/* ==========================================================================
   SCENES: one labeled block per scene, in page order.

   How this file is organized:
   - Plain rules describe the STATIC page (what you see with motion off).
   - Rules starting with ".has-motion" only apply when animations are running.
     JavaScript adds that class to <html> unless the visitor asked for
     reduced motion.
   ========================================================================== */

/* --------------------------------------------------------------------------
   SHARED: landscape layers and dust (used by hero and CTA)
   -------------------------------------------------------------------------- */
.landscape { position: absolute; inset: 0; overflow: hidden; background: var(--ink); }
.layer { position: absolute; inset: 0; width: 100%; height: 100%; }
.has-motion .hero .layer { will-change: transform; }

.dust { position: absolute; inset: 0; pointer-events: none; }
.dust__mote {
  position: absolute;
  border-radius: 50%;
  background: var(--sand);
}

/* --------------------------------------------------------------------------
   SHARED: "beats". A list of short lines that reads as a normal list when
   static. With motion on, the lines stack in one spot and swap as you scroll.
   Used by the problem statements and the install steps.
   -------------------------------------------------------------------------- */
.has-motion .beat {
  position: absolute;
  inset: 0 0 auto 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(1.25rem);
  /* leaving: quick, so the old line is gone before the new one arrives */
  transition: opacity var(--speed-fast) var(--ease-smooth),
              transform var(--speed-fast) var(--ease-smooth),
              visibility 0s linear var(--speed-fast);
}
.has-motion .beat.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
  /* arriving: waits for the old line to clear, then settles in */
  transition: opacity var(--speed-base) var(--ease-smooth) var(--speed-fast),
              transform var(--speed-base) var(--ease-smooth) var(--speed-fast),
              visibility 0s linear var(--speed-fast);
}

/* --------------------------------------------------------------------------
   SHARED: the cabin stage. Scenes 2 and 3 use the same layout and the same
   drawing, so the window sits in the same place on screen in both.
   -------------------------------------------------------------------------- */
.cabin__pin { padding-block: var(--section-pad); }
.has-motion .cabin__pin {
  height: 100vh;
  height: 100svh;
  min-height: 36rem;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-block: clamp(4rem, 8vh, 5.5rem) 1.5rem;
}
.cabin {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: clamp(1.25rem, 4vw, 4rem);
}
@media (min-width: 900px) {
  .cabin { grid-template-columns: 5fr 7fr; }
}

/* The stage is a fixed 4:3 box so labels can be placed against the drawing */
.cabin__stage {
  position: relative;
  order: -1;
  width: min(100%, 62svh);
  aspect-ratio: 4 / 3;
  margin-inline: auto;
}
@media (min-width: 900px) {
  .cabin__stage { order: 0; width: min(100%, 96svh); }
}
/* The drawing has no hard edge: it fades out into the page on every side */
.cabin__svg {
  width: 100%;
  height: 100%;
  -webkit-mask-image: radial-gradient(ellipse 64% 68% at 50% 49%, #000 58%, transparent 100%);
  mask-image: radial-gradient(ellipse 64% 68% at 50% 49%, #000 58%, transparent 100%);
}

/* Cabin drawing parts (the shapes are in the sprite in index.html) */
.cabin__belt { fill: none; stroke: var(--sand); stroke-width: 10; opacity: 0.14; }
.cabin__line { fill: none; stroke: var(--sand); stroke-width: 1.5; opacity: 0.14; }
.cabin__track { fill: none; stroke: var(--ink-deep); stroke-width: 14; }
.cabin__track-inner { fill: none; stroke: var(--sand); stroke-width: 1.5; opacity: 0.3; }
.cabin__bugs { color: var(--bone); }
.has-motion .cabin__bugs--static { display: none; }

/* --------------------------------------------------------------------------
   SCENE 1: HERO
   -------------------------------------------------------------------------- */
.hero__pin {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 36rem;
  overflow: hidden;
}
/* Darkens the top and bottom so the text stays readable over the sky and road */
.hero__scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--ink) 60%, transparent) 0%, transparent 50%),
    linear-gradient(0deg, color-mix(in srgb, var(--ink) 82%, transparent) 0%, transparent 42%);
  pointer-events: none;
}
/* Fades the whole hero toward dark at the end of its scroll */
.hero__shade { position: absolute; inset: 0; background: var(--ink); opacity: 0; pointer-events: none; }

.hero__content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-top: clamp(5.5rem, 14vh, 9rem);
  padding-bottom: clamp(3.5rem, 9vh, 5.5rem);
}
.hero__headline { max-width: 100%; }
/* Each headline sentence sits in a mask so it can slide up from below */
.line-mask { display: block; overflow: hidden; padding-bottom: 0.06em; }
.line-inner { display: block; }

.hero__bottom { display: grid; gap: 1.5rem; }
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 2rem; }

/* Optional hero video (turned on in js/config.js > settings.useHeroVideo) */
.hero__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero--video .layer, .hero--video .dust { display: none; }
.hero--video .hero__scrim { background: color-mix(in srgb, var(--ink) 55%, transparent); }

/* Scroll cue: only shown when motion is on */
.scroll-cue { display: none; }
.has-motion .scroll-cue {
  position: absolute;
  right: var(--gutter);
  bottom: 1.5rem;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--sand);
}
.scroll-cue i { width: 2px; height: 2.75rem; background: var(--sand); transform-origin: top; }
@media (prefers-reduced-motion: no-preference) {
  .scroll-cue i { animation: cue-pulse 1.8s var(--ease-smooth) infinite; }
}
@keyframes cue-pulse {
  0% { transform: scaleY(0); transform-origin: top; }
  50% { transform: scaleY(1); transform-origin: top; }
  51% { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* --------------------------------------------------------------------------
   SCENE 2: PROBLEM (open window, bugs fly in)
   -------------------------------------------------------------------------- */
.problem { background: var(--ink); }

/* The three statements */
.problem__list { display: grid; gap: 1rem; margin-top: clamp(1.25rem, 3.5vh, 2.5rem); }
.problem__statement {
  max-width: 22ch;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.45rem, 2.4vw, 2.1rem);
  line-height: 1.05;
  text-transform: uppercase;
  text-wrap: balance;
  color: var(--sand);
}
.has-motion .problem__list { position: relative; display: block; min-height: 7rem; }

/* --------------------------------------------------------------------------
   SCENE 3: MECHANISM (signature scene)
   -------------------------------------------------------------------------- */
.mechanism { background: linear-gradient(180deg, var(--ink), var(--charcoal)); }

/* SVG parts */
.mech__track-highlight {
  fill: none;
  stroke: var(--ember);
  stroke-width: 5;
  stroke-dasharray: 1;
  opacity: 0;               /* JS reveals it during the "Insert" beat */
}
.mech__frame { fill: none; stroke: var(--steel); stroke-width: 6; stroke-linejoin: round; }
.mech__bug { color: var(--bone); }

/* Steps: a normal numbered list when static */
.steps { display: grid; gap: 2rem; margin-top: clamp(1.5rem, 4vh, 3rem); }
.step { display: grid; grid-template-columns: auto 1fr; column-gap: 1.25rem; align-items: start; }
.step__num {
  grid-row: span 2;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3rem, 6vw, 5.5rem);
  line-height: 0.85;
  color: transparent;
  -webkit-text-stroke: 2px var(--sand);
}
.step__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.5rem, 2.4vw, 2.1rem);
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.step__text { margin-top: 0.4rem; font-size: var(--text-lead); line-height: 1.4; color: var(--sand); max-width: 22em; }
.has-motion .steps { position: relative; display: block; min-height: 8.5rem; margin-top: clamp(1rem, 3vh, 2.5rem); }

/* "Window track" label that appears with the highlight */
.mechanism__callout { display: none; }
.has-motion .mechanism__callout {
  position: absolute;
  left: 48%;
  top: 8.6%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transform: translateX(-50%);
  color: var(--bone);
  font-size: var(--text-small);
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
}
.mechanism__callout i { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--ember); }

/* --------------------------------------------------------------------------
   SCENE 4: ROAD
   -------------------------------------------------------------------------- */
.road { --veh-w: min(80svh, 88vw); }       /* vehicle width, change to resize it */
.road__pin {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 34rem;
  overflow: hidden;
  background: var(--ink);
}
.road__world { position: absolute; inset: 0; }
.road__sky { position: absolute; inset: 0; width: 100%; height: 100%; }

/* Wide strips of landscape that slide sideways */
.strip {
  position: absolute;
  left: 0; bottom: 0;
  height: 100%;
  width: auto;
  max-width: none;
  aspect-ratio: 6400 / 900;
}
.has-motion .strip { will-change: transform; }

.vehicle {
  position: absolute;
  left: 50%;
  bottom: 19%;                             /* sits the wheels on the dirt strip */
  width: var(--veh-w);
  margin-left: calc(var(--veh-w) / -2);
  overflow: visible;
}
/* Vehicle paint. The shapes are in the sprite in index.html (g-rig4-body,
   g-rig2-body, g-wheel) and are reused by the fit drawings in scene 6. */
.veh__rig--2 { display: none; }             /* static page: the four-door only */
.has-motion .veh__rig--2 { display: inline; }
.veh__shell { fill: var(--ink); stroke: var(--sand); stroke-opacity: 0.28; stroke-width: 1.5; stroke-linejoin: round; }
.veh__dark { fill: var(--ink-deep); }
.veh__glass { fill: var(--sand); opacity: 0.3; }
.veh__screen { stroke: var(--ember); stroke-width: 3; stroke-linejoin: round; }
.veh__seam { fill: none; stroke: var(--sand); stroke-opacity: 0.2; stroke-width: 1.5; }
.veh__well { fill: var(--ink-deep); }
.veh__flare { fill: none; stroke: var(--charcoal); stroke-width: 9; stroke-linejoin: round; stroke-linecap: round; }
.veh__tail { fill: var(--ember); }
.veh__lug { fill: none; stroke: var(--charcoal); stroke-width: 6; stroke-linecap: round; }      /* tread blocks */
.veh__link { fill: none; stroke: var(--ink-deep); stroke-width: 8; stroke-linecap: round; }     /* track bar and shock bodies */
.veh__shock { fill: none; stroke: var(--sand); stroke-opacity: 0.45; stroke-width: 4; stroke-linecap: round; }
.veh__coil { fill: none; stroke: var(--charcoal); stroke-width: 5; stroke-linejoin: round; stroke-linecap: round; }
.veh__lamp { fill: var(--bone); opacity: 0.85; }
.veh__tire { fill: var(--ink-deep); }
.veh__tire--edge { stroke: var(--sand); stroke-opacity: 0.22; stroke-width: 1.5; }
.veh__tread-roll { fill: none; stroke: color-mix(in srgb, var(--charcoal) 86%, var(--sand)); stroke-width: 22; stroke-dasharray: 10 8; }   /* 10 + 8 = one block and its gap */
.veh__tread-roll--edge { stroke-width: 5; }
.veh__tread--spare { stroke-width: 10; stroke-dasharray: 12 9; }
.veh__axle { fill: var(--charcoal); stroke: var(--sand); stroke-opacity: 0.25; stroke-width: 1.5; }
.veh__spoke { fill: none; stroke: var(--ink-deep); stroke-width: 11; stroke-linecap: round; }
.veh__hook { fill: none; stroke: var(--ember); stroke-width: 5; stroke-linecap: round; }
.veh__tread { fill: none; stroke: var(--charcoal); stroke-width: 5; stroke-dasharray: 7 6; }
.veh__rim { fill: var(--charcoal); stroke: var(--sand); stroke-opacity: 0.4; stroke-width: 2; }
.veh__spoke { fill: none; stroke: var(--sand); stroke-opacity: 0.5; stroke-width: 3; }

/* Dust kicked up behind the rear wheel (puffs are added by JS) */
.road__dust {
  position: absolute;
  left: calc(50% - var(--veh-w) * 0.27);
  bottom: 20.5%;
  width: 0; height: 0;
}
.road__puff {
  position: absolute;
  right: 0; bottom: 0;
  width: calc(var(--veh-w) * 0.12);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--sand) 70%, transparent), transparent 68%);
  opacity: 0;
}

.road__content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-top: clamp(5.5rem, 14vh, 9rem);
  padding-bottom: clamp(1.25rem, 4vh, 2.5rem);
  pointer-events: none;
}
.road__swap { display: grid; gap: 0.75rem; }
.road__line { max-width: 16ch; text-shadow: 0 2px 24px color-mix(in srgb, var(--ink) 60%, transparent); }
.has-motion .road__line { grid-area: 1 / 1; }   /* both lines share one spot and crossfade */

/* Bottom row: speed readout on the left, model coverage on the right */
.road__bottom { display: grid; gap: 1rem; }
@media (min-width: 700px) {
  .road__bottom { grid-template-columns: 1fr 1fr; align-items: end; gap: 2rem; }
}
.road__speed { display: none; }
.has-motion .road__speed { display: block; }
.road__speed-read { display: flex; align-items: baseline; gap: 0.5rem; font-family: var(--font-display); font-weight: 800; line-height: 1; }
.road__speed-num { font-size: clamp(3rem, 8vw, 6rem); min-width: 2ch; font-variant-numeric: tabular-nums; }
.road__speed-unit { font-size: 1.25rem; letter-spacing: 0.06em; color: var(--sand); }
.road__speed-note { font-size: var(--text-small); color: var(--bone); opacity: 0.85; }

/* Which windows it covers: a plain two-line list when static. With motion on,
   one line shows at a time and swaps as the two-door fades into the four-door. */
.road__fits { display: grid; gap: 1rem; }
.road__fit-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.5rem, 2.6vw, 2.2rem);
  line-height: 1;
  text-transform: uppercase;
}
.road__fit-text { margin-top: 0.3rem; max-width: 24em; }
.has-motion .road__fits { position: relative; display: block; min-height: 5.25rem; }
/* Narrow screens: the caption rides up under the headline so it never covers
   the rig, and the speed readout keeps the bottom edge to itself. */
@media (max-width: 699px) {
  .has-motion .road__bottom { display: contents; }
  .has-motion .road__fits { order: 1; margin: 1.25rem 0 auto; }
  .has-motion .road__speed { order: 2; }
}
@media (min-width: 700px) {
  .road__fit { text-align: right; }
  .road__fit-text { margin-left: auto; }
  .has-motion .road__fits { order: 0; }
  .has-motion .road__fit { inset: auto 0 0 0; }
}

/* --------------------------------------------------------------------------
   SCENE 5: COMPARE
   -------------------------------------------------------------------------- */
.compare__table-wrap { position: relative; margin-top: clamp(2rem, 5vw, 4rem); }
.compare__table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.compare__table th, .compare__table td {
  padding: 1.1rem 0.75rem;
  border-bottom: 1px solid var(--line-on-light);
  text-align: center;
  vertical-align: middle;
}
.compare__table tbody tr:last-child th, .compare__table tbody tr:last-child td { border-bottom: 0; }
.compare__table thead th {
  padding-top: 1.4rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(0.85rem, 1.6vw, 1.3rem);
  line-height: 1.05;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  hyphens: auto;
}
.compare__table th:first-child { width: 34%; text-align: left; padding-left: 0; }
.compare__table tbody th { font-weight: 500; font-size: clamp(0.9rem, 1.3vw, 1.1rem); line-height: 1.3; }
/* Our column: a soft tint, plus the ember bar across its top (separate element below) */
.compare__table .is-brand { background: color-mix(in srgb, var(--ember) 9%, transparent); }

.ico {
  width: 1.7rem; height: 1.7rem;
  margin-inline: auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;         /* lets the icon "draw itself" */
  stroke-dashoffset: 0;
}
.st--no .ico { opacity: 0.45; }
.is-brand .ico { color: var(--ember); }

/* "In testing" and "Varies": plain words, no badge */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: clamp(0.72rem, 1.15vw, 0.9rem);
  font-weight: 600;
  white-space: nowrap;
}
.pill--target::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--ember); }
.pill--varies { font-weight: 500; opacity: 0.75; }

/* Ember bar across the top of our column. JS lines it up with the column. */
.compare__outline {
  position: absolute;
  top: 0;
  height: 4px;
  background: var(--ember);
  pointer-events: none;
}
.compare__note { margin-top: 1.5rem; font-size: var(--text-small); max-width: 40em; }

@media (max-width: 600px) {
  .compare__table th, .compare__table td { padding: 0.8rem 0.25rem; }
  .pill--target::before { display: none; }
  .ico { width: 1.4rem; height: 1.4rem; }
}

/* --------------------------------------------------------------------------
   SCENE 6: SPECS AND FIT
   -------------------------------------------------------------------------- */
.specs { background: var(--bone-alt); }

/* The screen drawing and its numbered parts */
.anatomy {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
  margin-top: clamp(2rem, 5vw, 4rem);
}
@media (min-width: 900px) {
  .anatomy { grid-template-columns: 6fr 5fr; }
}
.anatomy__svg { width: 100%; height: auto; overflow: visible; }
.anatomy__frame { fill: none; stroke: var(--ink); stroke-width: 7; stroke-linejoin: round; }
.spot circle { fill: var(--ink); stroke: var(--bone-alt); stroke-width: 4; }
.spot text {
  fill: var(--bone);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  text-anchor: middle;
}

/* The list numbers match the dots on the drawing */
.parts { counter-reset: part; }
.part {
  position: relative;
  counter-increment: part;
  padding: 1.4rem 0 1.4rem 3.25rem;
  border-top: 1px solid var(--line-on-light);
}
.part:first-child { border-top: 0; padding-top: 0; }
.part::before {
  content: counter(part);
  position: absolute;
  left: 0;
  width: 2rem; height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  line-height: 1;
}
.part__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  line-height: 1;
  text-transform: uppercase;
}
.part__text { margin-top: 0.4rem; max-width: 30em; }
.part__note { margin-top: 0.4rem; font-size: var(--text-small); font-style: italic; opacity: 0.85; }
.anatomy__promise {
  margin-top: 0.5rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line-on-light);
  font-weight: 600;
  max-width: 30em;
}

/* Planned models and the independence note */
.fits { margin-top: clamp(2.5rem, 6vw, 4.5rem); padding-top: 1.75rem; border-top: 1px solid var(--line-on-light); }
.fits__models { font-weight: 600; }
.fits__disclaimer { margin-top: 0.5rem; font-size: var(--text-small); max-width: 44em; }

/* --------------------------------------------------------------------------
   SCENE 7: CTA
   -------------------------------------------------------------------------- */
.cta {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-block: var(--section-pad);
}
.cta__scrim {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, color-mix(in srgb, var(--ink) 82%, transparent) 0%, color-mix(in srgb, var(--ink) 35%, transparent) 100%);
}
.cta__content { position: relative; z-index: 2; }
/* Narrow screens: the words sit at the top and the rig drives below them */
@media (max-width: 899px) {
  .cta { align-items: flex-start; min-height: max(100svh, 44rem); }
  .cta__scrim { background: linear-gradient(180deg, color-mix(in srgb, var(--ink) 88%, transparent) 0%, color-mix(in srgb, var(--ink) 70%, transparent) 42%, transparent 68%); }
}
.cta__sub { margin-top: 1.25rem; }

/* The email field is a single line to write on, not a box */
.waitlist { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem 1.25rem; margin-top: 2rem; max-width: 38rem; }
.waitlist__input {
  flex: 1 1 15rem;
  min-height: 3.25rem;
  padding: 0.7rem 0.15rem;
  border: 0;
  border-bottom: 2px solid var(--sand);
  border-radius: 0;
  background: transparent;
  color: var(--bone);
  font-size: var(--text-lead);
}
.waitlist__input::placeholder { color: var(--sand); opacity: 1; }
.waitlist__msg { flex-basis: 100%; min-height: 1.5em; font-size: var(--text-small); }
.waitlist__msg.is-error { font-weight: 600; }
.waitlist__msg.is-error::before { content: ""; display: inline-block; width: 0.5rem; height: 0.5rem; margin-right: 0.5rem; background: var(--ember); border-radius: 50%; }
.waitlist__input[aria-invalid="true"] { border-bottom-color: var(--ember); }

/* Button states: "Sending" dims it, success swaps the words for a checkmark
   that draws itself. */
.waitlist__btn span { transition: opacity var(--speed-fast) var(--ease-smooth); }
.waitlist__check {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 1.7rem; height: 1.7rem;
  fill: none;
  stroke: var(--ink);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 0.45s var(--ease-smooth) 0.1s;
}
.waitlist.is-sending .waitlist__btn { opacity: 0.7; cursor: progress; }
.waitlist.is-done .waitlist__btn { cursor: default; }
.waitlist.is-done .waitlist__btn span { opacity: 0; }
.waitlist.is-done .waitlist__check { stroke-dashoffset: 0; }
@media (prefers-reduced-motion: reduce) {
  .waitlist__btn span, .waitlist__check { transition: none; }
}
.cta__fine { font-size: var(--text-small); color: var(--sand); }

/* --------------------------------------------------------------------------
   SMALL SCREENS
   -------------------------------------------------------------------------- */
@media (max-width: 899px) {
  .has-motion .cabin__pin { align-items: flex-start; }
}

/* --------------------------------------------------------------------------
   TOPOGRAPHIC LINES
   Faint map contours in the open corners of the text scenes. Any block with
   the class "topo-host" can hold one: add an <svg class="topo topo--br">.
   Corners: --br bottom right, --tr top right, --bl bottom left.
   -------------------------------------------------------------------------- */
.topo-host { position: relative; isolation: isolate; overflow: clip; }
.topo {
  position: absolute;
  z-index: -1;                               /* behind the text, above the background */
  width: clamp(22rem, 62vw, 46rem);
  aspect-ratio: 1;
  max-width: none;
  /* The rings melt away toward the outside, so there is never a hard edge
     where one scene meets the next */
  -webkit-mask-image: radial-gradient(closest-side, #000 45%, transparent 97%);
  mask-image: radial-gradient(closest-side, #000 45%, transparent 97%);
  pointer-events: none;
  color: var(--sand);
  opacity: 0.2;
}
.scene--light .topo { color: var(--ink); opacity: 0.16; }
.topo--br { right: 0; bottom: 0; transform: translate(26%, 0); }
.topo--tr { right: 0; top: 0; transform: translate(26%, 0); }
.topo--bl { left: 0; bottom: 0; transform: translate(-26%, 0); }
/* Each ring is one dash as long as the ring itself. Sliding the dash off
   (offset 1) hides the ring, sliding it on (offset 0) draws it. Inner rings
   (low --t) finish first. */
.topo__line {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
  stroke-dasharray: 1;
  stroke-dashoffset: clamp(0, calc(var(--topo-draw, 0) * 1.8 - 0.8 * (1 - var(--t, 0))), 1);
}
.topo__line--index { stroke-width: 2.6; }    /* every fourth ring is heavier, like a map */
/* Wide screens: in the two window scenes the drawing fills the right side, so
   the lines move under the text on the left instead. */
@media (min-width: 900px) {
  .cabin__pin .topo--br { right: auto; left: 0; transform: translate(-26%, 0); }
}

/* --------------------------------------------------------------------------
   SCENE FADE
   js/main.js moves --fade-in and --fade-out between 0 and 1 as scenes change.
   -------------------------------------------------------------------------- */
.has-motion main > .scene { opacity: calc(var(--fade-in, 1) * var(--fade-out, 1)); }

/* Each scene overlaps the one above it by a hair, so no thin line of the
   page behind can ever show where two scenes meet */
main > .scene + .scene { margin-top: -1px; }

/* A scene that arrives behind a ridgeline edge overlaps the one above by the
   height of the tallest ridge (config.js > motion.sceneReveal.ridge), so the
   old scene shows between the peaks instead of the empty page */
.has-motion main > .scene--reveal { margin-top: -10vh; }

/* ...and the padded scenes get that much extra room at the bottom, so the
   overlap never covers their last line of text */
.has-motion main > .scene--pad:has(+ .scene--reveal) { padding-bottom: calc(var(--section-pad) + 10vh); }
