/* Warm cream page, near-black ink, one clay accent, serif headings, system sans body. */
@font-face {
  font-family: "Source Serif 4";
  src: url("assets/fonts/source-serif-4-latin.woff2") format("woff2");
  font-weight: 400 600;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --bg: light-dark(#faf9f5, #262624);
  --ink: light-dark(#141413, #f5f4ef);
  --soft: light-dark(#5e5d59, #b7b5a9);
  --faint: light-dark(#87867f, #8f8d84);
  --rule: light-dark(#e8e6dc, #3a3936);
  --accent: light-dark(#c6613f, #d97757);
  --serif: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  /* chart series, used only on post pages */
  --s0: light-dark(#87867f, #9a988f);
  --s1: light-dark(#c6613f, #d97757);
  --s2: light-dark(#4f7cac, #7ea7d1);
}

* { box-sizing: border-box; }
html { overflow-x: hidden; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul, ol, figure { margin: 0; }
a { color: inherit; text-decoration: underline; text-decoration-color: var(--rule); text-decoration-thickness: 1px; text-underline-offset: 3px; transition: color 120ms ease, text-decoration-color 120ms ease; }
a:hover { color: var(--accent); text-decoration-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
/* Placeholders stay in the source for review but are hidden on the live site. */
[data-todo] { display: none !important; }

.page { max-width: 688px; margin: 0 auto; padding: 72px 24px 88px; }
.top { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.top nav { margin-left: auto; display: flex; gap: 20px; font-size: 15px; color: var(--soft); }
.top nav a { text-decoration: none; }
.name { font: 500 20px/1.3 var(--serif); letter-spacing: -0.01em; text-decoration: none; }

.intro { margin-top: 64px; }
.intro h1 { font: 400 40px/1.15 var(--serif); letter-spacing: -0.02em; }
.intro p { margin-top: 20px; font-size: 18px; line-height: 1.6; color: var(--soft); }
.intro p a { color: var(--ink); }
.intro p a:hover { color: var(--accent); }

section { margin-top: 64px; }
h2 { font: 500 24px/1.3 var(--serif); letter-spacing: -0.01em; padding-bottom: 12px; border-bottom: 1px solid var(--rule); }

.projects { list-style: none; padding: 0; }
.projects li { padding: 20px 0; border-bottom: 1px solid var(--rule); }
.projects h3 { font: 500 19px/1.35 var(--serif); }
.projects h3 a { text-decoration: none; }
.projects .note { margin-left: 8px; font: 400 14px/1 var(--sans); color: var(--faint); }
.projects p { margin-top: 4px; color: var(--soft); }
.projects .links { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 14px; }
.projects .links a { color: var(--soft); }
.projects .links a:hover { color: var(--accent); }

.writing { list-style: none; padding: 0; }
.writing li { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--rule); align-items: baseline; }
.writing time { font-size: 14px; color: var(--faint); }
.writing a { text-decoration: none; }

.contact { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 8px 24px; }
footer { margin-top: 72px; font-size: 14px; color: var(--faint); }

/* Post pages */
.post { margin-top: 56px; }
.post .back { font-size: 15px; color: var(--soft); text-decoration: none; }
.post h1 { margin-top: 28px; font: 400 38px/1.15 var(--serif); letter-spacing: -0.02em; }
.post .meta { margin-top: 12px; font-size: 14px; color: var(--faint); }
.post .dek { margin-top: 18px; font-size: 19px; line-height: 1.55; color: var(--soft); }
.post h2 { margin: 52px 0 12px; padding: 0; border: 0; font-size: 25px; }
.post p { margin: 14px 0; font-size: 17px; line-height: 1.7; }
.post .box { margin: 28px 0; padding: 18px 22px; border-radius: 8px; background: light-dark(#f0eee6, #30302e); font-size: 15.5px; }
.post .box p { margin: 0; font-size: inherit; }
.post figure { margin: 28px 0 10px; }
.post svg { width: 100%; height: auto; display: block; }
.post figcaption { margin-top: 8px; font-size: 14px; line-height: 1.55; color: var(--soft); }
.post .grid { stroke: var(--rule); stroke-width: 1; }
.post .tick, .post .note, .post .axlabel { fill: var(--soft); font-size: 12px; }
.post .cat { fill: var(--ink); font-size: 13px; }
.post .note.strong { fill: var(--ink); font-weight: 600; }
.post .thr { stroke: var(--faint); stroke-width: 1.5; }
.post .band { fill: var(--rule); opacity: 0.7; }
.post .s0, .post .s1, .post .s2 { stroke: var(--bg); stroke-width: 2; }
.post .s0 { fill: var(--s0); } .post .s1 { fill: var(--s1); } .post .s2 { fill: var(--s2); }
.post .dim { opacity: 0.55; }
.post .pair { fill: none; stroke: var(--faint); stroke-width: 1; opacity: 0.45; }
.post .ci { stroke: var(--ink); stroke-width: 2; }
.post .cimean { stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }
.post .hit { fill: transparent; stroke: none; }
.post .mark:hover circle:not(.hit) { stroke: var(--ink); }
.post .legend { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13.5px; color: var(--soft); }
.post .key { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 50%; vertical-align: middle; }
.post .tiles { margin: 20px 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.post .tile b { display: block; font: 500 26px/1.2 var(--serif); }
.post .tile span { font-size: 14px; line-height: 1.5; color: var(--soft); }
.post details.tv { margin-top: 8px; font-size: 14px; }
.post details.tv summary { cursor: pointer; color: var(--soft); }
.post .tw { overflow-x: auto; }
.post table { margin-top: 8px; min-width: 100%; border-collapse: collapse; font-size: 13.5px; }
.post td, .post th { padding: 5px 8px; border-bottom: 1px solid var(--rule); text-align: left; white-space: nowrap; }
.post ol.refs { padding-left: 20px; }
.post ol.refs li { margin-bottom: 10px; font-size: 15px; line-height: 1.55; color: var(--soft); overflow-wrap: anywhere; }
#tip { position: fixed; z-index: 9; display: none; max-width: 300px; padding: 6px 9px; border-radius: 6px; pointer-events: none; background: var(--ink); color: var(--bg); font-size: 13px; }

@media (max-width: 600px) {
  .page { padding: 40px 20px 64px; }
  .intro { margin-top: 48px; }
  .intro h1 { font-size: 32px; }
  .intro p { font-size: 17px; }
  section { margin-top: 52px; }
  .writing li { grid-template-columns: 1fr; gap: 2px; }
  .post h1 { font-size: 30px; }
  .post .tiles { grid-template-columns: 1fr; gap: 12px; }
}
@media (prefers-reduced-motion: reduce) { a { transition: none; } }

[data-todo]{display:none !important}
