/* ===================================================================
   Chapter page — scrollytelling layout
   =================================================================== */

.chapter-page {
  position: relative;
}

/* ===== Hero / chapter opener ===== */
.chapter-hero {
  height: 100vh;
  min-height: 700px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.chapter-hero-bg {
  position: absolute;
  inset: -10%;
  background:
    radial-gradient(ellipse at 30% 40%, rgba(90, 14, 14, 0.6) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 60%, rgba(20, 8, 8, 0.8) 0%, transparent 60%), var(--bg);
  will-change: transform;
}

.chapter-hero-grain {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='400' height='400'><filter id='n'><feTurbulence type='turbulence' baseFrequency='0.02' numOctaves='3' seed='3'/><feColorMatrix values='0 0 0 0 0.4  0 0 0 0 0.05  0 0 0 0 0.05  0 0 0 0.5 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  opacity: 0.4;
  mix-blend-mode: multiply;
}

.chapter-hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 800px;
  padding: 0 40px;
}

.chapter-numeral-frame {
  position: relative;
  width: 280px;
  height: 280px;
  margin: 0 auto 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chapter-numeral-frame svg.ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  animation: slow-rotate 120s linear infinite;
}
.chapter-numeral {
  font-family: var(--font-display);
  font-size: 180px;
  font-weight: 300;
  font-style: italic;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -0.02em;
  text-shadow: 0 0 40px rgba(185, 28, 28, 0.4);
  position: relative;
  z-index: 2;
}

@keyframes slow-rotate {
  to {
    transform: rotate(360deg);
  }
}

.chapter-kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 16px;
}
.chapter-kicker .accent {
  color: var(--accent);
}

.chapter-title {
  font-family: var(--font-display);
  font-size: clamp(48px, 7vw, 96px);
  font-weight: 400;
  font-style: italic;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--paper);
  margin-bottom: 32px;
}
.chapter-title .typed-cursor {
  display: inline-block;
  width: 0.5ch;
  background: var(--accent);
  animation: blink 0.8s steps(2, end) infinite;
  margin-left: 4px;
  height: 0.9em;
  vertical-align: -0.1em;
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}

.chapter-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.chapter-meta .dot {
  color: var(--accent);
}

.scroll-cue {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-faint);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  animation: bob 2.5s ease-in-out infinite;
}
.scroll-cue::after {
  content: "";
  width: 1px;
  height: 32px;
  background: linear-gradient(to bottom, var(--accent), transparent);
}
@keyframes bob {
  0%,
  100% {
    transform: translate(-50%, 0);
    opacity: 0.6;
  }
  50% {
    transform: translate(-50%, 6px);
    opacity: 1;
  }
}

/* ===== Prose body ===== */
.chapter-body {
  margin: 0 auto;
  position: relative;

  .column-container {
    margin: 0 auto;
    padding: 0 40px;
    max-width: 680px;
    &:first-of-type {
      padding-top: 120px;
    }
    &:last-of-type {
      padding-top: 60px;
    }
  }
}

.chapter-body p {
  font-family: var(--font-body);
  font-size: 21px;
  line-height: 1.75;
  color: var(--ink);
  margin-bottom: 1.6em;
  text-wrap: pretty;
}

.prose.capitalise p:first-of-type::first-letter {
  font-family: var(--font-display);
  font-size: 5.5em;
  font-style: italic;
  font-weight: 400;
  float: left;
  line-height: 0.85;
  margin: 0.05em 0.12em 0 -0.05em;
  color: var(--accent);
}

.chapter-body .pull {
  font-family: var(--font-display);
  font-size: 38px;
  font-style: italic;
  font-weight: 400;
  line-height: 1.25;
  color: var(--paper);
  margin: 80px -40px;
  padding: 0 40px;
  position: relative;
  text-wrap: balance;
}
.chapter-body .pull::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent);
}

.chapter-body .key-line,
.chapter-body em {
  //font-family: var(--font-display);
  font-style: italic;
  color: var(--accent-bright);
}

/* ===== Pinned full-bleed section ===== */
.pinned-section {
  height: 250vh;
  position: relative;
}
.pinned-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg-2);
}
.pinned-bg {
  position: absolute;
  inset: -15% 0;
  background-size: cover;
  background-position: center;
  opacity: 0.5;
  filter: contrast(1.2) brightness(0.5);
}
.pinned-bg.t1 {
  background:
    radial-gradient(circle at 20% 80%, rgba(185, 28, 28, 0.3), transparent 40%),
    radial-gradient(circle at 80% 20%, rgba(40, 12, 12, 0.8), transparent 50%),
    linear-gradient(180deg, #0a0707 0%, #1a0a0a 50%, #0a0707 100%);
}
.pinned-overlay {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    90deg,
    transparent 0,
    transparent 80px,
    rgba(232, 226, 214, 0.02) 80px,
    rgba(232, 226, 214, 0.02) 81px
  );
}
.pinned-text {
  position: relative;
  z-index: 2;
  max-width: 800px;
  padding: 0 40px;
  text-align: center;
}
.pinned-text h2 {
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 72px);
  font-style: italic;
  font-weight: 400;
  line-height: 1.1;
  color: var(--paper);
  margin-bottom: 32px;
  text-wrap: balance;
}
.pinned-text p {
  font-family: var(--font-display);
  font-size: 22px;
  font-style: italic;
  color: var(--ink-dim);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.5;
}

/* ===== Section label ===== */
.section-label {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 680px;
  margin: 0 auto 40px;
  padding: 0 40px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
}
.section-label::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--accent);
}

/* ===== Image slot (abstract texture placeholder) ===== */
.texture-slot {
  width: 100%;
  height: 60vh;
  margin: 80px 0;
  position: relative;
  overflow: hidden;
}
.texture-slot.t-rust {
  background:
    radial-gradient(ellipse at 30% 50%, rgba(120, 30, 20, 0.4), transparent 60%),
    radial-gradient(ellipse at 70% 30%, rgba(40, 10, 10, 0.6), transparent 50%),
    linear-gradient(135deg, #1a0a0a, #0a0707);
}
.texture-slot.t-concrete {
  background:
    radial-gradient(circle at 20% 80%, rgba(60, 40, 35, 0.3), transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(20, 14, 14, 0.8), transparent 60%), #0d0908;
}
.texture-slot::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='400' height='400'><filter id='n'><feTurbulence type='turbulence' baseFrequency='0.015' numOctaves='4'/><feColorMatrix values='0 0 0 0 0.3  0 0 0 0 0.1  0 0 0 0 0.05  0 0 0 0.7 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  mix-blend-mode: multiply;
  opacity: 0.6;
}
.texture-slot .texture-caption {
  position: absolute;
  bottom: 20px;
  left: 24px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--ink-dim);
  z-index: 2;
}

/* ===== Marginalia / note ===== */
.note {
  margin: 60px auto;
  padding: 32px 40px;
  border-left: 2px solid var(--accent-deep);
  background: rgba(185, 28, 28, 0.04);
}
.note,
.note p {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-dim);
  letter-spacing: 0.02em;
}
.note .note-label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
