/* Shared deck styles. A talk is a page of <section> slides inside <main class="deck">.
   The stage is a fixed 16:9 box scaled to the window; sizes use cqw so they
   scale with it. White slides, one idea each, logo bottom right. */

:root {
  --ink: #111;
  --faint: #8a8a8a;
  --brand: #77a52d;
  --paper: #fff;
  --code-bg: #1e2227;
  font-family: "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; }

html, body { height: 100%; background: #000; overflow: hidden; }

.deck {
  position: absolute;
  inset: 0;
  margin: auto;
  width: min(100vw, calc(100vh * 16 / 9));
  height: min(100vh, calc(100vw * 9 / 16));
  container-type: size;
  background: var(--paper);
  color: var(--ink);
  overflow: hidden;
}

.deck > section {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5cqw;
  padding: 6cqw 7cqw 7cqw;
  text-align: center;
}
.deck > section.active { display: flex; }

/* Logo on every slide, like the Baselime deck. */
.deck::after {
  content: "";
  position: absolute;
  right: 2.2cqw;
  bottom: 1.8cqw;
  width: 9cqw;
  height: 1.4cqw;
  background: url(/assets/polylane.svg) right center / contain no-repeat;
  z-index: 5;
}
.deck .count {
  position: absolute;
  left: 2.2cqw;
  bottom: 1.8cqw;
  font: 500 0.9cqw/1 "JetBrains Mono", ui-monospace, monospace;
  color: var(--faint);
  z-index: 5;
}

/* Small bold label, top left. */
.deck h2 {
  position: absolute;
  top: 3.2cqw;
  left: 3.6cqw;
  font-size: 1.5cqw;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* The one line a slide says. */
.say { font-size: 3.4cqw; font-weight: 500; letter-spacing: -0.02em; line-height: 1.2; max-width: 70cqw; }
.say.xl { font-size: 5.5cqw; font-weight: 600; letter-spacing: -0.035em; }
.faint { color: var(--faint); }
.small { font-size: 1.6cqw; }
s { text-decoration-color: #d33; text-decoration-thickness: 0.25cqw; color: var(--faint); }
.brand { color: var(--brand); }

/* Title and thanks slides: left aligned, like the old deck. */
section.title { align-items: flex-start; justify-content: center; text-align: left; padding-left: 7cqw; }
section.title h1 { font-size: 5.4cqw; font-weight: 700; letter-spacing: -0.04em; line-height: 1.02; max-width: 60cqw; }
section.title .who { margin-top: 3cqw; font-size: 1.8cqw; font-weight: 500; }
section.title .links { font: 500 1.2cqw/1.7 "JetBrains Mono", ui-monospace, monospace; color: var(--faint); }

/* Big number slides. */
.stat { font-size: 10cqw; font-weight: 700; letter-spacing: -0.05em; line-height: 1; white-space: nowrap; }
.stat .to { color: var(--faint); font-weight: 400; padding: 0 0.15em; }
.stat .after { color: var(--brand); }

/* Pictures: memes, photos, diagrams. */
.pic { max-width: 80cqw; max-height: 44cqw; object-fit: contain; }
.pic.tall { max-height: 48cqw; }
.pic.full { max-width: 100%; max-height: 100%; }

/* A meme: an image with captions positioned in percent of the image. */
.meme { position: relative; height: 44cqw; max-width: 84cqw; container-type: inline-size; }
.meme.short { height: 38cqw; }
.meme img { display: block; width: 100%; height: 100%; }
.meme .cap {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.05;
  font-size: 5.5cqw;
}
.meme .cap.impact {
  font-family: Impact, "Anton", "Arial Black", sans-serif;
  color: #fff;
  text-transform: uppercase;
  -webkit-text-stroke: 0.12em #000;
  paint-order: stroke fill;
}
.meme .cap.ink { color: #000; font-weight: 600; letter-spacing: -0.02em; }

/* Code in a terminal window, like the old deck. */
.term {
  background: var(--code-bg);
  color: #d7dae0;
  border-radius: 0.8cqw;
  padding: 3cqw 3cqw 2.4cqw;
  position: relative;
  text-align: left;
  font: 400 1.7cqw/1.6 "JetBrains Mono", ui-monospace, monospace;
  box-shadow: 0 1cqw 3cqw rgb(0 0 0 / 0.18);
  white-space: pre;
}
.term::before {
  content: "";
  position: absolute;
  top: 1.1cqw;
  left: 1.2cqw;
  width: 0.8cqw;
  height: 0.8cqw;
  border-radius: 50%;
  background: #ff5f57;
  box-shadow: 1.3cqw 0 #febc2e, 2.6cqw 0 #28c840;
}
.term .k { color: #c678dd; }
.term .s { color: #98c379; }
.term .n { color: #d19a66; }
.term .c { color: #7f848e; }

.row { display: flex; gap: 5cqw; align-items: center; justify-content: center; }
.list { font-size: 3cqw; font-weight: 500; line-height: 1.5; letter-spacing: -0.02em; list-style: none; padding: 0; }

.notes { display: none; }

/* Slides that are all figure: less padding, the figure as big as it fits. */
section.fill { padding: 5.5cqw 3cqw 4cqw; }
.diagram { height: 46cqw; max-width: 94cqw; width: auto; object-fit: contain; }
.diagram.wide { height: auto; width: 94cqw; max-height: 46cqw; }
.chart { width: 90cqw; max-height: 44cqw; object-fit: contain; }
.term.dense { font-size: 1.45cqw; line-height: 1.55; }

/* Live charts (chart.js). Same tokens as the blog's DailyChart. */
.dchart-host { position: relative; width: 88cqw; }
.dchart { display: block; width: 100%; height: auto; font-size: 12px; overflow: visible; }
.dchart .ax { fill: var(--faint); }
.dchart .ax.strong { fill: var(--ink); font-weight: 500; }
.dchart .grid { stroke: #ececec; stroke-width: 1; }
.dchart .boundary { stroke: #c9c9c9; stroke-width: 1; stroke-dasharray: 3 3; }
.dchart .wash { fill: var(--brand); fill-opacity: 0.07; }
.dchart .band { fill: var(--brand); fill-opacity: 0.14; }
.dchart .series { fill: none; stroke: var(--brand); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.dchart .dot { fill: var(--brand); stroke: #fff; stroke-width: 2; transition: r 120ms ease; }
.dchart .dot.partial { fill: #fff; stroke: var(--brand); }
.dchart .dot.is-active { r: 5.5; }
.dchart .bar { fill: var(--brand); transition: fill 120ms ease; }
.dchart .bar.partial { fill-opacity: 0.45; }
.dchart .bar.is-active { fill: #4e7a17; }
.dchart .crosshair { stroke: #c9c9c9; stroke-width: 1; }
.dchart-tip {
  position: absolute; top: 0; z-index: 4; text-align: left;
  background: #fff; border: 1px solid #e5e5e5; border-radius: 0.5cqw; box-shadow: 0 0.3cqw 1cqw rgb(0 0 0 / 0.08);
  padding: 0.6cqw 0.9cqw; font-size: 1.15cqw; line-height: 1.4; color: var(--ink); pointer-events: none;
}
.dchart-tip span { color: var(--faint); }
.dchart-legend { display: flex; gap: 2cqw; align-items: center; margin-top: 0.8cqw; font-size: 1.1cqw; color: var(--faint); }
.dchart-legend span { display: inline-flex; align-items: center; gap: 0.6cqw; }
.dchart-legend em { margin-left: auto; font-style: normal; }
.dchart-legend .sw { display: inline-block; width: 1.6cqw; background: var(--brand); border-radius: 2px; }
.dchart-legend .sw.line { height: 0.18cqw; }
.dchart-legend .sw.area { height: 0.9cqw; opacity: 0.2; }

/* Draw in on each visit to the slide. */
section.active .dchart .series { stroke-dasharray: 1; animation: draw 1.4s ease-out both; }
section.active .dchart .dot, section.active .dchart .late { animation: fade 0.3s ease-out both; animation-delay: calc(var(--i, 30) * 40ms + 200ms); }
section.active .dchart .band { animation: fade 0.8s ease-out 0.6s both; }
section.active .dchart .bar { transform-box: fill-box; transform-origin: bottom; animation: grow 0.5s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i) * 35ms); }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }

.topology { width: 90cqw; max-height: 49cqw; object-fit: contain; }

.logos { display: flex; gap: 2.6cqw; align-items: center; margin-top: 3cqw; }
.logos img { width: auto; display: block; }

/* A left-to-right run of steps. */
.steps { display: flex; align-items: flex-start; gap: 2cqw; }
.steps > div { display: flex; flex-direction: column; gap: 1cqw; width: 17cqw; }
.steps b { font-size: 2.8cqw; font-weight: 600; letter-spacing: -0.02em; }
.steps span { font-size: 1.6cqw; color: var(--faint); }
.steps > i { font-style: normal; font-size: 2.8cqw; color: var(--faint); line-height: 1.2; }

/* Fragments: hidden until stepped to. */
.frag { opacity: 0; transform: translateY(0.6cqw); transition: opacity 0.35s ease, transform 0.35s ease; }
.frag.shown { opacity: 1; transform: none; }

/* A career timeline: logos over years on a rule. */
.timeline { display: flex; gap: 4cqw; margin-top: 3.5cqw; position: relative; }
.timeline::before { content: ""; position: absolute; left: 0; right: 0; bottom: 1.1cqw; height: 1px; background: #e2e2e2; }
.timeline > div { display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 1.4cqw; position: relative; }
.timeline img { width: auto; display: block; }
.timeline span { font: 500 1.3cqw/1 "JetBrains Mono", ui-monospace, monospace; color: var(--faint); background: var(--paper); padding-right: 0.8cqw; position: relative; }
.steps > i { transition: opacity 0.35s ease; }
.steps > i:has(+ .frag:not(.shown)) { opacity: 0; }

/* A cycle: four steps in a row, Verification underneath looping back to
   Detection. The container keeps the SVG's 800x240 aspect so paths line up
   with the absolutely placed steps. */
.cycle { position: relative; width: 80cqw; height: 24cqw; }
.cycle svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; transition: opacity 0.35s ease; }
.cycle .fwd, .cycle .back { fill: none; stroke-width: 2; }
.cycle .fwd { stroke: #8a8a8a; }
.cycle .back { stroke: var(--brand); stroke-dasharray: 6 5; }
.cycle:has(.verif:not(.shown)) svg { opacity: 0; }
.cycle .st { position: absolute; width: 20%; display: flex; flex-direction: column; align-items: center; gap: 0.9cqw; }
.cycle .st b { font-size: 2.3cqw; font-weight: 600; letter-spacing: -0.02em; }
.cycle .st span { font-size: 1.4cqw; color: var(--faint); }
.cycle > i { position: absolute; top: 0; width: 5%; text-align: center; font-style: normal; font-size: 2.3cqw; line-height: 1.25; color: var(--faint); transition: opacity 0.35s ease; }
.cycle > i:has(+ .frag:not(.shown)) { opacity: 0; }
/* No slide-up on the cycle's steps: opacity only. */
.cycle .frag { transform: none; }
