/* HARDGAP Design Tokens
   All colors, fonts, and spacing values are defined here.
   No hardcoded hex values outside this file. */

/* Space Grotesk is self-hosted, not pulled from Google Fonts. A stylesheet
   loaded from fonts.googleapis.com cannot satisfy `style-src 'self'` without
   an origin exception, and a site that sells air-gapped hardware does not ask
   its visitors to announce every page view to a third party to render text.
   One variable file per subset covers the 300-700 range the design uses.
   SIL Open Font License 1.1 — see assets/fonts/OFL.txt. */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/assets/fonts/space-grotesk-latin.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: 'Space Grotesk';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/assets/fonts/space-grotesk-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* Backgrounds */
  --bg-primary: #000000;
  --bg-secondary: #111111;
  --bg-surface: #1A1A1A;
  --bg-elevated: #222222;

  /* Text */
  /* Every text colour clears WCAG AA (4.5:1) against the darkest surface it
     is used on, --bg-surface #1A1A1A, not just against pure black. The old
     --text-muted #555555 measured 2.33:1 there, which is unreadable, and it
     was carrying spec-table headers and form hints. */
  --text-primary: #E8E4D9;    /* Warm e-ink white — the sapphire window color. 13.7:1 */
  --text-secondary: #A8A8A8;  /* 7.2:1 on surface */
  --text-muted: #8A8A8A;      /* 5.0:1 on surface */
  /* Scoped to --bg-primary, --bg-secondary, and --bg-surface: 5.81, 5.23 and
     4.82:1. NOT for use on --bg-elevated, where it measures 4.41:1.
     That exclusion is a property of the palette, not an oversight — even
     --text-muted is only 4.61:1 on --bg-elevated, so there is no room for a
     fainter tier that is also safe there. Elevated surfaces are opaque cards,
     so nothing painted on the page background reaches text sitting on them.

     The previous value, #7A7A82, was safe on pure black (4.93:1) and nowhere
     else: 4.44:1 on --bg-secondary, 4.09:1 on --bg-surface. It had no headroom
     for anything painted behind it, which capped the NFC field background at
     luminance 0.0048. #86868E raises that ceiling to 0.0146 — three times the
     budget, and the reason the accent reads at all. */
  --text-faint: #86868E;      /* Ordinals and separators, on dark surfaces */
  --text-accent: #64D2FF;     /* NFC blue — CTAs and interactive elements */

  /* Titanium chassis palette */
  --titanium-light: #8E8E94;
  --titanium-mid: #7A7A80;
  --titanium-dark: #4A4A52;

  /* Borders */
  --border-subtle: #1A1A1A;
  --border-default: #2A2A2A;

  /* Accent colors */
  --accent-primary: #64D2FF;  /* NFC blue */
  --accent-danger: #E8635A;   /* E-ink red — warnings, errors. 5.3:1 on surface */
  --accent-success: #66BB6A;  /* E-ink green — confirmations. 7.4:1 on surface */
  --accent-gold: #D4A017;     /* E-ink yellow — Founders Edition accent. 7.3:1 on surface */
  --accent-danger-fill: #A82722; /* Danger used as a fill behind light text */

  /* Typography */
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Space Grotesk', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Courier New', monospace;

  /* Tracking scale. Named by typographic role so wordmarks, display copy,
     labels, and controls move together when the system is tuned. */
  --tracking-display: -0.055em;
  --tracking-heading: -0.025em;
  --tracking-normal: 0;
  --tracking-control: 0.01em;
  --tracking-input: 0.02em;
  --tracking-label: 0.11em;
  --tracking-wordmark: 0.25em;

  /* Spacing — 8px base unit */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 40px;
  --space-6: 48px;
  --space-8: 64px;
  --space-10: 80px;
  --space-12: 96px;
  --space-16: 128px;

  --space-20: 160px;
  --space-24: 192px;

  /* Type scale — fluid between a 375px phone and a 1440px display, so the
     hero does not need a media query to stop overflowing on a small screen
     and does not look undersized on a large one. */
  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-base: 1rem;
  --text-lg: clamp(1.0625rem, 0.99rem + 0.32vw, 1.25rem);
  --text-xl: clamp(1.25rem, 1.13rem + 0.5vw, 1.5rem);
  --text-2xl: clamp(1.5rem, 1.28rem + 0.94vw, 2rem);
  --text-3xl: clamp(1.875rem, 1.5rem + 1.6vw, 2.75rem);
  --text-hero: clamp(2.25rem, 1.36rem + 3.8vw, 4.5rem);

  /* Measure — long-form copy stops being readable much past this */
  --measure: 68ch;
  --measure-narrow: 54ch;

  /* Content widths */
  --width-content: 1200px;
  --width-prose: 780px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 400ms cubic-bezier(0.22, 1, 0.36, 1);

  /* Border radius — max 4px for hardware aesthetic */
  --radius-sm: 2px;
  --radius-base: 4px;

  /* Elevation. Titanium under a dark room light: a tight contact shadow and a
     wide ambient one, never a soft drop shadow. */
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 12px 32px rgba(0, 0, 0, 0.6);
  --glow-accent: 0 0 24px rgba(100, 210, 255, 0.22);
  --glow-gold: 0 0 24px rgba(212, 160, 23, 0.22);
}

/* Everything below respects a reduced-motion preference. The Ken Burns drift
   on the hero and the dialog transition are decoration, not information. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
