/* ─────────────────────────────────────────────────────────────
   Landing on v2 — 方格稿紙. Loaded by index.html after its own <style>,
   with tokens-v2.css before it. Reads tokens-v2.css only: no hex, no radius
   number, no font name in this file.

   This is the grid-paper.html trial made live: the same overrides, with the
   trial's own colour names swapped for --gp- roles, and its two URL toggles
   (?red=0, ?grid=tint) settled on their defaults — brand red on, grid on the
   white paper.

   index.html's markup and <style> are still written against v1 names
   (--paper, --line-chip, --link…), so the first block points those names at
   v2 roles. The rest re-dresses the page: blue rules on off-white, square
   corners, characters in 田字格, green tick and red pen for marks.
   ───────────────────────────────────────────────────────────── */

/* ── v1 names → v2 roles ──────────────────────────────────────── */
:root {
  --paper: var(--gp-bg);
  --paper-tint: var(--gp-bg-tint);
  --surface-raised: var(--gp-surface);
  --hatch-a: var(--gp-blue-50);
  --hatch-b: var(--gp-blue-100);
  --line: var(--gp-rule);
  --line-soft: var(--gp-rule-soft);
  --line-chip: var(--gp-rule-strong);
  --line-dark: var(--gp-rule-night);

  --ink: var(--gp-text);
  --ink-body: var(--gp-text-body);
  --ink-2: var(--gp-text-2);
  --ink-muted: var(--gp-text-muted);
  --on-ink: var(--gp-on-night);
  --on-ink-muted: var(--gp-on-night-muted);

  --accent: var(--gp-brand);
  --accent-fill: var(--gp-label);
  --link: var(--gp-label);
  --link-hover: var(--gp-label-deep);
  --link-tint: var(--gp-select-tint);
  --correct: var(--gp-correct);
  --wrong: var(--gp-wrong);
  --progress: var(--gp-rule-strong);
}

/* ── square corners, flat paper: nothing floats ───────────────── */
.btn, .btn--lg, .btn--invert, .card, .faq__a, .rail__card, .dm.hq, .hq .q,
.hq .chip, .hq .wc, .hq .wc-hint > *, .hq .dm-cta, .hq .dm__notice, .hq .dm__ri, .hq .mk,
.hq .seg, .hq .seg::before, .hq .pic, .chips span, .brand__mark, .hq .wc-side,
.hq .pair, .hq .sim, .shot-focus__x {
  border-radius: var(--gp-radius-card);
}
.hq .opt { border-radius: var(--gp-radius-opt); }
.hq .wc-hint > * { border-radius: 999px; }
.card:hover, .dm.hq :where(.opt, .chip, .wc, .mk, .sim, .wc-hint > *, .dm-cta--ghost) { box-shadow: none; }
@media (hover: hover) {
  .dm.hq :is(.opt, .mk, .sim):not(:disabled):hover { box-shadow: none; transform: none; border-color: var(--gp-label); background: var(--gp-select-tint); }
  .dm.hq .wc:not(.is-drag):hover { box-shadow: none; }
}

/* ── header ───────────────────────────────────────────────────── */
.hdr { border-bottom-color: var(--gp-rule-strong); }
.hdr.scrolled { border-bottom-color: var(--gp-rule-strong); box-shadow: none; }
.hdr__sec { border-left-color: var(--gp-rule-strong); }
/* 一二三 in red, as on the section eyebrows; the one in view at full strength */
.hdr__sec-step { color: var(--gp-brand); }
.hdr__sec-step.on { color: var(--gp-brand); }

/* buttons: brand red, one of its three places */
.btn, .hq .dm-cta { background: var(--gp-brand); color: var(--gp-on-brand); }
.btn:hover { background: var(--gp-brand-deep); color: var(--gp-on-brand); }
/* the second choice next to it (Join the waitlist): outlined, so Try it now stays the pick */
.btn.btn--line { background: var(--gp-surface); color: var(--gp-label); box-shadow: inset 0 0 0 var(--gp-w-hair) var(--gp-label); }
.btn.btn--line:hover { background: var(--gp-select-tint); color: var(--gp-label); }

/* ── hero: plain paper with the faintest ruled grid ───────────── */
.hero-band {
  background-color: var(--gp-bg);
  background-image: var(--gp-ruled);
  /* pitch and offset come from the script at the end of index.html, so the
     page's grid lines run straight through the cells of the 隨時隨地 line */
  background-size: var(--gp, var(--gp-pitch)) var(--gp, var(--gp-pitch));
  background-position: var(--gx, -1px) var(--gy, -1px);
  border-bottom: var(--gp-w-hair) solid var(--gp-rule-strong);
}
/* the Chinese line, one character to a cell, like a line written on 稿紙 */
.hero__cn {
  display: flex; flex-wrap: wrap; margin-top: 26px;
  font-family: var(--gp-font-kai); font-size: clamp(19px, 2.3vw, 30px); color: var(--gp-text); letter-spacing: 0;
}
.hero__cn > span {
  width: var(--gp-cell); height: var(--gp-cell); display: grid; place-items: center; line-height: 1;
  background: var(--gp-cross), var(--gp-surface);
  border: var(--gp-w-hair) solid var(--gp-rule-strong); margin-left: calc(-1 * var(--gp-w-hair));
}
.hero__cn > span:first-child { margin-left: 0; }
.hero__cn > span.p { background: var(--gp-surface); place-items: start; padding: .3em 0 0 .25em; }
.stats { border-top-color: var(--gp-rule-strong); }
.stats__l { color: var(--gp-label); font-weight: 600; }
.stats__n--han { font-family: var(--gp-font-kai); }

.hq__shot { background: none; border-radius: var(--gp-radius-card); }
.hq__phone { box-shadow: none; }

/* ── the belt: a row of cells ─────────────────────────────────── */
.bar { background: var(--gp-surface); border-bottom: var(--gp-w-hair) solid var(--gp-rule-strong); }
.bar__row > div { border-left-color: var(--gp-rule-strong); }
.bar .mono { color: var(--gp-label); font-weight: 600; letter-spacing: var(--gp-track-chip); }

/* ── section labels ───────────────────────────────────────────── */
/* the section eyebrow is red; every other label is blue */
.intro__eyebrow { color: var(--gp-brand); font-weight: 700; letter-spacing: var(--gp-track-eyebrow); }
.faq__cat {
  color: var(--gp-label); font-weight: 700; letter-spacing: var(--gp-track-eyebrow);
}

/* the three intro cards: index cards, a blue rule on top */
.card {
  background: var(--gp-surface); border: var(--gp-w-hair) solid var(--gp-rule-strong);
  border-top: var(--gp-w-head) solid var(--gp-rule-ink);
}
.card:hover { transform: none; border-color: var(--gp-label); background: var(--gp-bg); }

/* 一二三 in red, the PRACTICE / REVIEW / CARDS labels beside them in plain ink */
.feat__num { color: var(--gp-brand); }
.feat__kicker { color: var(--gp-text); font-weight: 700; letter-spacing: var(--gp-track-eyebrow); }

/* feature text: list lead-ins become short ruled marks */
.flist li::before { background: var(--gp-label); }
.feat__see { color: var(--gp-label); }

/* ── demos: answer sheet ──────────────────────────────────────── */
.dm.hq { background: var(--gp-surface); border-color: var(--gp-rule-strong); }
.dm-try { color: var(--gp-label); }
.dm-try svg { stroke: var(--gp-label); }
@keyframes breathe {
  0%, 100% { border-color: var(--gp-rule-strong); background: var(--gp-surface); }
  50%      { border-color: var(--gp-label); background: var(--gp-select-tint); }
}
.dm.hq :where(.opt, .chip, .wc, .mk, .sim, .wc-hint > *, .dm-cta--ghost) { background: var(--gp-surface); border-color: var(--gp-rule-strong); }
/* 鍵帽, as gp-opt in components-v2.css: the 3px bottom edge is what says "press" */
.hq .opt { background: var(--gp-surface); border-bottom-width: var(--gp-w-head); gap: 10px; min-height: var(--gp-opt-min-h); padding: 6px 12px 6px 9px; line-height: 1.5; }
.dm.hq .opt { font-size: var(--gp-fs-body); padding: 6px 12px 6px 9px; }
.hq .opt + .opt { margin-top: 6px; }
.hq .opt__k {
  width: var(--gp-opt-key); height: var(--gp-opt-key); display: grid; place-items: center;
  font-size: 14px; font-weight: 600; color: var(--gp-text-2); background: var(--gp-bg-tint); border-radius: var(--gp-radius-key);
}
.dm.hq .opt:not(:disabled, .is-right, .is-wrong):active { transform: translateY(1px); border-bottom-width: 2px; margin-bottom: 1px; }
/* colour only, never width: the hero animates these and nothing may shift */
.hq .opt.is-picked { border-color: var(--gp-label); background: var(--gp-select-tint); }
.hq .opt.is-picked .opt__k { background: var(--gp-label); color: var(--gp-on-fill); }
/* once marked, the key fills: green for right, red for wrong (as in the app) */
.hq .opt.is-right { border-color: var(--gp-correct); background: var(--gp-correct-tint); }
.hq .opt.is-right .opt__k { background: var(--gp-correct); color: var(--gp-on-fill); }
.hq .opt.is-right .opt__mark { color: var(--gp-correct); }
.hq .opt.is-wrong { border-color: var(--gp-wrong-edge); background: var(--gp-wrong-tint); }
.hq .opt.is-wrong .opt__k { background: var(--gp-wrong); color: var(--gp-on-fill); }
.hq .opt.is-wrong .opt__mark { color: var(--gp-wrong); }
.hq .expl { border-left-color: var(--gp-correct); }
.hq .expl b { color: var(--gp-correct); }
.hq .expl--wrong { border-left-color: var(--gp-wrong); }
.hq .expl--wrong b { color: var(--gp-wrong); }
.hq .a__tab { background: var(--gp-step-todo); border-radius: var(--gp-radius-card); }
.hq .a__tab i { background: var(--gp-step-done); }
.dm.hq .a__tab.is-cur { background: var(--gp-step-cur); }
.hq .dm-cta--ghost { color: var(--gp-label); border-color: var(--gp-label); background: var(--gp-surface); }
.hq .dm__ri.is-ok { border-color: var(--gp-correct); background: var(--gp-correct-tint); }
.hq .dm__ri.is-ok b { color: var(--gp-correct); }
.hq .dm__ri.is-no { border-color: var(--gp-wrong-edge); background: var(--gp-wrong-tint); }
.hq .slot { border-bottom-color: var(--gp-label); }
.hq .seg, .dm.hq .seg { background: var(--gp-select-tint); }
.hq .seg::before { box-shadow: none; border: var(--gp-w-hair) solid var(--gp-rule-strong); }

/* word cards: each character in a 田字格, its 注音格 beside it */
.dm.hq .wc { border-color: var(--gp-rule-strong); }
/* a little thickness: the 3px bottom edge of the 鍵帽, and the same on the
   right, so each card in the stack reads as card stock, not a flat outline */
.hq .wc { border-bottom-width: var(--gp-w-head); border-right-width: var(--gp-w-head); }
.hq .wc.is-lean { border-color: var(--gp-correct); }
.hq .wc.is-lean-l { border-color: var(--ink-muted); }
.dm.hq .wc__w { font-family: var(--gp-font-kai); font-weight: 400; padding-top: .75em; }
.dm.hq .wc__w .ch { margin-right: 6px; border: var(--gp-w-cell) solid var(--gp-rule-ink); }
/* the rule between 田字格 and 注音格 sits on the character cell; with 拼音 or
   無 picked there is no 注音, so the 注音格 and that rule go */
.dm.hq .wc__w .ch__h {
  width: 1.35em; height: 1.35em; display: grid; place-items: center; line-height: 1;
  background: var(--gp-cross); border-right: var(--gp-w-cell) solid var(--gp-rule-ink);
}
/* wide enough that the tone mark stays inside the cell */
.dm.hq .wc__w .ch__zy { margin-left: 0; align-self: stretch; height: auto; width: 2.1em; padding-right: .6em; box-sizing: border-box; }
.dm.hq .wc__w .ch__zy em { left: auto; right: .12em; margin-left: 0; }
.dm.hq .wc__w .ch__zy em.n { left: calc((100% - .6em) / 2); right: auto; }
.dm.hq .dm__scr:not(.ph-zy) .wc__w .ch__zy { display: none; }
.dm.hq .dm__scr:not(.ph-zy) .wc__w .ch__h { border-right: 0; }
/* 拼音 centred over the 田字格, clear of the top rule */
.dm.hq .wc__w .ch__py { width: calc(1.35em / .4); margin-bottom: .45em; }
.hq .wc-side--r { color: var(--gp-correct); }
.hq .wc-hint > :last-child { color: var(--gp-correct); border-color: var(--gp-correct); }

/* Weak Spots: the pair on the tint, 類似題 a plain row; the mistake list as a
   題目列表 — blue rule on top, the app's marks (dashed circle / green tick) */
.hq .pair { background: var(--gp-bg-tint); }
.hq .pair__s { border-top-color: var(--gp-rule-strong); }
.hq .mk { border: 0; border-bottom: var(--gp-w-hair) solid var(--gp-rule-strong); padding: 10px 6px; }
.hq .mk + .mk { margin-top: 0; }
.hq .dm__h + .mk, .hq .dm__h + * .mk:first-child { border-top: var(--gp-w-head) solid var(--gp-rule-ink); }
.hq .mk__mk { color: var(--gp-correct); }
.hq .mk__mk:not(.is-o)::before { border-color: var(--gp-text-muted); }
.hq .mk.is-done .mk__s b { color: var(--gp-correct); }
.hq .mk__s small { color: var(--gp-label); }

/* ── Screenshots ──────────────────────────────────────────────── */
.band { border-top: var(--gp-w-hair) solid var(--gp-rule-strong); border-bottom: var(--gp-w-hair) solid var(--gp-rule-strong); }
/* the phones stand straight on the tinted band: the dark bezel is contrast
   enough, so no backdrop card around each one */
.screens__shot { border: 0; background: none; padding: 0; }
.screens__img { box-shadow: none; }
.screens__dots button::before { border-radius: var(--gp-radius-card); }
.screens__dots button.is-on::before { background: var(--gp-label); }
.screens__edge { background: color-mix(in srgb, var(--gp-bg-tint) 70%, transparent); }

/* ── Coverage: the sentence written out on a row of cells ─────── */
.scope__tab { color: var(--gp-rule-strong); }
.scope__tab.is-on { color: var(--gp-label); }
.scope__tab:hover { color: var(--gp-text-muted); }
.scope__bar { background: var(--gp-rule); }
.scope__bar i { background: var(--gp-label); }
.scope__eg {
  display: flex; font-family: var(--gp-font-kai); font-weight: 400; line-height: 1;
  /* C is 18 characters; each cell is 1.6em wide less the shared 1px edge */
  font-size: min(36px, 100cqw / 29.5);
}
.scope__eg span {
  width: var(--gp-cell); height: var(--gp-cell); display: grid; place-items: center;
  background: var(--gp-cross), var(--gp-surface);
  border: var(--gp-w-hair) solid var(--gp-rule-strong); margin-left: calc(-1 * var(--gp-w-hair));
}
.scope__eg span:first-child { margin-left: 0; }
.scope__desc { margin-top: 16px; color: var(--gp-label); }

/* ── page grid ────────────────────────────────────────────────── */
/* the faint ruled grid on the white paper (Features, Coverage, Plans);
   the tinted bands (Screenshots, Quality) and FAQ stay plain */
body { background-image: var(--gp-ruled); background-size: var(--gp-pitch) var(--gp-pitch); background-position: -1px -1px; }
.band, .quality { background-color: var(--gp-bg-tint); }

/* ── Quality: 一二三四 in cells on a ruled line ───────────────── */
.rail::before, .rail::after { border-color: var(--gp-rule-strong); }
.rail::before { background: var(--gp-rule-strong); }
.rail__dot {
  border-radius: var(--gp-radius-card); border: var(--gp-w-hair) solid var(--gp-label); background: var(--gp-surface);
  font-family: var(--gp-font-kai); font-size: 21px; color: var(--gp-label);
}
.rail__btn:hover .rail__dot { border-color: var(--gp-label-deep); }
.rail__btn[aria-expanded="true"] .rail__dot { border-color: var(--gp-label-deep); color: var(--gp-label-deep); background: var(--gp-select-tint); }
.rail__card { border-color: var(--gp-rule-strong); }
.rail__bands span { color: var(--gp-label); }

/* ── Plans: three index cards, Premium on the tinted paper ─────── */
.plan {
  background: var(--gp-surface); border: var(--gp-w-hair) solid var(--gp-rule-strong);
  border-top: var(--gp-w-head) solid var(--gp-rule-ink); border-radius: var(--gp-radius-card);
}
.plan--paid { background: var(--gp-select-tint); border-color: var(--gp-label); border-top-color: var(--gp-rule-ink); }
.plan--paid .plan__name { color: var(--gp-label); }
.plan__get { border-bottom-color: var(--gp-rule); }
.plan__list li::before { color: var(--gp-label); }
.plan--paid .plan__list li::before { color: var(--gp-label); }
/* Before the Premium name: the app's gold 認證徽章 (VerifiedBadge on the student ID;
   art from web/ops/design/composites.js i-verified) */
.plan__mark { width: 24px; height: 24px; flex: none; filter: drop-shadow(0 .5px .5px color-mix(in srgb, var(--gp-premium-ink) 45%, transparent)); }

/* ── FAQ ──────────────────────────────────────────────────────── */
/* plain paper, no grid; the rule on top ends the grid above, as under .intro */
.faq { background: var(--gp-bg); border-top: var(--gp-w-hair) solid var(--gp-rule-strong); }
.faq__cat + .faq__item { border-top: var(--gp-w-head) solid var(--gp-rule-ink); }
.faq__item { border-bottom-color: var(--gp-rule-strong); }
.faq__q::after { border-color: var(--gp-label); }
.faq__a { border-color: var(--gp-rule-strong); background: var(--gp-surface); }

/* ── closing band + footer: blue-black ────────────────────────── */
.cta, .foot { background: var(--gp-night); }
.btn--invert { background: var(--gp-on-fill); color: var(--gp-night); }
.btn--invert:hover { background: var(--gp-bg); color: var(--gp-night); }
.cta__btns { display: flex; gap: 12px; flex-wrap: wrap; }
.btn--invert.btn--invert-line { background: transparent; color: var(--gp-on-fill); box-shadow: inset 0 0 0 var(--gp-w-hair) var(--gp-on-fill); }
.btn--invert.btn--invert-line:hover { background: color-mix(in srgb, var(--gp-on-fill) 12%, transparent); color: var(--gp-on-fill); }
/* the jpg ground shows as a box on the blue-black */
.cta__mark { display: none; }

/* Features intro (Raise your TOCFL band + the three cards) on plain paper, no
   grid; the grid starts with the detailed features below. .intro is a .wrap,
   so the paper is widened to the full page with a shadow and clipped to the
   side edges; the second shadow, 1px lower, is the rule between the two areas. */
.intro {
  background: var(--gp-bg);
  box-shadow: 0 0 0 100vmax var(--gp-bg), 0 1px 0 100vmax var(--gp-rule-strong);
  clip-path: inset(0 -100vmax -1px);
  padding-bottom: var(--gp-s20);
}
@media (max-width: 760px) { .intro { padding-bottom: var(--gp-s14); } }
