@font-face { font-family: "Literata"; src: url("fonts/literata.woff2") format("woff2"); font-weight: 200 900; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url("fonts/public-sans-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url("fonts/public-sans-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url("fonts/public-sans-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --ink: #22252b;
  --slate: #5b6470;
  --maroon: #1d4f6e;  /* accent (name kept from the first version) */
  --gold: #d98a1f;    /* highlight */
  --mist: #eceef1;
  --paper: #ffffff;
  --rule: #d6d9de;
  --serif: "Literata", Georgia, "Times New Roman", serif;
  --sans: "Public Sans", "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--maroon); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 2px; }

.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: 16px; top: 12px; background: var(--paper); padding: 8px 12px; z-index: 10; }

/* Header */
.site-head {
  max-width: 1120px; margin: 0 auto; padding: 22px 32px;
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-family: var(--sans);
}
.site-name { font-weight: 600; color: var(--ink); text-decoration: none; font-size: 1rem; }
.site-head nav { display: flex; gap: 22px; flex-wrap: wrap; }
.site-head nav a { color: var(--slate); text-decoration: none; font-size: 0.95rem; }
.site-head nav a:hover { color: var(--maroon); }

/* Hero */
.hero {
  max-width: 1120px; margin: 0 auto; padding: 56px 32px 72px;
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 56px; align-items: center;
  border-bottom: 1px solid var(--rule);
}
.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  line-height: 1.02; font-weight: 500; letter-spacing: -0.02em;
  margin: 0 0 18px; color: var(--maroon);
}
.role { font-family: var(--sans); color: var(--slate); font-size: 1rem; line-height: 1.5; margin: 0 0 28px; }
.lede { font-size: 1.28rem; line-height: 1.55; max-width: 34ch; margin: 0; }

.vm { margin: 0; }
.vm svg { width: 100%; max-width: 440px; display: block; margin: 0 auto; font-family: var(--sans); }
.vm figcaption { font-family: var(--sans); font-size: 0.85rem; color: var(--slate); text-align: center; max-width: 42ch; margin: 14px auto 0; line-height: 1.45; }
.vm .panel { fill: #fff; stroke: var(--rule); }
.vm .lab { font-size: 11px; fill: var(--slate); font-weight: 600; letter-spacing: .04em; }
.vm .sub { font-size: 10.5px; fill: var(--slate); }
.vm .tr { fill: none; stroke: #c3c8cf; stroke-width: 1.1; }
.vm .tr.on { stroke: var(--gold); stroke-width: 1.8; }
.vm .flow { fill: none; stroke: var(--gold); stroke-width: 1.4; stroke-dasharray: 3 4; animation: flow 1.6s linear infinite; }
.vm .model { fill: var(--maroon); }
.vm .model-t { fill: #fff; font-size: 12px; font-weight: 600; }
.vm .ring { fill: var(--mist); stroke: var(--rule); }
.vm .die { stroke: #fff; stroke-width: 0.6; }
.vm .yhat { font-size: 12px; fill: var(--ink); font-weight: 600; }
@keyframes flow { to { stroke-dashoffset: -14; } }
@media (prefers-reduced-motion: reduce) { .vm .flow { animation: none; } html { scroll-behavior: auto; } }

/* Sections: heading in the left column, text in the right */
main { padding-bottom: 24px; }
.block {
  max-width: 1120px; margin: 0 auto; padding: 56px 32px;
  display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 40px;
  border-bottom: 1px solid var(--rule);
}
.block:last-child { border-bottom: 0; }
.block h2 { font-size: 1.55rem; font-weight: 500; margin: 0; line-height: 1.2; color: var(--ink); }
.body { max-width: 66ch; }
.body > :first-child { margin-top: 0; }
.body p { margin: 0 0 1em; }

.topics { list-style: none; padding: 0; margin: 1.4em 0 0; display: grid; gap: 1.1em; }
.topics li { padding-left: 18px; border-left: 3px solid var(--gold); }
.topics b { font-weight: 600; color: var(--maroon); }

.courses { width: 100%; border-collapse: collapse; margin: 1.4em 0 1em; font-family: var(--sans); font-size: 0.97rem; }
.courses caption { text-align: left; color: var(--slate); font-size: 0.9rem; padding-bottom: 8px; }
.courses th { text-align: left; font-weight: 600; color: var(--slate); border-bottom: 2px solid var(--ink); padding: 8px 10px 8px 0; }
.courses td { border-bottom: 1px solid var(--rule); padding: 10px 10px 10px 0; vertical-align: top; }
.courses td:first-child { white-space: nowrap; font-weight: 600; color: var(--maroon); }
.aside { font-family: var(--sans); font-size: 0.93rem; color: var(--slate); }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.timeline li:last-child { border-bottom: 0; }
.when { font-family: var(--sans); color: var(--slate); font-size: 0.95rem; font-variant-numeric: tabular-nums; padding-top: 2px; }

.mail { font-size: 1.25rem; }

.site-foot { max-width: 1120px; margin: 0 auto; padding: 28px 32px 48px; font-family: var(--sans); font-size: 0.85rem; color: var(--slate); border-top: 1px solid var(--rule); }

@media (max-width: 820px) {
  .site-head, .hero, .block, .site-foot { padding-left: 16px; padding-right: 16px; }
  .hero { grid-template-columns: 1fr; gap: 36px; padding-top: 32px; padding-bottom: 48px; }
  .vm svg { max-width: 340px; }
  .block { grid-template-columns: 1fr; gap: 16px; padding-top: 40px; padding-bottom: 40px; }
  .timeline li { grid-template-columns: 1fr; gap: 2px; }
  .site-head nav { gap: 16px; }
}

/* Added for the full site */
.links { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 26px 0 0; font-family: var(--sans); font-size: 0.98rem; }
.portrait { display: block; width: 132px; height: 132px; object-fit: cover; border-radius: 50%; margin-bottom: 22px; border: 3px solid var(--mist); }
.body h3 { font-size: 1.12rem; font-weight: 600; margin: 2em 0 0.7em; color: var(--ink); }
.body h3.first { margin-top: 0; }
.recent { list-style: none; padding: 0; margin: 0; }
.recent li { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--rule); }
.recent li:last-child { border-bottom: 0; }
.pubs { margin: 0; padding-left: 1.6em; }
.pubs li { margin: 0 0 0.85em; padding-left: 0.2em; }
.pubs li::marker { color: var(--slate); font-family: var(--sans); font-size: 0.9em; }
.pubs b { font-weight: 600; }
.pubs a { font-family: var(--sans); font-size: 0.85rem; margin-left: 4px; white-space: nowrap; }
.pubs.plain { list-style: none; padding-left: 0; }
.pubs.plain li { padding-left: 0; }
@media (max-width: 820px) {
  .recent li { grid-template-columns: 1fr; gap: 2px; }
}

/* Shared page frame: keeps the header and columns in the same place on every page */
html { scrollbar-gutter: stable; overflow-y: scroll; }
.site-head { min-height: 72px; }
.page-head {
  max-width: 1120px; margin: 0 auto; padding: 40px 32px 44px;
  border-bottom: 1px solid var(--rule);
}
.page-head h1 { font-size: clamp(2rem, 4.4vw, 3rem); line-height: 1.1; font-weight: 500; letter-spacing: -0.015em; margin: 14px 0 12px; color: var(--maroon); }
.page-head h1 .code { color: var(--ink); }
.page-head .role { margin: 0; }
.crumbs { font-family: var(--sans); font-size: 0.9rem; color: var(--slate); display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs a { color: var(--slate); }
.crumbs a:hover { color: var(--maroon); }
.crumbs .sep { color: var(--rule); }
.crumbs [aria-current] { color: var(--ink); }
.materials { list-style: none; padding: 0; margin: 0; }
.empty { color: var(--slate); font-style: italic; }
.soon { display: inline-block; font-family: var(--sans); font-size: 0.78rem; color: var(--maroon); background: #e6eef3; border-radius: 3px; padding: 1px 7px; margin-left: 4px; white-space: nowrap; }
.courses td a { color: var(--maroon); font-weight: 600; text-decoration: none; }
.courses td a:hover { text-decoration: underline; }
@media (max-width: 820px) { .page-head { padding: 28px 16px 32px; } }
.topics + .aside { margin-top: 1.4em; }

.courses .lock { font-family: var(--sans); font-size: 0.78rem; color: var(--slate); margin-left: 6px; white-space: nowrap; }

/* Public course pages */
.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 22px 28px; max-width: none; }
.tgroup h3 { margin: 0 0 8px; font-family: var(--sans); font-size: 0.95rem; color: var(--maroon); }
.tgroup ul { margin: 0; padding-left: 1.1em; font-family: var(--sans); font-size: 0.95rem; line-height: 1.55; }
.tgroup li { margin: 0 0 4px; }
