/* NADIR site v1.2. One column, one accent, light and dark. No framework. */

/* Self-hosted, SIL OFL 1.1 (see fonts/README.md). */
@font-face { font-family: "Newsreader"; src: url("fonts/newsreader.woff2") format("woff2"); font-weight: 300 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("fonts/newsreader-italic.woff2") format("woff2"); font-weight: 300 700; font-style: italic; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/jetbrainsmono.woff2") format("woff2"); font-weight: 400 600; font-style: normal; font-display: swap; }
@font-face { font-family: "STIX Two Math"; src: local("STIX Two Math"), local("STIXTwoMath-Regular"), url("fonts/stix-two-math.woff2") format("woff2"); font-display: swap; }

:root {
  color-scheme: light dark;
  --bg: #fbfaf7;
  --fg: #17171a;
  --muted: #5b5b62;
  --faint: #8a8a91;
  --rule: #dcd9d1;
  --panel: #f3f1ec;
  --accent: #a3401a;
  --accent-soft: #f4e4dc;
  --measure: 680px;
  --gutter: 16px;
  --serif: "Newsreader", "Iowan Old Style", "Charter", Cambria, Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111113;
    --fg: #e8e6e1;
    --muted: #a5a39d;
    --faint: #7a7873;
    --rule: #2e2d2b;
    --panel: #1a1a1c;
    --accent: #ec8a5e;
    --accent-soft: #2c1d16;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--serif);
  font-size: 15.5px;
  line-height: 1.6;
  font-optical-sizing: auto;
  font-variant-numeric: lining-nums;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}

.wrap {
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: var(--gutter); top: 8px; background: var(--bg); padding: 4px 8px; z-index: 10; }

/* ---------------------------------------------------------------- header */

.site-header { border-bottom: 1px solid var(--rule); }
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 18px;
  padding-bottom: 14px;
}
.brand {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--fg);
  text-decoration: none;
}
.brand span { color: var(--accent); }
.nav { display: flex; flex-wrap: wrap; gap: 4px 18px; font-family: var(--mono); font-size: 13px; }
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--fg); }
.nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 0.3em; }

/* ----------------------------------------------------------------- type */

main { padding: 48px 0 32px; }

h1, h2, h3 { font-weight: 500; line-height: 1.2; letter-spacing: -0.012em; }
h1 { font-size: 27px; margin: 0 0 16px; }
h2 { font-size: 19px; margin: 56px 0 12px; padding-top: 24px; border-top: 1px solid var(--rule); }
h3 { font-size: 16px; margin: 32px 0 8px; }
h2 + h3 { margin-top: 16px; }
p, ul, ol, dl, table, pre, figure { margin: 0 0 18px; }
ul, ol { padding-left: 22px; }
li { margin: 0 0 6px; }
strong { font-weight: 600; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 40px 0; }

.lede { font-size: 17px; line-height: 1.5; color: var(--fg); }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }

.kicker, .label, .meta, code, kbd, .mono {
  font-family: var(--mono);
}
.kicker {
  display: block;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 12px;
}
.meta { font-size: 13px; color: var(--muted); line-height: 1.5; }
code { font-size: 0.85em; background: var(--panel); padding: 1px 4px; border-radius: 3px; }

pre {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.5;
  background: var(--panel);
  border: 1px solid var(--rule);
  padding: 14px 16px;
  overflow-x: auto;
  border-radius: 3px;
}
pre code { background: none; padding: 0; font-size: inherit; }

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

.note {
  border-left: 2px solid var(--accent);
  padding: 2px 0 2px 16px;
  margin: 24px 0;
  color: var(--fg);
}
.note p:last-child { margin-bottom: 0; }

.badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid currentColor;
  border-radius: 2px;
  padding: 0 5px;
  line-height: 1.6;
  vertical-align: 0.15em;
  white-space: nowrap;
}
.badge-built { color: var(--fg); }
.badge-progress { color: var(--accent); }
.badge-planned { color: var(--faint); }
.badge-archived { color: var(--faint); }
.badge-draft { color: var(--accent); }

.not-claim {
  background: var(--panel);
  border: 1px solid var(--rule);
  padding: 18px 20px 6px;
  margin: 32px 0;
  border-radius: 3px;
}
.not-claim h2, .not-claim h3 { margin-top: 0; border: 0; padding: 0; font-size: 18px; }

/* --------------------------------------------------------------- tables */

.table-scroll { overflow-x: auto; margin: 0 0 18px; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; line-height: 1.45; }
.table-scroll table { margin: 0; }
th, td { text-align: left; vertical-align: top; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--rule); }
th {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom-color: var(--fg);
}
td:last-child, th:last-child { padding-right: 0; }

dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; font-size: 14px; }
dl.facts dt { font-family: var(--mono); font-size: 12px; color: var(--muted); padding-top: 3px; text-transform: uppercase; letter-spacing: 0.06em; }
dl.facts dd { margin: 0; }

/* -------------------------------------------------------------- reports */

.report-list { list-style: none; padding: 0; }
.report-list > li { padding: 20px 0; border-top: 1px solid var(--rule); margin: 0; }
.report-list > li:last-child { border-bottom: 1px solid var(--rule); }
.report-list h3 { margin: 4px 0 6px; font-size: 16px; }
.report-list h3 a { color: var(--fg); text-decoration: none; }
.report-list h3 a:hover { color: var(--accent); }
.report-list p { margin-bottom: 8px; font-size: 14.5px; }
.links { font-family: var(--mono); font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px 16px; }

/* ------------------------------------------------------------- diagram */

figure.diagram { margin: 28px 0 24px; }
figure.diagram svg { display: block; width: 100%; max-width: 560px; height: auto; margin: 0 auto; }
figure.diagram.wide svg { max-width: 100%; }
figure.diagram svg.fg { max-width: 520px; }
/* ------------------------------------------------------------------ math */
math { font-family: "STIX Two Math", "Cambria Math", math; font-size: 1.06em; }
math.tml-display { display: block math; margin: 0; }
.eq { margin: 6px 0 18px; padding: 14px 16px; border-left: 2px solid var(--accent); background: var(--panel); overflow-x: auto; }
.eq + .eq { margin-top: -10px; }
.eq-where { font-size: 14px; color: var(--muted); margin: -8px 0 20px; }
.layer { margin-top: 30px; }
.layer h3 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.layer h3 .badge { font-size: 10.5px; }
.dg-var { fill: var(--bg); stroke: var(--fg); stroke-width: 1.2; }
.dg-var-a { fill: var(--bg); stroke: var(--muted); stroke-width: 1.2; }
.dg-fac { fill: var(--fg); }
.dg-fac-acc { fill: var(--accent); }
.dg-edge { stroke: var(--muted); stroke-width: 1; fill: none; }
.dg-edge-acc { stroke: var(--accent); stroke-width: 1; fill: none; }
.dg-sym { font-family: var(--serif); font-style: italic; font-size: 14px; fill: var(--fg); }

figcaption { font-family: var(--serif); font-size: 13px; color: var(--muted); margin-top: 10px; line-height: 1.5; }

.dg-box { fill: var(--bg); stroke: var(--fg); stroke-width: 1; }
.dg-io { fill: var(--panel); stroke: var(--rule); stroke-width: 1; }
.dg-built { fill: var(--accent-soft); stroke: var(--accent); }
.dg-line { stroke: var(--muted); stroke-width: 1; fill: none; }
.dg-arrow { fill: var(--muted); }
.dg-n { font-family: var(--mono); font-size: 11px; fill: var(--accent); letter-spacing: 0.06em; }
.dg-t { font-family: var(--serif); font-size: 15px; font-weight: 500; fill: var(--fg); }
.dg-s { font-family: var(--mono); font-size: 10.5px; fill: var(--muted); }
.dg-o { font-family: var(--mono); font-size: 10.5px; fill: var(--accent); }
.dg-chip { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase; fill: var(--faint); }
.dg-arrow-acc { fill: var(--accent); }
.dg-gate { stroke: var(--accent); stroke-width: 1; stroke-dasharray: 4 3; fill: none; }
.dg-gate-t { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.06em; text-transform: uppercase; fill: var(--accent); }
.dg-env { fill: var(--accent); fill-opacity: 0.08; stroke: var(--accent); stroke-width: 1; }
.dg-env2 { fill: none; stroke: var(--muted); stroke-width: 1; stroke-dasharray: 5 3; }
.dg-car { fill: var(--panel); stroke: var(--fg); stroke-width: 1.2; }
.dg-track { stroke: var(--fg); stroke-width: 1; stroke-dasharray: 2 3; fill: none; }
.dg-ell { fill: var(--bg); fill-opacity: 0.6; stroke: var(--fg); stroke-width: 0.9; }
.dg-hit { fill: var(--accent); }
.dg-dash { stroke: var(--faint); stroke-width: 0.8; stroke-dasharray: 3 3; fill: none; }
.dg-axis { stroke: var(--muted); stroke-width: 1; }
.dg-grid { stroke: var(--rule); stroke-width: 1; }
.dg-curve { stroke: var(--fg); stroke-width: 1.4; fill: none; }
.dg-curve-acc { stroke: var(--accent); stroke-width: 1.4; fill: none; }
.dg-shade { fill: var(--accent); fill-opacity: 0.09; }
.dg-band { fill: var(--muted); fill-opacity: 0.16; }
.dg-io-t { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.06em; fill: var(--fg); }

/* ----------------------------------------------------------- archived */

.archived-flag {
  font-family: var(--mono);
  font-size: 13px;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--faint);
  background: var(--panel);
  padding: 10px 14px;
  margin: 0 0 28px;
  color: var(--muted);
}
.draft-flag { border-left-color: var(--accent); color: var(--fg); }

/* ---------------------------------------------------------------- footer */

.site-footer { border-top: 1px solid var(--rule); margin-top: 48px; }
.site-footer .wrap { padding-top: 22px; padding-bottom: 40px; }
.site-footer p { font-family: var(--mono); font-size: 12px; color: var(--muted); margin: 0 0 6px; line-height: 1.6; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--fg); }

/* ---------------------------------------------------------------- small */

@media (max-width: 520px) {
  body { font-size: 15px; }
  main { padding-top: 32px; }
  h1 { font-size: 24px; }
  h2 { font-size: 18px; margin-top: 44px; }
  .lede { font-size: 16px; }
  dl.facts { grid-template-columns: 1fr; gap: 2px 0; }
  dl.facts dd { margin-bottom: 10px; }
  table { font-size: 14px; }
}

@media print {
  .site-header .nav, .site-footer, .skip { display: none; }
  body { background: #fff; color: #000; font-size: 11pt; }
  a { color: #000; }
}

/* ------------------------------------------------------------- progress */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--rule); border: 1px solid var(--rule); margin: 24px 0; }
.stat-row > div { background: var(--bg); padding: 12px 14px; }
.stat-row dt { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.stat-row dd { margin: 4px 0 0; font-size: 25px; font-variant-numeric: tabular-nums lining-nums; }
.stat-row dd span { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.progress-chart svg { max-width: 100%; }
.pg-out { fill: var(--accent); }
.pg-build { fill: var(--faint); }
.pg-grid { stroke: var(--rule); stroke-width: 1; }
.pg-ax { font-family: var(--mono); font-size: 10.5px; fill: var(--muted); }
.pg-key { display: inline-block; width: 9px; height: 9px; margin: 0 5px 0 0; vertical-align: baseline; }
.pg-key-out { background: var(--accent); }
.pg-key-build { background: var(--faint); margin-left: 12px; }
th.num, td.num { text-align: right; }
.feed { list-style: none; padding: 0; font-size: 14px; }
.feed li { display: grid; grid-template-columns: 92px 90px 1fr; gap: 4px 12px; padding: 7px 0; border-bottom: 1px solid var(--rule); }
.feed-date { color: var(--muted); font-size: 12px; padding-top: 2px; }
.feed-kind { font-family: var(--mono); font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; padding-top: 2px; }
@media (max-width: 560px) {
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .feed li { grid-template-columns: 1fr; gap: 0; }
}

.badge { white-space: nowrap; }
td .meta, td code { overflow-wrap: anywhere; }
