:root {
  --paper: #f7f0e4;
  --paper-strong: #fff9f0;
  --ink: #1e1c1a;
  --ink-soft: #5f584f;
  --accent: #b83a2f;
  --accent-soft: rgba(184, 58, 47, 0.14);
  --accent-gold: #d9a441;
  --accent-green: #1f6a5f;
  --line: rgba(30, 28, 26, 0.12);
  --shadow: 0 22px 70px rgba(30, 28, 26, 0.18);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(217, 164, 65, 0.22), transparent 34%),
    radial-gradient(circle at bottom right, rgba(31, 106, 95, 0.2), transparent 28%),
    linear-gradient(160deg, #efe3cf 0%, #f7f0e4 48%, #efe5d7 100%);
  overflow: hidden;
}

body.deck-body::before,
body.landing-body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(30, 28, 26, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30, 28, 26, 0.025) 1px, transparent 1px);
  background-size: 36px 36px;
  pointer-events: none;
}

a {
  color: inherit;
  text-decoration: none;
}

.landing-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}

.landing-panel {
  width: min(1120px, 100%);
  display: grid;
  gap: 24px;
}

.landing-hero,
.landing-grid > a,
.slide,
.floating-toolbar,
.control-strip,
.dots {
  background: rgba(255, 249, 240, 0.82);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow);
}

.landing-hero {
  border-radius: 36px;
  padding: 42px;
  position: relative;
  overflow: hidden;
}

.landing-hero::after {
  content: "";
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  right: -110px;
  top: -90px;
  background: radial-gradient(circle, rgba(184, 58, 47, 0.22), transparent 64%);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}

.landing-title,
.slide h1,
.slide h2,
.metric-value,
.diagram-node strong {
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  letter-spacing: -0.03em;
}

.landing-title {
  margin: 18px 0 12px;
  font-size: clamp(44px, 8vw, 82px);
  line-height: 0.96;
  max-width: 820px;
}

.landing-copy {
  max-width: 760px;
  font-size: 20px;
  line-height: 1.65;
  color: var(--ink-soft);
}

.landing-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.landing-grid > a {
  border-radius: 28px;
  padding: 28px;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
  display: grid;
  gap: 12px;
}

.landing-grid > .landing-card {
  border-radius: 28px;
  padding: 28px;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
  display: grid;
  gap: 12px;
}

.landing-grid > a:hover,
.landing-grid > .landing-card:hover,
.landing-grid > a:focus-visible,
.landing-grid > .landing-card:focus-within,
.toolbar-link:hover,
.toolbar-link:focus-visible,
.control-button:hover,
.control-button:focus-visible,
.jump-link:hover,
.jump-link:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(184, 58, 47, 0.4);
  box-shadow: 0 18px 50px rgba(184, 58, 47, 0.18);
}

.landing-grid h2 {
  margin: 0;
  font-size: 28px;
}

.download-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  border: 1px solid rgba(184, 58, 47, 0.22);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.download-link:hover,
.download-link:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(184, 58, 47, 0.48);
  box-shadow: 0 12px 28px rgba(184, 58, 47, 0.15);
}

.landing-grid p,
.landing-grid li,
.landing-tip,
.speaker-note p,
.slide ul,
.slide ol,
.slide p {
  color: var(--ink-soft);
  line-height: 1.6;
}

.landing-grid ul,
.slide ul,
.slide ol {
  margin: 0;
  padding-left: 20px;
}

.landing-tip {
  font-size: 15px;
}

.deck-shell {
  min-height: 100vh;
  padding: 24px 24px 112px;
}

.deck-frame {
  position: relative;
  height: calc(100vh - 136px);
}

.floating-toolbar {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: min(1180px, calc(100vw - 36px));
  border-radius: 18px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  z-index: 10;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.toolbar-brand {
  font-weight: 800;
  letter-spacing: 0.04em;
}

.toolbar-link {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--ink-soft);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.toolbar-status {
  font-size: 14px;
  color: var(--ink-soft);
}

.slides {
  position: relative;
  height: 100%;
}

.slide {
  position: absolute;
  inset: 0;
  border-radius: 32px;
  padding: clamp(34px, 4vw, 56px);
  display: grid;
  gap: 26px;
  opacity: 0;
  transform: translateX(40px) scale(0.985);
  pointer-events: none;
  transition: opacity 260ms ease, transform 260ms ease;
  overflow: auto;
}

.slide.active {
  opacity: 1;
  transform: translateX(0) scale(1);
  pointer-events: auto;
}

.slide h1,
.slide h2 {
  margin: 0;
  font-size: clamp(42px, 6vw, 72px);
  line-height: 1.02;
}

.slide h2 {
  font-size: clamp(36px, 5vw, 58px);
}

.slide-subtitle {
  font-size: clamp(19px, 2.4vw, 28px);
  max-width: 900px;
  color: var(--ink-soft);
}

.lede {
  font-size: 22px;
  max-width: 980px;
  color: var(--ink);
}

.grid-two,
.grid-three,
.metric-grid,
.command-grid {
  display: grid;
  gap: 18px;
}

.grid-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.command-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel,
.metric,
.command-card,
.speaker-note,
.diagram-node,
.timeline-item,
.fact-card,
.highlight-card {
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  padding: 22px;
}

.panel h3,
.speaker-note h3,
.metric-label,
.command-card h3,
.timeline-item h3,
.fact-card h3,
.highlight-card h3 {
  margin: 0 0 12px;
}

.panel h3,
.speaker-note h3,
.command-card h3,
.timeline-item h3,
.fact-card h3,
.highlight-card h3 {
  font-size: 21px;
}

.panel strong,
.slide strong {
  color: var(--ink);
}

.metric {
  display: grid;
  gap: 10px;
  align-content: start;
}

.metric-label {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 800;
}

.metric-value {
  font-size: clamp(36px, 4vw, 52px);
  line-height: 1;
}

.metric-copy {
  color: var(--ink-soft);
}

.diagram {
  display: flex;
  gap: 18px;
  align-items: stretch;
  flex-wrap: wrap;
}

.diagram-node {
  flex: 1 1 220px;
  min-height: 140px;
  display: grid;
  gap: 10px;
  align-content: start;
}

.diagram-node em {
  font-style: normal;
  color: var(--accent);
  font-weight: 800;
}

.diagram-arrow {
  align-self: center;
  font-size: 40px;
  color: var(--accent);
  font-weight: 700;
}

.code-block {
  padding: 18px 20px;
  border-radius: 18px;
  background: #201c19;
  color: #f8f0e3;
  font-family: "SFMono-Regular", "Menlo", "Consolas", monospace;
  font-size: 15px;
  line-height: 1.6;
  overflow: auto;
}

.tag-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tag {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
}

.speaker-note {
  border-left: 6px solid var(--accent-gold);
  background: rgba(255, 250, 239, 0.95);
}

.speaker-note h3 {
  color: var(--accent);
}

.timeline {
  display: grid;
  gap: 14px;
}

.timeline-item {
  display: grid;
  gap: 8px;
  grid-template-columns: auto 1fr;
  align-items: start;
}

.timeline-number {
  min-width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--accent);
  color: #fff7ed;
  font-weight: 800;
  font-size: 18px;
}

.timeline-copy {
  display: grid;
  gap: 4px;
}

.command-card .code-block {
  margin-top: 12px;
}

.fact-card {
  position: relative;
  overflow: hidden;
}

.fact-card::after {
  content: "";
  position: absolute;
  inset: auto -24px -24px auto;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(31, 106, 95, 0.18), transparent 68%);
}

.highlight-card {
  background: linear-gradient(155deg, rgba(184, 58, 47, 0.08), rgba(255, 255, 255, 0.84));
}

.result-line {
  font-family: "SFMono-Regular", "Menlo", "Consolas", monospace;
  font-size: 14px;
  color: var(--ink);
}

.control-strip {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  width: min(760px, calc(100vw - 36px));
  border-radius: 20px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 11;
}

.control-button,
.jump-link {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink);
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.control-button[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.dots {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 999px;
  padding: 12px 10px;
  display: grid;
  gap: 10px;
  z-index: 11;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 0;
  background: rgba(30, 28, 26, 0.18);
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease;
}

.dot.active {
  background: var(--accent);
  transform: scale(1.2);
}

.jump-links {
  display: flex;
  gap: 8px;
  overflow: auto;
  padding-bottom: 2px;
}

.jump-link.active {
  background: var(--accent);
  color: #fff7ed;
  border-color: transparent;
}

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

@media (max-width: 980px) {
  body {
    overflow: auto;
  }

  .deck-shell {
    padding: 92px 16px 132px;
  }

  .deck-frame {
    height: auto;
    min-height: calc(100vh - 220px);
  }

  .slide {
    position: relative;
    min-height: calc(100vh - 240px);
  }

  .grid-two,
  .grid-three,
  .metric-grid,
  .command-grid {
    grid-template-columns: 1fr;
  }

  .diagram {
    flex-direction: column;
  }

  .diagram-arrow {
    align-self: start;
    transform: rotate(90deg);
    margin-left: 8px;
  }

  .floating-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .dots {
    display: none;
  }

  .landing-grid {
    grid-template-columns: 1fr;
  }
}
