/* InterImm phase 2 kit · 137: the shared look of every phase 2 site.

   Source of truth: InterImm/interstellar, kit/. Published at
   https://interstellar.interimm.org/kit/interimm.css with its fonts and interimm.js.
   See kit/README.md and the spec page at https://interstellar.interimm.org/kit/.

   137 is 1/α, the one number both worlds already share. Phase 2 is a conversation
   across light years, so it is written in the alphabet
   of the first message: 667 bits that fold into a 23 × 29 picture. Everything is
   made of square pixels on deep blue, with signal blue for the open sky. Their voice is the white-cyan of the bits
   they sent; ours is the yellow of our own star. No curves, no paper, no red:
   phase 1 is serif type on paper with Mars rust, and phase 2 shares nothing with it
   but class names and markup hooks. Keep changes additive. */

/* ---------- fonts (self-hosted, SIL OFL; see kit/fonts) ---------- */
@font-face {
  font-family: "Pixelify Sans";
  src: url("fonts/pixelify-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("fonts/instrument-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- tokens ---------- */
:root {
  color-scheme: dark;

  /* deep blue for reading; signal blue (--sky) only for the open sky of a hero */
  --sky: #1422c2;
  --bg: #0d1457;
  --bg-alt: #0a104a;
  --surface: #141d6e;
  --surface-2: #1b267f;
  --deep: #070b38;            /* instruments, tools, anything you look into */
  --text: #ffffff;
  --muted: #d0d5f7;
  --border: rgb(255 255 255 / 0.14);
  --border-strong: rgb(255 255 255 / 0.4);

  /* the two voices */
  --them: #9ff8ff;            /* what reaches us: their bits, the signal, the current item */
  --them-soft: rgb(159 248 255 / 0.16);
  --them-ink: #031c22;        /* text on --them */
  --us: #ffd84a;              /* what we send: the colour of our own star */
  --us-soft: rgb(255 216 74 / 0.18);
  --us-ink: #2a2000;          /* text on --us */

  /* phase 1 names, mapped onto the voices */
  --accent: var(--them);
  --accent-hover: #ffffff;
  --accent-text: var(--them-ink);
  --accent-soft: var(--them-soft);
  --beam: var(--us);
  --beam-soft: var(--us-soft);
  --link: var(--them);
  --focus: var(--us);
  --signal: var(--them);      /* a detection in charts */
  --noise: #3a4bd6;           /* the noise floor in charts */
  --scope: var(--deep);       /* chart ground */
  --shadow: 6px 6px 0 rgb(2 4 30 / 0.6);   /* a hard pixel shadow, never a blur */

  /* data colours: categorical series never use the two voices */
  --c1: #7dffa8; --c2: #ff8ad8; --c3: #ffa45c; --c4: #c9b3ff;
  --seq-1: #2638dc; --seq-2: #3d55ea; --seq-3: #5b76f4; --seq-4: #7f98fb; --seq-5: #a6b9ff; --seq-6: #ccd7ff; --seq-7: #f0f4ff;
  --div-cool-1: #a4609c; --div-cool-2: #d8807e; --div-cool-3: #ffa45c;
  --div-hot-1: #7f98fb; --div-hot-2: #b4d4ff; --div-hot-3: #effaff;
  --div-mid: #8e95d6;
  --plot-grid: rgb(255 255 255 / 0.08);
  --plot-axis: rgb(255 255 255 / 0.28);
  --plot-context: rgb(255 255 255 / 0.12);
  --plot-dim: #8890d8;

  /* scales: everything snaps to a 4 px pixel */
  --px: 4px;
  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem; --space-4: 1rem;
  --space-5: 1.5rem; --space-6: 2rem; --space-7: 3rem; --space-8: 4.5rem;
  --step--2: 0.72rem;         /* mono labels: kickers, table heads, captions */
  --step--1: 0.875rem;        /* notes, small controls */
  --step-0: 1.0625rem;        /* body */
  --step-1: 1.22rem;          /* ledes */
  --step-2: clamp(1.75rem, 1.25rem + 1.9vw, 2.6rem);  /* section titles */
  --step-3: clamp(2.4rem, 1.4rem + 4vw, 4.4rem);    /* page titles */
  --step-4: clamp(2.6rem, 1.3rem + 5vw, 5.2rem);    /* hero titles */
  --step-5: clamp(2.8rem, 1.2rem + 6vw, 6.4rem);    /* the entrance only */
  --radius-sm: 0;
  --radius: 0;
  --radius-pill: 0;
  --dur: 0.12s;
  --rule: 2px dashed rgb(255 255 255 / 0.3);   /* a line of bits, not a printed rule */
  /* stepped corners, one pixel cut from each: the only shape in phase 2 */
  --notch: polygon(0 var(--px), var(--px) var(--px), var(--px) 0, calc(100% - var(--px)) 0, calc(100% - var(--px)) var(--px), 100% var(--px), 100% calc(100% - var(--px)), calc(100% - var(--px)) calc(100% - var(--px)), calc(100% - var(--px)) 100%, var(--px) 100%, var(--px) calc(100% - var(--px)), 0 calc(100% - var(--px)));
  --wrap: 76rem;
  --cjk: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans SC", "Source Han Sans SC";
  --emoji: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji";
  --font: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, var(--cjk), sans-serif, var(--emoji);
  /* pixels are for big type only: page titles and display numbers. Everything you read is Instrument Sans. */
  --font-display: "Pixelify Sans", "JetBrains Mono", ui-monospace, var(--cjk), monospace, var(--emoji);
  --font-heading: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, var(--cjk), sans-serif, var(--emoji);
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, var(--cjk), monospace;
}

/* no curves anywhere: the message has none */
*, *::before, *::after { border-radius: 0 !important; }

/* the open sky over a hero: a deeper blue, a pixel grid, and (drawn by interimm.js) their picture */
.space {
  --bg: var(--sky);
  --surface: rgb(0 0 60 / 0.35);
  --surface-2: rgb(0 0 60 / 0.5);
  color: var(--text);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--bg);
}
.space::before {
  content: ""; position: absolute; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    linear-gradient(rgb(255 255 255 / 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 0.05) 1px, transparent 1px);
  background-size: 24px 24px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 45%);
  mask-image: linear-gradient(90deg, transparent, #000 45%);
}
.message-field { position: absolute; z-index: -1; top: 50%; right: 3%; height: 118%; width: auto; aspect-ratio: 23 / 29; transform: translateY(-50%); pointer-events: none; opacity: 0.1; image-rendering: pixelated; }
@media (max-width: 56rem) { .message-field { opacity: 0.06; right: -10%; } }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; }

h1, h2, h3 {
  font-family: var(--font-heading); font-weight: 700;
  line-height: 1.15; letter-spacing: -0.015em; margin: 0 0 0.6em; text-wrap: balance;
}
/* only the page title is set in pixels */
h1 { font-family: var(--font-display); line-height: 1.05; letter-spacing: 0; }
h1:lang(zh), h2:lang(zh), h3:lang(zh) { font-weight: 800; letter-spacing: 0.02em; line-height: 1.3; }
h3 { line-height: 1.3; letter-spacing: 0; }
p { margin: 0 0 1em; text-wrap: pretty; }
img, video, svg, canvas { max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: 0.22em; text-decoration-style: dotted; text-decoration-thickness: 2px; }
a:hover { text-decoration-style: solid; }
ul, ol { margin: 0 0 1em; }
::selection { background: var(--accent); color: var(--accent-text); }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.wrap { width: min(100% - 2rem, var(--wrap)); margin-inline: auto; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  padding: 0.6rem 1rem; border-radius: 0.5rem;
  background: var(--accent); color: var(--accent-text); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 1rem; }

.text-center { text-align: center; }

/* mono label above a heading, led by a signal-strength glyph like a receiver's readout.
   .kicker-out (or .eyebrow-out) switches it to our voice, for what we send. */
.kicker, .eyebrow {
  display: inline-flex; align-items: center; gap: 0.6rem; margin: 0 0 1rem;
  font-family: var(--font-mono); font-size: 0.75rem; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent);
}
/* the kicker is led by the first bits of the preamble: 1, 0, 1, 1 (2 and 3, the first primes) */
.kicker::before {
  content: ""; flex: none; width: calc(var(--px) * 7); height: var(--px);
  background:
    linear-gradient(currentColor 0 0) 0 0 / var(--px) 100% no-repeat,
    linear-gradient(currentColor 0 0) calc(var(--px) * 4) 0 / var(--px) 100% no-repeat,
    linear-gradient(currentColor 0 0) 100% 0 / var(--px) 100% no-repeat;
  box-shadow: none;
}
.kicker-out, .eyebrow-out { color: var(--us); }
.kicker:has(.pulse)::before { display: none; }
.eyebrow { margin: 0; }
/* a blinking pixel: on for the beacon's duty cycle, off between */
.pulse { width: 0.5rem; height: 0.5rem; background: var(--accent); animation: pulse 1.6s steps(1) infinite; }
@keyframes pulse { 60% { opacity: 0.15; } }

/* numbers that should line up: clocks, coordinates, measurements */
.readout { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: 0; }

.icon { width: 1.5rem; height: 1.5rem; flex: none; }
.icon-emoji { display: inline-grid; place-items: center; font-size: 1.25rem; line-height: 1; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--deep);
  border-bottom: 2px solid var(--text);
}
.header-inner { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem 1.25rem; min-height: 4rem; padding-block: 0.5rem; }

.brand {
  display: inline-flex; align-items: center; gap: 0.65rem;
  font-family: var(--font-heading); font-weight: 700; font-size: 1.05rem; letter-spacing: 0;
  color: var(--text); text-decoration: none;
}
/* phase 2 brand mark, drawn in pixels: our star (yellow), the bits between, their star (white-cyan).
   An <img class="brand-mark"> still works. */
.brand-dot {
  flex: none; width: calc(var(--px) * 9); height: calc(var(--px) * 3);
  background:
    linear-gradient(var(--us) 0 0) 0 0 / calc(var(--px) * 3) 100% no-repeat,
    linear-gradient(var(--muted) 0 0) calc(var(--px) * 4) var(--px) / var(--px) var(--px) no-repeat,
    linear-gradient(var(--them) 0 0) 100% 0 / calc(var(--px) * 3) 100% no-repeat;
}
.brand-site { color: var(--text); font-weight: 600; font-size: 0.98rem; text-decoration: none; white-space: nowrap; }
.brand-site::before { content: "/"; margin-right: 0.75rem; color: var(--border-strong); font-weight: 400; }
.brand-site:hover { color: var(--link); }
/* a family site shows its own name instead of the era's year */
.header-inner:has(.brand-site) .brand-sub { display: none; }
.brand-sub { font-family: var(--font-mono); font-weight: 500; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }

.site-nav { display: flex; flex: 1; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.25rem 1rem; }
.nav-list { display: flex; flex-wrap: wrap; align-items: center; gap: 0.1rem; list-style: none; margin: 0; padding: 0; }

.nav-link, .dropdown > summary {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.4rem 0.7rem; border-radius: 999px;
  color: var(--muted); font-size: 0.95rem; font-weight: 500; text-decoration: none; cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.nav-link:hover, .dropdown > summary:hover, .dropdown[open] > summary { color: var(--text); background: var(--surface-2); }
.nav-link[aria-current="page"], .dropdown[data-current] > summary { color: var(--them-ink); background: var(--them); }
.lang-link { border: 1px solid var(--border-strong); color: var(--text); }

.dropdown { position: relative; }
.dropdown > summary { list-style: none; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown > summary::after {
  content: ""; width: 0.35em; height: 0.35em; margin-top: -0.2em;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg);
}
.dropdown-menu {
  position: absolute; top: calc(100% + 0.5rem); left: 0; z-index: 60;
  min-width: min(19rem, 90vw); margin: 0; padding: 0.4rem; list-style: none;
  background: var(--deep); border: 2px solid var(--text); box-shadow: var(--shadow);
}
.dropdown-menu a {
  display: block; padding: 0.5rem 0.75rem; border-radius: 0.5rem;
  color: var(--text); font-size: 0.95rem; text-decoration: none;
}
.dropdown-menu a:hover { background: var(--surface-2); }
.dropdown-menu a[aria-current="page"] { color: var(--link); font-weight: 600; }

.nav-toggle {
  display: none; margin-left: auto; padding: 0.45rem; border: 1px solid var(--border-strong); border-radius: 999px;
  background: transparent; color: var(--text); cursor: pointer;
}

/* on wide screens GitHub is an icon; the word comes back in the folded menu */
@media (min-width: 75.01rem) { .nav-github-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } }
@media (max-width: 96rem) {
  .js .nav-toggle { display: inline-flex; }
  .js .site-nav { display: none; flex-basis: 100%; padding-bottom: 0.75rem; }
  .js .site-nav.is-open { display: flex; flex-direction: column; align-items: stretch; }
  .nav-list { flex-direction: column; align-items: stretch; }
  .nav-link, .dropdown > summary { border-radius: 0.5rem; font-size: 1rem; }
  .nav-tools { flex-direction: row; flex-wrap: wrap; padding-top: 0.5rem; border-top: 1px solid var(--border); }
  .dropdown-menu { position: static; min-width: 0; margin: 0.2rem 0 0.4rem 0.75rem; box-shadow: none; }
}

/* ---------- buttons, chips ---------- */
/* buttons are blocks of pixels with notched corners and a hard shadow that they press into */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6ch;
  min-height: 2.6rem; padding: 0.5rem 1.15rem; border: 2px solid var(--text);
  background: transparent; color: var(--text); font: inherit; font-family: var(--font-mono); font-size: 0.85rem; font-weight: 600; line-height: 1.4;
  letter-spacing: 0.06em; text-transform: uppercase;
  white-space: nowrap; text-decoration: none; cursor: pointer; clip-path: var(--notch);
  transition: background var(--dur) steps(2), color var(--dur) steps(2), transform var(--dur) steps(2);
}
.btn:hover { background: var(--text); color: var(--bg); }
.btn:active { transform: translate(2px, 2px); }
.btn span { display: inline-block; transition: transform 0.15s; }
.btn:hover span { transform: translateX(3px); }
/* primary is lit in the incoming voice; .btn-send is for anything that transmits (send, write back) */
.btn-primary { background: var(--them); border-color: var(--them); color: var(--them-ink); }
.btn-primary:hover { background: #ffffff; border-color: #ffffff; color: var(--them-ink); }
.btn-send { background: var(--us); border-color: var(--us); color: var(--us-ink); }
.btn-send:hover { background: #fff0a8; border-color: #fff0a8; color: var(--us-ink); }
.btn-ghost { border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); border-color: var(--text); }
.btn-lg { min-height: 3rem; padding: 0.7rem 1.5rem; font-size: 1.02rem; }

.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; margin: 0 0 1.25rem; padding: 0; }
.chips li {
  padding: 0.15rem 0.8rem; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--muted); font-family: var(--font-mono); font-size: 0.78rem; line-height: 1.7;
}
.chips-small li { padding: 0.05rem 0.6rem; font-size: 0.72rem; }

.text-link { color: var(--text); font-weight: 600; text-decoration: none; border-bottom: 2px dotted var(--accent); padding-bottom: 0.1rem; }
.text-link span { display: inline-block; transition: transform 0.15s; }
.text-link:hover span { transform: translateX(3px); }

/* ---------- sections ---------- */
.section { padding-block: clamp(3.5rem, 8vw, 6rem); }
.section-alt { background: var(--bg-alt); border-block: var(--rule); }
.section-head { margin-bottom: clamp(1.75rem, 4vw, 2.75rem); }
.section-head-split { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1.25rem 2rem; }
.section-title { font-size: var(--step-2); margin-bottom: 0.5rem; letter-spacing: -0.02em; }
.section-lede { max-width: 38rem; margin: 0; color: var(--muted); font-size: 1.08rem; }

/* tiles */
.bento { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16.5rem), 1fr)); }
.tile {
  position: relative; display: flex; flex-direction: column;
  padding: 1.5rem; border: 2px solid var(--border-strong);
  background: var(--surface); clip-path: var(--notch);
}
.tile > :last-child { margin-bottom: 0; }
.tile-icon {
  display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; margin-bottom: 1.25rem;
  background: var(--them); color: var(--them-ink);
}
/* glyphs: a part of the 667-bit picture drawn as an icon by the kit (data-glyph="count|system|dish|hydrogen") */
[data-glyph] canvas { display: block; width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.tile-title { font-size: 1.1rem; margin-bottom: 0.4rem; }
.tile p { color: var(--muted); font-size: 0.97rem; }
.tile .card-cta { color: var(--text); }

/* cards */
.card-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
.card {
  position: relative; display: flex; flex-direction: column;
  padding: 1.5rem; background: var(--surface); border: 2px solid var(--border-strong); clip-path: var(--notch);
}
.card > :last-child { margin-bottom: 0; }
.card-title { font-size: 1.1rem; margin-bottom: 0.5rem; }
.card-cta { margin: auto 0 0; padding-top: 0.75rem; color: var(--link); font-size: 0.92rem; font-weight: 600; }
.card-cta span { display: inline-block; color: var(--accent); transition: transform var(--dur) steps(2); }
.card-wide { max-width: 54rem; margin-inline: auto; width: 100%; }

/* a strip of cards separated by hairlines, as on an instrument panel */
.panel { display: grid; gap: 2px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); background: var(--border-strong); border: 2px solid var(--border-strong); overflow: hidden; }
.panel > * { margin: 0; padding: 1.4rem 1.5rem; background: var(--bg); border: 0; border-radius: 0; }
.space .panel > * { background: var(--bg); }
.section-alt .panel > * { background: var(--bg-alt); }

.card-link-wrap { transition: border-color var(--dur) steps(2), background var(--dur) steps(2); }
.card-link-wrap:hover { border-color: var(--accent); background: var(--surface-2); }
.panel > .card-link-wrap:hover { background: var(--surface-2); box-shadow: none; }
.card-link-wrap:hover .card-cta span { transform: translateX(4px); }
.card-link { color: var(--text); text-decoration: none; }
.card-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card-link:focus-visible { outline: none; }
.card-link:focus-visible::after { outline: 3px solid var(--focus); outline-offset: -5px; }

.card-media { padding: 0; overflow: hidden; }
.card-media .card-image { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--bg-alt); }
.card-media .card-body { padding: 1.25rem 1.5rem 1.5rem; }

.stack { display: grid; gap: 1.5rem; }
.figure { margin: 1rem 0 0; padding: 1rem; background: var(--surface); border: 2px solid var(--border-strong); text-align: center; }
.figure img { max-height: 32rem; width: auto; margin-inline: auto; }

/* ---------- the signature: a scope (waterfall spectrogram or any chart) ---------- */
.scope { position: relative; margin: 0; overflow: hidden; border: 2px solid var(--text); background: var(--scope); box-shadow: var(--shadow); }
.scope canvas { display: block; width: 100%; height: 14rem; image-rendering: pixelated; }
.scope figcaption {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 1rem; padding: 0.5rem 0.8rem;
  border-top: 2px solid var(--border-strong); font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted);
}
.scope-axis { position: absolute; inset: auto 0 2.1rem; display: flex; justify-content: space-between; padding: 0 0.6rem; pointer-events: none; font-family: var(--font-mono); font-size: 0.65rem; color: color-mix(in srgb, var(--muted) 80%, transparent); }

/* key–value readouts (coordinates, distances) */
.readouts { display: grid; gap: 0.8rem 1.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr)); margin: 0; }
.readouts div { border-top: var(--rule); padding-top: 0.6rem; }
.readouts dt { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.readouts dd { margin: 0.15rem 0 0; font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 1.15rem; font-weight: 500; color: var(--text); }

/* a log: timestamped entries down a hairline */
.log { list-style: none; margin: 0; padding: 0; border-left: var(--rule); }
.log > li { position: relative; padding: 0 0 2rem 1.75rem; }
.log > li:last-child { padding-bottom: 0; }
.log > li::before { content: ""; position: absolute; left: calc(-0.3rem - 1px); top: 0.45rem; width: 0.6rem; height: 0.6rem; background: var(--bg); border: 2px solid var(--muted); }
.log > li.is-key::before { background: var(--them); border-color: var(--them); }
.log > li.is-out::before { background: var(--us); border-color: var(--us); }
.log > li.is-out time { color: var(--us); }
.log time { display: block; margin-bottom: 0.25rem; font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.04em; color: var(--accent); font-variant-numeric: tabular-nums; }
.log h3 { font-size: 1.1rem; margin-bottom: 0.35rem; }
.log p { color: var(--muted); max-width: 40rem; }

/* data tables */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.data-table th, .data-table td { padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.data-table th { font-family: var(--font-mono); font-size: 0.7rem; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.data-table td.num, .data-table th.num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; }

/* forms */
.field { display: grid; gap: 0.35rem; font-size: 0.9rem; color: var(--muted); }
.field input, .field textarea, .field select, .inline-field select, .inline-field input {
  font: inherit; font-size: 1rem; color: var(--text); background: var(--deep); border: 2px solid var(--border-strong);
  padding: 0.55rem 0.7rem;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--text); outline: none; }
.field textarea { min-height: 7rem; resize: vertical; line-height: 1.55; }
.inline-field { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; color: var(--muted); }
.note { font-size: 0.85rem; color: var(--muted); }

/* ---------- page anatomy: heroes and splits ---------- */
/* Every phase 2 page opens with a .hero (a .space one for story pages), then .section blocks. */
.hero { padding-block: clamp(3rem, 8vw, 5.5rem) clamp(2.5rem, 6vw, 4rem); border-bottom: var(--rule); }
.hero h1 { font-size: var(--step-4); font-weight: 700; line-height: 1.02; letter-spacing: 0; margin-bottom: 0.45em; }
.hero h1:lang(zh) { font-weight: 800; line-height: 1.2; letter-spacing: 0.02em; }
.hero h1 em, .hero h1 .num { font-style: normal; color: var(--accent); }
.hero-xl h1 { font-size: var(--step-5); }
.hero .lede { max-width: 38rem; margin: 0 0 1rem; color: var(--muted); font-size: clamp(1.05rem, 1rem + 0.4vw, var(--step-1)); }
.hero .scope canvas { height: clamp(13rem, 30vw, 19rem); }
.hero .readouts { margin-top: clamp(2rem, 5vw, 3.5rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1.75rem 0 0; }

/* two columns that stack on narrow screens; set --split to change the ratio */
.split, .hero-grid { display: grid; gap: clamp(1.5rem, 4vw, 3rem); grid-template-columns: var(--split, minmax(0, 1fr) minmax(0, 1fr)); align-items: start; }
.hero-grid { --split: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 3.5rem); align-items: center; }
.split-center { align-items: center; }
@media (max-width: 56rem) { .split, .hero-grid { grid-template-columns: minmax(0, 1fr); } }

.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.muted { color: var(--muted); }

/* ---------- small parts ---------- */
.btn-sm { min-height: 2.1rem; padding: 0.3rem 0.85rem; font-size: var(--step--1); }

/* a short status word next to a title: soon, live, estimate */
.badge {
  display: inline-block; padding: 0 0.5rem; border: 1px solid var(--border-strong);
  font-family: var(--font-mono); font-size: 0.65rem; font-weight: 500; line-height: 1.7; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); vertical-align: middle; white-space: nowrap;
}
.badge-signal { border-color: var(--them); background: var(--them); color: var(--them-ink); }
.badge-beam, .badge-us { border-color: var(--us); background: var(--us); color: var(--us-ink); }

/* tabs: a segmented control. Use role="tab" and aria-selected; the page shows and hides the panels. */
.tabs { display: inline-flex; flex-wrap: wrap; gap: 0; padding: 0; background: transparent; border: 2px solid var(--text); }
.tabs > button, .tabs > a {
  font: inherit; font-size: 0.92rem; font-weight: 600; color: var(--muted); background: none; border: 0; text-decoration: none;
  padding: 0.4rem 0.9rem; cursor: pointer; transition: color var(--dur) steps(2), background var(--dur) steps(2);
}
.tabs > :hover { color: var(--text); }
.tabs > [aria-selected="true"], .tabs > [aria-current="page"] { color: var(--bg); background: var(--text); }

/* form groups: a min–max pair and a list of checkboxes */
.field-pair, .field-checks { margin: 0; padding: 0; border: 0; min-width: 0; }
.field-pair legend, .field-checks legend { padding: 0; margin-bottom: 0.35rem; font-size: 0.9rem; color: var(--muted); }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; }
.field-pair input {
  width: 100%; min-width: 0; font: inherit; font-size: 0.92rem; color: var(--text); background: var(--deep);
  border: 2px solid var(--border-strong); padding: 0.4rem 0.6rem;
}
.field-checks label { display: flex; gap: 0.45rem; align-items: center; font-size: 0.92rem; line-height: 1.6; }
input[type="checkbox"], input[type="radio"], input[type="range"] { accent-color: var(--accent); }

/* ---------- data: legends and tooltips for any chart ---------- */
.legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; list-style: none; margin: 0.75rem 0 0.25rem; padding: 0; font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); }
.legend li { display: inline-flex; align-items: center; gap: 0.4rem; }
.legend .ramp { gap: 0.15rem; }
.legend .ramp > span:not(.sw) { margin-inline: 0.3rem; }
.sw { display: inline-block; flex: none; width: 0.75rem; height: 0.75rem; }
.sw-bar, .legend .ramp .sw { width: 1.1rem; height: 0.6rem; border-radius: 2px; }
.sw-band { width: 1.1rem; height: 0.6rem; border-radius: 2px; background: var(--accent-soft); outline: 1px solid var(--accent); }
.sw-ring { border: 2px solid var(--text); background: var(--bg); }
.sw-c1 { background: var(--c1); } .sw-c2 { background: var(--c2); } .sw-c3 { background: var(--c3); } .sw-c4 { background: var(--c4); }
.sw-signal { background: var(--signal); } .sw-dim { background: var(--plot-dim); }

.tooltip {
  position: absolute; left: 0; top: 0; pointer-events: none; z-index: 2;
  display: grid; gap: 0.1rem; max-width: 18rem; padding: 0.5rem 0.7rem;
  background: var(--deep); color: var(--text); border: 2px solid var(--text);
  box-shadow: var(--shadow); font-family: var(--font-mono); font-size: 0.75rem; line-height: 1.45;
}
.tooltip[hidden] { display: none; }
.tooltip strong { font-family: var(--font); font-size: 0.88rem; }
.tooltip span { color: var(--muted); }

/* ---------- tools: a full-width app with a side panel ---------- */
/* <main class="app-shell"><aside class="app-side">filters</aside><section class="app-main">…</section>
   <aside class="app-detail" hidden>details</aside></main>. The detail column appears when it is shown. */
.wrap-full { width: auto; max-width: none; margin-inline: 0; padding-inline: 1rem; }
.app-shell { display: grid; gap: 1.25rem; align-items: start; grid-template-columns: 16.5rem minmax(0, 1fr); padding: 1.25rem 1rem 3rem; }
.app-shell:has(> .app-detail:not([hidden])) { grid-template-columns: 16.5rem minmax(0, 1fr) 22rem; }
.app-side { position: sticky; top: 5rem; max-height: calc(100vh - 6rem); overflow: auto; padding-right: 0.25rem; }
.app-detail {
  position: sticky; top: 5rem; max-height: calc(100vh - 6rem); overflow: auto;
  padding: 1.25rem; background: var(--surface); border: 2px solid var(--text); box-shadow: var(--shadow);
}
@media (max-width: 75rem) {
  .app-shell:has(> .app-detail:not([hidden])) { grid-template-columns: 16.5rem minmax(0, 1fr); }
  .app-detail { grid-column: 2; position: static; max-height: none; }
}
@media (max-width: 52rem) {
  .app-shell, .app-shell:has(> .app-detail:not([hidden])) { grid-template-columns: minmax(0, 1fr); }
  .app-detail { grid-column: 1; }
  .app-side { position: static; max-height: none; }
}

/* ---------- conversation: the signature of phase 2 ---------- */
/* An exchange across light years. Incoming messages (theirs) sit left in cyan,
   outgoing (ours) sit right in yellow; the dashed spine is the distance between.
   <ol class="exchange">
     <li class="msg msg-in"><p class="msg-meta"><span>Ross 128 b → Sol</span><time>sent 2208 · heard 2219</time></p><p>…</p></li>
     <li class="msg msg-out"><p class="msg-meta"><span>Sol → Ross 128 b</span><time>sent 2219 · arrives 2230</time></p><p>…</p></li>
   </ol> */
.exchange { position: relative; display: grid; gap: 1.25rem; margin: 0; padding: 0; list-style: none; }
.exchange::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; border-left: var(--rule); }
.msg { position: relative; width: min(100%, calc(50% - 1.5rem)); padding: 1rem 1.2rem; background: var(--surface); border: 2px solid var(--border-strong); }
.msg > :last-child { margin-bottom: 0; }
.msg-in { justify-self: start; border-color: var(--them); box-shadow: 6px 6px 0 var(--them-soft); }
.msg-out { justify-self: end; border-color: var(--us); box-shadow: -6px 6px 0 var(--us-soft); }
.msg::after { content: ""; position: absolute; top: 1.25rem; width: 0.75rem; height: 0.75rem; }
.msg-in::after { right: calc(-1.5rem - 0.375rem - 2px); background: var(--them); }
.msg-out::after { left: calc(-1.5rem - 0.375rem - 2px); background: var(--us); }
.msg-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.2rem 1rem; margin: 0 0 0.5rem; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.04em; color: var(--muted); }
.msg-in .msg-meta span { color: var(--them); }
.msg-out .msg-meta span { color: var(--us); }
.msg-waiting { border-style: dashed; background: transparent; box-shadow: none; }
@media (max-width: 40rem) {
  .exchange::before { left: 0.3rem; }
  .msg { width: auto; margin-left: 1.5rem; }
  .msg-in::after, .msg-out::after { left: -1.5rem; right: auto; }
}

/* a message in transit: a dashed path from sender to receiver, the packet at --progress (0–1).
   <div class="transit transit-out" style="--progress: 0.3"><span>Sol</span><span>Ross 128 b</span></div> */
.transit { --voice: var(--them); --voice-soft: var(--them-soft); position: relative; display: flex; justify-content: space-between; gap: 1rem; padding-top: 1.1rem; font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); }
.transit-out { --voice: var(--us); --voice-soft: var(--us-soft); }
.transit::before { content: ""; position: absolute; left: 0; right: 0; top: 0.35rem; border-top: var(--rule); }
.transit::after {
  content: ""; position: absolute; top: calc(0.35rem - 1px); left: 0; height: 2px; width: calc(var(--progress, 0) * 100%); min-width: 2px;
  background: repeating-linear-gradient(90deg, var(--voice) 0 4px, transparent 4px 8px);
}
.transit > :first-child::before, .transit > :last-child::before { content: ""; position: absolute; top: 0.05rem; width: 0.6rem; height: 0.6rem; background: var(--surface-2); border: 2px solid var(--border-strong); }
.transit > :first-child::before { left: 0; }
.transit > :last-child::before { right: 0; }
.transit > :first-child::before { background: var(--voice); border-color: var(--voice); }
.transit-packet { position: absolute; top: calc(0.35rem - 0.375rem); left: calc(var(--progress, 0) * 100%); width: 0.75rem; height: 0.75rem; margin-left: -0.375rem; background: var(--voice); animation: pulse 1.6s steps(1) infinite; }

/* ---------- inner pages ---------- */
.page-hero { padding-block: clamp(3.5rem, 9vw, 6.5rem) clamp(2.5rem, 6vw, 4rem); border-bottom: var(--rule); }
.page-hero h1 { font-size: var(--step-3); font-weight: 700; letter-spacing: 0; line-height: 1; margin-bottom: 0.4em; }
.page-hero h1:lang(zh) { font-weight: 800; letter-spacing: 0.02em; line-height: 1.2; }
.page-hero .lede { max-width: 44rem; margin: 0 0 1rem; color: var(--muted); font-size: clamp(1.05rem, 1rem + 0.4vw, 1.22rem); }
.page-hero .chips { margin: 1rem 0 0; }

.prose { max-width: 44rem; }
.prose > * { margin-inline: 0; }
.prose h2 { margin-top: 2em; font-size: 1.5rem; }
.prose h3 { margin-top: 1.6em; font-size: 1.15rem; }
.prose-wide { max-width: 66rem; }
.prose-wide > p, .prose-wide > h2, .prose-wide > h3, .prose-wide > ul, .prose-wide > ol { max-width: 44rem; margin-inline: auto; }
.wrap.prose { margin-inline: auto; }
blockquote { margin: 1.5rem 0; padding: 0.25rem 0 0.25rem 1.25rem; border-left: 4px solid var(--accent); color: var(--text); font-size: 1.1rem; }
:lang(zh) { line-height: 1.85; }
:lang(zh) .tile p, :lang(zh) .card p, :lang(zh) .log p { line-height: 1.75; }

/* ---------- footer ---------- */
.site-footer { padding-block: 3.5rem 1.5rem; background: var(--deep); border-top: 2px solid var(--text); color: var(--muted); font-size: 0.93rem; }
.footer-brand { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; padding-bottom: 2rem; margin-bottom: 2rem; border-bottom: 1px solid var(--border); }
.footer-brand .kicker { margin: 0; }
.footer-grid { display: grid; gap: 2rem 3rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.footer-col h2 { margin-bottom: 0.8rem; font-family: var(--font-mono); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text); }
.footer-col ul { margin: 0; padding: 0; list-style: none; }
.footer-col li { margin-bottom: 0.35rem; }
.footer-col a { color: var(--muted); text-decoration: none; }
.footer-col a:hover { color: var(--link); text-decoration: underline; }
.footer-legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; margin: 2.5rem 0 0; padding-top: 1.25rem; border-top: 1px solid var(--border); font-family: var(--font-mono); font-size: 0.75rem; }
.footer-legal a { color: var(--muted); text-decoration: none; }
.footer-legal a:hover { color: var(--link); }

/* ---------- motion and print ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media print {
  .site-header, .site-footer, .skip-link { display: none; }
  body, .space { background: #fff; color: #000; }
  .space::before, .space::after, .message-field { display: none; }
}
