:root {
  color-scheme: light;
  --paper: #f4f2ec;
  --ink: #27302f;
  --muted: #58635f;
  --line: #c9ceca;
  --accent: #2a638b;
  --button-ink: #ffffff;
  --selected: #e1e9ed;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #192321;
  --ink: #f1f0e9;
  --muted: #bbc7c0;
  --line: #495953;
  --accent: #96c6e5;
  --button-ink: #172320;
  --selected: #314a53;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Arial, Helvetica, sans-serif; line-height: 1.55; }
a { color: var(--accent); }
button, a { -webkit-tap-highlight-color: transparent; }
button, .module-button { touch-action: manipulation; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.course-index { width: min(1100px, 100%); margin: 0 auto; padding: 28px 36px 40px; }
.index-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; }
.eyebrow { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .09em; }
.index-header .eyebrow { color: var(--muted); }
.theme-controls { display: flex; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; }
.theme-controls button { min-width: 66px; min-height: 44px; background: transparent; border: 0; border-radius: 5px; color: var(--ink); font-size: 14px; cursor: pointer; }
.theme-controls button[aria-pressed="true"] { background: var(--selected); font-weight: 700; }
.intro { padding: 48px 0 36px; max-width: 820px; }
h1 { margin: 0; font-family: Georgia, 'Times New Roman', serif; font-weight: 400; font-size: clamp(28px, 4.5vw, 48px); line-height: 1.15; letter-spacing: -.025em; }
.teacher { margin: 18px 0 0; font-weight: 700; }
.intro-text { margin: 12px 0 0; color: var(--muted); max-width: 680px; font-size: 17px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-bottom: 14px; }
.section-heading h2 { margin: 0; font-size: 20px; }
.section-heading span { font-size: 13px; color: var(--muted); }
.module-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.module-row { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; gap: 24px; align-items: center; padding: 28px 0; border-bottom: 1px solid var(--line); }
.module-number { color: var(--accent); font-family: Georgia, 'Times New Roman', serif; font-size: 48px; line-height: 1; }
.module-copy .eyebrow { color: var(--accent); }
.module-copy h3 { margin: 7px 0 8px; font-size: 21px; line-height: 1.3; }
.module-copy p:not(.eyebrow) { margin: 0; color: var(--muted); max-width: 640px; }
.module-button { display: inline-flex; align-items: center; justify-content: center; gap: 18px; min-height: 48px; padding: 10px 18px; border-radius: 7px; background: var(--accent); color: var(--button-ink); text-decoration: none; font-size: 15px; font-weight: 700; white-space: nowrap; }
.module-button:hover { text-decoration: underline; }
.index-footer { margin-top: 26px; color: var(--muted); font-size: 14px; }
.index-footer p { margin: 8px 0; }
.skip-link { position: absolute; left: 16px; top: -100px; padding: 12px; background: var(--paper); border: 2px solid var(--accent); z-index: 10; }
.skip-link:focus { top: 12px; }
@media (max-width: 700px) {
  .course-index { padding: 20px 20px 32px; }
  .intro { padding-top: 32px; }
  .module-row { grid-template-columns: 34px minmax(0, 1fr); gap: 14px; padding: 24px 0; }
  .module-number { font-size: 36px; align-self: start; margin-top: 3px; }
  .module-button { grid-column: 2; justify-self: start; }
}
@media (max-width: 380px) {
  .course-index { padding-inline: 16px; }
  .module-copy h3 { font-size: 19px; }
  .intro-text { font-size: 16px; }
}
