/*
  Design tokens (design/colors.md) — the plain custom properties, light `:root` + `.dark`, and
  nothing else: the one place a colour, the radius or a duration is written as a value. The SPA
  takes them through `index.css` (Tailwind's `@theme` names over these), the API page
  `swagger.html` through `swagger.css` without Tailwind
  (openspec/changes/archive/*-swagger-page/design.md), MapLibre through getComputedStyle
  (lib/theme.ts) — nothing is duplicated in TS.

  The screen is near-monochrome: warm graphite carries the interface, `--ink` draws data at
  rest (lines, bars, grounded airframes), one orange `--live` says «now / selected / attention»,
  one sage `--ok` says «fine». Nothing is coloured by identity — airframes, survey types and
  areas differ by silhouette, icon and label. Dark is the reference theme; light must pass the
  same contrast table. `--map-*` are hex twins for MapLibre, which cannot parse oklch.
*/

:root {
  color-scheme: light;
  --radius: 0.45rem;
  /* light: the day fallback — same warm-graphite family, paper instead of glass */
  --background: oklch(0.96 0.005 100);
  --foreground: oklch(0.22 0.012 110);
  --card: oklch(0.99 0.002 100);
  --card-foreground: var(--foreground);
  --popover: oklch(0.99 0.002 100);
  --popover-foreground: var(--foreground);
  --muted: oklch(0.93 0.006 100);
  --muted-foreground: oklch(0.45 0.012 110);
  --fg-3: oklch(0.60 0.010 110);
  --accent: oklch(0.90 0.008 100);
  --accent-foreground: var(--foreground);
  --secondary: oklch(0.93 0.006 100);
  --secondary-foreground: var(--foreground);
  /* lines: alpha over the foreground so they sit on any surface */
  --border: color-mix(in oklch, var(--foreground) 12%, transparent);
  --input: color-mix(in oklch, var(--foreground) 16%, transparent);
  --line-strong: color-mix(in oklch, var(--foreground) 22%, transparent);
  --ring: var(--live);
  /* data at rest and its quiet fill */
  --ink: oklch(0.45 0.012 110);
  --ink-soft: color-mix(in oklch, var(--ink) 28%, transparent);
  /* the only chroma: live (now / selected), ok (fine), warn (rare), destructive (buttons only).
     Live is the Geoscan favicon red-orange #EF3B24 = oklch(0.626 0.219 31), darkened per theme
     to hold 4.5:1 on the ground (same move as the old hue-45 orange). */
  --live: oklch(0.55 0.18 31);
  --live-foreground: oklch(0.99 0.005 31);
  --primary: var(--live);
  --primary-foreground: var(--live-foreground);
  --ok: oklch(0.52 0.11 150);
  --warn: oklch(0.52 0.11 75);
  --destructive: oklch(0.52 0.19 28);
  /* the rail follows the theme (#412): paper in light, the darker graphite in .dark; its accents
     are the page's --primary / --ring, which hold 4.5:1 on either rail */
  --sidebar: var(--card);
  --sidebar-foreground: var(--foreground);
  --sidebar-accent: var(--muted);
  --sidebar-accent-foreground: var(--foreground);
  --sidebar-border: color-mix(in oklch, var(--sidebar-foreground) 12%, transparent);
  --sidebar-primary: var(--primary);
  --sidebar-primary-foreground: var(--primary-foreground);
  --sidebar-ring: var(--ring);
  /* hex twins for MapLibre (it cannot parse oklch): --background, the night wash, --ink, --live, --ok.
     Change a source token — change its twin in the same commit. */
  --map-ground: #f2f2ee;
  --map-dim: #ffffff; /* unused in light (vector basemap), kept so the palette shape matches */
  --map-ink: #55564e;
  --map-live: #c53825;
  --map-ok: #317a45;
  /* the map in the day's light (features/map/sunlight.ts writes --sun-dim / --sun-mix from the
     playhead's sun): gold multiplied over the ground near the horizon, this night past twilight */
  --sun-warm: #cf7325;
  --sun-night: #232b3a;
  /* motion constants (motion.md) — the only place durations are written as numbers */
  --dur-fast: 150ms;   /* colour, opacity, border */
  --dur-state: 200ms;  /* panel open, selection change */
  --dur-data: 500ms;   /* data appearing: line, bars, meter */
  --dur-ring: 600ms;   /* ring — the longest appearance */
  --dur-map: 500ms;    /* map easeTo / fitBounds (lib/theme.ts DUR_MAP mirrors it) */
  --ease-out: cubic-bezier(.2, .7, .2, 1);
}

/* On paper the dark tokens never apply (`@media not print`): a printed document is black on white
   whatever the screen's theme — the light `:root` values above are the print values, nothing is
   duplicated (the print rules themselves are at the end of index.css). */
@media not print {
.dark {
  color-scheme: dark;
  /* dark: the reference theme — graphite ground, glass over a dimmed satellite */
  --background: oklch(0.18 0.006 110);
  --foreground: oklch(0.93 0.006 110);
  --card: oklch(0.22 0.007 110);
  --popover: oklch(0.24 0.007 110);
  --muted: oklch(0.28 0.008 110);
  --muted-foreground: oklch(0.70 0.010 110);
  --fg-3: oklch(0.52 0.010 110);
  --accent: oklch(0.31 0.009 110);
  --secondary: oklch(0.28 0.008 110);
  --border: color-mix(in oklch, var(--foreground) 10%, transparent);
  --input: color-mix(in oklch, var(--foreground) 14%, transparent);
  --line-strong: color-mix(in oklch, var(--foreground) 22%, transparent);
  --ink: color-mix(in oklch, var(--foreground) 70%, transparent);
  --live: oklch(0.70 0.18 31);
  --live-foreground: oklch(0.15 0.03 31);
  --ok: oklch(0.74 0.10 145);
  --warn: oklch(0.80 0.13 80);
  --destructive: oklch(0.66 0.19 28);
  /* the rail sits a step below the ground; --sidebar-primary / -ring follow --live via var() */
  --sidebar: oklch(0.14 0.006 110);
  --sidebar-foreground: oklch(0.90 0.006 110);
  --sidebar-accent: oklch(0.22 0.007 110);
  --sidebar-accent-foreground: oklch(0.97 0.004 110);
  --sidebar-border: color-mix(in oklch, var(--sidebar-foreground) 8%, transparent);
  /* --card-foreground, --primary, --ring, --ink-soft inherit from :root via var() */
  --map-ground: #12120f;
  /* night ops: satellite imagery is dimmed with this wash so the glass UI stays readable */
  --map-dim: #0b0b08;
  --map-ink: #a8a8a4;
  --map-live: #fa6b54;
  --map-ok: #82bc83;
}
}
