/*
 * TechAPTO design tokens (docs/design.md, D-008, D-009)
 * The single source of colour, type, spacing, shape and motion. site.css and
 * templates reference these custom properties only; nothing else hard-codes
 * a colour or size.
 *
 * Theme: light only (plan §2.1). Colour contrast ratios are in design.md §3.
 *
 * Fonts: self-hosted woff2, Latin subset, SIL OFL 1.1 (licences in
 * ../fonts/). Newsreader (variable opsz + wght) for display and headings,
 * Inter (variable wght) for body and UI, Geist Mono (variable wght) for
 * labels. The wordmark is an inline SVG and needs no font. Each family has
 * a metric-matched local fallback, measured in Chrome from a 200-character
 * sample (P1-2, docs/handoffs/frontend.md), so the swap barely shifts layout.
 */

/* ---------------------------------------------------------------------
   Font faces. unicode-range is the Latin subset as served by Google Fonts.
   --------------------------------------------------------------------- */

@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/newsreader-latin-opsz-wght-v26.woff2") format("woff2");
  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;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-wght-v20.woff2") format("woff2");
  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;
}

@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/geist-mono-latin-wght-v6.woff2") format("woff2");
  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 fallbacks (size-adjust = average advance ratio; ascent and
   descent from the web font's line metrics, divided by size-adjust). */
@font-face {
  font-family: "Newsreader Fallback";
  src: local("Georgia");
  size-adjust: 98.02%;
  ascent-override: 74.99%;
  descent-override: 27.04%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Inter Fallback";
  src: local("Arial"), local("ArialMT"), local("Liberation Sans"), local("Arimo");
  size-adjust: 107.00%;
  ascent-override: 90.56%;
  descent-override: 22.52%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Geist Mono Fallback";
  src: local("Menlo"), local("Consolas"), local("Courier New");
  size-adjust: 99.98%;
  ascent-override: 100.52%;
  descent-override: 29.50%;
  line-gap-override: 0%;
}

:root {
  color-scheme: light;

  /* ---- Colour (design.md §3) ---- */
  --ground: #FFFFFF;          /* page background */
  --surface: #F5F5F4;         /* cards, tiles, form fields */
  --line: #E6E6E3;            /* hairlines, borders (decorative) */
  --ink: #0A0A0B;             /* headings, body, primary button */
  --ink-2: #2B2B2B;           /* secondary body text */
  --muted: #6B6B6B;           /* captions, eyebrows: 5.33 on ground, 4.89 on surface */
  --reveal: #8F8F8D;          /* unrevealed mission words: 3.24 on ground (large text, QA F1) */
  --band: #0A0A0B;            /* dark band and footer */
  --band-surface: #17171A;    /* cards on the band */
  --band-line: #2A2A2E;       /* hairlines on the band (decorative) */
  --band-ink: #F5F5F4;        /* text on the band: 18.3 */
  --band-muted: #A3A3A3;      /* meta on the band: 7.85 */
  --accent: #2F4BFF;          /* cobalt (D-008): 5.88 with white text, 5.39 on surface */
  --accent-ink: #FFFFFF;      /* text and icons on the accent */
  --scrim: rgba(10, 10, 11, 0.62); /* hero video overlay (D-024): keeps white text readable */
  --focus: var(--accent);

  /* ---- Type families ---- */
  --font-serif: "Newsreader", "Newsreader Fallback", Georgia, serif;
  --font-sans: "Inter", "Inter Fallback", Arial, sans-serif;
  --font-mono: "Geist Mono", "Geist Mono Fallback", Menlo, Consolas, monospace;

  /* ---- Type scale (design.md §4), fluid 360px -> 1440px ---- */
  --t-display: clamp(2.75rem, 1.6rem + 5vw, 5.5rem);
  --t-h2: clamp(2rem, 1.4rem + 2.6vw, 3.25rem);
  --t-h3: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);
  --t-figure: clamp(3rem, 2rem + 4vw, 5rem);
  --t-lede: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
  --t-body: 1.0625rem;
  --t-small: 0.875rem;
  --t-eyebrow: 0.75rem;

  --lh-display: 1.02;
  --lh-h2: 1.08;
  --lh-h3: 1.2;
  --lh-figure: 1;
  --lh-lede: 1.5;
  --lh-body: 1.6;
  --lh-small: 1.5;
  --lh-eyebrow: 1.4;

  --track-display: -0.02em;
  --track-h2: -0.015em;
  --track-h3: -0.01em;
  --track-eyebrow: 0.08em;

  --w-serif-light: 300;
  --w-serif: 400;
  --w-body: 400;
  --w-medium: 500;
  --w-semibold: 600;

  --measure: 68ch;            /* body text */
  --measure-head: 24ch;       /* headlines */
  --measure-head-home: 18ch;  /* Home hero headline */

  /* ---- Space (design.md §5) ---- */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;
  --s-10: 128px;
  --section-y: clamp(64px, 10vw, 128px);
  --gutter: clamp(16px, 4vw, 32px);
  --container: 1280px;
  --grid-gap: 24px;

  /* ---- Shape ---- */
  --r-card: 20px;
  --r-tile: 12px;
  --r-button: 10px;
  --r-chip: 8px;
  --r-pill: 999px;
  --border: 1px solid var(--line);
  --border-band: 1px solid var(--band-line);

  /* ---- Components ---- */
  --header-h: 72px;
  --control-h: 48px;
  --chip-size: 40px;
  --focus-ring: 2px solid var(--focus);
  --focus-offset: 2px;

  /* ---- Motion (design.md §8; all off under prefers-reduced-motion) ---- */
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur-fast: 150ms;
  --dur-reveal: 400ms;
  --rise: 12px;
  --ticker-loop: 60s;
  --signal-loop: 7s;          /* hero grid signals (D-021) */
  --signal-len: 120px;
}
