:root {
  --bg: #f7f5f1;
  --surface: #ffffff;
  --ink: #1b1f2a;
  --muted: #5a6172;
  --rule: #e2ddd3;
  --accent: #c2541b;
  --accent-soft: #fbe9dd;
  --night: #141a2b;
  --night-ink: #eef0f6;
  --night-muted: #aab1c4;
  --serif: "IBM Plex Serif", Georgia, serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #10141f;
    --surface: #181d2b;
    --ink: #e8eaf1;
    --muted: #a3aabb;
    --rule: #2a3142;
    --accent: #f08a4b;
    --accent-soft: #2b2018;
  }
}
:root[data-theme="dark"] {
  --bg: #10141f;
  --surface: #181d2b;
  --ink: #e8eaf1;
  --muted: #a3aabb;
  --rule: #2a3142;
  --accent: #f08a4b;
  --accent-soft: #2b2018;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.65 var(--sans);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }

/* nav */
nav.top {
  position: sticky; top: 0; z-index: 10;
  background: rgba(20, 26, 43, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
nav.top .wrap { display: flex; align-items: center; gap: 20px; height: 52px; overflow-x: auto; }
nav.top .brand { color: #fff; font-weight: 600; text-decoration: none; letter-spacing: 0.04em; white-space: nowrap; }
nav.top .brand span { color: #f08a4b; }
nav.top .links { display: flex; gap: 18px; margin-left: auto; }
nav.top .links a { color: #c9cfdd; text-decoration: none; font-size: 14px; white-space: nowrap; }
nav.top .links a:hover { color: #fff; }
@media (max-width: 640px) { nav.top .brand span { display: none; } }

/* hero */
.hero {
  position: relative;
  color: #fff;
  background: var(--night) url("images/aerostat-shield.jpg") center / cover no-repeat;
  min-height: min(78vh, 780px);
  display: flex; align-items: flex-end;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10, 14, 26, 0.15) 0%, rgba(10, 14, 26, 0.35) 45%, rgba(10, 14, 26, 0.88) 100%);
}
.hero .wrap { position: relative; padding-top: 120px; padding-bottom: 56px; }
.hero h1 { font: 600 clamp(34px, 6vw, 60px)/1.08 var(--serif); margin: 10px 0 14px; max-width: 16ch; }
.hero .sub { font-size: clamp(17px, 2.2vw, 21px); max-width: 44ch; color: #e6e9f2; margin: 0 0 18px; }
.badge {
  display: inline-block; font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 3px; background: #f08a4b; color: #1b1206;
}
.appno { font-size: 14px; color: #c9cfdd; margin: 0; }
.credit { position: absolute; right: 16px; bottom: 10px; font-size: 12px; color: rgba(255, 255, 255, 0.6); }

/* sections */
section { padding: 64px 0; border-bottom: 1px solid var(--rule); }
section.dark { background: var(--night); color: var(--night-ink); border-bottom: none; }
section.dark .muted, section.dark .kicker { color: var(--night-muted); }
.kicker { font-size: 13px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin: 0 0 8px; }
h2 { font: 600 clamp(26px, 3.6vw, 36px)/1.2 var(--serif); margin: 0 0 18px; }
h3 { font: 600 20px/1.3 var(--sans); margin: 0 0 8px; }
.lede { font: 400 20px/1.6 var(--serif); }
.muted { color: var(--muted); }

.grid { display: grid; gap: 22px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 20px; }
section.dark .card { background: #1c2337; border-color: #2b3450; }
.card p { margin: 0; }
.num { font: 600 28px/1 var(--serif); color: var(--accent); display: block; margin-bottom: 8px; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; align-items: start; }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } }

/* figures: patent drawings sit on white in both themes */
figure { margin: 0; }
figure.drawing a { display: block; background: #fff; border: 1px solid var(--rule); border-radius: 6px; padding: 8px; }
figure.drawing img { max-height: 620px; margin: 0 auto; width: auto; }
figure.art img { border-radius: 6px; }
figcaption { font-size: 14px; color: var(--muted); margin-top: 8px; }
section.dark figcaption { color: var(--night-muted); }

/* loop */
ol.loop { list-style: none; padding: 0; margin: 0; counter-reset: step; display: grid; gap: 10px; }
ol.loop li {
  counter-increment: step; position: relative; padding: 10px 14px 10px 52px;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 6px;
}
ol.loop li::before {
  content: counter(step); position: absolute; left: 12px; top: 9px;
  width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  font-weight: 600; font-size: 14px; display: grid; place-items: center;
}
ol.loop li.air::before { background: var(--accent); color: #fff; }

/* fallback ladder */
.ladder { display: grid; gap: 12px; }
.ladder .rung { display: grid; grid-template-columns: 120px 1fr; gap: 14px; align-items: start; }
.ladder .rung b { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: #f08a4b; padding-top: 3px; }
@media (max-width: 520px) { .ladder .rung { grid-template-columns: 1fr; gap: 2px; } }

/* lineage */
.era { display: grid; grid-template-columns: 1fr 1.3fr; gap: 32px; align-items: start; padding: 28px 0; border-top: 1px solid #2b3450; }
.era:first-of-type { border-top: none; }
.era > div:only-child { grid-column: 1 / -1; max-width: 760px; }
@media (max-width: 820px) { .era { grid-template-columns: 1fr; gap: 16px; } }
.when { font: 600 30px/1 var(--serif); color: #f08a4b; margin: 0 0 8px; }
figure.photo img { border-radius: 6px; margin: 0 auto; }
figure.photo.wide { margin: 8px 0 22px; }
section.dark ul { padding-left: 20px; }
section.dark ul li { margin-bottom: 6px; }
blockquote.quote { background: #1c2337; color: var(--night-ink); font-style: italic; margin-top: 16px; }
blockquote.quote span { font-style: normal; font-size: 14px; color: var(--night-muted); }

blockquote { margin: 0; padding: 18px 22px; border-left: 3px solid var(--accent); background: var(--surface); font: 400 17px/1.65 var(--serif); }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 22px; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }

footer { padding: 36px 0 48px; font-size: 14px; color: var(--muted); }
footer p { margin: 0 0 8px; max-width: 760px; }
