.why-story-preview {
  --story-text: #f0ede7;
  --story-accent: #ef9797;
  --story-travel: clamp(380px, 72svh, 620px);
  --red-rocks-hold: 88px;
  --overview-hold: 120px;
  color: var(--story-text);
  background: #09121e;
  position: relative;
  overflow-anchor: none;
}

.why-story-preview[data-mode="scroll"]::after {
  content: "";
  display: block;
  height: calc(var(--story-travel) + var(--red-rocks-hold) + var(--overview-hold));
}

.why-story-stage {
  position: relative;
  display: grid;
  align-items: center;
  min-height: 100svh;
  isolation: isolate;
  overflow: clip;
  padding: clamp(38px, 8vh, 90px) clamp(24px, 7vw, 140px);
}

.why-story-preview[data-mode="scroll"] .why-story-stage {
  position: sticky;
  top: 0;
}

.why-story-backdrop {
  position: absolute;
  inset: 0;
  z-index: -3;
  background: #0d1927 url("/assets/colorado-route-preview.webp") center 56% / cover no-repeat;
  transform: translate3d(var(--story-pan, 0%), 0, 0) scale(var(--story-scale, 1.04));
  transform-origin: 67% 50%;
}

.why-story-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(90deg, #070d16f5 1%, #070d16e6 24%, #070d169e 46%, #070d1600 81%),
    linear-gradient(0deg, #070d16ba, transparent 35%);
}

.why-story-stage[data-terrain-ready] .why-story-backdrop {
  opacity: .52;
}

.why-story-stage[data-terrain-texture="orthophoto"] {
  background: radial-gradient(ellipse at 77% 46%, #172532, #09121d 72%);
}

.why-story-stage[data-terrain-texture="orthophoto"] .why-story-backdrop {
  opacity: .31;
  filter: saturate(.42);
}

.why-story-terrain {
  position: absolute;
  z-index: 0;
  inset: 0 0 0 34%;
  touch-action: pan-y pinch-zoom;
  cursor: grab;
  overflow: hidden;
}

.why-story-terrain[hidden] { display: none; }
.why-story-terrain[data-dragging] { cursor: grabbing; }

.why-story-terrain canvas {
  display: block;
  width: 100%;
  height: 100%;
  mask-image: linear-gradient(90deg, transparent, #000 22%, #000 94%, #000b);
}

.why-terrain-hint {
  position: absolute;
  right: clamp(91px, 8vw, 140px);
  bottom: clamp(25px, 6vh, 75px);
  color: #dee7f1;
  font-size: .78rem;
  text-shadow: 0 1px 8px #070d16, 0 1px 14px #070d16;
  pointer-events: none;
}

.why-terrain-hint span { color: #f0a198; margin-left: 5px; }

.why-flight-location {
  position: absolute;
  top: clamp(24px, 8vh, 96px);
  right: clamp(32px, 8vw, 140px);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  color: #f2e9dd;
  background: #0b111bc4;
  border: 1px solid #c9b3a960;
  border-radius: 3px;
  font-size: .73rem;
  pointer-events: none;
}

.why-flight-location::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #edac8e;
}

.why-story-terrain:focus-visible { outline: 2px solid #f2c8b7; outline-offset: -4px; }
.why-story-stage[data-terrain-ready] .why-story-route { visibility: hidden; }

.why-story-attribution {
  display: none;
  position: absolute;
  z-index: 2;
  right: clamp(91px, 8vw, 140px);
  bottom: max(16px, 3vh);
  color: #b8c5d6;
  font-size: .64rem;
  text-shadow: 0 1px 8px #070d16;
}

.why-story-stage[data-terrain-ready] .why-story-attribution { display: inline-block; }
.why-story-attribution:focus-visible { opacity: 1; }

.why-story-route {
  display: block;
  position: absolute;
  inset: 0 0 0 auto;
  width: 68%;
  height: 100%;
  z-index: -2;
  pointer-events: none;
  overflow: visible;
  filter: drop-shadow(0 0 5px #ff7a715e);
}

.why-story-route path {
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.why-story-route-base {
  stroke: #ecd9c84a;
  stroke-width: 1;
  stroke-dasharray: 2 8;
}

.why-story-route-progress {
  stroke: #f0a198;
  stroke-width: 2;
  stroke-dasharray: 1;
  stroke-dashoffset: var(--story-route-offset, .77);
}

.why-story-route-start {
  fill: #f7d2b9;
}

.why-story-route-end {
  fill: #f7d2b9;
  opacity: var(--story-route-end, .30);
}

.why-story-layout {
  position: relative;
  z-index: 2;
  width: min(100%, 600px);
  pointer-events: none;
}

.why-story-layout :is(a, button) { pointer-events: auto; }

.why-story-panel + .why-story-panel:not([hidden]) {
  margin-top: 38px;
}

.why-story-preview[data-mode] .why-story-panels {
  display: grid;
}

.why-story-preview[data-mode] .why-story-panel {
  grid-area: 1 / 1;
  margin: 0;
}

.why-story-preview[data-mode] .why-story-panel[hidden] {
  display: block;
  visibility: hidden;
}

.why-story-panel h2,
.why-fleet-intro h2 {
  color: #f0a198;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .17em;
  text-transform: uppercase;
  margin: 0 0 14px;
}

.why-story-panel h3,
.why-fleet-intro h3 {
  margin: 0;
  color: var(--ivory);
  font: 400 clamp(2.9rem, 5.25vw, 4.6rem) / .99 var(--font-heading);
  text-wrap: balance;
}

.why-story-panel p,
.why-fleet-intro p {
  max-width: 42ch;
  margin: 15px 0 0;
  color: #dce4ed;
  font-size: clamp(.86rem, 1.23vw, 1.04rem);
  line-height: 1.65;
}

.why-story-panel .why-story-kicker,
.why-fleet-intro .why-story-kicker {
  color: #e9a7a5;
  font-weight: 600;
  font-size: .75rem;
}

.why-story-panel a,
.why-story-fleet-link,
.why-fleet-intro > a {
  color: #fff5ef;
  text-decoration: underline;
  text-decoration-color: #e79994;
  text-underline-offset: 5px;
}

.why-story-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 22px;
  margin-top: 24px;
}

.why-story-steps {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid #a4b3c875;
  background: #080d17db;
  border-radius: 4px;
}

.why-story-steps[hidden] { display: none; }

.why-story-steps button,
.why-story-fleet-link,
.why-fleet-intro > a {
  min-height: 44px;
  padding-inline: 12px;
  font: 600 .81rem var(--font-body);
}

.why-story-steps button {
  cursor: pointer;
  color: #e9edf4;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 3px;
}

.why-story-steps button:hover { background: #1d2a3d; }

.why-story-steps [aria-pressed="true"] {
  background: #4d242b;
  border-color: #b76c74;
  color: white;
}

.why-story-fleet-link,
.why-fleet-intro > a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding-inline: 0;
}

.why-story-preview :is(button, a):focus-visible,
.why-fleet-intro a:focus-visible {
  outline: 2px solid #f7dece;
  outline-offset: 4px;
}

.why-fleet-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 28px;
  background: var(--midnight);
  padding: clamp(32px, 4.2vw, 66px) clamp(24px, 7vw, 140px) 24px;
}

.why-fleet-intro h3 { font-size: clamp(2rem, 4.2vw, 4.3rem); }
.why-fleet-intro + .fleet-gallery-wrap { padding-top: 16px; }

@media (max-width: 760px) {
  .flight-preview-page,
  .flight-preview-page body {
    overflow: visible;
    overflow-x: clip;
  }

  .why-story-preview { --story-travel: clamp(320px, 65svh, 560px); }

  .why-story-stage {
    align-items: end;
    padding-block: 122px 88px;
    overflow: hidden;
  }

  .why-story-stage::before {
    background: linear-gradient(0deg, #070d16 10%, #070d16ed 33%, #070d1699 63%, #070d1610 100%);
  }

  .why-story-backdrop { background-position: 57% center; }

  .why-story-route {
    width: 106%;
    height: 52%;
    right: -3%;
  }

  .why-story-terrain {
    inset: 0 0 auto;
    height: 52%;
  }

  .why-story-terrain canvas { mask-image: linear-gradient(0deg, transparent, #000 16%); }
  .why-terrain-hint { top: 24px; right: 24px; bottom: auto; }
  .why-flight-location { top: 24px; right: auto; left: 24px; }

  .why-story-attribution {
    top: 62px;
    right: 24px;
    bottom: auto;
  }

  .why-story-panel h3 {
    font-size: clamp(2.35rem, 10vw, 3.5rem);
  }

  .why-story-panel p { margin-top: 11px; }
  .why-story-actions { margin-top: 17px; }
  .why-story-steps button { padding-inline: 7px; font-size: .72rem; }
}

@media (max-width: 760px) and (max-height: 720px) {
  .why-story-stage { padding-block: 82px 68px; }
  .why-story-panel h2 { margin-bottom: 9px; }
  .why-story-panel h3 { font-size: clamp(1.95rem, 9vw, 2.7rem); }
  .why-story-panel p { margin-top: 8px; line-height: 1.5; }
  .why-story-actions { margin-top: 12px; gap: 2px 12px; }
}

@media (max-width: 760px) and (orientation: portrait) {
  .why-story-preview[data-mode] .why-story-stage {
    grid-template: minmax(144px, 1fr) auto / minmax(0, 1fr);
    height: 100svh;
    min-height: min-content;
    padding: 0 0 calc(94px + env(safe-area-inset-bottom, 0px));
    row-gap: 10px;
  }
  .why-story-preview[data-mode] .why-story-terrain {
    grid-area: 1 / 1;
    position: relative;
    inset: auto;
    align-self: stretch;
    height: auto;
  }
  .why-story-terrain canvas { position: absolute; inset: 0; }
  .why-story-preview[data-mode] .why-story-attribution {
    position: relative;
    inset: auto;
    grid-area: 1 / 1;
    place-self: end;
    margin: 0 16px 3px;
  }
  .why-flight-location { top: 10px; left: 16px; }
  .why-terrain-hint { top: 16px; right: 16px; }
  .why-story-preview[data-mode] .why-story-layout {
    grid-area: 2 / 1;
    justify-self: center;
    padding-inline: clamp(14px, 5vw, 28px);
  }
  .why-story-actions { display: grid; justify-items: start; gap: 5px; }
  .why-story-steps:not([hidden]) {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: min(100%, 350px);
  }
  .why-story-steps button { padding-inline: 3px; line-height: 1.2; }
}

@media (max-width: 360px) and (max-height: 660px) and (orientation: portrait) {
  .why-story-preview[data-mode] .why-story-stage {
    grid-template-rows: minmax(115px, 1fr) auto;
    row-gap: 6px;
  }
  .why-story-panel h3 { font-size: 1.65rem; }
  .why-story-panel p { margin-top: 6px; line-height: 1.38; }
  .why-story-actions { margin-top: 8px; }
}

@media (orientation: landscape) and (max-height: 500px) and (max-width: 1000px) {
  .flight-preview-page, .flight-preview-page body { overflow: visible; overflow-x: clip; }
  .why-story-preview[data-mode] .why-story-stage {
    align-items: center;
    padding: 12px 16px 70px;
  }
  .why-story-preview[data-mode] .why-story-layout { width: 47%; }
  .why-story-terrain { inset: 0 0 62px 49%; height: auto; }
  .why-story-preview[data-mode] .why-story-panel { margin: 0; }
  .why-story-panel h2 { margin-bottom: 4px; }
  .why-story-panel h3 { font-size: clamp(1.45rem, 3vw, 1.85rem); }
  .why-story-panel p { margin-top: 5px; line-height: 1.34; }
  .why-story-actions { gap: 0; margin-top: 6px; }
  .why-story-steps { flex-wrap: nowrap; }
  .why-story-steps button { padding-inline: 4px; line-height: 1.15; }
  .why-terrain-hint { top: 12px; right: 12px; bottom: auto; }
  .why-flight-location { top: 8px; left: 10px; right: auto; }
  .why-story-attribution { top: auto; right: 18px; bottom: 66px; }
}
