/* Shared deck engine styles. Every deck on slides.connermccarthy.com uses this file. */

@font-face { font-family: "Archivo"; src: url("fonts/archivo.woff2") format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("fonts/atkinson-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("fonts/atkinson-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/plexmono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/plexmono-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  color-scheme: light;
  --paper: #e8ebee;
  --panel: #f6f7f8;
  --ink: #172131;
  --muted: #566173;
  --line: #c3c9d1;
  --signal: #d9931f;
  --allow: #2b7d58;
  --block: #b23a2e;

  --display: "Archivo", "Arial Narrow", sans-serif;
  --text: "Atkinson Hyperlegible", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;

  /* One unit that tracks the 16:9 stage, so type scales with the screen it's projected on. */
  --u: min(1vw, 1.78vh);
  --pad: max(16px, calc(var(--u) * 6));
}

* { box-sizing: border-box; }

html, body { margin: 0; height: 100%; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: max(16px, calc(var(--u) * 1.75));
  line-height: 1.45;
  overflow: hidden;
}

/* ---------- Slides ---------- */

.deck { position: fixed; inset: 0; }

.slide {
  position: absolute;
  inset: 0;
  /* Room above for the rail and below for the controls; tall slides scroll instead of sliding under them. */
  padding: calc(var(--pad) * 0.5 + 3em) var(--pad) calc(var(--pad) * 0.5 + 2.5em);
  display: flex;
  flex-direction: column;
  justify-content: safe center;
  overflow-y: auto;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}

.slide.is-current {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.25s ease;
}

.slide h1, .slide h2 {
  font-family: var(--display);
  font-stretch: 112%;
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.01em;
  margin: 0 0 0.45em;
  max-width: 18ch;
  text-wrap: balance;
}

.slide h1 { font-size: max(40px, calc(var(--u) * 7)); }
.slide h2 { font-size: max(30px, calc(var(--u) * 4.2)); }

.slide h3 {
  font-family: var(--display);
  font-stretch: 100%;
  font-weight: 700;
  font-size: 1.1em;
  margin: 0 0 0.2em;
}

.slide p { margin: 0 0 0.8em; max-width: 34em; text-wrap: pretty; }
.slide .lede { font-size: 1.15em; color: var(--muted); max-width: 28em; }
.slide .small { font-size: 0.8em; color: var(--muted); }

code, pre { font-family: var(--mono); font-size: 0.85em; }
pre {
  margin: 0;
  padding: 0.9em 1.1em;
  background: var(--ink);
  color: var(--paper);
  border-radius: 6px;
  overflow-x: auto;
  line-height: 1.5;
}

/* Steps reveal one at a time before the deck moves on. */
.step { transition: opacity 0.3s ease, transform 0.3s ease; }
.step:not(.is-shown) { opacity: 0; transform: translateY(0.3em); }

/* ---------- Route rail: the deck's progress, drawn as the path a visit takes ---------- */

.rail {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  padding: calc(var(--pad) * 0.5) var(--pad) 0;
  pointer-events: none;
}

.rail ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(var(--stops, 5), 1fr);
  position: relative;
  font-size: 0.72em;
  color: var(--muted);
}

.rail ol::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0.55em;
  height: 2px;
  background: var(--line);
}

.rail li {
  position: relative;
  padding-top: 1.5em;
  transition: color 0.3s ease;
}

.rail li::before {
  content: "";
  position: absolute;
  top: 0.15em;
  left: 0;
  width: 0.8em;
  height: 0.8em;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--line);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.rail li.is-passed::before { background: var(--ink); border-color: var(--ink); }
.rail li.is-passed { color: var(--ink); }
.rail li[aria-current="step"]::before { background: var(--signal); border-color: var(--signal); }
.rail li[aria-current="step"] { color: var(--ink); font-weight: 700; }

.rail.is-off { opacity: 0.35; }

/* ---------- Chrome ---------- */

.controls {
  position: fixed;
  right: var(--pad);
  bottom: calc(var(--pad) * 0.45);
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 0.4em;
  font-size: 0.7em;
  color: var(--muted);
}

.controls button {
  font: inherit;
  font-size: 1.3em;
  line-height: 1;
  width: 2em;
  height: 2em;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
}

.controls button:disabled { opacity: 0.35; cursor: default; }

:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }

/* Speaker notes: press N. */
.notes { display: none; }
body.show-notes .slide.is-current .notes {
  display: block;
  position: fixed;
  left: var(--pad);
  right: calc(var(--pad) + 9em);
  bottom: calc(var(--pad) * 0.4);
  z-index: 3;
  max-height: 30vh;
  overflow-y: auto;
  padding: 0.7em 1em;
  background: var(--ink);
  color: var(--paper);
  border-radius: 6px;
  font-size: 0.75em;
}

@media (max-width: 700px) {
  .rail span { display: none; }
  .slide { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
}

@media print {
  body { overflow: visible; }
  .deck { position: static; }
  .slide { position: relative; visibility: visible; opacity: 1; height: 100vh; break-after: page; }
  .step:not(.is-shown) { opacity: 1; transform: none; }
  .controls { display: none; }
}
