/* Slide stage: always laid out at 1280×720, scaled by .slide-frame. */

@font-face { font-family: "Inter"; src: url("../fonts/Inter.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("../fonts/SpaceGrotesk.ttf") format("truetype"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Merriweather"; src: url("../fonts/Merriweather.ttf") format("truetype"); font-weight: 300 900; font-display: swap; }
@font-face { font-family: "Playfair Display"; src: url("../fonts/PlayfairDisplay.ttf") format("truetype"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/JetBrainsMono.ttf") format("truetype"); font-weight: 100 800; font-display: swap; }

/* Absolutely positioned so the scaled frame never feeds back into its container's size. */
.slide-frame { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); overflow: hidden; }

.slide {
  position: absolute; left: 0; top: 0;
  width: 1280px; height: 720px;
  transform: scale(var(--scale, 1));
  transform-origin: 0 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font), system-ui, sans-serif;
  font-size: 32px;
  line-height: calc(1.35em + var(--line-extra, 0px));
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.slide-bg { position: absolute; inset: 0; background: center / cover no-repeat; }
.slide-shade { position: absolute; inset: 0; }
.slide-shade.darken { background: rgba(0, 0, 0, 0.45); }

.slide-content {
  position: absolute; inset: 0;
  padding: var(--margin, 48px);
  display: flex; flex-direction: column; justify-content: center;
  gap: 0.45em;
  overflow: hidden;
}
.slide-content > *, .column > * { margin: 0; }

/* headings may use their own family (theme headingFont), defaulting to the text font */
.slide h1, .slide h2, .slide h3 { font-family: var(--heading-font), var(--font), system-ui, sans-serif; margin: 0; }
.slide h1 { font-size: 2em; line-height: 1.12; font-weight: 700; letter-spacing: -0.01em; }
.slide h2 { font-size: 1.5em; line-height: 1.18; font-weight: 700; color: var(--accent); }
.slide h3 { font-size: 1.2em; line-height: 1.25; font-weight: 600; color: var(--accent); }
.slide p { margin: 0; }
.slide a { color: var(--accent); }
.slide strong { color: var(--accent); }
.slide ul { margin: 0; padding-left: 1.1em; display: flex; flex-direction: column; gap: 0.25em; }
.slide li::marker { color: var(--accent); }
.slide code {
  font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 0.85em;
  background: var(--code-bg); color: #e6e9ef; padding: 0.05em 0.3em; border-radius: 6px;
}
.slide pre {
  margin: 0; background: var(--code-bg); color: #e6e9ef;
  border-radius: 12px; padding: 0.7em 0.9em;
  font-size: 0.75em; line-height: 1.45; overflow: hidden; white-space: pre;
}
.slide pre code { background: none; padding: 0; font-size: 1em; }

.slide figure { margin: 0; min-height: 0; flex: 0 1 auto; display: flex; }
.slide figure img { max-width: 100%; max-height: 460px; object-fit: contain; border-radius: 8px; }
.slide figure.missing { font-size: 0.5em; opacity: 0.6; border: 2px dashed currentColor; padding: 1em; border-radius: 8px; }
/* Images stack in one grid cell, so the frame is as large as the largest image and
   the layout doesn't jump; render.js toggles .active, the transition cross-fades. */
.slide figure.slideshow { display: grid; place-items: center; }
.slide figure.slideshow img {
  grid-area: 1 / 1;
  opacity: 0;
  transition: opacity 1.2s ease-in-out;
}
.slide figure.slideshow img.active { opacity: 1; }
.slide figure.video a { position: relative; display: block; }
.slide figure.video img { width: 640px; aspect-ratio: 16 / 9; object-fit: cover; }
.slide figure.video .play {
  position: absolute; left: 50%; top: 50%; width: 96px; height: 68px; transform: translate(-50%, -50%);
  background: rgba(220, 0, 0, 0.9); border-radius: 18px;
}
.slide figure.video .play::after {
  content: ""; position: absolute; left: 38px; top: 20px;
  border-style: solid; border-width: 14px 0 14px 26px; border-color: transparent transparent transparent #fff;
}

.slide .columns { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 1.5em; align-items: start; min-height: 0; }
.slide .column { display: flex; flex-direction: column; gap: 0.45em; min-width: 0; }

.slide .cursor {
  display: inline-block; width: 0.5em; height: 1.1em; vertical-align: text-bottom;
  background: var(--accent); margin-left: 0.1em;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.slide.skipped::after {
  content: "SKIPPED"; position: absolute; top: 24px; right: 24px;
  font: 700 20px/1 system-ui, sans-serif; letter-spacing: 0.1em;
  padding: 8px 12px; border-radius: 6px; background: rgba(0, 0, 0, 0.6); color: #fff;
}

/* ---------- print: one slide per page ---------- */

.print-deck { display: none; }
@media print {
  @page { size: 1280px 720px; margin: 0; }
  html, body { background: #000 !important; height: auto; }
  body > *:not(.print-deck) { display: none !important; }
  .print-deck { display: block; }
  .print-page { position: relative; width: 1280px; height: 720px; overflow: hidden; break-after: page; page-break-after: always; }
  .print-page .slide { transform: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-page .slide * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .slide figure.slideshow img, .slide figure.slideshow img.active { transition: none; opacity: 0; }
  .slide figure.slideshow img:first-child, .slide figure.slideshow img.active:first-child { opacity: 1; }
  .slide .cursor { animation: none; }
}

/* Theme logo: a corner overlay above content, inset by half the inner margin (at least 16px). */
.slide-logo {
  position: absolute; z-index: 2; width: auto; max-width: 40%;
  object-fit: contain; pointer-events: none;
  --logo-inset: max(16px, calc(var(--margin, 48px) / 2));
}
.slide-logo.top-left { top: var(--logo-inset); left: var(--logo-inset); }
.slide-logo.top-right { top: var(--logo-inset); right: var(--logo-inset); }
.slide-logo.bottom-left { bottom: var(--logo-inset); left: var(--logo-inset); }
.slide-logo.bottom-right { bottom: var(--logo-inset); right: var(--logo-inset); }
