:root {
  --ink: #101828;
  --ink-soft: #475467;
  --ink-faint: #667085;
  --navy: #1d2939;
  --accent: #3538cd;
  --line: #e4e7ec;
  --line-soft: #f0f1f3;
  --surface: #ffffff;
  --surface-alt: #f7f8fa;
  --page: #f2f4f7;
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0 20px 64px;
  background: var(--page);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.9em;
  background: #eceefb;
  color: var(--accent);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

/* ---------- Masthead ---------- */

.masthead {
  max-width: 780px;
  margin: 0 auto;
  padding: 64px 0 32px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.masthead h1 {
  margin: 0 0 16px;
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--navy);
}

.lede {
  margin: 0;
  font-size: 17px;
  color: var(--ink-soft);
}

/* ---------- Toolbar ---------- */

.toolbar {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 0 auto 28px;
}

.btn {
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 14px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.btn:hover {
  color: var(--accent);
  border-color: #c7c9f5;
  background: #fbfbff;
}

a.btn {
  text-decoration: none;
}

.btn--primary,
.btn--primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Course ---------- */

.wrap {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  gap: 40px;
}

.course {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}

.course__head {
  padding: 32px 32px 28px;
  border-bottom: 1px solid var(--line);
}

.course__number {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.course__title {
  margin: 0 0 14px;
  font-size: 25px;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--navy);
}

.course__blurb {
  margin: 0;
  max-width: 62ch;
  color: var(--ink-soft);
  font-size: 15.5px;
}

.course__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  font-size: 13.5px;
  color: var(--ink-faint);
}

.meta__value {
  font-weight: 600;
  color: var(--navy);
}

/* ---------- Accordion ---------- */

.item + .item {
  border-top: 1px solid var(--line-soft);
}

.item:nth-child(odd) {
  background: var(--surface-alt);
}

.item__head {
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
}

.item__toggle {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 18px 32px;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  color: var(--navy);
  text-align: left;
  background: none;
  border: 0;
  cursor: pointer;
}

.item__toggle:hover .item__title {
  color: var(--accent);
}

.item__toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -3px;
}

.chevron {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--ink-faint);
  transition: transform 0.2s ease;
}

.item.is-open .chevron {
  transform: rotate(-180deg);
}

.item__title {
  flex: 1;
  transition: color 0.15s;
}

.item__count {
  flex: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-faint);
}

.item__panel {
  display: none;
  padding: 0 32px 22px;
}

.item.is-open .item__panel {
  display: block;
}

.lessons {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: lesson;
  border-top: 1px solid var(--line);
}

.lessons li {
  counter-increment: lesson;
  display: flex;
  gap: 14px;
  padding: 9px 0 9px 30px;
  font-size: 15px;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line-soft);
}

.lessons li:last-child {
  border-bottom: 0;
}

.lessons li::before {
  content: counter(lesson, decimal-leading-zero);
  flex: none;
  width: 2ch;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-faint);
  padding-top: 2px;
}

/* ---------- Footer ---------- */

.foot {
  max-width: 900px;
  margin: 48px auto 0;
  text-align: center;
  font-size: 13px;
  color: var(--ink-faint);
}

.foot p {
  margin: 0;
}

@media (max-width: 640px) {
  .course__head {
    padding: 26px 20px 22px;
  }

  .item__toggle {
    padding: 16px 20px;
    font-size: 15px;
  }

  .item__panel {
    padding: 0 20px 18px;
  }

  .item__count {
    display: none;
  }
}

/* ---------- Print ---------- */

@page {
  size: A4;
  margin: 16mm 14mm;
}

@media print {
  [data-no-print] {
    display: none;
  }

  body {
    padding: 0;
    background: #fff;
    font-size: 10.5pt;
    line-height: 1.45;
  }

  .masthead {
    padding: 0 0 20pt;
    max-width: none;
  }

  .masthead h1 {
    font-size: 26pt;
  }

  .lede {
    font-size: 11pt;
  }

  .wrap {
    max-width: none;
    gap: 20pt;
  }

  .course {
    border: 1px solid var(--line);
    border-radius: 6pt;
    box-shadow: none;
    break-inside: auto;
  }

  .course + .course {
    break-before: page;
  }

  .course__head {
    padding: 14pt 16pt 12pt;
    break-after: avoid;
  }

  .course__title {
    font-size: 15pt;
  }

  .course__blurb,
  .course__meta {
    font-size: 9.5pt;
  }

  /* Every section is expanded on paper, regardless of screen state. */
  .item__panel {
    display: block;
  }

  .item__head {
    break-after: avoid;
  }

  .lessons li {
    break-inside: avoid;
  }

  .item__toggle {
    padding: 9pt 16pt;
    font-size: 11pt;
  }

  .chevron {
    transform: rotate(-180deg);
  }

  .item__panel {
    padding: 0 16pt 10pt;
  }

  .lessons li {
    padding: 3.5pt 0 3.5pt 22pt;
    font-size: 9.5pt;
  }

  code {
    background: none;
    padding: 0;
  }
}
