/* Camera Simulator: design tokens. The ONLY file with color, font, radius, spacing, size or duration literals.
   Base: the Instrument direction (_design/sleek-instrument/tokens.css, Nov 19, 2026), copied, then the app's own tokens
   (BLUEPRINT.md section 10.1). Builders 2 and 3 append under their own comment block at the end. */
@import url("https://cdn.jsdelivr.net/npm/@fontsource-variable/geist@5.1.0/index.css");
@import url("https://cdn.jsdelivr.net/npm/@fontsource-variable/geist-mono@5.1.0/index.css");

:root {
  color-scheme: dark;

  /* ---- Instrument palette (contrast worked out in DIRECTION.md) ---- */
  --ground: #161517;      /* page */
  --panel: #1C1B1E;       /* rail, panels */
  --raised: #242326;      /* hover, inputs, pressed */
  --line: #302F33;        /* hairlines */
  --line-strong: #46444A; /* control outlines, ticks */
  --text: #ECECEA;        /* 15.4:1 on ground */
  --text-2: #A9ABAF;      /* 7.9:1 on ground, 6.8:1 on raised */
  --text-3: #8E9095;      /* labels: 5.7:1 on ground, 4.9:1 on raised */
  --silver: #DCDDDA;
  --silver-hi: #FFFFFF;
  --ink: #141517;         /* 13.4:1 on silver */
  --ink-2: #4A4C50;
  --signal: #E2343F;      /* the one accent: marks only, never text */
  --warn: #FFD60A;        /* clipping and limits only */
  --stage: #1A191B;       /* the stage behind the picture */
  --black: #000000;       /* behind the canvas, the shutter blink */
  --accent: #FFD60A;      /* read by render.js for the highlight warning stripes: the zebra color */

  --font-sans: "Geist Variable", "Geist", ui-sans-serif, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Geist Mono Variable", "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Change 3 of 6 (Nov 20, 2026): the whole scale one step up ("text too small" on a laptop); 12 px is the floor
     anywhere (checks/e2e-textsize.mjs). Was 11 / 11 / 11 / 12 / 13 / 14 / 15 / 16 / 22 / 28. */
  --t-nano: 12px;
  --t-micro: 12px;
  --t-label: 12px;
  --t-xs: 13px;
  --t-sm: 14px;
  --t-md: 15px;
  --t-title-s: 16px;
  --t-body: 17px;
  --t-val: 24px;
  --t-h2: 30px;
  /* The value you are changing right now (a dial turned, held or focused): larger and brighter, on the dial and on
     the matching HUD readout over the picture. */
  --t-val-on: 30px;
  --t-hud-on: 18px;
  --val-on: var(--silver-hi);
  --track-label: 0.12em;   /* change 3 of 6: was 0.14em; the larger labels keep the dock values from truncating sooner */
  --track-tight: -0.015em;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;

  --r: 2px;
  --r-tag: 1px;
  --round: 999px;
  --hair: 1px;
  --index-w: 2px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --d-click: 90ms;
  --d-blink: 120ms;
  --d-ui: 240ms;
  --d-reveal: 600ms;

  --focus-w: 2px;
  --focus-off: 3px;
  --focus-c: var(--text);

  /* ---- App layout (BLUEPRINT 1.1 to 1.3). Desktop sizes; the phone block below overrides. ---- */
  --bar-h: clamp(48px, 6.25vh, 56px);
  --rail-w: clamp(320px, 23.4vw, 336px);
  --strip-h: clamp(60px, 7.8vh, 70px);
  --dial-h: clamp(68px, 8.9vh, 80px);
  --gear-h: clamp(44px, 5.8vh, 52px);
  --mode-h: clamp(40px, 4.9vh, 44px);
  --why-h: clamp(32px, 4vh, 36px);
  --comp-h: clamp(40px, 5.3vh, 48px);
  --shoot-h: clamp(76px, calc(22vh - 78px), 120px);
  --shutter-d: clamp(60px, 8vh, 72px);
  --rail-pad: var(--s4);
  --rail-gap: clamp(3px, 0.5vh, 8px);
  --stage-pad: var(--s4);
  --pic-top: var(--s3);
  --readout-h: 24px;
  --thumb-w: clamp(84px, 10.7vh, 96px);
  --thumb-h: clamp(56px, 7.1vh, 64px);
  --dial-px: clamp(12px, 1.56vh, 14px);   /* pixels per third stop on a tape */
  --tape-h: 28px;
  --step-btn: 36px;
  --tap-min: 44px;
  --gp-head: 56px;
  --menu-w: 280px;
  --about-w: 560px;

  /* The picture's overlays: white text on a soft scrim, as a camera's EVF draws it */
  --hud-text: #F4F4F2;
  --hud-dim: rgba(244, 244, 242, 0.78);
  --hud-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  /* Review fix (Nov 19): the bands under the camera text stay dark enough for 4.5:1 on a white sky (0.72 or more). */
  --scrim-top: linear-gradient(rgba(10, 10, 11, 0.86), rgba(10, 10, 11, 0.82) 88%, rgba(10, 10, 11, 0));
  --scrim-bot: linear-gradient(rgba(10, 10, 11, 0), rgba(10, 10, 11, 0.82) 12%, rgba(10, 10, 11, 0.86));
  --tag-bg: rgba(10, 10, 11, 0.62);
  --grid-line: rgba(236, 236, 234, 0.6);
  --grid-shadow: rgba(22, 21, 23, 0.35);
  --hud-h: 34px;
  --hud-bot-h: 44px;
  --scale-w: 300px;
  --shadow-pop: 0 24px 64px rgba(0, 0, 0, 0.55);
  --veil: rgba(10, 10, 11, 0.55);
}

/* Layouts (audit 2, Nov 19, 2026; BLUEPRINT 1.5 amended). Three, chosen by pointer, width and shape, never by width alone:
   - Rail (the desktop): 1024 x 600 and up, any pointer; or a mouse at 700 px wide and up in a landscape-shaped window
     (5:4 or wider). Under 1024 x 600 the rail is the compact one ("wide stack", below), so an 800 x 567 window keeps a big
     picture and all three dials in view.
   - Compact (phone and tall stack): under 700 px wide, or a touch screen under 1024 x 600, or a window narrower than 5:4.
     A mouse at 700 to 1023 px in a tall window gets the two-column "tall stack" (app.css), touch gets the phone.
   The JS copy of these queries is UI.MQ in ui-core.js; keep them identical.
   Compact: */
@media (max-width: 699px), (max-width: 1023px) and (pointer: coarse), (max-height: 599px) and (pointer: coarse), (max-width: 1023px) and (pointer: none), (max-height: 599px) and (pointer: none), (max-width: 1023px) and (max-aspect-ratio: 1249/1000), (max-height: 599px) and (max-aspect-ratio: 1249/1000) {
  :root {
    --bar-h: 48px;
    --dial-h: 66px;
    --dial-px: 16px;
    --mode-h: 44px;
    --why-h: 32px;
    --comp-h: 44px;
    --gear-h: 64px;
    --shoot-h: 80px;
    --shutter-d: 72px;
    --step-btn: 44px;
    --tape-h: 44px;
    --readout-h: 36px;
    --hud-h: 24px;
    --hud-bot-h: 32px;
    --scale-w: 132px;
    --t-val: 20px;
    --t-val-on: 24px;
    --t-hud-on: 14px;
  }
}

/* ---- Builder 2 (Nov 19, 2026): panel parts, picture overlays ---- */
:root {
  --pk-row-h: 48px;
  --pk-opt-h: 44px;
  --pk-chip-h: 36px;
  --pk-input-h: 44px;
  --pk-switch-w: 34px;
  --pk-switch-h: 18px;
  --pk-sec-gap: 20px;
  --hist-w: 160px;
  --hist-h: 56px;
  --map-w: 220px;
  --map-h: 132px;
  --overlay-bg: rgba(10, 10, 11, 0.62);
  --hist-fill: rgba(244, 244, 242, 0.82);
  --map-view: rgba(244, 244, 242, 0.10);
  --map-sharp: rgba(244, 244, 242, 0.22);
  --map-line: rgba(244, 244, 242, 0.70);
  --menu-max-h: calc(100dvh - var(--bar-h) - 16px);
}
@media (max-width: 699px), (max-width: 1023px) and (pointer: coarse), (max-height: 599px) and (pointer: coarse), (max-width: 1023px) and (pointer: none), (max-height: 599px) and (pointer: none), (max-width: 1023px) and (max-aspect-ratio: 1249/1000), (max-height: 599px) and (max-aspect-ratio: 1249/1000) {
  :root {
    --pk-row-h: 52px;
    --pk-opt-h: 52px;
    --pk-chip-h: 44px;
    --pk-input-h: 48px;
    --hist-w: 120px;
    --hist-h: 42px;
    --map-w: 180px;
    --map-h: 108px;
  }
}
:root { --dial-px-wide: 34px; }

/* ---- Builder 3 (Nov 19, 2026): the result, missions, the phone sheets ---- */
:root {
  --res-side-w: clamp(296px, 26vw, 344px);
  --res-head-h: 48px;
  --res-tn-w: clamp(132px, 16vh, 200px);
  --res-row-k: 92px;
  --res-mk: 8px;
  --strip-h-ms: clamp(76px, 10vh, 90px);
  --ms-meter-w: 120px;
  --ms-meter-h: 2px;
  --grab-w: 36px;
  --grab-h: 4px;
  --cell-min: 240px;   /* audit 2: bigger thumbs, so a few shots do not sit in a corner of an empty sheet */
}
@media (max-width: 699px), (max-width: 1023px) and (pointer: coarse), (max-height: 599px) and (pointer: coarse), (max-width: 1023px) and (pointer: none), (max-height: 599px) and (pointer: none), (max-width: 1023px) and (max-aspect-ratio: 1249/1000), (max-height: 599px) and (max-aspect-ratio: 1249/1000) {
  :root { --res-head-h: 56px; --res-tn-w: 1fr; --cell-min: 104px; }
}

/* ---- Audit 2 (Nov 19, 2026): the wide stack, a compact rail for a mouse at 700 to 1023 px or under 600 px tall ---- */
@media (pointer: fine) and (min-width: 700px) and (max-width: 1023px) and (min-aspect-ratio: 5/4), (pointer: fine) and (min-width: 700px) and (max-height: 599px) and (min-aspect-ratio: 5/4) {
  :root {
    --bar-h: 44px;
    --rail-w: 248px;
    --dial-h: 54px;
    --dial-px: 12px;
    --mode-h: 34px;
    --comp-h: 34px;
    --gear-h: 32px;
    --shoot-h: 64px;
    --shutter-d: 46px;
    --rail-pad: 12px;
    --rail-gap: 2px;
    --stage-pad: 12px;
    --pic-top: 8px;
    --strip-h: 48px;
    --thumb-w: 66px;
    --thumb-h: 44px;
    --step-btn: 28px;
    --tape-h: 26px;
    --hud-h: 26px;
    --hud-bot-h: 34px;
    --scale-w: 160px;
    --t-val: 18px;
    --t-val-on: 22px;
    --t-hud-on: 15px;
    --gp-head: 44px;
  }
}

/* ---- ui:dock slice (Nov 19, 2026; audit-2/workspace-layout.md 7.2): the Photoshop-style dock ---- */
:root {
  --dk-head: 32px;            /* the Exposure header */
  --gear-h-open: 36px;        /* panel headers while one panel is open */
  --dial-h-compact: 40px;     /* a dial as one row while a panel is open */
  --dial-px-compact: 12px;    /* tape pixels per third stop in that row */
  --dk-label-w: 64px;
  --ov-btn: 32px;             /* overlay toolbar buttons in the top bar */
  --ov-h: 32px;
  --dk-tool: 28px;            /* the tall and Done buttons in an open header */
  --dk-pill-h: 28px;
}
@media (min-width: 1024px) and (min-height: 600px) {
  :root { --gear-h: clamp(38px, 4.9vh, 44px); }
}
@media (min-width: 1024px) and (min-height: 600px) and (max-height: 799px) {
  :root { --dk-head: 28px; --rail-gap: 2px; --gear-h: 36px; }
}
@media (pointer: fine) and (min-width: 700px) and (max-width: 1023px) and (min-aspect-ratio: 5/4), (pointer: fine) and (min-width: 700px) and (max-height: 599px) and (min-aspect-ratio: 5/4) {
  :root { --gear-h: 30px; --gear-h-open: 30px; --dial-h-compact: 32px; --dk-tool: 24px; }
}
@media (pointer: fine) and (min-width: 700px) and (max-height: 540px) and (min-aspect-ratio: 5/4) {
  :root { --gear-h: 26px; --gear-h-open: 26px; --dial-h: 50px; }
}
/* Change 2 of 6 (Nov 20, 2026): the eye AF box as a Sony body draws it: a thin bright frame that turns green when focus
   locks, with a dark ring so it reads on a white shirt or bright leaves alike. Green is the camera's own "in focus"
   color, used for this one mark only. */
:root {
  --af-ok: #4CE35E;
  --af-ring: rgba(0, 0, 0, 0.62);
  --af-eye-w: 2px;
  --d-acquire: 600ms;   /* the white-to-green acquire; picture.js keeps the same 600 ms */
}
