:root {
  color-scheme: light;
  --ink: #14213d;
  --muted: #5a6478;
  --line: #d8dfeb;
  --paper: #ffffff;
  --page: #f3f6fb;
  --blue: #1756a9;
  --blue-soft: #eaf2ff;
  --focus: #f5b82e;
  --content: 72rem;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--page);
}

a { color: var(--blue); }

a:focus-visible,
select:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: .75rem;
  left: .75rem;
  z-index: 20;
  padding: .7rem 1rem;
  border-radius: .35rem;
  color: #fff;
  background: var(--ink);
  translate: 0 -200%;
}

.skip-link:focus { translate: 0; }

.site-header,
.site-footer {
  width: min(var(--content), calc(100% - 2rem));
  margin-inline: auto;
}

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

.day-header {
  position: sticky;
  top: 0;
  z-index: 10;
  width: 100%;
  min-height: 4.25rem;
  padding: .65rem max(1rem, calc((100vw - var(--content)) / 2));
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / .96);
  box-shadow: 0 .25rem .75rem rgb(20 33 61 / .1);
  backdrop-filter: blur(10px);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  color: var(--muted);
  font-size: .9rem;
}

.day-controls {
  display: flex;
  align-items: end;
  justify-content: flex-end;
}

.day-control {
  display: grid;
  gap: .3rem;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 750;
}

.day-control-sections select { min-width: 18rem; }

select {
  min-height: 2.6rem;
  padding: .45rem 2.25rem .45rem .7rem;
  border: 1px solid var(--line);
  border-radius: .4rem;
  color: var(--ink);
  background: var(--paper);
  font: inherit;
}

main {
  width: min(var(--content), calc(100% - 2rem));
  margin: 2rem auto 5rem;
}

.day-main { scroll-margin-top: 6rem; }

.toc-page,
.lesson-section {
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: 0 1rem 3rem rgb(20 33 61 / .06);
}

.toc-page { padding: clamp(1.5rem, 5vw, 3.6rem); }

.eyebrow {
  margin: 0 0 .8rem;
  color: var(--blue);
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

h1 {
  max-width: 16ch;
  margin: 0;
  font-size: clamp(2.65rem, 7vw, 5.4rem);
  line-height: .98;
  letter-spacing: -.055em;
}

.course-objective {
  max-width: 54rem;
  margin: 1.25rem 0 0;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.62;
}

.course-brief {
  max-width: 54rem;
  margin-top: 2rem;
  padding: 1.2rem 1.35rem;
  border-left: 4px solid var(--blue);
  background: var(--blue-soft);
  line-height: 1.62;
}

.course-brief h2 {
  margin: 0 0 .45rem;
  font-size: 1rem;
}

.course-brief p { margin: 0; }

.section-toc {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.section-toc h2 {
  margin: 0;
  font-size: 1.25rem;
}

.toc-list {
  display: grid;
  margin: 1.25rem 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.toc-link {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr);
  align-items: center;
  gap: .75rem;
  padding: .8rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}

.toc-link:hover { color: var(--blue); }

.toc-number {
  color: var(--blue);
  font-weight: 850;
  white-space: nowrap;
}

.course-document {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
}

.lesson-section {
  padding: clamp(2rem, 6vw, 5rem);
  line-height: 1.62;
  scroll-margin-top: 6rem;
}

.section-heading-number {
  color: var(--blue);
  font-size: .72em;
  font-weight: 900;
  letter-spacing: .04em;
}

.section-heading-number::after { content: " –"; }

.lesson-section h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  line-height: 1.18;
  letter-spacing: -.025em;
}

.lesson-section p { margin: 0 0 1rem; }
.lesson-section p:last-child { margin-bottom: 0; }

.lesson-section ul {
  margin: 0;
  padding-left: 1.4rem;
}

.lesson-section li + li { margin-top: .45rem; }

.site-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: .5rem 1rem;
  padding: 1.5rem 0 2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .7rem;
  letter-spacing: .03em;
}

.site-footer-notice { text-align: center; }

.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-self: end;
  justify-content: flex-end;
  gap: .35rem .8rem;
}

.site-footer-links a { color: inherit; }

@media (max-width: 760px) {
  .day-header {
    align-items: flex-start;
    flex-direction: column;
    padding-block: .8rem;
  }

  .day-controls,
  .day-control,
  .day-control select { width: 100%; }

  .day-control-sections select { min-width: 0; }

  .lesson-section { scroll-margin-top: 9rem; }
  .day-main { scroll-margin-top: 9rem; }

  .site-footer {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .site-footer-links {
    justify-self: center;
    justify-content: center;
  }
}

@media (max-width: 460px) {
  main { width: min(100% - 1rem, var(--content)); }
  .toc-page { padding: 1.25rem; }
  .lesson-section { padding: 1.5rem 1.25rem; }
  .toc-link { grid-template-columns: 2.75rem minmax(0, 1fr); }
}

@media print {
  @page { size: A4; margin: 14mm; }

  body { background: #fff; }

  .site-header,
  .site-footer,
  .skip-link { display: none; }

  main {
    width: 100%;
    margin: 0;
  }

  .toc-page,
  .lesson-section {
    border: 0;
    box-shadow: none;
  }

  .toc-page {
    padding: 0;
    break-after: page;
  }

  .course-document {
    gap: 0;
    margin-top: 0;
  }

  .lesson-section {
    padding: 12mm 0;
    break-before: page;
  }

  .lesson-section p,
  .lesson-section li {
    orphans: 3;
    widows: 3;
  }

  a {
    color: inherit;
    text-decoration: none;
  }
}
