/* Toland tokens: copied from Euclid's cine-kb 27b-shot-list-tokens.css (do not edit there), plus the self-hosted font.
   Atkinson Hyperlegible ships only Regular (400) and Bold (700): 400-549 map to Regular, 550-800 to Bold (no faux bold). */
@font-face { font-family: "Atkinson Hyperlegible"; src: url("fonts/AtkinsonHyperlegible-Regular.woff2") format("woff2"); font-weight: 300 549; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("fonts/AtkinsonHyperlegible-Bold.woff2") format("woff2"); font-weight: 550 900; font-display: swap; }
/* 27b — Shot-list app design tokens (Euclid). Source: 27-shot-list-app-legibility-euclid.md
   Themes: default = light (daylight). Set data-theme="dark" | "red" | "hc" on <html>.
   Sizes in rem (1rem = 16px base) so Dynamic Type / user zoom scales them. */

/* Fonts (all OFL): Atkinson Hyperlegible (UI), IBM Plex Mono (optional codes). Self-host for offline PWA. */

:root {
  /* ---------- Type families ---------- */
  --font-ui: "Atkinson Hyperlegible", "Inter", system-ui, -apple-system, sans-serif;
  --font-code: "IBM Plex Mono", ui-monospace, "SF Mono", monospace;
  --num: tabular-nums;                       /* use: font-variant-numeric: var(--num) */

  /* ---------- Type scale (list / detail) ---------- */
  --fs-id: 1.75rem;      /* 28 — L1 shot ID */
  --fs-codes: 1.0625rem; /* 17 — L2 size/angle/move */
  --fs-action: 1.0625rem;/* 17 — L3 description */
  --fs-meta: 0.9375rem;  /* 15 — L4 lens/rig/cast/min */
  --fs-label: 0.8125rem; /* 13 — field labels, floor */
  --fs-meter: 1.75rem;   /* ahead/behind number */

  --fw-id: 700;  --fw-codes: 600;  --fw-action: 400;  --fw-meta: 500;  --fw-label: 600;
  --ls-codes: 0.04em;  --ls-label: 0.04em;
  --lh-body: 1.3;  --lh-tight: 1.1;

  /* ---------- Spacing (4pt grid) ---------- */
  --sp-1: 0.25rem;  /* 4 */
  --sp-2: 0.5rem;   /* 8  — row gap, min gap between targets */
  --sp-3: 0.75rem;  /* 12 — row padding vertical */
  --sp-4: 1rem;     /* 16 — row padding horizontal */
  --sp-6: 1.5rem;   /* 24 — section gap */
  --row-pad: var(--sp-3) var(--sp-4);
  --row-gap: var(--sp-2);
  --section-gap: var(--sp-6);
  --radius: 0.5rem; /* 8 — photo, sheets */
  --radius-pill: 999px;

  /* ---------- Touch ---------- */
  --tap-min: 44px;
  --tap-gap: 8px;
  --arrow-btn: 44px;       /* photo corner arrows (visual) */
  --arrow-hit: 48px;       /* hit area, may overhang photo edge */
  --arrow-inset: 6px;
  --arrow-stroke: 3px;
  --arrow-ring: 2px;
  --arrow-selected-scale: 1.15;
  --setup-bar: 4px;        /* left-edge setup colour bar */

  /* ---------- Motion ---------- */
  --dur: 150ms;
  --ease: cubic-bezier(.2,.8,.2,1);
  --undo-toast-ms: 5000;

  /* ---------- Colour: LIGHT (default, daylight) ---------- */
  --bg: #FFFFFF;
  --surface: #F6F6F6;
  --text: #111111;          /* ~18.9:1 on white */
  --text-2: #333333;        /* meta */
  --label: #555555;         /* ~7.5:1 — lightest grey allowed */
  --divider: rgba(0,0,0,.12);
  --scrim: rgba(0,0,0,.25);
  --focus: #0050C8;

  --arrow-bg: #FFFFFF;  --arrow-fg: #000000;  --arrow-ring-c: #000000;
  --arrow-sel-bg: #000000; --arrow-sel-fg: #FFFFFF;
  --arrow-idle-opacity: .7;
  --arrow-shadow: 0 1px 4px rgba(0,0,0,.45);

  /* priority */
  --must-bg: #111111; --must-fg: #FFFFFF;
  --should-fg: #111111; --should-ring: #111111;
  --could-fg: #555555;

  /* status — solid/outline only, always paired with word + glyph */
  --st-planned: #333333;
  --st-progress: #0050C8;
  --st-done: #11703A;
  --st-skipped: #B3261E;
  --st-moved: #8A4B00;
  --st-pickup: #6A1B9A;
  --st-merged: #37474F;
  --st-on: #FFFFFF;          /* text on filled pill */
  --done-row-opacity: .6;

  /* setup bars (cycle) */
  --setup-1: #1F5FBF; --setup-2: #B45309; --setup-3: #0F766E; --setup-4: #9D174D;
  --setup-5: #4D7C0F; --setup-6: #6D28D9; --setup-7: #374151; --setup-8: #A16207;

  /* meter */
  --ahead: #11703A; --behind: #B3261E;
}

/* ---------- DARK (night shoots) ---------- */
[data-theme="dark"] {
  --bg: #0B0B0B;  --surface: #161616;
  --text: #EDEDED;  --text-2: #CFCFCF;  --label: #A8A8A8;
  --divider: rgba(255,255,255,.14);  --focus: #7FB2FF;
  --arrow-bg: #EDEDED; --arrow-fg: #0B0B0B; --arrow-ring-c: #0B0B0B;
  --arrow-sel-bg: #0B0B0B; --arrow-sel-fg: #EDEDED;
  --must-bg: #EDEDED; --must-fg: #0B0B0B;
  --should-fg: #EDEDED; --should-ring: #EDEDED; --could-fg: #A8A8A8;
  --st-planned: #CFCFCF; --st-progress: #7FB2FF; --st-done: #5BD68A;
  --st-skipped: #FF7A70; --st-moved: #F0A65A; --st-pickup: #C99BFF; --st-merged: #B0BEC5;
  --st-on: #0B0B0B;
  --ahead: #5BD68A; --behind: #FF7A70;
}

/* ---------- RED NIGHT (preserve night vision, no bright spill) ---------- */
[data-theme="red"] {
  --bg: #000000;  --surface: #120000;
  --text: #FF5A4D;  --text-2: #E04A3F;  --label: #B83A31;
  --divider: rgba(255,90,77,.22);  --focus: #FF5A4D;
  --scrim: rgba(0,0,0,.5);
  --arrow-bg: #000000; --arrow-fg: #FF5A4D; --arrow-ring-c: #FF5A4D;
  --arrow-sel-bg: #FF5A4D; --arrow-sel-fg: #000000;
  --arrow-shadow: none;
  --must-bg: #FF5A4D; --must-fg: #000000;
  --should-fg: #FF5A4D; --should-ring: #FF5A4D; --could-fg: #B83A31;
  /* single hue: status relies on word + glyph + fill/outline */
  --st-planned: #B83A31; --st-progress: #FF5A4D; --st-done: #FF5A4D;
  --st-skipped: #FF5A4D; --st-moved: #FF5A4D; --st-pickup: #FF5A4D; --st-merged: #B83A31;
  --st-on: #000000;
  --setup-1: #FF5A4D; --setup-2: #B83A31; --setup-3: #FF5A4D; --setup-4: #B83A31;
  --setup-5: #FF5A4D; --setup-6: #B83A31; --setup-7: #FF5A4D; --setup-8: #B83A31;
  --ahead: #FF5A4D; --behind: #FF5A4D;
}
[data-theme="red"] img { filter: grayscale(1) sepia(1) hue-rotate(-50deg) saturate(4) brightness(.6); }

/* ---------- HIGH CONTRAST (sunlight) ---------- */
[data-theme="hc"] {
  --bg: #FFFFFF; --surface: #FFFFFF;
  --text: #000000; --text-2: #000000; --label: #000000;
  --divider: #000000; --focus: #000000;
  --arrow-idle-opacity: 1;
  --could-fg: #000000;
  --st-planned: #000000; --st-progress: #000000; --st-done: #000000;
  --st-skipped: #000000; --st-moved: #000000; --st-pickup: #000000; --st-merged: #000000;
  --done-row-opacity: .75;
  --fw-action: 500; --fw-meta: 600; --fw-codes: 700; /* +100 weights */
}

/* ---------- ON-SET MODE (combine with any theme) ---------- */
[data-mode="onset"] {
  --fs-id: 2.125rem;     /* 34 */
  --fs-codes: 1.25rem;   /* 20 */
  --fs-action: 1.1875rem;/* 19 */
  --fs-meta: 1.0625rem;  /* 17 */
  --fs-meter: 2.25rem;
  --tap-min: 56px;
  --arrow-btn: 56px; --arrow-hit: 60px;
}
[data-mode="onset"] { --fw-action: 500; } /* fallback: no thin weights on set */

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