/* District 2059 · site stylesheet
   Built from the District 2059 design system (Night theme).
   One file, no build step, no external requests: fonts are self-hosted. */

/* ---------- Fonts (SIL Open Font License, see /assets/fonts/licenses) ---------- */
@font-face { font-family: "Bodoni Moda"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/bodoni-moda-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Bodoni Moda"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/bodoni-moda-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Josefin Sans"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/josefin-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/source-serif-4-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/source-serif-4-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Courier Prime"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/courier-prime-latin-400-normal.woff2") format("woff2"); }

/* ---------- Tokens ---------- */
:root {
  --void: #0d0b09;
  --surface: #17130f;
  --surface-raised: #231c16;
  --line: #3b3128;
  --edge: #7a6a55;
  --ink: #efe4cf;
  --ink-muted: #a8977c;
  --ink-on-light: var(--void);
  --brass: #b4831c;
  --patina: #3a8a80;
  --patina-deep: #1f4f4a;
  --neon: #ff4d3d;
  --alert: var(--neon);

  --font-display: "Bodoni Moda", Didot, "Times New Roman", serif;
  --font-deco: "Josefin Sans", "Century Gothic", "Segoe UI", sans-serif;
  --font-serif: "Source Serif 4", Georgia, serif;
  --font-mono: "Courier Prime", "Courier New", monospace;

  --space-1: 4px; --space-2: 8px; --space-4: 16px; --space-8: 32px; --space-16: 64px;
  --radius-sm: 2px;
  --page-max: 1200px;
  --gutter: var(--space-8);
  color-scheme: dark;
}
@media (max-width: 759px) { :root { --gutter: var(--space-4); } }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--void); color: var(--ink);
  font-family: var(--font-serif); font-size: 17px; line-height: 27px;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--brass); }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
h1, h2, h3, p, ul, ol { margin: 0; }
ul.plain, ol.plain { padding: 0; list-style: none; }
b, strong { font-weight: 600; }
/* The HTML hidden attribute does nothing on SVG elements by default (the chart's red marker relies on it). */
svg [hidden] { display: none; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: var(--space-4); top: -100px; z-index: 10; padding: var(--space-2) var(--space-4); background: var(--brass); color: var(--ink-on-light); font-family: var(--font-deco); font-weight: 600; font-size: 13px; letter-spacing: 0.18em; text-decoration: none; }
.skip-link:focus { top: var(--space-4); }

/* ---------- Type styles ---------- */
.display-xl { font-family: var(--font-display); font-weight: 700; font-size: 72px; line-height: 0.95; }
.heading-1 { font-family: var(--font-display); font-weight: 600; font-size: 44px; line-height: 48px; }
.heading-2 { font-family: var(--font-display); font-weight: 600; font-size: 30px; line-height: 36px; }
.label { font-family: var(--font-deco); font-weight: 600; font-size: 13px; line-height: 16px; letter-spacing: 0.18em; text-transform: uppercase; }
.label-small { font-family: var(--font-deco); font-weight: 600; font-size: 11px; line-height: 14px; letter-spacing: 0.2em; text-transform: uppercase; }
.body-small { font-size: 15px; line-height: 22px; }
.data { font-family: var(--font-mono); font-size: 15px; line-height: 22px; }
.lede { font-size: 19px; line-height: 30px; max-width: 36em; }
.muted { color: var(--ink-muted); }
.brass { color: var(--brass); }
.neon { color: var(--neon); }
@media (max-width: 759px) {
  .display-xl { font-size: 48px; }
  .heading-1 { font-size: 32px; line-height: 38px; }
  .heading-2 { font-size: 24px; line-height: 30px; }
  .lede { font-size: 17px; line-height: 27px; }
}

/* ---------- Layout ---------- */
.wrap { max-width: var(--page-max); margin: 0 auto; padding-inline: var(--gutter); }
.stack { display: flex; flex-direction: column; gap: var(--space-4); }
.stack-tight { display: flex; flex-direction: column; gap: var(--space-2); }
.intro-copy { flex: 1 1 520px; min-width: 0; }
.stack-lg { display: flex; flex-direction: column; gap: var(--space-8); }
main.page { padding-block: var(--space-16); display: flex; flex-direction: column; gap: 48px; }
@media (max-width: 759px) { main.page { padding-block: var(--space-8); gap: var(--space-8); } }
.grid-auto { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.grid-2 { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }

/* ---------- Utilities (no inline styles anywhere: the CSP forbids them) ---------- */
.center { text-align: center; }
.pad-y { padding-block: var(--space-8); }
.pad-y-xl { padding-block: var(--space-16); }
.pad-bottom-xl { padding-bottom: var(--space-16); }
.grid-3 { display: grid; gap: var(--space-8); grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.w-20 { --w: 20%; } .w-30 { --w: 30%; } .w-35 { --w: 35%; } .w-40 { --w: 40%; } .w-45 { --w: 45%; } .w-50 { --w: 50%; }
.w-55 { --w: 55%; } .w-60 { --w: 60%; } .w-65 { --w: 65%; } .w-70 { --w: 70%; } .w-80 { --w: 80%; } .w-90 { --w: 90%; }
@media (max-width: 759px) { .pad-y-xl { padding-block: var(--space-8); } .pad-bottom-xl { padding-bottom: var(--space-8); } .grid-3 { gap: 24px; } }

/* ---------- Header and navigation ---------- */
.site-header { border-bottom: 1px solid var(--line); position: relative; }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4); padding-block: 24px; }
.wordmark { font-family: var(--font-display); font-weight: 700; font-size: 26px; line-height: 32px; color: var(--ink); text-decoration: none; }
.wordmark:hover { color: var(--brass); }
.nav-list { display: flex; flex-wrap: wrap; gap: var(--space-8); padding: 0; list-style: none; }
.nav-list a { display: block; padding: 14px 0; color: var(--ink); text-decoration: none; font-family: var(--font-deco); font-weight: 600; font-size: 13px; line-height: 16px; letter-spacing: 0.18em; }
.nav-list a:hover { color: var(--brass); }
.nav-list a[aria-current="page"] { color: var(--brass); border-bottom: 1px solid var(--brass); }
.menu-button { display: none; }

@media (max-width: 759px) {
  .site-header .wrap { padding-block: 12px; flex-wrap: nowrap; }
  .wordmark { font-size: 22px; line-height: 28px; }
  /* With JavaScript: collapse the nav behind a MENU button. Without it the links simply wrap. */
  .js .menu-button {
    display: flex; align-items: center; gap: var(--space-2); min-width: 44px; min-height: 44px; padding: 0 12px;
    background: transparent; border: 1px solid var(--edge); border-radius: var(--radius-sm); color: var(--ink); cursor: pointer;
    font-family: var(--font-deco); font-weight: 600; font-size: 11px; letter-spacing: 0.2em;
  }
  .js .site-nav { position: absolute; left: 0; right: 0; top: 100%; z-index: 5; background: var(--surface); border-bottom: 1px solid var(--brass); }
  .js .site-nav[hidden] { display: none; }
  .js .nav-list { flex-direction: column; gap: 0; }
  .js .nav-list a { padding: var(--space-4); border-bottom: 1px solid var(--line); }
  .js .nav-list a[aria-current="page"] { border-bottom-color: var(--line); }
  .no-js .site-header .wrap { flex-wrap: wrap; }
  .no-js .nav-list { gap: var(--space-4); }
}
@media (min-width: 760px) { .site-nav[hidden] { display: block; } }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-4); padding-block: var(--space-8); color: var(--ink-muted); }
.site-footer .seal { width: 40px; height: 40px; }

/* ---------- Buttons ---------- */
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 24px; border-radius: var(--radius-sm); text-decoration: none; font-family: var(--font-deco); font-weight: 600; font-size: 13px; letter-spacing: 0.18em; }
.button-primary { background: var(--brass); color: var(--ink-on-light); }
.button-primary:hover { background: var(--ink); color: var(--ink-on-light); }
.button-secondary { border: 1px solid var(--edge); color: var(--ink); }
.button-secondary:hover { border-color: var(--brass); color: var(--brass); }
.button-row { display: flex; flex-wrap: wrap; gap: var(--space-4); }
@media (max-width: 759px) { .button-row { flex-direction: column; } .button-row .button { width: 100%; } }

/* ---------- Deco frame and ornaments ---------- */
.frame { border: 1px solid var(--brass); padding: var(--space-2); }
.frame-inner { border: 1px solid var(--brass); }
.divider { display: flex; align-items: center; justify-content: center; gap: var(--space-4); }
.divider::before, .divider::after { content: ""; width: 96px; height: 1px; background: var(--brass); }
.divider span { width: 8px; height: 8px; background: var(--brass); transform: rotate(45deg); }
@media (max-width: 759px) { .frame { padding: 6px; } .divider::before, .divider::after { width: 64px; } }

/* ---------- Hero (home) ---------- */
.hero { padding-top: var(--space-16); padding-bottom: var(--space-8); }
.hero .frame-inner { display: flex; flex-wrap: wrap; }
.hero-copy { flex: 1 1 480px; min-width: 0; padding: var(--space-16) 48px; display: flex; flex-direction: column; justify-content: center; gap: 24px; }
.hero-art { flex: 1 1 420px; min-width: 0; min-height: 420px; display: flex; align-items: flex-end; justify-content: center; overflow: hidden; border-left: 1px solid var(--line); }
.hero-art svg { width: 100%; max-width: 520px; height: 420px; }
@media (max-width: 759px) {
  .hero { padding-top: var(--space-4); padding-bottom: 0; }
  .hero .frame-inner { flex-direction: column-reverse; }
  .hero-copy { flex-basis: auto; padding: 24px 20px 28px; gap: var(--space-4); }
  .hero-art { flex-basis: auto; min-height: 0; height: 200px; border-left: 0; border-bottom: 1px solid var(--line); }
  .hero-art svg { height: 200px; }
}

/* ---------- Section headers ---------- */
.section-head.no-rule { border-bottom: 0; padding-bottom: 0; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-4); padding-bottom: var(--space-4); border-bottom: 1px solid var(--line); }
.live { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--neon); }
.live::before { content: ""; width: 10px; height: 10px; border-radius: 999px; background: var(--neon); box-shadow: 0 0 10px rgba(255, 77, 61, 0.6); animation: breathe 3s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) { .live::before { animation: none; } }

/* ---------- Stat tiles ---------- */
.tile { background: var(--surface); border: 1px solid var(--line); padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.tile.hostile { border-color: var(--neon); }
.tile .value { font-family: var(--font-display); font-weight: 700; font-size: 48px; line-height: 1; overflow-wrap: anywhere; }
.tile .value.brass { color: var(--brass); }
.tiles-compact .tile .value { font-size: 44px; }
@media (max-width: 759px) {
  .tiles-rows .tile { flex-direction: row; align-items: center; justify-content: space-between; padding: var(--space-4); }
  .tiles-rows .tile .note { display: none; }
  .tiles-rows .tile .value { font-size: 26px; text-align: right; white-space: nowrap; overflow-wrap: normal; }
  .tiles-compact { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
  .tiles-compact .tile { padding: 14px; gap: var(--space-2); }
  .tiles-compact .tile .value { font-size: 26px; }
  .tiles-compact .tile .note { display: none; }
}

/* ---------- Exhibits / pieces ---------- */
.exhibit { border-top: 1px solid var(--brass); padding-top: 24px; display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 759px) { .exhibit { padding-top: var(--space-4); gap: var(--space-2); } }

/* ---------- Teal band ---------- */
.band { background: var(--patina-deep); padding: 48px; display: flex; flex-wrap: wrap; gap: var(--space-8); align-items: flex-start; }
.band > :first-child { flex: 1 1 260px; min-width: 0; }
.band > .band-body { flex: 2 1 480px; min-width: 0; }
.rule-list { display: flex; flex-direction: column; gap: var(--space-4); }
.rule-list li { padding-left: 24px; border-left: 1px solid var(--brass); }
@media (max-width: 759px) { .band { padding: var(--space-8) 20px; margin-inline: calc(var(--gutter) * -1); } .band > * { flex-basis: 100% !important; } .rule-list li { padding-left: var(--space-4); } }

/* ---------- Panels, tables, bars ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); padding: var(--space-8); display: flex; flex-direction: column; gap: 20px; min-width: 0; }
@media (max-width: 759px) { .panel { padding: var(--space-4); gap: var(--space-4); } }
.table-wrap { overflow-x: auto; }
table.ledger { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: 15px; line-height: 22px; }
table.ledger th { text-align: left; padding: var(--space-2) var(--space-2) var(--space-2) 0; border-bottom: 1px solid var(--line); font-family: var(--font-deco); font-weight: 600; font-size: 11px; letter-spacing: 0.2em; color: var(--ink-muted); }
table.ledger td { padding: 10px var(--space-2) 10px 0; border-bottom: 1px solid var(--line); }
table.ledger td:first-child { color: var(--brass); width: 3em; }
table.ledger .num { text-align: right; padding-right: 0; }
table.ledger.catches td:first-child { width: 7em; white-space: nowrap; }
table.ledger.catches .num { white-space: nowrap; padding-right: var(--space-4); }
table.ledger.catches .catch-note { display: block; font-size: 13px; line-height: 18px; }
table.ledger.catches a.hash { color: var(--brass); white-space: nowrap; }
table.ledger.catches .catch-type { white-space: nowrap; }
@media (max-width: 759px) {
  table.ledger.catches { font-size: 14px; }
  table.ledger.catches td:first-child { width: auto; }
  table.ledger.catches .num { padding-right: var(--space-2); }
  table.ledger.catches .hash-more { display: none; }
}
table.ledger.catches a.hash:hover, table.ledger.catches a.hash:focus-visible { text-decoration: underline; }
.pending { display: inline-block; height: 12px; width: var(--w, 60%); background: var(--line); vertical-align: middle; }
.bars { display: flex; flex-direction: column; gap: 14px; }
.bar-row { display: grid; grid-template-columns: 210px 1fr; align-items: center; gap: var(--space-4); }
.bar-track { height: 16px; background: var(--surface-raised); }
.bar-fill { height: 100%; width: var(--w, 0%); background: var(--brass); }
@media (max-width: 759px) { .bar-row { grid-template-columns: 1fr; gap: 6px; } .bar-track { height: 12px; } }
.ports { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-2); }
.port { background: var(--surface-raised); border: 1px solid var(--line); padding: 12px; display: flex; flex-direction: column; gap: var(--space-2); }
@media (max-width: 759px) { .ports { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------- Chart ---------- */
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart svg * { vector-effect: non-scaling-stroke; }
/* Scale labels on the gridlines. Sizes are in SVG units, so phones (where the chart shrinks) get a bigger number. */
.chart .yticks text { font-family: var(--font-mono); font-size: 13px; fill: var(--ink-muted); }
@media (max-width: 759px) { .chart .yticks text { font-size: 30px; } }
.chart-axis { display: flex; justify-content: space-between; padding-left: 4.5%; }
.legend { display: flex; flex-wrap: wrap; gap: var(--space-2) 24px; }
.legend span { display: inline-flex; align-items: center; gap: var(--space-2); }
.swatch-line { width: 24px; height: 2px; }
.bg-brass { background: var(--brass); }
.bg-patina { background: repeating-linear-gradient(90deg, var(--patina) 0 6px, transparent 6px 12px); }
.swatch-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--neon); }

/* ---------- Range toggle ---------- */
.toggle { display: inline-flex; border: 1px solid var(--edge); border-radius: var(--radius-sm); }
.toggle button { min-height: 44px; padding: 0 var(--space-4); border: 0; background: transparent; color: var(--ink); cursor: pointer; font-family: var(--font-deco); font-weight: 600; font-size: 11px; letter-spacing: 0.2em; }
.toggle button[aria-pressed="true"] { background: var(--brass); color: var(--ink-on-light); }
.stamp { align-self: flex-start; padding: var(--space-2) 12px; border: 1px solid var(--brass); color: var(--brass); }
.page-intro { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px; }
.page-intro-controls { display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-4); }
@media (max-width: 759px) {
  .page-intro-controls { align-items: stretch; width: 100%; }
  .toggle { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- Opening week ---------- */
.opening .frame-inner { padding: 48px; display: flex; flex-direction: column; gap: 48px; }
.milestones { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); border-top: 1px solid var(--brass); }
.milestone { position: relative; padding: 24px 24px 0 0; display: flex; flex-direction: column; gap: var(--space-4); }
.milestone::before { content: ""; position: absolute; top: -6px; left: 0; width: 10px; height: 10px; background: var(--brass); transform: rotate(45deg); }
.milestone .value { font-family: var(--font-display); font-weight: 700; font-size: 44px; line-height: 1; }
.firsts li { display: flex; justify-content: space-between; gap: var(--space-4); padding: 12px 0; border-bottom: 1px solid var(--line); }
.firsts .t { color: var(--brass); white-space: nowrap; }
.firsts .hostile, .firsts .hostile .t { color: var(--neon); }
.split { display: flex; flex-wrap: wrap; gap: 48px; align-items: flex-start; }
.split > :first-child { flex: 1 1 520px; min-width: 0; }
.split > :last-child { flex: 1 1 360px; min-width: 0; }
.note-card { background: var(--surface); border: 1px solid var(--line); padding: 24px; display: flex; flex-direction: column; gap: var(--space-2); }
@media (max-width: 759px) {
  .opening .frame-inner { padding: 20px var(--space-4); gap: 24px; }
  .milestones { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4) 12px; border-top: 0; }
  .milestone { border-top: 1px solid var(--brass); padding: 10px 0 0; gap: 6px; }
  .milestone::before { display: none; }
  .milestone .value { font-size: 28px; }
  .milestone .data { font-size: 13px; line-height: 18px; }
  .firsts li { flex-direction: column; gap: 0; padding: var(--space-2) 0; }
  .split { gap: 24px; }
  .note-card { padding: 14px; }
}

/* ---------- Stakeout flow ---------- */
ol.flow { display: grid; grid-template-columns: minmax(0, 1fr) 48px minmax(0, 1.2fr) 48px minmax(0, 1fr) 48px minmax(0, 1fr); align-items: center; padding: 48px; }
.flow > li { min-width: 0; }
.flow .card { padding: 14px var(--space-4); font-size: 15px; line-height: 22px; text-align: center; }
.flow .street { background: var(--patina-deep); }
.flow .watchers { border: 1px solid var(--edge); padding: 12px; display: flex; flex-direction: column; gap: var(--space-2); }
.flow .watchers .card { background: var(--surface); border: 1px solid var(--line); }
.flow .ledger-card { background: var(--surface-raised); border: 1px solid var(--brass); }
.flow .site-card { background: var(--brass); color: var(--ink-on-light); }
.flow .arrow { display: flex; justify-content: center; align-items: center; }
.flow .arrow svg { width: 32px; height: 14px; }
.flow .when { display: block; font-family: var(--font-mono); font-size: 13px; color: var(--ink-muted); }
@media (max-width: 899px) {
  ol.flow { grid-template-columns: 1fr; padding: 0; }
  .flow .card { text-align: left; }
  .flow .arrow { padding: 6px 0; }
  .flow .arrow svg { transform: rotate(90deg); width: 18px; height: 14px; }
}
.flow-frame { overflow: hidden; }
@media (max-width: 899px) { .flow-frame { border: 0; padding: 0; } .flow-frame > .frame-inner { border: 0; } }

.offlist li { display: flex; gap: var(--space-4); padding: var(--space-4) 0; border-bottom: 1px solid var(--line); }
.offlist li span:first-child { color: var(--brass); }

/* ---------- 404 ---------- */
.wrong-door { min-height: 60vh; display: flex; flex-direction: column; justify-content: center; gap: var(--space-4); padding-block: var(--space-16); }
