/* DAILY: white, calm, premium-app feel. Newsreader (serif) for headlines and key statements,
   DM Sans for everything else. Most sections sit on white with hairline dividers; five very pale
   tints mark the moments that matter (highlight, lesson, application, reflection, prayer). */
:root {
  --bg: #FFFFFF;
  --off: #F8F9FA;
  --ink: #172033;
  --body: #2E394D;
  --muted: #667085;
  --line: #E8EBEF;
  --green: #355747;        /* primary buttons, links */
  --green-hover: #2A463A;
  --on-green: #FFFFFF;

  --t-story: #EDF6FC;      /* story highlight */
  --t-lesson: #F1F6EA;     /* the lesson */
  --t-apply: #FCF1F2;      /* for your life today */
  --t-reflect: #F5F0FC;    /* something to think about */
  --t-prayer: #F2F7F3;     /* prayer */
  --c-lesson: #3F6B2E;
  --c-apply: #A83E4C;
  --c-reflect: #66419F;
  --c-prayer: #355747;

  --serif: "Newsreader", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--body);
  font-family: var(--sans); font-size: 1.0625rem; line-height: 1.7;
  padding-left: max(22px, env(safe-area-inset-left, 0px));
  padding-right: max(22px, env(safe-area-inset-right, 0px));
  padding-block: 6px 64px;
  overflow-x: hidden;
}
body[data-view="home"] { padding-bottom: 0; }
.wrap { width: 100%; max-width: 38rem; margin-inline: auto; }
h1, h2, h3 { margin: 0; font-weight: 500; }
p { margin: 0; }
a { color: var(--green); text-underline-offset: 3px; }
strong { font-weight: 600; color: var(--ink); }
:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; border-radius: 8px; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---------- reading progress (results only) ---------- */
#progress { display: none; position: fixed; left: 0; right: 0; top: env(safe-area-inset-top, 0px); height: 3px; background: #EEF1F4; z-index: 30; }
body[data-view="result"] #progress { display: block; }
#progress-bar { height: 100%; width: 100%; background: #86B3D6; transform-origin: left center; transform: scaleX(0); }

/* ---------- top bar: wordmark left on home, centered with a back arrow on results ---------- */
.top { display: grid; grid-template-columns: 1fr; align-items: center; min-height: 68px; }
.brand { justify-self: start; font-family: var(--serif); font-weight: 500; font-size: 2rem; letter-spacing: -.01em; color: var(--ink); background: none; border: 0; padding: 10px 0; cursor: pointer; line-height: 1; }
.back { display: none; width: 44px; height: 44px; align-items: center; justify-content: center; color: var(--ink); background: none; border: 0; padding: 0; margin-left: -10px; cursor: pointer; border-radius: 12px; }
body[data-view="result"] .top, body[data-view="notice"] .top { grid-template-columns: 44px 1fr 44px; }
body[data-view="result"] .back, body[data-view="notice"] .back { display: inline-flex; grid-column: 1; grid-row: 1; }
body[data-view="result"] .brand, body[data-view="notice"] .brand { grid-column: 2; grid-row: 1; justify-self: center; font-size: 1.5rem; }
.stack { display: flex; flex-direction: column; gap: 32px; }

/* ---------- home ---------- */
.hero { display: flex; flex-direction: column; align-items: stretch; text-align: left; gap: 0; padding-top: 28px; }
.kicker { font-size: .78rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.hero h1 { font-family: var(--serif); font-size: clamp(2.7rem, 12vw, 3.6rem); line-height: 1.08; letter-spacing: -.015em; margin-top: 36px; max-width: 12ch; color: var(--ink); }
.hero .sub { font-family: var(--serif); font-size: 1.4rem; line-height: 1.4; color: var(--muted); margin-top: 20px; max-width: 22rem; }
.search { display: flex; flex-direction: column; gap: 16px; width: 100%; margin-top: 36px; }
.field { position: relative; }
.field-ico { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input {
  width: 100%; min-height: 66px; padding: 14px 20px 14px 56px;
  font: inherit; font-size: 1.15rem; color: var(--ink);
  background: #FFFFFF; border: 1px solid #DADFE5; border-radius: 20px;
  box-shadow: 0 1px 2px rgba(23, 32, 51, .04), 0 6px 20px rgba(23, 32, 51, .05);
  -webkit-appearance: none; appearance: none;
}
.search input::placeholder { color: #727C8E; }
.search input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 4px rgba(53, 87, 71, .15); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 60px; padding: 14px 24px; font: inherit; font-weight: 500; font-size: 1.05rem; border-radius: 20px; border: 0; cursor: pointer; text-decoration: none; }
.btn-primary { background: var(--green); color: var(--on-green); justify-content: space-between; padding-inline: 28px 24px; }
.btn-primary span { flex: 1; text-align: center; margin-right: -20px; }
.btn-primary:hover { background: var(--green-hover); }
.btn-soft { background: #F2F4F6; color: var(--ink); font-size: .98rem; min-height: 56px; padding: 12px 16px; gap: 10px; border-radius: 18px; }
.btn-soft:hover { background: #E8ECEF; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { font: inherit; font-size: 1rem; min-height: 44px; padding: 8px 20px; cursor: pointer; background: #fff; color: var(--ink); border: 1px solid #DADFE5; border-radius: 999px; }
.chip:hover { border-color: var(--green); color: var(--green); }
.tagline { text-align: center; font-size: .98rem; line-height: 1.55; color: var(--ink); margin-top: 44px; }
.art { margin: 36px -22px 0; line-height: 0; overflow: hidden; }
.landscape { display: block; width: 100%; height: clamp(230px, 56vw, 340px); }

/* notices */
.notice { background: var(--off); border-radius: 22px; padding: 30px 24px; display: flex; flex-direction: column; gap: 16px; }
.notice h2 { font-family: var(--serif); font-size: 1.8rem; line-height: 1.2; color: var(--ink); }

/* ---------- results: opening ---------- */
#result .stack { gap: 0; }
.opening { display: flex; flex-direction: column; align-items: flex-start; gap: 0; padding-top: 12px; }
.word-label { font-size: .8rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink); background: var(--t-story); padding: 7px 16px; border-radius: 12px; }
.opening h1 { font-family: var(--serif); font-size: clamp(2.5rem, 10.5vw, 3.3rem); line-height: 1.1; letter-spacing: -.015em; color: var(--ink); margin-top: 22px; text-wrap: balance; }
.person { font-size: 1.15rem; font-weight: 500; color: var(--ink); margin-top: 18px; }
.scripture { display: flex; flex-direction: column; gap: 2px; margin-top: 2px; }
.scripture .label { display: none; }
.scripture .main { font-size: .98rem !important; color: var(--muted); line-height: 1.5 !important; }
.scripture a { font-size: .92rem; }
.scripture .fine { font-size: .86rem !important; line-height: 1.55 !important; color: var(--muted); margin-top: 8px; }
.scripture ul { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: .9rem; }
.scripture li span { color: var(--muted); }
.matched { font-size: .92rem; color: var(--muted); margin-top: 14px; }

.intro { display: flex; flex-direction: column; gap: 18px; margin-top: 40px; padding-bottom: 12px; }
.intro p, .sec p, .close p { font-size: 1.0625rem; line-height: 1.75; }
.intro p:first-child { font-family: var(--serif); font-size: 1.4rem; line-height: 1.4; font-weight: 500; color: var(--ink); }

/* ---------- results: sections ---------- */
.card { display: flex; flex-direction: column; }
.sec, .close { display: flex; flex-direction: column; gap: 16px; padding-block: 40px; border-top: 1px solid var(--line); }
.sec h3, .reflect h3, .close h2 { display: flex; align-items: center; gap: 12px; font-family: var(--sans); font-size: .8rem; font-weight: 600; letter-spacing: .13em; text-transform: uppercase; line-height: 1.3; color: var(--label, var(--ink)); }
.ico { flex: none; width: 24px; height: 24px; }
.sec.story { border-top: 0; padding-top: 24px; }
.sec.story p:first-of-type { font-family: var(--serif); font-size: 1.45rem; line-height: 1.4; font-weight: 500; color: var(--ink); }

.tag { align-self: flex-start; font-size: .8rem; font-weight: 500; padding: 4px 12px; border-radius: 999px; background: #F2F4F6; color: var(--muted); }
.tag.direct { background: var(--t-lesson); color: var(--c-lesson); }

/* important moment: pale blue highlight */
.intro p.pull, .sec p.pull {
  position: relative; background: var(--t-story); border-radius: 18px; padding: 20px 22px 20px 64px; margin-block: 4px;
  font-family: var(--serif); font-size: 1.3rem; line-height: 1.4; font-weight: 500; color: var(--ink);
}
.intro p.pull::before, .sec p.pull::before {
  content: ""; position: absolute; left: 20px; top: 20px; width: 28px; height: 28px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 28'%3E%3Ccircle cx='14' cy='14' r='14' fill='%23D6E7F4'/%3E%3Cpath d='M9.500 18c0-3 1.100-4.900 3.300-5.900l.7 1.200c-1.200.600-1.800 1.400-1.900 2.400H13.500V18zM15.500 18c0-3 1.100-4.900 3.300-5.900l.7 1.200c-1.200.600-1.800 1.400-1.900 2.400H19.500V18z' fill='%235B8DB5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.quote { display: flex; flex-direction: column; gap: 6px; padding-left: 4px; font-family: var(--serif); font-style: italic; font-size: 1.25rem; line-height: 1.4; color: var(--muted); }

/* tinted panels */
.sec.lesson, .sec.application, .reflect, .close.prayer { border-top: 0; border-radius: 22px; padding: 30px 24px 32px; margin-block: 14px; }
.sec.lesson { --label: var(--c-lesson); background: var(--t-lesson); }
.sec.application { --label: var(--c-apply); background: var(--t-apply); }
.reflect { --label: var(--c-reflect); background: var(--t-reflect); }
.close.prayer { --label: var(--c-prayer); background: var(--t-prayer); }
.sec.lesson + .sec.application { margin-top: 14px; }

/* the lesson: the central statement is large, with a short green rule */
.sec.lesson p.pull { background: none; padding: 0; margin: 2px 0 6px; font-size: 1.6rem; line-height: 1.3; font-weight: 600; }
.sec.lesson p.pull::before { display: none; }
.sec.lesson p.pull::after { content: ""; display: block; width: 32px; height: 2px; background: var(--c-lesson); margin-top: 16px; }
/* application: closing statement stands out with a rose rule */
.sec.application > p:last-child { font-family: var(--serif); font-size: 1.4rem; line-height: 1.35; font-weight: 600; color: var(--ink); margin-top: 6px; }
.sec.application > p:last-child::after { content: ""; display: block; width: 32px; height: 2px; background: var(--c-apply); margin-top: 16px; }

/* reflection: one question with room around it */
.reflect { text-align: center; padding-block: 36px 44px; gap: 0; display: flex; flex-direction: column; align-items: center; }
.reflect h3 { justify-content: center; }
.reflect p { font-family: var(--serif); font-style: italic; font-size: 1.65rem; line-height: 1.4; font-weight: 400; color: var(--ink); margin-top: 26px; max-width: 28rem; text-wrap: balance; }

.close.prayer p { font-size: 1.0625rem; line-height: 1.8; }
.close.prayer p:last-child { font-family: var(--serif); font-style: italic; font-size: 1.3rem; }

.readfull ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.readfull li { font-size: 1rem; line-height: 1.55; }
.readfull li span { display: block; color: var(--muted); font-size: .92rem; }
.actions { display: grid; grid-template-columns: 1.55fr 1fr; gap: 12px; width: 100%; margin-top: 28px; }
.fineprint { font-size: .88rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 24px; margin-top: 40px; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); width: min(92vw, 28rem); background: var(--ink); color: #FFFFFF; padding: 16px 20px; border-radius: 18px; font-weight: 500; text-align: center; z-index: 40; box-shadow: 0 10px 30px rgba(23, 32, 51, .22); }
.linkbox { width: 100%; margin-top: 8px; padding: 10px 12px; font: inherit; font-size: .95rem; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); }

@media (min-width: 640px) {
  body { font-size: 1.125rem; }
  .intro p, .sec p, .close p, .close.prayer p { font-size: 1.125rem; }
  .art { margin-inline: 0; border-radius: 28px; }
  .sec.lesson, .sec.application, .reflect, .close.prayer { padding-inline: 36px; }
}
@media (prefers-reduced-motion: no-preference) {
  .fade { animation: fade .5s ease-out both; }
  @keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}
