/* See The Bravo — features page. Design notes: scenes are sticky full-screen stages; each one
   rises over the last. Scroll position arrives as --e (entering), --p (progress) and --x (leaving). */

:root {
  --night: #070714;
  --ink: #eef2f7;
  --haze: #8e9ab0;
  --tag: #86f0d9;
  --glide: #63e68b;
  --text-muted: rgba(238, 242, 247, 0.5);
  --text-primary: var(--ink);
  --gutter: clamp(1rem, 5.5vw, 5.5rem);
  --display: "Archivo", "Inter", system-ui, sans-serif;
  --data: "B612", "Archivo", system-ui, sans-serif;
  --mono: "B612 Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

html {
  background: var(--night);
  color-scheme: dark;
}

body.fx {
  background: var(--night);
  color: var(--ink);
  font-family: var(--display);
  font-stretch: 100%;
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

.fx a {
  color: inherit;
}

.lede a {
  text-decoration: underline;
  text-decoration-color: rgba(134, 240, 217, 0.6);
  text-underline-offset: 0.2em;
  transition: color 0.2s ease;
}

.lede a:hover {
  color: var(--tag);
}

:focus-visible {
  outline: 2px solid var(--tag);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  z-index: 2000;
  padding: 0.5rem 0.9rem;
  background: var(--ink);
  color: var(--night);
  border-radius: 6px;
}

.skip:focus {
  left: 0.5rem;
}

/* ---------- Navigation ---------- */

.fx-nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem var(--gutter);
  background: linear-gradient(180deg, rgba(7, 7, 20, 0.7), rgba(7, 7, 20, 0));
}

.fx-nav .logo {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  text-decoration: none;
  white-space: nowrap;
}

.fx-nav .logo-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}

.fx-nav-links {
  display: flex;
  align-items: center;
  gap: clamp(0.9rem, 2vw, 1.75rem);
  font-size: 0.95rem;
}

.fx-nav-links a {
  text-decoration: none;
  color: rgba(238, 242, 247, 0.75);
  transition: color 0.2s ease;
}

.fx-nav-links a:hover,
.fx-nav-links a[aria-current="page"] {
  color: var(--ink);
}

/* ---------- Scenes ---------- */

.scene {
  --e: 1;
  --p: 0;
  --x: 0;
  position: relative;
  height: calc(var(--len, 3) * 100svh);
}

.scene + .scene {
  margin-top: -100svh;
}

.stage {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
  background: var(--night);
  border-radius: calc((1 - var(--e)) * 36px) calc((1 - var(--e)) * 36px) 0 0;
  transform: scale(calc(1 - var(--x) * 0.07));
  transform-origin: 50% 30%;
  will-change: transform;
  isolation: isolate;
}

/* footage layer: moves slower than its frame while the scene rises */
.media {
  position: absolute;
  inset: -4svh 0;
  transform: translate3d(0, calc((1 - var(--e)) * -26svh + var(--x) * 10svh), 0)
    scale(calc(1.06 - var(--e) * 0.04));
  will-change: transform;
}

.shot {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.shot.is-on {
  opacity: 1;
}

.shot video,
.shot img,
.shot canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* legibility: a low wash from the bottom-left corner where the words sit */
.scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 75% at 0% 100%, rgba(5, 6, 16, 0.82) 0%, rgba(5, 6, 16, 0.45) 38%, rgba(5, 6, 16, 0) 70%),
    linear-gradient(0deg, rgba(5, 6, 16, 0.55) 0%, rgba(5, 6, 16, 0) 35%),
    linear-gradient(180deg, rgba(5, 6, 16, 0.45) 0%, rgba(5, 6, 16, 0) 18%);
}

/* the scene underneath sinks back and dims as the next one arrives */
.dim {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: #04040c;
  opacity: calc(var(--x) * 0.7);
}

.copy {
  position: absolute;
  z-index: 3;
  left: var(--gutter);
  right: var(--gutter);
  bottom: clamp(2.5rem, 9svh, 7rem);
  max-width: 62rem;
}

#top .copy {
  max-width: 82rem;
}

.copy > * {
  --k: clamp(0, calc((var(--e) - 0.5 - var(--i, 0) * 0.07) * 5), 1);
  opacity: var(--k);
  transform: translate3d(0, calc((1 - var(--k)) * 2.2rem), 0);
}

.copy > :nth-child(2) { --i: 1; }
.copy > :nth-child(3) { --i: 2; }
.copy > :nth-child(4) { --i: 3; }

.headline {
  font-stretch: 125%;
  font-weight: 760;
  font-size: clamp(2.5rem, 6.4vw, 6.6rem);
  line-height: 0.94;
  letter-spacing: -0.025em;
  text-wrap: balance;
  margin-bottom: 0.32em;
}

h1.headline {
  font-size: clamp(2.5rem, min(5.6vw, 9svh), 7.4rem);
  line-height: 0.88;
  letter-spacing: -0.035em;
}

.lede {
  max-width: 44ch;
  font-size: clamp(1.02rem, 1.25vw, 1.22rem);
  line-height: 1.6;
  color: rgba(238, 242, 247, 0.86);
  text-wrap: pretty;
}

.lede + .lede {
  margin-top: 0.8rem;
}

/* data blocks: real places and live values, stacked like the app's aircraft tags */
.tagblock {
  position: absolute;
  z-index: 3;
  top: clamp(5rem, 13svh, 8rem);
  right: var(--gutter);
  font-family: var(--data);
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--tag);
  text-align: right;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
  font-variant-numeric: tabular-nums;
  opacity: clamp(0, calc((var(--e) - 0.75) * 5 * 0.75), 0.75);
}

.tagblock > div {
  transition: opacity 0.45s ease;
}

.tagblock .tag-swap {
  position: absolute;
  right: 0;
  top: 0;
  white-space: nowrap;
  opacity: 0;
}

.tagblock .tag-swap.is-on {
  opacity: 1;
}

.tagblock .faint {
  color: rgba(238, 242, 247, 0.62);
}

.cue {
  position: absolute;
  z-index: 3;
  right: var(--gutter);
  bottom: clamp(2.5rem, 9svh, 7rem);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: rgba(238, 242, 247, 0.7);
  opacity: calc(1 - var(--p) * 4);
}

.cue span {
  width: 1px;
  height: 46px;
  background: linear-gradient(180deg, rgba(238, 242, 247, 0), rgba(238, 242, 247, 0.85));
  transform-origin: top;
  animation: drop 2.2s ease-in-out infinite;
}

@keyframes drop {
  0% { transform: scaleY(0); opacity: 1; }
  60% { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1); opacity: 0; }
}

/* ---------- Scene details ---------- */

.places {
  position: absolute;
  z-index: 3;
  right: var(--gutter);
  bottom: clamp(2.5rem, 9svh, 7rem);
  list-style: none;
  text-align: right;
  font-stretch: 112%;
  font-weight: 600;
  font-size: clamp(0.95rem, 1.35vw, 1.3rem);
  line-height: 1.55;
  opacity: clamp(0, calc((var(--e) - 0.7) * 4), 1);
}

.places li {
  color: rgba(238, 242, 247, 0.38);
  transition: color 0.4s ease, transform 0.4s ease;
}

.places li.is-on {
  color: var(--ink);
  transform: translateX(-0.4rem);
}

.places li small {
  display: block;
  height: 0;
  overflow: hidden;
  font-family: var(--data);
  font-weight: 400;
  font-stretch: 100%;
  font-size: 0.72rem;
  color: var(--tag);
  transition: height 0.4s ease;
}

.places li.is-on small {
  height: 1.4em;
}

.layers {
  columns: 3 11rem;
  column-gap: 1.5rem;
  margin-top: 1.1rem;
  max-width: 44rem;
  list-style: none;
  font-size: 0.9rem;
  line-height: 1.75;
  color: rgba(238, 242, 247, 0.78);
}

.layers li::before {
  content: "";
  display: inline-block;
  width: 0.4rem;
  height: 0.4rem;
  margin-right: 0.55rem;
  border-radius: 50%;
  background: var(--tag);
  vertical-align: 0.12em;
  opacity: 0.8;
}

/* copy that changes with the shot inside a scene */
.copy .swap {
  display: grid;
}

.copy .swap > * {
  grid-area: 1 / 1;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.copy .swap > .is-on {
  opacity: 1;
  pointer-events: auto;
}

/* ---------- Hangar (3D models) ---------- */

.hangar-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(80% 60% at 50% 40%, #1d2440 0%, #0d1024 48%, #070714 100%);
}

#hangar {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
  cursor: grab;
}

#hangar:active {
  cursor: grabbing;
}

.types {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.types button {
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: rgba(238, 242, 247, 0.8);
  background: rgba(238, 242, 247, 0.06);
  border: 1px solid rgba(238, 242, 247, 0.16);
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.types button:hover {
  background: rgba(238, 242, 247, 0.12);
}

.types button[aria-pressed="true"] {
  color: var(--night);
  background: var(--ink);
  border-color: var(--ink);
}

.hangar-status {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  font-family: var(--data);
  font-size: 0.8rem;
  color: var(--haze);
}

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

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.6rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 1.35rem;
  border-radius: 999px;
  font-weight: 650;
  font-size: 0.98rem;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  font-family: inherit;
  transition: transform 0.2s ease, background 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.fx a.btn-primary,
.btn-primary {
  background: var(--ink);
  color: var(--night);
}

.btn-quiet {
  background: rgba(238, 242, 247, 0.08);
  border-color: rgba(238, 242, 247, 0.25);
  color: var(--ink);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.btn svg {
  width: 1rem;
  height: 1rem;
}

.honesty {
  position: relative;
  z-index: 1;
  background: var(--night);
  padding: 2.2rem var(--gutter) 2rem;
  font-size: 0.86rem;
  line-height: 1.6;
  color: var(--haze);
}

.honesty p {
  max-width: 70ch;
}

.honesty p + p {
  margin-top: 0.5rem;
}

footer {
  position: relative;
  z-index: 1;
  background: #030308;
  padding: 1.5rem 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* ---------- Film modal ---------- */

.film {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(3, 3, 10, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.film[hidden] {
  display: none;
}

.film-frame {
  width: min(100%, 1280px, calc(86vh * 16 / 9));
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.film-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.film button {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  border: 1px solid rgba(238, 242, 247, 0.3);
  background: rgba(238, 242, 247, 0.1);
  color: var(--ink);
  font-size: 1.3rem;
  cursor: pointer;
}

/* ---------- Small screens ---------- */

@media (max-width: 760px) {
  .fx-nav-links .hide-sm {
    display: none;
  }

  .fx-nav .logo {
    font-size: 1.05rem;
    gap: 0.55rem;
  }

  .fx-nav .logo-icon {
    width: 30px;
    height: 30px;
  }

  .tagblock {
    top: 4.6rem;
    font-size: 0.72rem;
  }

  .copy {
    bottom: 2rem;
  }

  .scrim {
    background:
      linear-gradient(0deg, rgba(5, 6, 16, 0.9) 0%, rgba(5, 6, 16, 0.6) 34%, rgba(5, 6, 16, 0) 62%),
      linear-gradient(180deg, rgba(5, 6, 16, 0.5) 0%, rgba(5, 6, 16, 0) 22%);
  }

  .places {
    display: none;
  }

  .tagblock.with-places {
    display: none;
  }

  .layers {
    columns: 2;
    font-size: 0.8rem;
    line-height: 1.6;
  }

  .cue {
    display: none;
  }
}

/* ---------- Reduced motion: no scroll-tied movement, no autoplay ---------- */

@media (prefers-reduced-motion: reduce) {
  .stage,
  .media,
  .copy > * {
    transform: none !important;
  }

  .copy > *,
  .places {
    opacity: 1 !important;
  }

  .tagblock {
    opacity: 0.75 !important;
  }

  .cue span {
    animation: none;
  }

  .shot {
    transition: none;
  }
}

/* scenes whose footage has its subject on the left: words go right, data tags go left */
.flip .copy {
  left: auto;
  max-width: min(40rem, calc(100% - 2 * var(--gutter)));
}

.flip .tagblock {
  right: auto;
  left: var(--gutter);
  text-align: left;
}

.flip .tagblock .tag-swap {
  right: auto;
  left: 0;
}

.flip .scrim {
  background:
    radial-gradient(110% 80% at 100% 100%, rgba(5, 6, 16, 0.88) 0%, rgba(5, 6, 16, 0.5) 40%, rgba(5, 6, 16, 0) 72%),
    linear-gradient(0deg, rgba(5, 6, 16, 0.5) 0%, rgba(5, 6, 16, 0) 30%),
    linear-gradient(180deg, rgba(5, 6, 16, 0.45) 0%, rgba(5, 6, 16, 0) 18%);
}

.flip .headline {
  font-size: clamp(2.4rem, 5vw, 5.2rem);
}

/* the weather layers, in a column of their own */
.layers-aside {
  position: absolute;
  z-index: 3;
  right: var(--gutter);
  bottom: clamp(2.5rem, 9svh, 7rem);
  width: min(26rem, 34vw);
  opacity: clamp(0, calc((var(--e) - 0.7) * 4), 1);
}

.layers-aside h3 {
  font-size: 0.95rem;
  font-weight: 650;
  margin-bottom: 0.4rem;
}

.layers-aside .layers {
  columns: 2;
  margin-top: 0;
}

.layers-hint {
  margin-left: 0.5rem;
  font-weight: 400;
  font-size: 0.8rem;
  color: rgba(238, 242, 247, 0.55);
}

.layers button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-align: left;
  transition: color 0.2s ease;
}

.layers button:hover,
.layers button[aria-pressed="true"] {
  color: var(--ink);
}

.layers button:focus-visible {
  outline: 2px solid var(--tag);
  outline-offset: 3px;
  border-radius: 3px;
}

/* layers with a screenshot read brighter than the rest of the list */
.layers-aside .layers li:not(:has(button)) {
  color: rgba(238, 242, 247, 0.5);
}

.layers-aside .layers li:not(:has(button))::before {
  opacity: 0.35;
}

.layers li:has(button[aria-pressed="true"])::before {
  opacity: 1;
  box-shadow: 0 0 0 3px rgba(134, 240, 217, 0.25);
}

/* a weather layer's screenshot fades in over the scene's clip while it is pointed at */
.layer-shots img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.layer-shots img.is-on {
  opacity: 1;
}

@media (max-width: 760px) {
  .flip .copy {
    left: var(--gutter);
    right: var(--gutter);
  }

  .flip .tagblock {
    left: auto;
    right: var(--gutter);
    text-align: right;
  }

  .flip .tagblock .tag-swap {
    left: auto;
    right: 0;
  }

  .layers-aside {
    display: none;
  }
}

/* words on both sides: darken the bottom-right corner too */
.both-sides .scrim {
  background:
    radial-gradient(120% 75% at 0% 100%, rgba(5, 6, 16, 0.82) 0%, rgba(5, 6, 16, 0.45) 38%, rgba(5, 6, 16, 0) 70%),
    radial-gradient(70% 60% at 100% 100%, rgba(5, 6, 16, 0.78) 0%, rgba(5, 6, 16, 0.35) 45%, rgba(5, 6, 16, 0) 75%),
    linear-gradient(0deg, rgba(5, 6, 16, 0.55) 0%, rgba(5, 6, 16, 0) 35%),
    linear-gradient(180deg, rgba(5, 6, 16, 0.45) 0%, rgba(5, 6, 16, 0) 18%);
}

/* a scene with a copy block per shot */
.copy[data-shot] {
  transition: opacity 0.5s ease;
}

.copy[data-shot]:not(.is-on) {
  opacity: 0;
  pointer-events: none;
}

.flip .copy.compact {
  left: var(--gutter);
  right: var(--gutter);
  max-width: 64rem;
}

.compact .headline {
  font-size: clamp(2.2rem, 4.3vw, 4.4rem);
}

.compact .lede {
  max-width: 62ch;
}

.flip .scrim {
  background:
    radial-gradient(110% 80% at 100% 100%, rgba(5, 6, 16, 0.85) 0%, rgba(5, 6, 16, 0.45) 40%, rgba(5, 6, 16, 0) 72%),
    linear-gradient(0deg, rgba(5, 6, 16, 0.8) 0%, rgba(5, 6, 16, 0.45) 24%, rgba(5, 6, 16, 0) 42%),
    linear-gradient(180deg, rgba(5, 6, 16, 0.45) 0%, rgba(5, 6, 16, 0) 18%);
}

/* scenes whose aircraft fly low in the frame: words go up in the sky, data tags go down */
.layout-top .copy {
  top: clamp(5.5rem, 15svh, 9.5rem);
  bottom: auto;
}

.layout-top .headline {
  font-size: clamp(2.4rem, 5.2vw, 5.4rem);
}

.layout-top .tagblock {
  top: auto;
  bottom: clamp(2rem, 6svh, 4.5rem);
}

.layout-top .tagblock .tag-swap {
  top: auto;
  bottom: 0;
}

.layout-top .scrim {
  background:
    radial-gradient(110% 70% at 0% 0%, rgba(5, 6, 16, 0.78) 0%, rgba(5, 6, 16, 0.4) 40%, rgba(5, 6, 16, 0) 72%),
    linear-gradient(180deg, rgba(5, 6, 16, 0.55) 0%, rgba(5, 6, 16, 0) 30%),
    linear-gradient(0deg, rgba(5, 6, 16, 0.4) 0%, rgba(5, 6, 16, 0) 20%);
}

@media (max-width: 760px) {
  .layout-top .copy {
    top: 4.8rem;
  }

  .layout-top .scrim {
    background:
      linear-gradient(180deg, rgba(5, 6, 16, 0.88) 0%, rgba(5, 6, 16, 0.55) 34%, rgba(5, 6, 16, 0) 60%),
      linear-gradient(0deg, rgba(5, 6, 16, 0.45) 0%, rgba(5, 6, 16, 0) 22%);
  }
}

/* the weather scene's aircraft fly mid-frame: a smaller headline keeps the words below them */
#weather .headline {
  font-size: clamp(2.4rem, 5.2vw, 5.4rem);
}

/* the maps scene's flight bag fills a phone's width down to the bottom: its tags would sit on the window's buttons */
@media (max-width: 760px) {
  #maps .tagblock {
    display: none;
  }
}
