/* ==========================================================================
   claude-web.css — Claude aesthetic for websites and web apps
   Warm paper, ink text, serif headlines, one clay accent, calm motion.

   · Self-contained: palette, fonts, light/dark, fluid type, base layer,
     layout helpers and components. Load fonts in your HTML (see
     landing-starter.html); this file does not @import anything.
   · Dark mode: follows prefers-color-scheme; force it with
     <html data-theme="dark"> or <html data-theme="light">.
   · Chinese pages: <html lang="zh-CN">. Headlines switch to weight 500,
     tracking 0 and looser leading automatically (see :lang(zh) block).
   · Colour values are identical to assets/tokens.json. Layout values were
     checked against anthropic.com / claude.com stylesheets (Nov 2026).
   · Docs: references/web-ui.md
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. Local-first CJK fonts
      Google Fonts' @font-face shadows a locally installed font of the same
      name, so an installed Noto Serif SC would still be downloaded. These
      aliases try the installed copy first (by exact weight, so a stray
      "Heavy-only" install is never picked for 500). If nothing matches, the
      stack falls through to the web font, then to system fonts.
   -------------------------------------------------------------------------- */
@font-face { font-family: "Local Serif SC"; font-weight: 400; font-display: swap;
  src: local("Noto Serif SC"), local("Noto Serif SC Regular"), local("NotoSerifSC-Regular"), local("Source Han Serif SC Regular"), local("SourceHanSerifSC-Regular"); }
@font-face { font-family: "Local Serif SC"; font-weight: 500; font-display: swap;
  src: local("Noto Serif SC Medium"), local("NotoSerifSC-Medium"), local("Source Han Serif SC Medium"), local("SourceHanSerifSC-Medium"); }
@font-face { font-family: "Local Serif SC"; font-weight: 600; font-display: swap;
  src: local("Noto Serif SC SemiBold"), local("NotoSerifSC-SemiBold"), local("Source Han Serif SC SemiBold"), local("SourceHanSerifSC-SemiBold"); }
@font-face { font-family: "Local Sans SC"; font-weight: 400; font-display: swap;
  src: local("Noto Sans SC"), local("Noto Sans SC Regular"), local("NotoSansSC-Regular"), local("Source Han Sans SC Regular"), local("SourceHanSansSC-Regular"); }
@font-face { font-family: "Local Sans SC"; font-weight: 500; font-display: swap;
  src: local("Noto Sans SC Medium"), local("NotoSansSC-Medium"), local("Source Han Sans SC Medium"), local("SourceHanSansSC-Medium"); }
@font-face { font-family: "Local Sans SC"; font-weight: 600; font-display: swap;
  src: local("Noto Sans SC SemiBold"), local("NotoSansSC-SemiBold"), local("Noto Sans SC Bold"), local("NotoSansSC-Bold"), local("Source Han Sans SC Bold"), local("SourceHanSansSC-Bold"); }

/* --------------------------------------------------------------------------
   1. Palette (raw values — do not use directly in components)
   -------------------------------------------------------------------------- */
:root {
  --ivory: #FAF9F5;          /* gray-050 */
  --ivory-100: #F5F4ED;      /* gray-100 */
  --ivory-medium: #F0EEE6;   /* gray-150 */
  --ivory-dark: #E8E6DC;     /* gray-200 */
  --gray-250: #DEDCD1;
  --cloud-light: #D1CFC5;    /* gray-300 */
  --gray-350: #C2C0B6;
  --cloud-medium: #B0AEA5;   /* gray-400 */
  --cloud-dark: #87867F;     /* gray-500 */
  --gray-550: #73726C;
  --slate-light: #5E5D59;    /* gray-600 */
  --gray-650: #4D4C48;
  --slate-medium: #3D3D3A;   /* gray-700 */
  --gray-750: #30302E;
  --gray-800: #262624;
  --gray-850: #1F1E1D;
  --slate: #141413;          /* gray-950 */

  --clay: #D97757;
  --clay-deep: #C6613F;

  --oat: #E3DACC;
  --cactus: #BCD1CA;
  --heather: #CBCADB;
  --coral: #EBCECE;
  --olive: #788C5D;
  --sky: #6A9BCC;
  --fig: #C46686;
  --kraft: #D4A27F;
  --manilla: #EBDBBC;

  /* interaction-only colours (anthropic.com: --color-error, focus rings) */
  --error: #BF4D43;
  --focus-light: #154C92;
  --focus-dark: #90C3F6;

  /* ------------------------------------------------------------------------
     2. Type
     ------------------------------------------------------------------------ */
  /* Latin first, then the local CJK alias, then the web font, then system. */
  --font-serif: "Source Serif 4", "Local Serif SC", "Noto Serif SC", "Songti SC", "STZhongsong", Georgia, serif;
  /* big headlines (display / h1 / number). Online, Google's variable Source Serif 4 already uses display
     shapes at large sizes; naming the Display family first picks up a locally installed static Display cut
     offline. Display has no 500: at 500 you get Display Regular. */
  --font-display: "Source Serif 4 Display", "Source Serif 4", "Local Serif SC", "Noto Serif SC", "Songti SC", "STZhongsong", Georgia, serif;
  --font-sans: "Inter", "Local Sans SC", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Noto Sans SC", ui-monospace, monospace;

  /* ------------------------------------------------------------------------
     3. Layout & shape
     ------------------------------------------------------------------------ */
  --w-page: 90rem;           /* 1440 — full-bleed grid limit (claude.com) */
  --w-content: 75rem;        /* 1200 — default .container */
  --w-narrow: 45rem;         /* 720  — anthropic.com reading max */
  --w-reading: 65ch;         /* prose measure; zh → 36em */
  --gutter: clamp(1.25rem, 0.28rem + 4.13vw, 4rem);          /* 20 → 64 */
  --grid-gap: clamp(1rem, 0.65rem + 1.5vw, 2rem);             /* 16 → 32 */
  --section-y: clamp(4rem, 2.59rem + 6.01vw, 8rem);           /* 64 → 128 */
  --section-y-sm: clamp(3rem, 2.3rem + 3vw, 5rem);            /* 48 → 80 */
  --section-y-lg: clamp(5rem, 3.24rem + 7.51vw, 10rem);       /* 80 → 160 */
  --nav-h: 4rem;             /* 64; 72 from 768px */
  --card-pad: clamp(1.25rem, 0.9rem + 1.5vw, 2rem);           /* 20 → 32 */

  --radius-sm: 4px;          /* inline code, checkbox */
  --radius-control: 8px;     /* buttons, inputs, menus */
  --radius-card: 12px;       /* cards */
  --radius-panel: 16px;      /* big panels, screenshot plates, dialogs */
  --radius-pill: 999px;      /* tags */

  --shadow-lift: 0 1px 2px rgba(20, 20, 19, .04), 0 8px 24px rgba(20, 20, 19, .06);
  --shadow-overlay: 0 2px 6px rgba(20, 20, 19, .06), 0 24px 56px rgba(20, 20, 19, .14);

  /* ------------------------------------------------------------------------
     4. Motion
     ------------------------------------------------------------------------ */
  --ease-out: cubic-bezier(.33, 1, .68, 1);
  --ease-standard: cubic-bezier(.4, 0, .2, 1);
  --dur-fast: 150ms;         /* hover colour */
  --dur: 200ms;              /* most UI */
  --dur-slow: 300ms;         /* dialogs, menus */
  --dur-reveal: 700ms;       /* scroll reveal */
  --rise: 12px;

  /* ------------------------------------------------------------------------
     5. Fluid type scale (Latin defaults; :lang(zh) overrides below)
        375px → 1440px viewport
     ------------------------------------------------------------------------ */
  --fs-display: clamp(2.75rem, 1.96rem + 3.38vw, 5rem);      /* 44 → 80 */
  --fs-h1: clamp(2.125rem, 1.64rem + 2.07vw, 3.5rem);        /* 34 → 56 */
  --fs-h2: clamp(1.75rem, 1.44rem + 1.31vw, 2.625rem);       /* 28 → 42 */
  --fs-h3: clamp(1.3125rem, 1.2rem + 0.47vw, 1.625rem);      /* 21 → 26 */
  --fs-lead: clamp(1.125rem, 1.04rem + 0.38vw, 1.375rem);    /* 18 → 22 */
  --fs-body: clamp(1rem, 0.96rem + 0.19vw, 1.125rem);        /* 16 → 18 */
  --fs-small: clamp(0.875rem, 0.85rem + 0.09vw, 0.9375rem);  /* 14 → 15 */
  --fs-eyebrow: 0.8125rem;                                   /* 13 */
  --fs-number: clamp(3.5rem, 2.27rem + 5.26vw, 7rem);        /* 56 → 112 */

  --lh-display: 1.08;  --lh-h1: 1.12;  --lh-h2: 1.2;  --lh-h3: 1.3;
  --lh-lead: 1.5;      --lh-body: 1.6; --lh-small: 1.5;
  --wt-display: 600;   --wt-h1: 600;   --wt-h2: 500;  --wt-h3: 500;
  --tr-display: -0.03em; --tr-h1: -0.02em; --tr-h2: -0.01em; --tr-h3: -0.005em;
  --tr-eyebrow: 0.12em;
}

/* Chinese: smaller display sizes, looser leading, 500 weight, tracking 0.
   lang is inherited, so a lang="en" island inside a zh page resets below. */
:lang(zh), :lang(ja) {
  --fs-display: clamp(2.25rem, 1.63rem + 2.63vw, 4rem);     /* 36 → 64 */
  --fs-h1: clamp(1.875rem, 1.48rem + 1.69vw, 3rem);         /* 30 → 48 */
  --fs-h2: clamp(1.5625rem, 1.32rem + 1.03vw, 2.25rem);     /* 25 → 36 */
  --fs-h3: clamp(1.25rem, 1.16rem + 0.38vw, 1.5rem);        /* 20 → 24 */
  --fs-lead: clamp(1.0625rem, 1rem + 0.28vw, 1.25rem);      /* 17 → 20 */
  --fs-body: clamp(1rem, 0.98rem + 0.09vw, 1.0625rem);      /* 16 → 17 */
  --lh-display: 1.25;  --lh-h1: 1.3;  --lh-h2: 1.35;  --lh-h3: 1.45;
  --lh-lead: 1.75;     --lh-body: 1.75; --lh-small: 1.65;
  --wt-display: 500;   --wt-h1: 500;
  --tr-display: 0; --tr-h1: 0; --tr-h2: 0; --tr-h3: 0;
  --tr-eyebrow: 0.1em;
  --w-reading: 36em;
}
:lang(en) {
  --fs-display: clamp(2.75rem, 1.96rem + 3.38vw, 5rem);
  --fs-h1: clamp(2.125rem, 1.64rem + 2.07vw, 3.5rem);
  --fs-h2: clamp(1.75rem, 1.44rem + 1.31vw, 2.625rem);
  --fs-h3: clamp(1.3125rem, 1.2rem + 0.47vw, 1.625rem);
  --fs-lead: clamp(1.125rem, 1.04rem + 0.38vw, 1.375rem);
  --fs-body: clamp(1rem, 0.96rem + 0.19vw, 1.125rem);
  --lh-display: 1.08;  --lh-h1: 1.12;  --lh-h2: 1.2;  --lh-h3: 1.3;
  --lh-lead: 1.5;      --lh-body: 1.6; --lh-small: 1.5;
  --wt-display: 600;   --wt-h1: 600;
  --tr-display: -0.03em; --tr-h1: -0.02em; --tr-h2: -0.01em; --tr-h3: -0.005em;
  --tr-eyebrow: 0.12em;
  --w-reading: 65ch;
}
@media (min-width: 768px) { :root { --nav-h: 4.5rem; } }

/* --------------------------------------------------------------------------
   6. Colour roles — light (Paper)
   -------------------------------------------------------------------------- */
:root,
[data-theme="light"] {
  color-scheme: light;
  --bg: var(--ivory);                 /* page */
  --surface: var(--ivory-medium);     /* cards, panels, sidebar */
  --surface-2: var(--ivory-dark);     /* hover on surface, table head, secondary button */
  --border: var(--gray-250);          /* hairlines, dividers */
  --border-strong: var(--gray-350);   /* outline buttons, card outlines */
  --border-input: var(--cloud-dark);  /* form controls: 3.5:1 on bg (WCAG 1.4.11) */
  --text: var(--slate);               /* 17.5:1 on bg */
  --text-muted: var(--slate-light);   /* 6.3:1 on bg, 5.7:1 on surface */
  --text-faint: var(--gray-550);      /* 4.6:1 on bg — captions, placeholders */
  --accent: var(--clay);              /* graphics, highlight bar, hand-drawn marks */
  --accent-text: var(--clay-deep);    /* 3.85:1 — large text only */
  --accent-contrast: var(--slate);    /* text on clay: 5.9:1 */
  --primary: var(--slate);            /* default button */
  --primary-hover: var(--slate-medium);
  --primary-contrast: var(--ivory);
  --focus-ring: var(--focus-light);   /* 8.0:1 on bg */
  --success: var(--olive);
  --warning: var(--kraft);
  --danger: var(--error);             /* 4.6:1 on bg */
  --danger-contrast: var(--ivory);
  --success-tint: color-mix(in srgb, var(--olive) 16%, var(--bg));
  --warning-tint: var(--manilla);
  --danger-tint: var(--coral);
  --overlay: rgba(20, 20, 19, .4);
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%235E5D59' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
}

/* Colour roles — dark (Slate). Same block three times: system dark,
   forced dark, and .theme-ink sections. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: var(--slate);
    --surface: var(--gray-850);
    --surface-2: var(--gray-800);
    --border: var(--slate-medium);
    --border-strong: var(--gray-650);
    --border-input: var(--gray-550);
    --text: var(--ivory);
    --text-muted: var(--cloud-medium);
    --text-faint: var(--cloud-dark);
    --accent: var(--clay);
    --accent-text: var(--clay);
    --accent-contrast: var(--slate);
    --primary: var(--ivory);
    --primary-hover: var(--ivory-dark);
    --primary-contrast: var(--slate);
    --focus-ring: var(--focus-dark);
    --success: var(--olive);
    --warning: var(--kraft);
    --danger: var(--fig);
    --danger-contrast: var(--slate);
    --success-tint: color-mix(in srgb, var(--olive) 22%, var(--bg));
    --warning-tint: color-mix(in srgb, var(--kraft) 20%, var(--bg));
    --danger-tint: color-mix(in srgb, var(--fig) 20%, var(--bg));
    --overlay: rgba(0, 0, 0, .6);
    --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23B0AEA5' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  }
}
[data-theme="dark"],
.theme-ink {
  color-scheme: dark;
  --bg: var(--slate);
  --surface: var(--gray-850);
  --surface-2: var(--gray-800);
  --border: var(--slate-medium);
  --border-strong: var(--gray-650);
  --border-input: var(--gray-550);
  --text: var(--ivory);
  --text-muted: var(--cloud-medium);
  --text-faint: var(--cloud-dark);
  --accent: var(--clay);
  --accent-text: var(--clay);
  --accent-contrast: var(--slate);
  --primary: var(--ivory);
  --primary-hover: var(--ivory-dark);
  --primary-contrast: var(--slate);
  --focus-ring: var(--focus-dark);
  --success: var(--olive);
  --warning: var(--kraft);
  --danger: var(--fig);
  --danger-contrast: var(--slate);
  --success-tint: color-mix(in srgb, var(--olive) 22%, var(--bg));
  --warning-tint: color-mix(in srgb, var(--kraft) 20%, var(--bg));
  --danger-tint: color-mix(in srgb, var(--fig) 20%, var(--bg));
  --overlay: rgba(0, 0, 0, .6);
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23B0AEA5' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
}
/* an ink band inside an already-dark page lifts one step so it still reads as a band */
[data-theme="dark"] .theme-ink { --bg: var(--gray-850); --surface: var(--gray-800); --surface-2: var(--gray-750); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-ink { --bg: var(--gray-850); --surface: var(--gray-800); --surface-2: var(--gray-750); }
}

/* supporting-colour plates (illustration backgrounds, chapter bands) — ink text only */
.bg-surface { background: var(--surface); }
.bg-oat, .bg-cactus, .bg-heather, .bg-coral, .bg-manilla { color: var(--slate); }
.bg-oat { background: var(--oat); }
.bg-cactus { background: var(--cactus); }
.bg-heather { background: var(--heather); }
.bg-coral { background: var(--coral); }
.bg-manilla { background: var(--manilla); }

/* --------------------------------------------------------------------------
   7. Base layer (low specificity via :where)
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 1rem); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-feature-settings: "kern", "liga", "calt";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}
:lang(zh) { line-break: strict; }
:where(.theme-ink) { background: var(--bg); color: var(--text); }
:where(h1, h2, h3, h4, p, figure, blockquote, ul, ol, dl, dd) { margin: 0; }
:where(img, video, canvas) { display: block; max-width: 100%; height: auto; }
:where(svg) { flex-shrink: 0; }
:where(button, input, select, textarea) { font: inherit; color: inherit; }
:where(h1, h2, h3, h4) { font-family: var(--font-serif); color: var(--text); text-wrap: balance; }
:where(h1) { font-family: var(--font-display); font-size: var(--fs-h1); line-height: var(--lh-h1); font-weight: var(--wt-h1); letter-spacing: var(--tr-h1); }
:where(h2) { font-size: var(--fs-h2); line-height: var(--lh-h2); font-weight: var(--wt-h2); letter-spacing: var(--tr-h2); }
:where(h3) { font-size: var(--fs-h3); line-height: var(--lh-h3); font-weight: var(--wt-h3); letter-spacing: var(--tr-h3); }
:where(h4) { font: 600 1rem/1.4 var(--font-sans); }
:where(p, li) { text-wrap: pretty; }
:where(strong, b) { font-weight: 600; }
:where(small) { font-size: var(--fs-small); }
:where(hr) { height: 1px; margin: 0; border: 0; background: var(--border); }
::selection { background: color-mix(in srgb, var(--clay) 30%, transparent); }

/* links: ink + quiet underline that darkens on hover (both official sites do this) */
:where(a) {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .22em;
  text-decoration-color: var(--border-strong);
  transition: text-decoration-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
:where(a:hover) { text-decoration-color: currentColor; }
.link-quiet { text-decoration: none; color: var(--text-muted); }
.link-quiet:hover { color: var(--text); }
.link-arrow { text-decoration: none; font-weight: 500; display: inline-flex; align-items: center; gap: .375em; }
.link-arrow::after { content: "→"; transition: transform var(--dur) var(--ease-out); }
.link-arrow:hover::after { transform: translateX(3px); }

/* focus: one visible ring everywhere, keyboard only */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 3px; border-radius: 2px; }

/* --------------------------------------------------------------------------
   8. Type classes
   -------------------------------------------------------------------------- */
.t-display { font-family: var(--font-display); font-size: var(--fs-display); line-height: var(--lh-display); font-weight: var(--wt-display); letter-spacing: var(--tr-display); text-wrap: balance; }
.t-h1 { font-family: var(--font-display); font-size: var(--fs-h1); line-height: var(--lh-h1); font-weight: var(--wt-h1); letter-spacing: var(--tr-h1); }
.t-h2 { font-family: var(--font-serif); font-size: var(--fs-h2); line-height: var(--lh-h2); font-weight: var(--wt-h2); letter-spacing: var(--tr-h2); }
.t-h3 { font-family: var(--font-serif); font-size: var(--fs-h3); line-height: var(--lh-h3); font-weight: var(--wt-h3); letter-spacing: var(--tr-h3); }
.t-lead { font-family: var(--font-sans); font-size: var(--fs-lead); line-height: var(--lh-lead); color: var(--text-muted); }
.t-body { font-size: var(--fs-body); line-height: var(--lh-body); }
.t-small { font-size: var(--fs-small); line-height: var(--lh-small); color: var(--text-muted); }
.t-eyebrow { font: 500 var(--fs-eyebrow)/1.3 var(--font-sans); letter-spacing: var(--tr-eyebrow); text-transform: uppercase; color: var(--text-muted); }
.t-number { font-family: var(--font-display); font-size: var(--fs-number); line-height: 1; font-weight: 500; letter-spacing: -0.03em; font-variant-numeric: lining-nums tabular-nums; }
.t-quote { font-family: var(--font-serif); font-size: var(--fs-h2); line-height: var(--lh-h2); font-weight: 400; letter-spacing: var(--tr-h2); text-wrap: balance; }
.t-mono { font-family: var(--font-mono); font-size: .875em; }
.accent { color: var(--accent-text); }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.tabular { font-variant-numeric: tabular-nums; }
/* keep a Chinese phrase on one line: 开始之前，<span class="nobr">你可能想知道。</span> */
.nobr { white-space: nowrap; }
.measure { max-width: var(--w-reading); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* long-form text (docs, blog) */
.prose { max-width: var(--w-reading); }
.prose > * + * { margin-top: 1.1em; }
.prose > :where(h2) { margin-top: 2.2em; font-size: var(--fs-h3); line-height: var(--lh-h3); }
.prose > :where(h3) { margin-top: 1.8em; font: 600 1.0625rem/1.5 var(--font-sans); letter-spacing: 0; }
.prose > :where(h2, h3) + * { margin-top: .6em; }
.prose :where(ul, ol) { padding-left: 1.4em; }
.prose :where(li + li) { margin-top: .4em; }
.prose :where(blockquote) { padding-left: 1.25em; border-left: 2px solid var(--border-strong); color: var(--text-muted); }
.prose :where(figure figcaption) { margin-top: .75em; font-size: var(--fs-small); color: var(--text-muted); }

/* --------------------------------------------------------------------------
   9. Layout
   -------------------------------------------------------------------------- */
.container { width: 100%; max-width: calc(var(--w-content) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.container-page { max-width: calc(var(--w-page) + 2 * var(--gutter)); }
.container-narrow { max-width: calc(var(--w-narrow) + 2 * var(--gutter)); }
.section { padding-block: var(--section-y); }
.section-sm { padding-block: var(--section-y-sm); }
.section-lg { padding-block: var(--section-y-lg); }
.hairline-top { border-top: 1px solid var(--border); }

.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--grid-gap); }
.grid > * { grid-column: 1 / -1; }
@media (min-width: 768px) {
  .grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .span-3 { grid-column: span 3; }  .span-4 { grid-column: span 4; }
  .span-5 { grid-column: span 5; }  .span-6 { grid-column: span 6; }
  .span-7 { grid-column: span 7; }  .span-8 { grid-column: span 8; }
  .span-12 { grid-column: 1 / -1; }
  .start-7 { grid-column-start: 7; } .start-8 { grid-column-start: 8; }
}
.cols-3 { display: grid; gap: var(--grid-gap); grid-template-columns: 1fr; }
@media (min-width: 768px) { .cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cols-2 { display: grid; gap: var(--grid-gap); grid-template-columns: 1fr; }
@media (min-width: 768px) { .cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stack { display: flex; flex-direction: column; gap: var(--stack, 1rem); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--row-gap, .75rem); }
.section-head { display: grid; gap: 1rem; max-width: 40rem; margin-bottom: clamp(2rem, 1.2rem + 3vw, 4rem); }

/* --------------------------------------------------------------------------
   10. Buttons
   -------------------------------------------------------------------------- */
.btn {
  --btn-h: 2.75rem;
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: var(--btn-h);
  padding: 0 1.25rem;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  font: 500 .9375rem/1.2 var(--font-sans);
  letter-spacing: 0;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  background: transparent;
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out),
              color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.btn svg { width: 1.125rem; height: 1.125rem; }
.btn:focus-visible { outline-offset: 3px; border-radius: var(--radius-control); }
.btn:active:not(:disabled, [aria-disabled="true"]) { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn-sm { --btn-h: 2.25rem; padding: 0 .875rem; font-size: .875rem; }
.btn-lg { --btn-h: 3.25rem; padding: 0 1.75rem; font-size: 1rem; }
.btn-icon { width: var(--btn-h); padding: 0; }
.btn-block { width: 100%; }

/* primary = ink (default). The page's most important action. */
.btn-primary { background: var(--primary); color: var(--primary-contrast); }
.btn-primary:hover:not(:disabled, [aria-disabled="true"]) { background: var(--primary-hover); }
/* accent = clay with ink text. At most one per page (the single hero CTA). */
.btn-accent { background: var(--clay); color: var(--slate); }
.btn-accent:hover:not(:disabled, [aria-disabled="true"]) { background: var(--clay-deep); }
/* secondary = filled warm grey with a hairline */
.btn-secondary { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.btn-secondary:hover:not(:disabled, [aria-disabled="true"]) { background: var(--border); }
/* outline = transparent with a visible border */
.btn-outline { border-color: var(--border-strong); color: var(--text); }
.btn-outline:hover:not(:disabled, [aria-disabled="true"]) { background: var(--surface); border-color: var(--text-faint); }
/* ghost = text only until hovered (toolbars, icon buttons) */
.btn-ghost { color: var(--text-muted); }
.btn-ghost:hover:not(:disabled, [aria-disabled="true"]) { background: var(--surface-2); color: var(--text); }
/* link = looks like a link, behaves like a button */
.btn-link { --btn-h: auto; padding: 0; color: var(--text); text-decoration: underline 1px; text-underline-offset: .22em; text-decoration-color: var(--border-strong); }
.btn-link:hover { text-decoration-color: currentColor; }
.btn-danger { background: var(--danger); color: var(--danger-contrast); }
.btn-danger:hover:not(:disabled, [aria-disabled="true"]) { background: color-mix(in srgb, var(--danger) 88%, var(--text)); }

/* --------------------------------------------------------------------------
   11. Header / nav / footer
   -------------------------------------------------------------------------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--bg); border-bottom: 1px solid transparent; transition: border-color var(--dur) var(--ease-out); }
.site-header.is-scrolled, .site-header.hairline { border-bottom-color: var(--border); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; height: var(--nav-h); }
.brand { display: inline-flex; align-items: baseline; gap: .1em; font: 500 1.375rem/1 var(--font-serif); letter-spacing: 0; color: var(--text); text-decoration: none; white-space: nowrap; }
.brand-dot { width: .32em; height: .32em; border-radius: 50%; background: var(--clay); display: inline-block; }
.nav-links { display: none; align-items: center; gap: 2rem; margin: 0; padding: 0; list-style: none; }
.nav-links a { color: var(--text-muted); text-decoration: none; font-size: .9375rem; transition: color var(--dur-fast) var(--ease-out); }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); }
.nav-actions { display: flex; align-items: center; gap: .5rem; }
@media (min-width: 900px) { .nav-links { display: flex; } .nav-menu { display: none; } }

/* mobile menu: a <details> disclosure, no JS needed */
.nav-menu { position: relative; }
.nav-menu > summary { list-style: none; }
.nav-menu > summary::-webkit-details-marker { display: none; }
.nav-menu-panel { position: absolute; right: 0; top: calc(100% + .5rem); min-width: 12rem; padding: .5rem; display: grid; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-lift); }
.nav-menu-panel a { padding: .625rem .75rem; border-radius: var(--radius-control); text-decoration: none; color: var(--text); }
.nav-menu-panel a:hover { background: var(--surface); }

.site-footer { border-top: 1px solid var(--border); padding-block: clamp(3rem, 2rem + 4vw, 5rem) 2.5rem; font-size: var(--fs-small); color: var(--text-muted); }
.site-footer a { color: var(--text-muted); text-decoration: none; }
.site-footer a:hover, .site-footer .brand { color: var(--text); }
.footer-cols { display: grid; gap: 2rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 768px) { .footer-cols { grid-template-columns: 2fr repeat(3, minmax(0, 1fr)); } }
.footer-cols ul { list-style: none; margin: .75rem 0 0; padding: 0; display: grid; gap: .5rem; }
.footer-title { font-weight: 500; color: var(--text); }
.footer-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--border); color: var(--text-faint); }

/* --------------------------------------------------------------------------
   12. Cards, plates, quotes
   -------------------------------------------------------------------------- */
.card { display: flex; flex-direction: column; gap: .75rem; padding: var(--card-pad); background: var(--surface); border-radius: var(--radius-card); color: var(--text); }
.card-outline { background: transparent; border: 1px solid var(--border); }
.card-raised { background: var(--bg); border: 1px solid var(--border); box-shadow: var(--shadow-lift); }
a.card, .card-link { text-decoration: none; transition: background-color var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out); }
a.card:hover, .card-link:hover { background: var(--surface-2); }
a.card-outline:hover { background: var(--surface); border-color: var(--border-strong); }
.card-index { font: 500 1rem/1 var(--font-serif); color: var(--text-faint); font-variant-numeric: lining-nums; }
.card-title { font: 500 var(--fs-h3)/var(--lh-h3) var(--font-serif); letter-spacing: var(--tr-h3); }

/* product screenshots sit on an ivory-medium plate */
.plate { padding: clamp(1rem, 4vw, 3.5rem); background: var(--surface); border-radius: var(--radius-panel); }
.plate > img, .plate > .shot { border-radius: var(--radius-control); border: 1px solid var(--border); box-shadow: var(--shadow-lift); }

.quote { display: grid; gap: 1.5rem; max-width: 46rem; }
.quote blockquote { font-family: var(--font-serif); font-size: var(--fs-h2); line-height: var(--lh-h2); font-weight: 400; letter-spacing: var(--tr-h2); text-wrap: balance; }
.quote figcaption { font-size: var(--fs-small); color: var(--text-muted); }

/* --------------------------------------------------------------------------
   13. Forms
   -------------------------------------------------------------------------- */
.field { display: grid; gap: .375rem; }
.label { font: 500 .875rem/1.4 var(--font-sans); color: var(--text); }
.hint { font-size: .8125rem; line-height: 1.5; color: var(--text-muted); }
.field-error { font-size: .8125rem; line-height: 1.5; color: var(--danger); }
.input, .select, .textarea {
  width: 100%;
  min-height: 2.75rem;
  padding: .625rem .875rem;
  font: 400 1rem/1.4 var(--font-sans);   /* ≥16px stops iOS zoom */
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-control);
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
  appearance: none;
}
.textarea { min-height: 7rem; resize: vertical; line-height: var(--lh-body); }
.select { padding-right: 2.5rem; background: var(--bg) var(--chevron) no-repeat right .875rem center / 16px; }
.input::placeholder, .textarea::placeholder { color: var(--text-faint); opacity: 1; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-muted); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--focus-ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus-ring) 22%, transparent); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--danger); }
.input:disabled, .select:disabled, .textarea:disabled { background: var(--surface); color: var(--text-faint); border-color: var(--border); cursor: not-allowed; }
.check { display: inline-flex; align-items: flex-start; gap: .625rem; font-size: var(--fs-small); line-height: 1.5; cursor: pointer; }
.check input { width: 1.125rem; height: 1.125rem; margin: .15em 0 0; accent-color: var(--primary); flex-shrink: 0; }
.input-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.input-row .input { flex: 1 1 14rem; width: auto; }

/* --------------------------------------------------------------------------
   14. Tags, callouts, toasts, empty states
   -------------------------------------------------------------------------- */
.tag { display: inline-flex; align-items: center; gap: .375rem; min-height: 1.625rem; padding: .125rem .625rem; border-radius: var(--radius-pill); background: var(--surface-2); color: var(--text); font: 500 .8125rem/1.2 var(--font-sans); white-space: nowrap; }
.tag-outline { background: transparent; box-shadow: inset 0 0 0 1px var(--border-strong); }
.tag-accent { background: var(--clay); color: var(--slate); }
.tag-success, .tag-warning, .tag-danger { --dot: var(--text-faint); }
.tag-success { background: var(--success-tint); --dot: var(--success); }
.tag-warning { background: var(--warning-tint); --dot: var(--warning); }
.tag-danger { background: var(--danger-tint); --dot: var(--danger); }
.tag-success::before, .tag-warning::before, .tag-danger::before, .tag-dot::before { content: ""; width: .4375rem; height: .4375rem; border-radius: 50%; background: var(--dot, var(--text-faint)); }

.callout { display: grid; gap: .25rem; padding: 1rem 1.25rem 1rem 1.375rem; border-radius: var(--radius-control); background: var(--surface); box-shadow: inset 3px 0 0 var(--mark, var(--border-strong)); font-size: var(--fs-small); line-height: var(--lh-small); }
.callout-title { font-weight: 600; color: var(--text); }
.callout-success { --mark: var(--success); background: var(--success-tint); }
.callout-warning { --mark: var(--warning); background: var(--warning-tint); }
.callout-danger { --mark: var(--danger); background: var(--danger-tint); }
.callout-accent { --mark: var(--clay); }

.toast-region { position: fixed; z-index: 100; left: 50%; bottom: 1.5rem; transform: translateX(-50%); display: grid; gap: .5rem; width: min(26rem, calc(100vw - 2rem)); }
.toast { display: flex; align-items: flex-start; gap: .75rem; padding: .875rem 1rem; border-radius: var(--radius-control); background: var(--text); color: var(--bg); font-size: .9375rem; line-height: 1.5; box-shadow: var(--shadow-lift); animation: cw-rise var(--dur-slow) var(--ease-out) both; }
.toast .btn-link { color: inherit; margin-left: auto; text-decoration-color: currentColor; }

.empty { display: grid; justify-items: center; text-align: center; gap: .75rem; padding: clamp(3rem, 2rem + 4vw, 5rem) 1.5rem; color: var(--text-muted); }
.empty-art { width: 8rem; height: auto; margin-bottom: .5rem; }
.empty-title { font: 500 var(--fs-h3)/var(--lh-h3) var(--font-serif); color: var(--text); }
.empty p { max-width: 26rem; }

/* --------------------------------------------------------------------------
   15. Tables, code, tabs, pagination, FAQ
   -------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-small); line-height: 1.5; font-variant-numeric: tabular-nums; }
.table th { padding: .625rem .875rem; text-align: left; font-weight: 500; font-size: .8125rem; color: var(--text-muted); border-bottom: 1px solid var(--border-strong); white-space: nowrap; }
.table td { padding: .875rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table :is(th, td):first-child { padding-left: 0; }
.table :is(th, td):last-child { padding-right: 0; }
.table tbody tr { transition: background-color var(--dur-fast) var(--ease-out); }
.table tbody tr:hover { background: color-mix(in srgb, var(--surface) 70%, transparent); }
.table .num { text-align: right; }

:where(code, kbd, samp, pre) { font-family: var(--font-mono); }
:where(:not(pre) > code) { padding: .125em .375em; border-radius: var(--radius-sm); background: var(--surface-2); font-size: .875em; }
:where(kbd) { padding: .1em .4em; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: var(--radius-sm); font-size: .8125em; }
:where(pre) { margin: 0; padding: 1.125rem 1.25rem; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface); font-size: .875rem; line-height: 1.65; tab-size: 2; }
/* quiet syntax colours (Prism / highlight.js class names) */
:where(.token.comment, .hljs-comment) { color: var(--text-faint); }
:where(.token.keyword, .hljs-keyword) { color: var(--text); font-weight: 600; }
:where(.token.string, .hljs-string) { color: color-mix(in srgb, var(--olive) 80%, var(--text)); }
:where(.token.number, .token.boolean, .hljs-number) { color: color-mix(in srgb, var(--sky) 75%, var(--text)); }
:where(.token.function, .hljs-title) { color: color-mix(in srgb, var(--clay-deep) 85%, var(--text)); }

.tabs { display: flex; gap: 1.75rem; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tab { appearance: none; background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: .75rem 0; color: var(--text-muted); font: 500 .9375rem/1.2 var(--font-sans); white-space: nowrap; cursor: pointer; transition: color var(--dur-fast) var(--ease-out), border-color var(--dur) var(--ease-out); }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--text); }

.pagination { display: flex; align-items: center; gap: .25rem; margin: 0; padding: 0; list-style: none; font-variant-numeric: tabular-nums; }
.pagination :is(a, span) { display: inline-grid; place-items: center; min-width: 2.25rem; height: 2.25rem; padding: 0 .5rem; border-radius: var(--radius-control); color: var(--text-muted); text-decoration: none; font-size: .9375rem; }
.pagination a:hover { background: var(--surface-2); color: var(--text); }
.pagination [aria-current="page"] { background: var(--surface-2); color: var(--text); font-weight: 500; }
.pagination [aria-disabled="true"] { opacity: .4; pointer-events: none; }

.faq { border-top: 1px solid var(--border); }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.25rem 0; cursor: pointer; list-style: none; font: 500 var(--fs-body)/1.5 var(--font-sans); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; width: .625rem; height: .625rem; flex-shrink: 0; margin-right: .25rem; border-right: 1.5px solid var(--text-muted); border-bottom: 1.5px solid var(--text-muted); transform: translateY(-25%) rotate(45deg); transition: transform var(--dur) var(--ease-out); }
.faq details[open] summary::after { transform: translateY(25%) rotate(-135deg); }
.faq details > :not(summary) { padding-bottom: 1.25rem; color: var(--text-muted); max-width: var(--w-reading); }

/* --------------------------------------------------------------------------
   16. Dialog
   -------------------------------------------------------------------------- */
.dialog { width: min(32rem, calc(100vw - 2rem)); max-height: calc(100dvh - 4rem); padding: clamp(1.5rem, 1rem + 2vw, 2rem); border: 1px solid var(--border); border-radius: var(--radius-panel); background: var(--bg); color: var(--text); box-shadow: var(--shadow-overlay); }
.dialog::backdrop { background: var(--overlay); }
.dialog[open] { animation: cw-rise var(--dur-slow) var(--ease-out) both; }
.dialog-title { font: 500 var(--fs-h3)/var(--lh-h3) var(--font-serif); margin-bottom: .5rem; }
.dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .5rem; margin-top: 1.5rem; }

/* --------------------------------------------------------------------------
   17. App shell (dashboards, tools)
   -------------------------------------------------------------------------- */
.app { display: grid; grid-template-columns: 1fr; min-height: 100vh; min-height: 100dvh; }
.sidebar { display: flex; flex-direction: column; gap: 1.5rem; padding: 1.25rem .75rem; background: var(--surface); border-bottom: 1px solid var(--border); }
.sidebar .brand { padding: .25rem .75rem; font-size: 1.25rem; }
.side-group { display: grid; gap: .125rem; }
.side-label { padding: 0 .75rem .375rem; font: 500 .75rem/1.3 var(--font-sans); letter-spacing: var(--tr-eyebrow); text-transform: uppercase; color: var(--text-faint); }
.side-link { display: flex; align-items: center; gap: .625rem; min-height: 2.25rem; padding: 0 .75rem; border-radius: var(--radius-control); color: var(--text-muted); text-decoration: none; font-size: .9375rem; transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); }
.side-link svg { width: 1.125rem; height: 1.125rem; }
.side-link:hover { background: var(--surface-2); color: var(--text); }
.side-link[aria-current="page"] { background: var(--surface-2); color: var(--text); font-weight: 500; }
.side-link .count { margin-left: auto; font-size: .8125rem; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.app-body { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .75rem; min-height: 3.75rem; padding: .5rem var(--app-pad, 1.25rem); background: var(--bg); border-bottom: 1px solid var(--border); }
.app-main { padding: clamp(1.5rem, 1rem + 2vw, 2.5rem) var(--app-pad, 1.25rem) 4rem; display: grid; gap: clamp(1.5rem, 1rem + 1.5vw, 2.25rem); align-content: start; }
.page-title { font: 500 var(--fs-h2)/var(--lh-h2) var(--font-serif); letter-spacing: var(--tr-h2); }
:lang(en) .page-title, .page-title:lang(en) { font-weight: 600; letter-spacing: -0.015em; }
.stat { display: grid; gap: .5rem; align-content: start; }
.stat-label { font-size: .875rem; color: var(--text-muted); }
.stat-value { font: 500 clamp(2rem, 1.6rem + 1.2vw, 2.75rem)/1 var(--font-serif); letter-spacing: -0.02em; font-variant-numeric: lining-nums tabular-nums; }
.stat-value small { font: 400 .875rem/1 var(--font-sans); letter-spacing: 0; color: var(--text-muted); margin-left: .25rem; }
.stat-meta { font-size: .8125rem; color: var(--text-faint); }
@media (min-width: 1024px) {
  .app { grid-template-columns: 15.5rem minmax(0, 1fr); --app-pad: 2.5rem; }
  .sidebar { position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; border-bottom: 0; border-right: 1px solid var(--border); padding: 1.5rem .75rem; }
}
@media (max-width: 1023.98px) {
  .sidebar { flex-direction: row; align-items: center; overflow-x: auto; gap: .5rem; padding: .75rem; }
  .sidebar .side-label, .sidebar .side-foot { display: none; }
  .side-group { display: flex; gap: .25rem; }
  .side-link { white-space: nowrap; }
}

/* charts drawn as inline SVG: give the svg class="chart" */
.chart { width: 100%; height: auto; overflow: visible; font-family: var(--font-sans); }
.chart .bar { fill: var(--cloud-light); }
.chart .bar-hl { fill: var(--clay); }
.chart .axis { stroke: var(--border); stroke-width: 1; }
.chart .grid-line { stroke: var(--border); stroke-width: 1; stroke-dasharray: 2 4; }
.chart .lbl { fill: var(--text-faint); font-size: 12px; }
.chart .val { fill: var(--text-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.chart .val-hl { fill: var(--text); font-family: var(--font-serif); font-size: 18px; font-weight: 500; }
[data-theme="dark"] .chart .bar { fill: var(--slate-light); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chart .bar { fill: var(--slate-light); } }

/* --------------------------------------------------------------------------
   18. Hand-drawn strokes (paths from assets/handdrawn.js)
   -------------------------------------------------------------------------- */
.ink { fill: none; stroke: var(--text); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.ink-thin { fill: none; stroke: var(--text); stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; }
.ink-accent { fill: none; stroke: var(--clay); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.fill-clay { fill: var(--clay); } .fill-oat { fill: var(--oat); } .fill-cactus { fill: var(--cactus); }
.fill-heather { fill: var(--heather); } .fill-paper { fill: var(--bg); } .fill-ink { fill: var(--text); }
.icon { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* paper grain (optional, very light) */
.paper-grain { position: relative; isolation: isolate; }
.paper-grain::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .5; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .08  0 0 0 0 .08  0 0 0 0 .07  0 0 0 .06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* --------------------------------------------------------------------------
   19. Motion
   -------------------------------------------------------------------------- */
@keyframes cw-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes cw-fade { from { opacity: 0; } to { opacity: 1; } }

/* scroll reveal: add class="reveal"; a script adds .is-in once (see starters).
   Only hidden when JS is running (html.js) and motion is allowed. */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(var(--rise)); transition: opacity var(--dur-reveal) var(--ease-out), transform var(--dur-reveal) var(--ease-out); transition-delay: var(--delay, 0ms); }
  .js .reveal.is-in { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* theme toggle helper: show the icon for the theme you would switch to */
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
