/* GENERATED from brands/definer-group/tokens.json by tools/site-style/theme.mjs. Do not edit; edit tokens.json. */
/* ============================================================
   Kit v1 theme template
   Filled from brands/<slug>/tokens.json by tools/site-style/theme.mjs
   (later by render.mjs). Each comment marker of the form
   "/* {{name}} *\/" is replaced; everything else is copied as is.

   Three layers:
     1. raw palette   brand colour names (--paper, --brass ...). Only here.
     2. semantic      --bg --fg --accent ... Sections use ONLY these.
     3. scale         type, space, shape and motion-duration tokens.
   Then: fonts per script, brand overrides, dark band, widget aliases.
   The Chinese :lang() rules and reduced motion live in base.css.
   ============================================================ */

:root {
  /* ---- 1. raw palette (from tokens.json "palette") ---- */
  --ivory: #F6F3EC;
  --white: #FFFFFF;
  --linen: #ECE5D8;
  --ink: #131211;
  --night: #1E1D1B;
  --ink-soft: #46443F;
  --muted: #67645E;
  --line: #D8D0C2;
  --line-strong: #827B70;
  --gilt: #7B5B22;
  --gilt-light: #C8A562;
  --cream: #F5F1E8;
  --cream-soft: #BAB4A8;
  --line-dark: #3B3934;
  --line-dark-strong: #87827A;
  --error: #A3271F;
  --error-dark: #F0A29B;
  --success: #2E6B4A;

  /* ---- 2. semantic tokens, light surfaces (tokens.json "themes.light") ----
     bg            page background
     surface       raised surface: cards, form panel
     surface-quiet quiet band: numbers, footer
     fg            main text
     fg-soft       long paragraphs, lower weight text
     fg-muted      captions, labels, placeholders, dates
     rule          decorative hairline (never the only cue)
     rule-strong   field underline, control borders (3:1)
     accent        links, small labels, focus ring
     danger        error text
     success       success text
     action        primary button fill
     on-action     primary button text
     action-hover  primary button fill on hover                   */
  --bg: var(--ivory);
  --surface: var(--white);
  --surface-quiet: var(--linen);
  --fg: var(--ink);
  --fg-soft: var(--ink-soft);
  --fg-muted: var(--muted);
  --rule: var(--line);
  --rule-strong: var(--line-strong);
  --accent: var(--gilt);
  --danger: var(--error);
  --action: var(--ink);
  --on-action: var(--cream);
  --action-hover: var(--night);

  /* ---- 3. scale ---- */
  /* fonts: Latin family first, so Latin letters and numbers inside
     Chinese text use it. Simplified swap is below. */
  --font-display: "Cormorant Garamond", "Noto Serif HK", "Noto Serif TC", Georgia, "Songti TC", serif;
  --font-body: "Jost", "Noto Sans HK", "Noto Sans TC", system-ui, -apple-system, "PingFang HK", "Microsoft JhengHei", sans-serif;

  --fs-display: clamp(2.75rem, 1.78rem + 4.13vw, 5.5rem);
  --fs-h1: clamp(2.25rem, 1.72rem + 2.25vw, 3.75rem);
  --fs-h2: clamp(1.75rem, 1.4rem + 1.5vw, 2.75rem);
  --fs-h3: 1.5rem;
  --fs-h4: 1.25rem;
  --fs-lead: clamp(1.125rem, 1.08rem + 0.19vw, 1.25rem);
  --fs-body: 1rem;
  --fs-small: 0.875rem;
  --fs-label: 0.8125rem;
  --fs-stat: clamp(3rem, 2.3rem + 3vw, 5rem);

  --fw-display: 300; --fw-heading: 400; --fw-body: 400; --fw-ui: 500;
  --lh-display: 1.05; --lh-h1: 1.1; --lh-heading: 1.2; --lh-h3: 1.3; --lh-h4: 1.4;
  --lh-lead: 1.55; --lh-body: 1.6; --lh-small: 1.5; --lh-label: 1.4; --lh-stat: 1;
  --ls-display: -0.02em; --ls-heading: -0.01em; --ls-body: 0; --ls-label: 0.14em;
  --label-case: uppercase;
  --display-scale: 1;

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 64px;
  --space-9: 96px; --space-10: 128px; --space-11: 160px;
  --section-y: clamp(64px, 9vw, 128px);
  --gutter: 24px;
  --margin: clamp(20px, 5vw, 80px);
  --container: 1280px; --container-wide: 1440px; --measure: 680px;

  --radius: 6px; --radius-sm: 2px; --radius-pill: 999px;
  --hairline: 1px; --control-h: 48px; --tap-min: 44px;
  --focus-width: 2px; --focus-offset: 3px;

  /* motion: durations, distances and easing only. These are the calm
     defaults; kit/v1/motion.css sets the still / calm / lively values on
     html[data-motion-preset] (from brand.json "motion"), zeroes them under
     prefers-reduced-motion and for the pause switch (html[data-motion="off"]).
     Numbers from the 2026-11-16 design scan; sources in kit/CHANGELOG.md. */
  --ease: ease;
  --t-fast: 300ms;
  --t-reveal: 700ms;
  --reveal-shift: 28px;
  --stagger: 120ms;
  --t-rise: 700ms;
  --rise-shift: 0.3em;

  /* ---- brand overrides of any layer-3 token (tokens.json "overrides") ---- */
  --fw-display: 400;
  --lh-display: 1;
  --ls-display: -0.015em;
  --fs-h3: 1.75rem;
  --zh-fw-heading: 400;
  --radius: 2px;
  --radius-pill: 2px;
  --overlay-display: rgba(19, 18, 17, .5);
  --overlay-text: rgba(19, 18, 17, .65);
}

/* Simplified Chinese: swap the CJK families (tokens.json "fonts.*-hans") */
:lang(zh-Hans), :lang(zh-CN) {
  --font-display: "Cormorant Garamond", "Noto Serif SC", Georgia, "Songti SC", serif;
  --font-body: "Jost", "Noto Sans SC", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* Dark band: flips the semantic layer (tokens.json "themes.dark") */
.band--dark {
  --bg: var(--ink);
  --surface: var(--night);
  --surface-quiet: var(--night);
  --fg: var(--cream);
  --fg-soft: var(--cream-soft);
  --fg-muted: var(--cream-soft);
  --rule: var(--line-dark);
  --rule-strong: var(--line-dark-strong);
  --accent: var(--gilt-light);
  --danger: var(--error-dark);
  --action: var(--cream);
  --on-action: var(--ink);
  --action-hover: var(--white);
  background: var(--bg);
  color: var(--fg);
}

/* Widget aliases: shared/book.css, shared/event-builder.js and other
   shared widgets read --brand*. Mapped to semantic tokens so they follow
   the kit theme. Re-declared on .band--dark so they flip there too.
   (--paper is left alone: in many brands it is a raw palette name.) */
:root, .band--dark {
  --brand: var(--action);
  --brand-dark: var(--action-hover);
  --brand-darker: var(--action);
  --brand-tint: var(--surface-quiet);
  --brand-tint-2: var(--rule);
  --accent-dark: var(--danger);
  --paper-2: var(--surface-quiet);
}
