/* Follows the reader's system theme until they pick one with the toggle,
   which adds .light or .dark to <html>. */
:root {
  --bg: #151514;
  --text: #e4e1da;
  --muted: #8f8b84;
  --rule: #2c2b29;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not(.dark) {
    --bg: #fcfbf8;
    --text: #1c1c1c;
    --muted: #6e6b66;
    --rule: #e4e1da;
    color-scheme: light;
  }
}

:root.light {
  --bg: #fcfbf8;
  --text: #1c1c1c;
  --muted: #6e6b66;
  --rule: #e4e1da;
  color-scheme: light;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Charter, "Bitstream Charter", "Sitka Text", Cambria, "Noto Serif", Georgia, serif;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

main {
  max-width: 34rem;
  margin: 0 auto;
  padding: 4rem 1.25rem 5rem;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: var(--muted);
}
a:hover { text-decoration-color: currentColor; }

h1, h2, h3 {
  line-height: 1.25;
  font-weight: 600;
}
h1 { font-size: 1.5rem; margin: 0 0 0.4rem; }
h2 { font-size: 1.2rem; margin: 2.4rem 0 0.6rem; }
h3 { font-size: 1rem; margin: 2rem 0 0.4rem; }

p, ul, ol, blockquote { margin: 0 0 1.25rem; }

blockquote {
  margin-left: 0;
  padding-left: 1rem;
  border-left: 2px solid var(--rule);
  color: var(--muted);
}

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

img { max-width: 100%; height: auto; }

code {
  font-size: 0.85em;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}

time, .muted { color: var(--muted); }

/* Landing */
.intro { margin-bottom: 3rem; }
.intro p { color: var(--muted); margin: 0; }

.list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  padding: 0.55rem 0;
  border-top: 1px solid var(--rule);
}
.list a { text-decoration: none; }
.list a:hover { text-decoration: underline; }
.list time {
  font-size: 0.8rem;
  white-space: nowrap;
}

/* Top bar: home link (on inner pages) and theme toggle */
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  margin: -1.5rem 0 3rem;
}
.top a { text-decoration: none; color: var(--muted); }
.top a:hover { color: var(--text); }

.theme { display: flex; gap: 0.35rem; }
.theme button {
  display: flex;
  padding: 0.3rem;
  background: none;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  opacity: 0.55;
  cursor: pointer;
}
.theme button:hover { opacity: 1; }
.theme button[aria-pressed="true"] {
  color: var(--text);
  background: var(--rule);
  opacity: 1;
  cursor: default;
}
.theme button:focus-visible { outline: 1px solid var(--muted); outline-offset: 2px; }

/* Article */

article header { margin-bottom: 2.2rem; }
article header time { font-size: 0.85rem; }
.dek {
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--muted);
  margin: 0 0 0.9rem;
}

.pull {
  font-style: italic;
  font-size: 1.1rem;
  line-height: 1.5;
  margin: 2rem 0;
  padding-left: 1rem;
  border-left: 2px solid var(--text);
}

.note {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--muted);
  margin: 3rem 0 0;
  padding-top: 1.2rem;
  border-top: 1px solid var(--rule);
}
.note p:last-child { margin-bottom: 0; }

sup.footnote-ref {
  font-size: 0.65em;
  line-height: 0;
  margin-left: 0.1em;
}
sup.footnote-ref a { text-decoration: none; color: var(--muted); }

.footnotes {
  margin-top: 2.5rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--rule);
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--muted);
}
.footnotes h2 {
  font-size: 0.85rem;
  margin: 0 0 0.8rem;
  color: var(--text);
}
.footnotes ol { padding-left: 1.2rem; margin: 0; }
.footnotes li { margin-bottom: 0.6rem; overflow-wrap: anywhere; }
.footnotes p { margin: 0; display: inline; }
.footnote-backref { text-decoration: none; margin-left: 0.3em; }

footer {
  display: flex;
  justify-content: space-between;
  margin-top: 4rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--rule);
  font-size: 0.85rem;
}
footer a { text-decoration: none; color: var(--muted); }
footer a:hover { color: var(--text); }

@media (max-width: 30rem) {
  html { font-size: 18px; }
  main { padding-top: 2.5rem; }
  .list li { flex-direction: column; gap: 0; }
}
