/* Homepage: a ten-chapter cinematic sequence. Each .narrative-section is one frame.
   Shared chapter primitives (.frame, .chapter-head, .item-label) live here. */

/* ---------------------------------------------------------------------------
   Frame system
--------------------------------------------------------------------------- */

.narrative-section {
  position: relative;
  display: grid;
  align-items: center;
  padding: clamp(3rem, 7svh, 5rem) 0;
}

.immersive-home .narrative-section {
  min-height: 100svh;
}

.frame {
  width: min(100% - 3rem, var(--content));
  margin-inline: auto;
  transform: translateY(var(--frame-base-y, 0px));
}

/* Pager feedback: the active frame nudges with scroll intent. */
.pager-intent .narrative-section.is-pager-active .frame {
  transform: translateY(calc(var(--frame-base-y, 0px) + var(--pager-nudge, 0px)));
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.chapter-head {
  max-width: 56rem;
}

.chapter-head-centered {
  margin-inline: auto;
  text-align: center;
}

.chapter-head-centered .chapter-slate {
  justify-content: center;
}

.chapter-lede {
  max-width: 58ch;
  color: var(--paper-2);
  font-size: clamp(1rem, 1.2vw, 1.12rem);
  line-height: 1.62;
}

.chapter-head-centered .chapter-lede {
  margin-inline: auto;
}

.item-label {
  display: block;
  margin-bottom: 0.55rem;
  color: var(--red);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ---------------------------------------------------------------------------
   Prologue: hero
--------------------------------------------------------------------------- */

.home-hero {
  --frame-base-y: clamp(-3rem, -6svh, -2rem);
}

.hero-frame {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr);
  gap: clamp(2.5rem, 5vw, 5rem);
  align-items: center;
}

/* Letterbox bars for the projector-start opening. Hidden by default; the
   motion system reveals and animates them on capable desktops only. */
.letterbox {
  display: none;
}

.home-hero h1 {
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
  font-size: clamp(2.7rem, min(9.5svh, 7vw), 5.2rem);
  line-height: 0.99;
}

.hero-line {
  display: block;
}

.home-hero .hero-body {
  max-width: 34rem;
}

.home-hero .entry-row {
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1.9rem;
}

.hero-archive {
  min-width: 0;
}

.map-plate {
  position: relative;
  padding: clamp(0.9rem, 1.6vw, 1.4rem);
  border: 1px solid var(--hairline);
  background: var(--coal);
  box-shadow: var(--shadow);
}

.thread-path {
  position: absolute;
  inset: clamp(0.9rem, 1.6vw, 1.4rem);
  width: calc(100% - 2 * clamp(0.9rem, 1.6vw, 1.4rem));
  height: calc(100% - 2 * clamp(0.9rem, 1.6vw, 1.4rem));
  pointer-events: none;
}

.thread-path path {
  fill: none;
  stroke: var(--red);
  stroke-width: 1.6;
  vector-effect: non-scaling-stroke;
  opacity: 0.85;
}

.thread-dot {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 5px rgba(224, 56, 46, 0.16);
}

/* Map dots reveal a small mono tag on hover: the map invites exploration. */
.thread-dot::after,
.preview-story-dot::after {
  content: "";
  position: absolute;
  inset: -10px;
}

.dot-tag {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.6rem);
  z-index: 2;
  padding: 0.32rem 0.6rem;
  border: 1px solid var(--hairline-strong);
  background: rgba(7, 6, 5, 0.95);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-50%) translateY(5px);
  transition: opacity 240ms ease, transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.thread-dot:hover,
.preview-story-dot:hover {
  /* Pause the pulse so the hover ring wins the cascade. */
  animation: none;
  background: var(--red-bright);
  box-shadow: 0 0 0 8px rgba(224, 56, 46, 0.22);
}

.thread-dot:hover .dot-tag,
.preview-story-dot:hover .dot-tag {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.dot-a {
  left: 21%;
  top: 67%;
}

.dot-b {
  left: 48%;
  top: 56%;
}

.dot-c {
  left: 84%;
  top: 36%;
}

.hero-index {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 1rem 0 0;
  padding-top: 0.9rem;
  border-top: 1px solid var(--hairline);
  color: var(--paper-3);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* ---------------------------------------------------------------------------
   01 Purpose: stacked head + three staggered columns
--------------------------------------------------------------------------- */

.purpose-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.6rem, 3vw, 2.8rem);
  margin-top: clamp(2rem, 6svh, 3.6rem);
}

.purpose-columns article {
  position: relative;
  padding-top: 1.15rem;
}

/* Drawn as a pseudo-element so the thread choreography can stitch it in. */
.purpose-columns article::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--red), rgba(224, 56, 46, 0.18));
}

.purpose-columns article:nth-child(2) {
  margin-top: clamp(1rem, 4svh, 2.4rem);
}

.purpose-columns article:nth-child(3) {
  margin-top: clamp(2rem, 8svh, 4.8rem);
}

.purpose-columns p {
  margin-bottom: 0;
  color: var(--paper-2);
  font-size: 0.95rem;
  line-height: 1.58;
}

/* ---------------------------------------------------------------------------
   02 Mission: copy beside a hairline 2x2 grid
--------------------------------------------------------------------------- */

.mission-frame {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.25fr);
  gap: clamp(2.4rem, 4.5vw, 4.5rem);
  align-items: center;
}

.mission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--hairline);
  border-top: 2px solid var(--red);
  background: var(--hairline);
}

.mission-grid article {
  padding: clamp(1.2rem, 2vw, 1.7rem);
  background: var(--night);
  transition: background 240ms ease;
}

.mission-grid article:hover {
  background: var(--coal);
}

.mission-grid h3 {
  font-size: 1.16rem;
}

.mission-grid p {
  margin-bottom: 0;
  color: var(--paper-2);
  font-size: 0.92rem;
  line-height: 1.55;
}

/* ---------------------------------------------------------------------------
   03 Audience: centered head + credit roll
--------------------------------------------------------------------------- */

.credit-roll {
  max-width: 62rem;
  margin: clamp(2rem, 6svh, 3.6rem) auto 0;
}

.credit-row {
  position: relative;
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 17rem) minmax(0, 1fr);
  gap: 1.6rem;
  align-items: baseline;
  padding: clamp(0.95rem, 2.4svh, 1.4rem) 0;
  border-top: 1px solid var(--hairline);
}

/* A short stretch of the red thread always visible; full width on hover. */
.credit-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: -1px;
  width: 5.2rem;
  height: 2px;
  background: var(--red);
  transform: scaleX(0.42);
  transform-origin: left;
  transition: transform 360ms cubic-bezier(0.22, 1, 0.36, 1);
}

.credit-row:hover::before {
  transform: scaleX(1);
}

.credit-row .item-label {
  margin-bottom: 0;
}

.credit-row h3 {
  margin-bottom: 0;
  font-size: 1.2rem;
}

.credit-row p {
  margin-bottom: 0;
  color: var(--paper-2);
  font-size: 0.92rem;
  line-height: 1.55;
}

/* ---------------------------------------------------------------------------
   04 Products: copy + film reel of the first lessons
--------------------------------------------------------------------------- */

.lessons-frame {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(2.4rem, 4.5vw, 4.5rem);
  align-items: center;
}

.format-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem 1.6rem;
  margin: 1.6rem 0 0.4rem;
}

.format-list dt {
  color: var(--red);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.format-list dd {
  margin: 0.25rem 0 0;
  color: var(--paper-2);
  font-size: 0.92rem;
  line-height: 1.45;
}

.lesson-reel {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: clamp(0.9rem, 2.4svh, 1.3rem);
  padding-left: 1.9rem;
}

.lesson-reel::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.4rem;
  bottom: 0.4rem;
  width: 1px;
  background: linear-gradient(180deg, var(--red), rgba(224, 56, 46, 0.12));
}

.reel-frame {
  display: flex;
  gap: 1.2rem;
  padding: clamp(1rem, 2svh, 1.35rem) 1.4rem;
  border: 1px solid var(--hairline);
  background: var(--coal);
  transition: border-color 220ms ease, transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.reel-frame:hover {
  border-color: var(--hairline-strong);
  transform: translateY(-2px);
}

.reel-frame:nth-child(2) {
  margin-left: clamp(0.8rem, 2.4vw, 2rem);
}

.reel-frame:nth-child(3) {
  margin-left: clamp(1.6rem, 4.8vw, 4rem);
}

.reel-index {
  color: var(--red);
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1;
}

.reel-body h3 {
  margin-bottom: 0.3rem;
  font-size: 1.12rem;
}

.reel-body p {
  margin-bottom: 0.45rem;
  color: var(--paper-2);
  font-size: 0.88rem;
}

.reel-body .meta-line {
  margin-bottom: 0;
  font-size: 0.66rem;
}

.reel-tail {
  margin: 0.2rem 0 0;
  margin-left: clamp(2.4rem, 7vw, 5.6rem);
  color: var(--paper-3);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ---------------------------------------------------------------------------
   05 Organization: centered head + horizontal pipeline
--------------------------------------------------------------------------- */

.pipeline {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(1.4rem, 2.6vw, 2.4rem);
  margin-top: clamp(2.2rem, 7svh, 4.2rem);
}

.pipeline::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 4px;
  height: 2px;
  background: linear-gradient(90deg, var(--red), rgba(224, 56, 46, 0.15));
}

.pipeline-step {
  position: relative;
  padding-top: 1.7rem;
}

.pipeline-node {
  position: absolute;
  left: 0;
  top: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--red);
}

.pipeline-step h3 {
  font-size: 1.12rem;
}

.pipeline-step p {
  margin-bottom: 0;
  color: var(--paper-2);
  font-size: 0.9rem;
  line-height: 1.55;
}

/* ---------------------------------------------------------------------------
   06 Stories: copy + full map plate
--------------------------------------------------------------------------- */

.story-frame {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.2fr);
  gap: clamp(2.4rem, 4.5vw, 4.5rem);
  align-items: center;
}

.care-terms {
  display: grid;
  gap: 0.6rem;
  margin: 1.4rem 0 1.9rem;
  padding: 0;
  list-style: none;
}

.care-terms li {
  display: grid;
  grid-template-columns: 6.4rem minmax(0, 1fr);
  gap: 1rem;
  align-items: baseline;
  padding-left: 0.75rem;
  border-left: 2px solid rgba(224, 56, 46, 0.55);
  color: var(--paper-2);
  font-size: 0.92rem;
}

.care-terms .item-label {
  margin-bottom: 0;
}

.story-map-plate {
  padding: clamp(0.9rem, 1.6vw, 1.4rem);
  border: 1px solid var(--hairline);
  background: var(--coal);
  box-shadow: var(--shadow);
}

.story-map-plate .map-canvas {
  position: relative;
}

.preview-story-dot {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 5px rgba(224, 56, 46, 0.18);
}

.map-caption {
  margin: 1rem 0 0;
  padding-top: 0.85rem;
  border-top: 1px solid var(--hairline);
  color: var(--paper-3);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ---------------------------------------------------------------------------
   07 Roadmap: copy + vertical timeline
--------------------------------------------------------------------------- */

.roadmap-frame {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(2.4rem, 4.5vw, 4.5rem);
  align-items: center;
}

.timeline {
  position: relative;
  display: grid;
  gap: clamp(1.1rem, 3svh, 1.7rem);
  margin: 0;
  padding: 0 0 0 1.9rem;
  list-style: none;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 2px;
  background: linear-gradient(180deg, rgba(224, 56, 46, 0.2), var(--red) 20%, var(--red) 80%, rgba(224, 56, 46, 0.15));
}

.timeline-step {
  position: relative;
}

.timeline-step::before {
  content: "";
  position: absolute;
  left: -1.9rem;
  top: 0.35rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--red);
}

.timeline-step h3 {
  margin-bottom: 0.35rem;
  font-size: 1.14rem;
}

.timeline-step p {
  margin-bottom: 0;
  color: var(--paper-2);
  font-size: 0.9rem;
  line-height: 1.55;
}

/* ---------------------------------------------------------------------------
   08 Impact: centered head + divided measures
--------------------------------------------------------------------------- */

.measure-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: clamp(2.2rem, 7svh, 4rem);
  padding-top: clamp(1.4rem, 3svh, 2rem);
}

.measure {
  padding: 0.4rem clamp(1.1rem, 2.2vw, 1.8rem);
}

.measure:first-child {
  padding-left: 0;
}

.measure + .measure {
  border-left: 1px solid var(--hairline);
}

.measure h3 {
  font-size: 1.1rem;
}

.measure p {
  margin-bottom: 0;
  color: var(--paper-2);
  font-size: 0.88rem;
  line-height: 1.55;
}

/* ---------------------------------------------------------------------------
   09 Closing
--------------------------------------------------------------------------- */

.closing-section {
  background:
    radial-gradient(ellipse at 50% 120%, rgba(224, 56, 46, 0.12), transparent 60%);
}

.closing-frame {
  max-width: 46rem;
  text-align: center;
}

.closing-frame .chapter-slate {
  justify-content: center;
}

.closing-frame h2 {
  font-size: clamp(2.4rem, 4.6vw, 3.9rem);
}

.closing-frame .chapter-lede {
  margin-inline: auto;
}

.closing-frame .button {
  margin-top: 1.7rem;
}

/* ---------------------------------------------------------------------------
   Pager rail (created by site.js on the immersive homepage)
--------------------------------------------------------------------------- */

.pager-rail {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: var(--z-rail);
  display: none;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  color: var(--paper-3);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  pointer-events: none;
}

.is-immersive-home .pager-rail {
  display: flex;
  opacity: 1;
  transition: opacity 320ms ease;
}

.is-immersive-home .pager-rail.is-complete {
  opacity: 0;
}

.pager-rail-count {
  color: var(--paper-2);
}

.pager-rail-track {
  display: block;
  width: 84px;
  height: 2px;
  overflow: hidden;
  background: var(--hairline);
}

.pager-rail-fill {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--red);
  transform: scaleX(var(--pager-progress, 0));
  transform-origin: left;
  transition: transform 120ms linear;
}

@media (max-width: 900px) {
  .is-immersive-home .pager-rail {
    display: none;
  }
}

/* ---------------------------------------------------------------------------
   Legacy shared containers still used by subpages
--------------------------------------------------------------------------- */

.paper-band,
.poster-section {
  width: min(100% - 2.4rem, var(--content));
  margin: 0 auto;
  padding: clamp(2.6rem, 6svh, 4.2rem) 0;
}

.poster-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: clamp(2rem, 4.5vw, 4rem);
  align-items: start;
}

.poster-copy p {
  color: var(--paper-2);
}

/* ---------------------------------------------------------------------------
   Responsive
--------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .immersive-home .narrative-section {
    min-height: 0;
  }

  .narrative-section {
    padding: clamp(3.4rem, 9svh, 5rem) 0;
  }

  .hero-frame,
  .mission-frame,
  .lessons-frame,
  .story-frame,
  .roadmap-frame {
    grid-template-columns: 1fr;
    gap: 2.4rem;
  }

  .home-hero h1 {
    font-size: clamp(2.7rem, 13vw, 4.2rem);
  }

  .purpose-columns {
    grid-template-columns: 1fr;
    gap: 1.4rem;
  }

  .purpose-columns article:nth-child(2),
  .purpose-columns article:nth-child(3) {
    margin-top: 0;
  }

  .credit-row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .pipeline {
    grid-template-columns: 1fr;
    gap: 1.6rem;
    padding-left: 1.9rem;
  }

  .pipeline::before {
    left: 4px;
    right: auto;
    top: 0.5rem;
    bottom: 0.5rem;
    width: 1px;
    height: auto;
  }

  .pipeline-step {
    padding-top: 0;
  }

  .pipeline-node {
    left: -1.9rem;
    top: 0.35rem;
  }

  .measure-row {
    grid-template-columns: 1fr;
    gap: 1.4rem;
  }

  .measure {
    padding: 0;
  }

  .measure + .measure {
    border-left: 0;
    border-top: 1px solid var(--hairline);
    padding-top: 1.4rem;
  }

  .poster-section {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .mission-grid {
    grid-template-columns: 1fr;
  }

  .format-list {
    grid-template-columns: 1fr;
  }

  .reel-frame:nth-child(2),
  .reel-frame:nth-child(3) {
    margin-left: 0;
  }

  .reel-tail {
    margin-left: 0;
  }

  .hero-index {
    flex-wrap: wrap;
    gap: 0.5rem 1.2rem;
    justify-content: flex-start;
  }
}
