@font-face {
  font-family: 'Inter';
  src: url('./fonts/InterVariable.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f7f4ee;
  --surface: #fffdfa;
  --text: #151311;
  --muted: #70675f;
  --faint: #9a9089;
  --line: rgba(21, 19, 17, 0.1);
  --line-strong: rgba(21, 19, 17, 0.18);
  --accent: #8e745a;
  --max-width: 1500px;
}

:root[data-theme='dark'] {
  --bg: #12110f;
  --surface: rgba(255, 255, 255, 0.03);
  --text: #f1ede6;
  --muted: #c7bbac;
  --faint: #8c8278;
  --line: rgba(241, 237, 230, 0.12);
  --line-strong: rgba(241, 237, 230, 0.22);
  --accent: #d3ad84;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }

.frame { width: min(var(--max-width), calc(100% - 72px)); margin: 0 auto; }

/* ── Masthead ── */
.masthead {
  position: sticky; top: 0; z-index: 30;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 24px;
  padding: 24px 0 16px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(8px);
}
.masthead.is-scrolled { border-bottom-color: var(--line-strong); }
.brand {
  display: inline-flex; align-items: baseline; gap: 10px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.24em; text-transform: uppercase;
}
.brand-mark { color: var(--accent); }
.brand-text { color: var(--muted); }
.mastnav { display: flex; justify-content: center; gap: 22px; flex-wrap: wrap; font-size: 12px; }
.mastnav a { color: var(--muted); transition: color 140ms ease; }
.mastnav a:hover { color: var(--text); }
.masthead-actions { display: inline-flex; align-items: center; gap: 14px; }
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px;
  padding: 0; border: 0; background: transparent; color: var(--muted); cursor: pointer;
  transition: color 140ms ease;
}
.theme-toggle:hover { color: var(--text); }
.theme-toggle-glyph { font-size: 12px; line-height: 1; }

/* ── Sections ── */
.section { padding: 120px 0; }
.section-rule { border-top: 1px solid var(--line); }
.hero { border-top: none; padding: 84px 0 96px; }
.kicker, .section-number {
  display: inline-block; margin: 0 0 18px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.34em; text-transform: uppercase;
  color: var(--accent);
}
.hero h1 {
  margin: 0; font-size: clamp(3rem, 5.6vw, 5.4rem); font-weight: 300;
  line-height: 0.95; letter-spacing: -0.06em; max-width: 16ch;
}
.hero h1 span { display: block; }
.lede { max-width: 60ch; margin: 38px 0 0; color: var(--muted); font-size: 17px; line-height: 1.85; }
.lede + .lede { margin-top: 18px; }

/* counts strip */
.counts { display: flex; flex-wrap: wrap; gap: 40px; margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--line); }
.count { display: grid; gap: 6px; }
.count b { font-size: clamp(1.9rem, 3vw, 2.6rem); font-weight: 300; letter-spacing: -0.04em; }
.count span { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }

/* NotebookLM / usage note */
.usenote {
  margin-top: 44px; padding: 26px 30px; border: 1px solid var(--line-strong);
  display: grid; gap: 12px; max-width: 78ch;
}
.usenote h2 { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); }
.usenote p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.8; max-width: 70ch; }
.usenote a { color: var(--accent); border-bottom: 1px solid var(--line-strong); }
.usenote a:hover { color: var(--text); border-bottom-color: var(--text); }

/* ── Contents ── */
.contents-grid { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 28px; margin-top: 40px; }
.contents-card { padding-top: 16px; border-top: 1px solid var(--line-strong); display: grid; gap: 8px; }
.contents-card .pn { font-size: 10px; letter-spacing: 0.28em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.contents-card h3 { margin: 0; font-size: 18px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.2; }
.contents-card p { margin: 0; font-size: 12px; color: var(--muted); }

/* ── Track section head ── */
.track-head { max-width: 70ch; margin-bottom: 56px; }
.track-head .track-label { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--faint); display: block; margin-bottom: 14px; }
.track-head h2 { margin: 0; font-size: clamp(2.1rem, 3.8vw, 3.4rem); font-weight: 300; letter-spacing: -0.05em; line-height: 1; }
.track-head .blurb { margin: 24px 0 0; color: var(--muted); font-size: 16px; line-height: 1.85; max-width: 64ch; }

/* ── Tutorial cards ── */
.cards { display: grid; gap: 0; border-top: 1px solid var(--line); }
.card {
  display: grid; grid-template-columns: 64px minmax(0,1fr); gap: 16px 34px;
  padding: 40px 0; border-bottom: 1px solid var(--line);
  scroll-margin-top: 90px;
}
.card-num { font-size: 13px; font-weight: 600; color: var(--accent); letter-spacing: 0.04em; padding-top: 6px; }
.card-body { display: grid; gap: 14px; }
.card-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.card-head h3 { margin: 0; font-size: 23px; font-weight: 500; letter-spacing: -0.035em; line-height: 1.12; }
.card-summary { margin: 0; color: var(--text); font-size: 15.5px; line-height: 1.6; max-width: 64ch; opacity: 0.92; }
.card-essay { margin: 0; color: var(--muted); font-size: 15.5px; line-height: 1.9; max-width: 70ch; }

.meta { display: flex; flex-wrap: wrap; gap: 8px 8px; align-items: center; }
.chip {
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 4px 9px; border: 1px solid var(--line-strong); border-radius: 2px; color: var(--muted);
  white-space: nowrap;
}
.chip-fw { color: var(--accent); border-color: var(--accent); }
.chip-flag { color: var(--bg); background: var(--accent); border-color: var(--accent); font-weight: 600; }

.prereqs { font-size: 12px; color: var(--faint); line-height: 1.7; }
.prereqs b { color: var(--muted); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; font-size: 10px; }
.prereqs a { color: var(--muted); border-bottom: 1px solid var(--line); }
.prereqs a:hover { color: var(--text); }

.card-foot { display: flex; gap: 22px; flex-wrap: wrap; align-items: center; padding-top: 4px; }
.src-link {
  font-size: 10px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent);
  border-bottom: 1px solid transparent; padding-bottom: 3px; transition: border-color 140ms ease, color 140ms ease;
}
.src-link:hover { border-bottom-color: var(--accent); }
.surface-note { font-size: 11px; color: var(--faint); letter-spacing: 0.04em; }

/* ── Footer ── */
.site-footer { display: grid; gap: 22px; padding: 64px 0 72px; border-top: 1px solid var(--line); }
.footer-ring { display: flex; flex-wrap: wrap; gap: 14px 28px; }
.footer-ring a { font-size: 11px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); transition: color 140ms ease; }
.footer-ring a:hover { color: var(--text); }
.colophon { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.8; max-width: 80ch; }

@media (max-width: 1100px) {
  .contents-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 860px) {
  .frame { width: min(var(--max-width), calc(100% - 28px)); }
  .masthead { grid-template-columns: 1fr; justify-items: start; gap: 12px; }
  .masthead-actions { order: 3; }
  .mastnav { justify-content: flex-start; gap: 12px 18px; }
  .section { padding: 80px 0; }
  .card { grid-template-columns: 1fr; gap: 12px; }
  .card-num { padding-top: 0; }
}
@media (max-width: 560px) {
  .contents-grid { grid-template-columns: 1fr; }
  .counts { gap: 24px 32px; }
}
