/* ============================================================
   moon-lander.nodejavascript.com — lunar regolith, system fonts,
   no external assets, one drawing of this site's own.
   Sibling of nodejavascript.com: same family shell, its own identity.
   ============================================================ */

:root {
  /* 🔴 THIS SITE'S OWN COLOURS, AND THEY HAVE TO STAY ITS OWN (standard parts 5a
     and 5b). Regolith is the actual colour of the stuff the lander lands on —
     a warm silver-grey — and the background is a near-black of the same hue, so
     the tab, the page and the header bar agree. Neither value appears anywhere
     else in the family; `~/.nodejs_theme_register.py` is what checks that. */
  --bg: #0d0b09;
  --bg-soft: #12100d;
  --surface: #16130f;
  --surface-2: #1c1813;
  --line: rgba(216, 210, 196, 0.11);
  --border-strong: rgba(216, 210, 196, 0.2);

  --text: #f4f0e6;
  --muted: #a89f8d;

  --accent: #d8d2c4;
  --accent-deep: #b9b1a0;
  --accent-soft: rgba(216, 210, 196, 0.14);
  --ink: #14110d;

  --good: #7fd18a;
  --bad: #f08a7a;
  --warn: #e8c07a;
  --yellow: #fbbf24;

  --radius: 14px;
  --radius-lg: 22px;
  --container: 980px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

/* `hidden` has to beat any display rule, or a control hidden in the markup comes
   back the moment a class gives it a display — the attribute only sets
   `display: none` at the lowest possible weight. The cookie bar and its two views
   swap places by setting `hidden`, and two of them are laid out with flex, so
   without this the ask stays on screen underneath the panel. */
[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  background:
    radial-gradient(1000px 560px at 82% -10%, rgba(216, 210, 196, 0.13), transparent 62%),
    linear-gradient(180deg, #0d0b09 0%, #100e0b 52%, #0b0908 100%);
  background-attachment: fixed;
}

/* 🔴 THE ABSTRACT — the extra touch the apex had and the rest of the family did not
   (standard part 5d-ii). Measured in a real browser on 19 Sep 2026: nine of the ten
   sites painted a gradient wash and no geometry at all, and every one of them passed
   the "has a background image" check because the register counted gradient types in
   the stylesheet. George, verbatim: *"the rest of the sites have lovely theme colors
   and gradients, but maybe missing the extra touch of a background abstract."*

   This site's geometry is A CRATER FIELD: three sizes of impact ring repeated across
   the ground, which is a drawing no other site in the family makes. It sits on its own
   fixed layer rather than in body's gradient stack for one reason — a pattern has to
   FADE, and nothing fades a background image except a mask. A mask on `body` would
   fade the page's own background with it; masked here, the craters dissolve before the
   fold, so there is no edge to see, which is the half of part 5d that matters. */
.dvs-pattern {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(circle 5px at 38px 44px, rgba(216, 210, 196, 0.15) 0 5px, rgba(216, 210, 196, 0.05) 5px 7px, rgba(0, 0, 0, 0) 8px),
    radial-gradient(circle 3px at 112px 98px, rgba(216, 210, 196, 0.12) 0 3px, rgba(0, 0, 0, 0) 3.6px),
    radial-gradient(circle 1.6px at 64px 140px, rgba(216, 210, 196, 0.1) 0 1.6px, rgba(0, 0, 0, 0) 2px),
    linear-gradient(180deg, rgba(216, 210, 196, 0.05) 0%, rgba(0, 0, 0, 0) 46%);
  background-size: 154px 154px, 154px 154px, 154px 154px, 100% 100%;
  background-repeat: repeat, repeat, repeat, no-repeat;
  -webkit-mask-image: radial-gradient(130% 88% at 50% 4%, #000 16%, rgba(0, 0, 0, 0) 82%);
  mask-image: radial-gradient(130% 88% at 50% 4%, #000 16%, rgba(0, 0, 0, 0) 82%);
}

/* ---------- shell ---------- */

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
}
.skip:focus {
  left: 8px;
  top: 8px;
  z-index: 20;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--ink);
  font-weight: 700;
}

/* The bar spans the viewport, not the content column, and the column starts below
   it — the two faults that read as correct in the source and wrong on the page. */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 20px;
  background: rgba(13, 11, 9, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}
.brand .mark {
  color: var(--accent);
  display: inline-flex;
}
.brand b {
  display: block;
  font-size: 15px;
  letter-spacing: 0.2px;
  line-height: 1.1;
}
.brand small {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

main {
  max-width: var(--container);
  margin: 0 auto;
  padding: 32px 20px 60px;
}

/* ---------- hero ---------- */

.hero {
  padding: 26px 0 34px;
}

h1 {
  font-size: clamp(30px, 6vw, 48px);
  line-height: 1.08;
  margin: 0 0 16px;
  letter-spacing: -0.6px;
}

.lede {
  font-size: clamp(16px, 2.4vw, 19px);
  color: #e6e0d2;
  margin: 0 0 20px;
  max-width: 64ch;
}

.sub {
  color: var(--muted);
  margin: 0 0 14px;
  max-width: 72ch;
}
.sub b {
  color: var(--text);
}
.plain {
  color: var(--muted);
  font-size: 14px;
  margin: 18px 0 0;
}
.small {
  font-size: 13.5px;
}
h3 {
  font-size: 17px;
  margin: 22px 0 6px;
  letter-spacing: -0.1px;
}

/* ---------- cards ---------- */

.card {
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin: 0 0 22px;
  box-shadow: 0 14px 36px -22px rgba(0, 0, 0, 0.8);
}
.card h2 {
  font-size: clamp(19px, 3.4vw, 25px);
  margin: 0 0 8px;
  letter-spacing: -0.3px;
}
.card-head {
  margin-bottom: 16px;
}

/* ---------- the stage ---------- */

.stage-wrap {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #090807;
}
#stage {
  display: block;
  width: 100%;
  height: 330px;
}

.outcome {
  position: absolute;
  left: 14px;
  top: 12px;
  margin: 0;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: var(--ink);
  background: var(--accent);
}
.outcome.landed {
  background: var(--good);
}
.outcome.crash,
.outcome.lost {
  background: var(--bad);
}
.outcome.offpad,
.outcome.timeout {
  background: var(--warn);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 4px;
}
.controls button {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  border-radius: 11px;
  padding: 10px 16px;
  cursor: pointer;
  border: 1px solid transparent;
  background: var(--accent);
  color: var(--ink);
}
.controls button:hover:not(:disabled) {
  background: #eae5d9;
}
.controls button.ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
  font-weight: 500;
}
.controls button.ghost:hover {
  border-color: var(--accent);
}
.controls button[aria-pressed="true"]:not(.ghost) {
  outline: 2px solid var(--accent-deep);
  outline-offset: 2px;
}
.hint {
  color: var(--muted);
  font-size: 13px;
  margin: 10px 0 0;
  max-width: 78ch;
}
.hint b {
  color: var(--text);
}
.status {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

/* ---------- telemetry ---------- */

.telemetry {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 18px 26px;
  margin: 20px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
@media (max-width: 720px) {
  .telemetry {
    grid-template-columns: minmax(0, 1fr);
  }
}
.readouts dl,
.stats {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 14px;
  margin: 0;
  font-size: 14px;
}
.readouts dt,
.stats dt {
  color: var(--muted);
}
.readouts dd,
.stats dd {
  margin: 0;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.bars {
  display: grid;
  gap: 9px;
  margin-top: 16px;
}
.bar {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--muted);
}
.track {
  position: relative;
  display: block;
  height: 8px;
  border-radius: 999px;
  background: rgba(216, 210, 196, 0.1);
  overflow: hidden;
}
.fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: 999px;
  transition: width 90ms linear;
}
.fill.fuel {
  background: var(--accent);
}
.fill.throttle {
  background: var(--warn);
}
.fill.side {
  background: var(--good);
}

/* ---------- charts ---------- */

.chart {
  margin: 22px 0 0;
}
.chart figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin-bottom: 8px;
}
.chart-title {
  font-weight: 700;
  font-size: 15px;
}
.chart-note {
  color: var(--muted);
  font-size: 13px;
  flex: 1 1 260px;
}
.chart-value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  color: var(--accent);
}
.chart-body {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.24);
  padding: 6px 4px 2px;
}
.chart-body svg {
  display: block;
  width: 100%;
  height: 160px;
}
.grid {
  stroke: rgba(216, 210, 196, 0.12);
  stroke-width: 1;
}
.axis {
  fill: var(--muted);
  font-size: 11px;
  font-family: var(--font-mono);
}
.rule {
  stroke: var(--bad);
  stroke-width: 1.2;
  stroke-dasharray: 5 4;
}
.rule-label {
  fill: var(--bad);
}
.area {
  fill: rgba(216, 210, 196, 0.1);
}
.line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linejoin: round;
}
.dot {
  fill: var(--accent);
}

/* ---------- footer ---------- */

.foot {
  border-top: 1px solid var(--line);
  padding: 26px 20px 40px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
}
.foot-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
}
.foot-brand .mark {
  color: var(--accent);
  display: inline-flex;
}
.foot-brand a {
  color: var(--muted);
  text-decoration: none;
}
.foot-brand a:hover {
  color: var(--text);
}
.foot-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 14px;
  list-style: none;
  margin: 6px 0;
  padding: 0;
}
.foot-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px 14px;
  margin: 10px 0 0;
  font-size: 12.5px;
  color: rgba(168, 159, 141, 0.8);
}
a {
  color: var(--accent);
}
a:hover {
  color: #f6f2e8;
}
.linkish {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: inherit;
  color: inherit;
  cursor: pointer;
}
.linkish:hover,
.linkish:focus-visible {
  color: var(--accent);
  text-decoration: underline;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 2px;
}

/* ---------- the cookie bar ----------

   The same consent model as every other site in the family, in this page's colours.
   Three things here are deliberate and should stay that way.

   It sits in one row — the question, then the two answers — because a banner that
   stacks into paragraphs is a banner people resent. The two answers carry the same
   class, so they are the same size, the same weight and the same distance from the
   reader: no accept-first order, no smaller decline, and no colour that quietly says
   which one is welcome. And the detail lives one link away rather than in the bar. */

/* A fixed banner sits on top of whatever is behind it and takes the click, so the
   page leaves exactly the banner's own height free while it is up — measured and
   written back by consent.js, and reset to zero the moment the question is answered.
   Without this the footer cannot be clicked until a visitor has answered a question
   about cookies, which is not a question anyone should have to answer to reach a link. */
body {
  padding-bottom: var(--consent-height, 0px);
}

.consent {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 22px;
  padding: 13px 20px;
  background: rgba(20, 17, 13, 0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(8px);
  max-height: calc(100vh - 12px);
  max-height: calc(100dvh - 12px);
  overflow-y: auto;
}
.consentTitle {
  flex: 0 0 auto;
  margin: 0;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
}
.consentText {
  flex: 1 1 300px;
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}
.consentActions {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  flex: 1 1 auto;
  gap: 10px;
}
.consentActions button {
  min-width: 0;
  padding: 10px 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  border-radius: 11px;
  cursor: pointer;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text);
}
.consentActions button:hover {
  border-color: var(--accent);
}
.consentText a {
  color: var(--text);
}
.consentAsk {
  flex: 1 1 320px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 22px;
}
.consentPrefs {
  flex: 1 1 100%;
}
.consentHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.consentClose {
  flex: 0 0 auto;
  background: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  font: inherit;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  padding: 3px 10px;
}
.consentClose:hover,
.consentClose:focus-visible {
  color: var(--text);
  border-color: var(--text);
}
.consentSettings {
  flex: 0 0 auto;
  color: var(--muted);
}
.consentList {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}
.consentRow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.consentRow > div {
  flex: 1 1 260px;
  min-width: 0;
}
.consentRowName {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.consentRowWhy {
  margin: 2px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

/* The switch. Its ring is drawn from `aria-checked`, so what the eye sees and what a
   screen reader announces are the same attribute and cannot drift apart — nothing in
   the script toggles a class. The word beside it carries the state as well, because a
   state shown only in colour is a state some readers cannot see. */
.consentSwitch {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
}
.consentSwitch .consentDot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
}
.consentSwitch[aria-checked="true"] {
  border-color: var(--accent);
  color: var(--text);
}
.consentSwitch[aria-checked="true"] .consentDot {
  background: var(--accent);
}
