:root {
  color-scheme: light dark;
  --bg: #fbfaf6;
  --surface: #ffffff;
  --sunken: #f2f0e9;
  --ink: #1d2320;
  --muted: #5a635e;
  --line: #dfdcd2;
  --accent: #1f6b4f;
  --accent-ink: #ffffff;
  --hold: #fff7e3;
  --hold-line: #d9b45a;
  --serif: ui-serif, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111513;
    --surface: #181d1a;
    --sunken: #0c0f0e;
    --ink: #e8ece9;
    --muted: #a0aaa4;
    --line: #2d3531;
    --accent: #58b78f;
    --accent-ink: #0c1411;
    --hold: #2a2412;
    --hold-line: #8a7236;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.6 var(--sans);
}
a { color: var(--accent); text-underline-offset: 2px; }
img, video { display: block; max-width: 100%; height: auto; }
code { font: .88em var(--mono); background: var(--sunken); padding: .1em .3em; border-radius: 4px; overflow-wrap: anywhere; }
pre { background: var(--sunken); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; overflow-x: auto; line-height: 1.45; }
pre code { background: none; padding: 0; font-size: 14px; overflow-wrap: normal; }

.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 24px;
  padding: 10px max(16px, calc((100vw - 1080px) / 2));
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { font: 600 18px var(--serif); color: var(--ink); text-decoration: none; white-space: nowrap; }
.top nav { display: flex; gap: 18px; overflow-x: auto; scrollbar-width: none; white-space: nowrap; font-size: 15px; }
.top nav::-webkit-scrollbar { display: none; }
.top nav a { color: var(--muted); text-decoration: none; padding: 4px 0; }
.top nav a:hover { color: var(--ink); }

main { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
section { padding: 44px 0 8px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; }
h1 { font-size: clamp(34px, 5.4vw, 52px); margin: 8px 0 16px; letter-spacing: -.01em; }
h2 { font-size: 30px; margin: 0 0 14px; padding-top: 22px; border-top: 1px solid var(--line); }
h3 { font-size: 21px; margin: 32px 0 8px; }
h4 { font-size: 15px; margin: 0 0 8px; }
p { max-width: 72ch; }
.eyebrow { margin: 0; font-size: 14px; letter-spacing: .04em; color: var(--muted); }
.lead { font-size: 19px; }
.note { font-size: 15px; color: var(--muted); }
.plain { padding-left: 20px; max-width: 72ch; }
.plain li { margin-bottom: 8px; }

.hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 36px; align-items: center; padding-top: 40px; }
.hero-fig { margin: 0; }
.hero-fig img { border-radius: 12px; border: 1px solid var(--line); }
figcaption { font-size: 14px; color: var(--muted); margin-top: 8px; max-width: 72ch; }
.links { display: flex; flex-wrap: wrap; gap: 10px; }
.button { padding: 8px 14px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); text-decoration: none; font-size: 15px; font-weight: 500; border: 1px solid var(--accent); }
.button.ghost { background: transparent; color: var(--accent); }

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding: 32px 0 0; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.tile b { display: block; font: 600 30px/1.15 var(--serif); }
.tile span { display: block; font-size: 14px; color: var(--muted); line-height: 1.35; margin-top: 4px; }

.wide { display: block; margin: 20px 0; }
.wide img { width: 100%; }
#problem .wide img { max-width: 640px; }
.video { margin-top: 12px; }
.video video { width: 100%; border-radius: 10px; background: #000; }

.columns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.columns h3 { margin-top: 8px; font-size: 19px; }
.columns p { font-size: 16px; }

.scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 15px; line-height: 1.4; }
th, td { padding: 9px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { font-weight: 600; background: var(--sunken); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
tr.strong td { font-weight: 600; }
.dated td:first-child { white-space: nowrap; }
.nw { white-space: nowrap; }
.tile .nw { display: inline; }

.k { display: inline-block; width: .8em; height: .8em; border-radius: 2px; margin: 0 .3em 0 .2em; }
.k.r { background: #d9443f; } .k.g { background: #3fb950; } .k.b { background: #2f81d7; } .k.y { background: #d4b106; }

.hold {
  display: flex; flex-direction: column; justify-content: center; gap: 4px;
  padding: 14px 16px;
  background: var(--hold); border: 1px dashed var(--hold-line); border-radius: 10px;
  font-size: 15px; line-height: 1.4;
}
.daypick { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.daypick button { font: 500 15px var(--sans); padding: 6px 12px; border-radius: 8px; border: 1px solid var(--accent); background: transparent; color: var(--accent); cursor: pointer; font-variant-numeric: tabular-nums; }
.daypick button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.week video { max-width: 860px; }

footer { max-width: 1080px; margin: 40px auto 0; padding: 16px 16px 32px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }

@media (max-width: 860px) {
  body { font-size: 16px; }
  .hero { grid-template-columns: 1fr; gap: 20px; padding-top: 24px; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .columns { grid-template-columns: 1fr; gap: 4px; }
  .pair-videos { grid-template-columns: 1fr; }
  .top { gap: 14px; }
}
@media (max-width: 640px) {
  .brand { display: none; }
  .top nav { -webkit-mask-image: linear-gradient(to right, #000 88%, transparent); mask-image: linear-gradient(to right, #000 88%, transparent); padding-right: 28px; }
  .tile span { overflow-wrap: normal; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
