/* Museum site ~ an institutional museum built on object records. Every object
   stands on the same grey photographic sweep, as a still that becomes a 3D
   model when the device can take it. */
/* Panchang SemiBold, the logo's typeface (Fontshare, ITF Free Font License). */
@font-face {
    font-family: 'Panchang';
    src: url('https://cdn.fontshare.com/wf/VFK4WJ2ASLGVJIGPTOYHEAIT3DW643RW/6EOQ664MDO34ATBE2MF2I4O67G7EU7JM/5CZKGRVOJ2H4RNXBVGN3P4FD5ZWCYM54.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

:root {
    --paper: #ffffff;
    --ink: #000000;
    --ink-2: #555555;
    --rule: #d9d9d5;
    --band: #f5f5f3;
    --sweep-top: #f4f4f2;
    --sweep-floor: #e1e1dc;
    --crimson: #a6192e;
    --crimson-dark: #861324;
    --plum: #6c1c3f;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 400 18px/1.55 'Public Sans', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

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

[hidden] { display: none !important; }

.wrap {
    max-width: 1320px;
    margin: 0 auto;
    padding-left: 32px;
    padding-right: 32px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.skip {
    position: absolute;
    left: 16px;
    top: -60px;
    z-index: 1000;
    padding: 10px 16px;
    background: var(--ink);
    color: #fff;
}

.skip:focus { top: 8px; }

/* ---------- Header ---------- */
.site-header { border-bottom: 1px solid var(--rule); }

.header-bar {
    display: flex;
    align-items: center;
    gap: 32px;
    height: 88px;
}

/* The logo and the name in Panchang, stacked one word to a line, the three
   lines together as tall as the logo and set off from it by a hairline.
   The initials are the logo's OCM, in its crimson. */
.brand {
    --logo: 60px;
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
}

.brand img {
    display: block;
    width: var(--logo);
    height: var(--logo);
}

.brand-name {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: var(--logo);
    padding-left: 14px;
    border-left: 1px solid var(--rule);
    font: 600 calc(var(--logo) * 0.23) / 1.3 'Panchang', 'Public Sans', sans-serif;
}

.brand-name b {
    font-weight: inherit;
    color: var(--crimson);
}

.brand:hover .brand-name { color: var(--crimson); }

.site-header nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 28px;
    margin-left: auto;
}

.site-header nav a {
    padding: 6px 0;
    font-weight: 500;
    text-decoration: none;
    border-bottom: 2px solid transparent;
}

.site-header nav a:hover,
.site-header nav a[aria-current="page"] { border-bottom-color: var(--crimson); }

.lang select {
    padding: 6px 8px;
    border: 1.5px solid var(--ink);
    border-radius: 0;
    background: var(--paper);
    color: var(--ink);
    font: 500 15px/1.2 'Public Sans', sans-serif;
}

/* ---------- Buttons and links ---------- */
.btn {
    display: inline-block;
    padding: 14px 22px;
    border: 2px solid var(--crimson);
    background: var(--crimson);
    color: #fff;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
}

.btn:hover { background: var(--crimson-dark); border-color: var(--crimson-dark); }

.btn-quiet {
    border-color: var(--ink);
    background: transparent;
    color: var(--ink);
}

.btn-quiet:hover { background: var(--ink); border-color: var(--ink); color: #fff; }

.text-link {
    font-weight: 600;
    text-decoration-color: var(--crimson);
    text-decoration-thickness: 2px;
    text-underline-offset: 5px;
}

.text-link:hover { color: var(--crimson); }

/* Only devices that can run the emulators get the buttons that open them. */
.desktop-note { display: none; }
[data-tier="touch"] .needs-desktop { display: none; }
[data-tier="touch"] .desktop-note:not(.webgl-note) { display: block; }
/* Nor do browsers without WebGL 2 (scripts/main.js); a phone keeps its own note. */
[data-webgl="none"] .needs-desktop { display: none; }
[data-webgl="none"]:not([data-tier="touch"]) .webgl-note { display: block; }

/* ---------- Shared type ---------- */
/* Words are never split across lines: no automatic hyphens, no breaking
   inside a word. A heading whose longest word doesn't fit its column is set
   smaller instead (scripts/main.js). */
h1, h2, h3, h4, p, li, dt, dd, a, button, figcaption {
    hyphens: manual;
    overflow-wrap: normal;
    word-break: normal;
}

/* Grid columns never grow to fit a long word: the heading shrinks instead. */
.hero > *,
.section-head > *,
.object > *,
.object-body > *,
.article > *,
.records > *,
.aims > *,
.footer-grid > * { min-width: 0; }

/* Text the scripts write keeps its translation's own line breaks. */
.device-note,
.stage-hint,
.where-note,
.filter-count { white-space: pre-line; }

/* Headings are set in Panchang, the logo's typeface, as on the original
   front page. It runs wide, so sizes sit below what a normal sans would take. */
h1, h2, h3 {
    font-family: 'Panchang', 'Public Sans', sans-serif;
    font-weight: 600;
    letter-spacing: 0;
    text-wrap: balance;
}

.lede {
    max-width: 40ch;
    margin: 0 0 32px;
    color: var(--ink-2);
    font-size: 20px;
}

.record-number {
    color: var(--ink-2);
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}

.section-head {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 56px;
    align-items: end;
    margin-bottom: 48px;
}

.section-head h2,
.prose h2,
.object-text h2,
.archive h2 {
    margin: 0;
    font-size: clamp(22px, 2.2vw, 32px);
    line-height: 1.18;
}

.section-head p {
    max-width: 58ch;
    margin: 0;
    color: var(--ink-2);
}

/* A heavy rule above a group: the start of a section of the catalogue. */
.group-title {
    margin: 0 0 24px;
    padding-top: 12px;
    border-top: 2px solid var(--ink);
    font-size: 16px;
    font-weight: 600;
}

.band {
    padding: 80px 0 88px;
    background: var(--band);
}

.band-more { margin: 40px 0 0; }

/* ---------- Page heads ---------- */
.page-head {
    padding-top: 64px;
    padding-bottom: 40px;
}

.page-head h1 {
    margin: 0 0 20px;
    font-size: clamp(30px, 3.6vw, 52px);
    line-height: 1.1;
}

.page-head .lede { max-width: 56ch; margin-bottom: 0; }

.crumbs {
    display: flex;
    gap: 10px;
    padding-top: 24px;
    padding-bottom: 8px;
    color: var(--ink-2);
    font-size: 15px;
}

.crumbs a { text-underline-offset: 3px; }
.crumbs [aria-current] { color: var(--ink); }

/* ---------- Home hero ---------- */
.hero {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    align-items: center;
    gap: 56px;
    padding-top: 56px;
    padding-bottom: 88px;
}

.hero h1 {
    margin: 0 0 24px;
    font-size: clamp(28px, 3.05vw, 46px);
    line-height: 1.1;
}

.lede + .hero-actions { margin-top: 0; }

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.device-note {
    max-width: 44ch;
    margin: 32px 0 0;
    padding-left: 16px;
    border-left: 3px solid var(--crimson);
    font-size: 16px;
}

.hero-object { margin: 0; }

.hero-object figcaption {
    max-width: 70ch;
    margin-top: 14px;
    color: var(--ink-2);
    font-size: 15px;
}

.hero-object figcaption strong { color: var(--ink); }
.hero-object .record-number { margin-left: 6px; }

/* ---------- The sweep ---------- */
.stage,
.record-stage {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background:
        radial-gradient(120% 60% at 50% 100%, var(--sweep-floor), transparent 70%),
        linear-gradient(var(--sweep-top), var(--sweep-top) 55%, #ebebe7);
}

.band .record-stage { background-color: #fff; }

.stage-poster,
.record-stage img,
.stage .viewer-canvas {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.stage .viewer-canvas {
    opacity: 0;
    touch-action: none;
    cursor: grab;
    transition: opacity 0.6s;
}

.stage .viewer-canvas:active { cursor: grabbing; }
.stage.is-live .viewer-canvas { opacity: 1; }
.stage.is-live .stage-poster { opacity: 0; transition: opacity 0.6s; }

.stage-load {
    position: absolute;
    left: 16px;
    bottom: 16px;
    padding: 10px 14px;
    border: 1.5px solid var(--ink);
    background: #fff;
    color: var(--ink);
    font: 600 15px/1.2 'Public Sans', sans-serif;
    cursor: pointer;
}

.stage-load span { color: var(--ink-2); font-weight: 400; }
.stage-load:hover { background: var(--ink); color: #fff; }
.stage-load:hover span { color: #ddd; }

.stage.is-live .stage-load,
.stage.is-loading .stage-load,
.stage.is-failed .stage-load,
.stage.is-auto .stage-load { display: none; }

.stage-hint {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 12px;
    margin: 0;
    color: var(--ink-2);
    font-size: 14px;
    pointer-events: none;
}

/* ---------- Records ---------- */
.records {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 40px 32px;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* A scenario's page (pages/scenario.php): the machine's other scenarios. */
.scenario-links {
    margin: 40px 0 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--rule);
}
.scenario-links li { padding: 14px 0; border-bottom: 1px solid var(--rule); }
.scenario-links a { font-weight: 600; text-underline-offset: 3px; }
.scenario-links a:hover { color: var(--crimson); }
.scenario-links span { color: var(--ink-2); }

.record { position: relative; }
.record .record-stage { margin-bottom: 14px; }
.record p { margin: 0; }

.record h2,
.record h3 {
    margin: 2px 0;
    font-size: 17px;
    line-height: 1.3;
}

.record h2 a,
.record h3 a { text-decoration: none; }

/* The whole card answers the click; the link stays the one thing announced. */
.record h2 a::after,
.record h3 a::after {
    content: '';
    position: absolute;
    inset: 0;
}

.record:hover h2 a,
.record:hover h3 a {
    text-decoration: underline;
    text-decoration-color: var(--crimson);
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}

.record-line { color: var(--ink-2); font-size: 16px; }

.record-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px !important;
    font-size: 15px;
    font-weight: 500;
}

.record-status::before {
    content: '';
    flex: none;
    width: 9px;
    height: 9px;
    border: 1.5px solid var(--ink-2);
    border-radius: 50%;
}

.record-status.is-on::before { border-color: var(--crimson); background: var(--crimson); }

/* ---------- Collection page ---------- */
.catalogue { padding-bottom: 104px; }

.filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 40px;
    padding-top: 16px;
    border-top: 2px solid var(--ink);
}

.filters button,
.ways-categories button {
    padding: 9px 14px;
    border: 1.5px solid var(--ink);
    background: var(--paper);
    color: var(--ink);
    font: 500 15px/1.2 'Public Sans', sans-serif;
    cursor: pointer;
}

.filters button:hover { background: var(--band); }
.filters button[aria-pressed="true"] { background: var(--ink); color: #fff; }

.filter-count {
    margin: 0 0 0 auto;
    color: var(--ink-2);
    font-size: 15px;
}

/* ---------- Object record page ---------- */
.object {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 48px;
    align-items: start;
    padding-top: 16px;
    padding-bottom: 72px;
}

.object-record h1 {
    margin: 4px 0 12px;
    font-size: clamp(28px, 3.2vw, 46px);
    line-height: 1.1;
}

.object-record .record-number { margin: 0; }

.object-summary {
    margin: 0 0 28px;
    color: var(--ink-2);
    font-size: 19px;
}

.facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin: 0 0 28px;
    border-top: 1px solid var(--rule);
}

.facts div {
    padding: 10px 12px 10px 0;
    border-bottom: 1px solid var(--rule);
}

.facts dt { color: var(--ink-2); font-size: 14px; }
.facts dd { margin: 0; font-size: 16px; font-weight: 500; }

.object-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
}

.object-actions .desktop-note,
.object-note {
    margin: 0;
    padding-left: 14px;
    border-left: 3px solid var(--crimson);
    font-size: 16px;
}

.object-note { border-left-color: var(--rule); color: var(--ink-2); }

/* Ways in: the launch button's dialog when the machine has scenarios. The
   standard visit comes first, outlined; the rest scroll under the heading,
   however many there are. A scenario without a still has the machine's;
   with neither, its title on the sweep. */
html:has(.ways[open]) { overflow: hidden; }

.ways {
    width: min(1120px, calc(100% - 32px));
    /* One size however many scenarios there are, or the search leaves showing */
    height: min(880px, calc(100% - 48px));
    padding: 0;
    border: 0;
    background: var(--band);
    color: var(--ink);
}

/* It still scrolls; without a bar, the cards don't shift sideways as a
   category or search leaves too few of them to need one */
.ways { scrollbar-width: none; }
.ways::-webkit-scrollbar { display: none; }

.ways::backdrop { background: rgba(0, 0, 0, 0.55); }
.ways[open] { animation: ways-in 0.22s ease-out; }

@keyframes ways-in { from { opacity: 0; transform: translateY(12px); } }

.ways-inner { padding: 0 40px 44px; }

.ways-head {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: start;
    gap: 24px;
    margin-bottom: 24px;
    padding: 36px 0 20px;
    border-bottom: 1px solid var(--rule);
    background: var(--band);
    /* Its band across the dialog's side padding too, so the cards scrolling
       under it don't show at its ends (the default card's frame sits 1px out) */
    box-shadow: -40px 0 var(--band), 40px 0 var(--band);
}

.ways-head > div { flex: 1; }
.ways-head .record-number { margin: 0; }

.ways-head h2 {
    margin: 2px 0 8px;
    font-size: clamp(24px, 2.4vw, 32px);
    line-height: 1.15;
}

.ways-intro { max-width: 62ch; margin: 0; color: var(--ink-2); font-size: 17px; }

.ways-head form { margin: 0; }

/* Search and category buttons: scripts show them. A category button picks
   only its scenarios; pressed again, all of them. */
.ways-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
}

.ways-tools[hidden] { display: none; }

.ways-search {
    flex: 0 1 320px;
    min-width: 0;
    padding: 9px 14px;
    border: 1.5px solid var(--ink);
    border-radius: 0;
    background: var(--paper);
    color: var(--ink);
    font: 400 15px/1.2 'Public Sans', sans-serif;
}

.ways-search:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.ways-categories { display: flex; flex-wrap: wrap; gap: 8px; }

.ways-categories button:hover:not([aria-pressed="true"]) { background: var(--band); }

.ways-categories button[aria-pressed="true"] {
    border-color: var(--crimson);
    background: var(--crimson);
    color: #fff;
}

.ways-close {
    width: 40px;
    height: 40px;
    border: 1.5px solid var(--ink);
    background: transparent;
    color: var(--ink);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.ways-close:hover { background: var(--ink); color: #fff; }

.ways-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 24px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.way {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--rule);
    background: var(--paper);
}

.way[hidden] { display: none; }

/* A border and a shadow, not an outline: an outline is painted over
   everything, the sticky head included, when the list scrolls under it */
.way.is-default { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }

.way-still {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: linear-gradient(var(--sweep-top), var(--sweep-floor));
}

.way-still img { width: 100%; height: 100%; object-fit: cover; }

.way-blank {
    padding: 0 24px;
    color: var(--ink-2);
    font: 600 18px/1.3 'Panchang', 'Public Sans', sans-serif;
    text-align: center;
}

.way-tag {
    position: absolute;
    left: 12px;
    top: 12px;
    padding: 3px 8px;
    background: var(--paper);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.way.is-default .way-tag { background: var(--ink); color: #fff; }

.way-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 18px 20px 20px;
}

.way-text h3 { margin: 0; font-size: 20px; line-height: 1.2; }
/* The title leads to the scenario's own page (pages/scenario.php); Start
   still goes straight in. */
.way-text h3 a { color: inherit; text-decoration: none; }
.way-text h3 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.way-text p { margin: 0 0 8px; color: var(--ink-2); font-size: 15px; line-height: 1.45; }

.way-text .btn {
    margin-top: auto;
    align-self: flex-start;
    padding: 10px 16px;
    font-size: 15px;
}

.ways-none { margin: 8px 0 0; color: var(--ink-2); font-size: 17px; }

.object-body {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
    gap: 48px 80px;
    padding-bottom: 96px;
}

.object-text h2 { margin-bottom: 16px; padding-top: 14px; border-top: 2px solid var(--ink); font-size: clamp(19px, 1.8vw, 24px); }
.object-text h2 + p { max-width: 64ch; margin: 0 0 56px; }

.parts {
    margin: 0;
    border-top: 1px solid var(--rule);
}

.parts div {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 5fr);
    gap: 24px;
    padding: 14px 0;
    border-bottom: 1px solid var(--rule);
}

.parts dt { font-weight: 600; }
.parts dd { margin: 0; color: var(--ink-2); }

/* ---------- Where to see one ---------- */
.object-side {
    display: flex;
    flex-direction: column;
    gap: 56px;
}

.where h2 {
    margin: 0 0 16px;
    padding-top: 14px;
    border-top: 2px solid var(--ink);
    font-size: 18px;
}

.where-map {
    margin: 0;
    background: var(--band);
}

.where-map svg { display: block; width: 100%; height: auto; }
.where-map .land { fill: #d4d4ce; }

.where-map .holder,
.where-map .you,
.where-map .route-line { vector-effect: non-scaling-stroke; }

.where-map .holder {
    fill: #fff;
    stroke: var(--crimson);
    stroke-width: 2;
}

.where-map .holder.is-running { fill: var(--crimson); stroke: #fff; }

.where-map .you {
    fill: var(--ink);
    stroke: #fff;
    stroke-width: 2;
}

/* The route is drawn in once, from the visitor to the machine. */
.where-map .route-line {
    fill: none;
    stroke: var(--crimson);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    transition: stroke-dashoffset 1.6s cubic-bezier(0.45, 0, 0.25, 1);
}

.where.is-routed .route-line { stroke-dashoffset: 0; }

.where-counts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 20px 0 0;
}

.where-counts dt { color: var(--ink-2); font-size: 14px; }

.where-counts dd {
    margin: 4px 0 0;
    font: 600 22px/1.2 'Panchang', 'Public Sans', sans-serif;
    font-variant-numeric: tabular-nums;
}

/* The "of n" after the working count. */
.where-counts .of { color: var(--ink-2); font: 400 15px/1 'Public Sans', sans-serif; }

.where-note {
    min-height: 0;
    margin: 12px 0 0;
    color: var(--ink-2);
    font-size: 15px;
}

.where-note:empty { display: none; }

/* Every row is the same height, so a long list can show exactly three and
   scroll the rest. */
.holders {
    --row: 68px;
    margin: 20px 0 0;
    padding: 0;
    border-top: 1px solid var(--rule);
    list-style: none;
}

.holders.is-long {
    max-height: calc(3 * var(--row));
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-mask-image: linear-gradient(#000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(#000 calc(100% - 28px), transparent);
}

.holders.is-long.is-end {
    -webkit-mask-image: none;
    mask-image: none;
}

.holders.is-long:focus-visible { outline: 2px solid var(--crimson); outline-offset: 2px; }

.holders li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-content: center;
    gap: 2px 12px;
    box-sizing: border-box;
    height: var(--row);
    border-bottom: 1px solid var(--rule);
    font-size: 16px;
    line-height: 22px;
}

.holders a,
.holders span:not(.holder-status) {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.holders a { font-weight: 600; text-underline-offset: 3px; }
.holders span { color: var(--ink-2); font-size: 14px; line-height: 20px; }

.holder-status {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
    white-space: nowrap;
}

.holder-status::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 6px;
    border: 1.5px solid var(--crimson);
    border-radius: 50%;
}

.holder-status.is-on::before { background: var(--crimson); }

.archive h2 {
    margin-bottom: 12px;
    padding-top: 14px;
    border-top: 2px solid var(--ink);
    font-size: 18px;
}

.sources {
    margin: 0;
    padding: 0;
    list-style: none;
}

.sources li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--rule);
    font-size: 16px;
}

.sources a { text-underline-offset: 3px; }
.sources span { flex: none; color: var(--ink-2); font-size: 13px; }

/* ---------- Machine article (content/<id>/article.md) ---------- */
/* Same columns as the record above: the text in the wide one, "On this page"
   in the narrow one, held in view while the article scrolls by. */
.article {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
    gap: 0 80px;
    padding-bottom: 104px;
}

.article-head {
    grid-column: 1 / -1;
    padding-top: 14px;
    border-top: 2px solid var(--ink);
}

.article-head h2 {
    margin: 0 0 12px;
    font-size: clamp(24px, 2.6vw, 36px);
    line-height: 1.15;
}

.article-head .lede { max-width: 56ch; margin-bottom: 24px; }

.article-body { max-width: 68ch; }

.article-body > :first-child { margin-top: 16px; }

.article-body p,
.article-body ul,
.article-body ol { margin: 0 0 18px; line-height: 1.65; }

.article-body ul,
.article-body ol { padding-left: 24px; }

.article-body li + li { margin-top: 6px; }
.article-body li > ul,
.article-body li > ol { margin: 6px 0 0; }

.article-body h3 {
    margin: 48px 0 14px;
    font-size: clamp(19px, 1.8vw, 24px);
    line-height: 1.2;
    scroll-margin-top: 24px;
}

.article-body h4 {
    margin: 32px 0 10px;
    font: 700 18px/1.3 'Public Sans', sans-serif;
    scroll-margin-top: 24px;
}

.article-body h5,
.article-body h6 {
    margin: 24px 0 8px;
    font: 600 16px/1.3 'Public Sans', sans-serif;
}

.article-body a { text-underline-offset: 3px; }
.article-body a:hover { color: var(--crimson); }

.article-body blockquote {
    margin: 28px 0;
    padding: 2px 0 2px 22px;
    border-left: 3px solid var(--crimson);
    color: var(--ink-2);
}

.article-body blockquote p:last-child { margin-bottom: 0; }

.article-body code {
    padding: 1px 5px;
    background: var(--band);
    font: 0.9em/1.4 ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
}

.article-body pre {
    margin: 0 0 22px;
    padding: 16px 18px;
    overflow-x: auto;
    background: var(--band);
    border-left: 3px solid var(--rule);
}

.article-body pre code { padding: 0; background: none; font-size: 14px; }

.article-body hr {
    margin: 40px 0;
    border: 0;
    border-top: 1px solid var(--rule);
}

.article-figure { margin: 32px 0; }

.article-figure img,
.article-figure video,
.article-figure iframe {
    display: block;
    width: 100%;
    height: auto;
    background: var(--band);
}

.article-figure iframe { aspect-ratio: 16 / 9; border: 0; }

/* Several pictures side by side, wrapping to fewer columns on narrow screens. */
.figure-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.figure-row figcaption { grid-column: 1 / -1; margin-top: 0; }

.article-figure figcaption {
    margin-top: 10px;
    color: var(--ink-2);
    font-size: 15px;
    line-height: 1.5;
}

.article-body img { max-width: 100%; height: auto; }

.article-table {
    margin: 0 0 24px;
    overflow-x: auto;
}

.article-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px;
}

.article-table th,
.article-table td {
    padding: 10px 12px 10px 0;
    border-bottom: 1px solid var(--rule);
    text-align: left;
    vertical-align: top;
}

.article-table th { border-bottom: 2px solid var(--ink); font-weight: 600; }

.article-contents {
    align-self: start;
    position: sticky;
    top: 24px;
    margin-top: 16px;
}

.article-contents p {
    margin: 0 0 8px;
    color: var(--ink-2);
    font-size: 14px;
}

.article-contents ol {
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--rule);
    list-style: none;
}

.article-contents li { border-bottom: 1px solid var(--rule); }

.article-contents a {
    display: block;
    padding: 10px 0;
    font-size: 16px;
    text-decoration: none;
}

.article-contents a:hover { color: var(--crimson); }

/* ---------- About, contributors ---------- */
.aims {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
}

.aims article {
    padding-top: 14px;
    border-top: 2px solid var(--ink);
}

.aims h2 {
    margin: 0 0 8px;
    font-size: 17px;
}

.aims p {
    margin: 0 0 16px;
    color: var(--ink-2);
}

.aims { padding-top: 24px; padding-bottom: 96px; }

.prose { padding-top: 80px; padding-bottom: 96px; }
.band .prose { padding-top: 0; padding-bottom: 0; }
.page-head + .prose { padding-top: 24px; }
.prose h2 { margin-bottom: 20px; }
.prose p { max-width: 64ch; margin: 0 0 16px; }
.prose .parts { max-width: 880px; margin-bottom: 0; }
.prose .parts + h2 { margin-top: 64px; }

/* ---------- Footer ---------- */
/* The header's lockup at a larger size, then the site's links in columns,
   and the small print under a hairline. */
.site-footer {
    --footer-ink: #fff;
    --footer-ink-2: #a3a3a3;
    --footer-rule: #2e2e2e;
    padding: 72px 0 40px;
    background: var(--ink);
    color: var(--footer-ink);
}

.footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 5fr) repeat(3, minmax(0, 2fr));
    gap: 48px 32px;
    padding-bottom: 56px;
}

.brand.is-footer { --logo: 88px; gap: 20px; }
.brand.is-footer .brand-name { padding-left: 20px; border-left-color: var(--footer-rule); }
/* The logo's crimson, lifted to read on black. */
.brand.is-footer .brand-name b { color: #e2475d; }
.brand.is-footer:hover .brand-name { color: var(--footer-ink); }

.footer-brand p {
    max-width: 40ch;
    margin: 24px 0 0;
    color: var(--footer-ink-2);
    font-size: 16px;
}

.footer-col p {
    margin: 0 0 14px;
    color: var(--footer-ink-2);
    font-size: 14px;
}

.footer-col ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer-col li + li { margin-top: 10px; }

.footer-col a,
.footer-base a {
    color: var(--footer-ink);
    text-decoration: none;
}

.footer-col a:hover,
.footer-base a:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.footer-base {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px 32px;
    padding-top: 24px;
    border-top: 1px solid var(--footer-rule);
    color: var(--footer-ink-2);
    font-size: 14px;
}

.footer-base p { max-width: 80ch; margin: 0; }

/* ---------- Narrow screens ---------- */
@media (max-width: 1000px) {
    .hero,
    .section-head,
    .object,
    .object-body { grid-template-columns: 1fr; gap: 32px; }
    .records { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .aims { grid-template-columns: 1fr; }
    .article { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .footer-brand { grid-column: 1 / -1; }
    .article-contents { position: static; grid-row: 2; margin: 8px 0 16px; }
}

@media (max-width: 720px) {
    body { font-size: 17px; }
    .wrap { padding-left: 16px; padding-right: 16px; }

    .header-bar { flex-wrap: wrap; gap: 0 16px; height: auto; padding-top: 14px; }
    .brand { --logo: 48px; gap: 12px; }
    .lang { margin-left: auto; }
    .site-header nav {
        order: 3;
        flex-wrap: nowrap;
        gap: 22px;
        width: calc(100% + 32px);
        margin: 10px -16px 0;
        padding: 0 16px 6px;
        overflow-x: auto;
        white-space: nowrap;
        scrollbar-width: none;
    }

    .hero { padding-top: 32px; padding-bottom: 56px; }
    .lede { font-size: 18px; }
    .page-head { padding-top: 40px; }
    .band { padding: 56px 0 64px; }
    .records { grid-template-columns: 1fr; gap: 32px; }
    .facts { grid-template-columns: 1fr; }
    .parts div { grid-template-columns: 1fr; gap: 2px; }
    .filter-count { width: 100%; margin: 4px 0 0; }
    .site-footer { padding-top: 56px; }
    .brand.is-footer { --logo: 72px; gap: 16px; }
    .brand.is-footer .brand-name { padding-left: 16px; }
    .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 24px; padding-bottom: 40px; }
    .ways-inner { padding: 0 16px 28px; }
    .ways-head { padding-top: 20px; }
    .ways-search { flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .stage .viewer-canvas,
    .stage.is-live .stage-poster { transition: none; }
    .where-map .route-line { transition: none; }
    .ways[open] { animation: none; }
}
