/* =============================================================================
   story.css — the scroll story

   #story is seven viewports tall and holds a sticky, one-viewport stage. The
   stage contains two layers:

       .three-helix-stage   z-index 1   the cards (positioned by helix.js)
       .stage-copy          z-index 2   everything in this file

   The copy is click-through as a layer, and each block opts back in where it
   needs to be reachable — only the hero's buttons actually are. Opacity and
   transform on the copy blocks are written inline by story.js once per frame,
   so nothing here should set them.
   ============================================================================= */

/* --- the scroll region and the sticky stage ------------------------------ */

.stage-scroll {
  position: relative;
  height: 700svh;
}

.stage-sticky {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
  background: linear-gradient(var(--surface-hi) 0%, var(--surface-lo) 100%);
}

/* warm glow bleeding in from the right, behind the helix */
.stage-sticky::after {
  content: "";
  position: absolute;
  top: 4vh;
  right: -12vw;
  width: 56vw;
  height: 92vh;
  background: radial-gradient(closest-side, var(--accent-glow), var(--accent-glow-0));
  pointer-events: none;
}

.stage-copy {
  position: relative;
  z-index: var(--z-copy);
  height: 100%;
  pointer-events: none;
}

/* --- first screen: hero ------------------------------------------------- */

.hero-copy {
  position: absolute;
  top: 50%;
  left: 6vw;
  max-width: 47vw;
  transform: translateY(-50%);
  pointer-events: auto;
}

.hero-eyebrow {
  margin-bottom: 3vh;
  padding-left: 20px;
  color: var(--ink-2);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .14em;
}

.hero-title {
  position: relative;
}

.hero-title__text {
  font-size: clamp(76px, 7.7vw, 132px);
  font-weight: 790;
  line-height: .92;
  letter-spacing: -.09em;
}

.hero-title__bottom {
  position: relative;
  display: inline-block;
  isolation: isolate;
}

/* the yellow band behind the wordmark */
.hero-title__band {
  position: absolute;
  right: .06em;
  bottom: .05em;
  left: .04em;
  z-index: -1;
  height: .155em;
  border-radius: 2px;
  background: var(--accent);
}

.hero-rule {
  max-width: 560px;
  height: 1px;
  margin: 4.2vh 0 2.6vh;
  background: var(--ink-a14);
}

.hero-sub {
  margin-bottom: 3.4vh;
  padding-left: 20px;
  color: var(--ink-2);
  font-size: clamp(16px, 1.25vw, 19px);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 14px;
  padding-left: 20px;
}

/* --- the three chapter headings ----------------------------------------- */

.phase-headings {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.phase-heading {
  position: absolute;
  will-change: opacity, transform;
}

.phase-heading__row {
  display: flex;
  align-items: flex-start;
  gap: 2.2vw;
}

.phase-heading__index {
  min-width: 2.4em;
  padding-top: 1.2vh;
  border-top: 2px solid var(--ink);
  color: var(--ink-3);
  font-size: 15px;
  font-weight: 620;
  letter-spacing: .16em;
}

.phase-heading__title {
  font-size: clamp(44px, 4.8vw, 82px);
  font-weight: 790;
  line-height: 1.04;
  letter-spacing: -.055em;
}

.phase-heading__rule {
  width: 20vw;
  max-width: 300px;
  height: 1px;
  margin-top: 2.2vh;
  background: var(--ink-a16);
}

.phase-heading__note {
  margin-top: 2.2vh;
  color: var(--ink-2);
  font-size: clamp(15px, 1.15vw, 17.5px);
}

/* 01 — sits beside the first card */
.phase-heading--side {
  top: 44%;
  left: 6vw;
  transform: translateY(-50%);
}

/* 02 — centred, above the two cards */
.phase-heading--center {
  top: 21vh;
  right: 0;
  left: 0;
  text-align: center;
}

.phase-heading--center .phase-heading__body {
  max-width: 88vw;
  margin-inline: auto;
}

.phase-heading--center .phase-heading__title {
  font-size: clamp(52px, 5.6vw, 96px);
}

.phase-heading--center .phase-heading__note {
  margin-right: auto;
  margin-left: auto;
}

.phase-heading__band-line {
  position: relative;
  display: inline-block;
  isolation: isolate;
}

.phase-heading__band {
  position: absolute;
  right: .08em;
  bottom: .05em;
  left: .04em;
  z-index: -1;
  height: .155em;
  border-radius: 2px;
  background: var(--accent);
}

/* 03 — top left, above the timeline card */
.phase-heading--top {
  top: 18vh;
  left: 6vw;
}

.phase-heading--top .phase-heading__index {
  border-top-width: 6px;
  border-top-color: var(--accent);
  color: var(--accent);
  font-size: 17px;
  -webkit-text-stroke: 0;
}

.phase-heading--top .phase-heading__title {
  font-size: clamp(40px, 4.3vw, 74px);
}

.phase-heading--top .phase-heading__rule {
  width: 34vw;
  max-width: 520px;
  margin-top: 2.6vh;
}

/* --- the two animated vignettes ----------------------------------------- */

.stage-vignette {
  position: absolute;
  left: calc(8.2vw + 38px);
  pointer-events: none;
}

.stage-vignette--query {
  top: calc(44% + 245px);
  width: clamp(320px, 30vw, 640px);
}

.stage-vignette--parcel {
  top: calc(18vh + 320px);
  left: 5.6vw;
  width: clamp(340px, 28vw, 660px);
}

.floating-vignette svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

/* --- plain, stacked story (reduced motion / short landscape) ------------ */

.static-story {
  display: flex;
  flex-direction: column;
  gap: 15vh;
  padding: 16vh 6vw 6vh;
}

.static-hero {
  padding: 80px 0 64px;
}

.static-hero h1 {
  margin: 16px 0;
  font-size: clamp(44px, 9vw, 88px);
}

.static-hero__mark {
  width: 96px;
  height: 96px;
}

.static-story__chapter {
  display: grid;
  grid-template-columns: minmax(280px, 5fr) 7fr;
  align-items: center;
  gap: 6vw;
}

.static-story__text .phase-heading__title {
  font-size: clamp(36px, 4vw, 64px);
}

.static-story__cards {
  display: grid;
  gap: 18px;
}

.static-card {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 60px var(--ink-a12);
}

/* a 960×540 card face scaled down to fit the slot (see main.js) */
.static-card__inner {
  position: absolute;
  top: 0;
  left: 0;
  width: 960px;
  height: 540px;
  transform-origin: 0 0;
}

.static-vignette {
  max-width: 640px;
  margin-top: 24px;
}
