/* Altivon Digital — design tokens (spec: design/ART-DIRECTION.md §2–4, §6).
   Foundation team file. Section teams read these tokens; they never redefine the raw palette.

   Two layers:
   1. Raw tokens (palette, type, space, radii, shadows, glass, motion) — fixed values from the spec.
   2. Semantic tokens (--text, --text-2, --text-3, --hairline, --btn-*, --focus-ring, --surface, --selection-*)
      that each ground (.ground-stone, .ground-stone-2, .ground-night in base.css) points at the right raw
      values. Write components against the semantic layer and they work on every ground. */

/* ---- Mona Sans, self-hosted (Google Fonts "latin" file, variable: wght 200–900, wdth 75–125) ------------ */
@font-face {
  font-family: "Mona Sans";
  src: url("../fonts/mona-sans-latin.woff2") format("woff2");
  font-weight: 200 900;
  font-stretch: 75% 125%;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Metric-matched stand-in while the woff2 loads, so the swap barely moves text (Arial scaled to Mona Sans'
   average advance at 420/100; vertical metrics from Mona Sans: ascent 1090, descent 320, gap 0). */
@font-face {
  font-family: "Mona Sans Fallback";
  src: local("Arial"), local("ArialMT"), local("Helvetica Neue"), local("Helvetica");
  size-adjust: 103%;
  ascent-override: 105.8%;
  descent-override: 31.1%;
  line-gap-override: 0%;
}

:root {
  /* ---- Palette: the client's navy, chrome greys and one royal blue, taken from the Altivon logo ----------- */
  /* light stage: cool chrome greys (the token names stay, so every section keeps working) */
  --stone: #E7EAF0;        /* main light ground */
  --stone-2: #DBE0E8;      /* deeper band, alternating sections */
  --stone-3: #C8CFDA;      /* far edge of a sweep, dividers as fills */
  --paper: #F4F6F9;        /* raised panels on the greys, glass tint */
  /* ink: navy */
  --ink: #0B1226;          /* text, primary buttons (15:1 on stone) */
  --ink-2: #3B4458;        /* secondary text (8.1:1 on stone) */
  --ink-3: #565F75;        /* labels, captions (5.3:1 on stone, 5.9:1 on paper) */
  --ink-3-deep: #4C556B;   /* labels on stone-2 (5.6:1) */
  /* night stage: the logo's deep navy */
  --night: #09101F;
  --night-2: #111A30;
  --on-night: #EEF1F6;     /* chrome white (16.8:1 on night) */
  --on-night-2: #A2ACC1;   /* 8.3:1 on night, 7.6:1 on night-2 */
  /* the accent: the blue under the logo's swoosh, used sparingly (focus, selection, link hover) */
  --royal: #2D4FD6;        /* on the greys (5.4:1 on stone) */
  --royal-night: #7D95FF;  /* on navy (6.9:1 on night) */
  /* materials */
  --line: rgba(11, 18, 38, .12);         /* hairlines: allowed, sparingly */
  --line-night: rgba(238, 241, 246, .14);
  --glass: rgba(244, 246, 249, .58);     /* with --glass-filter */
  --glass-edge: rgba(255, 255, 255, .55);/* 1px inner highlight on glass */
  --glass-night: rgba(20, 30, 56, .56);
  --glass-edge-night: rgba(255, 255, 255, .1);
  --glass-solid: rgba(244, 246, 249, .94);       /* when backdrop-filter is unsupported */
  --glass-solid-night: rgba(17, 26, 48, .96);
  --glass-filter: blur(18px) saturate(1.4);
  --glass-filter-chip: blur(16px) saturate(1.4);
  --glass-sheen: linear-gradient(180deg, rgba(255, 255, 255, .26) 0%, rgba(255, 255, 255, 0) 46%);

  /* the hero's studio light on navy (the logo's vignette), the night sections' softer top light, the contact shadow */
  --sweep: radial-gradient(120% 92% at 50% 26%, #1B2849 0%, #0F1832 42%, #070C18 100%);
  --night-light: radial-gradient(130% 80% at 50% 0%, #121C38 0%, #09101F 62%);
  --grey-light: linear-gradient(180deg, rgba(255, 255, 255, .42) 0%, rgba(255, 255, 255, 0) 38%); /* a soft sheen at the top of each grey section */
  --contact-shadow: radial-gradient(closest-side, rgba(2, 5, 14, .5), rgba(2, 5, 14, .18) 55%, rgba(2, 5, 14, 0));

  /* ---- Shadows ---------------------------------------------------------------------------------------- */
  --shadow-float: 0 40px 80px -20px rgba(6, 11, 26, .3), 0 18px 36px -18px rgba(6, 11, 26, .24);
  --shadow-chip: 0 18px 36px -14px rgba(6, 11, 26, .28), 0 4px 10px -4px rgba(6, 11, 26, .14);
  --shadow-sheet: 0 30px 60px -24px rgba(6, 11, 26, .34);

  /* ---- Type: Mona Sans only (§3) ---------------------------------------------------------------------- */
  --font: "Mona Sans", "Mona Sans Fallback", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --fs-display: clamp(3.25rem, 1.1rem + 8.6vw, 10.75rem);  /* hero headline, 52 → 172px */
  --fs-h2: clamp(2.5rem, 1.1rem + 4.8vw, 6.25rem);         /* section headlines, 40 → 100px */
  --fs-sub: clamp(1.5rem, 1.1rem + 1.4vw, 2.25rem);        /* 24 → 36px */
  --fs-lead: clamp(1.125rem, 1rem + .5vw, 1.375rem);       /* 18 → 22px */
  --fs-body: 1.0625rem;  /* 17px */
  --fs-ui: .9375rem;     /* 15px: buttons, nav links */
  --fs-small: .875rem;   /* 14px: footer and fine print */
  --fs-label: .8125rem;  /* 13px */

  --fw-display: 520;
  --fw-sub: 500;
  --fw-text: 420;
  --fw-nav: 480;
  --fw-ui: 560;
  --fw-label: 560;
  --fw-brand: 620;

  --fwd-display: 100%;   /* font-stretch (the wdth axis) */
  --fwd-label: 112%;
  --fwd-brand: 108%;

  --tr-display: -0.045em;
  --tr-sub: -0.025em;
  --tr-lead: -0.01em;
  --tr-label: 0.08em;
  --tr-brand: -0.03em;

  --lh-display: .9;
  --lh-sub: 1.05;
  --lh-lead: 1.4;
  --lh-body: 1.55;

  --measure-lead: 34ch;
  --measure-body: 62ch;

  /* ---- Layout (§4) ------------------------------------------------------------------------------------- */
  --margin: clamp(20px, 3.2vw, 48px);         /* page margins */
  --gutter: clamp(12px, 1.4vw, 24px);         /* column gap of the 12-column grid */
  --section-pad: clamp(112px, 13vw, 208px);   /* section padding, top and bottom */
  --nav-h: 64px;
  --target: 44px;                             /* smallest touch target */

  /* spacing scale (4px base) */
  --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;
  /* fluid gaps for compositions */
  --space-fluid-s: clamp(16px, 1.2vw + 10px, 28px);
  --space-fluid-m: clamp(28px, 3vw + 12px, 64px);
  --space-fluid-l: clamp(48px, 6vw + 16px, 120px);

  /* ---- Radii ------------------------------------------------------------------------------------------- */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-card: 20px;   /* cards, the phone menu sheet */
  --radius-lg: 28px;
  --radius-pill: 999px;

  /* ---- Motion (§6) ------------------------------------------------------------------------------------- */
  --ease-out: cubic-bezier(.16, 1, .3, 1);        /* entrances (≈ expo.out) */
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);    /* moves (≈ power3.inOut) */
  --ease-in: cubic-bezier(.7, 0, .84, 0);         /* exits */
  /* Springs for UI feedback (fallbacks first; linear() versions below where supported). */
  --ease-spring: cubic-bezier(.2, .9, .25, 1);    /* morph: ≤ 0.6% overshoot */
  --ease-press: cubic-bezier(.25, .8, .3, 1);     /* press: critically damped */

  --dur-press: 190ms;
  --dur-morph: 430ms;
  --dur-ui: 600ms;        /* UI moves 0.5–0.7s */
  --dur-reveal: 1200ms;   /* big type 1.1–1.3s */
  --stagger: 75ms;        /* big type 0.06–0.09s */

  /* ---- Layers ------------------------------------------------------------------------------------------ */
  --z-content: 1;
  --z-sticky: 20;
  --z-nav: 100;
  --z-grain: 900;
  --z-skip: 1000;

  /* ---- Semantic tokens: the light stone ground is the default --------------------------------------------- */
  --ground: var(--stone);
  --text: var(--ink);
  --text-2: var(--ink-2);
  --text-3: var(--ink-3);
  --hairline: var(--line);
  --surface: var(--paper);
  --btn-bg: var(--ink);
  --btn-bg-hover: #1C2744;
  --btn-fg: var(--stone);
  --accent: var(--royal);
  --focus-ring: var(--royal);
  --selection-bg: var(--ink);
  --selection-fg: var(--stone);
  --grain-opacity: .045;        /* multiply-equivalent darkening grain on light pixels */
  --grain-light-opacity: .03;   /* screen-equivalent lightening grain on dark pixels */
}

/* True damped-spring curves (sampled step responses). Spring: ζ 0.86, 0.5% overshoot. Press: ζ 1. */
@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --ease-spring: linear(0, 0.0013 0.62%, 0.0046 1.18%, 0.0111 1.88%, 0.0218 2.68%, 0.0373 3.59%, 0.0583 4.59%,
      0.0848 5.69%, 0.117 6.87%, 0.1544 8.13%, 0.2429 10.88%, 0.3988 15.55%, 0.4534 17.24%, 0.5077 19%, 0.561 20.82%,
      0.6126 22.7%, 0.6617 24.64%, 0.7079 26.64%, 0.7507 28.7%, 0.7899 30.82%, 0.8254 32.99%, 0.8569 35.21%,
      0.8847 37.49%, 0.9087 39.83%, 0.9293 42.22%, 0.9466 44.65%, 0.9609 47.14%, 0.9725 49.68%, 0.9818 52.27%,
      0.989 54.91%, 0.9985 60.33%, 1.0043 68.81%, 1.002 96.69%, 1);
    --ease-press: linear(0, 0.0041 0.98%, 0.0141 1.88%, 0.0331 2.97%, 0.0624 4.25%, 0.1025 5.69%, 0.1526 7.28%,
      0.3454 12.88%, 0.4163 15%, 0.4867 17.24%, 0.5547 19.6%, 0.6189 22.07%, 0.6779 24.64%, 0.7312 27.32%,
      0.7784 30.1%, 0.8195 32.99%, 0.8547 35.97%, 0.8843 39.04%, 0.9089 42.22%, 0.929 45.48%, 0.9453 48.83%,
      0.9582 52.27%, 0.9684 55.8%, 0.9764 59.41%, 0.9871 66.89%, 0.9952 78.72%, 1);
  }
}
