.mast-story {
  --mast-sticky-top: 58px;
}

.mast-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(24px, 4vw, 68px);
  padding-block: 32px;
}

.mast-visual {
  position: relative;
  display: grid;
  place-items: center;
  height: min(690px, 76svh);
  min-width: 0;
  isolation: isolate;
  background: radial-gradient(ellipse at 51% 58%, var(--color-surface) 0, transparent 71%);
}

.mast-still {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
}

.mast-rig, .mast-detail, .mast-progress, .mast-drone { display: none; }

.mast-copy { min-width: 0; }
.mast-chapter + .mast-chapter { margin-top: 28px; }
.mast-chapter .eyebrow { display: block; color: var(--color-accent); }
.mast-chapter h2 {
  margin: .32em 0 .25em;
  font-family: var(--font-display);
  font-size: clamp(30px, 4.65vw, 72px);
  line-height: .94;
  letter-spacing: -.045em;
  overflow-wrap: normal;
}
.mast-chapter p {
  max-width: 34ch;
  font-family: var(--font-body);
  color: var(--color-text);
  font-size: clamp(16px, 1.45vw, 21px);
  line-height: 1.55;
}
.mast-story.is-mast-ready {
  --mast-closeup-hold: 220px;
  height: calc(100svh + clamp(1200px, 180svh, 1840px) + var(--mast-closeup-hold));
}
.is-mast-ready .mast-stage {
  position: sticky;
  top: var(--mast-sticky-top);
  height: calc(100svh - var(--mast-sticky-top) - var(--mobile-demo-space, 0px));
  padding-block: 12px 20px;
}
.is-mast-ready .mast-visual { height: 100%; min-height: 0; }
.is-mast-ready .mast-rig { display: block; width: 100%; height: 100%; }
.is-mast-ready .mast-detail {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
}
.is-mast-ready .mast-still { display: none; }
.is-mast-ready .mast-chapter { margin: 0; }
.is-mast-ready .mast-chapter:not([hidden]) { animation: mast-copy-in 240ms var(--ease-out) both; }
@keyframes mast-copy-in { from { opacity: 0; transform: translateY(6px); } }

.mast-progress {
  margin-top: clamp(18px, 3vh, 34px);
  gap: 8px;
  max-width: 192px;
  grid-template-columns: repeat(3, 1fr);
}
.is-mast-ready .mast-progress { display: grid; }
.mast-progress span { height: 2px; background: var(--color-rule); }
.mast-progress .is-current { background: var(--color-accent); }

.mast-marker { color: var(--color-accent); opacity: 0; transition: opacity 180ms var(--ease-out); }
.mast-marker.is-current { opacity: 1; }
.mast-marker :is(path, circle) { fill: none; stroke: currentColor; stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.mast-marker circle { fill: var(--color-bg); }
.mast-marker text { fill: currentColor; font: 700 36px var(--font-body); letter-spacing: .08em; }
.mast-visint-marker.is-current { opacity: var(--mast-visint-opacity, 0); transition: none; }
.mast-visint-marker text { font-size: 39px; }
.mast-visint-detail-marker text { font-size: 42px; letter-spacing: .04em; }
.mast-solar-marker.is-current { opacity: var(--mast-solar-opacity, 0); transition: none; }
.mast-label-stacked { display: none; }

.mast-story[data-mast-continuous] {
  padding-block: clamp(34px, 5svh, 60px);
}
.mast-story[data-mast-continuous].is-mast-ready {
  height: calc(100svh + clamp(1040px, 158svh, 1600px) + var(--mast-closeup-hold));
}
.mast-story[data-mast-continuous].is-mast-ready:has(.mast-drone) {
  --mast-closeup-hold: 64px;
  height: calc(100svh + clamp(1260px, 190svh, 1930px) + var(--mast-closeup-hold));
}
.is-mast-ready[data-mast-continuous] .mast-visual { background: none; }
.is-mast-ready[data-mast-continuous] .mast-copy {
  display: grid;
  align-content: start;
}
.is-mast-ready[data-mast-continuous] .mast-chapter {
  grid-area: 1 / 1;
  opacity: var(--mast-chapter-opacity, 0);
  transform: translateY(var(--mast-chapter-y, 0px));
  animation: none;
  pointer-events: none;
}
.is-mast-ready[data-mast-continuous] .mast-chapter.is-current { pointer-events: auto; }
.is-mast-ready[data-mast-continuous] .mast-chapter:first-child { --mast-chapter-opacity: 1; }
.is-mast-ready[data-mast-continuous] .mast-progress {
  grid-row: 2;
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
}

.is-mast-ready .mast-drone {
  display: block;
  position: absolute;
  inset: 0;
  opacity: var(--mast-drone-opacity, 0);
  transform: translateY(calc(12px * (1 - var(--mast-drone-opacity, 0))));
  pointer-events: none;
}
.mast-drone-aircraft {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@media (min-width: 768px), (min-width: 600px) and (max-height: 510px) and (orientation: landscape) {
  .is-mast-ready .mast-visual {
    position: absolute;
    inset: 12px auto 20px 0;
    width: 56%;
    height: auto;
    transform: translateX(calc(var(--mast-side, 1) * 78.5714%));
  }
  .is-mast-ready .mast-copy {
    position: absolute;
    top: 50%;
    left: 60%;
    width: 40%;
    opacity: var(--mast-copy-opacity, 1);
    transform: translate(calc(var(--mast-side, 1) * -150%), -50%);
  }
  .is-mast-ready[data-mast-continuous] .mast-copy {
    inset: 12px 0 20px;
    width: auto;
    grid-template-rows: 1fr auto;
    opacity: 1;
    transform: none;
    pointer-events: none;
  }
  .is-mast-ready[data-mast-continuous] .mast-chapter {
    width: 40%;
    align-self: center;
    justify-self: start;
    translate: clamp(64px, 14vw, 260px) 0;
  }
  .is-mast-ready[data-mast-continuous] .mast-chapter:nth-child(even) {
    justify-self: end;
    translate: calc(-1 * clamp(64px, 14vw, 260px)) 0;
  }
  .is-mast-ready[data-mast-continuous] .mast-progress {
    width: 118px;
    margin: 0;
    justify-self: center;
  }
  .is-mast-ready[data-mast-continuous]:dir(rtl) .mast-visual {
    transform: translateX(calc((1 - var(--mast-side, 1)) * 78.5714%));
  }
}

@media (min-width: 768px) and (max-width: 1200px) {
  .is-mast-ready[data-mast-continuous] .mast-chapter { translate: 8vw 0; }
  .is-mast-ready[data-mast-continuous] .mast-chapter:nth-child(even) { translate: -8vw 0; }
}

/* Keep the camera head and wheels in view in a wide, short hero. */
@media (min-width: 768px) and (min-aspect-ratio: 17/10) {
  [data-extended-hero] { background: var(--color-bg); }
  [data-extended-hero] :is(img, video) {
    inset: 0 0 0 auto;
    width: auto;
    max-width: 100%;
    height: 100%;
    aspect-ratio: 16 / 9;
    object-fit: contain;
    mask-image: linear-gradient(90deg, transparent, #000 27%);
  }
}

@media (max-width: 767px) and (orientation: portrait), (max-width: 599px), (max-width: 767px) and (min-height: 511px) {
  [data-extended-hero] :is(img, video) { object-position: 80% center; }
  .mast-story { --mast-sticky-top: 54px; }
  .mast-stage { grid-template-columns: 1fr; gap: 12px; }
  .mast-visual { height: min(475px, 60svh); }
  .is-mast-ready .mast-stage {
    grid-template-rows: minmax(0, 1fr) auto;
    padding-block: 3px 14px;
    align-items: stretch;
  }
  .mast-story[data-mast-continuous].is-mast-ready:has(.mast-drone) {
    height: calc(100svh + clamp(880px, 132svh, 1450px) + var(--mast-closeup-hold));
  }
  .is-mast-ready .mast-visual {
    --mast-mobile-zoom: var(--mast-head-zoom, 0);
    transform: translateX(calc((var(--mast-side, 1) - .5) * 14px * (1 - var(--mast-mobile-zoom))))
      scale(calc(1 + .12 * var(--mast-mobile-zoom)));
  }
  .mast-marker:not(.mast-visint-marker, .mast-visint-detail-marker, .mast-solar-marker) text { display: none; }
  .mast-visint-detail-marker text { font-size: 78px; letter-spacing: .02em; }
  .mast-label-wide { display: none; }
  .mast-label-stacked { display: block; }
  .mast-label-sigint { transform: translateY(25px); }
  .mast-chapter h2 { font-size: clamp(27px, 8.2vw, 46px); }
  .mast-chapter p { font-size: clamp(14px, 4vw, 17px); line-height: 1.4; }
  .mast-progress { margin-top: 12px; }
}

@media (max-width: 1023px) and (max-height: 510px) and (orientation: landscape) {
  .mast-story[data-mast-continuous].is-mast-ready:has(.mast-drone) {
    height: calc(100svh + 860px + var(--mast-closeup-hold));
  }
  .mast-chapter h2 { font-size: clamp(23px, 4.5vw, 40px); }
  .mast-chapter p { font-size: 15px; line-height: 1.45; }
  .mast-chapter .eyebrow { margin-block-end: 6px; }
}
