/* Our Flight Record: layered daylight scene. Without the script this is one composed still (no trail, no arrows).
   Every rule is scoped under .flight so nothing leaks into the rest of the page. */

.flight { position: relative; height: 100vh; min-height: 560px; }
/* js/flight.js sets the pinned section's height */
.flight .stage { position: relative; height: 100vh; min-height: 560px; overflow: hidden; }
.flight.motion .stage { position: sticky; top: 0; }

/* the sky is see-through at both ends, so the section meets the page's own background above and below */
.flight .sky { position: absolute; inset: -12vh 0 0; background: linear-gradient(rgba(228, 236, 255, 0) 12vh, #E4ECFF 30vh, #F3F7FF 62%, rgba(243, 247, 255, 0)); }
.flight .sky, .flight .far, .flight .earth, .flight .near, .flight .head { will-change: transform; }

.flight .far { position: absolute; left: -30vw; bottom: 34vh; width: 160vw; height: auto; transform: translate(-3vw, 9vh); }

.flight .earth { position: absolute; left: 50%; top: 52vh; width: 95vw; margin-left: -47.5vw; aspect-ratio: 1; transform: translateY(16vh); }
.flight .earth img { display: block; width: 100%; height: 100%; animation: fl-spin 420s linear infinite; }
.flight.off .earth img { animation-play-state: paused; }
@keyframes fl-spin { to { transform: rotate(360deg); } }

/* rocket and trail are drawn here, above the globe; the script cuts the globe's disc out of whatever is on its far side */
.flight .scene { position: absolute; inset: 0; width: 100%; height: 100%; }
.flight .ship-still { position: absolute; left: 50vw; top: 40vh; width: 42vmin; height: 42vmin; transform: translate(-50%, -50%); }

/* two separate clouds over the launch: near-l in front (bigger, lower), near-r behind it (smaller, higher).
   Each image's cloud is centred at about 51% of its width. Default transforms = the parted frame. */
.flight .near { position: absolute; height: auto; }
.flight .near-l { width: 60vw; left: 11.9vw; bottom: -9vh; transform: translateX(-48vw) scale(1.12); }
.flight .near-r { width: 46vw; left: 36.5vw; bottom: -2vh; transform: translate(34vw, -3vh) scale(1.04); }
/* the exit: a white mist rises from the bottom so the stage ends in the page's own white */
.flight .fog { position: absolute; left: 0; right: 0; bottom: 0; height: 80%; background: linear-gradient(rgba(255, 255, 255, 0), #fff 58%); opacity: 0; pointer-events: none; }

/* --fl-top / --fl-top-m: where the heading starts; a page with a fixed bar sets them to clear it */
.flight .head { position: absolute; top: var(--fl-top, 48px); left: 64px; max-width: 440px; }
.flight .eyebrow { margin: 0 0 10px; text-transform: uppercase; font-weight: 600; font-size: 13px; letter-spacing: .16em; color: #1E4ED8; }
.flight .head h2 { margin: 0; font: 600 clamp(38px, 4.4vw, 62px)/1.04 Fraunces, Georgia, serif; letter-spacing: -.01em; }
.flight .lede { margin: 12px 0 0; font-size: 18px; color: #3B4A6B; }

/* callouts: an arrow from a point on the rocket to each square card */
.flight .leads { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.flight .ln { fill: none; stroke: #1E4ED8; stroke-width: 1.5; stroke-dasharray: 1; stroke-linejoin: round; transition: stroke-width .2s; }
.flight .tip { fill: #1E4ED8; }
.flight .dot { fill: #fff; stroke: #1E4ED8; stroke-width: 1.5; transition: r .2s; }
.flight .hot .ln { stroke-width: 2.5; }
.flight .hot .dot { r: 6px; }

.flight .stats { display: contents; }
.flight .col { position: absolute; display: flex; flex-direction: column; gap: 22px; }
.flight .col-l { left: max(64px, 7vw); top: max(31vh, calc(var(--fl-top, 48px) + 214px)); }
.flight .col-r { right: max(64px, 7vw); top: max(13vh, calc(var(--fl-top, 48px) + 30px)); }
/* --b runs 0 to 1 as the blue block slides off; each part of the card follows it by its own --i */
.flight .stat { --b: 1; position: relative; width: 292px; background: #fff; border: 1px solid #C9D6F5; border-radius: 0; padding: 14px 20px 14px; box-shadow: 0 14px 28px -20px rgba(15, 30, 70, .45); transition: translate .2s, box-shadow .2s; }
.flight .stat::after { content: ''; position: absolute; inset: -1px -3px; background: #1E4ED8; transform: scaleX(calc(1 - var(--b))); transform-origin: right; pointer-events: none; }
.flight .stat:hover, .flight .stat:focus-within { translate: 0 -3px; box-shadow: 0 24px 34px -22px rgba(15, 30, 70, .55); }
.flight .col-l .stat { border-right: 3px solid #1E4ED8; }
.flight .col-l .stat::after { transform-origin: left; }
.flight .c2, .flight .c3 { border-left: 3px solid #1E4ED8; }
.flight .stat header, .flight .faces a, .flight .cap, .flight .rows li, .flight .tiles i, .flight .note { --v: clamp(0, (var(--b) - var(--i, 0) * .1) * 4, 1); opacity: var(--v); translate: 0 calc((1 - var(--v)) * 8px); }
.flight .stat header { display: flex; align-items: baseline; gap: 12px; }
.flight .num { margin: 0; font: 600 46px/1 Fraunces, Georgia, serif; color: #1E4ED8; font-variant-numeric: tabular-nums; }
.flight .stat h3 { margin: 0; font-size: 16px; font-weight: 600; }
.flight .stat h3 a { color: inherit; text-decoration: none; }
.flight .stat h3 a:hover { color: #1E4ED8; }
.flight .stat a:focus-visible { outline: 2px solid #1E4ED8; outline-offset: 2px; }

.flight .faces { display: flex; gap: 6px; margin: 12px 0 8px; }
.flight .faces a { width: 44px; height: 44px; display: grid; place-items: center; overflow: hidden; background: #EAF0FF; color: #1E4ED8; font-weight: 600; font-size: 14px; text-decoration: none; transition: background .2s, color .2s; }
.flight .faces a:nth-child(1) { --i: 1; } .flight .faces a:nth-child(2) { --i: 1.6; } .flight .faces a:nth-child(3) { --i: 2.2; } .flight .faces a:nth-child(4) { --i: 2.8; } .flight .faces a:nth-child(5) { --i: 3.4; }
.flight .faces img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1); transition: filter .3s; }
.flight .faces a:hover, .flight .faces a:focus-visible { background: #1E4ED8; color: #fff; }
.flight .faces a:hover img, .flight .faces a:focus-visible img { filter: none; }
.flight .cap { --i: 4.5; margin: 0; min-height: 1.5em; font-size: 13px; color: #46557A; }

/* one square per student */
.flight .tiles { display: flex; gap: 5px; margin: 12px 0 8px; }
.flight .tiles i { width: 22px; height: 22px; background: #1E4ED8; }
.flight .note { --i: 5; margin: 0; font-size: 13px; color: #46557A; }

.flight .rows { list-style: none; margin: 10px 0 0; padding: 0; }
.flight .rows li { border-top: 1px solid #E1E8FA; }
.flight .rows li:nth-child(1) { --i: 1.5; } .flight .rows li:nth-child(2) { --i: 2.5; } .flight .rows li:nth-child(3) { --i: 3.5; } .flight .rows li:nth-child(4) { --i: 4.5; }
.flight .rows a, .flight .rows li > span { display: flex; align-items: center; gap: 8px; padding: 7px 0; font-size: 14px; font-weight: 500; color: #0F1E46; text-decoration: none; }
.flight .rows em { margin-left: auto; font-style: normal; font-size: 12px; color: #46557A; }
.flight .rows a::after { content: '\2197'; color: #1E4ED8; transition: translate .2s; }
.flight .rows a:hover { color: #1E4ED8; }
.flight .rows a:hover::after { translate: 2px -2px; }

@media (max-aspect-ratio: 4/5) {
  .flight .earth { top: 51vh; width: 150vw; margin-left: -75vw; transform: translateY(8vh); }
  .flight .far { bottom: 36vh; width: 260vw; left: -80vw; }
  .flight .ship-still { left: 52vw; top: 31vh; width: 58vmin; height: 58vmin; }
  .flight .near-l { width: 125vw; left: -24.9vw; bottom: -5vh; transform: translateX(-72vw) scale(1.1); }
  .flight .near-r { width: 100vw; left: 13vw; bottom: 2vh; transform: translate(55vw, -2vh) scale(1.04); }
  .flight .head { top: var(--fl-top-m, 28px); left: 22px; right: 22px; }
  .flight .head h2 { font-size: 36px; }
  .flight .lede { font-size: 16px; margin-top: 8px; }
  /* stacked cards: each is one row; the title's link covers the whole card */
  .flight .stats { position: absolute; left: 42px; right: 22px; bottom: 3.5vh; display: grid; gap: 8px; }
  .flight .col { position: static; display: contents; }
  .flight .stat, .flight .col-l .stat { position: relative; left: auto; top: auto; width: auto; display: grid; grid-template-columns: 44px 1fr; column-gap: 12px; align-items: center; padding: 9px 14px; border-right: 1px solid #C9D6F5; border-left: 3px solid #1E4ED8; }
  .flight .col-l .stat::after { transform-origin: right; }
  .flight .stat:hover, .flight .stat:focus-within { translate: none; }
  .flight .stat header { display: contents; }
  .flight .num { grid-row: 1 / span 2; font-size: 38px; text-align: center; }
  .flight .stat h3 { font-size: 15px; }
  .flight .stat h3 a::before { content: ''; position: absolute; inset: 0; }
  .flight .faces { grid-column: 2; margin: 5px 0 0; gap: 4px; }
  .flight .faces a { width: 30px; height: 30px; font-size: 11px; pointer-events: none; }
  .flight .cap, .flight .note { display: none; }
  .flight .tiles { grid-column: 2; margin: 6px 0 2px; gap: 3px; }
  .flight .tiles i { width: 14px; height: 14px; }
  .flight .rows { grid-column: 2; display: flex; flex-wrap: wrap; gap: 0 12px; margin: 1px 0 0; }
  .flight .rows li { border: 0; }
  .flight .c2 .rows a, .flight .c2 .rows li > span { padding: 0; font-size: 13px; font-weight: 400; color: #46557A; pointer-events: none; }
  .flight .c2 .rows a::after { content: none; }
  .flight .c2 .rows em { display: none; }
  .flight .c2 .rows em.dev { display: inline; margin-left: 0; }
  .flight .c2 .rows em.dev::before { content: '('; } .flight .c2 .rows em.dev::after { content: ')'; }
  .flight .c3 .rows a { position: relative; min-height: 44px; padding: 0; color: #1E4ED8; }
  .flight .c3 .rows em { display: none; }
}
/* small phones: tighter cards so the rocket keeps its room */
@media (max-aspect-ratio: 4/5) and (max-height: 640px) {
  .flight .stats { gap: 6px; bottom: 2.5vh; }
  .flight .stat, .flight .c1 { padding: 7px 12px; }
  .flight .faces, .flight .c2 .rows { display: none; } /* short screens: titles, squares and platform links only */
  .flight .num { font-size: 32px; }
  .flight .tiles i { width: 11px; height: 11px; }
  .flight .c2 .rows em.dev { display: none; }
  .flight .c3 .rows a { min-height: 36px; }
}
@media (max-aspect-ratio: 4/5) and (max-height: 640px) { .flight .lede { display: none; } }
@media (prefers-reduced-motion: reduce) { .flight .earth img { animation: none; } .flight .stat, .flight .ln, .flight .dot, .flight .faces img, .flight .rows a::after { transition: none; } }
