/* Chooni.ir — design tokens. Single source of truth for palette, type and rhythm.
   Every other stylesheet consumes these; never hard-code a hex or a page width again.

   Theme: dark is the brand default (see chooni-brand skill — "deep near-black, warm
   undertone"). Light is an explicit opt-in via the nav toggle (assets/js/theme.js),
   which stamps data-theme="light" on <html>; no attribute = dark. We do NOT auto-switch
   on prefers-color-scheme — brand identity is dark-first, light is a reader convenience.

   Components that sit on a permanently dark photographic scrim (the title-page hero,
   the high-score cards, the result-feature card) stay dark regardless of theme — see
   the "dark island" override blocks in section-index.css / browse.css. */
:root {
  /* Surfaces */
  --bg: #0E0B08;
  --panel: #141019;
  --panel-2: #1B1620;

  /* Ink */
  --ink: #F4EEE4;
  --muted: #B9AE9E;
  --dim: #7A6F62;

  /* Accent */
  --amber: #F5B841;
  --amber-2: #E8A33D;
  --teal: #6FA8A6;

  /* Hairlines / borders */
  --line: rgba(244, 238, 228, 0.10);
  --line-2: rgba(244, 238, 228, 0.22);
  --amber-line: rgba(245, 184, 65, 0.55);
  --amber-wash: rgba(245, 184, 65, 0.14);

  /* RGB triplets for alpha-composited washes/gradients (rgb(var(--x-rgb) / .2)).
     Space-separated, not comma-separated: rgb() with a /alpha only accepts the
     modern space syntax — rgb(232, 163, 61 / .2) is invalid and drops the whole
     declaration. Lets decorative gradients (home ambient wash, hero base) track theme. */
  --bg-rgb: 14 11 8;
  --panel2-rgb: 27 22 32;
  --amber-rgb: 232 163 61;
  --teal-rgb: 111 168 166;
  --ink-rgb: 244 238 228;

  /* Fixed contrast ink for text sitting on an amber fill (chip-active, sort-on, etc.).
     Constant across themes — amber is always a mid/bright gold, so dark text is always
     the right call; using --bg there would go wrong once --bg turns light. */
  --on-amber: #241B0A;

  /* Type families */
  --font-fa: 'Vazirmatn', Tahoma, sans-serif;
  --font-display: 'Lalezar', 'Vazirmatn', Tahoma, sans-serif;
  --font-latin: 'Bodoni Moda', 'Didot', Georgia, serif;

  /* Fluid rhythm */
  --pad-x: clamp(20px, 5vw, 72px);   /* page side gutter */
  --section-y: clamp(64px, 12vw, 120px);
  --maxw: 1440px;                    /* content ceiling */

  /* Fluid display sizes (min → max track the desktop comp) */
  --fs-hero: clamp(52px, 11vw, 104px);
  --fs-h2: clamp(30px, 5vw, 56px);
  --fs-tile: clamp(34px, 4.5vw, 56px);
}

/* ===================================================================
   LIGHT THEME — opt-in via data-theme="light" on <html>.
   Warm paper surfaces, deepened amber/teal so they stay AA-legible as
   text/links on a light ground (the bright dark-theme shades don't).
   =================================================================== */
:root[data-theme="light"] {
  --bg: #FAF6EF;
  --panel: #FFFFFF;
  --panel-2: #F1E9DA;

  --ink: #211A12;
  --muted: #5B5044;
  --dim: #8C8172;

  --amber: #C6821A;
  --amber-2: #B5720A;
  --teal: #3F7A78;

  --line: rgba(33, 26, 18, 0.10);
  --line-2: rgba(33, 26, 18, 0.22);
  --amber-line: rgba(198, 130, 26, 0.45);
  --amber-wash: rgba(198, 130, 26, 0.10);

  --bg-rgb: 250 246 239;
  --panel2-rgb: 241 233 218;
  --amber-rgb: 198 130 26;
  --teal-rgb: 63 122 120;
  --ink-rgb: 33 26 18;
}
