/* ==========================================================================================================
   The slide show of /defense. Slides are drawn on a fixed 1920×1080 canvas that defense.js scales to the stage,
   so every size below is in px of that canvas. Colours come from the site tokens, so both themes work.
   ========================================================================================================== */

/* ---- page and stage ---- */
.page.deck-page { max-width: none; padding: 14px 16px 12px; }
@media (min-width: 768px) { .page.deck-page { padding: 14px 24px 12px; } }
@media (min-width: 1280px) { .page.deck-page { padding: 16px 32px 12px; } }
.deck { --stage-w: min(100%, calc((100dvh - var(--topbar-h) - 90px) * 16 / 9)); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.deck-stage { position: relative; width: var(--stage-w); aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; }
.deck-canvas { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; transform-origin: 0 0; transform: scale(0.5); }
.deck-bar { width: var(--stage-w); display: flex; align-items: center; gap: 8px; min-height: 40px; }
.deck-bar .btn.icon { min-width: 40px; }
.deck-count { font-family: var(--font-mono); font-size: 0.875rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; padding: 0 4px; }
.deck-track { flex: 1 1 auto; height: 6px; min-width: 24px; border-radius: 3px; background: var(--line); overflow: hidden; }
.deck-fill { height: 100%; width: 0; background: var(--violet-vivid); }
.present-only { display: none; }

/* ---- presentation mode: the slide fills the screen, the shell is gone, the bar appears only on pointer movement ---- */
:root[data-present="on"] body { overflow: hidden; }
:root[data-present="on"] .sidebar, :root[data-present="on"] .sidebar-backdrop, :root[data-present="on"] .topbar, :root[data-present="on"] .site-footer, :root[data-present="on"] .skip-link, :root[data-present="on"] .present-hide { display: none !important; }
:root[data-present="on"] .app-main { margin-left: 0 !important; transition: none; }
:root[data-present="on"] .page.deck-page { padding: 0; height: 100dvh; display: flex; align-items: center; justify-content: center; background: var(--bg); }
:root[data-present="on"] .deck { width: 100%; --stage-w: min(100vw, calc(100dvh * 16 / 9)); }
:root[data-present="on"] .deck-stage { border: 0; border-radius: 0; }
:root[data-present="on"] .deck-bar { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); width: min(620px, 92vw); padding: 6px 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-2); opacity: 0; pointer-events: none; transition: opacity 0.18s ease; z-index: 20; }
:root[data-present="on"][data-bar="on"] .deck-bar, :root[data-present="on"] .deck-bar:focus-within { opacity: 1; pointer-events: auto; }
:root[data-present="on"]:not([data-bar="on"]) { cursor: none; }
:root[data-present="on"] .present-only { display: inline-flex; }
@keyframes deck-in { from { opacity: 0; } to { opacity: 1; } }

/* ---- one slide ---- */
.slide { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; display: none; flex-direction: column; gap: 36px; padding: 96px 128px 160px; overflow: hidden; background: var(--bg); color: var(--ink); font-family: var(--font-sans); font-size: 28px; line-height: 1.35; text-align: left; }
.slide.is-current { display: flex; animation: deck-in 0.16s ease; }
.slide p { max-width: none; margin: 0; overflow-wrap: normal; }
.slide h1, .slide h2 { margin: 0; letter-spacing: normal; text-wrap: pretty; }
.slide svg { max-width: none; flex: none; display: block; }
.slide a { color: var(--azure); text-underline-offset: 4px; }
.slide .grow { flex: 1 1 auto; min-height: 0; }
.s-head { display: flex; flex-direction: column; gap: 12px; }
.slide .ttl { font-size: 56px; font-weight: 700; line-height: 1.12; letter-spacing: -1px; color: var(--ink); }
.eb { font-family: var(--font-mono); font-size: 24px; font-weight: 500; line-height: 1.3; letter-spacing: 2px; color: var(--faint); }
.s-foot { position: absolute; left: 128px; right: 128px; bottom: 64px; display: flex; justify-content: space-between; gap: 32px; font-size: 24px; line-height: 1.3; color: var(--faint); }
.s-backup { background: var(--surface); }
.tile { background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; padding: 26px 30px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.tile.center { justify-content: center; }
.band { background: var(--violet-soft); color: var(--ink); border-radius: 16px; padding: 22px 30px; line-height: 1.3; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }

/* ---- type and colour ---- */
.slide .t24 { font-size: 24px; line-height: 1.3; }
.slide .t28 { font-size: 28px; line-height: 1.32; }
.slide .t32 { font-size: 32px; line-height: 1.3; }
.slide .t36 { font-size: 36px; line-height: 1.3; }
.slide .t44 { font-size: 44px; line-height: 1.2; }
.slide .w6 { font-weight: 600; }
.slide .lh12 { line-height: 1.2; }
.slide .lh125 { line-height: 1.25; }
.slide .lh13 { line-height: 1.3; }
.slide .nw { white-space: nowrap; }
.slide .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.c-ink { color: var(--ink); } .c-soft { color: var(--muted); } .c-mute { color: var(--faint); }
.c-ok { color: var(--emerald); } .c-amber { color: var(--amber); } .c-violet { color: var(--violet); } .c-cyan { color: var(--cyan); } .c-coral { color: var(--coral); } .c-azure { color: var(--azure); } .c-indigo { color: var(--indigo); }
.big { font-size: 120px; font-weight: 700; line-height: 1.2; letter-spacing: -3px; white-space: nowrap; color: var(--coral); }
.big2 { font-size: 88px; font-weight: 700; line-height: 1.2; letter-spacing: -2px; white-space: nowrap; color: var(--ink); }
.big3 { font-size: 56px; font-weight: 700; line-height: 1.15; white-space: nowrap; color: var(--ink); }
.big4 { font-size: 72px; font-weight: 700; line-height: 1.1; letter-spacing: -2px; white-space: nowrap; color: var(--ink); }

/* ---- pixel grids ---- */
.px { width: 100%; height: auto; outline: 2px solid var(--line-strong); outline-offset: -1px; }
.dz { fill: var(--delta-zero); } .dp { fill: var(--delta-pos); } .dn { fill: var(--delta-neg); }

/* ---- cover ---- */
.s-cover { flex-direction: row; align-items: center; gap: 84px; padding: 128px; }
.cover-text { flex: 1 1 auto; display: flex; flex-direction: column; gap: 32px; min-width: 0; }
.slide .cover-title { font-size: 64px; font-weight: 700; line-height: 1.12; letter-spacing: -1.5px; color: var(--ink); }
.cover-art { width: 560px; flex: none; display: flex; flex-direction: column; gap: 16px; }

/* ---- statement ---- */
.s-stmt { background: #2b1f63; color: #f4f5f7; justify-content: center; padding: 128px; }
.stmt-eb { color: #fbbf24; }
.slide .stmt-t { font-size: 80px; font-weight: 700; line-height: 1.12; letter-spacing: -1.5px; color: #f4f5f7; text-wrap: wrap; }
.stmt-sub { font-size: 40px; font-weight: 600; line-height: 1.25; color: #fbbf24; }
.stmt-foot { color: #cfd3e6; }

/* ---- worked example ---- */
.ex { display: flex; gap: 40px; flex: 1 1 auto; min-height: 0; }
.ex-left { width: 1116px; flex: none; display: flex; flex-direction: column; gap: 24px; }
.ex-imgs { display: flex; gap: 24px; }
.ex-im { width: 356px; display: flex; flex-direction: column; gap: 10px; }
.ex-formula { flex: 1 1 auto; justify-content: center; padding: 18px 26px; gap: 8px; }
.ex-right { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.pred { padding: 22px 28px; gap: 8px; }
.digits { font-size: 88px; font-weight: 700; line-height: 1.05; color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---- question ---- */
.q-left { display: flex; flex-direction: column; gap: 28px; min-height: 0; }
.q-h1 { flex: 1.25 1 auto; justify-content: center; gap: 14px; }
.q-h0 { flex: 1 1 auto; justify-content: center; gap: 14px; }
.q-known { gap: 26px; justify-content: center; }
.known { display: flex; flex-direction: column; gap: 4px; }

/* ---- protocol ---- */
.proto { display: flex; }
.lanes { display: flex; flex-direction: column; gap: 24px; width: 1032px; flex: none; }
.lane { display: flex; flex: 1 1 0; min-height: 0; }
.pbox { justify-content: center; padding: 20px 24px; gap: 10px; flex: none; }
.w250 { width: 250px; } .w270 { width: 270px; } .w312 { width: 312px; } .w672 { width: 672px; }
.arr { display: flex; align-items: center; justify-content: center; width: 48px; flex: none; }
.proto > .arr { width: 56px; }
.arr path { fill: none; stroke: var(--faint); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.facts4 { display: grid; grid-template-columns: 1.1fr 0.9fr 1fr 1.1fr; gap: 32px; }
.fact { display: flex; flex-direction: column; gap: 4px; }

/* ---- charts ---- */
.tr { display: flex; gap: 56px; min-height: 0; }
.tr-chart { width: 1040px; flex: none; display: flex; flex-direction: column; gap: 12px; }
.tr-stats { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; justify-content: space-around; }
.stat-b { display: flex; flex-direction: column; gap: 10px; }
.lgs { display: flex; align-items: center; gap: 32px; }
.lg { display: flex; align-items: center; gap: 12px; }
.lg-sw { width: 22px; height: 22px; border-radius: 4px; flex: none; }
.lg-sw.f { background: var(--coral); } .lg-sw.c { background: var(--faint); }
.lg-sw.dot { border-radius: 50%; background: var(--coral); }
.lg-sw.dia { width: 16px; height: 16px; margin: 3px; border-radius: 0; transform: rotate(45deg); background: var(--indigo); }
.chart-s text { font-family: var(--font-sans); }
.chart-s .gl { stroke: var(--line); stroke-width: 1; }
.chart-s .ax { stroke: var(--line-strong); stroke-width: 2; }
.chart-s .tick { font-size: 24px; fill: var(--faint); }
.chart-s .xl { font-size: 28px; fill: var(--ink); }
.chart-s .axt { font-size: 24px; fill: var(--muted); }
.chart-s .b-f { fill: var(--coral); } .chart-s .b-c { fill: var(--faint); }
.chart-s .wh { stroke: var(--ink); stroke-width: 2.5; fill: none; }
.chart-s .v-f { font-size: 28px; font-weight: 600; fill: var(--coral); }
.chart-s .v-c { font-size: 28px; fill: var(--muted); }
.chart-s .pt.same { fill: var(--coral); } .chart-s .pt.cross { fill: var(--indigo); }
.chart-s .plabel { font-size: 24px; fill: var(--muted); }
.chart-s .plabel.same { fill: var(--coral); font-weight: 600; }

/* ---- matrices ---- */
.mx { display: flex; gap: 56px; min-height: 0; }
.mx-left { flex: none; display: flex; flex-direction: column; gap: 14px; }
.mx-right { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 24px; }
.hm { display: grid; grid-template-columns: 170px repeat(4, 166px); gap: 8px; align-items: stretch; }
.slide .hm-corner { font-size: 24px; line-height: 1.2; color: var(--faint); }
.slide .hm-h { font-size: 28px; font-weight: 600; line-height: 1.2; color: var(--ink); text-align: center; align-self: center; white-space: nowrap; }
.slide .hm-r { font-size: 28px; font-weight: 600; line-height: 1.2; color: var(--ink); align-self: center; white-space: nowrap; }
.hm-cell { min-height: 124px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-variant-numeric: tabular-nums; }
.hm-cell.dark { color: #fff; }
.hm-cell.diag { color: var(--faint); }
.hm-cell.mark { outline: 4px solid var(--ink); outline-offset: -4px; }
.slide .hm-cell .v { font-size: 36px; font-weight: 700; line-height: 1.15; white-space: nowrap; }
.slide .hm-cell .f { font-family: var(--font-mono); font-size: 24px; line-height: 1.15; white-space: nowrap; }
.slide .heat-scale { display: flex; align-items: center; gap: 14px; max-width: none; margin: 0; font-family: var(--font-mono); font-size: 24px; line-height: 1.2; color: var(--faint); }
.slide .heat-scale .ramp { width: 280px; height: 14px; border-radius: 4px; }
.slide .heat-scale .note { font-family: var(--font-sans); }
.pairs { display: flex; gap: 24px; }
.pair { display: flex; flex-direction: column; gap: 2px; flex: 1 1 0; min-width: 0; }

/* ---- correlation ---- */
.co { display: flex; gap: 44px; min-height: 0; }
.co-left { width: 1000px; flex: none; display: flex; flex-direction: column; gap: 8px; }
.co-right { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.rho { display: flex; flex-direction: column; gap: 8px; }

/* ---- grid tables ---- */
.gt { display: grid; }
.gt > p { padding: 12px 0; border-bottom: 1px solid var(--line); line-height: 1.25; }
.gt > .h { padding: 8px 0; border-bottom-color: var(--line-strong); font-size: 24px; line-height: 1.3; color: var(--faint); }
.gt > .r { text-align: right; white-space: nowrap; }
.gt.rho3 { grid-template-columns: 1fr 104px 104px 104px; column-gap: 8px; }
.gt.rho3 > p { display: block; }
.slide .rv { font-family: var(--font-mono); font-size: 32px; font-weight: 500; text-align: right; white-space: nowrap; color: var(--ink); font-variant-numeric: tabular-nums; }
.slide .rv.neg { font-weight: 700; color: var(--coral); }
.gt.nxt { grid-template-columns: 300px 480px 1fr; column-gap: 24px; }
.gt.nxt > p { padding: 10px 0; }
.gt.defs { grid-template-columns: 270px 1fr; column-gap: 24px; flex: 1.2 1 0; min-width: 0; }
.gt.mdl { grid-template-columns: 190px 1fr 180px 190px 330px; column-gap: 24px; }
.gt.mdl > p { padding: 16px 0; }
.gt.mdl > .h { padding: 8px 0; white-space: normal; }
.gt.rhof { grid-template-columns: 200px 1fr 1fr 1fr; column-gap: 24px; }
.gt.lit { grid-template-columns: 680px 1fr; column-gap: 32px; }
.gt.lit > p { padding: 9px 0; line-height: 1.2; }

/* ---- limitations, summary, backup ---- */
.lims { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.lim { padding: 32px; gap: 14px; }
.ls { display: flex; flex-direction: column; gap: 22px; }
.sum { padding: 30px 36px; gap: 24px; }
.bm { display: flex; gap: 44px; align-items: flex-start; }
.bm-ex { flex: 1 1 0; gap: 14px; }
.kvn { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.slide .kvv { font-family: var(--font-mono); font-size: 32px; font-weight: 600; line-height: 1.25; white-space: nowrap; color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---- print: one slide per page, in the current theme ---- */
@media print {
  @page { size: 1920px 1080px; margin: 0; }
  html, body { width: 1920px; }
  .page.deck-page { padding: 0 !important; }
  .deck-bar, .deck noscript, .site-footer { display: none !important; }
  .deck { display: block; --stage-w: 1920px; }
  .deck-stage { width: 1920px; height: auto; aspect-ratio: auto; overflow: visible; border: 0; border-radius: 0; }
  .deck-canvas { position: static; width: 1920px; height: auto; transform: none !important; }
  .slide { display: flex !important; position: relative; animation: none; break-after: page; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .slide:last-child { break-after: auto; }
  .slide a[href^="http"]::after { content: none; }
}

/* v4: the slide page keeps one control bar — the site footer and the label of the topbar toggle give way to the stage */
.app-main:has(.deck-page) > .site-footer { display: none; }
#present-toggle .lbl { display: none; }

/* phones held upright: the 16:9 slide is too small to read; say so above the deck */
.deck-rotate { display: none; }
@media (max-width: 600px) and (orientation: portrait) {
  .deck-rotate { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--line-strong); border-left: 3px solid var(--amber-ui); border-radius: 10px; font-size: 0.875rem; line-height: 1.45; color: var(--ink-2); background: var(--panel); }
  .deck-rotate .ic { flex: 0 0 18px; width: 18px; height: 18px; margin-top: 1px; color: var(--amber); }
}
