/* ==========================================================================
   The Merian Survey website
   Plain CSS, no build step. Colours and fonts are set once in :root below.
   The two accent colours stand for the two Merian filters:
   N540 (green, 540 nm) and N708 (deep red, 708 nm).
   Links are blue (--link), close to the blue of the logo frame.
   ========================================================================== */

:root {
  --paper: #ffffff;            /* page background */
  --paper-2: #f5f5f3;          /* tinted sections */
  --ink: #1b1a18;
  --ink-2: #47443f;
  --ink-3: #75716a;
  --rule: #e2dfd9;
  --n540: #4c7a37;
  --n708: #a8332c;
  --n540-soft: rgba(76, 122, 55, 0.17);
  --n708-soft: rgba(168, 51, 44, 0.15);
  --frame: #3b82b8;            /* the blue of the logo frame */
  --link: #2f72a8;             /* link underlines and hover, a little darker than --frame so text stays readable */
  --fp-color: #c4d9ea;         /* footprint maps, both filters (frame blue on paper) */
  --fp-rest: #ebe8e3;          /* footprint maps, rest of the survey */
  --ring-0: #86b4dc;           /* Filters page: distance from the filter center, 0 to 280 mm */
  --ring-1: #5e98c9;
  --ring-2: #3d7bb3;
  --ring-3: #285f93;
  --ring-4: #17426e;
  --sky: #0d111d;              /* dark bands */
  --sky-2: #171c2f;
  --on-sky: #f1ebdd;
  --on-sky-2: #b7b4c0;

  --serif: "EB Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --wrap: 1120px;
  --gutter: clamp(18px, 4vw, 40px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #11141c;
    --paper-2: #191d29;
    --ink: #ece6d8;
    --ink-2: #c4beb1;
    --ink-3: #908a7e;
    --rule: #2d3242;
    --n540: #8fc46c;
    --n708: #e3695e;
    --n540-soft: rgba(143, 196, 108, 0.2);
    --n708-soft: rgba(227, 105, 94, 0.2);
    --frame: #5aa2d6;
    --link: #5aa2d6;
    --fp-color: #2e4d66;
    --fp-rest: #232733;
    --ring-0: #3d6a93;
    --ring-1: #4f86b8;
    --ring-2: #6aa2d2;
    --ring-3: #8dbbe3;
    --ring-4: #b8d6f0;
    --sky: #090c15;
    --sky-2: #131829;
  }
}

/* The logo is drawn in black, so give it a faint light edge on dark backgrounds. */
@media (prefers-color-scheme: dark) {
  .brand img { filter: drop-shadow(0 0 1px rgba(236, 230, 216, 0.75)); }
}

/* ---------- Base ---------- */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; height: auto; display: block; }

a {
  color: inherit;
  text-decoration-color: var(--link);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}
a:hover { color: var(--link); }

:focus-visible { outline: 2px solid var(--frame); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.08;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.4rem, 5.6vw, 4.3rem); letter-spacing: -0.015em; font-weight: 500; }
h2 { font-size: clamp(1.9rem, 3.5vw, 2.7rem); font-weight: 500; letter-spacing: -0.01em; }
h3 { font-size: 1.5rem; line-height: 1.18; font-weight: 500; }

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

sup, sub { font-size: 0.7em; line-height: 0; }

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

.section { padding-block: clamp(56px, 8vw, 104px); }
section[id], [id="filter-figure"] { scroll-margin-top: 72px; }   /* keep anchored sections clear of the sticky header */
.section + .section { border-top: 1px solid var(--rule); }
.section.tint { background: var(--paper-2); }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 1.1rem;
}

.lede { font-size: 1.22rem; line-height: 1.55; color: var(--ink-2); max-width: 44rem; }

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: var(--paper); padding: 10px 16px; z-index: 100;
}
.skip:focus { left: 8px; top: 8px; }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.site-header .bar { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 68px; }

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { width: 35px; height: 44px; }
.brand span { font-family: var(--serif); font-size: 1.45rem; font-weight: 500; letter-spacing: 0.01em; }
.brand em { font-weight: 500; color: var(--ink-2); }
.brand:hover { color: inherit; }

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: clamp(14px, 2.4vw, 30px); }
.site-nav a {
  font-size: 0.98rem; text-decoration: none; padding: 6px 0; white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: inherit; border-bottom-color: var(--rule); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--link); }

.nav-toggle {
  display: none;
  font: inherit; font-size: 0.95rem; color: inherit;
  background: none; border: 1px solid var(--rule); border-radius: 3px; padding: 7px 14px; cursor: pointer;
}

/* The full menu needs about 760 px with the web fonts and about 800 px with system fonts
   (when Google Fonts is blocked), so switch to the Menu button below 820 px. */
@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--paper); border-bottom: 1px solid var(--rule); }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0; padding: 6px var(--gutter) 14px; }
  .site-nav a { display: block; padding: 12px 0; border-bottom: 1px solid var(--rule); }
  .site-nav li:last-child a { border-bottom: 0; }
  .site-nav a[aria-current="page"] { border-bottom-color: var(--rule); color: var(--link); }
}

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

.hero {
  position: relative;
  background:
    radial-gradient(ellipse 60% 70% at 78% 45%, rgba(72, 96, 170, 0.28), transparent 70%),
    url("../img/stars.svg") 0 0 / 800px 800px,
    linear-gradient(180deg, var(--sky), var(--sky-2));
  color: var(--on-sky);
  overflow: hidden;
}
.hero .wrap {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  align-items: center; gap: clamp(24px, 5vw, 72px);
  padding-block: clamp(64px, 10vw, 128px);
}
.hero .eyebrow { color: var(--on-sky-2); }
.hero h1 { color: var(--on-sky); }
.hero h1 em { font-style: italic; font-weight: 500; }
.hero .lede { color: #d5d0c6; }
.hero-art { justify-self: center; width: min(100%, 340px); }
.hero-art img { width: 100%; filter: drop-shadow(0 0 60px rgba(120, 150, 230, 0.35)); }

.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 2rem; }
.btn {
  display: inline-block; padding: 12px 22px; border-radius: 2px;
  font-size: 0.98rem; font-weight: 600; text-decoration: none;
  border: 1px solid var(--ink); background: var(--ink); color: var(--paper);
}
.btn:hover { background: var(--n708); border-color: var(--n708); color: #fff; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.hero .btn { background: var(--on-sky); border-color: var(--on-sky); color: var(--sky); }
.hero .btn:hover { background: #fff; border-color: #fff; color: var(--sky); }
.hero .btn.ghost { background: transparent; color: var(--on-sky); border-color: rgba(241, 235, 221, 0.5); }
.hero .btn.ghost:hover { background: rgba(241, 235, 221, 0.12); border-color: var(--on-sky); color: var(--on-sky); }

@media (max-width: 760px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-art { order: -1; width: 170px; justify-self: start; }
}

/* ---------- Key numbers ---------- */

.stats { display: grid; grid-template-columns: repeat(5, 1fr); margin: 0; border-bottom: 1px solid var(--rule); }
.stats > div { padding: 30px 22px 28px; border-left: 1px solid var(--rule); }
.stats > div:first-child { border-left: 0; padding-left: 0; }
.stats dt { font-family: var(--serif); font-weight: 600; font-size: clamp(1.7rem, 2.6vw, 2.3rem); line-height: 1.1; white-space: nowrap; }
.stats dd { margin: 8px 0 0; font-size: 0.93rem; line-height: 1.45; color: var(--ink-2); }

@media (max-width: 980px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats > div { border-left: 0; padding-left: 0; border-top: 1px solid var(--rule); }
  .stats > div:nth-child(-n+2) { border-top: 0; }
  .stats > div:nth-child(even) { padding-left: 22px; border-left: 1px solid var(--rule); }
}

/* ---------- Two-column text + figure ---------- */

.split { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }

/* ---------- Plates (figures) ---------- */
/* The double frame echoes the frame of the Merian logo. */

.plate { margin: 6px; padding: clamp(14px, 2.2vw, 26px); border: 1px solid var(--rule); outline: 1px solid var(--rule); outline-offset: 5px; background: var(--paper); }
.plate figcaption { margin-top: 16px; font-size: 0.93rem; line-height: 1.5; color: var(--ink-2); }
.plate-no { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); margin-right: 0.7em; }

.band-dark { background: var(--sky); color: var(--on-sky); }
.band-dark .plate { background: transparent; border-color: rgba(241, 235, 221, 0.25); outline-color: rgba(241, 235, 221, 0.25); }
.band-dark .plate figcaption { color: var(--on-sky-2); }
.band-dark .plate-no { color: var(--on-sky-2); }
.band-dark .eyebrow { color: var(--on-sky-2); }

/* ---------- Interactive filter figure ---------- */

.fig-wide { margin-top: 2.4rem; }
.ff svg { width: 100%; height: auto; overflow: visible; }
.ff text { font-family: var(--mono); font-size: 12.5px; fill: var(--ink-2); }
.ff .axis { stroke: var(--ink-3); stroke-width: 1; }
.ff .grid { stroke: var(--rule); stroke-width: 1; stroke-dasharray: 3 4; }
.ff .n540 { fill: var(--n540-soft); stroke: var(--n540); stroke-width: 1.6; }
.ff .n708 { fill: var(--n708-soft); stroke: var(--n708); stroke-width: 1.6; }
.ff .t540 { fill: var(--n540); font-weight: 500; font-size: 15px; }
.ff .t708 { fill: var(--n708); font-weight: 500; font-size: 15px; }
.ff .spec { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; }
.ff .line-label { fill: var(--ink); font-size: 13px; }
.ff .line-label.in { font-weight: 500; }
.ff .hsc { stroke: var(--ink-3); stroke-width: 1; }
.ff .hsc-curve { fill: none; stroke: var(--ink-3); stroke-width: 1; opacity: 0.5; }
.ff .hsc-label { fill: var(--ink-3); font-size: 12px; }
.ff .break-label { fill: var(--ink-3); font-size: 12px; font-style: italic; font-family: var(--sans); }

/* Mock-photometry strip */
.ff-sub-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 18px; margin-top: 10px; }
.ff-sub-head p { margin: 0; font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.ff-sub-head .nt { text-transform: none; letter-spacing: 0.04em; }
.ff-colors { display: flex; flex-wrap: wrap; gap: 8px; }
.ff-colors .color { font-family: var(--mono); font-size: 0.8rem; padding: 3px 10px; border: 1px solid var(--rule); border-radius: 999px; color: var(--ink-2); white-space: nowrap; }
.ff-colors .color b { font-weight: 500; }
.ff-colors .color.on-540 { border-color: var(--n540); color: var(--n540); background: var(--n540-soft); }
.ff-colors .color.on-708 { border-color: var(--n708); color: var(--n708); background: var(--n708-soft); }
.ff .ph-zero { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 5 4; }
.ff .ph-note { fill: var(--ink-3); font-size: 11px; }
.ff .ph-bar { stroke-width: 2; }
.ff .ph-band.broad .ph-bar { stroke: var(--ink-3); }
.ff .ph-band.broad .ph-mark { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; }
.ff .ph-band.m540 .ph-bar, .ff .ph-band.m540 .ph-mark { stroke: var(--n540); fill: var(--n540); }
.ff .ph-band.m708 .ph-bar, .ff .ph-band.m708 .ph-mark { stroke: var(--n708); fill: var(--n708); }
.ff .ph-label { font-size: 12px; fill: var(--ink-2); }
.ff .ph-band.m540 .ph-label { fill: var(--n540); }
.ff .ph-band.m708 .ph-label { fill: var(--n708); }
.ff .ph-band.out .ph-mark { opacity: 0.5; }

.ff-controls { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; margin-top: 10px; }
.ff-controls label { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.ff-controls output { font-family: var(--mono); font-size: 1rem; min-width: 5.6em; text-align: right; }
.ff-controls input[type="range"] { width: 100%; accent-color: var(--n708); }

.ff-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 14px; font-size: 0.93rem; }
.chip { font-family: var(--mono); font-size: 0.78rem; padding: 4px 10px; border: 1px solid var(--rule); border-radius: 999px; color: var(--ink-3); white-space: nowrap; }
.chip.on-540 { border-color: var(--n540); color: var(--n540); background: var(--n540-soft); }
.chip.on-708 { border-color: var(--n708); color: var(--n708); background: var(--n708-soft); }

/* Preset buttons that jump the slider to a redshift window */
.ff-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.ff-presets button {
  font: inherit; font-family: var(--mono); font-size: 0.78rem; line-height: 1.3;
  padding: 5px 11px; border-radius: 999px; border: 1px solid var(--rule);
  background: var(--paper); color: var(--ink-2); cursor: pointer;
}
.ff-presets button:hover { border-color: var(--ink-3); color: var(--ink); }
.ff-presets button[aria-pressed="true"] { border-color: var(--ink); color: var(--ink); background: var(--paper-2); }

/* Redshift-window chart under the spectrum */
.ff-zw-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 18px; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--rule); }
.ff-zw-head p { margin: 0; font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.ff-key { font-family: var(--mono); font-size: 0.78rem; color: var(--ink-2); display: flex; gap: 14px; }
.ff-key i { display: inline-block; width: 18px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: 1px; }
.ff-key .k540 { background: var(--n540); }
.ff-key .k708 { background: var(--n708); }
.ff .zw-svg { cursor: crosshair; margin-top: 6px; }
.ff .zw-track { stroke: var(--rule); stroke-width: 1; }
.ff .zw540 { fill: var(--n540); }
.ff .zw708 { fill: var(--n708); }
.ff .zw-label { font-size: 13px; fill: var(--ink-2); }
.ff .zw-label.in { fill: var(--ink); font-weight: 500; }
.ff .zcursor { stroke: var(--ink); stroke-width: 1.5; }
.ff .zcursor-label { font-size: 12px; fill: var(--ink); }

/* ---------- Footprint maps (Data page) ---------- */

.fp-map svg { display: block; width: 100%; height: auto; overflow: visible; }
.fp-map text { font-family: var(--mono); font-size: 12px; fill: var(--ink-3); }
.fp-map .strip-label { font-size: 11px; letter-spacing: 0.12em; fill: var(--ink-3); }
.fp-map .bg { fill: var(--paper); }
.fp-map .grid { stroke: var(--rule); stroke-width: 1; stroke-dasharray: 3 4; }
.fp-map .frame { fill: none; stroke: var(--ink-3); stroke-width: 1; }
.fp-map .rest, .fp-map .color, .fp-map .depth { fill-rule: evenodd; stroke: none; }
.fp-map .rest { fill: var(--fp-rest); }
.fp-map .color { fill: var(--fp-color); }
.fp-map .depth { fill: var(--frame); }
.fp-legend { display: flex; flex-wrap: wrap; gap: 8px 22px; list-style: none; margin: 14px 0 0; padding: 0; font-family: var(--mono); font-size: 0.78rem; color: var(--ink-2); }
.fp-legend li { display: flex; align-items: center; }
.fp-legend .sw { flex: none; width: 18px; height: 11px; margin-right: 8px; border: 1px solid var(--rule); }
.fp-legend .sw.color { background: var(--fp-color); }
.fp-legend .sw.depth { background: var(--frame); border-color: var(--frame); }
.fp-legend .sw.rest { background: var(--fp-rest); }

/* ---------- Filters page ---------- */

.fc svg, .fs svg { display: block; width: 100%; height: auto; overflow: visible; }
.fc text, .fs text { font-family: var(--mono); font-size: 12px; fill: var(--ink-3); }
.fc .grid, .fs .grid { stroke: var(--rule); stroke-width: 1; stroke-dasharray: 3 4; }
.fc .axis, .fs .axis { stroke: var(--ink-3); stroke-width: 1; }
.fc .hsc-area { fill: var(--ink-3); fill-opacity: 0.07; }
.fc .hsc-line { fill: none; stroke: var(--ink-3); stroke-width: 1.2; stroke-linejoin: round; }
.fc .hsc-label { font-size: 13px; fill: var(--ink-2); font-style: italic; }
.fc .m540-area { fill: var(--n540-soft); }
.fc .m708-area { fill: var(--n708-soft); }
.fc .m540-line { fill: none; stroke: var(--n540); stroke-width: 1.8; stroke-linejoin: round; }
.fc .m708-line { fill: none; stroke: var(--n708); stroke-width: 1.8; stroke-linejoin: round; }
.fc .t540, .fs .t540 { fill: var(--n540); font-weight: 500; font-size: 14px; }
.fc .t708, .fs .t708 { fill: var(--n708); font-weight: 500; font-size: 14px; }
.fs .curve { fill: none; stroke-width: 1.6; stroke-linejoin: round; }
.fs .cline { stroke-width: 1.2; stroke-dasharray: 6 3 2 3; }
.fs .curve.r0, .fs .cline.r0 { stroke: var(--ring-0); }
.fs .curve.r1 { stroke: var(--ring-1); }
.fs .curve.r2 { stroke: var(--ring-2); }
.fs .curve.r3 { stroke: var(--ring-3); }
.fs .curve.r4, .fs .cline.r4 { stroke: var(--ring-4); }
.fs .shift { stroke: var(--ink-2); stroke-width: 1.2; }
.fs .shift-head { fill: var(--ink-2); }
.fs .shift-label { font-size: 11.5px; fill: var(--ink-2); }
.fc .xh, .fs .xh { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 2 3; }
.fc .rbox, .fs .rbox { fill: var(--paper); stroke: var(--rule); }
.fc .readout text, .fs .readout text { fill: var(--ink-2); white-space: pre; }
.fc .hit, .fs .hit { cursor: crosshair; touch-action: pan-y; }
.fs-legend { display: flex; align-items: center; gap: 14px 26px; margin-top: 16px; }
.fs-legend ul { display: flex; flex-wrap: wrap; gap: 8px 22px; list-style: none; margin: 0; padding: 0; font-family: var(--mono); font-size: 0.78rem; color: var(--ink-2); }
.fs-legend li { display: flex; align-items: center; }
.fs-legend .sw { flex: none; width: 22px; height: 3px; border-radius: 2px; margin-right: 8px; }
.fs-legend .sw.r0 { background: var(--ring-0); }
.fs-legend .sw.r1 { background: var(--ring-1); }
.fs-legend .sw.r2 { background: var(--ring-2); }
.fs-legend .sw.r3 { background: var(--ring-3); }
.fs-legend .sw.r4 { background: var(--ring-4); }
.fs .fs-sketch { flex: none; width: 92px; height: 92px; }
.fs-sketch .edge { fill: none; stroke: var(--ink-3); stroke-width: 1.2; }
.fs-sketch .ring { fill: none; stroke: var(--rule); stroke-width: 1; stroke-dasharray: 2 3; }
.fs-sketch .ray { stroke: var(--ink-3); stroke-width: 0.8; }
.fs-sketch .dot.r0 { fill: var(--ring-0); }
.fs-sketch .dot.r1 { fill: var(--ring-1); }
.fs-sketch .dot.r2 { fill: var(--ring-2); }
.fs-sketch .dot.r3 { fill: var(--ring-3); }
.fs-sketch .dot.r4 { fill: var(--ring-4); }
@media (max-width: 600px) { .fs-legend { align-items: flex-start; } .fs .fs-sketch { width: 72px; height: 72px; } }

/* Depth figure on the Data page (uses the .fc curve styles) */
.dp .bar { stroke-width: 6; stroke-linecap: round; }
.dp .bar.hsc { stroke: var(--ink-3); }
.dp .bar.m540 { stroke: var(--n540); }
.dp .bar.m708 { stroke: var(--n708); }
.dp .val { font-size: 12px; fill: var(--ink-2); }
.dp .val .t540, .dp .val .t708 { font-size: inherit; }
.dp .val .hsc-name { font-style: italic; }

.downloads { list-style: none; margin: 1.4rem 0; padding: 0; }
.downloads li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; padding: 11px 0; border-top: 1px solid var(--rule); }
.downloads li:last-child { border-bottom: 1px solid var(--rule); }
.downloads a { font-weight: 600; }
.downloads span { font-family: var(--mono); font-size: 0.78rem; color: var(--ink-3); }

/* ---------- Cards ---------- */

.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(22px, 3vw, 36px); margin-top: 2.6rem; }
.card { border-top: 2px solid var(--ink); padding-top: 18px; display: flex; flex-direction: column; }
.card .num { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.14em; color: var(--ink-3); margin-bottom: 14px; }
.card p { color: var(--ink-2); }
.card .refs { margin-top: auto; padding-top: 6px; font-size: 0.92rem; color: var(--ink-3); }
.card .more { font-weight: 600; font-size: 0.98rem; }
.more-science { margin: 2.4rem 0 0; font-family: var(--serif); font-size: 1.45rem; font-style: italic; color: var(--ink-2); }
.more-science a { font-family: var(--sans); font-style: normal; font-size: 0.98rem; font-weight: 600; margin-left: 0.4em; }
@media (max-width: 860px) { .cards { grid-template-columns: 1fr; } }

/* ---------- Galaxy gallery ---------- */

.gallery-figure { margin: 2rem 0 0; }
.gallery { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; }
.gallery li { position: relative; aspect-ratio: 1 / 1; background: #000; overflow: hidden; }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.gallery .m, .gallery .z {
  position: absolute; left: 6px; margin: 0; pointer-events: none;
  font-family: var(--sans); font-size: clamp(9px, 0.95vw, 12px); line-height: 1.1; color: #fff;
  text-shadow: 0 0 3px #000, 0 0 2px #000;
}
.gallery .m { top: 5px; }
.gallery .z { bottom: 5px; }
.gallery sub { font-size: 0.75em; line-height: 0; }
.gallery-cap { margin-top: 16px; font-size: 0.93rem; line-height: 1.5; color: var(--ink-2); max-width: 52rem; }
/* The gallery page shows the 180 px cutouts at most at their own size. */
/* Column counts divide the 30 cutouts evenly. */
.gallery.big { grid-template-columns: repeat(6, minmax(0, 180px)); justify-content: center; gap: 6px; }
.gallery.big .m, .gallery.big .z { font-size: 12px; left: 7px; }
@media (max-width: 1000px) { .gallery.big { grid-template-columns: repeat(5, minmax(0, 180px)); } }
@media (max-width: 700px) { .gallery.big { grid-template-columns: repeat(3, minmax(0, 180px)); } }
@media (max-width: 420px) { .gallery.big { grid-template-columns: repeat(2, minmax(0, 180px)); } }
@media (max-width: 1000px) { .gallery { grid-template-columns: repeat(6, minmax(0, 1fr)); } .gallery .m, .gallery .z { font-size: 11px; } }
@media (max-width: 600px) {
  .gallery { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; }
  .gallery .m, .gallery .z { font-size: 8.5px; left: 3px; }
  .gallery .m { top: 3px; }
  .gallery .z { bottom: 3px; }
}

.head-row { display: flex; align-items: end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.head-row h2 { margin-bottom: 0; }
.head-row a { font-weight: 600; font-size: 0.98rem; }

/* ---------- Inner page header ---------- */

.page-head { padding-block: clamp(48px, 7vw, 92px) clamp(36px, 5vw, 60px); border-bottom: 1px solid var(--rule); }
.page-head h1 { font-size: clamp(2.3rem, 4.8vw, 3.7rem); max-width: 20ch; }

/* ---------- Prose blocks on inner pages ---------- */
/* .goal, .questions, .also, .spec tables and .timeline were written for
   science.html and survey.html. Those pages are removed for now (restore them
   with: git checkout 5ef048e -- science.html survey.html), so these rules stay. */

.goal { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: clamp(18px, 4vw, 56px); }
.goal .num { font-family: var(--serif); font-size: 3.4rem; line-height: 1; color: var(--ink-3); font-style: italic; }
.goal .body { max-width: 44rem; }
.goal .refs { font-size: 0.95rem; color: var(--ink-2); margin-top: 1.2em; }
@media (max-width: 700px) { .goal { grid-template-columns: 1fr; gap: 6px; } }

.questions { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 3vw, 40px); }
.questions li { font-family: var(--serif); font-size: 1.45rem; line-height: 1.25; font-style: italic; font-weight: 500; padding-top: 16px; border-top: 1px solid var(--ink); }
@media (max-width: 860px) { .questions { grid-template-columns: 1fr; } }

.also { list-style: none; margin: 1.6rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 clamp(24px, 4vw, 56px); }
.also li { padding: 16px 0; border-top: 1px solid var(--rule); }
.also b { display: block; font-weight: 600; }
.also span { color: var(--ink-2); font-size: 0.98rem; }
@media (max-width: 700px) { .also { grid-template-columns: 1fr; } }

/* ---------- Spec list and tables ---------- */

.spec { margin: 0; display: grid; grid-template-columns: minmax(130px, 0.34fr) 1fr; }
.spec dt, .spec dd { margin: 0; padding: 13px 0; border-top: 1px solid var(--rule); }
.spec dt { font-family: var(--mono); font-size: 0.76rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); padding-top: 17px; padding-right: 16px; }
.spec dt:first-of-type, .spec dt:first-of-type + dd { border-top: 1px solid var(--ink); }

.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 1rem; }
th, td { text-align: left; padding: 13px 18px 13px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-family: var(--mono); font-weight: 400; font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); border-bottom: 1px solid var(--ink); white-space: nowrap; }
td.num, th.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 9px; }
.swatch.s540 { background: var(--n540); }
.swatch.s708 { background: var(--n708); }
td code, p code, li code { font-family: var(--mono); font-size: 0.9em; }

/* ---------- Timeline ---------- */

.timeline { list-style: none; margin: 2.4rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--ink); }
.timeline li { position: relative; padding: 22px 18px 0 0; }
.timeline li::before { content: ""; position: absolute; top: -6px; left: 0; width: 11px; height: 11px; border-radius: 50%; background: var(--paper); border: 2px solid var(--ink); }
.section.tint .timeline li::before { background: var(--paper-2); }
.timeline li.done::before, .section.tint .timeline li.done::before { background: var(--ink); }
.timeline time { display: block; font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.timeline span { font-size: 0.98rem; line-height: 1.45; display: block; }
@media (max-width: 860px) {
  .timeline { grid-template-columns: 1fr; border-top: 0; border-left: 1px solid var(--ink); margin-left: 5px; }
  .timeline li { padding: 0 0 22px 24px; }
  .timeline li::before { top: 4px; left: -6px; }
}

/* ---------- Publications ---------- */

.pubs { list-style: none; margin: 0; padding: 0; }
.pub { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 8px 24px; padding: 26px 0; border-top: 1px solid var(--rule); }
.pubs > .pub:first-child { border-top: 1px solid var(--ink); }
.pub .yr { font-family: var(--mono); font-size: 0.9rem; color: var(--ink-3); padding-top: 6px; }
.pub h3 { font-size: 1.42rem; margin: 0 0 6px; text-wrap: pretty; }
.pub h3 a { text-decoration: none; }
.pub h3 a:hover { text-decoration: underline; text-decoration-color: var(--link); }
.pub .authors { color: var(--ink-2); margin: 0 0 8px; font-size: 0.98rem; }
.pub .meta { font-family: var(--mono); font-size: 0.8rem; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0; }
.pub .tag { color: var(--n540); }
@media (max-width: 600px) { .pub { grid-template-columns: 1fr; } .pub .yr { padding-top: 0; } }

/* ---------- Team ---------- */

.team-group { display: grid; grid-template-columns: minmax(0, 0.28fr) minmax(0, 1fr); gap: 18px clamp(24px, 4vw, 56px); padding: 34px 0; border-top: 1px solid var(--rule); }
.team-group:first-child { border-top: 1px solid var(--ink); }
.team-group h2 { font-size: 1.7rem; margin: 0; }
.people { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 22px 28px; }
.person { display: flex; align-items: center; gap: 16px; }
.avatar { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; flex: none; background: var(--paper-2); }
.avatar.initials {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 1.5rem; color: var(--ink-3); border: 1px solid var(--rule);
}
.who { min-width: 0; }
.who b { display: block; font-weight: 600; }
.who b a { text-decoration: none; }
.who b a:hover { text-decoration: underline; text-decoration-color: var(--link); color: inherit; }
.who .aff { display: block; color: var(--ink-2); font-size: 0.95rem; }
.role {
  display: inline-block; margin: 3px 0 3px; padding: 1px 8px; border: 1px solid currentColor; border-radius: 999px;
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--n708);
}
@media (max-width: 760px) { .team-group { grid-template-columns: 1fr; } }

/* ---------- Publication blocks ---------- */

.block-title { font-size: clamp(1.7rem, 2.8vw, 2.2rem); margin-bottom: 0.3em; }
.block-note { color: var(--ink-2); margin-bottom: 1.8rem; max-width: 44rem; }

/* ---------- Software list ---------- */

.repos { list-style: none; margin: 1.8rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 clamp(24px, 4vw, 56px); }
.repos li { padding: 18px 0; border-top: 1px solid var(--rule); }
.repos a { font-family: var(--mono); font-size: 1rem; font-weight: 500; }
.repos p { margin: 4px 0 0; color: var(--ink-2); font-size: 0.98rem; }
@media (max-width: 700px) { .repos { grid-template-columns: 1fr; } }

.note { border-left: 3px solid var(--n540); background: var(--n540-soft); padding: 16px 20px; margin: 1.6rem 0; max-width: 44rem; }

/* ---------- Namesake ---------- */

.namesake { display: grid; grid-template-columns: minmax(0, 0.36fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 72px); align-items: start; }
.namesake .dates { font-family: var(--serif); font-style: italic; font-size: 1.5rem; color: var(--ink-3); margin: 0; }
.namesake .body { max-width: 42rem; }
@media (max-width: 760px) { .namesake { grid-template-columns: 1fr; gap: 8px; } }

/* ---------- Footer ---------- */

.site-footer { background: var(--sky); color: var(--on-sky-2); font-size: 0.96rem; }
.site-footer a { color: var(--on-sky); text-decoration-color: rgba(241, 235, 221, 0.35); }
.site-footer a:hover { color: #fff; text-decoration-color: #fff; }
.foot-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); padding-block: 56px 36px; }
.foot-brand p { max-width: 36rem; }
.foot-brand { display: flex; gap: 18px; align-items: flex-start; }
.foot-brand strong { display: block; font-family: var(--serif); font-size: 1.5rem; font-weight: 600; color: var(--on-sky); margin-bottom: 6px; line-height: 1.1; }
.site-footer h2 { font-family: var(--mono); font-weight: 400; font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--on-sky-2); margin: 6px 0 12px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 6px; }
.fine { border-top: 1px solid rgba(241, 235, 221, 0.16); padding-block: 20px 28px; margin: 0; font-size: 0.88rem; }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr; } }
