/* ───────────────────────────────────────────────────────────────────────────
   Underwater Photography — PADUM DIVING theme.

   Tokens are the production theme's, by way of gradientfactor.padum-diving.com
   (padum.css v1.4.0): deep-ocean page gradient, white glass cards, Oswald over
   IBM Plex Sans, coral actions, 6/10/16/pill radii. The masthead, rail + stage
   shell, panels, sliders, readouts and notes are deliberately identical to the
   regulator page — three teaching tools from the same shop should feel like
   one product, and a student who has used one should not have to learn where
   anything is a second time.

   DIAGRAM COLOURS carry the same meanings as in the other two tools:

     · sun #FAC669 — ambient light. In Gradient Factors this is the reference
       everything is read against; here the sun is what the water is made of.
     · sky #95D1EB — the strobe, and anything the strobe puts back. It is the
       "what you actually get" colour in the regulator page too.
     · coral #D2564E — the thing going wrong. Backscatter, blown highlights,
       failed drills.

   Sun and coral are only ~ΔE 9 apart under deuteranopia, so nothing rests on
   hue alone: every bar is labelled, every stat carries its number, and the
   good/warn/bad states change the left border weight as well as the colour.
   ─────────────────────────────────────────────────────────────────────────── */

:root {
  color-scheme: dark;

  /* ── brand palette ── */
  --padum-ocean:  #244D78;
  --padum-sea:    #346B8F;
  --padum-lagoon: #539DB8;
  --padum-sky:    #95D1EB;
  --padum-coral:  #D2564E;
  --padum-coral-hover: #BC463F;
  --padum-sand:   #EEA570;
  --padum-sun:    #FAC669;

  --surface-page-top:  #14375A;
  --surface-page-mid:  #0E2740;
  --surface-page-deep: #0A1E33;
  --surface-card: linear-gradient(180deg, rgba(255,255,255,.10) 0%, rgba(255,255,255,.045) 100%);

  --surface-1: #0A1E33;
  --plane:     #0E2740;
  --ink:       #FFFFFF;
  --ink-2:     #D3D6DA;
  --ink-muted: #A2AAB2;
  --grid:      #233448;
  --axis:      #405060;
  --hairline:  rgba(255,255,255,.14);

  /* ── diagram roles ── */
  --c-amb:    #FAC669;
  --c-strobe: #95D1EB;
  --c-subj:   #E4F5FD;
  --c-bs:     #D2564E;

  --st-good:    #6FD48A;
  --st-warning: #FAC669;
  --st-bad:     #D2564E;

  /* ── type ── */
  --font-display: "Oswald", "DIN Condensed", "Arial Narrow", sans-serif;
  --font-ui: "IBM Plex Sans", "IBM Plex Sans Thai", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --track-display: .06em;
  --track-eyebrow: .22em;
  --leading-body: 1.55;

  /* ── shape & motion ── */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --shadow-card: 0 22px 46px rgba(4,14,26,.5), inset 0 1px 0 rgba(255,255,255,.16);
  --ring-focus: 0 0 0 3px rgba(83,157,184,.45);
  --blur-glass: saturate(130%) blur(14px);
  --ease-swell: cubic-bezier(.22,.61,.36,1);
  --dur-fast: 120ms;
  --dur-base: 200ms;

  --gap: 16px;
  --rail-w: 330px;
}

/* ─────────────────────────────── base ─────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: var(--leading-body);
  color: var(--ink-2);
  background: var(--surface-page-deep);
  background-image: linear-gradient(180deg,
    var(--surface-page-top) 0%,
    var(--surface-page-mid) 45%,
    var(--surface-page-deep) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 500; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--padum-sky); text-decoration: none; }
a:hover { color: var(--ink); }
strong { color: var(--ink); font-weight: 600; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ── language switching ──
   Both languages ship in the markup and CSS hides one, so a switch is a single
   attribute flip: no re-render, no flash, and the page still reads with JS off
   (it just shows both). */
html[data-lang="en"] [data-lang="th"] { display: none; }
html[data-lang="th"] [data-lang="en"] { display: none; }

/* ─────────────────────────── masthead ─────────────────────────── */

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 26px 28px 20px;
  border-bottom: 1px solid var(--hairline);
}

.masthead__id { display: flex; align-items: flex-start; gap: 18px; }

.brand {
  width: 62px;
  height: 62px;
  flex-shrink: 0;
  display: block;
  /* The mark is a flat illustration with white keylines, so it sits on the
     dark ground unaided — no plate, no ring. */
}

.masthead .rule {
  display: block;
  width: 62px;
  height: 3px;
  border-radius: var(--radius-pill);
  background: var(--padum-coral);
  margin-bottom: 12px;
}

.masthead h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(30px, 4.2vw, 46px);
  line-height: 1.02;
  letter-spacing: var(--track-display);
  text-transform: uppercase;
  color: var(--ink);
}
.masthead h1 em { font-style: normal; color: var(--padum-coral); }

.masthead__sub {
  margin: 10px 0 0;
  max-width: 66ch;
  color: var(--ink-muted);
  font-size: 13.5px;
}

.masthead__meta { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.chrome { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.disclaimer {
  margin: 0;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  color: var(--ink-muted);
  text-align: right;
  max-width: 34ch;
  line-height: 1.7;
}
.disclaimer strong { color: var(--padum-coral); font-weight: 600; }

/* ─────────────────────────── buttons ─────────────────────────── */

.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: transparent;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: var(--radius-pill);
  color: var(--ink-2);
  padding: 7px 14px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color var(--dur-base) var(--ease-swell),
              color var(--dur-base) var(--ease-swell),
              background var(--dur-base) var(--ease-swell);
}
.ghost-btn:hover { border-color: var(--padum-coral); color: var(--ink); background: rgba(210,86,78,.14); }
.ghost-btn:active { transform: scale(.98); }
.ghost-btn:focus-visible { outline: none; box-shadow: var(--ring-focus); }
.ghost-btn--wide { width: 100%; margin-top: 10px; }
.ghost-btn--mini { padding: 4px 10px; font-size: 9px; margin-left: auto; }

.ghost-btn[aria-pressed="true"] {
  border-color: var(--padum-coral);
  background: var(--padum-coral);
  color: #fff;
}
.ghost-btn[aria-pressed="true"]:hover { background: var(--padum-coral-hover); border-color: var(--padum-coral-hover); }

.lang { display: flex; gap: 4px; }
.lang .ghost-btn { padding: 7px 12px; }

/* Mutually exclusive options laid out in one even row, however many there are.
   grid-auto-flow rather than a fixed column count because this page has both
   two-way and three-way switches and they should look like the same control. */
.switch { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
/* Four-way choices need to wrap rather than squeeze four labels into a 330px
   rail, where each would get about sixty pixels and none would be readable. */
.switch--wrap { grid-auto-flow: row; grid-template-columns: 1fr 1fr; }
.switch .ghost-btn { width: 100%; padding-left: 6px; padding-right: 6px; }

/* The shutter button. The only filled action on the page, because it is the
   only one that produces something. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--padum-coral);
  border: 1px solid var(--padum-coral);
  border-radius: var(--radius-pill);
  color: #fff;
  padding: 10px 20px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--dur-base) var(--ease-swell);
}
.btn:hover { background: var(--padum-coral-hover); border-color: var(--padum-coral-hover); }
.btn:active { transform: scale(.98); }
.btn:focus-visible { outline: none; box-shadow: var(--ring-focus); }

/* The input is a SIBLING of its label, tied by `for`, rather than sitting
   inside it. Nesting is legal HTML and it is what this used to do, but a click
   then reaches the input twice -- once directly and once forwarded by the
   label's activation behaviour -- so the box toggles on and straight back off
   and the control looks dead. Two of the five checkboxes on this page behaved
   exactly that way. An explicit `for` removes the second path entirely. */
.check {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  color: var(--ink-2);
  padding: 3px 0;
}
.check input { accent-color: var(--padum-coral); width: 15px; height: 15px; cursor: pointer; flex-shrink: 0; }
.check label { cursor: pointer; }

/* ─────────────────────────── layout ─────────────────────────── */

.shell {
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  gap: var(--gap);
  padding: var(--gap) 28px 28px;
  align-items: start;
}

.rail {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  position: sticky;
  top: var(--gap);
  max-height: calc(100vh - 2 * var(--gap));
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--axis) transparent;
}

.stage { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }

/* ─────────────────────── panel (glass card) ─────────────────────── */

.panel, .stagecard {
  background: var(--surface-card);
  backdrop-filter: var(--blur-glass);
  -webkit-backdrop-filter: var(--blur-glass);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
.panel { padding: 18px 20px 20px; }
.stagecard { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }

.panel__title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  color: var(--ink);
}
.stagecard .panel__title { margin-bottom: 0; }

.panel__num {
  font-family: var(--font-mono);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
  color: var(--ink);
  background: var(--padum-sea);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.hint { margin: 10px 0 0; font-size: 11.5px; color: var(--ink-muted); line-height: 1.45; }
.hint--tight { margin-top: 6px; }
.hint--key { color: var(--ink-2); border-left: 2px solid var(--padum-sun); padding-left: 9px; }
.hint strong { color: var(--ink-2); }
.hint em { font-style: normal; color: var(--padum-sky); }

.lede { margin: 0; font-size: 12.5px; color: var(--ink-muted); max-width: 84ch; }

/* ─────────────────────────── controls ─────────────────────────── */

.control { display: flex; flex-direction: column; gap: 7px; }
.control + .control { margin-top: 14px; }
[hidden] { display: none !important; }

.control__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.control__label {
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  color: var(--ink-muted);
}

.control__value {
  font-family: var(--font-mono);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  white-space: nowrap;
}
.control__value .unit { font-size: 10.5px; color: var(--ink-muted); margin-left: 3px; }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 22px;
  background: transparent;
  cursor: pointer;
  margin: 0;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: var(--radius-pill);
  background: var(--grid);
}
input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: var(--radius-pill);
  background: var(--grid);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -6px;
  border-radius: var(--radius-pill);
  background: var(--padum-coral);
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(4,14,26,.6);
}
input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: var(--radius-pill);
  background: var(--padum-coral);
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(4,14,26,.6);
}
input[type="range"]:focus-visible { outline: none; box-shadow: var(--ring-focus); border-radius: var(--radius-pill); }

.scale {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--ink-muted);
}

/* Whole-stop labels under a third-stop slider. Each sits over the position it
   names because every dial list is 3n+1 long, so the whole stops fall on evenly
   spaced indices and space-between puts the labels on exactly those fractions.
   The point is that you can still count whole stops by eye; the thirds are
   somewhere to stand in between, not a finer grid to squint at. */
.scale--stops { font-size: 9px; letter-spacing: -.02em; }
.scale--stops span { flex: 0 0 auto; }

/* ─────────────────────── drill prompts ─────────────────────── */

.tries { display: flex; flex-direction: column; gap: 8px; }

.try {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
  width: 100%;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius-md);
  padding: 9px 11px;
  cursor: pointer;
  transition: border-color var(--dur-base) var(--ease-swell),
              background var(--dur-base) var(--ease-swell);
}
.try:hover { border-color: var(--padum-lagoon); background: rgba(83,157,184,.16); }
.try:focus-visible { outline: none; box-shadow: var(--ring-focus); }
.try.is-active { border-color: var(--padum-sun); background: rgba(250,198,105,.14); }
.try__name {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: var(--track-display);
  text-transform: uppercase;
  color: var(--ink);
}
.try__note { font-size: 10.5px; color: var(--ink-muted); line-height: 1.4; }

/* ─────────────────────────── readouts ─────────────────────────── */

.readouts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.stat {
  background: rgba(20, 55, 90, .82);
  backdrop-filter: var(--blur-glass);
  -webkit-backdrop-filter: var(--blur-glass);
  padding: 13px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  border-left: 3px solid transparent;
}
/* State is carried by border weight as much as by hue, so the three bands stay
   distinguishable without relying on red/green discrimination. */
.stat.is-good { border-left-color: var(--st-good); }
.stat.is-warn { border-left-color: var(--st-warning); }
.stat.is-bad  { border-left-color: var(--st-bad); }

.stat__label {
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat__value {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 32px;
  line-height: 1.02;
  letter-spacing: var(--track-display);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.stat__value .unit {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--ink-muted);
  margin-left: 4px;
}
.stat__note { font-size: 11px; color: var(--ink-muted); line-height: 1.4; }
.stat__note strong { color: var(--ink-2); }

/* The readout the whole page is built to make visible: it must plainly NOT
   move while the shutter slider runs from one end to the other. */
.stat--pinned .stat__value { color: var(--padum-sky); }

.swatch { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.swatch--amb    { background: var(--c-amb); }
.swatch--strobe { background: var(--c-strobe); }
.swatch--subj   { background: var(--c-subj); }
.swatch--bs     { background: var(--c-bs); }

/* ─────────────────────────── viewfinder ─────────────────────────── */

.stagecard--frame { gap: 10px; }

.viewfinder {
  position: relative;
  aspect-ratio: 3 / 2;
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--hairline);
  background: var(--surface-1);
}
.viewfinder canvas { display: block; width: 100%; height: 100%; }

.vf__hud {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 11px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .04em;
  color: rgba(255,255,255,.88);
  background: linear-gradient(180deg, rgba(6,18,30,0) 0%, rgba(6,18,30,.72) 100%);
  pointer-events: none;
}

.vf__warn {
  position: absolute;
  left: 10px; right: 10px; top: 10px;
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  background: rgba(210,86,78,.90);
  color: #fff;
  font-size: 11.5px;
  line-height: 1.35;
  pointer-events: none;
}

/* A visible shutter. The frame is a still image, so without a flash of
   feedback there is nothing to tell you the button did anything. */
.viewfinder.is-firing::after {
  content: '';
  position: absolute;
  inset: 0;
  background: #fff;
  animation: fire 260ms var(--ease-swell) forwards;
  pointer-events: none;
}
@keyframes fire { 0% { opacity: .85; } 100% { opacity: 0; } }

/* What the camera picked for itself. A readout, not a control -- it is styled
   like the HUD rather than like the rail so it never looks clickable. */
.auto-line {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-muted);
  border-left: 2px solid var(--padum-sea);
  padding-left: 10px;
}
.auto-line strong { color: var(--ink); font-weight: 500; }

.shootbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.verdict {
  margin: 0;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: var(--track-display);
  text-transform: uppercase;
  color: var(--ink-muted);
}
.verdict.is-good { color: var(--st-good); }
.verdict.is-warn { color: var(--st-warning); }
.verdict.is-bad  { color: var(--st-bad); }

.badge {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: none;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--hairline);
  color: var(--ink-muted);
  white-space: nowrap;
}
.badge--good { color: var(--st-good); border-color: rgba(111,212,138,.45); background: rgba(111,212,138,.12); }
.badge--warn { color: var(--st-warning); border-color: rgba(250,198,105,.45); background: rgba(250,198,105,.12); }
.badge--bad  { color: var(--st-bad); border-color: rgba(210,86,78,.5); background: rgba(210,86,78,.14); }

/* ─────────────────────────── drill brief ─────────────────────────── */

.brief {
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--padum-sea);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,.05);
  padding: 12px 15px;
  transition: border-left-color var(--dur-base) var(--ease-swell);
}
.brief.is-passing { border-left-color: var(--st-good); }
.brief__free { margin: 0; font-size: 12.5px; color: var(--ink-muted); }
.brief__head { display: flex; align-items: baseline; gap: 10px; }
.brief__eyebrow {
  font-size: 9px;
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  color: var(--padum-sun);
}
.brief h3 {
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: var(--track-display);
  text-transform: uppercase;
  color: var(--ink);
}
.brief__text { margin: 7px 0 11px; font-size: 12.5px; color: var(--ink-muted); max-width: 80ch; }

.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.checks li {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--ink-muted);
  padding: 4px 0;
  border-top: 1px solid rgba(255,255,255,.07);
}
.checks li:first-child { border-top: none; }
.checks__tick { color: var(--axis); font-size: 13px; text-align: center; }
.checks li.is-ok { color: var(--ink-2); }
.checks li.is-ok .checks__tick { color: var(--st-good); }
.checks__target { font-size: 11px; color: var(--ink-muted); white-space: nowrap; }
.checks__now {
  font-size: 11.5px;
  color: var(--ink);
  min-width: 5.5ch;
  text-align: right;
  white-space: nowrap;
}
.checks li.is-ok .checks__now { color: var(--st-good); }

/* ─────────────────────── two-exposure bars ─────────────────────── */

.bars { display: flex; flex-direction: column; gap: 8px; }

.bar {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) 52px;
  align-items: center;
  gap: 12px;
}
.bar--sum { padding-top: 8px; border-top: 1px solid var(--hairline); margin-top: 2px; }

.bar__name {
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  color: var(--ink-muted);
  text-align: right;
}
.bar--sum .bar__name { color: var(--ink-2); }

.bar__track {
  position: relative;
  display: block;
  height: 22px;
  border-radius: var(--radius-sm);
  background: var(--plane);
  border: 1px solid var(--hairline);
  overflow: hidden;
}

.bar__fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  /* Not transitioned. A slider drag repaints this every frame, and an ease on
     top of that reads as lag rather than as smoothness — and the whole point
     is watching one bar stay still while its neighbours move. */
}
.bar__fill--amb    { background: linear-gradient(90deg, rgba(250,198,105,.35), var(--c-amb)); }
.bar__fill--strobe { background: linear-gradient(90deg, rgba(149,209,235,.35), var(--c-strobe)); }
.bar__fill--subj   { background: linear-gradient(90deg, rgba(228,245,253,.35), var(--c-subj)); }

/* Correct exposure. Everything on the chart is read against this line. */
.bar__mark {
  position: absolute;
  top: -1px; bottom: -1px;
  width: 0;
  border-left: 2px dashed rgba(255,255,255,.65);
}

.bar__val { font-size: 12px; color: var(--ink); text-align: right; }
.bar.is-off .bar__val { color: var(--axis); }

.mixline {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--hairline);
}
.mixline__label {
  font-size: 9.5px;
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  color: var(--ink-muted);
  text-align: right;
}
.mixline__track {
  position: relative;
  display: block;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--c-amb);
  overflow: hidden;
}
.mixline__fill {
  position: absolute;
  inset: 0 0 0 auto;
  background: var(--c-strobe);
}
.mixline__ends { font-size: 10.5px; color: var(--ink-muted); white-space: nowrap; }

/* ─────────────────────────── light path ─────────────────────────── */

.lightpath {
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 6px;
}
.lightpath canvas { display: block; width: 100%; max-width: 620px; height: 320px; margin: 0 auto; }

/* ─────────────────────────── filmstrip ─────────────────────────── */

.strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.shot {
  margin: 0;
  border: 1px solid var(--hairline);
  border-top: 3px solid var(--axis);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface-1);
}
.shot--good { border-top-color: var(--st-good); }
.shot--warn { border-top-color: var(--st-warning); }
.shot--bad  { border-top-color: var(--st-bad); }
.shot { cursor: zoom-in; }
.shot:hover { border-color: rgba(255,255,255,.34); }
.shot img { display: block; width: 100%; height: auto; }

/* ─────────────────────────── the shot, full size ─────────────────────────── */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vmin;
  background: rgba(4, 14, 26, .92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: zoom-out;
}
.lightbox__inner {
  margin: 0;
  max-width: min(1200px, 94vw);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lightbox img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 78vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-card);
}
.lightbox figcaption { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.lightbox__verdict {
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: var(--track-display);
  text-transform: uppercase;
  color: var(--ink);
}
.lightbox__meta { font-size: 12px; color: var(--ink-muted); }
.lightbox__close {
  position: absolute;
  top: 14px; right: 18px;
  width: 40px; height: 40px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--hairline);
  background: rgba(255,255,255,.06);
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.lightbox__close:hover { border-color: var(--padum-coral); background: rgba(210,86,78,.2); }
.lightbox__close:focus-visible { outline: none; box-shadow: var(--ring-focus); }
.shot figcaption { padding: 7px 9px 8px; display: flex; flex-direction: column; gap: 2px; }
.shot__verdict {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: var(--track-display);
  text-transform: uppercase;
  color: var(--ink);
}
.shot__meta { font-size: 9.5px; color: var(--ink-muted); }

/* ─────────────────────────── notes ─────────────────────────── */

.notes { columns: 300px 3; column-gap: 26px; }
.note { break-inside: avoid; margin-bottom: 20px; }
.note h3 {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 7px;
}
.note p { margin: 0 0 9px; font-size: 12.5px; color: var(--ink-muted); }
.note p:last-child { margin-bottom: 0; }
.note strong { color: var(--ink-2); font-weight: 600; }
.note em { font-style: normal; color: var(--padum-sky); }
.note--warn { border-left: 3px solid var(--padum-coral); padding-left: 13px; }
.note--key  { border-left: 3px solid var(--padum-sun); padding-left: 13px; }
.note--key p { color: var(--ink-2); }

/* ─────────────────────────── footer ─────────────────────────── */

.foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 28px 26px;
  border-top: 1px solid var(--hairline);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  color: var(--ink-muted);
}
.foot__id { display: flex; align-items: center; gap: 10px; }
.foot__mark { width: 26px; height: 26px; display: block; opacity: .85; }
.foot strong { color: var(--padum-coral); font-weight: 600; }

/* ─────────────────────────── narrow ─────────────────────────── */

@media (max-width: 1180px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: static; max-height: none; }
  .bar, .mixline { grid-template-columns: 150px minmax(0, 1fr) 52px; }
}

@media (max-width: 720px) {
  .masthead { padding: 22px 20px 16px; }
  .masthead__id { gap: 14px; }
  .brand { width: 48px; height: 48px; }
  .masthead .rule { width: 48px; }
  .masthead__meta { align-items: flex-start; width: 100%; }
  .disclaimer { text-align: left; max-width: none; }
  .shell { padding: var(--gap) 16px 24px; }
  .panel, .stagecard { padding: 16px; }
  .stat__value { font-size: 26px; }

  /* Bars stack: 150px of label beside a track leaves the track too short to
     read a two-stop difference off, which is the only thing the chart is for. */
  .bar, .mixline { grid-template-columns: minmax(0, 1fr) 52px; row-gap: 3px; }
  .bar__name, .mixline__label { grid-column: 1 / -1; text-align: left; }
  .mixline__ends { grid-column: 1 / -1; }

  .checks li { grid-template-columns: 18px minmax(0, 1fr) auto; row-gap: 2px; }
  .checks__target { grid-column: 2 / -1; }

  .lightpath canvas { height: 260px; }
  .foot { padding: 16px 20px 24px; flex-direction: column; align-items: flex-start; gap: 8px; }

  /* 44px minimum hit target on touch. */
  .ghost-btn { min-height: 44px; }
  .switch .ghost-btn { font-size: 9px; letter-spacing: .08em; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
