:root {
  --bg: #0f1b2d;
  --bg-raised: #17263d;
  --text: #f5f1e8;
  --muted: #b8c2d1;
  --accent: #f2b84b;
  --accent-soft: rgba(242, 184, 75, 0.14);
  --line: rgba(245, 241, 232, 0.14);
  --serif: Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-snap-type: y proximity;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.2rem);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
}

/* Progress */
.progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--line);
  z-index: 10;
}

.progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.4s var(--ease);
}

/* Controls */
.controls {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 999px;
  z-index: 10;
  font-size: 0.9rem;
}

.controls button {
  font: inherit;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  cursor: pointer;
}

.controls button:hover,
.controls button[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.controls button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.controls kbd {
  font-family: var(--sans);
  font-size: 0.75rem;
  opacity: 0.7;
}

#counter {
  min-width: 4.5ch;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

/* Slides */
.slide {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(2rem, 6vw, 5rem) clamp(1.25rem, 6vw, 6rem);
  scroll-snap-align: start;
  border-bottom: 1px solid var(--line);
}

.inner {
  width: min(100%, 60rem);
}

.slide--title {
  background:
    radial-gradient(circle at 85% 15%, var(--accent-soft), transparent 45%),
    var(--bg);
}

.slide--closing {
  background:
    radial-gradient(circle at 15% 85%, var(--accent-soft), transparent 45%),
    var(--bg);
}

.eyebrow {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 1.25rem;
}

h1 {
  font-size: clamp(2.4rem, 1.5rem + 4.5vw, 5rem);
  max-width: 18ch;
}

h2 {
  font-size: clamp(2rem, 1.2rem + 3vw, 3.6rem);
  max-width: 24ch;
}

h3 {
  font-size: 1.35rem;
  color: var(--accent);
}

.lede {
  font-size: clamp(1.15rem, 1rem + 0.8vw, 1.6rem);
  color: var(--muted);
  max-width: 40ch;
}

.muted {
  color: var(--muted);
}

.stack {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  display: grid;
  gap: 0.9rem;
  max-width: 46rem;
}

.stack li {
  padding-left: 1.4rem;
  position: relative;
  font-size: clamp(1.1rem, 1rem + 0.6vw, 1.5rem);
}

.stack li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--accent);
}

/* 5W1H and work-as-worship grids */
dl {
  margin: 1.5rem 0 0;
  display: grid;
  gap: 1rem;
}

dl > div {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 1.1rem 1.25rem;
}

dt {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.3rem;
}

dd {
  margin: 0;
  color: var(--text);
}

.grid-6 {
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
}

/* Timeline */
.timeline {
  display: grid;
  gap: 1.25rem;
  margin-top: 1.5rem;
  border-left: 2px solid var(--accent);
  padding-left: 1.75rem;
}

.milestone {
  position: relative;
  display: grid;
  gap: 0.2rem;
}

.milestone::before {
  content: "";
  position: absolute;
  left: calc(-1.75rem - 0.45rem - 1px);
  top: 0.45rem;
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}

.when {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.6rem);
  font-weight: 700;
  color: var(--accent);
}

.what {
  color: var(--text);
  font-size: clamp(1.05rem, 1rem + 0.5vw, 1.35rem);
}

/* Problem / idea / reach */
.triptych {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.triptych > div {
  border-top: 3px solid var(--accent);
  padding-top: 1rem;
}

.triptych p {
  margin: 0;
  font-size: clamp(1.1rem, 1rem + 0.6vw, 1.4rem);
}

/* Jonah shift */
.shift {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin: 0 0 1.5rem;
  font-family: var(--serif);
  font-size: clamp(1.5rem, 1.1rem + 2vw, 2.6rem);
  font-weight: 700;
}

.shift .from {
  margin: 0;
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: var(--accent);
}

.shift .arrow {
  margin: 0;
  color: var(--accent);
}

.shift .to {
  margin: 0;
}

/* Reveal motion: children animate in when their slide becomes current */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.7s var(--ease),
    transform 0.7s var(--ease);
}

.slide.is-current .reveal {
  opacity: 1;
  transform: none;
}

.slide.is-current .reveal:nth-child(2) { transition-delay: 0.1s; }
.slide.is-current .reveal:nth-child(3) { transition-delay: 0.2s; }
.slide.is-current .reveal:nth-child(4) { transition-delay: 0.3s; }

.scroll-hint {
  margin-top: 2.5rem;
  font-size: 0.9rem;
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.7s var(--ease) 0.6s;
}

.slide--title.is-current .scroll-hint {
  opacity: 0.8;
}

/* Speaker notes */
.notes {
  position: absolute;
  left: clamp(1.25rem, 6vw, 6rem);
  right: clamp(1.25rem, 6vw, 6rem);
  bottom: 5.5rem;
  max-width: 48rem;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  background: var(--bg-raised);
  border: 1px solid var(--accent);
  border-radius: 0.75rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.notes[hidden] {
  display: none;
}

.notes p {
  margin: 0 0 0.75rem;
}

.notes p:last-child {
  margin-bottom: 0;
}

.time-badge {
  position: absolute;
  top: 1.5rem;
  right: clamp(1.25rem, 6vw, 6rem);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
}

body.notes-on .notes {
  display: block;
}

/* Course video */
.slide--video video {
  display: block;
  width: 100%;
  max-height: 70vh;
  margin-top: 1.25rem;
  border-radius: 0.75rem;
  border: 1px solid var(--line);
  background: #000;
}

/* Index (/): uses the same palette and type as the presentation decks */
.index-page {
  --paper: var(--bg);
  --ink: var(--text);
  --ink-muted: var(--muted);
  --brick: var(--accent);
  --rule: var(--line);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  line-height: 1.55;
}

.index {
  width: min(100% - 3rem, 68rem);
  margin: 0 auto;
  padding: clamp(3.5rem, 10vw, 7rem) 0 clamp(3rem, 8vw, 5rem);
}

.index h1 {
  font-family: var(--serif);
  font-size: clamp(2.25rem, 1.6rem + 2.5vw, 3.25rem);
  font-weight: 700;
  line-height: 1.15;
  margin: 0;
  color: var(--ink);
}

.index .dek {
  margin: 0.5rem 0 0;
  color: var(--ink-muted);
}

.thumb-grid {
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
}

.thumb-grid li {
  min-width: 0;
}

.thumb-card {
  display: block;
  background: var(--bg-raised);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 0.5rem;
  color: inherit;
  text-decoration: none;
}

.thumb-card img,
.thumb-fallback {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 4px;
  background: var(--bg);
}

.thumb-fallback {
  display: grid;
  place-items: center;
  font-size: 1.75rem;
  color: var(--accent);
}

.thumb-meta {
  display: grid;
  gap: 0.15rem;
  margin: 0.6rem 0 0.5rem;
}

.thumb-meta .num {
  font-variant-numeric: lining-nums tabular-nums;
  font-size: 0.8rem;
  color: var(--brick);
}

.thumb-title {
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.3;
}

.thumb-view {
  display: block;
  margin-top: 0.5rem;
  text-align: center;
  font-size: 0.8rem;
  padding: 0.3rem 0;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--bg);
}

.thumb-card:hover .thumb-view {
  border-color: var(--accent);
}

.thumb-card:focus-visible {
  outline: 2px solid var(--brick);
  outline-offset: 3px;
}

.thumb-grid .empty {
  color: var(--ink-muted);
}

.home-link {
  color: var(--text);
  text-decoration: none;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
}

.home-link:hover {
  background: var(--accent-soft);
}

/* Small screens */
@media (max-width: 640px) {
  .controls {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    bottom: 0.75rem;
  }

  .notes {
    bottom: 5rem;
    font-size: 0.85rem;
    max-height: 40vh;
    overflow: auto;
  }

  .time-badge {
    top: 1rem;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal,
  .scroll-hint,
  .progress span {
    transition: none;
    transform: none;
    opacity: 1;
  }
}
