@import url("https://fonts.googleapis.com/css2?family=Bitter:wght@600;800&family=Be+Vietnam+Pro:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap");

:root {
  --ground: #FBFAF7;
  --surface: #FFFFFF;
  --surface-2: #F2F0E9;
  --ink: #161A16;
  --ink-2: #3F473E;
  --muted: #757D73;
  --line: #DBD8CD;
  --line-strong: #C3C0B3;
  --jade: #0E5138;
  --jade-2: #146A49;
  --jade-soft: #E4EDE7;
  --on-jade: #FBFAF7;
  --amber: #B36F12;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #101310;
    --surface: #171B16;
    --surface-2: #1E231D;
    --ink: #EDEFE8;
    --ink-2: #C4C9BE;
    --muted: #8E968B;
    --line: #2A2F28;
    --line-strong: #3B423A;
    --jade: #62C094;
    --jade-2: #7BD0A8;
    --jade-soft: #16241C;
    --on-jade: #0A140F;
    --amber: #E2A44D;
  }
}

:root[data-theme="dark"] {
  --ground: #101310;
  --surface: #171B16;
  --surface-2: #1E231D;
  --ink: #EDEFE8;
  --ink-2: #C4C9BE;
  --muted: #8E968B;
  --line: #2A2F28;
  --line-strong: #3B423A;
  --jade: #62C094;
  --jade-2: #7BD0A8;
  --jade-soft: #16241C;
  --on-jade: #0A140F;
  --amber: #E2A44D;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: "Be Vietnam Pro", "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: min(100% - 40px, 720px); margin-inline: auto; }

.topbar { border-bottom: 1px solid var(--line); background: var(--surface); }
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  flex-wrap: wrap;
  width: min(100% - 40px, 1080px);
  margin-inline: auto;
}
.brand {
  font-family: Bitter, Georgia, serif;
  font-weight: 800;
  font-size: 15px;
  text-decoration: none;
  color: var(--ink);
}
.brand span { color: var(--jade); }
.back {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--jade);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.back:hover { border-bottom-color: var(--jade); }

h1, h2 {
  font-family: Bitter, Georgia, "Times New Roman", serif;
  font-weight: 800;
  line-height: 1.15;
  text-wrap: balance;
  margin: 0;
  letter-spacing: -.01em;
}
h1 { font-size: clamp(30px, 4.5vw, 42px); }
h2 { font-size: 22px; }

.head { padding: 56px 0 8px; }
.updated {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 18px;
}
.intro { color: var(--ink-2); font-size: 17px; margin: 18px 0 0; }

.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
}
.toc a {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: .04em;
  padding: 6px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink-2);
  text-decoration: none;
}
.toc a:hover { border-color: var(--jade); color: var(--jade); }

section { padding: 40px 0; border-top: 1px solid var(--line); margin-top: 40px; }
section:first-of-type { margin-top: 44px; }
section p { margin: 14px 0 0; color: var(--ink-2); }
section h2 + p { margin-top: 16px; }

ul.plain { margin: 14px 0 0; padding-left: 20px; color: var(--ink-2); }
ul.plain li { margin-top: 7px; }

dl.facts {
  margin: 20px 0 0;
  display: grid;
  grid-template-columns: minmax(140px, auto) 1fr;
  gap: 10px 20px;
  font-size: 15px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 20px;
  background: var(--surface);
}
dl.facts dt {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 3px;
}
dl.facts dd { margin: 0; color: var(--ink); }

a.link { color: var(--jade); font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--jade); }
a.link:hover { color: var(--jade-2); border-color: var(--jade-2); }

a:focus-visible, summary:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }

footer {
  border-top: 1px solid var(--line);
  margin-top: 48px;
  padding: 26px 0 48px;
  color: var(--muted);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
