/* Design tokens: "Blueprint Studio".
 *
 * ALL colours, fonts and the grid live here, as CSS custom properties. The two themes are just
 * two sets of values for the same names, so a theme change never touches app.css.
 *
 *   dark  = the navy blueprint (option A, as approved)
 *   light = warm off-white drafting paper, faint blue grid, navy ink, the same amber accent
 *
 * Which theme shows:
 *   <html data-theme="dark">   or  data-theme="light"  -> that theme (the user chose it)
 *   no data-theme attribute                           -> follows the computer's setting
 *
 * Contrast (WCAG AA, measured by scripts/check_contrast.py, which the tests run): body text >= 4.5:1 on its
 * background in both themes; large headings and UI lines >= 3:1. Use --accent for FILLS (buttons,
 * bars) and --accent-text for amber TEXT: plain amber is too light to read on paper.
 */

@font-face {
  font-family: 'Outfit';
  src: url('../fonts/outfit-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* type */
  --font-head: 'Outfit', ui-rounded, 'SF Pro Rounded', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --label-spacing: 0.06em;      /* only small uppercase labels get letter-spacing, and only a little */

  /* sizes */
  --radius: 4px;
  --header-h: 72px;
  --page-pad: 48px;
  --grid-major: 96px;
  --grid-minor: 24px;
  --motion: 180ms;
  --shadow-lift: 0 20px 60px rgba(0, 0, 0, 0.45);   /* the video lightbox floating over its backdrop */
}

/* ── Dark: the navy blueprint ─────────────────────────────────────────────────────────── */
:root,
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0B1D3A;
  --bg-header: rgba(8, 22, 46, 0.94);
  --panel: #0E2446;
  --panel-raised: #133058;
  --ink: #EAF2FF;              /* main text            14.9:1 on --bg */
  --ink-muted: #A9BDD9;        /* secondary text        8.8:1 on --bg */
  --line: #7FD3FF;             /* blueprint linework   10.1:1 on --bg */
  --line-text: #7FD3FF;        /* blue text (labels)                  */
  --line-soft: rgba(127, 211, 255, 0.32);
  --line-faint: rgba(127, 211, 255, 0.14);
  --grid-major-color: rgba(127, 211, 255, 0.07);
  --grid-minor-color: rgba(127, 211, 255, 0.035);
  --accent: #FFB547;           /* amber fills */
  --accent-text: #FFB547;      /* amber text            9.6:1 on --bg */
  --accent-soft: rgba(255, 181, 71, 0.14);
  --on-accent: #1B1405;        /* text on amber        10.4:1 */
  --good: #6FE3B0;
  --good-text: #6FE3B0;
  --good-soft: rgba(111, 227, 176, 0.12);
  --oops: #FF9F8A;             /* "not quite": a warm coral, never alarm red */
  --oops-text: #FFB3A3;
  --oops-soft: rgba(255, 159, 138, 0.12);
  --focus: #FFD089;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
  /* the video lightbox: a dark room in both themes, so the picture is what you look at */
  --backdrop: rgba(3, 9, 20, 0.88);
  --video-bg: #050B16;
  /* 3D scene colours (read by sim-street.js) */
  --scene-ground: #0C2142;
  --scene-street: #081631;
  --scene-fill: #12305A;
  --scene-roof: #1A3B6B;
}

/* ── Light: drafting paper ────────────────────────────────────────────────────────────── */
:root[data-theme='light'] {
  color-scheme: light;
  --bg: #F6F1E6;
  --bg-header: rgba(250, 247, 240, 0.95);
  --panel: #FFFDF8;
  --panel-raised: #FBF6EC;
  --ink: #13284A;              /* navy ink             13.0:1 on --bg */
  --ink-muted: #44587A;        /* secondary text        6.4:1 on --bg */
  --line: #2A64A8;             /* blueprint blue lines  5.3:1 on --bg */
  --line-text: #1F5594;        /* blue text             6.7:1 on --bg */
  --line-soft: rgba(42, 100, 168, 0.36);
  --line-faint: rgba(42, 100, 168, 0.16);
  --grid-major-color: rgba(42, 100, 168, 0.10);
  --grid-minor-color: rgba(42, 100, 168, 0.05);
  --accent: #FFB547;
  --accent-text: #8A5200;      /* dark amber text       5.7:1 on --bg */
  --accent-soft: rgba(255, 181, 71, 0.22);
  --on-accent: #1B1405;
  --good: #17784F;
  --good-text: #146B46;        /*                       5.8:1 on --bg */
  --good-soft: rgba(30, 138, 92, 0.10);
  --oops: #B04A33;
  --oops-text: #A3402A;        /*                       5.6:1 on --bg */
  --oops-soft: rgba(194, 85, 60, 0.10);
  --focus: #B86E00;
  --shadow: 0 1px 2px rgba(19, 40, 74, 0.08);
  --backdrop: rgba(10, 20, 38, 0.86);
  --video-bg: #050B16;
  --scene-ground: #EDE6D6;
  --scene-street: #D9D1BF;
  --scene-fill: #FFFDF8;
  --scene-roof: #E3ECF7;
}

/* No choice made yet: follow the computer's light/dark setting. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    color-scheme: light;
    --bg: #F6F1E6;
    --bg-header: rgba(250, 247, 240, 0.95);
    --panel: #FFFDF8;
    --panel-raised: #FBF6EC;
    --ink: #13284A;
    --ink-muted: #44587A;
    --line: #2A64A8;
    --line-text: #1F5594;
    --line-soft: rgba(42, 100, 168, 0.36);
    --line-faint: rgba(42, 100, 168, 0.16);
    --grid-major-color: rgba(42, 100, 168, 0.10);
    --grid-minor-color: rgba(42, 100, 168, 0.05);
    --accent: #FFB547;
    --accent-text: #8A5200;
    --accent-soft: rgba(255, 181, 71, 0.22);
    --on-accent: #1B1405;
    --good: #17784F;
    --good-text: #146B46;
    --good-soft: rgba(30, 138, 92, 0.10);
    --oops: #B04A33;
    --oops-text: #A3402A;
    --oops-soft: rgba(194, 85, 60, 0.10);
    --focus: #B86E00;
    --shadow: 0 1px 2px rgba(19, 40, 74, 0.08);
    --backdrop: rgba(10, 20, 38, 0.86);
    --video-bg: #050B16;
    --scene-ground: #EDE6D6;
    --scene-street: #D9D1BF;
    --scene-fill: #FFFDF8;
    --scene-roof: #E3ECF7;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root { --motion: 0ms; }
}
