/* Stage mode: a 1920×1080 dark canvas for a keynote screen.
   Sizes are in canvas px; nothing readable is under 24px (2.2% of the height). */
:root {
  --bg: #060a13; --panel: #0e1525; --panel2: #141d31; --line: #27344f;
  --ink: #f6f8fc; --ink2: #c3cde0; --dim: #8fa0bd;
  --blue: #6aa6ff; --violet: #a595ff;
  --grad: linear-gradient(100deg, #6aa6ff 0%, #a595ff 100%);
  --bad: #ff6464; --bad-bg: rgba(255, 100, 100, .12); --bad-line: rgba(255, 100, 100, .55);
  --ok: #42e08c; --ok-bg: rgba(66, 224, 140, .11); --ok-line: rgba(66, 224, 140, .5);
  --warn: #ffb845;
  --sev-crit: #ff6464; --sev-high: #ffb845;
  --code: #dbe5f7; --ctx: #b9c5db; --add-ink: #d6ffe7; --del-ink: #ffd6d6; --hl-ink: #ffd9d9;
  --on: #fff; --bar: #5b6a86; --track: rgba(255, 255, 255, .06);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
}
/* Light look (T toggles it on the stage window). Severity badges keep their colours. */
:root.light {
  --bg: #f6f8fc; --panel: #ffffff; --panel2: #eef2f8; --line: #c5d0e2;
  --ink: #0a1220; --ink2: #334155; --dim: #566275;
  --blue: #1a5fd0; --violet: #5b47d6;
  --grad: linear-gradient(100deg, #1a66e0 0%, #6a4ee6 100%);
  --bad: #c81e1e; --bad-bg: rgba(200, 30, 30, .07); --bad-line: rgba(200, 30, 30, .5);
  --ok: #0c7a3a; --ok-bg: rgba(12, 122, 58, .08); --ok-line: rgba(12, 122, 58, .5);
  --warn: #b25c00;
  --code: #1c2740; --ctx: #44506a; --add-ink: #0b4a26; --del-ink: #7a1414; --hl-ink: #7a1010;
  --on: #0a1220; --bar: #9aa7bd; --track: rgba(10, 20, 40, .07);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body:not(.presenter) { overflow: hidden; cursor: default; }
[hidden] { display: none !important; }

#fit { position: fixed; inset: 0; overflow: hidden; }
#deck { position: absolute; left: 50%; top: 50%; width: 1920px; height: 1080px;
  background:
    radial-gradient(1200px 700px at 8% -10%, rgba(106, 166, 255, .16), transparent 60%),
    radial-gradient(1100px 700px at 100% 110%, rgba(165, 149, 255, .13), transparent 60%),
    var(--bg);
  overflow: hidden; }

/* ---- top rail ---- */
.rail { position: absolute; left: 0; right: 0; top: 0; height: 92px; padding: 0 80px; display: flex; align-items: center; justify-content: space-between; }
.brand { font-size: 30px; font-weight: 800; letter-spacing: -.01em; display: flex; align-items: center; gap: 14px; }
.brand .mk { width: 22px; height: 22px; background: var(--grad); transform: rotate(45deg); border-radius: 4px; }
#acts { display: flex; gap: 10px; }
#acts span { font-size: 24px; font-weight: 600; color: var(--dim); padding: 8px 20px; border-radius: 999px; transition: all .3s; }
#acts span.done { color: var(--ink2); }
#acts span.on { color: var(--on); background: rgba(106, 166, 255, .2); box-shadow: inset 0 0 0 2px rgba(106, 166, 255, .55); }
.prog { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: var(--track); }
.prog i { display: block; height: 100%; width: 0; background: var(--grad); transition: width .4s ease; }

/* ---- exit button + opening hint (shown on mouse move / at load, then fade) ---- */
.exit { position: absolute; right: 80px; top: 112px; z-index: 5; display: flex; align-items: center; gap: 12px; font-size: 24px; font-weight: 700;
  color: var(--ink); text-decoration: none; background: var(--panel2); border: 2px solid var(--line); border-radius: 999px; padding: 10px 16px 10px 20px;
  opacity: 0; pointer-events: none; transition: opacity .3s; }
.exit svg { width: 26px; height: 26px; stroke: currentColor; fill: none; stroke-width: 2.4; stroke-linecap: round; }
.exit kbd { font-family: var(--mono); font-size: 20px; color: var(--dim); border: 2px solid var(--line); border-radius: 8px; padding: 1px 8px; }
.exit:hover { border-color: var(--blue); }
body.awake .exit { opacity: 1; pointer-events: auto; }
body.awake #deck { cursor: default; }
body:not(.awake):not(.presenter) #deck { cursor: none; }
.intro { position: absolute; left: 50%; top: 128px; transform: translateX(-50%); z-index: 5; display: flex; gap: 26px; align-items: center; white-space: nowrap;
  font-size: 26px; font-weight: 700; color: var(--ink); background: var(--panel2); border: 2px solid var(--line); border-radius: 999px; padding: 14px 32px;
  transition: opacity .6s; pointer-events: none; }
.intro span { font-weight: 500; color: var(--ink2); }
.intro.gone { opacity: 0; }

/* ---- slide frame ---- */
#slide { position: absolute; left: 80px; right: 80px; top: 104px; bottom: 44px; }
.sl { position: absolute; inset: 0; display: flex; flex-direction: column; animation: slIn .45s ease both; }
@keyframes slIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.sl.center { justify-content: center; }
/* headline stays put; whatever follows it is centred in the space that is left */
.sl:not(.center) > .hd + * { margin-top: auto; }
.sl:not(.center)::after { content: ""; margin-top: auto; }
.kick { font-size: 26px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--blue); margin-bottom: 14px; }
.hd { min-height: 104px; margin-bottom: 26px; align-items: start; }
h1 { font-size: 80px; line-height: 1.06; font-weight: 800; letter-spacing: -.025em; margin: 0; }
h1.xl { font-size: 104px; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.bad { color: var(--bad); } .ok { color: var(--ok); }
.sub { font-size: 36px; line-height: 1.3; color: var(--ink2); margin: 18px 0 0; max-width: 1500px; }
.note { font-size: 26px; line-height: 1.35; color: var(--dim); }
.grow { flex: 1; min-height: 0; }
.row { display: flex; gap: 32px; }
.col { display: flex; flex-direction: column; gap: 24px; min-width: 0; }

/* build steps: [data-at=n] appears at step n, [data-until=n] leaves after step n */
[data-at] { opacity: 0; transform: translateY(26px); transition: opacity .5s ease, transform .5s ease; pointer-events: none; }
[data-at].on { opacity: 1; transform: none; pointer-events: auto; }
[data-until] { transition: opacity .35s ease; }
[data-until].off { opacity: 0; }
/* .stack: steps that replace each other share one grid cell, so the box keeps the taller one's height */
.stack { display: grid; }
.stack > * { grid-area: 1 / 1; min-width: 0; }
.pending { display: flex; align-items: center; justify-content: center; gap: 18px; min-height: 150px; font-size: 36px; color: var(--ink2);
  border: 3px dashed var(--line); border-radius: 22px; }
.pending .dot { width: 20px; height: 20px; border-radius: 50%; background: var(--warn); animation: pulse 1.2s ease-in-out infinite; }

/* ---- shared pieces ---- */
.panel { background: var(--panel); border: 2px solid var(--line); border-radius: 22px; }
.chip { display: inline-flex; align-items: center; gap: 10px; font-size: 24px; font-weight: 600; color: var(--ink2);
  background: var(--track); border: 2px solid var(--line); border-radius: 999px; padding: 6px 18px; white-space: nowrap; }
.chip.mono { font-family: var(--mono); }
.chip.ok { color: var(--ok); border-color: var(--ok-line); background: var(--ok-bg); }
.chip.bad { color: var(--bad); border-color: var(--bad-line); background: var(--bad-bg); }
.chips { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.sev { font-size: 24px; font-weight: 800; letter-spacing: .06em; padding: 4px 16px; border-radius: 10px; }
.sev.CRITICAL { background: var(--sev-crit); color: #1b0606; }
.sev.HIGH { background: var(--sev-high); color: #201400; }
.ic { width: 1em; height: 1em; flex: none; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
code, .mono { font-family: var(--mono); }
.hl { background: rgba(255, 100, 100, .24); color: var(--hl-ink); border-radius: 6px; box-shadow: 0 0 0 2px rgba(255, 100, 100, .5); }
.code { font-family: var(--mono); font-size: 30px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; margin: 0; color: var(--code); }

/* unified diff */
.diff { font-family: var(--mono); font-size: 25px; line-height: 36px; padding: 14px 0; overflow: hidden; }
.ud { display: block; white-space: pre; overflow: hidden; text-overflow: ellipsis; padding: 0 26px 0 0; color: var(--ctx); transition: opacity .4s; }
.ud i { display: inline-block; width: 52px; text-align: center; font-style: normal; color: var(--dim); }
.ud.add { background: rgba(66, 224, 140, .1); color: var(--add-ink); } .ud.add i { color: var(--ok); }
.ud.del { background: rgba(255, 100, 100, .11); color: var(--del-ink); } .ud.del i { color: var(--bad); }
.diff.focus .ud:not(.flag) { opacity: .32; }
.diff.focus .ud.flag { background: rgba(255, 100, 100, .16); }
.diff:not(.focus) .hl { background: none; box-shadow: none; color: inherit; }
.diff-more { font-size: 24px; color: var(--dim); padding: 10px 26px 16px 52px; border-top: 2px dashed var(--line); margin-top: 8px; }
.ph { display: flex; align-items: center; gap: 18px; padding: 16px 26px; border-bottom: 2px solid var(--line); font-size: 26px; color: var(--ink2); }
.ph b { color: var(--ink); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph .sp { flex: 1; }
.ph .ic { font-size: 32px; color: var(--violet); }

/* ---- title ---- */
.pipe { display: flex; align-items: stretch; gap: 18px; margin-top: 64px; }
.pstep { flex: 1; padding: 28px 30px; display: flex; flex-direction: column; gap: 8px; animation: rise .6s ease both; }
.pstep .ic { font-size: 50px; color: var(--blue); margin-bottom: 8px; }
.pstep b { font-size: 40px; font-weight: 800; }
.pstep span { font-size: 27px; color: var(--ink2); line-height: 1.25; }
.pstep.hot { border-color: rgba(165, 149, 255, .6); background: linear-gradient(160deg, rgba(106, 166, 255, .14), rgba(165, 149, 255, .1)); }
.parr { align-self: center; font-size: 44px; color: var(--dim); animation: rise .6s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }
.foot { position: absolute; left: 0; right: 0; bottom: 0; font-size: 24px; color: var(--dim); display: flex; gap: 14px; align-items: center; }

/* ---- PR gate ---- */
.callout { display: flex; align-items: flex-start; gap: 24px; padding: 20px 28px; border-color: var(--bad-line); background: var(--bad-bg); margin-top: 20px; }
.callout .t { font-size: 32px; font-weight: 800; line-height: 1.2; }
.callout .d { font-size: 27px; color: var(--ink2); line-height: 1.3; margin-top: 6px; }
.block-grid { display: grid; grid-template-columns: 560px 1fr; gap: 40px; align-items: stretch; }
.big { padding: 30px 40px; display: flex; flex-direction: column; justify-content: center; border-color: var(--bad-line); background: var(--bad-bg); }
.big .n { font-size: 260px; line-height: .95; font-weight: 800; letter-spacing: -.04em; color: var(--bad); font-variant-numeric: tabular-nums; }
.big .l { font-size: 38px; font-weight: 700; line-height: 1.2; margin-top: 10px; }
.big .m { font-size: 27px; color: var(--ink2); margin-top: 12px; line-height: 1.3; }
.routes { display: flex; flex-direction: column; gap: 16px; }
.routes .lbl { font-size: 28px; color: var(--ink2); font-weight: 600; }
.route { display: flex; flex-direction: column; gap: 4px; padding: 18px 26px; animation: rise .5s ease both; }
.route code { font-size: 30px; font-weight: 700; color: var(--ink); }
.route span { font-size: 26px; color: var(--bad); }
.stamp { display: inline-block; border: 6px solid var(--bad); color: var(--bad); border-radius: 18px; padding: 2px 30px; transform: rotate(-3deg); animation: stamp .5s cubic-bezier(.2, 1.6, .4, 1) both .15s; }
@keyframes stamp { from { opacity: 0; transform: rotate(-3deg) scale(2.2); } to { opacity: 1; transform: rotate(-3deg) scale(1); } }

/* ---- find ---- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; margin-top: 8px; }
.stat { padding: 26px 38px 30px; }
.stat .n { font-size: 190px; line-height: 1; font-weight: 800; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.stat .n small { font-size: 64px; font-weight: 700; letter-spacing: 0; color: var(--ink2); margin-left: 12px; }
.stat .l { font-size: 34px; color: var(--ink2); margin-top: 6px; }
.sevbar { display: flex; height: 64px; border-radius: 16px; overflow: hidden; margin-top: 38px; gap: 4px; }
.sevbar i { display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 26px; font-weight: 800; color: #10151f; white-space: nowrap;
  flex-grow: 0; flex-basis: 0; transition: flex-grow 1.1s cubic-bezier(.2, .8, .2, 1) .3s; overflow: hidden; }
.sevbar .c { background: var(--sev-crit); } .sevbar .h { background: var(--sev-high); } .sevbar .m { background: #e8dc6a; } .sevbar .lo { background: #9fb2d1; }
.sevleg { display: flex; gap: 40px; margin-top: 18px; font-size: 28px; color: var(--ink2); }
.sevleg b { color: var(--ink); } .sevleg span::before { content: ""; display: inline-block; width: 18px; height: 18px; border-radius: 5px; margin-right: 12px; background: var(--k); }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.vcard { padding: 44px 42px 40px; min-height: 580px; display: flex; flex-direction: column; gap: 22px; transition: all .3s; opacity: .72; position: relative; }
.vcard .num { position: absolute; right: 26px; top: 22px; font-size: 26px; font-weight: 800; color: var(--dim); border: 2px solid var(--line); border-radius: 10px; width: 44px; height: 44px; display: grid; place-items: center; }
.vcard .ic { font-size: 80px; color: var(--violet); }
.vcard h3 { font-size: 50px; line-height: 1.12; margin: 0; font-weight: 800; letter-spacing: -.01em; }
.vcard p { font-size: 34px; line-height: 1.3; color: var(--ink2); margin: 0; flex: 1; }
.vcard code { font-size: 26px; color: var(--dim); word-break: break-all; }
.vcard.sel { opacity: 1; border-color: var(--blue); background: linear-gradient(160deg, rgba(106, 166, 255, .18), rgba(165, 149, 255, .1)); transform: translateY(-10px);
  box-shadow: 0 0 0 4px rgba(106, 166, 255, .22), 0 30px 80px rgba(30, 80, 200, .35); }
.vs { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-top: 26px; }
.vsc { padding: 30px 36px; }
.vsc .k { font-size: 24px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; display: flex; align-items: center; gap: 12px; }
.vsc .t { font-size: 37px; font-weight: 700; line-height: 1.2; margin-top: 10px; }
.vsc .d { font-size: 29px; line-height: 1.3; color: var(--ink2); margin-top: 8px; }
.vsc.no { border-color: var(--bad-line); } .vsc.no .k { color: var(--bad); } .vsc.no .t { text-decoration: line-through; text-decoration-color: rgba(255, 100, 100, .7); color: var(--ink2); }
.vsc.yes { border-color: var(--ok-line); background: var(--ok-bg); } .vsc.yes .k { color: var(--ok); }
.codebox { padding: 34px 40px; }
.codebox .code { font-size: 42px; }

/* ---- attack / replay ---- */
.req { padding: 0; overflow: hidden; position: relative; }
.req .body { padding: 28px 34px 32px; }
.req .code { font-size: 34px; }
.req .lbl { font-size: 24px; color: var(--dim); margin-bottom: 8px; }
.verb { font-family: var(--mono); font-weight: 800; color: var(--violet); }
.sweep::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 220px; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .22), transparent); transform: translateX(-240px); }
.fire .sweep::after { animation: sweep .7s ease-in both; }
@keyframes sweep { to { transform: translateX(1900px); } }
.resp { padding: 0; overflow: hidden; }
.resp, .await { margin-top: 24px; }
.resp.bad { border-color: var(--bad-line); background: var(--bad-bg); }
.resp.ok { border-color: var(--ok-line); background: var(--ok-bg); }
.resp .ph { border-color: inherit; }
.resp .body { padding: 28px 34px 30px; }
.resp .code { font-size: 42px; font-weight: 700; }
.resp .note { font-size: 28px; }
.resp.bad .code { color: var(--del-ink); } .resp.ok .code { color: var(--add-ink); }
.http { font-family: var(--mono); font-weight: 800; font-size: 28px; }
.resp[data-at] { transform: scale(.94); transition-delay: .65s; }
.resp[data-at].on { transform: none; }
.legit { display: flex; gap: 24px; align-items: flex-start; margin-top: 24px; padding: 26px 34px; }
.legit .ic { font-size: 44px; color: var(--ok); margin-top: 2px; }
.legit b { font-size: 36px; } .legit div div { font-size: 30px; color: var(--ink2); margin-top: 4px; line-height: 1.3; }
.fx { position: absolute; inset: 0; pointer-events: none; opacity: 0; }
.fx.bad { box-shadow: inset 0 0 0 14px var(--bad), inset 0 0 260px rgba(255, 60, 60, .55); animation: flash 1.5s ease-out both .6s; }
.fx.ok { box-shadow: inset 0 0 0 14px var(--ok), inset 0 0 260px rgba(40, 220, 130, .45); animation: flash 1.5s ease-out both .6s; }
@keyframes flash { 0% { opacity: 0; } 12% { opacity: 1; } 100% { opacity: 0; } }

/* ---- fix ---- */
.fix-grid { display: grid; grid-template-columns: 1180px 1fr; gap: 36px; align-items: start; }
.fix-side .t { font-size: 40px; line-height: 1.28; font-weight: 600; }

/* ---- ship ---- */
.pr { padding: 0; overflow: hidden; }
.pr .ph b { font-size: 32px; }
.checks { list-style: none; margin: 0; padding: 34px 38px 40px; display: grid; grid-template-columns: 1fr 1fr; gap: 30px 40px; }
.checks li { font-size: 35px; display: flex; gap: 16px; align-items: center; animation: rise .5s ease both; }
.checks .ic { font-size: 46px; color: var(--ok); }
.decide { margin-top: 34px; }
@keyframes pulse { 50% { opacity: .25; } }
.approved { display: flex; align-items: center; gap: 34px; padding: 26px 38px; border-color: var(--ok-line); background: var(--ok-bg); }
.approved .ic { font-size: 84px; color: var(--ok); }
.approved b { font-size: 46px; display: block; }
.approved code { font-size: 34px; color: var(--ink2); }

/* ---- scoreboard ---- */
.board { display: flex; flex-direction: column; gap: 28px; }
.brow { display: grid; grid-template-columns: 330px 1fr 200px; align-items: center; gap: 28px; }
.brow .nm { font-size: 46px; font-weight: 700; color: var(--ink2); }
.brow .bar { height: 92px; border-radius: 16px; background: var(--track); overflow: hidden; }
.brow .bar i { display: block; height: 100%; width: 0; border-radius: 16px; background: var(--bar); transition: width 1.4s cubic-bezier(.2, .8, .2, 1) .35s; }
.brow .sc { font-size: 72px; font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; color: var(--ink2); }
.brow .sc small { font-size: 34px; color: var(--dim); font-weight: 700; }
.brow.cm .nm { color: var(--ink); } .brow.cm .bar i { background: var(--grad); } .brow.cm .sc { color: var(--ink); }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; margin-top: 48px; }
.tile { padding: 30px 36px; display: flex; align-items: center; gap: 26px; animation: rise .6s ease both; }
.tile .n { font-size: 116px; font-weight: 800; line-height: 1; letter-spacing: -.03em; }
.tile .l { font-size: 32px; line-height: 1.25; color: var(--ink2); }
.url { font-size: 34px; font-weight: 700; font-family: var(--mono); color: var(--ink); }

.err { font-size: 36px; color: var(--bad); padding: 80px; }

/* ---- help card ---- */
#help { position: fixed; inset: 0; background: rgba(3, 6, 12, .8); display: grid; place-items: center; z-index: 20; }
.help-card { background: var(--panel2); border: 2px solid var(--line); border-radius: 20px; padding: 28px 40px 34px; font-size: 20px; max-width: 760px; }
.help-card h2 { margin: 0 0 16px; font-size: 28px; }
.help-card dl { display: grid; grid-template-columns: auto 1fr; gap: 10px 28px; margin: 0; }
.help-card dt { font-family: var(--mono); color: var(--blue); } .help-card dd { margin: 0; color: var(--ink2); }

/* ---- presenter window (a normal responsive page, not the scaled canvas) ---- */
body.presenter #fit { display: none; }
#presenter { max-width: 1100px; margin: 0 auto; padding: 28px 36px 40px; }
.pv-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 20px; color: var(--ink2); border-bottom: 2px solid var(--line); padding-bottom: 14px; }
.pv-clock { display: flex; align-items: baseline; gap: 18px; }
.pv-clock b { font-size: 54px; font-variant-numeric: tabular-nums; color: var(--ink); font-family: var(--mono); }
.pv-k { font-size: 15px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--blue); margin: 26px 0 8px; }
.pv-title { font-size: 34px; font-weight: 800; line-height: 1.15; }
.pv-say { font-size: 27px; line-height: 1.45; color: var(--ink); }
.pv-say i { color: var(--warn); font-style: normal; font-weight: 700; }
.pv-next { font-size: 22px; color: var(--ink2); }
.pv-keys { margin-top: 36px; font-size: 15px; color: var(--dim); }
