/* System fonts only: a SCORM package should work offline and behind an LMS's
   content policy, so nothing is fetched from a font CDN. */
:root {
  --paper: #faf8f4;
  --ink: #1d1d1b;
  --muted: #55554f;     /* 7.0:1 on paper */
  --accent: #1f5a4a;    /* 7.5:1 on paper */
  --accent-ink: #ffffff;
  --line: #d9d4c8;
  --tint: #eef3ef;
  --good: #1d6b3a;
  --bad: #a23a1f;
  --serif: Georgia, 'Iowan Old Style', 'Times New Roman', serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --measure: 40rem;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1.0625rem/1.65 var(--sans);
}

.skip {
  position: absolute; left: 1rem; top: -4rem;
  background: var(--ink); color: var(--paper); padding: .5rem 1rem; z-index: 10;
}
.skip:focus { top: .5rem; }

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

.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .75rem 1.5rem;
  border-bottom: 1px solid var(--line);
}
.course-title { margin: 0; font-size: .9375rem; color: var(--muted); letter-spacing: .01em; }

button { font: inherit; cursor: pointer; min-height: 44px; border-radius: 4px; }
.lang {
  background: transparent; color: var(--accent);
  border: 1.5px solid var(--accent); padding: .35rem 1rem; font-weight: 600;
}
.lang:hover { background: var(--tint); }

.progress { height: 3px; background: var(--line); }
.progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s ease; }

.layout {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  gap: 3rem;
  max-width: 68rem;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.toc summary { display: none; }
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: page; }
.toc .unit + .unit { margin-top: 1.25rem; }
.toc .unit-title { margin: 0 0 .25rem; font-size: .8125rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.toc li { counter-increment: page; }
.toc button {
  display: flex; gap: .75rem; width: 100%; text-align: left;
  background: none; border: 0; padding: .5rem 0; color: var(--muted);
}
.toc button::before { content: counter(page); font-variant-numeric: tabular-nums; min-width: 1.25rem; }
.toc button.visited::before { content: '✓'; color: var(--good); }
.toc button[aria-current='page'] { color: var(--ink); font-weight: 600; }
.toc button:hover { color: var(--ink); }

main { max-width: var(--measure); outline: none; }
h1 {
  font: 400 clamp(2rem, 4vw, 2.75rem)/1.15 var(--serif);
  margin: 0 0 1.5rem; outline: none;
}
article p, article ul { margin: 0 0 1.25rem; }
article h2 { font: 400 1.5rem/1.3 var(--serif); margin: 2.25rem 0 .75rem; }
.video { margin: 1.5rem 0 2rem; }
.video .frame { position: relative; aspect-ratio: 16 / 9; background: #111; border-radius: 4px; overflow: hidden; }
.video iframe, .video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video figcaption { margin-top: .5rem; color: var(--muted); font-size: .9375rem; }
article ul { padding-left: 1.25rem; }
article li { margin-bottom: .4rem; }

.callout {
  border-left: 3px solid var(--accent);
  background: var(--tint);
  padding: 1rem 1.25rem;
}

.question { border: 0; padding: 0; margin: 0 0 2.5rem; }
.question legend { font: 400 1.375rem/1.35 var(--serif); margin-bottom: 1rem; padding: 0; }
.option {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 1rem; margin-bottom: .5rem;
  border: 1px solid var(--line); border-radius: 4px; background: #fff; cursor: pointer;
}
.option input { width: 1.15rem; height: 1.15rem; accent-color: var(--accent); margin: 0; }
.option:has(input:checked) { border-color: var(--accent); }
.option.is-correct { border-color: var(--good); box-shadow: inset 3px 0 0 var(--good); }
.option.is-wrong { border-color: var(--bad); box-shadow: inset 3px 0 0 var(--bad); }
.option:has(input:disabled) { cursor: default; }
.feedback { margin: .75rem 0 0; font-weight: 600; outline: none; }
.feedback:empty { display: none; }
.feedback.good { color: var(--good); }
.feedback.bad { color: var(--bad); }
.result { font: 400 1.375rem/1.4 var(--serif); }

.primary, .secondary, .ghost { padding: .55rem 1.4rem; font-weight: 600; }
.primary { background: var(--accent); color: var(--accent-ink); border: 1.5px solid var(--accent); }
.primary:hover { background: #17463a; }
.secondary { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); margin-top: .5rem; }
.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }

.pager {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line);
}
.pager .count { color: var(--muted); font-size: .9375rem; }
.pager button[hidden] { display: inline-block; visibility: hidden; }

/* Phones: contents folds into a disclosure above the page. */
@media (max-width: 859px) {
  .bar { padding: .5rem 1rem; }
  .layout { grid-template-columns: 1fr; gap: 1.5rem; padding: 1.25rem 1rem 3rem; }
  .toc summary {
    display: block; cursor: pointer; color: var(--muted); font-size: .9375rem;
    padding: .6rem 0; min-height: 44px; border-bottom: 1px solid var(--line);
  }
  .toc ol { padding-top: .5rem; }
  .pager .count { display: none; }
}

@media (prefers-reduced-motion: no-preference) {
  article { animation: settle .35s ease-out both; }
  @keyframes settle { from { opacity: 0; transform: translateY(6px); } }
}
@media (prefers-reduced-motion: reduce) {
  .progress span { transition: none; }
}
