:root {
  --bg: #0b0b0b;
  --surface: #141414;
  --surface-2: #1a1a1a;
  --border: #2c2c2a;
  --border-strong: #3d3d3a;
  --text: #d3d1c7;
  --text-dim: #888780;
  --text-faint: #5f5e5a;
  --accent: #5dcaa5;
  --accent-dim: #1d9e75;
  --accent-bg: #04342c;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
  --maxw: 68rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.75;
  font-variant-ligatures: none;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.5rem;
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

a:hover {
  border-bottom-color: var(--accent);
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- header / nav ---------- */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

.brand {
  color: var(--accent);
  font-size: 14px;
  border: 0;
}

.brand:hover {
  border: 0;
  color: #9fe1cb;
}

.brand::before {
  content: "~/";
  color: var(--text-faint);
}

.site-nav {
  display: flex;
  gap: 1.25rem;
  font-size: 13px;
}

.site-nav a {
  color: var(--text-dim);
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ---------- typography ---------- */

main {
  padding: 3rem 0 4rem;
}

h1,
h2,
h3 {
  font-weight: 500;
  line-height: 1.3;
  color: #f1efe8;
}

h1 {
  font-size: 26px;
  margin: 0 0 0.35rem;
}

h2 {
  font-size: 18px;
  margin: 2.75rem 0 0.9rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

h3 {
  font-size: 15px;
  margin: 1.75rem 0 0.5rem;
}

p,
li {
  max-width: 74ch;
}

.lede {
  color: var(--text-dim);
  font-size: 14px;
  margin: 0 0 2rem;
}

.prose > :first-child {
  margin-top: 0;
}

code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.1em 0.35em;
  font-size: 0.9em;
}

pre {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1rem;
  overflow-x: auto;
}

pre code {
  background: none;
  border: 0;
  padding: 0;
}

blockquote {
  margin: 1.25rem 0;
  padding: 0.75rem 1.1rem;
  border-left: 2px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-dim);
}

blockquote p {
  margin: 0;
}

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

/* ---------- home hero ---------- */

.hero {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 1.75rem;
  align-items: start;
  margin-bottom: 1rem;
}

.hero-photo {
  width: 132px;
  height: 132px;
  border-radius: 4px;
  border: 1px solid var(--border-strong);
  object-fit: cover;
  display: block;
}

.hero-meta {
  color: var(--text-dim);
  font-size: 13px;
  margin: 0.6rem 0 0;
  line-height: 1.9;
}

.hero-meta .k {
  color: var(--text-faint);
  display: inline-block;
  min-width: 7.5rem;
}

/* ---------- transcript grid ---------- */

.legend {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-dim);
  margin: 0 0 1rem;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.swatch {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  display: inline-block;
}

.swatch.done {
  background: var(--accent-dim);
}

.swatch.active {
  border: 1px solid var(--accent);
}

.swatch.planned {
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 8px;
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
}

.grid li {
  max-width: none;
}

.tile {
  display: block;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.7rem 0.8rem;
  background: var(--surface);
  height: 100%;
}

.tile:hover {
  border-color: var(--accent);
  border-bottom-color: var(--accent);
}

.tile .code {
  font-size: 13px;
  color: var(--accent);
  display: block;
}

.tile .name {
  font-size: 12px;
  color: var(--text-dim);
  display: block;
  line-height: 1.45;
  margin-top: 0.2rem;
}

.tile.is-completed {
  border-color: var(--accent-dim);
  background: var(--accent-bg);
}

.tile.is-in_progress {
  border-color: var(--accent);
  border-style: dashed;
}

.tile.is-planned {
  opacity: 0.62;
}

/* ---------- badges ---------- */

.badge {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  border: 1px solid var(--border-strong);
  color: var(--text-dim);
  white-space: nowrap;
}

.badge.is-completed {
  background: var(--accent-bg);
  border-color: var(--accent-dim);
  color: var(--accent);
}

.badge.is-in_progress {
  border-color: var(--accent);
  color: var(--accent);
}

.badge.is-planned {
  color: var(--text-faint);
}

/* ---------- course page ---------- */

.course-head {
  margin-bottom: 1.75rem;
}

.course-head .kicker {
  color: var(--text-faint);
  font-size: 13px;
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.5rem 1.5rem;
  margin: 1.25rem 0 0;
  padding: 1rem 0 0;
  border-top: 1px solid var(--border);
  font-size: 13px;
}

.facts div {
  min-width: 0;
}

.facts dt {
  color: var(--text-faint);
  font-size: 12px;
}

.facts dd {
  margin: 0;
  color: var(--text);
  overflow-wrap: break-word;
}

/* ---------- research paper ---------- */

.paper {
  max-width: 46rem;
}

.paper h3 {
  margin: 2.25rem 0 0.5rem;
  color: var(--accent);
  font-size: 14px;
}

.paper p {
  margin: 0 0 1.1rem;
}

.paper .ref {
  font-size: 13px;
  color: var(--text-dim);
  padding-left: 2rem;
  text-indent: -2rem;
  margin-bottom: 0.9rem;
  overflow-wrap: break-word;
}

.paper .kicker {
  color: var(--text-faint);
  font-size: 13px;
  margin: 0 0 0.6rem;
}

.paper h2[id] {
  scroll-margin-top: 1rem;
}

/* ---------- cards ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 1rem;
  padding: 0;
  list-style: none;
}

.card {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  padding: 1.1rem 1.25rem;
  max-width: none;
}

.card h3 {
  margin-top: 0;
}

a.card {
  display: block;
  color: inherit;
  border: 1px solid var(--border);
}

a.card:hover {
  border-color: var(--accent);
}

a.card h3 {
  color: var(--accent);
}

.card .meta {
  font-size: 12px;
  color: var(--text-faint);
  margin: 0 0 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  max-width: none;
}

/* ---------- progress bar ---------- */

.cert-progress {
  margin: 1rem 0 0;
}

.cert-progress .track {
  height: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.cert-progress .fill {
  display: block;
  height: 100%;
  min-width: 2px;
  background: var(--accent-dim);
}

.cert-progress .fill.is-full {
  background: var(--accent);
}

.cert-progress .cert-link {
  color: var(--accent);
}

.cert-progress .pct {
  display: block;
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 0.45rem;
}

.card p {
  font-size: 13px;
  color: var(--text-dim);
  max-width: none;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0.85rem 0 0;
  padding: 0;
  list-style: none;
}

.chips li {
  font-size: 11px;
  color: var(--text-dim);
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  padding: 0.1rem 0.45rem;
  max-width: none;
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0 2.5rem;
  color: var(--text-faint);
  font-size: 12px;
}

.site-footer a {
  color: var(--text-dim);
}

/* ---------- responsive ---------- */

@media (max-width: 640px) {
  body {
    font-size: 14px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 1.1rem;
  }

  h1 {
    font-size: 22px;
  }

  .hero-meta .k {
    min-width: 6.5rem;
  }
}

@media (prefers-reduced-motion: no-preference) {
  a,
  .tile {
    transition: border-color 0.12s ease, color 0.12s ease;
  }
}
