/* Moonrun: a 1960s space-race poster at sunset. One illustrated world: ink outlines, flat colour, hard offset shadows,
   cream paper cards on a navy night. Radius: 4px everywhere, 999px only for chips and pips. */
:root {
  --space: #141a33;
  --space-2: #1d2547;
  --space-3: #2a3460;
  --paper: #f3e9d2;
  --paper-2: #e3d4b0;
  --card: #fbf5e6;
  --red: #e8432e;
  --red-deep: #a82c1d;
  --sun: #f2b632;
  --sun-deep: #b07d12;
  --mint: #2fb68a;
  --lunar: #58dcff;
  --ink: #141a33;
  --ink-2: #3c4466;
  --muted: #6b6f84;
  --display: "Bricolage Grotesque", "Arial Black", system-ui, sans-serif;
  --body: "Figtree", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --shadow: 4px 5px 0 rgba(8, 10, 24, .5);
  --shadow-lg: 8px 10px 0 rgba(8, 10, 24, .45);
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --ease: cubic-bezier(.2, .7, .1, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--space); color: var(--paper); font: 400 1rem/1.5 var(--body); overflow-x: clip; }
body::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 90; background-image: var(--noise); opacity: .12; }
::selection { background: var(--sun); color: var(--ink); }
h1, h2, h3, p { margin: 0; }
h1, h2 { font-family: var(--display); font-weight: 800; letter-spacing: -.02em; line-height: 1.02; text-wrap: balance; }
a { color: inherit; }
ol { margin: 0; padding: 0; list-style: none; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.wrap { width: min(1320px, 100% - 32px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--paper); color: var(--ink); padding: .6rem 1rem; z-index: 200; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }
button, a, input { touch-action: manipulation; -webkit-tap-highlight-color: transparent; font: inherit; }
.kicker { font: 800 .7rem/1.2 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

/* ---------- scene ---------- */
.scene { position: fixed; inset: 0; width: 100vw; height: 100lvh; z-index: -2; display: block; opacity: 0; transition: opacity 1.2s var(--ease); }
.scene.ready { opacity: 1; }
.loading { position: fixed; left: 50%; top: 50%; z-index: -1; transform: translate(-50%, -50%); font: 800 1.3rem var(--display); color: var(--sun); animation: breathe 1.6s ease-in-out infinite; transition: opacity .6s; pointer-events: none; }
.scene.ready ~ .loading { opacity: 0; animation: none; }
@keyframes breathe { 50% { opacity: .35; } }

/* ---------- nav ---------- */
.nav { position: fixed; inset: 0 0 auto; z-index: 60; padding: 12px 0; background: linear-gradient(rgba(20, 26, 51, .85), rgba(20, 26, 51, 0)); }
.nav .wrap { display: flex; align-items: center; gap: clamp(.6rem, 1.8vw, 1.4rem); }
.nav .wrap > * { flex: none; }
.logo { display: flex; align-items: center; gap: .55rem; margin-right: auto; font: 800 1.4rem/1 var(--display); letter-spacing: -.02em; text-decoration: none; color: var(--paper); }
.logo .badge { width: 38px; height: 38px; display: grid; place-items: center; background: var(--sun); border: 2px solid var(--ink); border-radius: 4px; box-shadow: 3px 3px 0 rgba(0, 0, 0, .45); transform: rotate(-5deg); transition: transform .3s var(--ease); }
.logo:hover .badge { transform: rotate(-14deg) translateY(-2px); }
.logo .badge svg { width: 26px; height: 26px; }
.links { display: flex; gap: 1.2rem; }
.nl { font-weight: 700; font-size: .95rem; text-decoration: none; color: var(--paper-2); padding: .3rem 0; border-bottom: 2px solid transparent; }
.nl:hover, .nl[aria-current] { color: var(--paper); border-bottom-color: var(--red); }
.ca { font: 700 .78rem var(--mono); color: var(--paper-2); background: rgba(20, 26, 51, .7); border: 1.5px solid var(--space-3); border-radius: 4px; padding: .45rem .7rem; flex: 0 1 auto !important; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ca button { all: unset; cursor: pointer; color: var(--sun); }
.sound { display: inline-flex; align-items: center; gap: .5rem; min-height: 38px; padding: .3rem .7rem; border: 2px solid var(--space-3); border-radius: 4px; background: rgba(20, 26, 51, .7); color: var(--paper-2); font: 700 .8rem var(--body); cursor: pointer; }
.sound.on { border-color: var(--sun); color: var(--paper); }
.eq { display: flex; align-items: flex-end; gap: 2px; height: 14px; }
.eq i { width: 3px; height: 4px; background: currentColor; border-radius: 1px; }
.sound.on .eq i { animation: eq .9s ease-in-out infinite alternate; }
.sound.on .eq i:nth-child(2) { animation-delay: .2s; } .sound.on .eq i:nth-child(3) { animation-delay: .4s; } .sound.on .eq i:nth-child(4) { animation-delay: .1s; }
@keyframes eq { from { height: 4px; } to { height: 14px; } }
.vignette { position: fixed; inset: 0; z-index: 70; pointer-events: none; opacity: 0; background: radial-gradient(ellipse at center, transparent 45%, rgba(232, 67, 46, .55) 100%); }
.vignette.hit { animation: vig .5s var(--ease); }
@keyframes vig { 0% { opacity: 1; } 100% { opacity: 0; } }
.floats { position: fixed; inset: 0; z-index: 65; pointer-events: none; overflow: hidden; }
.floats span { position: absolute; transform: translate(-50%, -50%); font: 800 1.3rem var(--display); color: #ffd23f; text-shadow: 2px 2px 0 var(--ink); animation: floatUp 1s var(--ease) forwards; white-space: nowrap; }
.floats span.fuel { color: var(--lunar); } .floats span.bad { color: var(--red); }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.6); } 20% { opacity: 1; transform: translate(-50%, -60%) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -160%) scale(1); } }
/* as the bar gets tight (narrow windows, or a zoomed-in page), drop the least important pieces first */
@media (max-width: 1380px) { .home .ca:not(.live) { display: none; } }
@media (max-width: 1180px) { .sound .label { display: none; } .play .ca:not(.live) { display: none; } }
@media (max-width: 1060px) { .home .links, .home .follow { display: none; } }
@media (max-width: 760px) { .links { display: none; } .ca:not(.live) { display: none; } }

/* ---------- buttons, chips, cards ---------- */
.btn { --bg: var(--red); --fg: #fff; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 44px; padding: .6rem 1.15rem; border: 2px solid var(--ink); border-radius: 4px;
  background: var(--bg); color: var(--fg); font: 800 .95rem/1 var(--body); text-decoration: none; cursor: pointer; white-space: nowrap; box-shadow: 3px 4px 0 var(--ink); transition: transform .12s, box-shadow .12s, background-color .2s; }
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 5px 0 var(--ink); }
.btn:active { transform: translate(2px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn.alt { --bg: var(--sun); --fg: var(--ink); }
.btn.ghost { --bg: transparent; --fg: var(--ink); box-shadow: none; border-color: var(--paper-2); }
.btn.sm { min-height: 34px; padding: .4rem .75rem; font-size: .82rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: 2px 2px 0 var(--ink); }
.chip { display: inline-flex; align-items: center; padding: .2rem .6rem; border-radius: 999px; font: 800 .72rem/1.3 var(--body); border: 1.5px solid var(--ink); }
.chip.sun { background: var(--sun); color: var(--ink); }
.card { background: var(--card); color: var(--ink); border: 2.5px solid var(--ink); border-radius: 4px; box-shadow: var(--shadow-lg); }

/* ---------- the hangar ---------- */
.play main { position: fixed; inset: 0; pointer-events: none; }
.play main > * { pointer-events: auto; }
.hangar { position: absolute; right: max(16px, calc((100vw - 1320px) / 2)); top: 76px; width: min(400px, 100% - 32px); max-height: calc(100dvh - 96px); overflow: auto; padding: 1.1rem 1.1rem 1rem; transition: transform .6s var(--ease), opacity .4s; scrollbar-width: thin; }
.h-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .8rem; }
.isl-name { font-size: 1.65rem; margin-top: .15rem; overflow-wrap: anywhere; }
.fold { display: none; }
@media (max-width: 760px) { .fold { display: inline-flex; } }
.rename { display: flex; gap: .5rem; margin-top: .7rem; }
.rename input { flex: 1; min-width: 0; min-height: 40px; padding: .4rem .7rem; border: 2px solid var(--ink); border-radius: 4px; background: #fff; color: var(--ink); font: 600 1rem var(--body); }
.fuel { display: flex; align-items: baseline; flex-wrap: wrap; gap: .25rem .6rem; margin: .9rem 0 .7rem; padding: .7rem .8rem; background: var(--space); color: var(--paper); border-radius: 4px; }
.fuel-label { font: 800 .7rem var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--paper-2); }
.fuel-n { font: 700 1.6rem/1 var(--mono); color: var(--sun); margin-right: auto; font-variant-numeric: tabular-nums; }
.parts { display: grid; gap: .45rem; }
.part { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .2rem .7rem; padding: .55rem .65rem; border: 2px solid var(--paper-2); border-radius: 4px; background: #fff; }
.part .slot { font: 800 .66rem var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.part .name { font-weight: 800; font-size: .98rem; line-height: 1.2; }
.pips { display: flex; gap: 3px; margin-top: 4px; }
.pips i { width: 16px; height: 6px; border-radius: 999px; background: var(--paper-2); }
.pips i.on { background: var(--red); }
.pips i.prem { background: repeating-linear-gradient(45deg, var(--paper-2) 0 3px, #d7c8a2 3px 6px); }
.part .up { grid-row: span 2; align-self: center; text-align: right; }
.part .up .btn { flex-direction: column; gap: .1rem; align-items: flex-end; min-height: 44px; }
.part .up small { font: 700 .7rem var(--mono); opacity: .85; }
.part .lock { font: 700 .72rem/1.3 var(--body); color: var(--muted); max-width: 13ch; text-align: right; }
.part.flash { animation: flash .7s var(--ease); }
@keyframes flash { 0% { background: #fff2b8; } 100% { background: #fff; } }
.paints { display: flex; gap: .4rem; flex-wrap: wrap; margin: .8rem 0 .2rem; }
.paints button { width: 28px; height: 28px; border-radius: 999px; border: 2px solid var(--ink); background: var(--c); cursor: pointer; padding: 0; }
.paints button[aria-checked="true"] { outline: 3px solid var(--ink); outline-offset: 2px; }
.readout { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: .7rem; }
.readout b { display: block; font: 700 1.15rem var(--mono); }
.warn { margin-top: .7rem; padding: .55rem .7rem; background: #ffe3dc; border: 2px solid var(--red); border-radius: 4px; font-size: .86rem; line-height: 1.35; }

.wallet-row { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-top: .7rem; }
.w-addr { font: 700 .8rem var(--mono); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-addr.on { color: var(--ink); }
.part .up .btn.prem { --bg: var(--space); --fg: var(--lunar); }
.dlg { padding: 1.1rem 1.2rem; width: min(380px, calc(100% - 32px)); }
.dlg::backdrop { background: rgba(20, 26, 51, .7); }
.dlg ul { list-style: none; margin: .7rem 0; padding: 0; display: grid; gap: .4rem; }
.dlg ul button { width: 100%; display: flex; align-items: center; gap: .6rem; min-height: 46px; padding: .5rem .8rem; border: 2px solid var(--ink); border-radius: 4px; background: #fff; color: var(--ink); font: 800 .95rem var(--body); cursor: pointer; }
.dlg ul button img { width: 24px; height: 24px; border-radius: 4px; }
.dlg-note { font-size: .82rem; color: var(--ink-2); margin: .5rem 0 .8rem; }
.rc-title { font-size: 1.4rem; margin-top: .2rem; }
.rc-grid { grid-template-columns: repeat(3, 1fr); margin: .8rem 0 .3rem; }

.gate { position: absolute; right: max(16px, calc((100vw - 1320px) / 2)); top: 76px; width: min(420px, 100% - 32px); padding: 1.2rem 1.2rem 1rem; }
.g-copy { margin-top: .6rem; font-size: .95rem; color: var(--ink-2); }
.g-steps { list-style: none; margin: .9rem 0 0; padding: 0; display: grid; gap: .5rem; }
.g-steps li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .7rem; padding: .6rem .7rem; background: #fff; border: 2px solid var(--paper-2); border-radius: 4px; }
.g-steps li.done { background: #e2f5ec; border-color: var(--mint); }
.g-steps small { display: block; color: var(--muted); font-size: .78rem; }
.g-n { width: 26px; height: 26px; display: grid; place-items: center; background: var(--ink); color: var(--paper); border-radius: 999px; font: 800 .8rem var(--body); }
.g-steps li.done .g-n { background: var(--mint); }
.g-parts { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; margin-top: .6rem; }
.g-parts button { display: grid; gap: .1rem; text-align: left; min-height: 48px; padding: .4rem .6rem; border: 2px solid var(--ink); border-radius: 4px; background: var(--sun); color: var(--ink); font: 800 .85rem var(--body); cursor: pointer; box-shadow: 2px 3px 0 var(--ink); }
.g-parts button small { font: 700 .68rem var(--mono); color: var(--ink-2); }
.g-parts button[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; }
body.gated .hangar, body.gated .console { display: none; }
@media (max-width: 760px) { .gate { left: 12px; right: 12px; width: auto; top: auto; bottom: 16px; } }

/* ---------- the launch console ---------- */
.console { position: absolute; left: 50%; bottom: max(22px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; justify-items: center; gap: .55rem; transition: transform .5s var(--ease), opacity .4s; }
.launch { position: relative; overflow: hidden; min-width: 280px; min-height: 68px; padding: 0 2.2rem; border: 3px solid var(--ink); border-radius: 4px; background: var(--red); color: #fff; cursor: pointer;
  font: 800 1.6rem/1 var(--display); letter-spacing: .02em; text-transform: uppercase; box-shadow: 5px 6px 0 var(--ink); transition: transform .12s, box-shadow .12s; }
.launch:hover:not([disabled]) { transform: translate(-1px, -2px); box-shadow: 6px 8px 0 var(--ink); }
.launch:active:not([disabled]) { transform: translate(3px, 4px); box-shadow: 1px 1px 0 var(--ink); }
.launch[disabled] { background: var(--space-3); cursor: default; }
.l-fill { position: absolute; inset: 0; background: var(--red); transform-origin: left; transform: scaleX(var(--p, 1)); }
.l-label { position: relative; }
.l-note { font-weight: 700; font-size: .9rem; color: var(--paper); text-shadow: 0 1px 0 var(--ink), 0 0 12px rgba(20, 26, 51, .8); text-align: center; }

/* ---------- flight HUD + mission control ---------- */
.hud { position: absolute; left: max(16px, calc((100vw - 1320px) / 2)); top: 90px; }
.hud .kicker { color: var(--paper-2); }
.alt-n { font: 700 clamp(2.4rem, 6vw, 4.6rem)/1 var(--mono); color: #fff; font-variant-numeric: tabular-nums; text-shadow: 3px 3px 0 var(--ink); }
.stamp { margin-top: .8rem; display: inline-block; font: 800 clamp(1rem, 2vw, 1.35rem)/1 var(--display); text-transform: uppercase; letter-spacing: .04em; color: var(--ink); background: var(--sun); border: 2.5px solid var(--ink); padding: .45rem .7rem; box-shadow: var(--shadow); transform: rotate(-3deg) scale(0); }
.stamp.go { animation: stamp .45s var(--ease) forwards; }
@keyframes stamp { 0% { transform: rotate(-12deg) scale(1.8); opacity: 0; } 100% { transform: rotate(-3deg) scale(1); opacity: 1; } }
.log { position: absolute; left: max(16px, calc((100vw - 1320px) / 2)); bottom: 24px; width: min(420px, 100% - 32px); display: grid; gap: .3rem; }
.log li { font: 700 .82rem/1.35 var(--mono); color: var(--paper); background: rgba(20, 26, 51, .78); border-left: 3px solid var(--sun); padding: .35rem .6rem; animation: logIn .35s var(--ease); }
.log li b { color: var(--sun); }
@keyframes logIn { from { transform: translateX(-12px); opacity: 0; } }

/* ---------- report ---------- */
.report { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(440px, 100% - 32px); padding: 1.4rem; text-align: center; animation: rise .5s var(--ease); }
@keyframes rise { from { transform: translate(-50%, -40%); opacity: 0; } }
.r-km { font: 700 clamp(2.4rem, 7vw, 3.4rem)/1 var(--mono); margin-top: .4rem; letter-spacing: -.03em; }
.r-mile { margin-top: .5rem; font: 800 1.1rem var(--display); color: var(--red); }
.r-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin: 1rem 0 .6rem; }
.r-grid div { background: #fff; border: 2px solid var(--paper-2); border-radius: 4px; padding: .5rem .3rem; }
.r-grid dt { font: 800 .62rem var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.r-grid dd { margin: .15rem 0 0; font: 700 1rem var(--mono); }
.r-note { font-size: .9rem; color: var(--ink-2); min-height: 1.2em; }
.card-cv { display: block; width: 100%; height: auto; margin: .8rem 0 .2rem; border: 2px solid var(--ink); border-radius: 4px; background: var(--space); }
.r-actions { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; margin-top: 1rem; }
.report.record .r-km { color: var(--red); }
.report.moon { background: #fffbe9; }

/* ---------- live field ---------- */
.field { position: absolute; left: max(16px, calc((100vw - 1320px) / 2)); bottom: 24px; width: min(330px, 100% - 32px); padding: .7rem .8rem .6rem; transition: transform .6s var(--ease), opacity .4s; }
.f-tabs { display: flex; gap: .3rem; margin-bottom: .5rem; }
.f-tabs button { flex: 1; min-height: 34px; border: 2px solid var(--ink); border-radius: 4px; background: transparent; color: var(--ink); font: 800 .78rem var(--body); cursor: pointer; }
.f-tabs button[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.feed, .board { display: grid; gap: .3rem; max-height: 220px; overflow: auto; }
.feed li, .board li, .top li { display: grid; grid-template-columns: auto 1fr auto; gap: .5rem; align-items: center; font-size: .84rem; padding: .3rem .4rem; border-radius: 4px; background: #fff; }
.feed li.new { animation: flash 1.2s var(--ease); }
.feed .sw, .board .sw, .top .sw { width: 12px; height: 12px; border-radius: 999px; border: 1.5px solid var(--ink); background: var(--c); }
.feed .who, .board .who, .top .who { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed .km, .board .km, .top .km { font: 700 .8rem var(--mono); }
.board li.me { outline: 2px solid var(--red); }
.board .rk { font: 700 .78rem var(--mono); color: var(--muted); }
.empty { font-size: .85rem; color: var(--muted); padding: .5rem .2rem; grid-template-columns: 1fr !important; background: transparent !important; }
.f-foot { display: flex; align-items: center; gap: .45rem; margin-top: .5rem; font-size: .76rem; color: var(--muted); font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 999px; background: var(--mint); box-shadow: 0 0 0 3px rgba(47, 182, 138, .25); animation: breathe 2s infinite; }

/* gauges, countdown and the flight controls */
.gauges { display: grid; gap: .35rem; margin-top: .7rem; width: 220px; }
.gauge { display: grid; grid-template-columns: 52px 1fr; align-items: center; gap: .5rem; font: 800 .66rem var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--paper-2); }
.gauge i { display: block; height: 12px; border: 2px solid var(--ink); border-radius: 4px; background: rgba(20, 26, 51, .7); overflow: hidden; }
.gauge b { display: block; height: 100%; background: var(--red); transform-origin: left; transition: transform .1s linear; }
.gauge.boost b { background: var(--lunar); }
.gauge-row { display: flex; justify-content: space-between; align-items: center; margin-top: .15rem; }
.hull { display: flex; gap: 4px; }
.hull i { width: 18px; height: 14px; background: var(--mint); border: 2px solid var(--ink); border-radius: 3px; }
.hull i.lost { background: var(--space-3); }
.g-stars { font: 700 1rem var(--mono); color: #ffd23f; text-shadow: 2px 2px 0 var(--ink); }
.count { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); font: 800 clamp(4rem, 14vw, 9rem)/1 var(--display); color: #fff; text-shadow: 6px 6px 0 var(--ink); pointer-events: none; }
.count.go { animation: count .8s var(--ease) both; }
@keyframes count { 0% { transform: translate(-50%, -50%) scale(1.8); opacity: 0; } 25% { opacity: 1; } 100% { transform: translate(-50%, -50%) scale(1); opacity: .9; } }
.controls { position: absolute; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; grid-template-columns: auto auto auto; gap: .6rem; justify-items: center; }
.ctl { min-width: 76px; min-height: 64px; border: 3px solid var(--ink); border-radius: 4px; background: var(--paper); color: var(--ink); font: 800 1.5rem var(--display); box-shadow: 4px 5px 0 var(--ink); cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: none; }
.ctl.boost { min-width: 150px; background: var(--lunar); font-size: 1.15rem; text-transform: uppercase; letter-spacing: .04em; }
.ctl.on { transform: translate(3px, 4px); box-shadow: 1px 1px 0 var(--ink); }
.keys { grid-column: 1 / -1; font-size: .82rem; font-weight: 700; color: var(--paper); text-shadow: 0 1px 0 var(--ink); }
kbd { font: 700 .75rem var(--mono); background: var(--paper); color: var(--ink); border: 1.5px solid var(--ink); border-bottom-width: 3px; border-radius: 4px; padding: .05rem .35rem; }
@media (hover: none) { .keys { display: none; } }
.r-goals { list-style: none; margin: .2rem 0 .7rem; padding: 0; display: grid; gap: .3rem; text-align: left; }
.r-goals li { background: #fff2b8; border: 2px solid var(--sun-deep); border-radius: 4px; padding: .4rem .6rem; font-size: .88rem; display: flex; justify-content: space-between; gap: .5rem; }
.r-goals span { font: 700 .85rem var(--mono); }
.goals { display: grid; gap: .3rem; max-height: 220px; overflow: auto; }
.goals li { display: grid; grid-template-columns: 18px 1fr auto; gap: .45rem; align-items: center; font-size: .82rem; padding: .3rem .4rem; border-radius: 4px; background: #fff; }
.goals li.done { background: #e2f5ec; color: var(--ink-2); }
.goals .tick { width: 16px; height: 16px; border: 2px solid var(--ink); border-radius: 3px; display: grid; place-items: center; font-size: .7rem; font-weight: 800; }
.goals li.done .tick { background: var(--mint); color: #fff; }
.goals .who { font-weight: 700; }
.goals .km { font: 700 .76rem var(--mono); }
.f-tabs button { font-size: .72rem; }

/* flying: the hangar and the field slide away, the HUD takes over */
body.flying .hangar { transform: translateX(calc(100% + 40px)); opacity: 0; pointer-events: none; }
body.flying .field { transform: translateY(calc(100% + 40px)); opacity: 0; pointer-events: none; }
body.flying .console, body.report-open .console { transform: translate(-50%, 160%); opacity: 0; pointer-events: none; }
body.report-open .hangar, body.report-open .field { opacity: 0; pointer-events: none; }

.toast { position: fixed; left: 50%; top: 84px; transform: translate(-50%, -20px); z-index: 80; background: var(--ink); color: var(--paper); border: 2px solid var(--sun); border-radius: 4px; padding: .6rem 1rem; font-weight: 700; font-size: .92rem; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; max-width: calc(100% - 32px); text-align: center; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- narrow windows and zoomed-in pages: the panels get slimmer so the launch button keeps its space ---------- */
@media (max-width: 1200px) { .hangar { width: min(340px, 100% - 32px); } .field { width: 280px; } .launch { min-width: 240px; font-size: 1.4rem; } .console { bottom: 16px; } }
@media (max-width: 1000px) and (min-width: 761px) { .field { display: none; } .hud { top: 76px; } .console { left: calc((100% - 372px) / 2); } body.flying .console { left: 50%; } }
@media (max-height: 640px) and (min-width: 761px) { .hangar { top: 64px; max-height: calc(100dvh - 160px); } .console { bottom: 10px; } .l-note { display: none; } }

/* ---------- phones: the hangar becomes a bottom sheet above the launch button ---------- */
@media (max-width: 760px) {
  .hangar { left: 12px; right: 12px; width: auto; top: auto; bottom: 108px; max-height: 46dvh; padding: .8rem; }
  .hangar.min { max-height: 128px; overflow: hidden; }
  .hangar.min .parts, .hangar.min .paints, .hangar.min .readout, .hangar.min .warn, .hangar.min #rename, .hangar.min .wallet-row { display: none; }
  .hangar.min .fuel { margin-bottom: 0; }
  .hangar { bottom: 100px; }
  .isl-name { font-size: 1.25rem; }
  .field { display: none; }
  .console { bottom: max(14px, env(safe-area-inset-bottom)); }
  .launch { min-width: min(340px, calc(100vw - 24px)); min-height: 62px; font-size: 1.4rem; }
  .hud { top: 74px; }
  .log { bottom: 16px; left: 12px; width: calc(100% - 24px); }
  .log li:nth-last-child(n+3) { display: none; }
  body.flying .log { display: none; }
  .gauges { width: 170px; }
  .ctl { min-width: 84px; min-height: 72px; }
  .ctl.boost { min-width: 130px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ====================================================================================================
   the home page: the launch site. The scene stays fixed behind the hero; the bands scroll over it.
   ==================================================================================================== */
.home { overflow-x: clip; }
.home .scene { z-index: -2; }
.veil { position: fixed; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(0deg, rgba(20, 26, 51, .55), transparent 35%), radial-gradient(50% 70% at 22% 55%, rgba(20, 26, 51, .72), transparent 70%); }
.home .nav { background: linear-gradient(rgba(20, 26, 51, .9), rgba(20, 26, 51, 0)); }
.btn.lg { min-height: 54px; padding: .8rem 1.5rem; font-size: 1.05rem; }
.follow { --fg: var(--paper); border-color: var(--space-3) !important; }
.hero { position: relative; min-height: 100svh; display: grid; align-items: start; align-items: safe center; padding: 110px 0 250px; }   /* 'safe': never centre content that doesn't fit, which would push it under the nav */   /* room at the bottom for the Flight Director */
.hero-grid { display: grid; grid-template-columns: minmax(0, 600px) minmax(300px, 340px); justify-content: space-between; gap: 48px; align-items: end; }
.hero h1 { font-size: clamp(2.6rem, 5.4vw, 4.6rem); max-width: 11ch; margin-top: 1rem; text-shadow: 4px 5px 0 rgba(8, 10, 24, .5); }
.hero h1 em { font-style: normal; color: var(--sun); }
.lede { margin-top: 1.2rem; max-width: 52ch; font-size: 1.15rem; color: var(--paper-2); text-shadow: 0 1px 0 var(--ink); }
.cta-row { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.6rem; }
.hero-note { margin-top: 1rem; font-size: .9rem; font-weight: 600; color: var(--paper-2); text-shadow: 0 1px 0 var(--ink); }
.eyebrow span { color: var(--sun); font: 800 .78rem/1.2 var(--body); letter-spacing: .14em; text-transform: uppercase; }
.eyebrow::before { content: ""; display: inline-block; width: 28px; height: 3px; background: var(--red); margin-right: .6rem; vertical-align: middle; }
.ca-hero { margin-top: 1.2rem; padding: .9rem 1rem; max-width: 560px; }
.ca-full { font: 700 .85rem var(--mono); overflow-wrap: anywhere; margin: .3rem 0 .7rem; }
.ca-links { display: flex; gap: .5rem; flex-wrap: wrap; }
.live { padding: 1rem 1.1rem .9rem; }
.live .kicker { display: flex; align-items: center; gap: .45rem; }
.live-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin: .7rem 0; }
.live-grid div { background: #fff; border: 2px solid var(--paper-2); border-radius: 4px; padding: .45rem .6rem; }
.live-grid dt { font: 800 .62rem var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.live-grid dd { margin: .1rem 0 0; font: 700 1.25rem/1 var(--mono); }
.live .feed { max-height: none; }
.live-foot { margin-top: .6rem; font-size: .8rem; color: var(--muted); font-weight: 600; }
.live-foot b { color: var(--ink); font-family: var(--mono); }
.top .pz { font: 700 .72rem var(--mono); color: var(--sun-deep); min-width: 32px; text-align: right; }
.top li { grid-template-columns: auto auto 1fr auto auto; font-size: .95rem; padding: .45rem .6rem; }
.top .rk { font: 700 .8rem var(--mono); color: var(--muted); min-width: 26px; }
.top li:first-child { background: #fff2b8; }

/* the Flight Director and his bubble */
.fd { position: absolute; left: max(16px, calc((100vw - 1320px) / 2 - 10px)); bottom: 26px; width: 170px; cursor: pointer; filter: drop-shadow(4px 5px 0 rgba(8, 10, 24, .45)); animation: bob 4s ease-in-out infinite; }
.fd svg { width: 100%; height: auto; }
.fd-eyes { animation: blink 5s infinite; transform-origin: center; }
@keyframes blink { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.1); } }
@keyframes bob { 50% { transform: translateY(-5px); } }
.bubble { position: absolute; left: max(196px, calc((100vw - 1320px) / 2 + 170px)); bottom: 120px; max-width: 360px; padding: .75rem 1rem; background: var(--card); color: var(--ink); border: 2.5px solid var(--ink); border-radius: 4px; box-shadow: var(--shadow); font: 600 .95rem/1.4 var(--body); text-align: left; cursor: pointer; }
.bubble::before { content: ""; position: absolute; left: -14px; bottom: 14px; border: 8px solid transparent; border-right-color: var(--ink); border-left: 0; }
.bubble.pop { animation: pop .35s var(--ease); }
@keyframes pop { 0% { transform: scale(.92); } 60% { transform: scale(1.03); } 100% { transform: scale(1); } }

/* bands */
.band { position: relative; background: var(--space); padding: clamp(70px, 9vw, 110px) 0; border-top: 3px solid var(--ink); }
.band h2 { font-size: clamp(2rem, 3.8vw, 3.1rem); margin: .9rem 0 0; max-width: 24ch; }
.band h2 em { font-style: normal; color: var(--sun); }
.band.light { background: var(--paper); color: var(--ink); }
.band.light .eyebrow span { color: var(--red-deep); }
.band.light h2 em { color: var(--red); }
.intro { margin-top: 1rem; max-width: 60ch; font-size: 1.08rem; color: var(--paper-2); }
.band.light .intro { color: var(--ink-2); }
.intro a { color: var(--sun); font-weight: 700; } .band.light .intro a { color: var(--red); }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 2.4rem; }
.step { position: relative; background: var(--card); border: 2.5px solid var(--ink); border-radius: 4px; box-shadow: var(--shadow); padding: 1.1rem 1.1rem 1.3rem; }
.step .n { position: absolute; right: 12px; top: 4px; font: 800 2.8rem/1 var(--display); color: var(--sun); }
.step .ill { height: 96px; margin: 0 0 .8rem; background: #fff; border: 2px solid var(--paper-2); border-radius: 4px; display: grid; place-items: center; }
.step .ill svg { height: 84px; width: auto; }
.step h3 { font: 800 1.1rem/1.3 var(--body); margin-bottom: .3rem; }
.step p { font-size: .95rem; color: var(--ink-2); }
.quote { display: grid; grid-template-columns: auto 1fr; gap: 1.4rem; align-items: center; margin: 3.6rem 0 0; padding: 1.4rem 1.6rem; background: var(--space); color: var(--paper); border: 2.5px solid var(--ink); border-left: 8px solid var(--red); border-radius: 4px; box-shadow: var(--shadow); }
.quote .av { width: 92px; height: 92px; background: var(--sun); border-radius: 4px; overflow: hidden; border: 2px solid var(--ink); }
.quote .av svg { width: 100%; height: 100%; }
.quote blockquote { margin: 0; font: 600 clamp(1.1rem, 2vw, 1.4rem)/1.4 var(--display); }
.quote figcaption { margin-top: .6rem; font: 800 .78rem var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--sun); }
.parts-grid { list-style: none; margin: 2.2rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.pc { padding: .9rem 1rem; }
.pc ol { margin: .5rem 0 0; padding: 0; list-style: none; display: grid; gap: .25rem; }
.pc li { display: flex; align-items: center; gap: .5rem; font-weight: 700; font-size: .92rem; padding: .25rem .4rem; background: #fff; border-radius: 4px; }
.pc li span { width: 20px; height: 20px; display: grid; place-items: center; background: var(--red); color: #fff; border-radius: 999px; font: 800 .7rem var(--body); }
.pc li.prem span { background: var(--sun); color: var(--ink); }
.pc li i { margin-left: auto; font: 700 .68rem var(--mono); color: var(--sun-deep); }
.flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 14px; align-items: center; margin-top: 2.4rem; }
.flow-box { background: var(--card); border: 2.5px solid var(--ink); border-radius: 4px; box-shadow: var(--shadow); padding: 1rem 1.1rem; text-align: center; }
.flow-box b { display: block; font: 800 1.1rem var(--display); }
.flow-box span { font-size: .85rem; color: var(--ink-2); }
.flow-box.gold { background: var(--sun); }
.flow-arrows { display: grid; gap: .5rem; }
.fa { position: relative; padding: .35rem 1.6rem .35rem .6rem; background: var(--space); color: var(--paper); font: 800 .78rem var(--body); border-radius: 4px; border: 2px solid var(--ink); }
.fa::after { content: "→"; position: absolute; right: .5rem; color: var(--sun); }
.fa i { display: block; font: 600 .7rem var(--body); color: var(--paper-2); }
.fa.dim { background: var(--paper-2); color: var(--ink-2); } .fa.dim::after { color: var(--ink-2); }
.split { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; margin: 1.6rem 0 0; }
.split div { background: #fff; border: 2px solid var(--ink); border-radius: 4px; text-align: center; padding: .4rem .2rem; }
.split dt { font: 800 .62rem var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.split dd { margin: .1rem 0 0; font: 700 1rem var(--mono); }
.split div:first-child { background: var(--sun); }
.status { list-style: none; margin: 2.4rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.status li { background: var(--card); border: 2.5px solid var(--ink); border-radius: 4px; padding: .9rem 1rem; display: grid; gap: .3rem; font-size: .92rem; color: var(--ink-2); }
.status b { display: inline-flex; align-items: center; gap: .45rem; font: 800 .74rem var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--ink); }
.status b::before { content: ""; width: 10px; height: 10px; border-radius: 999px; border: 2px solid var(--ink); }
.status .ok b::before { background: var(--mint); } .status .set b::before { background: var(--sun); } .status .never b::before { background: var(--red); }
.board-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 48px; align-items: center; }
.board-grid .btn { margin-top: 1.6rem; }
.top { padding: .8rem; display: grid; gap: .3rem; }
.weeks { margin-top: 2.6rem; display: grid; gap: 1rem; }
.week { padding: .8rem 1rem; }
.wk-head { font-size: .92rem; color: var(--ink-2); } .wk-head a { color: var(--red); font-weight: 700; }
.week ol { margin: .5rem 0 0; padding: 0; list-style: none; display: grid; gap: .25rem; }
.week li { display: grid; grid-template-columns: auto 1fr auto auto; gap: .6rem; align-items: center; font-size: .9rem; padding: .3rem .5rem; background: #fff; border-radius: 4px; }
.week .rk { font: 700 .78rem var(--mono); color: var(--muted); } .week .km { font: 700 .8rem var(--mono); } .week .pz { font: 700 .76rem var(--mono); color: var(--sun-deep); }
.week .empty { font-size: .86rem; color: var(--muted); }
.live-grid dd a { color: var(--red); text-decoration: none; font-size: 1rem; }
.closing { position: relative; padding: clamp(90px, 12vw, 150px) 0; text-align: center; background: var(--red); color: #fff; border-top: 3px solid var(--ink); }
.closing h2 { font-size: clamp(2.4rem, 6vw, 4.6rem); text-shadow: 4px 5px 0 var(--ink); margin: .6rem 0 1.6rem; }
.kicker.light { color: var(--paper); }
.closing .btn { --bg: var(--sun); --fg: var(--ink); }
.foot { background: var(--space); border-top: 3px solid var(--sun); padding: 44px 0 40px; color: var(--paper-2); font-size: .92rem; }
.foot-row { display: flex; justify-content: space-between; gap: 32px; }
.foot-row p:first-child { max-width: 72ch; }
.foot strong { color: var(--paper); }
.foot a { color: var(--sun); }
.flat .scene, .flat .loading { display: none; }
@media (max-width: 1100px) { .steps { grid-template-columns: repeat(2, 1fr); } .flow { grid-template-columns: 1fr; } .flow-arrows { grid-auto-flow: column; } .fa::after { content: "↓"; } .status { grid-template-columns: 1fr 1fr; } .split { grid-template-columns: repeat(5, 1fr); } }
@media (max-width: 1100px) { .hero-grid { grid-template-columns: 1fr; justify-content: stretch; } .live { max-width: 520px; } }
@media (max-width: 860px) { .board-grid { grid-template-columns: 1fr; } .parts-grid { grid-template-columns: 1fr 1fr; } .fd { display: none; } .bubble { position: static; margin: 1rem 0 0; max-width: none; } .bubble::before { display: none; } .hero { padding-bottom: 60px; } }
@media (max-width: 760px) { .steps, .parts-grid, .status, .flow-arrows { grid-template-columns: 1fr; grid-auto-flow: row; } .foot-row { flex-direction: column; } .hero h1 { font-size: 2.5rem; } }

/* ====================================================================================================
   the Almanac: a cream document with a sticky table of contents
   ==================================================================================================== */
.doc { background: var(--paper); color: var(--ink); }
.nav.solid { position: sticky; background: var(--space); border-bottom: 3px solid var(--red); padding: 9px 0; }
.doc-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 56px; padding: 48px 0 90px; align-items: start; }
.toc { position: sticky; top: 80px; }
.toc ol { list-style: none; margin: .6rem 0 0; padding: 0; display: grid; gap: .2rem; counter-reset: t; }
.toc a { display: block; padding: .35rem .6rem; border-left: 3px solid var(--paper-2); font-weight: 700; font-size: .9rem; text-decoration: none; color: var(--ink-2); }
.toc a:hover { border-left-color: var(--red); color: var(--ink); }
.doc-body h1 { font-size: clamp(2.2rem, 4.5vw, 3.4rem); margin-top: .8rem; }
.doc-body .eyebrow span { color: var(--red-deep); }
.doc-body .intro { color: var(--ink-2); }
.doc-body section { margin-top: 3rem; scroll-margin-top: 90px; }
.doc-body h2 { font-size: 1.7rem; padding-bottom: .4rem; border-bottom: 3px solid var(--ink); margin-bottom: 1rem; }
.doc-body p { margin: .7rem 0; max-width: 72ch; font-size: 1.02rem; }
.doc-body code { font: 700 .88em var(--mono); background: #fff; padding: .1rem .35rem; border: 1.5px solid var(--paper-2); border-radius: 4px; }
.note { font-size: .92rem !important; color: var(--ink-2); }
.facts { margin: .6rem 0; padding: 0; list-style: none; display: grid; gap: .5rem; }
.facts li { background: var(--card); border: 2px solid var(--ink); border-radius: 4px; padding: .65rem .9rem; font-size: .98rem; box-shadow: 3px 3px 0 var(--ink); }
.tbl-wrap { overflow: auto; margin: .8rem 0; border: 2.5px solid var(--ink); border-radius: 4px; background: var(--card); box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: left; padding: .55rem .7rem; border-bottom: 1.5px solid var(--paper-2); vertical-align: top; }
thead th { background: var(--space); color: var(--paper); font: 800 .72rem var(--body); letter-spacing: .1em; text-transform: uppercase; }
tbody th { font-weight: 800; white-space: nowrap; } tbody th small { font-weight: 600; color: var(--muted); }
td small { color: var(--muted); } td.prem { background: #fff6d6; }
td.ok { color: #1a7a55; font-weight: 800; } td.set { color: var(--sun-deep); font-weight: 800; } td.never { color: var(--red-deep); font-weight: 800; }
tfoot td { font-size: .8rem; color: var(--ink-2); }
.faq { margin: 0; display: grid; gap: .3rem; }
.faq dt { font-weight: 800; margin-top: .8rem; } .faq dd { margin: .15rem 0 0; color: var(--ink-2); max-width: 72ch; }
@media (max-width: 860px) { .doc-grid { grid-template-columns: 1fr; gap: 24px; } .toc { position: static; } .toc ol { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) { .doc .links { display: none; } }
