/* Presentation page (/presentation/). Loaded after style.css; uses its colour
   tokens. Slides are always dark, like the home page's top section, in both
   site themes.

   Sizes inside a slide are in units of --u: 1% of the slide's width, so a
   slide scales as a whole, like a picture. On narrow screens --u becomes a
   fixed size and slides grow with their content instead. */

.deck {
  --stage-reserve: 190px; /* top bar + controls + spacing, for the stage size */
  padding: 24px 0 32px;
}

/* ---------- Slides (without JavaScript: all slides stacked) ---------- */

.deck-stage {
  display: grid;
  gap: 24px;
  width: min(100% - 32px, 1080px);
  margin: 0 auto;
}

.slide {
  --u: 1cqw;
  container-type: inline-size;
  position: relative;
  display: grid;
  align-content: center;
  aspect-ratio: 16 / 9;
  padding: 5% 7%;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--hero-bg);
  color: #d6dde5;
  box-shadow: 0 0 0 1px rgb(32 170 243 / 0.18), 0 8px 30px rgb(0 0 0 / 0.25);
  font-size: calc(var(--u) * 2.5);
  line-height: 1.4;
  /* Keep the dark background and neon when printing. */
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.slide-notes { display: none; }

.slide :where(h1, h2, h3, p, ul, ol) { margin: 0; }

.slide h1,
.slide h2 {
  color: var(--hero-text);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.slide h1 { font-size: calc(var(--u) * 7); }

.slide h2 {
  font-size: calc(var(--u) * 4.2);
  margin-bottom: calc(var(--u) * 3.2);
}

/* A short neon line under each slide title, glowing like the top bar's. */
.slide h2::after {
  content: "";
  display: block;
  width: calc(var(--u) * 7);
  height: max(2px, calc(var(--u) * 0.3));
  margin-top: calc(var(--u) * 1.4);
  border-radius: 2px;
  background: var(--neon);
  box-shadow: 0 0 calc(var(--u) * 0.8) var(--neon);
}

.slide p + p,
.slide ul + p,
.slide p + ul { margin-top: calc(var(--u) * 1.6); }

.slide strong { color: var(--hero-text); }

.slide a {
  color: var(--neon);
  text-underline-offset: 0.15em;
}

.slide .tbd {
  color: var(--hero-muted);
  font-weight: 600;
  font-style: italic;
}

/* Bullets: small glowing neon dots. */
.slide ul {
  list-style: none;
  padding: 0;
  display: grid;
  gap: calc(var(--u) * 1.3);
}

.slide ul li {
  position: relative;
  padding-left: calc(var(--u) * 2.6);
}

.slide ul li::before {
  content: "";
  position: absolute;
  left: calc(var(--u) * 0.3);
  top: 0.55em;
  width: calc(var(--u) * 0.8);
  height: calc(var(--u) * 0.8);
  border-radius: 50%;
  background: var(--neon);
  box-shadow: 0 0 calc(var(--u) * 0.6) var(--neon);
}

/* Numbered lists: step cards side by side, with big neon numbers. */
.slide ol {
  list-style: none;
  padding: 0;
  counter-reset: step;
  display: grid;
  grid-auto-columns: 1fr;
  grid-auto-flow: column;
  gap: calc(var(--u) * 2);
}

.slide ol li {
  counter-increment: step;
  padding: calc(var(--u) * 2.4);
  border: 1px solid rgb(32 170 243 / 0.35);
  border-radius: calc(var(--u) * 1.2);
  background: rgb(255 255 255 / 0.03);
}

.slide ol li::before {
  content: counter(step);
  display: block;
  margin-bottom: calc(var(--u) * 1);
  font-size: calc(var(--u) * 4.4);
  font-weight: 700;
  line-height: 1;
  color: var(--neon);
  text-shadow: 0 0 calc(var(--u) * 1.2) rgb(32 170 243 / 0.6);
}

/* Tables (specifications): rows with thin dividers, labels muted. */
.slide .table-wrap { margin: 0; }

.slide table {
  border-collapse: collapse;
  width: 100%;
  font-size: calc(var(--u) * 2.1);
}

.slide td,
.slide th {
  padding: calc(var(--u) * 0.85) calc(var(--u) * 1.4);
  border-bottom: 1px solid rgb(255 255 255 / 0.12);
  text-align: left;
  vertical-align: top;
}

.slide td:first-child {
  width: 26%;
  padding-left: 0;
  color: var(--hero-muted);
  font-weight: 600;
}

/* Pictures. Screenshots of HeadNav's screen get the device frame of the
   manual, scaled with the slide and with a neon glow on the dark slide. */
.slide-media {
  display: grid;
  place-items: center;
  min-width: 0;
}

.slide-media img {
  display: block;
  max-width: 100%;
  height: auto;
}

.slide img.screen {
  width: calc(var(--u) * 36);
  max-width: 100%;
  padding: calc(var(--u) * 0.45);
  border: calc(var(--u) * 0.9) solid #3c3c40;
  border-radius: calc(var(--u) * 1.4);
  background: #000000;
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.06), 0 calc(var(--u) * 0.5) calc(var(--u) * 3) rgb(32 170 243 / 0.3);
}

/* ---------- Layouts ---------- */

/* Title: text on the left, the portrait on the right, fading into the
   dark background like on the home page. */
.slide-title .slide-text {
  position: relative;
  z-index: 1;
  max-width: 55%;
}

.slide-title h1 + p {
  margin-top: calc(var(--u) * 1.2);
  font-size: calc(var(--u) * 3.4);
  color: var(--neon);
  text-shadow: 0 0 calc(var(--u) * 1.5) rgb(32 170 243 / 0.45);
}

.slide-title .slide-text p:last-child {
  margin-top: calc(var(--u) * 3.5);
}

/* "Expected release": a pill like the one on the home page. */
.slide-title .slide-text p:last-child strong {
  display: inline-block;
  padding: calc(var(--u) * 0.6) calc(var(--u) * 1.6);
  border: 1px solid rgb(32 170 243 / 0.6);
  border-radius: 999px;
  font-size: calc(var(--u) * 2);
  font-weight: 600;
  box-shadow: 0 0 calc(var(--u) * 1.2) rgb(32 170 243 / 0.25);
}

.slide-title .slide-media {
  position: absolute;
  inset: 0 0 0 auto;
  width: 48%;
}

.slide-title .slide-media p { height: 100%; width: 100%; }

.slide-title .slide-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 20%;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 35%);
  mask-image: linear-gradient(90deg, transparent, #000 35%);
}

/* Section divider: one big centred heading. */
.slide-section {
  text-align: center;
  justify-items: center;
}

.slide-section h1 { font-size: calc(var(--u) * 6); }

.slide-section p {
  margin-top: calc(var(--u) * 2);
  font-size: calc(var(--u) * 3);
  color: var(--hero-muted);
}

/* Split: text on the left, a picture on the right. */
.slide-split {
  grid-template-columns: 1.25fr 1fr;
  align-items: center;
  column-gap: calc(var(--u) * 5);
  font-size: calc(var(--u) * 2.4);
}

/* ---------- Stage (with JavaScript: one slide at a time) ---------- */

/* All slides share one grid cell, so the stage is as big as the biggest
   slide and nothing shifts when the slide changes. */
.deck.is-ready .deck-stage {
  width: min(100% - 32px, max(calc((100svh - var(--stage-reserve)) * 16 / 9), 520px));
  gap: 0;
  touch-action: pan-y pinch-zoom;
}

.deck.is-ready .slide {
  grid-area: 1 / 1;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0s linear 0.35s;
}

.deck.is-ready .slide.is-active {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.35s ease, visibility 0s;
}

@media (prefers-reduced-motion: reduce) {
  .deck.is-ready .slide,
  .deck.is-ready .slide.is-active { transition: none; }
}

/* ---------- Controls ---------- */

.deck-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: min(100% - 32px, 1080px);
  margin: 14px auto 0;
}

.deck.is-ready .deck-controls { width: min(100% - 32px, max(calc((100svh - var(--stage-reserve)) * 16 / 9), 520px)); }

.deck-controls[hidden],
.deck-notes[hidden],
.deck-button[hidden] { display: none; }

.deck-progress {
  flex: 1 0 100%;
  height: 3px;
  margin-bottom: 6px;
  border-radius: 2px;
  background: var(--border);
  overflow: hidden;
}

.deck-progress-bar {
  width: 0;
  height: 100%;
  background: var(--neon);
  box-shadow: 0 0 6px var(--neon);
  transition: width 0.35s ease;
}

.deck-count {
  min-width: 4.5em;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.deck-spacer { flex: 1; }

.deck-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.deck-button svg {
  width: 20px;
  height: 20px;
}

.deck-prev,
.deck-next,
.deck-fullscreen { padding: 0; }

.deck-button:disabled {
  opacity: 0.4;
  cursor: default;
}

@media (hover: hover) {
  .deck-button:not(:disabled):hover {
    border-color: var(--neon);
    box-shadow: 0 0 8px rgb(32 170 243 / 0.35);
  }
}

.deck-button[aria-pressed="true"] {
  border-color: var(--neon);
  background: var(--neon);
  color: var(--accent-text);
}

/* Speaker notes, under the controls. */
.deck-notes {
  width: min(100% - 32px, 1080px);
  margin: 14px auto 0;
  padding: 16px 20px;
  border-left: 3px solid var(--neon);
  border-radius: 0 8px 8px 0;
  background: var(--bg-alt);
}

.deck.is-ready .deck-notes { width: min(100% - 32px, max(calc((100svh - var(--stage-reserve)) * 16 / 9), 520px)); }

.deck-notes p { margin: 0; }
.deck-notes p + p { margin-top: 0.8em; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Full screen ---------- */

.deck:fullscreen {
  --stage-reserve: 100px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 16px 0;
  background: var(--hero-bg);
  color: var(--hero-text);
}

.deck.notes-open:fullscreen { --stage-reserve: calc(100px + 28vh); }

.deck:fullscreen .slide { border-radius: 0; box-shadow: none; }

.deck:fullscreen .deck-notes {
  max-height: 26vh;
  overflow-y: auto;
  background: #161b21;
  color: #d6dde5;
}

.deck:fullscreen .deck-button {
  border-color: rgb(255 255 255 / 0.15);
  background: transparent;
  color: var(--hero-text);
}

.deck:fullscreen .deck-button[aria-pressed="true"] {
  background: var(--neon);
  color: var(--accent-text);
}

.deck:fullscreen .deck-count { color: var(--hero-muted); }
.deck:fullscreen .deck-progress { background: rgb(255 255 255 / 0.12); }

/* ---------- Narrow screens ---------- */

/* Phones held upright: a 16:9 slide would be too small to read, so slides
   get a normal text size and grow with their content. */
@media (max-width: 640px) {
  .slide {
    --u: 6.4px;
    aspect-ratio: auto;
    min-height: 60svh;
    padding: 28px 22px;
  }

  .slide-split { grid-template-columns: 1fr; row-gap: 24px; }
  .slide-split .slide-media { order: -1; }

  .slide ol { grid-auto-flow: row; }

  .slide-title { align-content: start; padding-top: 0; }
  .slide-title .slide-text { max-width: none; }
  .slide-title .slide-media {
    order: -1;
    position: relative;
    inset: auto;
    width: auto;
    height: 46svh;
    margin: 0 -22px 8px;
  }
  .slide-title .slide-media img {
    -webkit-mask-image: linear-gradient(180deg, #000 60%, transparent);
    mask-image: linear-gradient(180deg, #000 60%, transparent);
  }

  .slide td:first-child { width: 34%; }

  .deck.is-ready .deck-stage,
  .deck.is-ready .deck-controls,
  .deck.is-ready .deck-notes { width: calc(100% - 32px); }
}

/* ---------- Print: one slide per landscape page ---------- */

@media print {
  @page {
    size: landscape;
    margin: 0.8cm;
  }

  .site-header,
  .site-footer,
  .skip-link,
  .deck-controls,
  .deck-notes { display: none !important; }

  body { background: #ffffff; }

  .deck { padding: 0; }

  .deck .deck-stage,
  .deck.is-ready .deck-stage {
    display: block;
    width: 100%;

  }

  .deck .slide,
  .deck.is-ready .slide {
    --u: 1cqw;
    aspect-ratio: 16 / 9;
    min-height: 0;
    padding: 5% 7%;
    opacity: 1;
    visibility: visible;
    transition: none;
    box-shadow: none;
    break-inside: avoid;
    break-after: page;
  }

  .deck .slide:last-child { break-after: auto; }
}
