/* Home page: preloader + cinematic scroll stage (dark mission theme). */

/* ---------- Preloader (Feadship-inspired: fine-line compass, coordinates, enter) ---------- */
.preloader { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: #040608; color: #dfe6ea;
  transition: opacity .9s cubic-bezier(.6,0,.2,1), visibility .9s; }
.preloader.is-gone { opacity: 0; visibility: hidden; pointer-events: none; }
.preloader__horizon { position: absolute; left: 0; right: 0; top: 50%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.14) 20%, rgba(255,255,255,.14) 80%, transparent); }
.preloader__core { position: relative; display: grid; justify-items: center; gap: 30px; }
.compass { width: min(46vw, 230px); height: auto; overflow: visible; }
.compass__ticks { transform-origin: 120px 120px; animation: compass-spin 24s linear infinite; }
.compass__needle { transform-origin: 120px 120px; transform: rotate(var(--heading, -40deg)); transition: transform 1.6s cubic-bezier(.2,.8,.2,1); }
.compass text { font: 500 11px var(--mono); fill: #dfe6ea; letter-spacing: .1em; }
@keyframes compass-spin { to { transform: rotate(360deg); } }
.preloader__meta { display: grid; justify-items: center; gap: 10px; font: 500 11px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: #8f989e; }
.preloader__count { color: #dfe6ea; font-variant-numeric: tabular-nums; }
.preloader__enter { margin-top: 6px; padding: 16px 30px; border: 1px solid rgba(255,255,255,.35); border-radius: 2px; background: none; color: #f2f4f5;
  font: 500 12px/1 var(--mono); letter-spacing: .2em; text-transform: uppercase; cursor: pointer; opacity: 0; transform: translateY(8px);
  transition: opacity .6s, transform .6s, background .25s, color .25s; pointer-events: none; }
.preloader.is-ready .preloader__enter { opacity: 1; transform: none; pointer-events: auto; }
.preloader__enter:hover, .preloader__enter:focus-visible { background: #f2f4f5; color: #050607; }
.preloader__brand { position: absolute; top: 34px; left: 50%; transform: translateX(-50%); font: 600 20px/1 var(--display); letter-spacing: .24em; white-space: nowrap; text-transform: uppercase; }
.preloader__brand { display: flex; align-items: center; gap: 14px; }
.preloader__brand .brand__mark { width: 26px; height: 26px; color: #f2f4f5; }
.preloader__foot { position: absolute; bottom: 30px; left: 0; right: 0; display: flex; justify-content: space-between; padding: 0 clamp(20px, 4vw, 48px);
  font: 500 10px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: #5f686e; }
html.is-loading, html.is-loading body { overflow: hidden; }

/* ---------- Stage ---------- */
.mh-root { position: relative; }
.mh-stage { position: fixed; inset: 0; z-index: 1; overflow: hidden; background: #040608; }
.mh-shot { position: absolute; inset: 0; overflow: hidden; opacity: 0; will-change: opacity; }
.mh-shot__poster, .mh-shot__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.mh-shot__video { z-index: 1; }
.mh-shot.has-video .mh-shot__poster { opacity: 0; }
.mh-shot__fallback { display: none; }
/* The "dark filter": a cool, cinematic grade over every frame, deepest on the left where the copy sits. */
.mh-stage::after { content: ""; position: absolute; inset: 0; z-index: 4; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(3,5,7,.86) 0%, rgba(3,5,7,.5) 32%, rgba(3,5,7,.08) 62%, rgba(3,5,7,.25) 100%),
    linear-gradient(180deg, rgba(3,5,7,.55) 0%, transparent 18%, transparent 72%, rgba(3,5,7,.8) 100%),
    radial-gradient(ellipse at 60% 45%, transparent 50%, rgba(0,0,0,.45) 100%); }
/* Fine HUD frame: corner ticks and a centre crosshair, like a viewfinder. */
.mh-stage::before { content: ""; position: absolute; inset: clamp(14px, 2.4vw, 30px); z-index: 5; pointer-events: none;
  background:
    linear-gradient(#ffffff40, #ffffff40) top left / 18px 1px no-repeat, linear-gradient(#ffffff40, #ffffff40) top left / 1px 18px no-repeat,
    linear-gradient(#ffffff40, #ffffff40) top right / 18px 1px no-repeat, linear-gradient(#ffffff40, #ffffff40) top right / 1px 18px no-repeat,
    linear-gradient(#ffffff40, #ffffff40) bottom left / 18px 1px no-repeat, linear-gradient(#ffffff40, #ffffff40) bottom left / 1px 18px no-repeat,
    linear-gradient(#ffffff40, #ffffff40) bottom right / 18px 1px no-repeat, linear-gradient(#ffffff40, #ffffff40) bottom right / 1px 18px no-repeat; }

.mh-track { position: relative; z-index: 0; pointer-events: none; }
.mh-copy-layer { position: fixed; inset: 0; z-index: 12; pointer-events: none; }
.mh-copy { position: absolute; top: 54%; left: clamp(24px, 6.5vw, 110px); width: min(560px, calc(100vw - 48px)); opacity: 0;
  transform: translateY(-50%); transition: opacity .12s linear; pointer-events: none; color: #eef2f3; }
.mh-copy__index { margin: 0 0 18px; display: flex; align-items: center; gap: 12px; color: var(--accent); font: 500 12px/1 var(--mono); letter-spacing: .14em; }
.mh-copy__index span { color: #5f686e; }
.mh-copy__index::after { content: ""; width: 56px; height: 1px; background: rgba(127,227,238,.5); }
.mh-copy__eyebrow { margin: 0; color: #9aa4a9; font: 500 12px/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.mh-copy h2 { margin: 14px 0 0; font: 600 clamp(44px, 6vw, 96px)/.94 var(--display); letter-spacing: .005em; text-transform: uppercase; text-wrap: balance;
  text-shadow: 0 2px 30px rgba(0,0,0,.5); }
.mh-copy__body { max-width: 440px; margin-top: 20px; color: #b7c0c4; font: 400 clamp(15px, 1.15vw, 17px)/1.65 var(--font); }
.mh-copy__body p { margin: 0; }
.mh-copy__subtitle, .mh-copy__tags { display: none; }
.mh-copy .actions { margin-top: 30px; }

.mh-progress { position: fixed; z-index: 35; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(255,255,255,.06); }
.mh-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--amber)); transform: scaleX(0); transform-origin: left; }
.mh-route { position: fixed; z-index: 30; right: clamp(16px, 2.6vw, 40px); top: 50%; display: flex; flex-direction: column; gap: 14px; transform: translateY(-50%); }
.mh-route__item { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 0; border: 0; background: none; color: #dfe6ea; cursor: pointer; font: 500 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.mh-route__item span { opacity: .4; font-variant-numeric: tabular-nums; }
.mh-route__item i { width: 0; overflow: hidden; font-style: normal; white-space: nowrap; opacity: 0; transition: width .25s, opacity .25s; }
.mh-route__item::after { content: ""; width: 14px; height: 1px; background: rgba(255,255,255,.35); transition: width .25s, background .25s; }
.mh-route__item:hover i, .mh-route__item:focus-visible i, .mh-route__item.is-active i { width: 110px; opacity: 1; }
.mh-route__item.is-active span { color: var(--accent); opacity: 1; }
.mh-route__item.is-active::after { width: 30px; background: var(--accent); }
.mh-hint { position: fixed; z-index: 30; left: 50%; bottom: 30px; transform: translateX(-50%); display: grid; justify-items: center; gap: 10px;
  color: #9aa4a9; font: 500 11px/1 var(--mono); letter-spacing: .2em; text-transform: uppercase; transition: opacity .3s; }
.mh-hint.is-hidden { opacity: 0; }
.mh-hint i { display: block; width: 1px; height: 38px; background: linear-gradient(#9aa4a9, transparent); animation: hint-drop 1.8s ease-in-out infinite; }
@keyframes hint-drop { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* Telemetry readout, bottom left (SpaceX launch-feed feel). */
.telemetry { position: fixed; z-index: 30; left: clamp(24px, 3vw, 44px); bottom: 28px; display: flex; gap: 26px; font: 500 10px/1.5 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: #6c757b; pointer-events: none; transition: opacity .3s; }
.telemetry b { display: block; color: #dfe6ea; font-weight: 500; }

/* Page content scrolls up over the stage. */
#experience ~ section, body > .site-footer { position: relative; z-index: 40; background-color: var(--ink); }
/* A soft dissolve from the last frame into the page, instead of a hard edge. */
.manifesto::before { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 45vh; pointer-events: none;
  background: linear-gradient(180deg, rgba(5,6,7,0), rgba(5,6,7,.75) 60%, var(--ink)); }
.stage-off .mh-stage, .stage-off .mh-copy-layer, .stage-off .mh-route, .stage-off .mh-hint, .stage-off .mh-progress, .stage-off .telemetry { visibility: hidden; }

@media (max-width: 760px) {
  .mh-route, .telemetry { display: none; }
  .preloader__foot span:nth-child(2) { display: none; }
  .preloader__foot { white-space: nowrap; }
  .mh-copy { top: auto; bottom: calc(70px + env(safe-area-inset-bottom)); left: 20px; right: 20px; width: auto; transform: none; }
  .mh-copy h2 { font-size: clamp(40px, 12vw, 58px); }
  .mh-stage::after { background: linear-gradient(180deg, rgba(3,5,7,.45) 0%, transparent 25%, rgba(3,5,7,.6) 55%, rgba(3,5,7,.94) 100%); }
  .mh-shot__poster, .mh-shot__video { object-position: 62% center; }
}
@media (prefers-reduced-motion: reduce) { .compass__ticks, .mh-hint i { animation: none; } }

/* ---------- Mission polish: compass arc, word reveals, manifesto ---------- */
.compass__arc { stroke-dasharray: calc(var(--p, 0) * 100) 100; transform: rotate(-90deg); transform-origin: 120px 120px; transition: stroke-dasharray .2s linear; }
.preloader__status { color: var(--accent); min-height: 1em; }
.preloader__core { animation: pre-in 1.2s cubic-bezier(.2,.8,.2,1) both; }
@keyframes pre-in { from { opacity: 0; transform: scale(.96); } }

.mh-copy h2 .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.mh-copy h2 .w > span { display: inline-block; transform: translateY(108%); transition: transform 1s cubic-bezier(.16,.84,.24,1) calc(var(--i) * 55ms); }
.mh-copy.is-in h2 .w > span { transform: none; }
.mh-copy__body, .mh-copy .actions, .mh-copy__index { opacity: 0; transform: translateY(10px); transition: opacity .8s ease .35s, transform .8s cubic-bezier(.16,.84,.24,1) .35s; }
.mh-copy__index { transition-delay: 0s; }
.mh-copy.is-in .mh-copy__body, .mh-copy.is-in .mh-copy .actions, .mh-copy.is-in .actions, .mh-copy.is-in .mh-copy__index { opacity: 1; transform: none; }
.mh-copy .actions { display: flex; flex-wrap: wrap; gap: 12px; }
html.is-loading .mh-hint, html.is-loading .telemetry, html.is-loading .mh-route { opacity: 0; }
.mh-route, .telemetry, .mh-hint { transition: opacity .8s ease .4s; }

.manifesto { padding: clamp(110px, 16vw, 220px) 0 clamp(80px, 10vw, 140px); }
.manifesto .kicker { display: block; margin-bottom: 28px; }
.manifesto__text { margin: 0; max-width: 1180px; font: 600 clamp(34px, 5.4vw, 84px)/1.02 var(--display); text-transform: uppercase; letter-spacing: .005em; }
.manifesto__text span { color: rgba(242,244,245,.14); transition: color .35s ease; }
.manifesto__text span.is-lit { color: #f2f4f5; }
@media (prefers-reduced-motion: reduce) {
  .mh-copy h2 .w > span, .mh-copy__body, .mh-copy .actions, .mh-copy__index { transform: none !important; opacity: 1 !important; transition: none; }
}
