/* THE FIVE GATES OF GRIEF — Miracle Academy slide deck
   Dark cinematic treatment. No-JS safe: hidden states gated behind html.js. */

:root {
  /* ChristCode — Watchers night register (watchers.christcode.ai) */
  --ink: #F4F2EE;
  --ink-soft: rgba(244, 242, 238, 0.74);
  --ink-faint: rgba(244, 242, 238, 0.5);
  --gold: #F4C430;
  --gold-soft: rgba(244, 196, 48, 0.92);
  --ember: #CC5733;
  --cover: #241F18;
  --line: rgba(244, 242, 238, 0.16);
  /* epistemic lanes — documented / inference / hypothesis */
  --doc: #93C09A;
  --inf: #E0B15A;
  --hyp: #E08A68;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-snap-type: y proximity;
  background: #241F18;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: #241F18;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ---------- film grain ---------- */
.grain {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- progress bar ---------- */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 70;
  background: rgba(244, 241, 232, 0.08);
}
.progress span {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.12s linear;
}

/* ---------- pager (right) ---------- */
.pager {
  position: fixed;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 70;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pager-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: background 0.3s, transform 0.3s, border-color 0.3s;
}
.pager-dot:hover { border-color: var(--ink-faint); }
.pager-dot.active {
  background: var(--gold);
  border-color: var(--gold);
  transform: scale(1.25);
}
@media (max-width: 720px) {
  .pager { right: 12px; gap: 10px; }
  .pager-dot { width: 7px; height: 7px; }
}

/* ---------- deck + slides ---------- */
.deck { position: relative; }

.slide {
  position: relative;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
  background-color: #0d0a06;
}

/* legibility scrim — the copy lives bottom-LEFT, so darken the left and the
   top (brand) + bottom (text baseline); the image's light shows on the right */
.scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg,
      rgba(9, 6, 3, 0.88) 0%,
      rgba(9, 6, 3, 0.72) 26%,
      rgba(9, 6, 3, 0.42) 50%,
      rgba(9, 6, 3, 0.14) 72%,
      rgba(9, 6, 3, 0.0) 92%),
    linear-gradient(180deg,
      rgba(9, 6, 3, 0.60) 0%,
      rgba(9, 6, 3, 0.12) 30%,
      rgba(9, 6, 3, 0.18) 56%,
      rgba(9, 6, 3, 0.55) 80%,
      rgba(7, 5, 2, 0.92) 100%);
}

/* title slide: centered text → a dark horizontal band across the middle */
.slide--title .scrim {
  background:
    linear-gradient(180deg,
      rgba(9, 6, 3, 0.30) 0%,
      rgba(9, 6, 3, 0.68) 32%,
      rgba(9, 6, 3, 0.68) 64%,
      rgba(9, 6, 3, 0.42) 100%),
    radial-gradient(120% 120% at 50% 50%,
      rgba(7, 5, 2, 0.12) 0%,
      rgba(7, 5, 2, 0.44) 62%,
      rgba(6, 4, 2, 0.84) 100%);
}

/* ---------- brand mark (dark-grounds cloud lockup) ---------- */
.brand {
  position: absolute;
  top: 4.2vh;
  left: 5vw;
  z-index: 4;
}
.brand img {
  height: 30px;
  width: auto;
  display: block;
  opacity: 0.92;
}
@media (max-width: 720px) {
  .brand { top: 20px; left: 20px; }
  .brand img { height: 22px; }
}

/* ---------- ghost gate number ---------- */
.gate-num {
  position: absolute;
  top: 2.5vh;
  right: 4vw;
  z-index: 2;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 700;
  font-size: clamp(6rem, 22vw, 17rem);
  line-height: 0.8;
  color: rgba(244, 241, 232, 0.06);
  letter-spacing: -0.02em;
  pointer-events: none;
  user-select: none;
}

/* ---------- slide content ---------- */
.slide-inner {
  position: absolute;
  z-index: 3;
  left: 5vw;
  right: 5vw;
  bottom: 11vh;
  max-width: 860px;
}

.kicker {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--gold-soft);
  margin-bottom: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}
.kicker::before {
  content: "";
  width: 34px;
  height: 1px;
  background: var(--gold-soft);
  flex: 0 0 auto;
}

/* ---------- epistemic lane tag ---------- */
.lane {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 3px 9px 4px;
  border-radius: 3px;
  border: 1px solid currentColor;
  margin-left: 0.6rem;
  vertical-align: middle;
  line-height: 1;
}
.lane-doc { color: var(--doc); }
.lane-inf { color: var(--inf); }
.lane-hyp { color: var(--hyp); }

.gate-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 600;
  font-size: clamp(2.5rem, 6.4vw, 5rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 1.6rem;
  text-wrap: balance;
  text-shadow: 0 2px 28px rgba(0, 0, 0, 0.62), 0 1px 3px rgba(0, 0, 0, 0.55);
}

.points {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-width: 640px;
}
.points li {
  position: relative;
  padding-left: 1.5rem;
  font-size: clamp(1.02rem, 1.5vw, 1.32rem);
  line-height: 1.5;
  color: var(--ink-soft);
  font-weight: 300;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.6), 0 1px 2px rgba(0, 0, 0, 0.55);
}
.points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
}

/* ---------- case-file reference (light pointer to the full document) ---------- */
.case-file {
  margin-top: 1.9rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}
.case-file a {
  color: var(--gold-soft);
  text-decoration: none;
  border-bottom: 1px solid rgba(244, 196, 48, 0.4);
  transition: color 0.3s, border-color 0.3s;
}
.case-file a:hover {
  color: var(--gold);
  border-color: var(--gold);
}

/* ---------- title slide ---------- */
.slide--title .slide-inner {
  left: 0;
  right: 0;
  bottom: auto;
  top: 50%;
  transform: translateY(-50%);
  max-width: 1000px;
  margin: 0 auto;
  text-align: center;
  padding: 0 6vw;
}
.slide--title .kicker {
  justify-content: center;
  margin-bottom: 1.5rem;
}
.slide--title .kicker::before { display: none; }
.title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 600;
  font-size: clamp(3rem, 9.5vw, 7rem);
  line-height: 0.98;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-bottom: 1.4rem;
  text-shadow: 0 2px 34px rgba(0, 0, 0, 0.66), 0 1px 3px rgba(0, 0, 0, 0.55);
}
.subtitle {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.2rem, 2.4vw, 1.8rem);
  color: var(--ink-soft);
  margin-bottom: 2.4rem;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.6), 0 1px 2px rgba(0, 0, 0, 0.55);
}
.hint {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.hint .key {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 7px;
  margin: 0 2px;
  color: var(--ink-soft);
}

/* ---------- close slide ---------- */
.slide--close .slide-inner { max-width: 780px; }
.signoff {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  color: var(--gold-soft);
  margin: 1.8rem 0 1.4rem;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.6), 0 1px 2px rgba(0, 0, 0, 0.5);
}
.cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.98rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--gold-soft);
  border-radius: 999px;
  padding: 0.85rem 1.5rem;
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}
.cta b { font-weight: 600; color: var(--gold-soft); }
.cta:hover {
  background: var(--gold-soft);
  border-color: var(--gold-soft);
  color: #1a1509;
}
.cta:hover b { color: #1a1509; }

/* ---------- reveal (gated on html.js; double safety net in JS) ---------- */
html.js .reveal {
  opacity: 0;
  transform: translateY(26px);
}
html.js .reveal.in {
  opacity: 1;
  transform: none;
  transition: opacity 0.95s cubic-bezier(0.2, 0.7, 0.2, 1),
              transform 0.95s cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js .reveal { opacity: 1; transform: none; }
  .progress span { transition: none; }
}

/* ---------- small screens ---------- */
@media (max-width: 720px) {
  .slide-inner { bottom: 8vh; }
  .gate-num { font-size: clamp(4rem, 30vw, 8rem); top: 1.5vh; right: 4vw; }
  .points li { font-size: 1rem; }
}
