/* Reports from another world: a survey archive's paper by day, an observatory by night. */
:root {
  --paper: #efeadd; --paper-2: #e6dfcd; --ink: #1b1e24; --ink-2: #464a52; --ink-3: #777b83; --rule: #cfc6b0; --grid: rgba(60, 80, 110, 0.07);
  --plate: #0b0e14; --accent: #1f5fb8; --stamp: #a8431c; --open: #1f5fb8; --code-bg: #e2dac6;
  --measure: 40rem;
  --clip-fg: #1b1e24; --clip-dim: #464a52; --clip-frame: #b9ae94; --clip-bar: #e6dfcd; --clip-accent: #1f5fb8; --clip-label: #a8431c;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0e1218; --paper-2: #151a22; --ink: #e3e6ea; --ink-2: #b0b6c0; --ink-3: #828995; --rule: #2a313c; --grid: rgba(140, 180, 230, 0.05);
    --plate: #05070a; --accent: #8db8ff; --stamp: #f09a6b; --open: #8db8ff; --code-bg: #1d232d;
    --clip-fg: #e3e6ea; --clip-dim: #b0b6c0; --clip-frame: #2f3744; --clip-bar: #151a22; --clip-accent: #8db8ff; --clip-label: #f09a6b;
  }
}
:root[data-theme="dark"] {
  --paper: #0e1218; --paper-2: #151a22; --ink: #e3e6ea; --ink-2: #b0b6c0; --ink-3: #828995; --rule: #2a313c; --grid: rgba(140, 180, 230, 0.05);
  --plate: #05070a; --accent: #8db8ff; --stamp: #f09a6b; --open: #8db8ff; --code-bg: #1d232d;
  --clip-fg: #e3e6ea; --clip-dim: #b0b6c0; --clip-frame: #2f3744; --clip-bar: #151a22; --clip-accent: #8db8ff; --clip-label: #f09a6b;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); font: 1.1875rem/1.6 Newsreader, Georgia, serif; font-optical-sizing: auto;
  background-color: var(--paper);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  --clip-caption-font: 0.95rem/1.45 Newsreader, Georgia, serif;
}
a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
code, .mono { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 0.84em; }
code { background: var(--code-bg); padding: 0.05em 0.3em; border-radius: 2px; white-space: nowrap; }
.mono-label, .slip, header.site .dispatch, th, figure.plate::before, .note::before { font-family: 'IBM Plex Mono', ui-monospace, monospace; }

/* Masthead */
header.site { background: var(--paper); border-bottom: 3px double var(--rule); padding: 1.1rem max(16px, calc((100vw - 64rem) / 2)) 0.8rem; }
header.site .top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.3rem 1.5rem; }
header.site .mark { color: var(--ink); text-decoration: none; display: flex; align-items: baseline; gap: 0.75rem; flex-wrap: wrap; }
header.site .mark b { font-weight: 600; font-size: 1.5rem; letter-spacing: 0.01em; }
header.site .mark i { font-style: italic; color: var(--ink-2); font-size: 1.05rem; }
header.site .dispatch { font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
header.site .dispatch b { color: var(--stamp); font-weight: 500; }
header.site nav { display: flex; flex-wrap: wrap; gap: 0.2rem 1.1rem; margin-top: 0.6rem; font-family: 'IBM Plex Mono', monospace; font-size: 0.8rem; }
header.site nav a { color: var(--ink-2); text-decoration: none; }
header.site nav a:hover, header.site nav a[aria-current] { color: var(--ink); text-decoration: underline; }

main { padding: 2.25rem 16px 4rem; counter-reset: section; }
main > * { max-width: var(--measure); margin-left: auto; margin-right: auto; }
main > .wide, main > figure, main > climb-clip, main > .plates, main > table { max-width: 56rem; }

/* The report slip: number, subject, where and when observed, and its status stamp */
.slip { display: flex; flex-wrap: wrap; align-items: center; gap: 0; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); border: 1px solid var(--rule); background: var(--paper-2); }
.slip > span { padding: 0.3rem 0.7rem; border-right: 1px solid var(--rule); }
.slip > span:last-child { border-right: 0; }
.slip .no { color: var(--ink); font-weight: 500; }
.slip .stamp { color: var(--stamp); font-weight: 500; margin-left: auto; border-left: 1px solid var(--rule); }
.slip .stamp.open { color: var(--open); }

h1 { font-size: clamp(2.1rem, 5vw, 3.1rem); line-height: 1.1; font-weight: 600; margin-top: 1.1rem; margin-bottom: 0.6rem; letter-spacing: -0.01em; }
h1 + p.lede, p.lede { font-size: 1.35rem; line-height: 1.45; color: var(--ink-2); }
h2 { font-size: 1.6rem; line-height: 1.2; font-weight: 600; margin-top: 3rem; counter-increment: section; }
h2::before { content: "§" counter(section); font-family: 'IBM Plex Mono', monospace; font-size: 0.8rem; font-weight: 500; color: var(--stamp); display: block; letter-spacing: 0.06em; margin-bottom: 0.2rem; }
h3 { font-size: 1.25rem; margin-top: 2rem; }
p, li { color: var(--ink); }
li { margin: 0.25rem 0; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 3rem auto; }
blockquote { border-left: 3px solid var(--rule); margin-left: 0; padding-left: 1rem; color: var(--ink-2); font-style: italic; }

/* Ledgers */
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; margin: 1.5rem auto; display: block; overflow-x: auto; border-top: 3px double var(--rule); }
td:first-child { white-space: nowrap; }
th, td { text-align: left; padding: 0.4rem 0.8rem 0.4rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-size: 0.72rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
td.num, th.num, td[align="right"], th[align="right"] { text-align: right; font-variant-numeric: tabular-nums; }

/* Plates and recordings */
figure { margin: 2.25rem auto; }
figure.plate { border: 1px solid var(--rule); background: var(--paper-2); padding: 0.6rem 0.6rem 0.7rem; }
figure.plate::before { content: attr(data-plate); display: block; font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--stamp); margin-bottom: 0.45rem; }
figure img { display: block; max-width: 100%; height: auto; image-rendering: pixelated; margin: 0 auto; background: var(--plate); }
figcaption, .caption { font-size: 0.95rem; line-height: 1.45; color: var(--ink-2); margin-top: 0.6rem; }
climb-clip { display: block; margin: 2.25rem auto; --clip-radius: 0; }

.plates { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1.5rem; margin: 2rem auto; }
.card { display: block; text-decoration: none; color: inherit; border: 1px solid var(--rule); background: var(--paper-2); padding: 0.6rem; }
.card img { width: 100%; height: 9rem; object-fit: contain; image-rendering: pixelated; background: var(--plate); }
.card h3 { margin: 0.6rem 0 0.2rem; font-size: 1.15rem; }
.card p { margin: 0; font-size: 0.95rem; color: var(--ink-2); }
.card:hover { border-color: var(--ink-3); }
.card:hover h3 { text-decoration: underline; }

/* Margin notes */
.note { border-left: 3px solid var(--stamp); padding: 0.2rem 0 0.2rem 1rem; color: var(--ink-2); font-size: 1rem; }
.note::before { content: "Observer's note"; display: block; font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--stamp); margin-bottom: 0.15rem; }
.note.open { border-left-color: var(--open); }
.note.open::before { content: "Open question"; color: var(--open); }

footer.site { border-top: 3px double var(--rule); background: var(--paper); padding: 1.5rem max(16px, calc((100vw - 64rem) / 2)); font-size: 0.9rem; color: var(--ink-3); }
footer.site p { color: var(--ink-3); max-width: 46rem; margin: 0.3rem 0; }
footer.site a { color: var(--ink-2); }
@media (max-width: 40rem) { body { font-size: 1.0625rem; } main { padding-top: 1.5rem; } .slip > span { padding: 0.25rem 0.5rem; } }

/* Explore: the observatory */
main > .explore { max-width: 64rem; }
.ex-seeds { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 0; border: 1px solid var(--rule); background: var(--paper-2); }
.ex-seeds button { all: unset; cursor: pointer; padding: 0.55rem 0.8rem; border-right: 1px solid var(--rule); display: flex; flex-direction: column; gap: 0.1rem; }
.ex-seeds button:last-child { border-right: 0; }
.ex-seeds button b { font-weight: 600; }
.ex-seeds button span { font-size: 0.85rem; color: var(--ink-2); font-style: italic; }
.ex-seeds button[aria-selected="true"] { background: var(--paper); box-shadow: inset 0 -3px 0 var(--stamp); }
.ex-seeds button:focus-visible, .ex-play:focus-visible, .ex-labels button:focus-visible, .ex-moments button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ex-time { display: flex; gap: 0.6rem; align-items: stretch; margin-top: 1rem; }
.ex-play { all: unset; cursor: pointer; width: 2.6rem; display: grid; place-items: center; border: 1px solid var(--rule); background: var(--paper-2); font-size: 1rem; }
.ex-chart { position: relative; flex: 1; }
.ex-chart canvas { display: block; width: 100%; height: 7.5rem; border: 1px solid var(--rule); background: var(--paper); cursor: ew-resize; touch-action: none; }
.ex-tip { position: absolute; top: -0.4rem; transform: translate(-50%, -100%); background: var(--ink); color: var(--paper); font: 0.72rem/1.35 'IBM Plex Mono', monospace; padding: 0.25rem 0.5rem; pointer-events: none; white-space: nowrap; z-index: 2; }
.ex-readout { display: flex; flex-wrap: wrap; gap: 0.2rem 1.2rem; font-size: 0.8rem; color: var(--ink-2); margin: 0.6rem 0 1.2rem; min-height: 1.3rem; }
.ex-readout b { color: var(--ink); font-weight: 500; }
.ex-readout .why { color: var(--stamp); }
.ex-body { display: grid; grid-template-columns: minmax(0, 33rem) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.ex-tower { margin: 0; }
.ex-towerwrap { display: grid; grid-template-columns: 2.4rem minmax(0, 1fr) 1.6rem; gap: 0.4rem; align-items: stretch; }
.ex-labels { display: flex; flex-direction: column; }
.ex-labels button { all: unset; cursor: pointer; font: 0.72rem 'IBM Plex Mono', monospace; color: var(--ink-3); text-align: right; display: flex; align-items: center; justify-content: flex-end; padding-right: 0.2rem; border-right: 2px solid transparent; }
.ex-labels button.on { color: var(--stamp); border-right-color: var(--stamp); font-weight: 500; }
.ex-labels button:disabled { opacity: 0.35; cursor: default; }
.ex-map { width: 100%; height: auto; display: block; image-rendering: pixelated; cursor: pointer; background: var(--plate); }
.ex-true { width: 100%; height: 100%; object-fit: fill; image-rendering: pixelated; display: block; background: var(--plate); }
.ex-tower figcaption { font-size: 0.85rem; }
.ex-side h2 { margin-top: 0; counter-increment: none; }
.ex-side h2::before { content: none; }
.ex-crop { margin: 0 0 0.8rem; }
.ex-crop img { width: 100%; height: auto; image-rendering: pixelated; display: block; background: var(--plate); }
.ex-crop figcaption { font-size: 0.85rem; }
.ex-stats { display: table; font-size: 0.9rem; margin: 0; border-top: 0; }
.ex-stats th { white-space: nowrap; padding-right: 1rem; }
.ex-stats td:first-child { white-space: normal; }
.ex-stats code { white-space: nowrap; }
.ex-legend { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; font-size: 0.8rem; color: var(--ink-2); margin-top: 1rem; font-family: 'IBM Plex Mono', monospace; }
.ex-legend span { display: inline-flex; align-items: center; gap: 0.35rem; }
.ex-legend i { width: 0.8rem; height: 0.8rem; display: inline-block; border: 1px solid var(--rule); }
.ex-legend i.hatch { background: repeating-linear-gradient(135deg, #2e2e33 0 3px, #1c1c20 3px 6px); }
.ex-moments { list-style: none; padding: 0; }
.ex-moments li { padding: 0.35rem 0; border-bottom: 1px solid var(--rule); }
.ex-moments li[data-kind="open"] { color: var(--ink-2); font-size: 0.95rem; }
.ex-moments button { all: unset; cursor: pointer; color: var(--accent); font-size: 0.8rem; min-width: 9rem; display: inline-block; }
.ex-moments button:hover { text-decoration: underline; }
@media (max-width: 52rem) { .ex-body { grid-template-columns: 1fr; } }
