/* Plus for Things 3 design tokens: the one source for the site, the server
   pages (a byte-identical mirror in server/internal/web/assets/tokens.css,
   copied by `make tokens`) and the status page (Phase 5 reads this file at
   build time). Custom properties and @font-face only. The names are a
   contract: announce a rename in the PR. docs/design-system.md explains
   every token. Light mode only; the text colours meet WCAG AA on white and
   on --surface. */

/* Inter 4.1 variable (opsz 14-32, wght 400-700), latin subset, SIL OFL
   (web/public/fonts). The file name carries the version, so it can be
   cached for a year. */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/inter-4.1-latin.woff2') format('woff2');
}

/* Arial (or Helvetica) scaled to Inter's width and vertical metrics, so
   text does not move when Inter arrives. */
@font-face {
  font-family: 'Inter Fallback';
  src: local('Arial'), local('ArialMT'), local('Helvetica');
  size-adjust: 107.4%;
  ascent-override: 90.2%;
  descent-override: 22.48%;
  line-gap-override: 0%;
}

:root {
  /* Colour: blues. Text and buttons use --blue-600 and --blue-700;
     --blue (#3B82F6) is 3.7:1 on white, so it is for marks and
     decoration only, never for text. */
  --blue: #3B82F6;
  --blue-600: #2563EB;
  --blue-700: #1D4ED8;
  --blue-50: #F5F9FF;
  --blue-100: #DBEAFE;
  --blue-200: #BFDBFE;
  --blue-300: #93C5FD;

  /* Colour: surfaces, text, lines */
  --white: #FFFFFF;
  --surface: #EAF3FF;
  --ink: #0F172A;
  --muted: #475569;
  --line: #D6E0EC;
  --field: #8093AA;
  --red: #B91C1C;
  --red-line: #DC2626;

  /* Colour: status (Phase 5's status page). The dot and bar colours are
     for shapes; text uses the -text variants, which meet AA on --white,
     --blue-50 and --surface. */
  --status-ok: #16A34A;
  --status-degraded: #D97706;
  --status-down: #DC2626;
  --status-ok-text: #127234;
  --status-degraded-text: #A14B06;
  --status-down-text: #B91C1C;

  /* Colour: the sky behind hero and server pages */
  --sky-top: #F7FAFF;
  --sky-bottom: #DDE9FB;

  /* Type */
  --font-sans: 'Inter', 'Inter Fallback', ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
  --text-xs: 0.8125rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-md: 1.125rem;
  --text-lg: 1.3125rem;
  --text-xl: 1.5rem;
  --text-2xl: 2.25rem;
  --text-3xl: 3rem;
  --text-4xl: 3.75rem;
  --text-h1: clamp(2rem, 1.5rem + 2vw, 3rem);
  --text-h2: clamp(1.625rem, 1.35rem + 1.1vw, 2.25rem);
  --text-display: clamp(2.25rem, 1.4rem + 3.4vw, 3.75rem);
  --leading-tight: 1.1;
  --leading-snug: 1.3;
  --leading-normal: 1.55;
  --leading-relaxed: 1.7;
  --tracking-display: -0.022em;
  --tracking-tight: -0.012em;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  /* Space: an 8-point scale (--space-N is N x 8 px) */
  --space-half: 4px;
  --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;

  /* Layout */
  --container: 1232px;
  --container-narrow: 760px;
  --measure: 68ch;
  --gutter: clamp(16px, 4vw, 32px);
  --header-h: 64px;

  /* Shape */
  --r-xs: 8px;
  --r-sm: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 16px 40px rgba(37, 99, 235, 0.10);
  --shadow-lg: 0 2px 6px rgba(15, 23, 42, 0.05), 0 28px 64px rgba(37, 99, 235, 0.16);

  /* Motion: interface motion answers an action; the sky is the only
     ambient motion. Everything stops under prefers-reduced-motion. */
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 120ms;
  --dur: 200ms;
  --dur-slow: 400ms;
}
