/* GENERATED by tools/design_tokens.py from design/ (figma-tokens.css, foundation-tokens.css, components.css).
   Never edit: change design/ and run the tool. */

:root {
/* THE SOURCE: edit colour tokens here only (they mirror Figma's Primitives + Theme variables). tools/design_tokens.py
   writes them into the app (index.html) and the website (website/design-system.css); never edit those copies.
   Nuano color tokens, exported from the Figma file "My app idea" (collections Primitives + Theme, modes Zinc, Black, Peach, Blue), Oct 4 2026.
   A Theme variable in a mode is --<group>-<mode>-<name> (bg/secondary in Black → --bg-black-secondary); alternative-green / alternative-yellow → --…-green-… / --…-lemon-…
   Tokens with opacity in Figma use color-mix(… N%, transparent). */
--zinc-white: #FCFBF5; --zinc-50: #F8F3E2; --zinc-100: #F1E7C5; --zinc-200: #E3DABA; --zinc-300: #D4CCAD; --zinc-400: #A7A088; --zinc-500: #847E6C; --zinc-600: #656153; --zinc-700: #48453B; --zinc-800: #282721; --zinc-900: #1B1916; --zinc-950: #10100D; --zinc-black: #120E06;
--peach-50: #FDF1ED; --peach-100: #FAE2DA; --peach-200: #F8D2C5; --peach-300: #F5C0AD; --peach-400: #EC8460; --peach-500: #C16544; --peach-600: #954E35; --peach-700: #6A3726; --peach-800: #3C1F15; --peach-900: #28150E; --peach-950: #180D09;
--green-50: #EEF7E3; --green-100: #DBEEC4; --green-200: #C6E4A2; --green-300: #AED97C; --green-400: #86AB5B; --green-500: #6A8748; --green-600: #526837; --green-700: #3A4A28; --green-800: #212A16; --green-900: #151B0F; --green-950: #0D1109;
--lemon-50: #FDF4D0; --lemon-100: #FBE79A; --lemon-200: #F9D85C; --lemon-300: #EAC94B; --lemon-400: #B89E3B; --lemon-500: #927D2E; --lemon-600: #706024; --lemon-700: #504519; --lemon-800: #2D260E; --lemon-900: #1E1909; --lemon-950: #121006;
--blue-50: #EFF4FA; --blue-100: #DFE8F4; --blue-200: #CDDBEE; --blue-300: #B9CDE8; --blue-400: #7EA2CE; --blue-500: #507BB4; --blue-600: #3E5E89; --blue-700: #2E4361; --blue-800: #1B2737; --blue-900: #111922; --blue-950: #0B0F14;
--bg-zinc-primary: var(--zinc-100); --bg-zinc-secondary: color-mix(in srgb, var(--zinc-950) 4%, transparent); --bg-zinc-tertiary: color-mix(in srgb, var(--zinc-950) 14%, transparent); --bg-zinc-elevated: color-mix(in srgb, var(--zinc-950) 8%, transparent); --bg-zinc-inverted: var(--zinc-950);
--text-zinc-primary: var(--zinc-950); --text-zinc-secondary: var(--zinc-600); --text-zinc-tertiary: var(--zinc-400); --text-zinc-inverted: var(--zinc-100); --text-zinc-positive: var(--green-600); --text-zinc-negative: var(--peach-600); --text-zinc-positive-strong: var(--green-700); --text-zinc-negative-strong: var(--peach-700);
--border-zinc-default: color-mix(in srgb, var(--zinc-950) 10%, transparent); --border-zinc-strong: color-mix(in srgb, var(--zinc-950) 32%, transparent); --border-zinc-subtle: color-mix(in srgb, var(--zinc-950) 6%, transparent); --border-zinc-inverted: color-mix(in srgb, var(--zinc-950) 6%, transparent); --border-zinc-inverted-opaque: #FFFDF5; --border-zinc-opaque: #847E6C; --border-zinc-secondary-opaque: #847E6C;
--overlay-zinc-backdrop: color-mix(in srgb, var(--zinc-950) 72%, transparent);
--bg-black-primary: var(--zinc-950); --bg-black-secondary: color-mix(in srgb, var(--zinc-50) 5%, transparent); --bg-black-tertiary: color-mix(in srgb, var(--zinc-50) 18%, transparent); --bg-black-elevated: color-mix(in srgb, var(--zinc-50) 10%, transparent); --bg-black-inverted: var(--zinc-100);
--text-black-primary: var(--zinc-100); --text-black-secondary: var(--zinc-400); --text-black-tertiary: var(--zinc-600); --text-black-inverted: var(--zinc-950); --text-black-positive: var(--green-300); --text-black-negative: var(--peach-400); --text-black-positive-strong: var(--green-700); --text-black-negative-strong: var(--peach-300);
--border-black-default: color-mix(in srgb, var(--zinc-50) 10%, transparent); --border-black-strong: color-mix(in srgb, var(--zinc-50) 32%, transparent); --border-black-subtle: color-mix(in srgb, var(--zinc-50) 6%, transparent); --border-black-inverted: color-mix(in srgb, var(--zinc-950) 6%, transparent); --border-black-inverted-opaque: #10100D; --border-black-opaque: #F1E7C5; --border-black-secondary-opaque: #A7A088;
--overlay-black-backdrop: color-mix(in srgb, var(--zinc-800) 72%, transparent);
--bg-peach-primary: var(--peach-400); --bg-peach-secondary: color-mix(in srgb, var(--peach-50) 8%, transparent); --bg-peach-tertiary: color-mix(in srgb, var(--peach-50) 18%, transparent); --bg-peach-elevated: color-mix(in srgb, var(--peach-50) 10%, transparent); --bg-peach-inverted: var(--peach-950);
--text-peach-primary: var(--peach-950); --text-peach-secondary: var(--peach-800); --text-peach-tertiary: var(--peach-700); --text-peach-inverted: var(--peach-50); --text-peach-positive: var(--green-600); --text-peach-negative: var(--peach-600); --text-peach-positive-strong: var(--green-700); --text-peach-negative-strong: var(--peach-700);
--border-peach-default: color-mix(in srgb, var(--peach-50) 12%, transparent); --border-peach-strong: color-mix(in srgb, var(--peach-50) 32%, transparent); --border-peach-subtle: color-mix(in srgb, var(--peach-50) 8%, transparent); --border-peach-inverted: color-mix(in srgb, var(--peach-50) 8%, transparent); --border-peach-inverted-opaque: #180D09; --border-peach-opaque: #180D09; --border-peach-secondary-opaque: #180D09;
--overlay-peach-backdrop: color-mix(in srgb, var(--zinc-950) 72%, transparent);
--bg-blue-primary: var(--blue-300); --bg-blue-secondary: color-mix(in srgb, var(--blue-50) 18%, transparent); --bg-blue-tertiary: color-mix(in srgb, var(--blue-50) 40%, transparent); --bg-blue-elevated: color-mix(in srgb, var(--blue-50) 24%, transparent); --bg-blue-inverted: var(--blue-950);
--text-blue-primary: var(--blue-950); --text-blue-secondary: var(--blue-700); --text-blue-tertiary: var(--blue-600); --text-blue-inverted: var(--blue-100); --text-blue-positive: var(--green-600); --text-blue-negative: var(--peach-600); --text-blue-positive-strong: var(--green-700); --text-blue-negative-strong: var(--peach-700);
--border-blue-default: color-mix(in srgb, var(--blue-950) 10%, transparent); --border-blue-strong: color-mix(in srgb, var(--blue-950) 32%, transparent); --border-blue-subtle: color-mix(in srgb, var(--blue-950) 6%, transparent); --border-blue-inverted: color-mix(in srgb, var(--blue-50) 6%, transparent); --border-blue-inverted-opaque: var(--blue-50); --border-blue-opaque: var(--blue-800); --border-blue-secondary-opaque: var(--blue-800);
--overlay-blue-backdrop: color-mix(in srgb, var(--zinc-950) 72%, transparent);
--bg-green-primary: var(--green-300); --bg-green-secondary: color-mix(in srgb, var(--green-950) 10%, transparent); --bg-green-tertiary: color-mix(in srgb, var(--green-950) 18%, transparent); --bg-green-elevated: color-mix(in srgb, var(--green-950) 10%, transparent); --bg-green-inverted: var(--green-950);
--text-green-primary: var(--green-950); --text-green-secondary: var(--green-800); --text-green-tertiary: var(--green-700); --text-green-inverted: var(--green-50);
--border-green-default: color-mix(in srgb, var(--green-950) 10%, transparent); --border-green-strong: color-mix(in srgb, var(--green-950) 32%, transparent); --border-green-subtle: color-mix(in srgb, var(--green-950) 6%, transparent); --border-green-inverted: color-mix(in srgb, var(--green-950) 6%, transparent);
--bg-lemon-primary: var(--lemon-200); --bg-lemon-secondary: color-mix(in srgb, var(--lemon-950) 6%, transparent); --bg-lemon-tertiary: color-mix(in srgb, var(--lemon-950) 16%, transparent); --bg-lemon-elevated: color-mix(in srgb, var(--lemon-950) 6%, transparent); --bg-lemon-inverted: var(--lemon-950);
--text-lemon-primary: var(--lemon-950); --text-lemon-secondary: var(--lemon-800); --text-lemon-tertiary: var(--lemon-700); --text-lemon-inverted: var(--lemon-50);
--border-lemon-default: color-mix(in srgb, var(--lemon-950) 10%, transparent); --border-lemon-strong: color-mix(in srgb, var(--lemon-950) 32%, transparent); --border-lemon-subtle: color-mix(in srgb, var(--lemon-950) 6%, transparent); --border-lemon-inverted: color-mix(in srgb, var(--lemon-950) 6%, transparent);
}

/* THE SOURCE: edit design tokens here (and in figma-tokens.css) only. tools/design_tokens.py writes them into the app
   (index.html) and the website (website/design-system.css); never edit those copies.
   Nuano foundation tokens: space, layout, border width, radius, blur, shadow, font size, size (Oct 2026); duration, easing,
   font weight, line height, letter spacing, opacity and layers (proposed Nov 2026).
   Picked from the majority values in the Figma file "My app idea" (Mocks page: auto-layout gaps and padding, corner radii,
   stroke weights, background blurs) and the app's CSS; the same values sit at the top of index.html, and as Figma variables
   in the collection "Foundations" (space/8 → --space-8). Odd values were snapped to the nearest step
   (3 → 4, 18 → 16, 22 → 20, 26 → 24, 30 → 32; radius 5 → 4, 6 → 8, 99/100/50% → full; border 1.5 → 2, 4.5 → 5).
   Never a raw px value for these in CSS or inline styles: `python3 tools/tokens_check.py`. */
:root {
  /* Space: inside components and elements. The name is the px value. */
  --space-1: 1px;   /* hairline nudges only (an 18px box in a 20px slot) */
  --space-2: 2px; --space-4: 4px; --space-6: 6px; --space-8: 8px; --space-10: 10px; --space-12: 12px; --space-14: 14px;
  --space-16: 16px; --space-20: 20px; --space-24: 24px; --space-32: 32px; --space-40: 40px; --space-48: 48px; --space-64: 64px; --space-96: 96px;

  /* Layout: page-level spacing. */
  --layout-max-width: 430px;                 /* the app column */
  --layout-max-width-fold: 600px;            /* proposed (idea 56, Beta): the column on a foldable's inner screen */
  --layout-max-width-wide: 880px;            /* proposed (idea 56, Beta): two columns of cards on a wide screen */
  --layout-fold-zoom: 1.125;                 /* proposed (idea 56, Beta): "a bigger phone", everything a size up */
  --layout-gutter: var(--space-8);           /* a screen's side padding (Figma screens: 8) */
  --layout-gutter-bar: var(--space-16);      /* side padding of bottom bars, sheets, the snackbar */
  --layout-nav-height: 56px;                 /* top bar */
  --layout-home-indicator: 34px;             /* Figma's home-indicator area at the bottom of every screen */
  --layout-safe-top: env(safe-area-inset-top, 0px);
  --layout-top-inset: 0px;   /* room kept at the top of the page for the status bar: 0 in a browser tab, the notch's safe area when installed (html.standalone) */
  --layout-safe-bottom: env(safe-area-inset-bottom, 0px);
  --layout-inset-bottom: calc(var(--layout-home-indicator) + var(--layout-safe-bottom));   /* bottom bars, snackbar */
  --layout-clear-button: 104px;              /* room under content for a bottom bar with one button (14 + 56 + 34) */
  --layout-clear-cta: 120px;                 /* … for a fixed Continue button */
  --layout-clear-bar: 140px;                 /* … for the select-mode bar */

  /* Border width (strokes, outlines). The name is the px value. */
  --border-width-1: 1px;   /* dividers, outlined cards */
  --border-width-2: 2px;   /* rings, checkboxes, radios, focus outlines (Figma's main stroke) */
  --border-width-5: 5px;   /* the selected radio's ring */

  /* Radius. The name is the px value. */
  --radius-2: 2px;         /* thin tracks */
  --radius-4: 4px;         /* tags, checkboxes, the pointed corner of speech-bubble cards */
  --radius-8: 8px;         /* inputs, tips, snackbar, swipe actions */
  --radius-12: 12px;       /* panels, tooltips */
  --radius-16: 16px;       /* sheets, line highlights */
  --radius-24: 24px;       /* cards, word-bank sheets (Figma's most used radius) */
  --radius-48: 48px;       /* the website's large feature cards (Figma radius/48, 2026-11-30) */
  --radius-full: 999px;    /* pills, circles, round buttons */

  /* Blur. */
  --blur-sm: 3px;          /* soft edge under fades and bottom bars */
  --blur-md: 6px;          /* audio fade, enter animation */
  --blur-lg: 10px;         /* enter animation of intro cards */
  --blur-glass: 12px;      /* Figma's background blur 24: see-through buttons, bars, backdrops */

  /* Font size (idea 12, 2026-10-28). Figma's text styles: 10 tags (Tag / Code), 12 small labels, 14 labels and small
     text, 16 body and buttons, 18 titles and the nav title, 27 large titles, 32 / 40 display; 64 the review score.
     Snapped: 8, 9 → 10; 11 → 12; 13 → 14; 15 → 16; 20, 22 → 18; 23, 24 → 27. Figma: font-size/16. */
  --font-size-10: 10px; --font-size-12: 12px; --font-size-14: 14px; --font-size-16: 16px; --font-size-18: 18px;
  --font-size-27: 27px; --font-size-32: 32px; --font-size-40: 40px; --font-size-64: 64px;

  /* Size (idea 12): widths and heights of icons and controls. The name is the px value. Icons 12–24; controls 28
     (small round buttons, checkboxes' row), 32, 36 (icon buttons), 48 (play buttons, inputs), 56 (buttons, the nav bar),
     72 (the big round buttons). Illustrations and one-off artwork keep their own px. Figma: size/48. */
  --size-8: 8px; --size-12: 12px; --size-14: 14px; --size-16: 16px; --size-18: 18px; --size-20: 20px; --size-22: 22px; --size-24: 24px;
  --size-28: 28px; --size-32: 32px; --size-36: 36px; --size-48: 48px; --size-56: 56px; --size-72: 72px; --size-80: 80px;

  /* PROPOSED (ideas 46 and 48.1, 2026-11-11; not live until the owner approves in HQ): motion, type weights and line
     heights, letter spacing, opacity and layers as tokens. Same values the app used before, now named. */
  /* Motion (idea 46, the owner's set 2026-11-11): every duration and easing is a token. Duration: feel group + its ms value;
     instant 0; quick 150 / 250; default 300 / 400; moderate 500; dramatic 600 / 800; ambient 1000 / 1500 / 2400 / 3600 / 7000 (loops). No other values (Figma Foundations: duration/<group>/<ms>). */
  --duration-instant-0: 0ms; --duration-quick-150: 150ms; --duration-quick-250: 250ms; --duration-default-300: 300ms; --duration-default-400: 400ms; --duration-moderate-500: 500ms; --duration-dramatic-600: 600ms; --duration-dramatic-800: 800ms; --duration-ambient-1000: 1000ms; --duration-ambient-1500: 1500ms; --duration-ambient-2400: 2400ms; --duration-ambient-3600: 3600ms; --duration-ambient-7000: 7000ms;
  /* Easing: the keyword curves, and the app's own curves by what they do (standard: most enters; glide: the video / audio sheets;
     spring / spring-soft: a small overshoot; morph: the intro's card morph; peek: the swipe hint; steps: the spinners). */
  --easing-linear: linear; --easing-ease: ease; --easing-in: ease-in; --easing-out: ease-out; --easing-in-out: ease-in-out;
  --easing-standard: cubic-bezier(.2,.8,.2,1); --easing-glide: cubic-bezier(.22,.8,.24,1); --easing-spring: cubic-bezier(.2,1.2,.3,1); --easing-spring-soft: cubic-bezier(.3,1.25,.45,1); --easing-morph: cubic-bezier(.65,0,.25,1); --easing-peek: cubic-bezier(.45,0,.25,1); --easing-steps-8: steps(8); --easing-steps-12: steps(12);
  /* Type (idea 48.1): font weight by Figma's style names; line height (name = value × 100; normal = the font's own). */
  --font-weight-regular: 400; --font-weight-medium: 500; --font-weight-semibold: 600; --font-weight-bold: 700; --font-weight-extrabold: 800;
  --line-height-normal: normal; --line-height-100: 1; --line-height-120: 1.2; --line-height-125: 1.25; --line-height-130: 1.3; --line-height-135: 1.35; --line-height-140: 1.4; --line-height-145: 1.45; --line-height-150: 1.5; --line-height-160: 1.6; --line-height-170: 1.7; --line-height-180: 1.8;
  --letter-spacing-tight: -0.4px; --letter-spacing-0: 0; --letter-spacing-caps: 0.05em;
  /* Opacity (name = %): 0 hidden, 100 shown, the rest as used (40 disabled, 68 dimmed …). */
  --opacity-0: 0; --opacity-16: 0.16; --opacity-25: 0.25; --opacity-30: 0.3; --opacity-32: 0.32; --opacity-35: 0.35; --opacity-40: 0.4; --opacity-50: 0.5; --opacity-56: 0.56; --opacity-60: 0.6; --opacity-68: 0.68; --opacity-80: 0.8; --opacity-90: 0.9; --opacity-100: 1;
    --fade-dock: 60%;   /* bottom docks (owner, 2026-11-11): the most of the surface colour behind a dock's button; what scrolls under stays readable */
  /* Layers (z-index), lowest first: behind / base / raise-1…4 stack inside one component; the rest are the app's
     global layers: bottom bars, the intro's shade, the top bar, menus, the select bar, sheets and dialogs (overlay),
     snackbar and filter menus (popup), the start-up screen (boot), tap-a-word tooltips. */
  --layer-behind: -1; --layer-base: 0; --layer-raise-1: 1; --layer-raise-2: 2; --layer-raise-3: 3; --layer-raise-4: 4; --layer-bottom-bar: 5; --layer-shade: 9; --layer-nav: 10; --layer-nav-over: 11; --layer-sticky-buttons: 12; --layer-menu: 15; --layer-select-bar: 20; --layer-overlay: 25; --layer-popup: 30; --layer-boot: 100; --layer-tooltip: 1000;

  /* PROPOSED (marketing website, 2026-11-29; website/ only, not in the app, not in Figma Foundations yet): the landing page's
     display type and page frame, from the Figma page "Marketing Website" (desktop 1440). Display text is tighter than the
     app's: -4% on the 40 / 80 px headings, -5% on the 400 px kanji artwork. */
  --font-size-24: 24px;    /* site lead paragraph */
  --font-size-80: 80px;    /* site hero headline */
  --font-size-400: 400px;  /* site background kanji artwork */
  --line-height-105: 1.05;
  --letter-spacing-display: -0.04em;
  --letter-spacing-artwork: -0.05em;
  --layout-site-max-width: 1440px;           /* the Figma desktop frame */
  --layout-site-gutter: var(--space-64);     /* the page's side padding */
  --layout-copy-gap: var(--space-20);        /* every section's headline to its body copy (owner, 2026-11-29: the same everywhere) */
  --layout-site-nav-height: 96px;            /* 24 + a 48 px Medium button + 24 */
  --layout-journey-pin: 220px;               /* the journey's pinned card at its full size (Flashcard (marketing): 220 high) */
  --layout-journey-run: 45svh;
  --layout-mastery-run: 355svh;               /* scroll the mastery stage stays pinned while its steps play: the opening, three answered cards, the 4th card, then the review queue and its two cards flying past (owner, 2026-11-29/30) */
  --layout-mastery-drift: 12svh;              /* how far below its place the stack forms, drifting up into it with the move */               /* scroll the mastery stage stays pinned while its four steps play */               /* scroll from the card pinning to the next section arriving (owner: shorter, 2026-11-29) */

  /* PROPOSED (marketing website, 2026-11-29): motion patterns as named tokens. They only point at the owner's existing
     duration / easing / blur / space / colour tokens (no new durations), so a pattern is tuned in one place.
     Caption reveal: a headline arrives one word at a time, like a live transcript of speech (the app is audio-first). */
  --motion-caption-cadence: var(--duration-default-300);     /* one word to the next: about 200 words a minute */
  --motion-caption-pause: var(--duration-dramatic-600);      /* after . ? ! : the breath between sentences */
  --motion-caption-enter: var(--duration-quick-250);         /* each word's own fade-in */
  --motion-caption-easing: var(--easing-standard);
  --motion-caption-blur: var(--blur-md);                     /* a word lands slightly out of focus, then sharpens */
  --motion-caption-rise: var(--space-8);                     /* … and rises this far into place */
  /* ink: the word being "heard" is in its section's mode secondary text (--text-<mode>-secondary), then settles to primary */
  /* Distances and scales for enters (used by the site's intro; candidates for the app's 48.4 patterns too). */
  --motion-rise-sm: var(--space-8); --motion-rise-md: var(--space-16); --motion-rise-lg: var(--space-24);
  --motion-scale-press: 0.97;   /* a button while pressed (the app's 97%) */
  --motion-scale-seed: 0.2;     /* a letter growing out of its dot */

  /* PROPOSED (2026-11-29): interaction states for pointers (web / desktop). Hover is one rule for every component: its
     surface mixes in its own content colour at --state-hover-opacity (a dark button lightens, a light field darkens),
     only where a real pointer can hover (@media (hover: hover) and (pointer: fine)), never as the only cue. */
  --opacity-8: 0.08;
  --state-hover-opacity: var(--opacity-8);
  --motion-hover-duration: var(--duration-quick-150);
  --motion-hover-easing: var(--easing-standard);
  --motion-link-duration: var(--duration-quick-250);         /* a text link's underline drawing in */

  /* PROPOSED (marketing website, 2026-11-29): Theme blend. The page has one background that changes with scroll: as a
     section in another mode (data-theme) comes up from the bottom of the screen, the page's colours mix from the last
     mode's tokens to its mode's over this much scroll, so there is never a hard edge between sections. The transparent
     sticky nav takes the same mixed colours (its text, the wordmark and its button follow the mode under it). */
  --scroll-theme-blend: 70svh;
  /* Section reveal (every section, the hero too): a beat before a section's heading starts, and a beat after the heading
     is said before its body copy and the rest come in. */
  --motion-section-lead-in: var(--duration-moderate-500);
  --motion-section-beat: var(--duration-default-400);
  /* Card flip: a card turns over (front ↔ back) like a real flashcard; each face stays up for the hold. */
  --motion-flip-duration: var(--duration-dramatic-800);
  --motion-flip-easing: var(--easing-morph);
  --motion-flip-hold: var(--duration-ambient-2400);
  /* Marquee: rows of cards pan very slowly, each card taking this long to pass (6 cards → 63 s a loop). The owner
     asked for slower twice (2026-11-29): the longest duration token × 1.5, no new base duration. */
  --motion-marquee-step: calc(var(--duration-ambient-7000) * 1.5);
  /* Reward (website, "Put in the work"; owner, 2026-11-29, after the inspiration video): a card answered correctly.
     Its Correct badges pop out one after the other, then sparkles with dotted tails fly from each badge into the
     word's mastery panel, speeding up as they arrive, and every score they reach ticks up with a pop. */
  --motion-reward-pop: var(--duration-quick-250);            /* a badge (or a score) popping in */
  --motion-reward-pop-easing: var(--easing-spring);
  --motion-reward-gap: var(--duration-quick-150);            /* between two badges, two sparkles */
  --motion-reward-flight: var(--duration-dramatic-800);      /* one sparkle's flight to its score */
  --motion-reward-flight-easing: var(--easing-in);           /* slow off the badge, fast into the score */
  --motion-reward-trail: var(--duration-dramatic-600);       /* a tail dot lingering after the sparkle passes */
  --motion-reward-highlight: var(--duration-ambient-1500);   /* a meaning letter lit while its card's sparkles land, then back */
  /* Card swap: the answered card lifts off up and away; the next one rises from the stack into its place. */
  --motion-card-leave: var(--duration-default-400);
  --motion-card-arrive: var(--duration-moderate-500);
  --motion-card-arrive-easing: var(--easing-glide);
  /* Section display headings (Figma "Traditional flashcards aren't enough": 64 px Bold). */
  --font-size-section-title: var(--font-size-64);

  /* Font families: the app's Latin face (Plus Jakarta Sans) with Japanese fallbacks, the Japanese face for kanji-led text
     (Noto Sans JP), and the mono face for tags and code. */
  --font-family-sans: "Plus Jakarta Sans", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", sans-serif;
  --font-family-ja: "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  --font-family-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;

  /* Drop shadow. Nuano is flat: elevation comes from colour and the glass blur, not shadows (owner decision, Oct 2026).
     --shadow-md is kept in reserve only; do not add shadows without a Figma design first. */
  --shadow-md: 0 6px 20px var(--border-zinc-strong);
  /* Lift (Figma "Correct badge" and the answered Example card, Chapter 01): a small hard drop under something that
     has just popped up over the card. Black at 25%. */
  --shadow-lift: 0 var(--space-4) var(--space-4) color-mix(in srgb, var(--bg-black-primary) calc(var(--opacity-25) * 100%), transparent);
}

/* Mode map (generated): data-theme="<mode>" → --mode-<group>-<name> = that mode's Theme token. Zinc by default. */
:root, [data-theme="zinc"] { --mode-bg-primary: var(--bg-zinc-primary); --mode-bg-secondary: var(--bg-zinc-secondary); --mode-bg-tertiary: var(--bg-zinc-tertiary); --mode-bg-elevated: var(--bg-zinc-elevated); --mode-bg-inverted: var(--bg-zinc-inverted); --mode-text-primary: var(--text-zinc-primary); --mode-text-secondary: var(--text-zinc-secondary); --mode-text-tertiary: var(--text-zinc-tertiary); --mode-text-inverted: var(--text-zinc-inverted); --mode-text-positive: var(--text-zinc-positive); --mode-text-negative: var(--text-zinc-negative); --mode-text-positive-strong: var(--text-zinc-positive-strong); --mode-text-negative-strong: var(--text-zinc-negative-strong); --mode-border-default: var(--border-zinc-default); --mode-border-strong: var(--border-zinc-strong); --mode-border-subtle: var(--border-zinc-subtle); --mode-border-inverted: var(--border-zinc-inverted); --mode-border-inverted-opaque: var(--border-zinc-inverted-opaque); --mode-border-opaque: var(--border-zinc-opaque); --mode-border-secondary-opaque: var(--border-zinc-secondary-opaque); --mode-overlay-backdrop: var(--overlay-zinc-backdrop); }
[data-theme="black"] { --mode-bg-primary: var(--bg-black-primary); --mode-bg-secondary: var(--bg-black-secondary); --mode-bg-tertiary: var(--bg-black-tertiary); --mode-bg-elevated: var(--bg-black-elevated); --mode-bg-inverted: var(--bg-black-inverted); --mode-text-primary: var(--text-black-primary); --mode-text-secondary: var(--text-black-secondary); --mode-text-tertiary: var(--text-black-tertiary); --mode-text-inverted: var(--text-black-inverted); --mode-text-positive: var(--text-black-positive); --mode-text-negative: var(--text-black-negative); --mode-text-positive-strong: var(--text-black-positive-strong); --mode-text-negative-strong: var(--text-black-negative-strong); --mode-border-default: var(--border-black-default); --mode-border-strong: var(--border-black-strong); --mode-border-subtle: var(--border-black-subtle); --mode-border-inverted: var(--border-black-inverted); --mode-border-inverted-opaque: var(--border-black-inverted-opaque); --mode-border-opaque: var(--border-black-opaque); --mode-border-secondary-opaque: var(--border-black-secondary-opaque); --mode-overlay-backdrop: var(--overlay-black-backdrop); }
[data-theme="peach"] { --mode-bg-primary: var(--bg-peach-primary); --mode-bg-secondary: var(--bg-peach-secondary); --mode-bg-tertiary: var(--bg-peach-tertiary); --mode-bg-elevated: var(--bg-peach-elevated); --mode-bg-inverted: var(--bg-peach-inverted); --mode-text-primary: var(--text-peach-primary); --mode-text-secondary: var(--text-peach-secondary); --mode-text-tertiary: var(--text-peach-tertiary); --mode-text-inverted: var(--text-peach-inverted); --mode-text-positive: var(--text-peach-positive); --mode-text-negative: var(--text-peach-negative); --mode-text-positive-strong: var(--text-peach-positive-strong); --mode-text-negative-strong: var(--text-peach-negative-strong); --mode-border-default: var(--border-peach-default); --mode-border-strong: var(--border-peach-strong); --mode-border-subtle: var(--border-peach-subtle); --mode-border-inverted: var(--border-peach-inverted); --mode-border-inverted-opaque: var(--border-peach-inverted-opaque); --mode-border-opaque: var(--border-peach-opaque); --mode-border-secondary-opaque: var(--border-peach-secondary-opaque); --mode-overlay-backdrop: var(--overlay-peach-backdrop); }
[data-theme="blue"] { --mode-bg-primary: var(--bg-blue-primary); --mode-bg-secondary: var(--bg-blue-secondary); --mode-bg-tertiary: var(--bg-blue-tertiary); --mode-bg-elevated: var(--bg-blue-elevated); --mode-bg-inverted: var(--bg-blue-inverted); --mode-text-primary: var(--text-blue-primary); --mode-text-secondary: var(--text-blue-secondary); --mode-text-tertiary: var(--text-blue-tertiary); --mode-text-inverted: var(--text-blue-inverted); --mode-text-positive: var(--text-blue-positive); --mode-text-negative: var(--text-blue-negative); --mode-text-positive-strong: var(--text-blue-positive-strong); --mode-text-negative-strong: var(--text-blue-negative-strong); --mode-border-default: var(--border-blue-default); --mode-border-strong: var(--border-blue-strong); --mode-border-subtle: var(--border-blue-subtle); --mode-border-inverted: var(--border-blue-inverted); --mode-border-inverted-opaque: var(--border-blue-inverted-opaque); --mode-border-opaque: var(--border-blue-opaque); --mode-border-secondary-opaque: var(--border-blue-secondary-opaque); --mode-overlay-backdrop: var(--overlay-blue-backdrop); }
[data-theme="green"] { --mode-bg-primary: var(--bg-green-primary); --mode-bg-secondary: var(--bg-green-secondary); --mode-bg-tertiary: var(--bg-green-tertiary); --mode-bg-elevated: var(--bg-green-elevated); --mode-bg-inverted: var(--bg-green-inverted); --mode-text-primary: var(--text-green-primary); --mode-text-secondary: var(--text-green-secondary); --mode-text-tertiary: var(--text-green-tertiary); --mode-text-inverted: var(--text-green-inverted); --mode-border-default: var(--border-green-default); --mode-border-strong: var(--border-green-strong); --mode-border-subtle: var(--border-green-subtle); --mode-border-inverted: var(--border-green-inverted); }
[data-theme="lemon"] { --mode-bg-primary: var(--bg-lemon-primary); --mode-bg-secondary: var(--bg-lemon-secondary); --mode-bg-tertiary: var(--bg-lemon-tertiary); --mode-bg-elevated: var(--bg-lemon-elevated); --mode-bg-inverted: var(--bg-lemon-inverted); --mode-text-primary: var(--text-lemon-primary); --mode-text-secondary: var(--text-lemon-secondary); --mode-text-tertiary: var(--text-lemon-tertiary); --mode-text-inverted: var(--text-lemon-inverted); --mode-border-default: var(--border-lemon-default); --mode-border-strong: var(--border-lemon-strong); --mode-border-subtle: var(--border-lemon-subtle); --mode-border-inverted: var(--border-lemon-inverted); }

/* THE SOURCE for shared component styles (design system: docs/product/design-system/components/). Written once here, in
   tokens only; tools/design_tokens.py bundles it into website/design-system.css. The app (index.html) still has its own
   copies of these components: moving the app onto this file is a separate, owner-approved step.

   Colour follows the mode: a container with data-theme="<mode>" (zinc, black, peach, blue, green, lemon) maps the
   generic --mode-* names to that mode's Figma Theme tokens (the map is generated from figma-tokens.css), so one Button
   works in every mode, as in Figma. */

/* ── States (foundations/motion.md › Hover): a component names its surface and content colour; hover mixes the content
   colour into the surface at --state-hover-opacity, the same rule everywhere, on pointer devices only. ── */
.btn, .text-field-input {
  background-color: var(--surface);
  color: var(--on-surface);
  transition: background-color var(--motion-hover-duration) var(--motion-hover-easing),
              transform var(--motion-hover-duration) var(--motion-hover-easing);
}
@media (hover: hover) and (pointer: fine) {
  .btn:hover, .text-field-input:hover:not(:focus) {
    background-color: color-mix(in srgb, var(--surface), var(--on-surface) calc(var(--state-hover-opacity) * 100%));
  }
}

/* ── Button (components/button.md): Primary; sizes Large 56 (default) / Medium 48 (.btn-md). States: Enabled, Hover,
   Pressed. ── */
.btn {
  --surface: var(--mode-bg-inverted); --on-surface: var(--mode-text-inverted);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-8);
  height: var(--size-56); min-height: var(--size-56);
  padding: var(--space-16) var(--space-20);
  border: 0; border-radius: var(--radius-full);
  font: inherit; font-size: var(--font-size-16); font-weight: var(--font-weight-semibold); line-height: var(--line-height-normal);
  white-space: nowrap; cursor: pointer;
}
.btn:active { transform: scale(var(--motion-scale-press)); }
.btn-md { height: var(--size-48); min-height: var(--size-48); padding: var(--space-12) var(--space-16); }

/* ── Text field (components/text-field.md). States: Default, Hover, Focused, Filled. ── */
.text-field { display: flex; flex-direction: column; gap: var(--space-4); }
.text-field-input {
  --surface: var(--mode-bg-elevated); --on-surface: var(--mode-text-primary);
  width: 100%; height: var(--size-56); min-height: var(--size-56);
  padding: var(--space-8) var(--space-16);
  border: 0; border-radius: var(--radius-8);
  font: inherit; font-size: var(--font-size-16);
}
.text-field-input:focus { --surface: var(--mode-bg-tertiary); outline: none; }   /* Focused: the tertiary fill, as in the app */
.text-field-input:focus-visible { outline: var(--border-width-2) solid var(--mode-text-primary); outline-offset: var(--space-2); }
.text-field-input::placeholder { color: var(--mode-text-secondary); opacity: var(--opacity-100); }
/* Multi-line (2026-11-30, the website's contact message): the same field, as tall as its text (at least two size-72 steps),
   resizable up and down. */
.text-field-input.is-multiline { height: auto; min-height: calc(var(--size-72) * 2); padding-block: var(--space-12); line-height: var(--line-height-145); resize: vertical; }

/* ── Link (components/link.md). Hover and keyboard focus: an underline draws in from the left in the link's colour. ── */
.link {
  position: relative;
  font-weight: var(--font-weight-semibold); line-height: var(--line-height-normal);
}
.link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: calc(var(--space-4) * -1);
  height: var(--border-width-2); border-radius: var(--radius-full); background: currentColor;
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--motion-link-duration) var(--motion-hover-easing);
}
@media (hover: hover) and (pointer: fine) { .link:hover::after { transform: scaleX(1); } }
.link:focus-visible::after { transform: scaleX(1); }

/* ── Scroll edge (proposed; like iOS 26's scroll edge effect): a frosted band behind a bar that content scrolls
   under. The glass blur (--blur-glass) and a tint of the surface behind (--edge-surface, --fade-dock of it at the top)
   fade out downward over the bar's height plus --space-24, so there's no hard edge and text never runs into the bar's
   own content. Put .scroll-edge on the bar (it must be positioned); the band sits behind the bar's content. ── */
.scroll-edge::before {
  content: ""; position: absolute; z-index: var(--layer-behind); pointer-events: none;
  inset: 0 0 calc(var(--space-24) * -1) 0;
  background: linear-gradient(to bottom, color-mix(in srgb, var(--edge-surface, var(--mode-bg-primary)) var(--fade-dock), transparent), transparent);
  -webkit-backdrop-filter: blur(var(--blur-glass)); backdrop-filter: blur(var(--blur-glass));
  -webkit-mask-image: linear-gradient(to bottom, black 40%, transparent); mask-image: linear-gradient(to bottom, black 40%, transparent);
}

/* ── Background kanji (foundations/illustrations.md › Background kanji, proposed): one or two kanji that name the
   section's idea, 400 px Regular in the mode's bg/secondary, behind the device it belongs to, decoration only (aria-hidden). ── */
.bg-kanji {
  z-index: var(--layer-base);
  display: flex; justify-content: center; align-items: center;
  width: 100%; height: 100%;
  pointer-events: none; user-select: none;
  font-family: var(--font-family-ja);
  font-size: min(var(--font-size-400), 28vw);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-105);
  letter-spacing: var(--letter-spacing-artwork);
  color: var(--mode-bg-secondary);
  white-space: nowrap;
}
.bg-kanji span { display: block; }

/* ── Flashcard (marketing) (components/flashcard-marketing.md, Figma "Marketing / Kakeru example"):
   the plain word-and-meaning card Nuano is contrasted with. Zinc mode in Figma (data-theme="zinc" on it), 384 × 220, padding 32, radius 24.
   Two faces, Front (the word) and Back (a small word label over its dictionary meaning), stacked in one grid cell so
   the card is as tall as its taller face; it turns over with the Card flip pattern (--motion-flip-*). ── */
.flashcard {
  display: block; width: min(384px, 100%);   /* geometry: Figma's card width */
  margin: 0; padding: 0; border: 0; background: none;
  font: inherit; color: inherit; text-align: left; cursor: pointer;
  perspective: 1200px;   /* geometry: depth of the 3D turn, about 3 card widths */
}
.flashcard-inner {
  position: relative; display: grid;
  transform-style: preserve-3d;
  transition: transform var(--motion-flip-duration) var(--motion-flip-easing);
}
.flashcard[aria-pressed="true"] .flashcard-inner { transform: rotateY(180deg); }
.flashcard-face {
  grid-area: 1 / 1;
  display: flex; flex-direction: column; justify-content: center; gap: var(--space-16);
  min-height: 220px;   /* geometry: Figma's card height */
  padding: var(--space-32);
  border-radius: var(--radius-24);
  background: var(--mode-bg-primary);
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.flashcard-back { transform: rotateY(180deg); }
.flashcard:focus-visible { outline-offset: var(--space-4); border-radius: var(--radius-24); }
.flashcard-word {
  font-family: var(--font-family-ja);
  font-size: var(--font-size-40); font-weight: var(--font-weight-bold); line-height: var(--line-height-105);
  color: var(--mode-text-negative-strong);
}
.flashcard-label {
  font-family: var(--font-family-ja);
  font-size: var(--font-size-14); font-weight: var(--font-weight-medium); line-height: var(--line-height-140);
  color: var(--mode-text-negative-strong);
}
.flashcard-meaning { font-size: var(--font-size-24); font-weight: var(--font-weight-bold); line-height: var(--line-height-125); color: var(--mode-text-primary); }

/* Flashcard (marketing) › Compact: the card turned to its front and shrunk around the word, in Black mode's
   bg/secondary (the pill the journey hangs on its guide line). site.js switches data-compact (and the card's
   data-theme to black) and animates its size; colours cross-fade here. */
.flashcard-face, .flashcard-word {
  transition: background-color var(--motion-flip-duration) var(--motion-flip-easing), color var(--motion-flip-duration) var(--motion-flip-easing);
}
.flashcard[data-compact] { width: max-content; }
.flashcard[data-compact] .flashcard-face { min-height: 0; background: var(--mode-bg-secondary); }
.flashcard[data-compact] .flashcard-word { color: var(--mode-text-primary); font-size: var(--font-size-27); }   /* the pill's word is 27, the same as the Mastery panel's (owner, 2026-11-29) */
/* The pill is sized around the front only: the back leaves the layout but stays drawn (it is already turned away), so
   nothing blinks; the word keeps its left padding in both forms, so it never jumps while the card shrinks. */
.flashcard[data-compact] .flashcard-back { position: absolute; inset: 0; visibility: hidden; }

/* ── Flashcard (marketing) › Example: one real sentence with the word (Figma "Marketing / Kakeru example", the
   sentence layout). Zinc mode: the reading in small type over the kanji (ruby), the sentence with the word's form in
   Bold negative-strong, then the English with the word's meaning in Bold. ── */
.kakeru-card {
  flex: none; display: flex; flex-direction: column; gap: var(--space-12);
  width: 304px;   /* geometry: the marquee card (owner, 2026-11-29: smaller than Figma's 384 × 220), height from its text */
  margin: 0; padding: var(--space-24);
  border-radius: var(--radius-24);
  background: var(--mode-bg-primary); color: var(--mode-text-primary);
  list-style: none;
}
.kakeru-ja {
  margin: 0; padding-top: var(--space-16);   /* room for the reading over the first line */
  font-family: var(--font-family-ja); font-size: var(--font-size-32); font-weight: var(--font-weight-regular);
  line-height: var(--line-height-105);
}
.kakeru-ja b { font-weight: var(--font-weight-bold); color: var(--mode-text-negative-strong); }
.kakeru-ja rt { font-family: var(--font-family-sans); font-size: var(--font-size-12); color: var(--mode-text-secondary); }
.kakeru-en { margin: 0; font-size: var(--font-size-14); line-height: var(--line-height-140); }
.kakeru-en b { font-weight: var(--font-weight-bold); }

/* ── Flashcard (marketing) › Example, large: the Figma size (384 wide, sentence 40, reading 14, English 16), for a
   card shown on its own (the mastery stack's top card). ── */
.kakeru-card.is-lg { width: min(384px, 100%); min-height: 220px; padding: var(--space-32); gap: var(--space-16); border-radius: var(--radius-24); }   /* geometry: Figma's card width */
.kakeru-card.is-lg .kakeru-ja { padding-top: var(--space-20); font-size: var(--font-size-40); }
.kakeru-card.is-lg .kakeru-ja rt { font-size: var(--font-size-14); }
.kakeru-card.is-lg .kakeru-en { font-size: var(--font-size-16); }
/* Answered correctly (Figma Chapter 01, the stack's top card): a Peach primary outline outside the card, two soft
   Peach rings around it (the mock's 20% and 12% halos, on the nearest opacity tokens), and the lift shadow. */
.kakeru-card.is-correct {
  box-shadow:
    0 0 0 var(--border-width-2) var(--bg-peach-primary),
    0 0 0 var(--space-4) color-mix(in srgb, var(--bg-peach-primary) calc(var(--opacity-16) * 100%), transparent),
    0 0 0 var(--space-10) color-mix(in srgb, var(--bg-peach-primary) calc(var(--opacity-8) * 100%), transparent),
    var(--shadow-lift);
}

/* ── Phone (marketing; Figma "Marketing / Metallic phone hardware" 1048:6464 holding an app screen): the metallic
   phone frame (308 × 632) with a screen inside it (Figma's viewport: 12, 10 in, 284 × 612, its own radius). Size it
   with --phone-w. ── */
.phone { position: relative; width: var(--phone-w, 316px); aspect-ratio: 308 / 632; }   /* geometry: the frame's proportions */
.phone-frame { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.phone-screen {
  position: absolute; left: 3.9%; top: 1.58%; width: 92.2%; height: 96.8%;   /* geometry: Figma's screen viewport in the frame */
  overflow: hidden; border-radius: 12% / 5.6%; background: var(--bg-black-primary);
}
.phone-screen img { display: block; width: 100%; height: auto; }

/* ── Tag (components/tag.md, Figma "Tag / Default"): a small mono label, optionally with a value after it. The
   website's copy of the app's Tag, drawn in the mode it sits in. ── */
.tag {
  display: inline-flex; align-items: center; gap: var(--space-4);
  padding: var(--space-2) var(--space-6); border-radius: var(--radius-4);
  background: var(--mode-bg-tertiary); color: var(--mode-text-primary);
  font-family: var(--font-family-mono); font-size: var(--font-size-10); font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-normal); white-space: nowrap;
}
.tag-value { font-family: var(--font-family-sans); font-size: var(--font-size-14); line-height: var(--line-height-100); }

/* ── Correct badge (website; Figma "Correct badge", Chapter 01): what a correct answer earned, popping out of the
   card's edge: a pill in its score's mode (Peach for a meaning, Blue for a conjugation) holding a Tag and a check. ── */
.correct-badge {
  display: inline-flex; align-items: center; gap: var(--space-4);
  padding: var(--space-8) var(--space-8) var(--space-8) var(--space-16);
  border-radius: var(--radius-full); background: var(--mode-bg-primary); color: var(--mode-text-primary);
  box-shadow: var(--shadow-lift);
}
.correct-check { width: var(--size-32); height: var(--size-32); flex: none; }
.correct-check path { fill: none; stroke-width: 4.25; stroke-linecap: round; stroke-linejoin: round; }   /* geometry: Figma's check stroke */

/* ── Reward sparkle (website; Figma "Peach · meaning particles" / "Blue · conjugation particles"): a four-point
   sparkle with a dotted tail, flying from a Correct badge to the score it feeds; --spark is its score's ink. ── */
.reward-layer { position: fixed; inset: 0; pointer-events: none; z-index: var(--layer-nav-over); }
.reward-spark, .reward-dot { position: absolute; left: 0; top: 0; }
.reward-spark { width: var(--size-28); height: var(--size-28); margin: calc(var(--size-28) / -2) 0 0 calc(var(--size-28) / -2); filter: drop-shadow(0 0 var(--blur-md) var(--spark)); }
.reward-spark .spark-ink { fill: var(--spark); }
.reward-spark .spark-core { fill: var(--text-black-primary); }
.reward-dot { border-radius: var(--radius-full); background: var(--spark); }

/* ── Mastery dots (components/mastery-dots.md), Large: five dots, filled ones in Peach primary, the rest in the mode's
   tertiary. The same as the app's .dots-lg (the app still has its own copy). ── */
.dots-lg { display: inline-flex; gap: var(--space-4); }
.dots-lg i { width: var(--size-14); height: var(--size-14); border-radius: var(--radius-full); background: var(--mode-bg-tertiary); }
.dots-lg i.on { background: var(--bg-peach-primary); }

/* ── Meaning letter (components/definition-card.md, Figma "Meaning Ⓑ"): a meaning's circled letter on a small elevated
   disc. ── */
.meaning-letter {
  display: inline-grid; place-items: center; width: var(--size-24); height: var(--size-24);
  border-radius: var(--radius-full); background: var(--mode-bg-elevated);
  font-size: var(--font-size-18); font-weight: var(--font-weight-semibold); line-height: var(--line-height-100); color: var(--mode-text-secondary);
}
/* Highlighted (website reward rounds; owner, 2026-11-30): only while a card's sparkles land, to show the points go
   to that meaning: it pops in Peach, holds the mode's inverted disc (white in Black mode), then returns to the
   default look. Played by site.js (--motion-reward-highlight); no lasting state. */

/* ── Score chip (proposed; Figma "Meanings" / "Conjugations" in Chapter 01): one separate score. A small uppercase label
   in its own colour (--score-ink, a mode's primary: Peach for meanings, Blue for conjugations) over the value. The
   top-left corner stays square, like a speech bubble pointing at the total next to it. ── */
.score-chip {
  display: flex; flex-direction: column; gap: var(--space-4);
  padding: var(--space-12) var(--space-16);
  border-radius: 0 var(--radius-16) var(--radius-16) var(--radius-16);
  background: var(--mode-bg-secondary);
}
.score-label { font-size: var(--font-size-12); font-weight: var(--font-weight-semibold); text-transform: uppercase; color: var(--score-ink, var(--mode-text-secondary)); }
.score-value { font-size: var(--font-size-18); font-weight: var(--font-weight-bold); color: var(--mode-text-secondary); }

/* ── Flashcard (marketing) › Mastery panel (Figma "Marketing / Kakeru example" in Chapter 01): the word opened up to
   show its meanings, mastery and separate scores. Black mode bg/secondary, padding 32, radius 24; compact (only the
   word), it is the same pill as the journey's Compact card. ── */
.mastery-panel {
  position: relative; display: flex; align-items: center; gap: var(--space-40);
  width: max-content; max-width: 100%; padding: var(--space-32);
  border-radius: var(--radius-24); background: var(--mode-bg-secondary); color: var(--mode-text-primary);
}
.mp-word { display: flex; flex-direction: column; gap: var(--space-2); }
/* The word is 27 (Figma 1113:87202 uses 28; the owner chose the 27 token, 2026-11-29), the same as the Compact card's, so
   the panel can take over from that card without a jump. */
.mp-ja {
  font-family: var(--font-family-ja); font-weight: var(--font-weight-bold); line-height: var(--line-height-105);
  font-size: var(--font-size-27);
}
.mp-meanings { display: flex; align-items: center; gap: var(--space-2); }
.mp-meanings .meaning-letter { width: var(--size-20); height: var(--size-20); font-size: var(--font-size-16); }   /* the small letters (Figma: 20) */
.mp-label { margin-right: var(--space-4); font-size: var(--font-size-12); font-weight: var(--font-weight-semibold); text-transform: uppercase; letter-spacing: var(--letter-spacing-caps); color: var(--mode-text-secondary); }
.mp-stats { display: flex; align-items: flex-start; gap: var(--space-8); }
.mp-total { display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-2); }
.mp-pct { font-size: var(--font-size-40); font-weight: var(--font-weight-regular); line-height: var(--line-height-normal); }
/* It opens in two stages (data-level, set by a stage; none = fully open): 0 the word only (the Compact pill),
   1 the word and its meanings, 2 everything. */
.mastery-panel[data-level="0"] .mp-meanings, .mastery-panel[data-level="0"] .mp-stats, .mastery-panel[data-level="1"] .mp-stats { display: none; }
/* Split bar (Mastery panel, slim; owner, 2026-11-30, for phones): the total as one bar out of 100, its Peach part the
   meanings score and its Blue part the conjugations score, side by side, with a small legend in their colours. The
   site shows it in place of the letters and Score chips on small screens (website/site.css). */
.mp-split { display: none; }
.mp-bar { display: flex; gap: var(--space-2); height: var(--space-6); border-radius: var(--radius-full); overflow: hidden; background: var(--mode-bg-tertiary); }
.mp-bar-part { width: calc(var(--part, 0) * 1%); background: var(--bg-peach-primary); transition: width var(--motion-reward-pop) var(--motion-reward-pop-easing); }
.mp-bar-part + .mp-bar-part { background: var(--bg-blue-primary); }
.mp-legend { display: flex; gap: var(--space-16); margin-top: var(--space-8); font-size: var(--font-size-12); font-weight: var(--font-weight-semibold); text-transform: uppercase; }
.mp-legend > span { color: var(--bg-peach-primary); }
.mp-legend > span + span { color: var(--bg-blue-primary); }
.mp-legend-value { display: inline-block; }
.mastery-panel[data-level="0"] .mp-split, .mastery-panel[data-level="1"] .mp-split { display: none; }

/* ── Guide line (proposed): a dotted line that leads the eye from one part of the page to the next. A 5 px dash of the
   mode's bg/tertiary (Figma: 4, snapped), 8 on / 12 off; it draws in from its top. ── */
.guide-line {
  display: block; width: var(--border-width-5);
  background: repeating-linear-gradient(to bottom, var(--mode-bg-tertiary) 0 var(--space-8), transparent var(--space-8) calc(var(--space-8) + var(--space-12)));
  transform-origin: top;
}

/* ── Marquee (proposed): rows of cards panning very slowly, alternate rows the other way, one card passing every
   --motion-marquee-step. site.js repeats each row's cards once (hidden from screen readers) so the loop is seamless.
   It never stops on hover (owner, 2026-11-29); it stands still with reduced motion. ── */
.marquee { display: flex; flex-direction: column; gap: var(--space-16); overflow: hidden; }
.marquee-row {
  display: flex; gap: var(--space-24); width: max-content;
  margin: 0; padding: 0 var(--space-24) 0 0;   /* the trailing gap, so half the row is exactly one set of cards */
  animation: marquee-pan calc(var(--motion-marquee-step) * var(--marquee-cards, 6)) var(--easing-linear) infinite;
}
.marquee-row:nth-child(even) { animation-direction: reverse; animation-delay: calc(var(--motion-marquee-step) * -2); }
@keyframes marquee-pan { to { transform: translateX(-50%); } }

/* Phones (up to 600, the app's --layout-max-width-fold; a media query can't read a token): the Example cards and the
   marquee scale down a step, so about one and a half cards show across the screen. */
@media (max-width: 600px) {   /* geometry: the phone breakpoint, = --layout-max-width-fold */
  .marquee { gap: var(--space-12); }
  .marquee-row { gap: var(--space-16); padding-right: var(--space-16); }
  .kakeru-card { width: 208px; padding: var(--space-16); gap: var(--space-8); border-radius: var(--radius-16); }   /* geometry: the phone card width */
  .kakeru-ja { padding-top: var(--space-12); font-size: var(--font-size-24); }
  .kakeru-ja rt { font-size: var(--font-size-10); }
  .kakeru-en { font-size: var(--font-size-12); }
  /* everything a step smaller on a phone (owner, 2026-11-30: "a lot of things are just too big on mobile") */
  .kakeru-card.is-lg { padding: var(--space-24); min-height: 0; border-radius: var(--radius-24); }
  .kakeru-card.is-lg .kakeru-ja { font-size: var(--font-size-32); padding-top: var(--space-16); }
  .kakeru-card.is-lg .kakeru-en { font-size: var(--font-size-14); }
  .flashcard-face { min-height: 0; padding: var(--space-24); gap: var(--space-12); }
  .flashcard-word { font-size: var(--font-size-32); }
  .flashcard-label { font-size: var(--font-size-12); }
  .flashcard-meaning { font-size: var(--font-size-18); }
  .flashcard[data-compact] .flashcard-face { padding: var(--space-16) var(--space-24); }
  .flashcard[data-compact] .flashcard-word { font-size: var(--font-size-24); }
  .mastery-panel { padding: var(--space-16) var(--space-20); }
  .mp-ja { font-size: var(--font-size-24); }
  .mp-pct { font-size: var(--font-size-32); }
  .dots-lg i { width: var(--size-12); height: var(--size-12); }
  .correct-badge { padding: var(--space-6) var(--space-6) var(--space-6) var(--space-12); }
  .correct-check { width: var(--size-24); height: var(--size-24); }
}

@media (prefers-reduced-motion: reduce) {
  .btn, .text-field-input, .link::after { transition: none; }
  .flashcard-inner, .flashcard-face, .flashcard-word { transition: none; }   /* turns instantly, and only when asked */
  .marquee-row { animation: none; }
}
