@font-face {
  font-family: "Sofia Sans Condensed";
  src: url("/fonts/sofia-sans-condensed.woff2") format("woff2");
  font-weight: 1 1000;
  font-display: swap;
}
@font-face {
  font-family: "Sofia Sans";
  src: url("/fonts/sofia-sans.woff2") format("woff2");
  font-weight: 1 1000;
  font-display: swap;
}

:root {
  --space: #000;
  --starlight: #f0f0fa;
  --starlight-soft: rgba(240, 240, 250, 0.74);
  --line: rgba(240, 240, 250, 0.32);
  --gutter: clamp(20px, 4.4vw, 72px);
  --display: "Sofia Sans Condensed", "Arial Narrow", Arial, sans-serif;
  --text: "Sofia Sans", Arial, sans-serif;
  --stage: max(100vw, 178svh);
  --rocket-x: 78vw;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--space); scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--space);
  color: var(--starlight);
  font: 400 1.0625rem/1.55 var(--text);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
h1, h2, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
img { display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--starlight); outline-offset: 3px; }

.skip {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 30;
  padding: 8px 14px;
  background: var(--starlight);
  color: var(--space);
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

/* Header */
.bar {
  position: absolute;
  inset: 0 0 auto;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(18px, 2.6vw, 32px) var(--gutter);
}
.wordmark {
  font: 600 clamp(1.05rem, 1.5vw, 1.3rem)/1 var(--display);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}
.bar nav { display: flex; gap: clamp(18px, 3vw, 40px); }
.bar nav a {
  position: relative;
  padding: 6px 0;
  font-size: 0.9375rem;
  text-decoration: none;
  white-space: nowrap;
}
.bar nav a::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease-out);
}
.bar nav a:hover::after, .bar nav a:focus-visible::after { transform: scaleX(1); }

/* Distance readout: the one fixed element, counting down the trip from the nebula to the Moon. */
.distance {
  position: fixed;
  right: var(--gutter);
  bottom: clamp(18px, 3vw, 36px);
  z-index: 9;
  display: none;
  text-align: right;
  line-height: 1.1;
  pointer-events: none;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.7);
}
.js .distance { display: block; }
.distance-value {
  display: block;
  font: 500 clamp(1.5rem, 2.5vw, 2.25rem)/1 var(--display);
  letter-spacing: 0.01em;
}
.distance-label { display: block; margin-top: 5px; font-size: 0.875rem; color: var(--starlight-soft); }

/* Plates */
.hero, .charter, .contact { position: relative; isolation: isolate; }
.track { position: absolute; inset: 0; z-index: -1; }
.plate {
  position: sticky;
  top: 0;
  display: block;
  height: 100svh;
  overflow: hidden;
}
.plate img { width: 100%; height: 100%; object-fit: cover; }

/* Headlines */
h1, h2 {
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.012em;
  line-height: 0.96;
  text-wrap: balance;
}
.button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 30px;
  overflow: hidden;
  border: 1px solid var(--starlight);
  background: transparent;
  color: var(--starlight);
  font: 500 1rem/1 var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.35s var(--ease-out);
}
.button::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--starlight);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.35s var(--ease-out);
}
.button { isolation: isolate; }
.button:hover, .button:focus-visible { color: var(--space); }
.button:hover::before, .button:focus-visible::before { transform: scaleY(1); }
.button[disabled] { cursor: progress; color: var(--starlight-soft); border-color: var(--line); }
.button[disabled]::before { transform: scaleY(0); }

/* Opening */
.plate-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0,0,0,.72) 0%, rgba(0,0,0,0) 16%),
    linear-gradient(90deg, rgba(0,0,0,.86) 0%, rgba(0,0,0,.66) 28%, rgba(0,0,0,0) 56%),
    linear-gradient(0deg, #000 0%, rgba(0,0,0,0) 26%);
}
.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-height: 100svh;
  padding: 112px var(--gutter) 96px;
}
h1 { font-size: clamp(2.75rem, 6.1vw, 6.5rem); }
h1 span { display: block; }
.byline { margin-top: clamp(20px, 2.2vw, 30px); font-size: clamp(1.0625rem, 1.3vw, 1.25rem); }
.hero .button { margin-top: clamp(24px, 2.6vw, 36px); }

/* Corporate Charter */
.charter { min-height: 100svh; }
.plate-mars::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  z-index: 1;
  height: 100%;
  background:
    linear-gradient(180deg, #000 0, rgba(0,0,0,0) 24%),
    linear-gradient(90deg, rgba(0,0,0,.5) 0, rgba(0,0,0,.34) 38%, rgba(0,0,0,0) 62%);
}
.charter::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 26svh;
  z-index: -1;
  background: linear-gradient(0deg, #000, rgba(0,0,0,0));
}
.charter-copy {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  column-gap: clamp(40px, 7vw, 120px);
  align-items: start;
  max-width: calc(1500px + var(--gutter) * 2);
  padding: clamp(96px, 10vw, 148px) var(--gutter) clamp(120px, 28svh, 340px);
}
.charter-copy h2 {
  grid-column: 1 / -1;
  font-size: clamp(3rem, 7.4vw, 7.5rem);
  margin-bottom: clamp(24px, 3vw, 44px);
}
.charter-lead {
  grid-column: 1;
  font: 500 clamp(1.5rem, 2.5vw, 3.5rem)/1.12 var(--display);
  text-wrap: balance;
}
.specialties { grid-column: 1; margin-top: clamp(24px, 2.8vw, 40px); }
.specialties li {
  padding: 11px 0;
  border-top: 1px solid var(--line);
  font: 600 clamp(1.25rem, 1.75vw, 2.4rem)/1.15 var(--display);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.specialties li:last-child { border-bottom: 1px solid var(--line); }
.specialties p { margin-bottom: 12px; color: var(--starlight-soft); font-size: clamp(1rem, 1.1vw, 1.5rem); }
.charter-body { grid-column: 2; grid-row: 2 / span 2; max-width: 60ch; }
.charter-body p { font-size: clamp(1.0625rem, 1.25vw, 1.75rem); line-height: 1.55; }
.charter-body p + p { margin-top: 1em; }
.charter-body .signature { margin-top: 26px; font-size: clamp(0.9375rem, 1vw, 1.3rem); color: var(--starlight-soft); }
.signature strong { display: block; margin-top: 2px; color: var(--starlight); font: 600 clamp(1.375rem, 1.6vw, 2.1rem)/1.2 var(--display); letter-spacing: 0.03em; }

/* Contact */
.contact { min-height: 100svh; overflow: hidden; display: flex; flex-direction: column; }
.moon { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.moon::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(180deg, #000 0, rgba(0,0,0,0) 22%),
    linear-gradient(0deg, rgba(0,0,0,.72) 0, rgba(0,0,0,0) 20%),
    linear-gradient(90deg, rgba(0,0,0,.88) 0%, rgba(0,0,0,.72) 36%, rgba(0,0,0,0) 62%);
}
.moon-stage {
  position: absolute;
  bottom: 0;
  /* Slides the plate sideways on tall screens so the rocket stays in view, without exposing an edge. */
  left: min(0px, max(calc(100vw - var(--stage)), calc(var(--rocket-x) - var(--stage) * 0.7766)));
  width: var(--stage);
  aspect-ratio: 16 / 9;
}
.moon-plate, .moon-plate img { display: block; width: 100%; height: 100%; }
.moon-plate img { object-fit: cover; }
.rocket-site { position: absolute; inset: 0; }
.rocket-shadow, .rocket-body { position: absolute; display: block; }
.rocket-body { left: 73.206%; top: 38.842%; width: 8.911%; height: 42.508%; }
.rocket-shadow { left: 73.206%; top: 78.799%; width: 23.056%; height: 21.201%; }
.rocket { position: absolute; inset: 0; will-change: transform; }
.contact-copy {
  flex: 1;
  width: 100%;
  max-width: calc(620px + var(--gutter) * 2);
  padding: clamp(88px, 9vw, 128px) var(--gutter) 32px;
}
.contact h2 { font-size: clamp(2.75rem, 5.4vw, 5.5rem); margin-bottom: clamp(22px, 2.6vw, 36px); }
.field { position: relative; margin-bottom: 18px; }
.field label { display: block; margin-bottom: 6px; font-size: 0.9375rem; }
.field input, .field textarea {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(0, 0, 0, 0.52);
  color: var(--starlight);
  font: 400 1.0625rem/1.4 var(--text);
  transition: border-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
}
.field textarea { resize: vertical; min-height: 118px; }
.field input:hover, .field textarea:hover { border-color: rgba(240, 240, 250, 0.6); }
.field input:focus, .field textarea:focus { outline: 2px solid var(--starlight); outline-offset: 0; border-color: transparent; }
.field [aria-invalid="true"] { border-color: var(--starlight); }
.field-error { margin-top: 6px; font-size: 0.9375rem; font-weight: 600; }
.field-error::before { content: "! "; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.turnstile:empty { display: none; }
.turnstile iframe { margin-bottom: 16px; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin-top: 6px; }
.form-note { font-size: 0.9375rem; color: var(--starlight-soft); }
.form-status:empty { display: none; }
.form-status { margin-top: 16px; font-weight: 600; }
.form-status, .sent { scroll-margin: 88px 0; }
.form-status:focus { outline: none; }
.sent:focus { outline: none; }
.sent-title { font: 700 clamp(1.75rem, 3vw, 2.75rem)/1 var(--display); text-transform: uppercase; letter-spacing: 0.012em; margin-bottom: 10px; }
.text-button {
  margin-top: 18px;
  padding: 6px 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.foot {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 28px;
  max-width: calc(100% - 300px);
  padding: 20px var(--gutter) clamp(18px, 3vw, 36px);
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--starlight-soft);
}

/* Liftoff, played when a message is sent */
.plume, .dust, .flash { position: absolute; opacity: 0; pointer-events: none; }
.plume { left: 75.86%; top: 77.9%; width: 3.6%; height: 24%; }
.dust { left: 69.6%; top: 75.5%; width: 16.2%; height: 11%; }
.flash { left: 71.7%; top: 66.5%; width: 11.9%; height: 21.2%; }
.plume {
  mix-blend-mode: screen;
  transform-origin: 50% 0;
  background: radial-gradient(50% 50% at 50% 12%, #fff 0, #fff 22%, rgba(214, 228, 255, .85) 40%, rgba(120, 160, 255, .35) 64%, rgba(90, 130, 255, 0) 100%);
  filter: blur(1.5px);
}
.dust {
  border-radius: 50%;
  mix-blend-mode: screen;
  background: radial-gradient(closest-side, rgba(255, 255, 255, .95), rgba(214, 214, 214, .62) 46%, rgba(170, 170, 170, 0));
  filter: blur(7px);
}
.flash {
  border-radius: 50%;
  mix-blend-mode: screen;
  background: radial-gradient(closest-side, #fff 0, rgba(255, 255, 255, .75) 24%, rgba(190, 210, 255, 0) 100%);
}
.liftoff .plume { animation: plume-on 0.5s ease-out forwards, plume-flicker 0.11s linear 0.5s infinite alternate; }
.liftoff .flash { animation: flash 2.2s ease-out forwards; }
.liftoff .dust { animation: dust 3.8s cubic-bezier(0.1, 0.7, 0.3, 1) 0.3s forwards; }
.liftoff .rocket { animation: climb 4.6s cubic-bezier(0.62, 0.02, 0.92, 0.3) 0.7s forwards; }
.liftoff .rocket-shadow { animation: shadow-go 1.5s ease-in 0.8s forwards; }
.gone .rocket, .gone .rocket-shadow { visibility: hidden; }
.returning .rocket-body, .returning .rocket-shadow { animation: fade-in 1.4s ease forwards; }
@keyframes plume-on { from { opacity: 0; transform: scale(.5, .15); } to { opacity: 1; transform: scale(1, 1); } }
@keyframes plume-flicker { from { opacity: .88; transform: scale(.97, .95); } to { opacity: 1; transform: scale(1.03, 1.06); } }
@keyframes flash { 0% { opacity: 0; transform: scale(.4); } 16% { opacity: 1; } 100% { opacity: 0; transform: scale(1.5); } }
@keyframes dust { 0% { opacity: 0; transform: scale(.3, .4); } 22% { opacity: .95; } 100% { opacity: 0; transform: scale(3.6, 1.3); } }
@keyframes climb { to { transform: translate3d(0, -170svh, 0); } }
@keyframes shadow-go { to { opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* Opening sequence: the plate settles out of black, then the words arrive. */
@media (prefers-reduced-motion: no-preference) {
  .plate-hero img { animation: settle 3.6s var(--ease-out) both; }
  .hero-copy h1 span, .byline, .hero .button { animation: arrive 1.1s var(--ease-out) both; }
  .hero-copy h1 span:nth-child(1) { animation-delay: 0.7s; }
  .hero-copy h1 span:nth-child(2) { animation-delay: 0.82s; }
  .hero-copy h1 span:nth-child(3) { animation-delay: 0.94s; }
  .hero-copy h1 span:nth-child(4) { animation-delay: 1.06s; }
  .byline { animation-delay: 1.5s; }
  .hero .button { animation-delay: 1.62s; }
  @keyframes settle { from { opacity: 0; transform: scale(1.14); } to { opacity: 1; transform: scale(1); } }
  @keyframes arrive { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

  @supports (animation-timeline: view()) {
    .plate-mars img {
      animation: drift linear both;
      animation-timeline: view();
      animation-range: entry 0% exit 100%;
    }
    @keyframes drift { from { transform: scale(1.1); } to { transform: scale(1); } }
  }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
  .liftoff .rocket, .liftoff .plume, .liftoff .dust, .liftoff .flash, .liftoff .rocket-shadow { animation: none; }
}

/* Tablets and short laptops: charter becomes one column once the sky runs out of width */
@media (max-width: 1080px) {
  .charter-copy { grid-template-columns: minmax(0, 1fr); max-width: 680px; }
  .charter-copy > * { grid-column: 1; grid-row: auto; }
  .charter-body { margin-top: 28px; }
  .plate-mars::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0,0,0,.6), rgba(0,0,0,.28));
  }
  :root { --rocket-x: 82vw; }
  .contact-copy { max-width: calc(520px + var(--gutter) * 2); }
}

/* Phones */
@media (max-width: 760px) {
  .wordmark { font-size: 0.95rem; letter-spacing: 0.2em; }
  .bar nav a[href="#charter"] { display: none; }
  .hero-copy { justify-content: flex-end; padding-bottom: 72px; }
  .plate-hero { background: #000; }
  .plate-hero img { object-position: 50% 0; height: 72%; }
  .plate-hero::after {
    background: linear-gradient(180deg, rgba(0,0,0,.5) 0%, rgba(0,0,0,0) 14%, rgba(0,0,0,0) 36%, rgba(0,0,0,.9) 62%, #000 74%);
  }
  h1 { font-size: 11.2vw; }

  /* The readout becomes a strip that page content passes under. */
  .distance {
    inset: auto 0 0;
    display: none;
    padding: 26px var(--gutter) max(10px, env(safe-area-inset-bottom));
    background: linear-gradient(0deg, #000 56%, rgba(0,0,0,0));
    text-shadow: none;
  }
  .js .distance { display: flex; align-items: baseline; justify-content: flex-end; gap: 6px; }
  .distance-value { font-size: 1.25rem; }
  .distance-label { margin: 0; font-size: 0.875rem; }

  .charter-copy { padding-top: 92px; padding-bottom: 92vw; }
  .charter-copy h2 { font-size: clamp(2.75rem, 13vw, 4rem); }
  .plate-mars::after { background: rgba(0,0,0,.34); }

  .contact { min-height: 0; }
  .contact-copy { order: 1; flex: 0 0 auto; max-width: none; padding-bottom: 12px; }
  .contact h2 { font-size: clamp(2.5rem, 11.4vw, 3.4rem); }
  .form-actions .button { width: 100%; }
  .moon { order: 2; position: relative; inset: auto; flex: 0 0 auto; height: 74vw; overflow: visible; }
  .moon::before { background: linear-gradient(180deg, #000 0, rgba(0,0,0,0) 30%), linear-gradient(0deg, #000 0, rgba(0,0,0,0) 18%); }
  .moon-stage { --stage: 178vw; --rocket-x: 74vw; }
  .foot { order: 3; max-width: none; padding: 16px var(--gutter) 60px; }
}
