/* "Coach" design system — tokens, fonts, reset, type and icons.
   Warm paper, solid colour blocks, chunky controls. Light and dark (STORY-04.49): every colour the app draws is a token in
   this file; the light set in :root, the dark set for `prefers-color-scheme: dark` (unless <html data-theme="light">) and
   for <html data-theme="dark">. A brand direction changes this file (and public/fonts/) and nothing else.
   Spacing scale: 4 8 12 16 24 32 48 64. Radii: 10 16 24. Icons: Lucide, 2px stroke, 16/20/24.
   Colour rules: teal = the path and the next action; yellow = things earned (streak, XP, badges,
   countdown); coral = errors and weak spots. Solid colour, never a gradient (the scene drawings excepted). */
/* ---------- Fonts (self-hosted, SIL OFL 1.1; copied by `npm run vendor`) ---------- */
@font-face {
  font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("../fonts/bricolage-grotesque-latin-opsz-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("../fonts/bricolage-grotesque-latin-ext-opsz-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Hanken Grotesk"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/hanken-grotesk-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Hanken Grotesk"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/hanken-grotesk-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Hanken Grotesk"; font-style: italic; font-weight: 100 900; font-display: swap;
  src: url("../fonts/hanken-grotesk-latin-wght-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Hanken Grotesk"; font-style: italic; font-weight: 100 900; font-display: swap;
  src: url("../fonts/hanken-grotesk-latin-ext-wght-italic.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Tokens ---------- */
/* ROLES: the pairs tests/theme-contrast.test.mjs checks in every set (light, dark, each with prefers-contrast: more).
   One role per line, `role: foreground on background, background, …`. text 4.5:1; large 3:1 (24 px, or 18.66 px bold);
   focus, edge and mark 3:1 (the focus outline, a control's only edge, a state mark against what it sits on).
   Dividers (--line, --line-2), shadows and scrims are decoration and are not checked; the scene drawings' colours are fixed.
   text: --ink on --paper, --paper-2, --surface, --exam-bg, --exam-pane, --teal-tint, --sun-tint, --coral-tint
   text: --ink-2 on --paper, --paper-2, --surface, --exam-bg, --teal-tint
   text: --teal on --paper, --paper-2, --surface, --exam-bg, --teal-tint
   text: --teal-deep on --surface, --teal-tint
   text: --sun-ink on --sun-tint, --surface
   text: --coral-deep on --coral-tint, --surface
   text: --coral-ink on --coral-tint, --surface
   text: --on-fill on --teal, --coral-deep, --ink, --sun-ink
   text: --on-teal on --teal
   text: --surface on --teal
   text: --on-sun on --sun
   large: --coral on --surface
   focus: --focus on --paper, --paper-2, --surface, --exam-bg
   edge: --edge on --paper, --paper-2, --surface, --exam-bg
   mark: --line-strong on --surface, --paper, --exam-bg
   mark: --teal on --surface, --paper, --exam-bg
   mark: --edge on --teal-tint
*/
:root {
  color-scheme: light;
  /* paper and ink */
  --paper: #FAF5EA;
  --paper-2: #F1E9D8;
  --surface: #FFFDF8;
  --ink: #17231F;
  --ink-2: #4A5852;
  --line: #E4DAC6;
  --line-2: #CDC2AA;
  --line-strong: #857D6B;
  --edge: #857D6B;          /* the edge of a control whose edge is its only boundary: 3:1 on its surface */
  --focus: #17231F;         /* the focus outline */

  /* teal: the path and the next action */
  --teal: #0E5A4E;
  --teal-deep: #093F37;
  --teal-tint: #DDEEE8;
  --teal-soft: #BFE0D7;
  --teal-line: rgba(14, 90, 78, 0.22);
  --on-teal: #FFFDF8;       /* text and marks on a teal fill in the journey */
  /* sun: things earned */
  --sun: #FFC233;
  --sun-deep: #D69800;
  --sun-tint: #FFF0C2;
  --sun-ink: #7A5300;
  --on-sun: #17231F;        /* text on the sun fill (the avatar) */
  --coin-ink: #9A6B00;      /* the coin's inner ring */
  /* coral: errors and weak spots */
  --coral: #E4553F;
  --coral-deep: #B43420;
  --coral-ink: #8A2415;
  --coral-tint: #FBE2DB;
  /* text and marks on a solid fill (a right or wrong mark, a danger button) */
  --on-fill: #FFFFFF;
  --ink-lip: #000000;       /* the lip under an ink-faced button */

  /* exam mode: colour almost off */
  --exam-bg: #FDFBF6;
  --exam-pane: #F6F2E9;
  --exam-line: #DAD3C3;
  --exam-fill: #E4DED0;

  /* chart series */
  --c1: #0E5A4E; --c2: #D69800; --c3: #E4553F; --c4: #4A5852; --c5: #6FB3A4; --c6: #857D6B;

  /* the surface laid thinly over a solid fill (the teal cards' lines and dots) */
  --veil-25: rgba(255, 253, 248, 0.25);
  --veil-30: rgba(255, 253, 248, 0.3);
  --veil-38: rgba(255, 253, 248, 0.38);
  --veil-45: rgba(255, 253, 248, 0.45);
  --veil-60: rgba(255, 253, 248, 0.6);
  --ink-line: rgba(23, 35, 31, 0.2); /* a line in ink on a tinted card */
  /* shadows and scrims */
  --shade-06: rgba(23, 35, 31, 0.06);
  --shade-08: rgba(23, 35, 31, 0.08);
  --shade-10: rgba(23, 35, 31, 0.1);
  --shade-12: rgba(23, 35, 31, 0.12);
  --shade-18: rgba(23, 35, 31, 0.18);
  --shade-30: rgba(23, 35, 31, 0.3);
  --knob-shadow: rgba(0, 0, 0, 0.2);
  --scrim: rgba(23, 35, 31, 0.5);        /* behind a dialog */
  --scrim-deep: rgba(23, 35, 31, 0.52);  /* behind a sheet or a text opened whole */
  --scrim-wall: rgba(23, 35, 31, 0.45);  /* behind the badge wall */
  --scrim-menu: rgba(23, 35, 31, 0.16);  /* under an open Study or Library menu */
  --scrim-pop: rgba(23, 35, 31, 0.32);   /* behind the work pop-up (owner, 2026-11-22: more dim) */
  --scrim-blur: 10px;                    /* and more blur (owner, 2026-11-22) */
  /* the scene drawings (blocks.js): fixed colours in both sets, so a drawn scene reads the same */
  --scene-label: rgb(255 255 255 / 85%);
  --scene-ink: #17231F;
  --scene-park: linear-gradient(#bfe3ff 0 42%, #9bd18b 42% 100%);
  --scene-street: linear-gradient(#cfe6fb 0 40%, #d9d4cc 40% 62%, #8d8f94 62% 100%);
  --scene-office: linear-gradient(#eef0f4 0 62%, #c8b8a2 62% 100%);
  --scene-kitchen: linear-gradient(#fbf3e2 0 60%, #d8c3a5 60% 100%);
  --scene-beach: linear-gradient(#aee0ff 0 38%, #5cb8e6 38% 55%, #f1dfae 55% 100%);
  --scene-classroom: linear-gradient(#f3f0e6 0 58%, #c9b79c 58% 100%);
  --scene-market: linear-gradient(#d4ecff 0 34%, #f0e2c4 34% 100%);
  --scene-airport: linear-gradient(#e8eef5 0 55%, #b9c2cf 55% 100%);
  --scene-plain: linear-gradient(#f2f4f7, #e6e9ee);
  /* a select's chevron, in --ink-2 (a picture cannot read a token) */
  --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234A5852' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");

  /* spacing */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
  /* radii */
  --r-s: 10px; --r-m: 16px; --r-l: 24px;
  /* the one container (SN :138-139): the bar's row, the page and the footer's row; backgrounds run the full width */
  --page-max: 1360px;
  --gutter: 32px;
  --bar-h: 64px;

  /* type */
  --display: "Bricolage Grotesque", "Trebuchet MS", system-ui, sans-serif;
  --text: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fs-xs: 0.8125rem;   /* 13 — eyebrows, table heads */
  --fs-s: 0.875rem;     /* 14 — notes */
  --fs-m: 0.9375rem;    /* 15 — secondary text */
  --fs-base: 1rem;      /* 16 */
  --fs-l: 1.0625rem;    /* 17 — h3, reading */
  --fs-xl: 1.125rem;    /* 18 — ledes, passages */
  --fs-2xl: 1.375rem;   /* 22 — h2 */
  --fs-3xl: clamp(2rem, 1.55rem + 1.7vw, 2.75rem); /* h1 */

  /* shadows: a lip under chunky things, one soft shadow for things that float */
  --lip: 0 4px 0;
  --lip-pressed: 0 1px 0;
  --float: 0 18px 48px rgba(23, 35, 31, 0.22);

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --pick: var(--teal);        /* colour of a chosen answer; ink in exam mode */
  --pick-ink: var(--surface);
}
@media (max-width: 860px) {
  :root { --gutter: 16px; --bar-h: 60px; }
}

/* The dark set: the system's dark scheme unless the page asks for light, or <html data-theme="dark"> (forced, for checks). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23B1C0B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    --paper: #0D1512; --paper-2: #1A2621; --surface: #131D19; --ink: #E9F1EC; --ink-2: #B1C0B8;
    --line: #24322C; --line-2: #364840; --line-strong: #6D8379; --edge: #7C9187; --focus: #E9F1EC;
    --teal: #5CCBB0; --teal-deep: #8FE0CA; --teal-tint: #18261F; --teal-soft: #2A3B33; --teal-line: rgba(92, 203, 176, 0.24); --on-teal: #06231D;
    --sun: #FFC233; --sun-deep: #E0A82E; --sun-tint: #2E2814; --sun-ink: #FFD978; --on-sun: #2E2000; --coin-ink: #8A5F00;
    --coral: #F19A86; --coral-deep: #F4A897; --coral-ink: #F7B9AA; --coral-tint: #3A1F19;
    --on-fill: #06231D; --ink-lip: #6D8379;
    --exam-bg: #131D19; --exam-pane: #1A2621; --exam-line: #364840; --exam-fill: #24322C;
    --c1: #5CCBB0; --c2: #E0A82E; --c3: #F19A86; --c4: #B1C0B8; --c5: #6FB3A4; --c6: #8D9E96;
    --veil-25: rgba(19, 29, 25, 0.25); --veil-30: rgba(19, 29, 25, 0.3); --veil-38: rgba(19, 29, 25, 0.38); --veil-45: rgba(19, 29, 25, 0.45); --veil-60: rgba(19, 29, 25, 0.6);
    --ink-line: rgba(233, 241, 236, 0.2);
    --shade-06: rgba(0, 0, 0, 0.2); --shade-08: rgba(0, 0, 0, 0.24); --shade-10: rgba(0, 0, 0, 0.28); --shade-12: rgba(0, 0, 0, 0.3); --shade-18: rgba(0, 0, 0, 0.4); --shade-30: rgba(0, 0, 0, 0.5);
    --knob-shadow: rgba(0, 0, 0, 0.5);
    --scrim: rgba(0, 0, 0, 0.6); --scrim-deep: rgba(0, 0, 0, 0.62); --scrim-wall: rgba(0, 0, 0, 0.58); --scrim-menu: rgba(0, 0, 0, 0.42); --scrim-pop: rgba(0, 0, 0, 0.5);
    --float: 0 18px 48px rgba(0, 0, 0, 0.6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23B1C0B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  --paper: #0D1512; --paper-2: #1A2621; --surface: #131D19; --ink: #E9F1EC; --ink-2: #B1C0B8;
  --line: #24322C; --line-2: #364840; --line-strong: #6D8379; --edge: #7C9187; --focus: #E9F1EC;
  --teal: #5CCBB0; --teal-deep: #8FE0CA; --teal-tint: #18261F; --teal-soft: #2A3B33; --teal-line: rgba(92, 203, 176, 0.24); --on-teal: #06231D;
  --sun: #FFC233; --sun-deep: #E0A82E; --sun-tint: #2E2814; --sun-ink: #FFD978; --on-sun: #2E2000; --coin-ink: #8A5F00;
  --coral: #F19A86; --coral-deep: #F4A897; --coral-ink: #F7B9AA; --coral-tint: #3A1F19;
  --on-fill: #06231D; --ink-lip: #6D8379;
  --exam-bg: #131D19; --exam-pane: #1A2621; --exam-line: #364840; --exam-fill: #24322C;
  --c1: #5CCBB0; --c2: #E0A82E; --c3: #F19A86; --c4: #B1C0B8; --c5: #6FB3A4; --c6: #8D9E96;
  --veil-25: rgba(19, 29, 25, 0.25); --veil-30: rgba(19, 29, 25, 0.3); --veil-38: rgba(19, 29, 25, 0.38); --veil-45: rgba(19, 29, 25, 0.45); --veil-60: rgba(19, 29, 25, 0.6);
  --ink-line: rgba(233, 241, 236, 0.2);
  --shade-06: rgba(0, 0, 0, 0.2); --shade-08: rgba(0, 0, 0, 0.24); --shade-10: rgba(0, 0, 0, 0.28); --shade-12: rgba(0, 0, 0, 0.3); --shade-18: rgba(0, 0, 0, 0.4); --shade-30: rgba(0, 0, 0, 0.5);
  --knob-shadow: rgba(0, 0, 0, 0.5);
  --scrim: rgba(0, 0, 0, 0.6); --scrim-deep: rgba(0, 0, 0, 0.62); --scrim-wall: rgba(0, 0, 0, 0.58); --scrim-menu: rgba(0, 0, 0, 0.42); --scrim-pop: rgba(0, 0, 0, 0.5);
  --float: 0 18px 48px rgba(0, 0, 0, 0.6);
}

/* ---------- Reset and base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: var(--fs-base);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, h5, p, ol, ul, dl, dd, figure, table, fieldset, blockquote, pre { margin: 0; padding: 0; }
ol, ul { list-style: none; }
fieldset { border: 0; min-width: 0; }
a { color: inherit; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
svg { display: block; flex: none; }
img, audio { max-width: 100%; }
[hidden] { display: none !important; }
a, button, label, summary, select, input { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
/* During a test a pull on the page must not reload it. */
html:has(body.running) { overscroll-behavior: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--sun-tint); color: var(--ink); }

.sr, .visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.skip {
  position: absolute; inset-inline-start: var(--s4); top: -100px; z-index: 60;
  padding: var(--s3) var(--s4); border-radius: var(--r-s);
  background: var(--ink); color: var(--surface); font-weight: 700;
}
.skip:focus { top: var(--s4); }
noscript { display: block; padding: var(--s5); }

/* ---------- Icons ---------- */
.i {
  width: 20px; height: 20px;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.i--s { width: 16px; height: 16px; }
.i--l { width: 24px; height: 24px; }
.i--xl { width: 40px; height: 40px; stroke-width: 1.75; }
.i--inline { display: inline-block; vertical-align: -3px; }
.coin { width: 16px; height: 16px; }

/* ---------- Type ---------- */
h1, h2, h3, h4, .display { font-family: var(--display); font-optical-sizing: auto; }
h1 { font-size: var(--fs-3xl); font-weight: 700; line-height: 1.05; letter-spacing: -0.02em; text-wrap: balance; }
h2 { font-size: var(--fs-2xl); font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
h3 { font-size: var(--fs-l); font-weight: 700; line-height: 1.3; }
h4 { font-size: var(--fs-base); font-weight: 700; line-height: 1.3; }
h5 { font-size: var(--fs-m); font-weight: 700; line-height: 1.3; }
strong, b { font-weight: 700; }
.eyebrow {
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-2);
}
.muted { color: var(--ink-2); }
.small { font-size: var(--fs-s); }
.num { font-variant-numeric: tabular-nums; }
.hint { font-size: var(--fs-m); color: var(--ink-2); }
.lede { font-size: var(--fs-xl); color: var(--ink-2); }
.bignum {
  font-family: var(--display); font-weight: 800; letter-spacing: -0.03em;
  font-size: clamp(2.75rem, 2rem + 3vw, 4rem); line-height: 1; font-variant-numeric: tabular-nums;
}
.link {
  font-weight: 700; color: var(--teal);
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px;
  display: inline-flex; align-items: center; gap: var(--s1); min-height: 44px;
}
.link--s { min-height: 32px; font-size: var(--fs-m); }
@media (hover: hover) and (pointer: fine) { .link:hover { color: var(--teal-deep); } }
/* Fingers get the full 44px target; a mouse can use the tighter inline size. */
@media (pointer: coarse) { .link--s { min-height: 44px; } }

/* Running text written by the content: lessons, tips, model answers. */
.prose { max-width: 68ch; font-size: var(--fs-l); line-height: 1.7; }
.prose > * + * { margin-top: var(--s4); }
.prose h3 { font-size: 1.25rem; margin-top: var(--s6); }
.prose ul, .prose ol, .bullets { display: grid; gap: var(--s2); padding-inline-start: 0; }
.prose ul > li, .bullets > li { position: relative; padding-inline-start: var(--s5); }
.prose ul > li::before, .bullets > li::before {
  content: ""; position: absolute; inset-inline-start: 6px; top: 0.62em;
  width: 6px; height: 6px; border-radius: 50%; background: var(--teal);
}
.prose ol, .numbered { counter-reset: n; display: grid; gap: var(--s3); }
.prose ol > li, .numbered > li { counter-increment: n; position: relative; padding-inline-start: 40px; min-height: 28px; }
.prose ol > li::before, .numbered > li::before {
  content: counter(n); position: absolute; inset-inline-start: 0; top: 0;
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--teal-tint); color: var(--teal-deep);
  font-family: var(--display); font-weight: 700; font-size: var(--fs-s); font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important; animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important; scroll-behavior: auto !important;
  }
}
/* More contrast, in both sets. */
@media (prefers-contrast: more) {
  :root { --ink-2: #2C3833; --line: #857D6B; --line-2: #6F6858; --exam-line: #857D6B; }
}
@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --ink-2: #D3DDD7; --line: #6D8379; --line-2: #8A9E95; --exam-line: #6D8379; --edge: #9AAEA5; }
}
@media (prefers-contrast: more) {
  :root[data-theme="dark"] { --ink-2: #D3DDD7; --line: #6D8379; --line-2: #8A9E95; --exam-line: #6D8379; --edge: #9AAEA5; }
}
