*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/*
 * Color scheme (dark only). Every color on the site comes from these tokens;
 * don't hard-code colors elsewhere. Contrast ratios are against --bg (WCAG AA
 * needs 4.5:1 for body text). See "Color scheme" in README.md.
 */
:root {
  color-scheme: dark;

  --bg: #0a0c0f;            /* page background, near-black blue-gray */
  --text: #e8eaed;          /* headings, primary text        16.3:1 */
  --text-muted: #8b929a;    /* body copy, captions, footer    6.2:1 */
  --accent: #00a800;        /* brand green: links, top rule,  6.2:1
                               ASCII airframe */
  --accent-hover: #00c400;  /* link hover/focus               8.3:1 */
  --border: #1e2329;        /* dividers (decorative only)    1.2:1 */
  --grid-dot: rgb(255 255 255 / 0.07); /* background dot grid */

  --font-heading: "Space Grotesk", system-ui, sans-serif;
  --font-mono: "Roboto Mono", ui-monospace, monospace;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-heading);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100dvh;
  border-top: 2px solid var(--accent);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, var(--grid-dot) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
}

.page {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 2.5rem 1.5rem;
  max-width: 44rem;
  margin: 0 auto;
  text-align: center;
}

.header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: 100%;
  margin-bottom: 2rem;
}

.company-name a {
  color: inherit;
  text-decoration: none;
}

.company-name a:hover,
.company-name a:focus-visible {
  color: var(--accent-hover);
}

/* ---------------------------------------------------------------------------
 * Site nav: About | logo (home link) | Milestones, on every page. The three
 * columns keep the logo centered whatever the link widths. The link for the
 * page you're on (aria-current="page") is green and underlined.
 * ------------------------------------------------------------------------ */

.site-nav {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  column-gap: 1rem;
  width: 100%;
}

.site-nav > :first-child { justify-self: center; }
.site-nav > :last-child  { justify-self: center; }

.nav-link {
  font-family: var(--font-mono);
  font-size: 1rem;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  text-decoration: none;
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--accent-hover);
}

.nav-link[aria-current="page"] {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.4em;
}

.home-link {
  display: block;
  line-height: 0;
}

.logo {
  width: 6.5rem;
  height: 6.5rem;
  object-fit: contain;
  border-radius: 0.5rem;
}

/* Wider than the text column: centered, up to 64rem (as wide as the
   milestone video), with a 1rem gutter each side on small screens. The
   height is about 0.8x the width. The header sits above it, so the box
   may run below the fold; the height term keeps the middle of the box,
   where the model is drawn, on the first screen of a laptop. 18rem floor
   for very short windows. */
.airframe {
  --airframe-w: min(64rem, calc(100vw - 2rem),
                    max(18rem, calc((100svh - 10rem) * 1.25)));
  width: var(--airframe-w);
  margin: 0 calc((100% - var(--airframe-w)) / 2) 2.5rem;
}

/* Font size is set by airframe.js so 100 columns fill the width. */
.airframe pre {
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.2;
  color: var(--accent);
  text-align: left;
  white-space: pre;
  overflow: hidden;
  user-select: none;
}

.company-name {
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text);
}

.mission-subheadline {
  font-family: var(--font-mono);
  font-size: clamp(0.875rem, 2.2vw, 1rem);
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.75;
  letter-spacing: 0.01em;
}

.contact {
  width: 100%;
}

.contact-line {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

main {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  width: 100%;
}

.contact-line a {
  color: var(--accent);
  text-decoration: none;
}

.contact-line a:hover,
.contact-line a:focus-visible {
  color: var(--accent-hover);
  text-decoration: underline;
}

.footer {
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  width: 100%;
}

.footer p {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* ---------------------------------------------------------------------------
 * Sub-page header (/milestones/, /about/) and the Milestones page.
 * Milestones are newest first.
 * ------------------------------------------------------------------------ */

/* Sub-pages start at the top, so the nav sits at the same height on every
   page (centering would push it down on short pages like /about/). main
   grows to keep the contact line and footer at the bottom of the window. */
.page:has(.site-header) {
  justify-content: flex-start;
}

.page:has(.site-header) > main {
  flex-grow: 1;
}

/* Visible to screen readers only. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.site-header {
  width: 100%;
  margin-bottom: 3.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.875rem;
  color: var(--text);
  text-decoration: none;
}

.brand-logo {
  width: 3.5rem;
  height: 3.5rem;
  object-fit: contain;
  border-radius: 0.5rem;
}

.brand-name {
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

/* On phones the name drops below the logo so the nav row still fits. */
@media (max-width: 40rem) {
  .brand {
    flex-direction: column;
    gap: 0.5rem;
  }

  /* Narrow enough to wrap onto two lines, so About and Milestones still fit
     beside it on a 390px phone. */
  .brand-name {
    font-size: 1.125rem;
    max-width: 8em;  /* a wrapped box keeps its max-width, so keep it tight */
    text-align: center;
  }

  .site-nav {
    column-gap: 0.5rem;
  }

  .site-nav > :first-child { justify-self: start; }
  .site-nav > :last-child  { justify-self: end; }

  .nav-link {
    font-size: 0.875rem;
  }
}

.brand:hover .brand-name,
.brand:focus-visible .brand-name {
  color: var(--accent-hover);
}

main.milestone {
  gap: 0;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
}

/* Every event's title is the same size, the latest and the earlier ones. */
.milestone-title,
.milestone-subtitle {
  font-size: clamp(1.375rem, 4vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text);
}

.milestone-title {
  margin-top: 0.75rem;
}

.milestone-date {
  margin-top: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* The video breaks out of the text column: up to 64rem wide, centered, with
 * the same 1.5rem side gutter as .page on small screens. */
.milestone-media {
  --media-w: min(64rem, calc(100vw - 3rem));
  width: var(--media-w);
  margin-top: 2rem;
  margin-left: calc((100% - var(--media-w)) / 2);
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  overflow: hidden;
  background: var(--bg);
}

.milestone-media video,
.milestone-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.media-placeholder {
  display: grid;
  place-items: center;
  height: 100%;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-muted);
}

.milestone-summary {
  margin-top: 1.5rem;
  font-family: var(--font-mono);
  font-size: clamp(0.875rem, 2.2vw, 1rem);
  line-height: 1.75;
  color: var(--text-muted);
}

/* Two camera views side by side in one file (2544 x 1080). */
.milestone-media--pair {
  aspect-ratio: 106 / 45;
}

/* A portrait phone video (1080 x 1350, 4:5): narrower, and never taller than
 * 80% of the screen, so the readouts under it stay in view. */
.milestone-media--portrait {
  --media-w: min(36rem, calc(100vw - 3rem), 64vh);
  aspect-ratio: 4 / 5;
}

/* An earlier event under the latest one: same pieces, set off by a rule. */
.milestone-more {
  margin-top: 3.5rem;
  padding-top: 3rem;
  border-top: 1px solid var(--border);
}

/* The contact line and footer sit well clear of the last event's text. */
.milestone + .contact {
  margin-top: 7rem;
}

/* Live telemetry under the milestone video (filled in by /milestones/telemetry.js). */
.telemetry {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  overflow: hidden;
  background: var(--border); /* shows through the 1px gaps as cell dividers */
  text-align: left;
}

.tm-cell {
  display: flex;
  flex-direction: column;
  gap: 0.0625rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg);
  min-width: 0;
}

.tm-label,
.tm-sub {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tm-label {
  text-transform: uppercase;
}

.tm-value {
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  white-space: pre;
}

.telemetry.is-unavailable .tm-value {
  color: var(--text-muted);
}

.telemetry-note {
  margin-top: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: var(--text-muted);
  opacity: 0.85;            /* a step fainter than captions; still 4.8:1 on --bg */
  text-align: left;
}

@media (max-width: 34rem) {
  .telemetry {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------------------------------------------------------------------------
 * About page (/about/).
 * ------------------------------------------------------------------------ */

/* main grows to fill the space between the nav and the contact line (see
   .page:has(.site-header) > main); center the content within it. */
main.about {
  gap: 4rem;
  justify-content: center;
}

.about-section {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.section-title {
  font-size: clamp(1.375rem, 4vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text);
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 2rem;
  list-style: none;
}

.member {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
}

.member-photo {
  width: 14rem;
  height: auto;             /* override the <img> height attribute */
  aspect-ratio: 1;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  object-fit: cover;
  background: var(--bg);
}

.member-name {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

.member-role {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-muted);
}

main.about + .contact {
  margin-top: 5rem;
}
