/* ==========================================================================
   Anodela — Design Tokens (single source of truth)
   Flat precision system. One canvas under every section of every page: no
   alternating panels, no gradients, no shadows, no blur, and no rule where
   two sections meet. Depth = a hairline plus one opaque tonal step.
   ========================================================================== */

:root {
  /* ---- Canvas (one fill; the legacy panel names all resolve to it) ---- */
  --bg-canvas: #f8f9fb;
  --bg-white: var(--bg-canvas);
  --bg-muted: var(--bg-canvas);
  --bg-tint: var(--bg-canvas);

  /* ---- Surfaces: the only tonal steps a component may take ---- */
  --surface: #ffffff;
  --surface-muted: #f1f3f6;     /* one step down: wells, bars, chips      */
  --surface-sunken: #e9ecf1;    /* pressed / selected only                 */
  --surface-raised: #ffffff;
  --surface-ink: #0c1017;       /* solid dark component (never a section)  */
  --surface-glass: var(--bg-canvas);

  /* ---- Text ramp (AA on canvas and on surface) ---- */
  --text-primary: #0c1017;      /* 18.6:1 */
  --text-secondary: #3a404c;    /* 10.4:1 */
  --text-muted: #5b6270;        /*  6.1:1 */
  --text-faint: #6b7280;        /*  4.8:1 — still AA for small text */
  --text-on-accent: #ffffff;
  --text-on-ink: #e9ecf1;
  --text-on-ink-muted: #a3aab8;

  /* ---- Hairlines (components only — never between sections) ---- */
  --border-subtle: #e7e9ee;
  --border-default: #dcdfe5;
  --border-strong: #c3c8d1;
  --ring: #0071e3;

  /* ---- Accent (cell blue) ---- */
  --accent: #0071e3;            /* white on accent 4.6:1 */
  --accent-hover: #0064ca;
  --accent-press: #0058b3;
  --accent-link: #005bbf;       /* 6.3:1 on canvas */
  --accent-soft: #e6f0fc;       /* opaque tint */
  --accent-line: #a9cbf3;

  /* ---- Semantic (opaque) ---- */
  --success: #147a43;  --success-soft: #e3f3ea;
  --warning: #9a5200;  --warning-soft: #fbeedd;
  --error:   #c4001a;  --error-soft:   #fbe4e7;
  --info:    #0071e3;  --info-soft:    #e6f0fc;

  /* ---- Retired tokens: resolve to flat values so nothing can reintroduce them ---- */
  --grad-soft: var(--surface-muted);
  --grad-accent: var(--accent);
  --grad-hero: none;
  --grad-text: none;
  --grad-card: none;
  --shadow-sm: none; --shadow-md: none; --shadow-lg: none; --shadow-xl: none; --shadow-accent: none;

  /* ---- Type families ----
     Jost carries the headlines: a geometric sans on Futura bones, precise
     enough for cell chemistry without reading as a system default. Wix
     Madefor Text carries running and interface text, and Geist Mono carries
     capacities, C-rates, lot numbers and interface labels. */
  --font-sans: "Wix Madefor Text", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Jost", "Wix Madefor Text", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* ---- Fluid type scale (1.25 → 1.333 across the viewport) ---- */
  --fs-display: clamp(2.75rem, 1.35rem + 5.6vw, 5.5rem);
  --fs-h1: clamp(2.375rem, 1.5rem + 3.6vw, 4.25rem);
  --fs-h2: clamp(1.875rem, 1.35rem + 2.1vw, 3rem);
  --fs-h3: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);
  --fs-h4: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
  --fs-lead: clamp(1.125rem, 1.03rem + 0.4vw, 1.3125rem);
  --fs-body: 1.0625rem;
  --fs-body-lg: 1.1875rem;
  --fs-small: 0.9375rem;
  --fs-micro: 0.8125rem;
  --fs-label: 0.75rem;

  --track-display: -0.038em;
  --track-h1: -0.034em;
  --track-h2: -0.028em;
  --track-h3: -0.018em;
  --track-label: 0.04em;

  /* ---- Spacing (4pt base / 8pt rhythm) ---- */
  --space-0: 0;     --space-1: 4px;   --space-2: 8px;   --space-3: 12px;
  --space-4: 16px;  --space-5: 20px;  --space-6: 24px;  --space-7: 28px; --space-8: 32px;
  --space-10: 40px; --space-12: 48px; --space-16: 64px; --space-20: 80px;
  --space-24: 96px; --space-28: 112px; --space-32: 128px; --space-40: 160px;

  /* ---- Radii (one family: 6 / 10 / 14 / 18) ---- */
  --radius-xs: 6px; --radius-sm: 8px; --radius-md: 10px; --radius-lg: 14px;
  --radius-xl: 18px; --radius-2xl: 22px; --radius-pill: 999px;

  /* ---- Containers ---- */
  --container-sm: 720px;  --container-md: 840px;  --container-lg: 1040px;
  --container-xl: 1200px; --container-2xl: 1280px;
  --gutter: clamp(20px, 4.4vw, 40px);
  --measure: 68ch;

  /* ---- Section rhythm ---- */
  --section-y: clamp(72px, 8.4vw, 128px);
  --section-y-lg: clamp(88px, 10vw, 152px);
  --stack: clamp(16px, 2vw, 24px);

  /* ---- Grid ---- */
  --grid-cols: 12;
  --grid-gap: clamp(16px, 2vw, 24px);

  /* ---- Motion ---- */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 140ms;
  --dur-base: 220ms;
  --dur-slow: 560ms;

  /* ---- Sticky header offset (anchor scroll-margin) ---- */
  --header-h: 64px;
}
