/* Story mode — one place per chapter, full screen, scroll-driven.
   Chapter media is sticky inside its section, so the next chapter's photo
   slides up and covers the previous one. */

.story-page {
  background: var(--ink);
  overflow-x: hidden;
}

.story-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 70;
  background: rgba(244, 239, 231, 0.08);
}
.story-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(to right, var(--accent), var(--accent-2));
}

.story-hud {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px var(--gut) 0;
  pointer-events: none;
}
.story-hud a { pointer-events: auto; }
.hud-right { display: flex; align-items: center; gap: 12px; }
.hud-year {
  font-family: var(--serif);
  font-size: 1.05rem;
  letter-spacing: 0.22em;
  color: var(--paper);
  opacity: 0.75;
}
.hud-count {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- chapters ---------- */

.chapter {
  position: relative;
  height: 190vh;
  background: var(--ink);
}
.chapter:last-of-type { height: 150vh; }

.chapter-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.chapter-media {
  position: absolute;
  inset: 0;
  will-change: transform;
}
.chapter-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.14);
  filter: saturate(1.02);
}

.chapter-veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 60% at 50% 45%, rgba(8, 9, 12, 0.15), rgba(8, 9, 12, 0.72) 100%),
    linear-gradient(to top, rgba(8, 9, 12, 0.88), rgba(8, 9, 12, 0.25) 55%, rgba(8, 9, 12, 0.5));
}

.chapter-text {
  position: relative;
  z-index: 2;
  width: min(760px, 86vw);
  text-align: center;
  color: var(--paper);
  will-change: transform, opacity;
}

.ch-kicker {
  margin: 0 0 14px;
  font-size: 0.74rem;
  letter-spacing: 0.36em;
  text-transform: uppercase;
  color: var(--accent);
}

.ch-name {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.4rem, 9vw, 5rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  text-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}

.ch-caption {
  margin: 18px auto 0;
  max-width: 44ch;
  color: rgba(244, 239, 231, 0.82);
  font-size: clamp(0.95rem, 2.4vw, 1.08rem);
  line-height: 1.6;
}

.ch-meta {
  margin: 20px 0 0;
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(244, 239, 231, 0.62);
  font-variant-numeric: tabular-nums;
}

.ch-cta {
  display: inline-block;
  margin-top: 26px;
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  background: var(--accent);
  border-radius: 999px;
  padding: 11px 22px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.ch-cta:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -12px rgba(232, 176, 106, 0.7); }

/* chapter dots down the right edge */
.chapter-dots {
  position: fixed;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chapter-dots button {
  width: 7px;
  height: 7px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(244, 239, 231, 0.5);
  background: transparent;
  cursor: pointer;
  transition: transform 0.25s ease, background 0.25s ease;
}
.chapter-dots button[aria-current="true"] {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.5);
}

/* ---------- intro + outro ---------- */

.chapter-intro { height: 100vh; }
.chapter-intro .chapter-sticky { background: radial-gradient(700px 500px at 50% 20%, rgba(232, 176, 106, 0.12), transparent 60%), var(--ink); }
.intro-title { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(2.6rem, 9vw, 5rem); line-height: 1; }
.intro-line { max-width: 42ch; margin: 20px auto 0; color: var(--muted); }
.intro-count { margin-top: 16px; font-size: 0.78rem; letter-spacing: 0.2em; text-transform: uppercase; color: rgba(244, 239, 231, 0.6); }
.story-scroll-hint { margin-top: 40px; font-size: 0.78rem; color: var(--muted); animation: float 2.6s ease-in-out infinite; }

.chapter-outro { height: 100vh; }
.chapter-outro .chapter-sticky { background: var(--ink); }
.outro-title { font-family: var(--serif); font-size: clamp(1.6rem, 5vw, 2.6rem); margin: 0; }
.outro-link {
  display: inline-block;
  margin-top: 20px;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 3px;
}
.outro-link:hover { color: var(--paper); }

/* reveal states (JS adds .in when a chapter's text should be readable) */
.chapter .chapter-text { opacity: 0; }
.chapter.in .chapter-text { opacity: 1; }
.chapter-text > * { opacity: 0; transform: translateY(22px); transition: opacity 0.7s ease, transform 0.9s cubic-bezier(0.16, 0.84, 0.24, 1); }
.chapter.in .ch-kicker { opacity: 1; transform: none; transition-delay: 0.05s; }
.chapter.in .ch-name { opacity: 1; transform: none; transition-delay: 0.16s; }
.chapter.in .ch-caption { opacity: 1; transform: none; transition-delay: 0.28s; }
.chapter.in .ch-meta { opacity: 1; transform: none; transition-delay: 0.36s; }
.chapter.in .ch-cta { opacity: 1; transform: none; transition-delay: 0.44s; }
.chapter-intro .chapter-text { opacity: 1; }
.chapter-intro .intro-text > * { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .chapter { height: 175vh; }
  .chapter-text { width: 88vw; }
  .ch-name { font-size: clamp(2.2rem, 12vw, 3.4rem); }
  .chapter-dots { right: 8px; gap: 8px; }
  .story-hud { padding: 14px 16px 0; }
}

@media (prefers-reduced-motion: reduce) {
  .chapter-media img { transform: none !important; }
  .chapter-text > * { transition: opacity 0.3s ease; transform: none !important; }
  .story-scroll-hint { animation: none; }
}
