/* zonedata.org - one stylesheet. Fonts self-hosted (latin subsets, variable where Google ships one). */
@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 400 600; font-display: swap; src: url("/assets/fonts/SourceSerif4-var.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-style: italic; font-weight: 400; font-display: swap; src: url("/assets/fonts/SourceSerif4-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 500; font-display: swap; src: url("/assets/fonts/Inter-var.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/IBMPlexMono-400.woff2") format("woff2"); }

:root {
  --ink: #1a1a1a;
  --ink-soft: #3a3a37;
  --muted: #6b6b66;
  --faint: #8a8983;
  --paper: #fcfbf9;
  --paper-raised: #ffffff;
  --rule: #e4e1da;
  --accent: #14384f;
  --accent-soft: #e8eef2;
  --code-bg: #f4f2ed;
  --serif: "Source Serif 4", Charter, Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --measure: 39.375rem; /* = 70ch of the body serif; rem so mono blocks share the same width */
}
[data-theme="dark"] {
  --ink: #e8e6e1;
  --ink-soft: #c9c7c1;
  --muted: #9a988f;
  --faint: #7a786f;
  --paper: #191918;
  --paper-raised: #201f1e;
  --rule: #34332f;
  --accent: #7fa8c0;
  --accent-soft: #22303a;
  --code-bg: #232221;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --ink: #e8e6e1; --ink-soft: #c9c7c1; --muted: #9a988f;
    --faint: #7a786f; --paper: #191918; --paper-raised: #201f1e;
    --rule: #34332f; --accent: #7fa8c0; --accent-soft: #22303a;
    --code-bg: #232221;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 46rem; margin: 0 auto; padding: 0 1.25rem; }

header.site {
  border-bottom: 2px solid var(--accent);
  font-family: var(--sans);
}
header.site .wrap {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-top: 1rem; padding-bottom: 1rem; gap: 1rem; flex-wrap: wrap;
}
.brand {
  font-family: var(--serif); font-size: 1.125rem;
  color: var(--ink); text-decoration: none; letter-spacing: 0.02em;
}
.brand span { color: var(--accent); }
nav.site a {
  font-size: 0.8125rem; color: var(--muted); text-decoration: none;
  margin-left: 1.1rem; letter-spacing: 0.03em;
}
nav.site a:hover, nav.site a[aria-current="page"] { color: var(--accent); }

main { padding: 2.5rem 0 3.5rem; }
main > .wrap > * { max-width: var(--measure); }

h1 { font-size: 1.75rem; font-weight: 600; line-height: 1.3;
     margin: 0 0 1rem; letter-spacing: -0.01em; }
h2 { font-size: 1.3125rem; font-weight: 600; line-height: 1.35;
     margin: 2.5rem 0 0.75rem; }
h3 { font-size: 1.0625rem; font-weight: 600; margin: 1.75rem 0 0.5rem; }
h2 a.anchor, h3 a.anchor {
  color: var(--rule); text-decoration: none; margin-left: 0.4rem;
  font-weight: 400;
}
h2:hover a.anchor, h3:hover a.anchor { color: var(--muted); }

p { margin: 0 0 1rem; }
a { color: var(--accent); text-decoration-thickness: 1px;
    text-underline-offset: 2px; }
strong { font-weight: 600; }

.doc-meta {
  font-family: var(--mono); font-size: 0.75rem; color: var(--muted);
  border-collapse: collapse; margin: 0 0 2rem;
}
.doc-meta td { padding: 0.15rem 0; vertical-align: top; }
.doc-meta td:first-child { width: 7.5rem; }
.doc-meta .status { color: var(--accent); }

.lede { font-size: 1.1875rem; color: var(--ink-soft); line-height: 1.65; }

blockquote {
  margin: 1.5rem 0; padding: 0.25rem 0 0.25rem 1.25rem;
  border-left: 3px solid var(--accent); color: var(--ink-soft);
  font-style: italic;
}
blockquote p { margin: 0; }

table.data {
  border-collapse: collapse; width: 100%; margin: 1.25rem 0;
  font-family: var(--sans); font-size: 0.875rem; line-height: 1.55;
}
table.data th {
  text-align: left; font-weight: 500; color: var(--muted);
  border-bottom: 1.5px solid var(--rule); padding: 0.4rem 0.75rem 0.4rem 0;
}
table.data td {
  border-bottom: 0.5px solid var(--rule);
  padding: 0.45rem 0.75rem 0.45rem 0; vertical-align: top;
}

pre {
  background: var(--code-bg); border: 0.5px solid var(--rule);
  border-radius: 6px; padding: 1rem 1.25rem; overflow-x: auto;
  white-space: pre-wrap; overflow-wrap: anywhere;
  font-family: var(--mono); font-size: 0.8125rem; line-height: 1.6;
  margin: 1.25rem 0;
}
code { font-family: var(--mono); font-size: 0.875em;
       background: var(--code-bg); padding: 0.1em 0.35em;
       border-radius: 4px; }
pre code { background: none; padding: 0; }

/* Diagrams: responsive replacements for the text graphics (wrap instead of scroll) */
figure.diagram {
  margin: 1.25rem 0; padding: 1rem 1.25rem;
  background: var(--paper-raised); border: 1px solid var(--rule); border-radius: 6px;
  font-family: var(--mono); font-size: 0.8125rem; line-height: 1.6; color: var(--ink);
}
figure.diagram ol, figure.diagram ul { list-style: none; margin: 0; padding: 0; }
figure.diagram li { margin: 0; }
figure.diagram p { margin: 0; }

.diagram.flow li + li::before {
  content: "\2193"; display: block; padding-left: 2rem; color: var(--muted);
}

.diagram.tree .branch + .branch { margin-top: 0.85rem; }
.diagram.tree ul { margin-left: 0.6rem; }
.diagram.tree li { position: relative; padding-left: 1.5rem; }
.diagram.tree li::before {
  content: ""; position: absolute; left: 0; top: 0.8em; width: 1rem;
  border-top: 1px solid var(--faint);
}
.diagram.tree li::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  border-left: 1px solid var(--faint);
}
.diagram.tree li:last-child::after { bottom: auto; height: 0.8em; }

.diagram.timeline .ends { display: flex; justify-content: space-between; gap: 1rem; }
.diagram.timeline .ends span:last-child { text-align: right; }
.diagram.timeline .span {
  position: relative; height: 0.9rem; margin: 0.15rem 0.35rem 0.6rem;
  border-bottom: 1px solid var(--ink-soft);
}
.diagram.timeline .span::before, .diagram.timeline .span::after {
  content: ""; position: absolute; bottom: -1px; height: 0.9rem;
  border-left: 1px solid var(--ink-soft);
}
.diagram.timeline .span::before { left: 0; }
.diagram.timeline .span::after { right: 0; }
.diagram.timeline .between, .diagram.timeline .note { text-align: center; }
.diagram.timeline .note { margin-top: 0.6rem; color: var(--muted); }

ul, ol { padding-left: 1.4rem; margin: 0 0 1rem; }
li { margin-bottom: 0.35rem; }

hr { border: none; border-top: 0.5px solid var(--rule); margin: 2.5rem 0; }

details.faq {
  border-bottom: 0.5px solid var(--rule); padding: 0.85rem 0;
}
details.faq summary {
  font-weight: 600; cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; gap: 1rem;
}
details.faq summary::after {
  content: "+"; font-family: var(--sans); color: var(--muted);
  flex-shrink: 0;
}
details.faq[open] summary::after { content: "–"; }
details.faq div { padding-top: 0.6rem; color: var(--ink-soft); }

footer.site {
  border-top: 0.5px solid var(--rule); font-family: var(--sans);
  font-size: 0.75rem; color: var(--faint); line-height: 1.7;
}
footer.site .wrap { padding-top: 1.25rem; padding-bottom: 1.75rem; }
footer.site a { color: var(--muted); }

button.theme {
  font-family: var(--sans); font-size: 0.75rem; color: var(--muted);
  background: none; border: 0.5px solid var(--rule); border-radius: 5px;
  padding: 0.2rem 0.6rem; cursor: pointer;
}
.no-js button.theme { display: none; }

@media print {
  header.site nav, button.theme, footer.site { display: none; }
  body { background: #fff; color: #000; }
}

/* Glossary */
dl.gloss dt {
  font-weight: 600; font-family: var(--sans); font-size: 0.9375rem;
  margin-top: 1.1rem;
}
dl.gloss dt code { font-size: 0.875em; }
dl.gloss dd {
  margin: 0.15rem 0 0 0; color: var(--ink-soft);
}
