/* Proof: a readable document in the same visual language. Only the rail is sticky. */
.proof-head { padding-top: calc(var(--header-h) + 16px); }
.proof-title { font-size: var(--fs-h2); margin: 40px 0 8px; }
.proof-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 56px; align-items: start; }
.proof-body { min-width: 0; max-width: 900px; }
.case { padding-block: 56px; border-top: 1px solid var(--line); scroll-margin-top: calc(var(--header-h) + 24px); }
.case:first-child { border-top: 0; padding-top: 24px; }
.case > p, .case > ul, .split p { max-width: 72ch; }
.case .h2 { margin-bottom: 14px; }
.case .h3 { margin: 44px 0 12px; }
.lede { font-size: clamp(1.0625rem, 1rem + .3vw, 1.25rem); line-height: 1.5; }
.small { font-size: var(--fs-small); }
.ticks { list-style: none; display: grid; gap: 10px; }
.ticks li { position: relative; padding-left: 1.4em; }
.ticks li::before { content: "▪"; position: absolute; left: 0; color: var(--accent); }
.meta-row { margin: 24px 0 14px; color: var(--fg-dim); }
.note { margin-top: 10px; }
.credit { margin-top: 14px; }
.chips { margin-top: 32px; }

/* Rail */
.rail-title { display: block; margin-bottom: 10px; }
.rail-list { list-style: none; }
.rail-list a { font-size: var(--fs-small); padding: 5px 0; }
.rail-list a[aria-current="true"] { color: var(--fg); }

/* Gallery */
.gallery { display: grid; grid-template-columns: 1.7fr 1fr .55fr; gap: 14px; align-items: start; margin-top: 28px; }
.gallery .crt-frame, .shots .crt-frame, .email-shot .crt-frame { padding: 0; width: 100%; cursor: zoom-in; display: block; }
.gallery .crt-frame { aspect-ratio: 16 / 10; }
.gallery .gallery-phone { aspect-ratio: 9 / 19.5; border-radius: 18% / 9%; }
.shots { display: grid; grid-template-columns: 1.6fr 1fr; gap: 14px; margin-top: 18px; }
.shots .crt-frame { aspect-ratio: 16 / 10; }
.shots .crt-frame:nth-child(2) { aspect-ratio: 1; }
.shots-wide { grid-template-columns: 1fr; }
.shots-wide .crt-frame { aspect-ratio: 16 / 5; border-radius: 6% / 20%; }

/* Blueprints + detector */
.blueprint { margin: 24px 0; }
.blueprint .bp-sub { fill: var(--fg-dim); font-size: 12px; }
.blueprint .bp-head { fill: var(--fg-dim); }
.blueprint .bp-dash { stroke-dasharray: 4 4; }
.blueprint .bp-lead { stroke: var(--fg-dim); fill: none; }
.blueprint .bp-panel { fill: none; stroke: var(--line-strong); stroke-dasharray: 4 4; }
.blueprint .bp-note { fill: var(--accent); font-size: 13px; letter-spacing: .08em; }

/* Detector pipeline: one wide diagram, or a stacked one when its box is narrow. Text stays >= 11px either way. */
.bp-pipe { container-type: inline-size; }
.bp-pipe svg { min-width: 0; }
.bp-pipe text { font-size: 13px; letter-spacing: .03em; }
.bp-pipe .bp-dim text { font-size: 13px; }
.bp-pipe .bp-sub { font-size: 12px; }
.bp-pipe .pipe-stack { display: none; }
@container (max-width: 559px) {
  .bp-pipe .pipe-wide { display: none; }
  .bp-pipe .pipe-stack { display: block; }
}
.detector-figs { display: grid; gap: 18px; }
.email-shot { margin: 0; max-width: 560px; }
.email-shot .crt-frame { aspect-ratio: 4 / 3; }
.email-shot figcaption { margin-top: 8px; }
.detector { margin-top: 32px; }
.detector-head h3 { margin: 0; color: var(--fg); }
.field-rating label { display: flex; justify-content: space-between; }
.meter .band-30 { left: 30%; }
.meter .band-60 { left: 60%; }
.callout { margin: 36px 0; }
.callout-note { display: block; }
.callout-note .label { position: static; padding: 0; margin-right: 1ch; background: none; color: var(--accent); }

/* FlyRank / Checkpoint */
.split { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 32px; align-items: start; margin-top: 18px; }
.split-media { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.video-card { margin: 0; }
.video-frame { position: relative; margin: 0; aspect-ratio: 16 / 9; border-radius: 3% / 5.4%; }
.video-frame video { width: 100%; height: 100%; object-fit: cover; transform: none; background: #05060a; }
.video-play {
  position: absolute; inset: 0; margin: auto; width: max-content; height: max-content; min-height: 44px; padding: 10px 20px;
  background: var(--bg); color: var(--fg); border: 1px solid var(--fg); font-family: var(--font-mono); font-weight: 700;
  font-size: var(--fs-label); letter-spacing: var(--ls-label); text-transform: uppercase; cursor: pointer;
}
.video-play:hover { background: var(--fg); color: var(--bg); }
.video-play[hidden] { display: none; }
.video-controls { display: flex; gap: 8px; margin-top: 10px; }
.video-controls button {
  min-height: 44px; padding: 8px 14px; background: transparent; color: var(--fg); border: 1px solid var(--line-strong);
  font: inherit; letter-spacing: var(--ls-label); text-transform: uppercase; cursor: pointer;
}
.video-controls button:hover { background: var(--fg); color: var(--bg); }

/* Charts: the table is the data; JS draws the picture and keeps the table for screen readers. */
.chart { margin: 18px 0 0; }
.chart.is-rendered .chart-data { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: normal; }   /* normal, not nowrap: a nowrap caption widens a table past 1px (Round 5 B3: 56px of page overflow at 150% text) */
.chart-data { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: var(--fs-small); }   /* fixed: the raw table must never be wider than its box, even before the SVG replaces it */
.chart-data caption { text-align: left; color: var(--fg-dim); padding-bottom: 6px; }
.chart-data th, .chart-data td { text-align: left; padding: 4px 8px 4px 0; border-bottom: 1px solid var(--line); font-weight: 400; overflow-wrap: anywhere; }

/* Experience */
.exp { display: grid; gap: 8px; margin-top: 12px; }
.exp-item { border-left: 1px solid var(--line-strong); padding-left: 20px; }
.exp-item .h3 { margin-top: 28px; }
.back-top { margin-top: 40px; }

/* Below 960: the rail becomes a horizontal chip row under the header */
@media (max-width: 959px) {
  .proof-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .rail {
    /* sticks at the very top so its background sits behind the transparent header too */
    position: sticky; top: 0; z-index: 50; display: block;
    margin-inline: calc(var(--margin) * -1); padding: calc(var(--header-h) + 4px) var(--margin) 8px;
    margin-top: calc(var(--header-h) * -1);
    background: var(--bg); border-bottom: 1px solid var(--line);
  }
  .rail-title, .rail .caret { display: none; }
  .rail-list { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
  .rail-list a { white-space: nowrap; border: 1px solid var(--line); padding: 6px 10px; min-height: 36px; align-items: center; }
  .rail-list a[aria-current="true"] { border-color: var(--accent); }
  .rail-progress { margin-top: 8px; }
  .split, .split-media { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 719px) {
  .gallery { grid-template-columns: 1fr 1fr; }
  .gallery .gallery-main { grid-column: 1 / -1; }
  .gallery .gallery-phone { max-height: 340px; width: auto; justify-self: center; }
  .shots { grid-template-columns: 1fr; }
  .case { padding-block: 40px; }
}

/* ───────────────────────── Exhibits: the frame (internals load later with css/exhibits.css) */
.exhibit { position: relative; margin: 28px 0; padding: 14px 16px 12px; border: 1px solid var(--line); transition: border-color 200ms var(--ease), box-shadow 200ms var(--ease); }
.exhibit::before, .exhibit::after { content: ""; position: absolute; width: 14px; height: 14px; border: 1px solid var(--xray-glow-1); pointer-events: none; }
.exhibit::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.exhibit::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }
.exhibit:hover, .exhibit:focus-within { border-color: var(--xray-glow-2); box-shadow: 0 0 0 1px rgb(56 84 100 / .35), 0 0 26px rgb(56 84 100 / .35); }
.ex-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 32px; margin-bottom: 12px; }
.ex-tag { padding: 3px 8px; border: 1px solid var(--line-strong); color: var(--fg-dim); }
.ex-hint { margin-left: auto; padding: 3px 8px; border: 1px dashed var(--line-strong); color: var(--fg-dim); transition: opacity 300ms; }
.ex-hint.is-gone { opacity: 0; visibility: hidden; }
.ex-replay { min-height: 32px; padding: 4px 10px; border: 1px solid var(--line-strong); background: transparent; color: var(--fg); cursor: pointer; }
.ex-hint.is-gone + .ex-replay, .ex-head:not(:has(.ex-hint)) .ex-replay { margin-left: auto; }
.ex-replay:hover { border-color: var(--accent); color: var(--accent); }
.ex-stage { position: relative; }
.exhibit:not([data-mounted="true"]) .ex-stage { min-height: var(--ex-h, 320px); }   /* reserve the space: no layout shift on mount */
/* measured mounted heights (desktop / ≤1100px / ≤720px) */
.ex-e1-home { --ex-h: 830px; } .ex-e2-company { --ex-h: 1290px; } .ex-e3-mobile { --ex-h: 674px; }
.ex-e4-email { --ex-h: 860px; } .ex-e5-ncl { --ex-h: 1800px; } .ex-e6-csaw { --ex-h: 500px; }
@media (max-width: 1100px) {
  .ex-e1-home { --ex-h: 860px; } .ex-e2-company { --ex-h: 1360px; } .ex-e4-email { --ex-h: 940px; } .ex-e5-ncl { --ex-h: 1610px; } .ex-e6-csaw { --ex-h: 520px; }
}
.ex-desc { margin: 12px 0 4px; max-width: 72ch; color: var(--fg-dim); font-size: var(--fs-small); line-height: 1.55; }
.ex-data summary { padding: 6px 0; color: var(--fg-dim); cursor: pointer; }
.ex-data .table { font-size: .8rem; }
.ex-cap { margin-top: 8px; color: var(--fg-dim); }
.ex-pair { display: grid; gap: 28px; margin: 28px 0; }   /* stacked: the company page needs the full width */
.ex-pair .exhibit { margin: 0; }
.shots-single { grid-template-columns: minmax(0, 300px); }
@media (max-width: 720px) {
  .exhibit { padding: 12px 10px 10px; }
  .ex-e1-home { --ex-h: 1270px; } .ex-e2-company { --ex-h: 1990px; } .ex-e3-mobile { --ex-h: 560px; } .ex-e4-email { --ex-h: 1300px; } .ex-e5-ncl { --ex-h: 2020px; } .ex-e6-csaw { --ex-h: 535px; }
}
/* Shared tooltip (exhibits, the pipeline diagram and the FlyRank chart) */
.ex-tip {
  position: absolute; z-index: 20; pointer-events: none; max-width: min(340px, 92%);
  padding: 6px 10px; background: var(--xray-ground); color: var(--xray-soft); border: 1px solid var(--xray-glow-2);
  font: 400 .75rem/1.35 var(--font-mono); letter-spacing: .03em; box-shadow: 0 0 14px rgb(56 84 100 / .6);
}
.ex-tip[hidden] { display: none; }
/* Detector diagram: a packet runs the pipeline once; boxes glow as it passes; signals are inspectable */
.bp-pipe { position: relative; }
.bp-packet { fill: var(--accent); filter: drop-shadow(0 0 6px var(--accent)); opacity: 0; }
.bp-packet.is-on { opacity: 1; }
.blueprint .bp-box.is-pass { stroke: var(--accent); filter: drop-shadow(0 0 8px rgb(143 227 255 / .55)); transition: filter 300ms; }
.bp-pipe svg:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.bp-pipe .bp-dim text.is-hot { fill: var(--accent); }
.chart[data-chart="p50"] { position: relative; }
.chart[data-chart="p50"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.chart .bar.is-hot { filter: brightness(1.3); }

/* Round 5 B3: the rail's chips are 44px tall on touch screens. */
@media (pointer: coarse) { .rail-list a { min-height: 44px; display: inline-flex; align-items: center; } }
