/* ==========================================================================
   Design tokens: the single source of truth for the site's design system
   (since 2026-10-21, D25; before that css/site.css :root, D14). Every page
   on the system links this first: tokens.css, then ds.css (base + text
   roles), then its own page stylesheet. Names follow the Figma variables
   (`/` → `-`), e.g. Figma spacing/16 = --spacing-16. Page stylesheets
   never declare tokens in :root (scripts/check-tokens.sh).
   Fonts load from <link> tags in each page, not here: Fontshare
   cabinet-grotesk@800,700 and switzer@400,600,700; Google IBM Plex Mono
   400;600 (plus Inter and Architects Daughter on work-gemstones only).
   The home page's own voice is self-hosted: css/fonts.css (@font-face for
   assets/fonts/): Literata italic 600, Funnel Sans 400, Martian Mono 500;600.

   Three tiers (D34; the formulas and the full inventory: docs/token-map.md):
   1. Primitives: colours named by palette meaning, scales by value. Components may use the spacing, radius,
      icon-size, border-width, opacity, motion and effect primitives
      directly; never a colour or type primitive.
   2. Roles, named by purpose: colour (the @roles block), the spacing and
      radius roles that 3+ components share, layout and type (the
      @layout-tokens block, values per mode).
   3. Component tokens, named after their component, used only inside it.
   ========================================================================== */
:root {
  /* ---------- primitives ---------- */
  /* colour: --color-<palette name>, named by meaning (D69): main (the page navy),
     main-raised, main-shade (navy at 20%), accent, accent-deep, accent-light, accent-muted
     (a muted violet at 32%), secondary (the light grey) and its subtle (60%), muted (40%)
     and tint (20%) steps, white and white-frost (50%) */
  --color-main: #100f2e;
  --color-main-raised: #1c1b43;
  --color-accent: #4e50e6;
  --color-accent-deep: #4c4ee0; /* Ioli's value for the accent on light surfaces (D68): 4.63:1 on secondary; accent is 4.45:1 */
  --color-accent-light: #7e80ff;
  --color-secondary: #e0e1e7;
  --color-white: #ffffff;
  --color-secondary-subtle: rgba(224, 225, 231, 0.6);
  --color-secondary-muted: rgba(224, 225, 231, 0.4);
  --color-secondary-tint: rgba(224, 225, 231, 0.2);
  --color-white-frost: rgba(255, 255, 255, 0.5); /* the frosted surfaces (D63, D69) */
  --color-main-shade: rgba(16, 15, 46, 0.2);
  --color-accent-muted: rgba(122, 120, 204, 0.32); /* Figma stroke #7A78CC at 32% (1330:1695) */
  /* spacing: --spacing-<px> */
  --spacing-4: 4px;
  --spacing-6: 6px;
  --spacing-8: 8px;
  --spacing-12: 12px;
  --spacing-16: 16px;
  --spacing-20: 20px;
  --spacing-24: 24px;
  --spacing-40: 40px;
  --spacing-60: 60px;
  --spacing-80: 80px;
  --spacing-100: 100px;
  --spacing-200: 200px;
  /* radius: --radius-<px> */
  --radius-6: 6px;
  --radius-8: 8px;
  --radius-12: 12px;
  --radius-20: 20px;
  --radius-24: 24px;
  --radius-40: 40px;
  --radius-100: 100px;
  /* icon size: --size-icon-<px> */
  --size-icon-16: 16px;
  --size-icon-20: 20px;
  --size-icon-24: 24px;
  --size-icon-36: 36px;
  --size-icon-60: 60px;
  /* border width: --border-<px>, a decimal point written as "-" */
  --border-0-5: 0.5px;
  --border-1: 1px;
  --border-2: 2px;
  /* opacity: --opacity-<percent> */
  --opacity-60: 0.6;
  --opacity-65: 0.65; /* code only: the Figma node uses a typed-in value (1328:8463) */
  --opacity-80: 0.8;  /* code only: the Figma nodes use a typed-in value (1330:1688, 1690–1692) */
  /* type: --font-size-<px>, --font-weight-<CSS weight name>,
     --line-height-<percent>, --font-<family> */
  --font-size-10: 10px;
  --font-size-14: 14px;
  --font-size-16: 16px;
  --font-size-18: 18px;
  --font-size-20: 20px;
  --font-size-22: 22px;
  --font-size-26: 26px;
  --font-size-32: 32px;
  --font-size-36: 36px;
  --font-size-54: 54px;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --line-height-100: 1; /* code only: Figma keeps line heights inside the text styles */
  --line-height-110: 1.1; /* code only: Figma keeps line heights inside the text styles */
  --line-height-135: 1.35; /* code only: Figma keeps line heights inside the text styles */
  --line-height-150: 1.5; /* code only: Figma keeps line heights inside the text styles */
  --letter-spacing-0-5: 0.5px; /* code only: Figma keeps letter spacing inside the text styles */
  --font-literata: 'Literata', Georgia, serif; /* the home page's headings (italic) */
  --font-funnel-sans: 'Funnel Sans', -apple-system, BlinkMacSystemFont, sans-serif; /* the home page's body text */
  --font-martian-mono: 'Martian Mono', ui-monospace, Menlo, monospace; /* the header's labels (Figma 1835:4421); to become the font of captions and labels site-wide (D59) */
  /* motion: --duration-<ms>, --ease-<curve name> */
  --duration-80: 80ms; /* code only: Figma has no motion variables */
  --duration-200: 200ms; /* code only: Figma has no motion variables */
  --duration-400: 400ms; /* code only: Figma has no motion variables */
  --duration-500: 500ms; /* code only: Figma has no motion variables */
  --duration-800: 800ms; /* code only: Figma has no motion variables */
  --duration-600: 600ms; /* code only: Figma has no motion variables */
  --duration-1400: 1400ms; /* code only: Figma has no motion variables */
  --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1); /* code only: Figma has no motion variables */
  --ease-fold: cubic-bezier(0.68, -0.25, 0.27, 1.25); /* the menu icon's fold, from zainabkabira.com's menu */ /* code only: Figma has no motion variables */
  --ease-fast-out-slow-in: cubic-bezier(0.4, 0, 0.2, 1); /* code only: Figma has no motion variables */
  /* effects: Figma effect styles shadow/*, paint style gradient/angular-accent */
  --shadow-sm: 0 4px 12px 0 var(--color-main-shade); /* code only: Figma has it as an effect style */
  --shadow-md: 0 4px 12px 8px var(--color-main-shade); /* code only: Figma has it as an effect style */
  --shadow-lg: 0 4px 20px 12px var(--color-main-shade); /* code only: Figma has it as an effect style */
  --gradient-angular-accent: url(../assets/images/gemstones/feature-gradient.png); /* Figma paint style gradient/angular-accent, baked to a PNG (feature-gradient/gen.py) */ /* code only: Figma has it as a paint style or a node fill */
  --gradient-linear-accent: linear-gradient(-0.7442300687484931deg, var(--color-accent) 12.183%, var(--color-main) 83.302%); /* home contact (Figma 1328:8455), stops taken literally */ /* code only: Figma has it as a paint style or a node fill */

  /* ---------- component tokens: --<component>-<property>, used only inside the component ---------- */
  /* case-study ToC (docs/components/toc.md); toc-m = the .wg-toc-m component */
  --toc-text: var(--text-secondary); /* code only: ToC component colour; Figma binds the role's primitive */
  --toc-text-on-accent: var(--text-body); /* code only: ToC component colour; Figma binds the role's primitive */
  --toc-surface: var(--surface-page); /* code only: ToC component colour; Figma binds the role's primitive */
  --toc-border: var(--border-color-subtle); /* code only: ToC component colour; Figma binds the role's primitive */
  --toc-focus-ring: var(--focus-ring); /* code only: ToC component colour; Figma binds the role's primitive */
  --toc-border-on-accent: var(--border-color-divider); /* overlay edge on the accent: 4.45:1 (the 60% border was 2.57:1) */ /* code only: ToC component colour; Figma binds the role's primitive */
  --toc-surface-on-accent: var(--surface-accent); /* the iPad overlay over an accent area */
  --toc-rows: 11; /* the number of rows of the rail: each page sets its own (Search has 10), so the rail centres on what it holds */ /* code only: Figma draws the rows */
  --toc-row: var(--spacing-24); /* aliases the scale step, as Figma toc/row does: a ToC row is one spacing step tall */
  --toc-row-hover: 32px;
  --toc-row-overlay: var(--toc-row-hover); /* 781–1279 overlay rows */
  --toc-dash: 3px;
  --toc-label-max: 220px; /* the widest a ToC label may get */
  --toc-z: 100; /* code only: Figma has no z-index variables */
  --toc-pill-top: calc((var(--size-header) - var(--site-header-control)) / 2); /* Gemstones phone: the floating pills' top edge, 38 (Figma 1861:8936) */ /* code only: derived from the header tokens */
  --toc-overlay-width: 200px; /* the iPad ToC panel (781–1279), Figma 1862:9895: 20 padding, 160 rows */ /* code only: the Figma node uses a typed-in value */
  --toc-glass: var(--site-header-glass); /* Gemstones phone: the panel and the open list are frosted like the pills */ /* code only: see --site-header-glass */
  --toc-glass-blur: var(--site-header-glass-blur); /* code only: see --site-header-glass */
  --toc-pill-row: var(--size-header); /* Gemstones phone: the header's bottom edge (132, Figma 1861:9083): the pinned panel, the open list and every scroll offset start there, so the pills' row stays intact (D64) */ /* code only: derived from the header tokens */
  /* chips: UI of the showcased project (the depicted product), not part of the design system; Figma holds these values raw: the "Product UI" collection was deleted, D70 */
  --chip-text: #18181b; /* code only: the depicted product's own value, a raw value in Figma */
  --chip-surface: var(--color-white); /* code only: the depicted product's own value, a raw value in Figma */
  --chip-border: #d4d4d8; /* code only: the depicted product's own value, a raw value in Figma */
  --chip-surface-active: #dde2ee; /* code only: the depicted product's own value, a raw value in Figma */
  --chip-border-active: #6b80ae; /* code only: the depicted product's own value, a raw value in Figma */
  --chip-radius: 4px; /* code only: the depicted product's own value, a raw value in Figma */
  --chip-radius-active: 6px; /* code only: the depicted product's own value, a raw value in Figma */
  --chip-padding-y: 2px; /* code only: the depicted product's own value, a raw value in Figma */
  --chip-padding-x: 6px; /* code only: the depicted product's own value, a raw value in Figma */
  --chip-padding-active-y: 10px; /* code only: the depicted product's own value, a raw value in Figma */
  --chip-padding-active-x: 8px; /* code only: the depicted product's own value, a raw value in Figma */
  --chip-gap: 4px; /* code only: the depicted product's own value, a raw value in Figma */
  --chip-line-height: 20px; /* code only: Figma keeps line heights inside the text styles */
  --chip-font: var(--font-weight-regular) var(--font-size-14)/var(--chip-line-height) 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; /* the depicted product's own font, a raw value on purpose: not part of this design system */ /* code only: Figma types the chip text */
  --chip-glow-rest: 0 0 0 rgba(110, 128, 230, 0); /* code only: Figma has the effect style chip/glow-active (rest = no glow) */
  --chip-glow-active: 0 0 18px rgba(110, 128, 230, 0.5); /* code only: Figma has the effect style chip/glow-active (rest = no glow) */
  /* chart (.wg-graph): off the spacing scale, from Figma */
  --chart-row-gap: 14px;
  --chart-label-gap: 6px;
  --chart-label-row: 24px;
  --chart-thumb: 32px;
  --chart-thumb-compact: 26px;
  /* video play button (.wg-video-btn) */
  --video-btn-size: 56px;
  /* hero visuals (.wg-hero-visuals): the depicted browser's own text */
  --hero-visuals-font-size: 11px; /* the depicted browser's own text size, off the type scale on purpose */ /* code only: Figma types the mock's text */
  /* rough.js sketches (.wg-sketch): hand-lettered labels */
  --sketch-font: 'Architects Daughter', var(--font-funnel-sans), cursive; /* code only: Figma types the sketch lettering */
  --sketch-title-size: var(--font-size-20); /* code only: Figma types the sketch lettering */
  /* home components (Figma 1330:1730): typed-in sizes in Figma */
  --site-header-gradient: linear-gradient(to top, transparent, var(--color-main) 25.602%); /* Figma 1328:9259, stops taken literally */ /* code only: Figma has it as a paint style or a node fill */
  --site-header-z: 100; /* code only: Figma has no z-index variables */
  --site-header-glass: var(--surface-frost); /* the frosted surfaces of the header: white at 50% (Figma 1816:3614), with the blur below */ /* code only: the surface/frost role in Figma */
  --site-header-glass-blur: 30px; /* Figma's background blur 60 = 30px in CSS (Figma 1835:4421) */ /* code only: typed-in effect in Figma */
  --site-header-control: 56px; /* every header surface is 56px tall: the widget, the nav bar, the résumé pill, the phone menu button (Figma 1835:4421) */ /* code only: typed-in value in Figma */
  --site-header-tracking: var(--letter-spacing-0-5); /* the header labels' letter spacing */ /* code only: typed in Figma */
  --site-header-label: var(--type-label-nav); /* the header labels: caption, nav items, résumé (uppercase, tracked): the label-nav role */ /* code only: the label-nav text style in Figma */
  --menu-toggle-size: var(--site-header-control); /* the phone menu button is a header surface too: 56px (Figma 1835:4450) */ /* code only: see --site-header-control */
  --menu-glass: var(--site-header-glass); /* the phone menu button is a header surface too */ /* code only: see --site-header-glass */
  --menu-glass-pressed: var(--surface-frost-active); /* the phone menu button while pressed, to open and to close (not in Figma) */ /* code only: see --surface-frost-active */
  --menu-glass-blur: var(--site-header-glass-blur); /* code only: see --site-header-glass */
  --nav-pill-control: var(--site-header-control); /* the nav pill is the header's frosted control, shared with the case studies (D64): 56px tall */ /* code only: see --site-header-control */
  --nav-pill-glass: var(--site-header-glass); /* code only: see --site-header-glass */
  --nav-pill-glass-active: var(--surface-frost-active); /* hover and pressed: white (D69) */ /* code only: see --surface-frost-active */
  --nav-pill-glass-blur: var(--site-header-glass-blur); /* code only: see --site-header-glass */
  --nav-pill-label: var(--site-header-label); /* code only: see --site-header-label */
  --nav-pill-tracking: var(--site-header-tracking); /* code only: see --site-header-tracking */
  --top-nav-avatar: 40px; /* Figma 1334:803 */ /* code only: the Figma node uses a typed-in value */
  --location-widget-photo: 44px; /* the size the sky is drawn at (D56); the tile shows it scaled */ /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --location-widget-tile: 56px; /* Figma 1835:4235 / 1835:4234: the tile, the left half of the widget pill, on every width */ /* code only: the Figma node uses a typed-in value */
  --location-widget-sky-scale: calc(56 / 44); /* the sky is drawn on 44px; the 56px tile shows it at its own size */ /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  /* location widget sky (D56): the tile is drawn from the weather and the sun height (js/home/sky.js reads these).
     Stage palettes by sun height (night, twilight, low sun, mid sun, day; dawn and dusk differ); sky top/mid/bottom, cloud light and cloud shade. */
  --location-widget-sky-night-top: #060a28; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --location-widget-sky-night-mid: #111a55; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --location-widget-sky-night-bot: #22307f; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --location-widget-sky-night-hi: #a9b2e6; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --location-widget-sky-night-lo: #3a4488; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --location-widget-sky-twi-dusk-top: #2b2d7e; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --location-widget-sky-twi-dusk-mid: #7a4fa3; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --location-widget-sky-twi-dusk-bot: #e0709a; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --location-widget-sky-twi-dusk-hi: #eea2bd; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --location-widget-sky-twi-dusk-lo: #47397f; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --location-widget-sky-twi-dawn-top: #2b3a85; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --location-widget-sky-twi-dawn-mid: #6f5aa8; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --location-widget-sky-twi-dawn-bot: #d98aa5; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --location-widget-sky-twi-dawn-hi: #f4b8cb; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --location-widget-sky-twi-dawn-lo: #4d4888; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --location-widget-sky-low-dusk-top: #5560d8; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --location-widget-sky-low-dusk-mid: #c88ad8; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --location-widget-sky-low-dusk-bot: #ffa062; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --location-widget-sky-low-dusk-hi: #ffd6b4; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --location-widget-sky-low-dusk-lo: #7f69aa; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --location-widget-sky-low-dawn-top: #6f84e6; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --location-widget-sky-low-dawn-mid: #f0a3cc; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --location-widget-sky-low-dawn-bot: #ffc58a; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --location-widget-sky-low-dawn-hi: #ffe0e8; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --location-widget-sky-low-dawn-lo: #9185ba; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --location-widget-sky-mid-dusk-top: #5b84f2; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --location-widget-sky-mid-dusk-mid: #9db8f5; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --location-widget-sky-mid-dusk-bot: #ffd7b0; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --location-widget-sky-mid-dusk-hi: #fff2e2; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --location-widget-sky-mid-dusk-lo: #9aa9cf; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --location-widget-sky-mid-dawn-top: #5f88f2; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --location-widget-sky-mid-dawn-mid: #a3bff5; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --location-widget-sky-mid-dawn-bot: #ffe4c6; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --location-widget-sky-mid-dawn-hi: #fff4ea; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --location-widget-sky-mid-dawn-lo: #9eadd2; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --location-widget-sky-day-top: #4a82f5; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --location-widget-sky-day-mid: #86b2fb; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --location-widget-sky-day-bot: #c3dcff; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --location-widget-sky-day-hi: #ffffff; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --location-widget-sky-day-lo: #a6b9da; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  /* mix targets and fixed lights */
  --location-widget-sky-rose: #e296b8; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --location-widget-sky-lead: #4a508e; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --location-widget-sky-horizon: #ff965a; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --location-widget-sky-sun-core-high: #fffce6; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --location-widget-sky-sun-core-low: #ffe2aa; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --location-widget-sky-sun-halo-high: #fff4c4; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --location-widget-sky-sun-halo-low: #ffa862; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --location-widget-sky-glow: #bec8ff; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --location-widget-sky-flash-tint: #cdd7ff; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --location-widget-sky-drop: #ecf4ff; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --location-widget-sky-drop-night: #aab6f0; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --location-widget-sky-white: var(--color-white); /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  /* fog image colour maps (dark, mid, light) for dawn, dusk and night; by day the image is used as it is */
  --location-widget-sky-fog-dawn-dark: #5a4a7e; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --location-widget-sky-fog-dawn-mid: #9a86b2; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --location-widget-sky-fog-dawn-light: #e6c4d0; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --location-widget-sky-fog-dusk-dark: #4a4276; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --location-widget-sky-fog-dusk-mid: #8a79a8; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --location-widget-sky-fog-dusk-light: #e9c2b6; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --location-widget-sky-fog-night-dark: #11143a; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --location-widget-sky-fog-night-mid: #252b5e; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --location-widget-sky-fog-night-light: #4b5290; /* code only: the sky tile is a coded spec, not a Figma variable (D56) */
  --card-size: 260px; /* home project cards (Figma 1330:1689–1692) */ /* code only: the Figma node uses a typed-in value */
  --graph-sticker: 60px; /* logo stickers (Figma 1330:1694) */ /* code only: the Figma node uses a typed-in value */
  --colophon-logo: 24px; /* Figma 1716:8022 */ /* code only: the Figma node uses a typed-in value */
  --menu-z: 101; /* phone menu overlay, above the header */ /* code only: Figma has no z-index variables */
  --menu-toggle-z: 102; /* its button, above the overlay so it stays the close control */ /* code only: Figma has no z-index variables */
  --hint-z: 3; /* above the neighbouring stickers and links */ /* code only: Figma has no z-index variables */
  /* The centre line's Figma fill is a skewed conic gradient; on a 2px line it
     renders as accent 75% → 50% over surface-dark, top to bottom (measured in
     experiments/home-centerline/, 2026-10-21). */
  --scroll-line-gradient: linear-gradient(to bottom, color-mix(in srgb, var(--color-accent) 75%, var(--color-main)), color-mix(in srgb, var(--color-accent) 50%, var(--color-main))); /* code only: Figma has it as a paint style or a node fill */

  /* @roles:start — roles, named by purpose (D17; by role since D32; tiers D34).
     Colour roles alias exactly one colour primitive; components use them, never
     a --color-* primitive. A spacing or radius role exists only if 3+ distinct
     components share it (consumer counts: docs/token-map.md); everything else
     uses the scale step. Figma: the Semantic collection, same names with "/". */
  /* text colour */
  --text-body: var(--color-white); /* paragraphs and labels on the page surface */
  --text-secondary: var(--color-secondary); /* headings, legends, labels and nav items: softer than body (14.2:1 vs 18.6:1); their emphasis comes from size and weight, not colour */
  --text-accent: var(--color-accent-light); /* accent for text on the page surface: 5.7:1 (accent is 3.2:1) */
  --text-accent-on-light: var(--color-accent-deep); /* accent text on light surfaces: callout, hint, outcomes card; 4.63:1 on secondary at every size and device (D68) */
  --text-on-light: var(--color-main); /* text on light surfaces: hint, callout */
  /* surface (background) */
  --surface-page: var(--color-main); /* the page and sketch background */
  --surface-light: var(--color-secondary); /* callouts, the hint bar, light cards */
  --surface-accent: var(--color-accent); /* solution panel, metadata card, primary button */
  --surface-raised: var(--color-main-raised); /* raised cards, the ToC panel, home cards */
  --surface-media: var(--color-white); /* screenshot and browser frames */
  --surface-muted: var(--color-secondary-muted); /* chart bars */
  --surface-tint: var(--color-secondary-tint);       /* secondary button, nav pill, active nav item, chip hover */
  --surface-tint-hover: var(--color-secondary-muted); /* secondary button hover */
  --surface-shade: var(--color-main-shade);    /* action chips on the accent gradient */
  --surface-frost-active: var(--color-white); /* hover and pressed state of the frosted surfaces (nav pill, menu button): solid white */
  --surface-frost: var(--color-white-frost);        /* frosted surfaces: nav pills, the phone ToC, the Before/After pills */
  /* border colour (the border-color- prefix keeps them apart from the --border-<px> widths) */
  --border-color-divider: var(--color-secondary); /* dividers: legend rule, comparison line, sketch strokes */
  --border-color-subtle: var(--color-secondary-subtle);   /* colophon top rule */
  --border-color-graph: var(--color-accent-muted);  /* home graph edges */
  /* focus */
  --focus-ring: var(--color-secondary); /* the focus outline on dark and accent */
  --focus-ring-on-light: var(--color-main); /* the focus ring on light controls (video button) */
  /* gap = the distance between elements, whether it is set with gap, margin or scroll-margin */
  --gap-hair: var(--spacing-4); /* a number to its label, nav items, colophon lines */
  --gap-tight: var(--spacing-8); /* icon to label, label to value */
  --gap-stack: var(--spacing-12); /* heading to text, items in a list */
  --gap-group: var(--spacing-20); /* between groups inside a block */
  --gap-block: var(--spacing-40); /* between blocks, and between columns at ≥1280 */
  --gap-section: var(--spacing-60); /* between groups of areas; scroll margins */
  /* inset = padding inside an element */
  --inset-tight: var(--spacing-8); /* chips, hints, the legend rule to its text */
  --inset-compact: var(--spacing-12); /* bars and compact cards: buttons, hint, search */
  --inset-card: var(--spacing-20); /* inside cards and callouts */
  --inset-panel: var(--spacing-24); /* inside large panels */
  --inset-wide: var(--spacing-40); /* the header, outcomes card, next-case band */
  /* radius by purpose */
  --radius-compact: var(--radius-8);   /* small elements: visuals and bars in compact layouts, the location photo, hints, action chips */
  --radius-card: var(--radius-12); /* cards, screenshots, callouts, sketch frames */
  --radius-pill: var(--radius-100); /* buttons, nav pill, search bar */
  /* @roles:end */
  /* size and focus roles: the same measure for every component */
  --size-touch: 44px;   /* minimum target size (WCAG 2.5.8 floor) */
  --size-header: 132px; /* home fixed header, fade included */ /* code only: the Figma node uses a typed-in value */
  --focus-offset: 3px; /* code only: Figma can't offset strokes */
  --focus-offset-inset: -2px; /* code only: Figma can't offset strokes */
}

/* @layout-tokens:start — layout and type roles, values per mode (Figma collection
   "Layout", modes "up to 780" / "781–1024" / "1025–1279" / "1280 and up"). Defined only here. */
:root {
  --layout-page-width: 1280px;
  --layout-content-width: 890px;
  --layout-columns: 6;
  --layout-gutter: var(--spacing-40);
  --layout-margin: calc((var(--layout-page-width) - var(--layout-content-width)) / 2);
  --layout-third: calc((var(--layout-content-width) - 2 * var(--layout-gutter)) / 3); /* code only: derived from the layout tokens */
  --layout-two-thirds: calc(2 * var(--layout-third) + var(--layout-gutter)); /* code only: derived from the layout tokens */
  --layout-section-padding-y: var(--spacing-100);
  --layout-scroll-gap: var(--spacing-200);
  /* type roles: one name per job, the size follows the mode (D15, D34, D69).
     display, heading and statement step down at ≤780 (the iPad takes the desktop size).
     --type-<role>-<property> are the per-mode parts (Figma Layout type/*);
     --type-<role> is the whole text style for the CSS font shorthand
     (Figma: the text style text/<role path>). */
  --type-display-size: var(--font-size-54);
  --type-heading-size: var(--font-size-36);
  --type-statement-size: var(--font-size-26);
  --type-body-default-size: var(--font-size-16); /* 16 at every width (Figma) */
  --type-body-highlight-size: var(--font-size-18); /* 18 at every width (Figma) */
  --type-icon-section-size: var(--size-icon-60); /* the emoji above a home section title: 60, 36 at up to 780 (D69) */
  --type-strong-weight: var(--font-weight-bold); /* emphasis inside body text */ /* code only: Figma bolds a text run */
}
@media (min-width: 1025px) and (max-width: 1279px) {
  :root { --layout-content-width: 100%; --layout-gutter: var(--spacing-20); --layout-margin: var(--spacing-80); }
}
@media (min-width: 781px) and (max-width: 1024px) {
  :root { --layout-content-width: 100%; --layout-gutter: var(--spacing-20); --layout-margin: var(--spacing-40); }
}
@media (max-width: 780px) {
  :root {
    --layout-columns: 4; --layout-content-width: 100%; --layout-gutter: var(--spacing-20); --layout-margin: var(--spacing-24);
    --layout-section-padding-y: var(--spacing-60); --layout-scroll-gap: var(--spacing-60);
    --type-display-size: var(--font-size-32); /* the display type is desktop-size from 781px: the iPad takes it; only the phone steps down */
    --type-heading-size: var(--font-size-32);
    --type-statement-size: var(--font-size-22);
    --type-icon-section-size: var(--size-icon-36);
  }
}
/* The whole text styles, after the per-mode parts above (custom properties
   resolve on :root, so each width gets its own sizes). */
:root {
  --type-display: italic var(--font-weight-semibold) var(--type-display-size)/var(--line-height-110) var(--font-literata); /* code only: Figma has it as a text style */
  --type-heading: italic var(--font-weight-semibold) var(--type-heading-size)/var(--line-height-110) var(--font-literata); /* code only: Figma has it as a text style */
  --type-statement: italic var(--font-weight-medium) var(--type-statement-size)/var(--line-height-110) var(--font-literata); /* code only: Figma has it as a text style */
  --type-body-highlight: var(--font-weight-regular) var(--type-body-highlight-size)/var(--line-height-150) var(--font-funnel-sans); /* code only: Figma has it as a text style */
  --type-body-default: var(--font-weight-regular) var(--type-body-default-size)/var(--line-height-150) var(--font-funnel-sans); /* code only: Figma has it as a text style */
  --type-label-section: var(--font-weight-medium) var(--font-size-10)/var(--line-height-135) var(--font-martian-mono); /* code only: Figma has it as a text style */
  --type-label-nav: var(--font-weight-semibold) var(--font-size-10)/var(--line-height-135) var(--font-martian-mono); /* code only: Figma has it as a text style */
  --type-caption: var(--font-weight-medium) var(--font-size-10)/var(--line-height-135) var(--font-martian-mono); /* code only: Figma has it as a text style */
}
/* @layout-tokens:end */
