:root {
  color-scheme: light;
  --ink: #111820;
  --muted: #68727d;
  --paper: #f5f2e9;
  --card: #fffdf7;
  --blue: #003262;
  --gold: #fdb515;
  --university-red: #a6192e;
  --line: #d8d6ce;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Manrope", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.masthead {
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  background: var(--blue);
  color: white;
}

.masthead__inner,
main,
footer {
  width: min(1120px, calc(100% - 40px));
  margin-inline: auto;
}

.masthead__inner {
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wordmark {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.05em;
  text-decoration: none;
}

.wordmark span { color: var(--gold); }

.channel-link {
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}

.channel-link:hover { color: var(--gold); }

.hero {
  position: relative;
  padding: clamp(72px, 10vw, 130px) 0 clamp(72px, 9vw, 118px);
}

.hero::after {
  content: "61C";
  position: absolute;
  z-index: -1;
  top: 34px;
  right: 0;
  color: rgba(0, 50, 98, 0.055);
  font-family: "DM Mono", monospace;
  font-size: clamp(7rem, 19vw, 15rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.1em;
  user-select: none;
}

.eyebrow {
  margin: 0 0 22px;
  color: var(--blue);
  font-family: "DM Mono", monospace;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  max-width: 900px;
  margin: 0;
  color: var(--blue);
  font-size: clamp(3rem, 7.4vw, 6.4rem);
  line-height: 0.96;
  letter-spacing: -0.065em;
}

h1 em {
  color: inherit;
  font-style: normal;
}

.intro {
  max-width: 560px;
  margin: 34px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  line-height: 1.7;
}

.course-meta {
  display: flex;
  gap: 34px;
  margin-top: 38px;
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.course-meta strong { color: var(--ink); }

.index {
  padding-bottom: clamp(76px, 10vw, 120px);
}

.index__header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--ink);
}

h2 {
  margin: 0;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  letter-spacing: -0.045em;
}

.search {
  position: relative;
  width: min(270px, 100%);
}

.search input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #aaa99f;
  border-radius: 0;
  outline: 0;
  background: transparent;
  padding: 10px 34px 10px 0;
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
}

.search input:focus { border-color: var(--blue); }
.search__icon { position: absolute; right: 4px; top: 8px; font-size: 1.2rem; }

.week-header {
  position: relative;
  margin: -1px 0 0;
  padding: 5px 9px;
  background: var(--blue);
  color: white;
  font-family: "DM Mono", monospace;
  font-size: 0.58rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.lecture-list > .week-header:first-child { margin-top: 0; }

.lecture-group {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  border-bottom: 1px solid var(--line);
}

.lecture-group--last {
  background: rgba(0, 50, 98, 0.045);
}

.video-link--last .video-title { position: relative; }

.video-link--last .video-title::before {
  content: "";
  position: absolute;
  top: 0.34em;
  left: -17px;
  width: 10px;
  height: 14px;
  background: var(--university-red);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 72%, 0 100%);
}

.lecture-number {
  padding: 28px 0;
  color: var(--blue);
  font-family: "DM Mono", monospace;
  font-weight: 500;
}

.lecture-number strong {
  display: block;
  font-size: 1.35rem;
  font-weight: 500;
}

.lecture-reading {
  display: block;
  max-width: 78px;
  margin-top: 7px;
  color: var(--muted);
  font-family: "Manrope", system-ui, sans-serif;
  font-size: 0.58rem;
  font-weight: 600;
  line-height: 1.4;
}

.lecture-videos { padding: 17px 0; }

.video-link {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) 24px;
  align-items: baseline;
  gap: 10px;
  padding: 10px 8px;
  border-radius: 7px;
  text-decoration: none;
  transition: background 140ms ease, color 140ms ease;
}

.video-link:hover,
.video-link:focus-visible {
  background: var(--card);
  color: var(--blue);
  outline: none;
}

.video-id {
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 0.74rem;
}

.video-title { font-weight: 600; line-height: 1.5; }
.video-arrow { opacity: 0; transform: translateX(-4px); transition: 140ms ease; }
.video-link:hover .video-arrow,
.video-link:focus-visible .video-arrow { opacity: 1; transform: none; }

.empty-state {
  padding: 60px 0;
  color: var(--muted);
  text-align: center;
}

.companion {
  display: grid;
  grid-template-columns: minmax(240px, 0.72fr) minmax(0, 1.28fr);
  gap: clamp(50px, 9vw, 120px);
  margin-bottom: clamp(90px, 12vw, 150px);
  padding: clamp(42px, 7vw, 76px);
  background: var(--blue);
  color: white;
}

.companion .eyebrow { color: var(--gold); }

.companion__intro h2 {
  max-width: 390px;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1.02;
}

.companion__intro > p:last-child {
  max-width: 410px;
  margin: 25px 0 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.9rem;
  line-height: 1.7;
}

.weekly-list { border-top: 1px solid rgba(255, 255, 255, 0.28); }

.weekly-link {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 20px;
  align-items: baseline;
  gap: 12px;
  padding: 16px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  text-decoration: none;
}

.weekly-link:hover,
.weekly-link:focus-visible {
  color: var(--gold);
  outline: none;
}

.weekly-id {
  color: rgba(255, 255, 255, 0.55);
  font-family: "DM Mono", monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.weekly-title { font-size: 0.9rem; font-weight: 600; line-height: 1.5; }
.weekly-arrow { opacity: 0; transition: opacity 140ms ease; }
.weekly-link:hover .weekly-arrow,
.weekly-link:focus-visible .weekly-arrow { opacity: 1; }

footer {
  padding: 34px 0 50px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.6;
}

footer a:hover { color: var(--blue); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 640px) {
  .masthead__inner, main, footer { width: min(100% - 28px, 1120px); }
  .masthead__inner { height: 66px; }
  .hero { padding-top: 62px; }
  .index__header { align-items: stretch; flex-direction: column; }
  .search { width: 100%; }
  .lecture-group { grid-template-columns: 54px minmax(0, 1fr); }
  .lecture-number strong { font-size: 1rem; }
  .video-link { grid-template-columns: 50px minmax(0, 1fr) 16px; gap: 5px; padding-right: 0; }
  .course-meta { gap: 20px; }
  .companion { grid-template-columns: 1fr; gap: 38px; margin-inline: -14px; padding: 42px 28px; }
  .weekly-link { grid-template-columns: 58px minmax(0, 1fr) 16px; gap: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
