/* ==========================================================================
   Averon Analytics · design tokens (v1, 3 Nov 2026)
   Navy night, gold light, Paper words. Precise and calm, like an instrument.
   Every page loads: tokens.css → base.css → pages.css (→ page CSS last).
   Brand colours are exact (brand manual, measured): never change them.
   ========================================================================== */

/* ---------- Fonts (self-hosted, latin subset, swap) ---------- */
@font-face {
  font-family: "Adventor";
  src: url("/assets/fonts/adventor-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Adventor";
  src: url("/assets/fonts/adventor-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Montserrat";
  src: url("/assets/fonts/montserrat-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
/* Metric-matched fallbacks (measured 3 Nov 2026 against Arial): the layout barely moves when the real fonts arrive */
@font-face {
  font-family: "Adventor Fallback";
  src: local("Arial"), local("Helvetica"), local("Roboto");
  size-adjust: 95.2%;
  ascent-override: 77.7%;
  descent-override: 20%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Montserrat Fallback";
  src: local("Arial"), local("Helvetica"), local("Roboto");
  size-adjust: 111.7%;
  ascent-override: 86.8%;
  descent-override: 22.4%;
  line-gap-override: 0%;
}

:root {
  /* ---------- Brand colours (exact) ---------- */
  --navy: #00243F;
  --gold: #EFBB75;
  --mist: #CCD5DB;        /* grey-blue */
  --paper: #EFEEEB;       /* off-white */

  /* Navy depth: darker shades for deep space, lighter tints (navy + mist) for raised surfaces */
  --navy-950: #000F1C;
  --navy-900: #001A2E;
  --navy-850: #001F37;
  --navy-700: #0A2B44;    /* navy + 5% mist */
  --navy-600: #143248;    /* navy + 10% mist */
  --navy-500: #253D50;    /* navy + 18% mist */

  /* Gold light */
  --gold-soft: #EFCD9E;   /* gold + 35% paper: hover light */
  --gold-deep: #D69C4D;   /* brand tone-on-tone gold */
  --gold-a06: rgba(239, 187, 117, .06);
  --gold-a12: rgba(239, 187, 117, .12);
  --gold-a20: rgba(239, 187, 117, .20);
  --gold-a32: rgba(239, 187, 117, .32);
  --gold-a48: rgba(239, 187, 117, .48);
  --gold-a72: rgba(239, 187, 117, .72);

  --mist-a06: rgba(204, 213, 219, .06);
  --mist-a10: rgba(204, 213, 219, .10);
  --mist-a14: rgba(204, 213, 219, .14);
  --mist-a24: rgba(204, 213, 219, .24);
  --mist-a40: rgba(204, 213, 219, .40);

  --navy-a40: rgba(0, 36, 63, .40);
  --navy-a72: rgba(0, 36, 63, .72);

  /* ---------- Semantic colours (dark default; .on-paper switches them) ---------- */
  --bg: var(--navy);
  --bg-deep: var(--navy-900);
  --bg-space: var(--navy-950);
  --text: var(--paper);
  --text-muted: var(--mist);
  --text-dim: #93A3AF;            /* mist at 72% on navy: 6.1:1 */
  --accent: var(--gold);          /* gold text: only on navy */
  --line: var(--mist-a14);        /* hairline */
  --line-strong: var(--mist-a24);
  --line-gold: var(--gold-a48);
  --tick: var(--gold-a72);        /* corner ticks, ruler marks */
  --grid-line: rgba(204, 213, 219, .045);
  --focus: var(--gold);

  /* ---------- Type ---------- */
  --font-display: "Adventor", "Adventor Fallback", "Century Gothic", "URW Gothic", "Avant Garde", "Futura", system-ui, sans-serif;
  --font-text: "Montserrat", "Montserrat Fallback", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  /* Fluid scale, mobile first: 360 px → 1440 px */
  --fs-label:   0.8125rem;                                       /* 13: data labels (never smaller) */
  --fs-small:   clamp(0.875rem, 0.854rem + 0.093vw, 0.9375rem);  /* 14 → 15: captions, credits */
  --fs-base:    clamp(1rem, 0.9583rem + 0.1852vw, 1.125rem);     /* 16 → 18: body */
  --fs-lead:    clamp(1.125rem, 1.0417rem + 0.3704vw, 1.375rem); /* 18 → 22 */
  --fs-h4:      clamp(1.0625rem, 1rem + 0.2778vw, 1.25rem);      /* 17 → 20 */
  --fs-h3:      clamp(1.3125rem, 1.1667rem + 0.6481vw, 1.75rem); /* 21 → 28 */
  --fs-h2:      clamp(1.75rem, 1.3333rem + 1.8519vw, 3rem);      /* 28 → 48 */
  --fs-h1:      clamp(2.125rem, 1.4167rem + 3.1481vw, 4.25rem);  /* 34 → 68 */
  --fs-display: clamp(2.5rem, 1.1667rem + 5.9259vw, 6.5rem);     /* 40 → 104 */

  --lh-tight: 1.06;
  --lh-heading: 1.12;
  --lh-snug: 1.35;
  --lh-body: 1.65;

  /* Tracking: wide and airy, like the brand key visuals */
  --track-display: .08em;
  --track-heading: .06em;
  --track-title: .1em;     /* small Adventor titles */
  --track-label: .22em;    /* uppercase data labels */
  --track-nav: .18em;
  --track-button: .14em;

  --measure: 62ch;         /* comfortable line length */

  /* ---------- Space (4 px base) ---------- */
  --space-3xs: .25rem;  /* 4 */
  --space-2xs: .5rem;   /* 8 */
  --space-xs: .75rem;   /* 12 */
  --space-s: 1rem;      /* 16 */
  --space-m: 1.5rem;    /* 24 */
  --space-l: 2rem;      /* 32 */
  --space-xl: 3rem;     /* 48 */
  --space-2xl: 4rem;    /* 64 */
  --space-3xl: 6rem;    /* 96 */
  --space-4xl: 8rem;    /* 128 */

  --gutter: clamp(1.25rem, 0.6rem + 2.9vw, 3rem);         /* ≈20 px on phones, 48 px on desktop */
  --section-y: clamp(4.5rem, 3.2rem + 5.8vw, 9rem);       /* section top/bottom */
  --stack: clamp(1rem, .85rem + .6vw, 1.5rem);             /* gap between text blocks */

  --max: 1280px;           /* main container */
  --max-wide: 1520px;
  --max-text: 720px;       /* reading column */

  --header-h: 64px;

  /* ---------- Shape: mostly square, with 27° chamfers ----------
     The brand's diamonds and long hexagons have sides at 27° from horizontal.
     A cut with rise --cy has run --cx = --cy × 1.9626 (1 / tan 27°). */
  --radius-0: 0;
  --radius-dot: 999px;     /* only for round nodes and the lens */
  --cut-ratio: 1.9626;
  --cut-s: 5px;
  --cut-m: 8px;
  --cut-l: 12px;
  --cut-xl: 18px;
  --hairline: 1px;

  /* ---------- Depth ---------- */
  --glass-bg: linear-gradient(155deg, rgba(20, 50, 72, .58) 0%, rgba(0, 26, 46, .46) 100%);
  --glass-blur: 10px;
  --shadow-panel: 0 40px 80px -40px rgba(0, 8, 16, .7);
  --glow-gold: 0 0 28px rgba(239, 187, 117, .22);

  --z-below: -1;
  --z-base: 0;
  --z-raised: 1;
  --z-hud: 30;             /* home: altitude gauge, captions */
  --z-menu: 40;            /* phone full-screen menu */
  --z-header: 50;          /* header stays above the menu (its button closes it) */
  --z-overlay: 70;         /* dialogs, toasts */
  --z-skip: 100;

  /* ---------- Motion ---------- */
  --ease-out: cubic-bezier(.16, 1, .3, 1);        /* expo out: arrivals */
  --ease-out-soft: cubic-bezier(.25, 1, .5, 1);   /* quart out: UI */
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);    /* moves between two states */
  --ease-scan: cubic-bezier(.45, 0, .2, 1);       /* scan bars, sweeps */
  --dur-instant: 120ms;
  --dur-fast: 200ms;
  --dur-base: 320ms;
  --dur-slow: 640ms;
  --dur-reveal: 1000ms;
  --dur-draw: 2200ms;

  color-scheme: dark;
}

@media (min-width: 768px) {
  :root {
    --header-h: 72px;
    --glass-blur: 14px;
  }
}
@media (min-width: 1280px) {
  :root { --header-h: 80px; }
}
