:root {
  color-scheme: dark;
  --bg: #0f151c;
  --panel: #171f28;
  --text: #e8edf2;
  --muted: #a9b5c0;
  --line: #34404c;
  --accent: #63a9d5;
  --accent-strong: #8bc8ec;
  --code-bg: #222c36;
  --warning-bg: #292a25;
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --max: 72rem;
  --reading: 48rem;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: .9375rem;
  line-height: 1.65;
}

::selection { background: #285a78; color: #ffffff; }

a { color: var(--accent-strong); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: .14em; }

.shell { width: min(calc(100% - 2rem), var(--max)); margin-inline: auto; }

.skip-link {
  position: absolute;
  left: -999rem;
  top: .5rem;
  z-index: 10;
  padding: .5rem .75rem;
  background: var(--text);
  color: var(--bg);
}
.skip-link:focus { left: .5rem; }

.site-header { border-bottom: 1px solid var(--line); background: var(--panel); }
.header-inner { min-height: 4.5rem; display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.site-name {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
}
.site-name span { color: var(--accent); }
nav { display: flex; flex-wrap: wrap; gap: .6rem 1.25rem; }
nav a { color: var(--text); font-size: .84rem; text-decoration: none; }
nav a:hover { color: var(--accent-strong); text-decoration: underline; }

main { padding-block: clamp(2.5rem, 6vw, 5.5rem); }
h1, h2, h3 { line-height: 1.16; letter-spacing: -.025em; }
h1 { max-width: 21ch; margin: .25rem 0 1.25rem; font-size: clamp(1.7rem, 3.2vw, 2.55rem); }
h2 { margin-top: 2.75rem; font-size: clamp(1.25rem, 2.5vw, 1.65rem); }
h3 { font-size: 1.08rem; }
p, li { max-width: var(--reading); }
.lead { max-width: 48rem; color: var(--muted); font-size: clamp(1rem, 1.6vw, 1.18rem); line-height: 1.55; }
.eyebrow {
  margin: 0;
  color: var(--accent-strong);
  font-family: var(--font-mono);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.home-intro { padding-block: clamp(1rem, 4vw, 3rem); }
.home-intro h1 { max-width: 15ch; }
.home-intro > p:first-of-type { max-width: 48rem; color: var(--muted); font-size: clamp(1rem, 1.6vw, 1.18rem); line-height: 1.55; }
.principles { margin-block: 2.5rem 1rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.principles section { min-width: 0; padding: 1.35rem; background: var(--panel); }
.principles h2 { margin: 0 0 .45rem; font-size: .98rem; }
.principles p { margin: 0; color: var(--muted); font-size: .86rem; }

.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-top: 4rem; border-bottom: 1px solid var(--line); }
.section-heading h2 { margin: 0 0 .7rem; }
.post-list { list-style: none; margin: 0; padding: 0; }
.post-list li { max-width: none; display: grid; grid-template-columns: 7.5rem 1fr; gap: 1.25rem; padding: 1.25rem 0; border-bottom: 1px solid var(--line); }
.post-list time { color: var(--muted); font-family: var(--font-mono); font-size: .76rem; }
.post-list h3 { margin: 0 0 .3rem; }
.post-list h3 a { color: var(--text); }
.post-list p { margin: 0; color: var(--muted); font-size: .86rem; }
.topic { display: inline-block; margin: .25rem .35rem 0 0; padding: .1rem .45rem; border: 1px solid var(--line); border-radius: 2rem; font-size: .7rem; }

.article { max-width: var(--reading); }
.article-header { margin-bottom: 2.25rem; }
.article-header h1 { max-width: 24ch; font-size: clamp(1.6rem, 3vw, 2.25rem); }
.article-meta { color: var(--muted); }
.archive-warning, .annotation {
  margin: 2rem 0;
  padding: 1.2rem 1.35rem;
  border-left: .3rem solid var(--accent);
  background: var(--warning-bg);
}
.archive-warning p, .annotation p:last-child { margin-bottom: 0; }
.annotation h2 { margin-top: 0; font-size: 1.12rem; }
.link-note { margin: 1rem 0 2rem; color: var(--muted); font-size: .78rem; }
.link-note p { margin: 0; }
.inactive-link-marker { padding-left: .12em; color: var(--muted); }
.historical-body { overflow-wrap: anywhere; }
.historical-body pre {
  overflow-x: auto;
  padding: 1.1rem;
  white-space: pre-wrap;
  border: 1px solid var(--line);
  background: var(--panel);
  font-family: var(--font-mono);
  font-size: .8rem;
}
.historical-body img { max-width: 100%; height: auto; }
.article-footer { margin-top: 3rem; padding-top: 1.25rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; }
.series-nav { margin-top: 2.5rem; }

.timeline { margin: 2rem 0; padding: 0; list-style: none; border-left: 2px solid var(--line); }
.timeline li { position: relative; margin-left: 1.25rem; padding: 0 0 2rem 1.4rem; }
.timeline li::before { content: ""; position: absolute; top: .55rem; left: -1.74rem; width: .7rem; height: .7rem; border: 2px solid var(--bg); border-radius: 50%; background: var(--accent); }
.timeline h2 { margin: 0 0 .35rem; font-size: 1.1rem; }
.timeline p { margin: .3rem 0; }
.timeline .kind { color: var(--muted); font-family: var(--font-mono); font-size: .7rem; text-transform: uppercase; }

code { padding: .08em .3em; border-radius: .2rem; background: var(--code-bg); font-family: var(--font-mono); }
blockquote { margin-left: 0; padding-left: 1.25rem; border-left: .25rem solid var(--line); color: var(--muted); }

.site-footer { border-top: 1px solid var(--line); background: var(--panel); color: var(--muted); font-size: .78rem; }
.footer-inner { min-height: 6rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.footer-inner p { margin: 0; }

@media (max-width: 720px) {
  .header-inner, .footer-inner { align-items: flex-start; flex-direction: column; justify-content: center; padding-block: 1rem; }
  .principles { grid-template-columns: 1fr; }
  .post-list li { grid-template-columns: 1fr; gap: .35rem; }
}
