
/* Landing page (src/landing/page.ts). Approved mockup: docs/mockups/landing-flow.html.
   Layout: the approved ZSR editorial page (newsprint, ink, one vermilion accent). The day is told as one pen line running
   across the full width; five hand-drawn stations play in turn while an answer sheet travels along the line.
   Sketch primitives (pen, paper fill, open double-stroke limbs, ink wobble) are ported from dates-platform/src/lib/lineart (MIT). */
:root {
  --paper: #F4EFE4; --card: #FBF8F1; --ink: #1B1A17; --ink2: #3A3732; --muted: #6A655B;
  --rule: #CFC7B6; --accent: #B5371A; --ok: #2E6B3A; --hl: #F2D9A6; --accent-ink: #FFFFFF;
  --latin: 'Newsreader', Georgia, serif;
  --serif: 'Newsreader', Georgia, serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }  /* the hidden attribute wins over display rules (word popup, answers) */
body { background: var(--paper); color: var(--ink); font-family: var(--sans); margin: 0; line-height: 1.6; overflow-wrap: break-word; }
.wrap { max-width: 1152px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.k { font-size: 12px; font-weight: 700; letter-spacing: .06em; }
.muted { color: var(--muted); }
h1, h2, h3 { font-family: var(--serif); margin: 0; text-wrap: balance; letter-spacing: -0.02em; }
p { margin: 0; }
.mock-note { background: var(--hl); font-size: 13px; padding-block: 8px; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-block: 14px; border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.top nav { display: flex; gap: 20px; font-size: 14px; font-weight: 600; flex-wrap: wrap; }
.top a { color: inherit; text-decoration: none; }
.mast { text-align: center; padding-block: 22px 0; }
.mast .name { font-family: var(--latin); font-weight: 700; font-size: clamp(44px, 8vw, 96px); line-height: 1; letter-spacing: -0.035em; }
.dateline { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin-top: 14px; padding-block: 7px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); font-size: 12.5px; font-weight: 600; color: var(--ink2); }
.dateline span:first-child { text-align: left; } .dateline span:last-child { text-align: right; }
.dateline .mid { font-family: var(--latin); font-style: italic; font-weight: 400; font-size: 15px; color: var(--ink2); text-wrap: balance; }  /* the slogan */
html:not([lang="en"]):not([lang="vi"]) .dateline .mid { font-family: var(--serif); font-style: normal; }

.hero { max-width: 820px; margin: 0 auto; text-align: center; padding-block: 40px 34px; display: grid; gap: 18px; justify-items: center; }
.hero h1 { font-size: clamp(30px, 4.4vw, 50px); line-height: 1.3; font-weight: 900; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .rule { width: 56px; height: 0; border-top: 2px solid var(--accent); }
.hero .dek { font-family: var(--serif); font-size: 17.5px; line-height: 1.9; color: var(--ink2); max-width: 39em; }

/* the flow strip */
.flow-band { padding-top: 52px; }  /* lines stay inside the content width (2026-11-20) */
.flow-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; padding-block: 12px 6px; border-top: 1px solid var(--ink); }
.flow-head h2 { font-size: 22px; line-height: 1.3; }
.flow { display: grid; grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr) 34px minmax(0, 1fr) 34px minmax(0, 1fr) 34px minmax(0, 1fr); align-items: start; padding-block: 8px 26px; }
.st { display: grid; gap: 10px; min-width: 0; transition: opacity .4s; }
.st.idle { opacity: .42; }
.st svg { display: block; width: 100%; height: auto; color: var(--ink); overflow: hidden; }  /* hands and sleeves enter from below the frame */
.st svg text { font-family: var(--sans); }
.st .pp { fill: var(--paper); }
.st .cap { display: grid; gap: 4px; padding-top: 8px; border-top: 1px solid var(--rule); }
.st .cap .row { display: flex; align-items: baseline; gap: 8px; }
.st .num { font: 800 13px var(--sans); width: 24px; height: 24px; border: 1.5px solid var(--ink); border-radius: 50%; display: inline-grid; place-items: center; flex: none; transition: background .3s, color .3s, border-color .3s; }
.st.on .num { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.st h3 { font-size: 17px; line-height: 1.35; }
.st p { font-size: 13.5px; color: var(--ink2); line-height: 1.6; }
.st .t { font-size: 12px; font-weight: 700; color: var(--muted); }
.link { align-self: start; padding-top: 34%; }
.link svg { display: block; width: 100%; height: auto; overflow: visible; color: var(--ink); }

.flow-ctrl { display: flex; gap: 10px; align-items: center; padding-bottom: 18px; font-size: 13px; color: var(--muted); }
.flow-ctrl button { font: 600 13px var(--sans); background: transparent; color: var(--ink); border: 1px solid var(--ink); padding: 4px 12px; min-height: 32px; cursor: pointer; }

/* proof: the real screen */
/* lower sections: newspaper inside pages */
.sec { padding-block: 52px; }
.sec-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: baseline; gap: 14px; border-top: 1px solid var(--ink); padding-top: 12px; margin-bottom: 28px; }
.sec-head .no { font: italic 400 15px var(--latin); color: var(--muted); }
.sec-head h2 { font-size: clamp(24px, 3vw, 34px); line-height: 1.25; }
.sec-head .k { color: var(--muted); }
.lead-p { font-family: var(--serif); color: var(--ink2); font-size: 17px; line-height: 1.9; max-width: 34em; }

/* the real screen */
.proof { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px; align-items: start; }
.notes { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 16px; counter-reset: n; }
.notes li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; counter-increment: n; }
.notes li::before { content: counter(n); font: 800 13px var(--sans); width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--accent); color: var(--accent); display: grid; place-items: center; }
.notes b { display: block; font-size: 15.5px; }
.notes span { color: var(--ink2); font-size: 14.5px; }
.specimen { background: var(--card); border: 1px solid var(--rule); padding: 22px 24px; display: grid; gap: 14px; min-width: 0; position: relative; }
.specimen .en { font-family: var(--latin); }
.specimen h3 { font-family: var(--latin); font-size: 22px; letter-spacing: -0.01em; }
.para { font-family: var(--latin); font-size: 17px; line-height: 1.75; display: grid; grid-template-columns: 22px minmax(0, 1fr); margin: 0 0 12px; }
.para .pn { font: 600 11px var(--sans); color: var(--muted); padding-top: 6px; }
.passage { position: relative; }
.spec-top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.passage .w { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; border-bottom: 1.5px dotted var(--accent); line-height: inherit; }
.passage .w:hover, .passage .w.cur { background: var(--hl); }
.passage .w.looked { background: color-mix(in srgb, var(--hl) 55%, transparent); border-bottom-style: solid; }
.wordpop { position: absolute; z-index: 5; width: min(340px, calc(100% - 24px)); border: 1px solid var(--ink); background: var(--paper); padding: 12px 14px; box-shadow: 4px 4px 0 var(--ink); display: grid; gap: 6px; }
.wp-head { display: flex; align-items: baseline; gap: 8px; }
.wp-head .word { font: 700 20px var(--latin); }
.wp-x { margin-left: auto; background: none; border: 0; color: var(--ink); font: 400 22px/1 var(--latin); cursor: pointer; padding: 0 2px; }
.wp-en { font-size: 15.5px; }
.w { background: var(--hl); border-bottom: 2px dotted var(--accent); }
.wordpop .gloss { font-size: 20px; font-weight: 500; }
.opts { display: grid; gap: 6px; margin-top: 4px; }
.opt { text-align: left; font-size: 15px; line-height: 1.4; padding: 8px 12px; background: var(--card); color: var(--ink); border: 1px solid var(--rule); cursor: pointer; }
.opt:hover { border-color: var(--ink); }
.opt.right { border-color: var(--ok); color: var(--ok); font-weight: 700; }
.opt.wrong { text-decoration: line-through; color: var(--muted); }
.marks { border-left: 3px solid var(--accent); padding-left: 12px; font-size: 14px; display: grid; gap: 2px; font-family: var(--latin); }
.result { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: start; border: 1px dashed var(--rule); padding: 12px 14px; background: var(--paper); }
.result .score { font: 800 30px/1 var(--sans); color: var(--ok); font-variant-numeric: tabular-nums; }
.result .score small { font-size: 14px; color: var(--muted); }
.pin { position: absolute; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font: 800 12px/22px var(--sans); text-align: center; }

/* levels: one ruler from Year 7 to the exam */
.ruler { display: grid; grid-template-columns: 2fr 3fr 3fr 2fr 1fr; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.yr { padding: 14px 14px 16px; display: grid; gap: 8px; align-content: start; min-width: 0; }
.yr + .yr { border-left: 1px solid var(--rule); }
.yr .y { font: 700 30px/1 var(--latin); }
.ticks { display: flex; gap: 4px; }
.ticks span { flex: 1; display: grid; gap: 4px; min-width: 0; }
.ticks i { display: block; height: 8px; background: var(--ink); }
.ticks em { font: 600 11.5px var(--latin); font-style: normal; color: var(--ink2); letter-spacing: .02em; }
.yr.exam .ticks i { background: var(--accent); }
.yr.exam .ticks em { color: var(--accent); font-weight: 700; }
.yr p { font-size: 13.5px; color: var(--ink2); }
.yr .len { font-size: 12px; font-weight: 700; color: var(--muted); }
.auto { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 22px; }
.auto div { display: grid; gap: 4px; }
.auto b { font: 800 26px/1 var(--sans); font-variant-numeric: tabular-nums; }
.auto span { font-size: 14px; color: var(--ink2); }

/* what they read: three newspaper columns */
.cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--ink); }
.col { padding: 16px 20px 6px; display: grid; gap: 10px; align-content: start; min-width: 0; }
.col:first-child { padding-left: 0; } .col:last-child { padding-right: 0; }
.col + .col { border-left: 1px solid var(--rule); }
.col h3 { font-size: 21px; }
.col .big { font: 800 36px/1 var(--sans); font-variant-numeric: tabular-nums; }
.col .big small { font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 4px; }
.col p { font-size: 14.5px; color: var(--ink2); }
.read-notes { display: none; }  /* phones only (see the media query) */
.shelf { display: grid; border-top: 1px solid var(--rule); }
.shelf div { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--rule); font-size: 14px; }
.shelf b { font-family: var(--latin); font-size: 16px; font-weight: 700; }
.shelf .by { color: var(--muted); font-size: 13px; white-space: nowrap; }
.tag { font-size: 11px; font-weight: 700; padding: 1px 7px; border: 1px solid var(--ink); white-space: nowrap; align-self: center; }
.tag.red { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* for parents */
.parent { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 44px; align-items: start; }
.checks { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 12px; }
.checks li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; font-size: 15px; color: var(--ink2); }
.checks li::before { content: "✓"; color: var(--ok); font-weight: 800; }
.report { background: var(--card); border: 1px solid var(--rule); padding: 20px 22px; display: grid; gap: 12px; }
.report .row { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 9px; border-bottom: 1px solid var(--rule); font-size: 14px; }
.report .row b { font-variant-numeric: tabular-nums; }
.report .note { font-family: var(--serif); font-size: 15.5px; line-height: 1.8; background: var(--paper); padding: 12px 14px; border-left: 3px solid var(--ink); }

/* questions */
.faq { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; }
.faq details { border-top: 1px solid var(--rule); padding-block: 14px; }
.faq summary { cursor: pointer; font-weight: 700; font-size: 15.5px; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 400 20px/1 var(--latin); color: var(--muted); }
.faq details[open] summary::after { content: "−"; }
.faq p { margin-top: 8px; font-size: 14.5px; color: var(--ink2); }

/* start, quietly */
.start { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 40px; align-items: start; }
.signin { display: grid; gap: 10px; max-width: 360px; }
.signin button { display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 0 16px; background: var(--card); color: var(--ink); border: 1px solid var(--rule); font: 600 15px var(--sans); cursor: pointer; text-align: left; }
.signin button:hover { border-color: var(--ink); }
.signin .fine { font-size: 13px; color: var(--muted); }

@media (max-width: 900px) {
  .proof, .parent, .start, .faq { grid-template-columns: minmax(0, 1fr); }
  .ruler { grid-template-columns: minmax(0, 1fr); } .yr + .yr { border-left: 0; border-top: 1px solid var(--rule); }
  .cols { grid-template-columns: minmax(0, 1fr); } .col { padding-inline: 0; } .col + .col { border-left: 0; border-top: 1px solid var(--rule); }
  .auto { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .dateline { grid-template-columns: 1fr; text-align: center; gap: 2px; } .dateline span:first-child, .dateline span:last-child { text-align: center; }
  .proof { grid-template-columns: minmax(0, 1fr); }
  .flow { grid-template-columns: minmax(0, 1fr); max-width: 460px; margin: 0 auto; }
  .link { padding-top: 0; width: 34px; height: 44px; margin-block: 6px 10px; justify-self: center; display: grid; place-items: center; }
  .link svg { transform: rotate(90deg); }
  /* phones: each scene's caption comes first, then its picture; scenes play one by one as they scroll in */
  .st { gap: 12px; }
  .st .cap { order: -1; border-top: 0; padding-top: 0; }
  .st svg { border-top: 1px solid var(--rule); padding-top: 6px; }
  .flow-ctrl { display: none; }
  /* phones: section side labels (Monday to Friday …) are hidden so each heading gets the full width */
  .flow-head > .k, .sec-head > .k { display: none; }
  .sec-head { grid-template-columns: auto minmax(0, 1fr); }
  /* phones: in No. 2 the sample screen comes first, then the numbered notes that explain it */
  #proof .specimen { order: -1; }
  /* phones: No. 3 as a compact table, one row per year, so all eleven levels fit on one screen */
  .yr { grid-template-columns: 50px minmax(0, 1fr) auto; grid-template-areas: "y ticks len" "y p p"; column-gap: 12px; row-gap: 4px; padding: 10px 0; align-items: center; }
  .yr .y { grid-area: y; font-size: 22px; align-self: start; padding-top: 1px; }
  .yr .ticks { grid-area: ticks; }
  .yr .ticks i { height: 6px; }
  .yr .ticks em { font-size: 10.5px; }
  .yr .len { grid-area: len; font-size: 11.5px; white-space: nowrap; align-self: start; }
  .yr p { grid-area: p; font-size: 13px; line-height: 1.5; }
  .auto { grid-template-columns: max-content minmax(0, 1fr); gap: 8px 14px; margin-top: 16px; align-items: baseline; }
  .auto div { display: contents; }
  .auto b { font-size: 18px; white-space: nowrap; }
  /* phones: No. 4 as three KPI figures side by side; the descriptions and title lists stay on wide screens */
  .cols { grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--ink); }
  .col, .col:first-child, .col:last-child { padding: 14px 6px 12px; gap: 6px; text-align: center; justify-items: center; }
  .col + .col { border-top: 0; border-left: 1px solid var(--rule); }
  .col .big { font-size: 30px; }
  .col .big small { display: block; margin: 4px 0 0; font-size: 11.5px; }
  .col h3 { font-size: 13.5px; line-height: 1.35; font-family: var(--sans); font-weight: 700; color: var(--ink2); }
  .col p, .col .shelf { display: none; }
  .read-notes { display: grid; gap: 12px; margin: 16px 0 0; }
  .read-notes div { display: grid; gap: 2px; }
  .read-notes dt { font-weight: 700; font-size: 14.5px; }
  .read-notes dd { margin: 0; font-size: 13.5px; color: var(--ink2); line-height: 1.6; }
  .auto span { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) { .st { transition: none; } }

/* interface fonts per language; English study text keeps Newsreader (--latin) */
html[lang="ko"] { --serif: 'Noto Serif KR', 'Newsreader', serif; --sans: 'Noto Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif; }
html[lang="ja"] { --serif: 'Hiragino Mincho ProN', 'Yu Mincho', 'Noto Serif JP', serif; --sans: 'Hiragino Sans', 'Yu Gothic', 'Noto Sans JP', Meiryo, sans-serif; }
html[lang="zh-Hans"] { --serif: 'Songti SC', 'Noto Serif SC', SimSun, serif; --sans: 'PingFang SC', 'Noto Sans SC', 'Microsoft YaHei', sans-serif; }
html[lang="zh-Hant"] { --serif: 'Songti TC', 'Noto Serif TC', PMingLiU, serif; --sans: 'PingFang TC', 'Noto Sans TC', 'Microsoft JhengHei', sans-serif; }
html[lang="th"] { --serif: 'Noto Serif Thai', Thonburi, serif; --sans: 'Noto Sans Thai', Thonburi, 'Leelawadee UI', sans-serif; }
html[lang="th"] body { line-height: 1.75; }
html[lang="ko"] body { word-break: keep-all; overflow-wrap: anywhere; }  /* Korean breaks between words; CJK/Thai keep normal breaking */
html[lang="en"] .hero h1, html[lang="vi"] .hero h1 { font-family: var(--latin); letter-spacing: -0.015em; }
html[lang="en"] .sec-head h2, html[lang="vi"] .sec-head h2, html[lang="en"] .flow-head h2, html[lang="vi"] .flow-head h2 { font-family: var(--latin); }
/* meanings shown in their own script inside the word pop-up */
.wordpop .gloss[lang="ja"] { font-family: 'Hiragino Sans', 'Yu Gothic', 'Noto Sans JP', sans-serif; }
.wordpop .gloss[lang="th"] { font-family: 'Noto Sans Thai', Thonburi, sans-serif; }
/* header language picker and the small family sign-in link */
.langpick { display: inline-flex; align-items: center; gap: 6px; }
.langpick select { font: 600 13px var(--sans); color: var(--ink); background: var(--card); border: 1px solid var(--rule); padding: 4px 8px; min-height: 30px; }
.signin button[aria-disabled="true"] { cursor: default; }
.family-link { font-size: 13px; color: var(--muted); }
.family-link a { color: inherit; }
.flow-head .no-inline { font: italic 400 15px var(--latin); color: var(--muted); margin-right: 12px; }

.langpick .globe { color: var(--ink); flex: none; }

:root { color-scheme: only light; }  /* light theme only: no dark mode, and browsers may not auto-darken the page */
/* waitlist entry points (mockup docs/mockups/waitlist.html screen A) */
.hero .cta-note { margin: 4px 0 0; font-size: 13px; font-weight: 700; color: var(--accent); }
.ctas { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.cta { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; background: var(--ink); color: var(--paper); font: 700 15px var(--sans); text-decoration: none; border: 1px solid var(--ink); }
.cta.ghost { background: transparent; color: var(--ink); }
.cta:hover { opacity: .9; }
.signin .cta { justify-self: start; }

