/* dbauer.physics.ucla.edu site theme.
 *
 * Plain CSS (no Sass) so it builds the same on GitHub Pages' Jekyll 3 and
 * local Jekyll 4. Colors are tokens on :root with a dark-mode set below;
 * every text/background pair meets WCAG 2.1 AA (most exceed 6:1). Check new
 * colors before adding them.
 */

/* ---------- Fonts (self-hosted, SIL OFL; see assets/fonts/OFL.txt) ---------- */

@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-latin-wght-italic.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("../fonts/source-sans-3-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */

:root {
  --font-body: "Source Serif 4", Georgia, Cambria, "Times New Roman", serif;
  --font-ui: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --bg: #ffffff;
  --surface: #f5f7fa;
  --ink: #16202c;          /* 16.4:1 on --bg */
  --muted: #4b5768;        /* 7.3:1 on --bg, 6.8:1 on --surface */
  --accent: #1a5a96;       /* links; 7.1:1 on --bg */
  --accent-strong: #0f3f6e;
  --accent-tint: #e8f0f8;  /* current-page background; --accent is 6.2:1 on it */
  --on-accent: #ffffff;
  --border: #d5dbe3;       /* decorative dividers only */
  --border-strong: #7a879a;/* 3.6:1: borders that mark a control */
  --gold: #ffd100;         /* decorative only */
  --focus: #1a5a96;

  --key-bg: #eef4fb;  --key-bar: #2774ae;  /* Key result */
  --chk-bg: #fdf6e9;  --chk-bar: #b26a00;  /* Check your understanding */
  --inf-bg: #eef7f5;  --inf-bar: #2f7d6d;  /* Quick refresher */
  --code-bg: #f1f3f6;
  --figure-bg: transparent;

  --radius: 6px;
  --measure: 44rem;
  --page-max: 86rem;
  --gutter: 1rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10161e;
    --surface: #17202b;
    --ink: #e6ebf1;          /* 15.2:1 */
    --muted: #a9b4c2;        /* 8.7:1 */
    --accent: #8cc4f5;       /* 9.8:1 */
    --accent-strong: #b5dafa;
    --accent-tint: #172f47;
    --on-accent: #10161e;
    --border: #2c3846;
    --border-strong: #6f7f93;
    --focus: #8cc4f5;

    --key-bg: #14263a;  --key-bar: #5aa3e0;
    --chk-bg: #2a2114;  --chk-bar: #e0a040;
    --inf-bg: #13292a;  --inf-bar: #56b39f;
    --code-bg: #1c2632;
    /* Figures are drawn for white paper; keep them on a white plate. */
    --figure-bg: #ffffff;
  }
}

@media (min-width: 40em) { :root { --gutter: 1.5rem; } }
@media (min-width: 75em) { :root { --gutter: 2rem; } }

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
}
@media (min-width: 48em) { body { font-size: 1.125rem; } }

body > main, body > .doc { flex: 1 0 auto; width: 100%; }

[id] { scroll-margin-top: 1.25rem; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-ui);
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
  font-variant-numeric: lining-nums;
  text-wrap: balance;
}
h1 { font-size: clamp(2rem, 1.6rem + 1.8vw, 2.75rem); font-weight: 700; letter-spacing: -0.02em; margin: 0; }
h2 { font-size: 1.625rem; margin: 2.75rem 0 0.75rem; }
h3 { font-size: 1.3rem; margin: 2rem 0 0.5rem; }
h4 { font-size: 1.1rem; margin: 1.5rem 0 0.5rem; }

p, ul, ol, dl, table, blockquote, pre, figure { margin: 0 0 1.15rem; }

a {
  color: var(--accent);
  text-decoration-line: underline;
  text-decoration-thickness: 0.07em;
  text-underline-offset: 0.18em;
}
a:hover { color: var(--accent-strong); text-decoration-thickness: 0.14em; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}
/* Programmatic focus targets (the skip link lands on <main>) need no ring. */
[tabindex="-1"]:focus { outline: none; }

strong, b { font-weight: 650; }

img, video { max-width: 100%; height: auto; }

hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }

::selection { background: var(--accent-tint); color: var(--ink); }

/* ---------- Skip link ---------- */

.skip-link {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: var(--on-accent);
  font: 600 1rem/1.2 var(--font-ui);
  border-radius: var(--radius);
  text-decoration: none;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; color: var(--on-accent); }

/* ---------- Masthead ---------- */

.masthead {
  border-top: 4px solid var(--accent);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  font-family: var(--font-ui);
}
.masthead__inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0.75rem var(--gutter);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 2rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.25rem 0;
  color: var(--ink);
  text-decoration: none;
}
.brand:hover { color: var(--ink); }
.brand__mark { width: 2.25rem; height: 2.25rem; flex: none; }
.brand__text { display: flex; flex-direction: column; line-height: 1.2; }
.brand__name { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.01em; }
.brand__sub { font-size: 0.875rem; font-weight: 500; color: var(--muted); }

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0 0 0 -0.75rem;
  padding: 0;
  list-style: none;
}
@media (min-width: 40em) { .site-nav ul { margin: 0 -0.75rem 0 0; } }
.site-nav a {
  display: block;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius);
  color: var(--ink);
  font-size: 1.0625rem;
  font-weight: 550;
  text-decoration: none;
}
.site-nav a:hover { background: var(--surface); color: var(--accent); }
.site-nav a.is-active { color: var(--accent); box-shadow: inset 0 -3px 0 var(--accent); border-radius: var(--radius) var(--radius) 0 0; }

/* ---------- Layout ---------- */

.doc {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
/* Pages without a sidebar: one centered reading column. */
.doc:not(.doc--course) { max-width: calc(var(--measure) + 2 * var(--gutter)); }

.doc__main { padding: 2.25rem 0 4rem; min-width: 0; }
.doc--course .doc__main { max-width: var(--measure); }

@media (min-width: 60em) {
  .doc--course {
    display: grid;
    grid-template-columns: 14.5rem minmax(0, 1fr);
    column-gap: clamp(2rem, 4vw, 3.5rem);
  }
  .doc--course .doc__main { padding-top: 2.75rem; }
}

@media (min-width: 75em) {
  .doc--toc .doc__main {
    display: grid;
    grid-template-columns: minmax(0, var(--measure)) 13.5rem;
    grid-template-areas: "header toc" "content toc" "pager toc";
    grid-template-rows: auto auto 1fr;
    column-gap: clamp(2rem, 3vw, 3rem);
    max-width: none;
  }
  .doc--toc .page-header { grid-area: header; }
  .doc--toc .page-content { grid-area: content; }
  .doc--toc .pager { grid-area: pager; align-self: start; }
  .doc--toc .toc { grid-area: toc; }
}

/* ---------- Page header ---------- */

.page-header { margin-bottom: 2rem; }
.page-header::after {
  content: "";
  display: block;
  width: 3rem;
  height: 4px;
  margin-top: 1.1rem;
  border-radius: 2px;
  background: var(--gold);
}
.eyebrow {
  margin: 0 0 0.5rem;
  font: 650 0.875rem/1.4 var(--font-ui);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-variant-numeric: lining-nums;
}
.eyebrow a { color: inherit; text-decoration-thickness: 1px; }
.eyebrow a:hover { color: var(--accent); }
.lede { font-size: 1.2rem; color: var(--muted); margin-top: 0.75rem; }
.lede p:last-child { margin-bottom: 0; }

/* ---------- Course sidebar ---------- */

.course-nav { font-family: var(--font-ui); padding-top: 1.5rem; }
.course-nav__title { margin: 0; font-size: 0.875rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.course-nav__title a { display: inline-block; padding: 0.3rem 0; color: var(--muted); text-decoration: none; }
.course-nav__title a:hover { color: var(--accent); text-decoration: underline; }
.course-nav__title a[aria-current="page"] { color: var(--accent); }

.course-nav__details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.4rem;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}
.course-nav__details > summary::-webkit-details-marker { display: none; }
.course-nav__details > summary::after {
  content: "";
  width: 0.5em;
  height: 0.5em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-25%) rotate(45deg);
}
.course-nav__details[open] > summary::after { transform: translateY(25%) rotate(-135deg); }

.course-nav__list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  border-left: 1px solid var(--border);
}
.course-nav__list a {
  display: flex;
  gap: 0.6rem;
  margin-left: -1px;
  padding: 0.32rem 0.75rem;
  border-left: 2px solid transparent;
  color: var(--ink);
  font-size: 0.975rem;
  line-height: 1.35;
  text-decoration: none;
}
.course-nav__list a:hover { color: var(--accent); border-left-color: var(--border-strong); }
.course-nav__list a[aria-current="page"] {
  color: var(--accent);
  font-weight: 650;
  border-left-color: var(--accent);
  background: var(--accent-tint);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.course-nav__num {
  flex: none;
  min-width: 1.4em;
  text-align: right;
  color: var(--muted);
  font-variant-numeric: tabular-nums lining-nums;
}
a[aria-current="page"] .course-nav__num { color: inherit; }

@media (max-width: 59.99em) {
  .course-nav { padding-bottom: 0.25rem; }
  /* The page eyebrow links to the course home on small screens. */
  .course-nav__title { display: none; }
  /* Until site.js runs, keep the list collapsed on small screens (no flash). */
  .js .course-nav__details:not([data-ready]) > :not(summary) { display: none; }
}
@media (min-width: 60em) {
  .course-nav {
    position: sticky;
    top: 0;
    align-self: start;
    max-height: 100vh;
    overflow-y: auto;
    padding: 2.75rem 0.25rem 2rem 0;
  }
  .course-nav__details > summary { display: none; }
}

/* ---------- On this page ---------- */

.toc {
  margin: 0 0 2rem;
  font-family: var(--font-ui);
  font-size: 0.95rem;
}
.toc details {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
}
.toc summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.9rem;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after {
  content: "";
  width: 0.45em;
  height: 0.45em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-25%) rotate(45deg);
}
.toc details[open] > summary::after { transform: translateY(25%) rotate(-135deg); }
.toc ul { list-style: none; margin: 0; padding: 0 0.9rem 0.75rem; }
.toc ul ul { padding: 0 0 0 0.9rem; }
.toc a {
  display: block;
  padding: 0.28rem 0;
  color: var(--ink);
  line-height: 1.35;
  text-decoration: none;
}
.toc a:hover { color: var(--accent); text-decoration: underline; }
.toc a[aria-current="location"] { color: var(--accent); font-weight: 650; }

@media (max-width: 74.99em) {
  .js .toc details:not([data-ready]) > :not(summary) { display: none; }
}
@media (min-width: 75em) {
  .toc {
    position: sticky;
    top: 0;
    align-self: start;
    max-height: 100vh;
    overflow-y: auto;
    margin: 0;
    padding: 0.4rem 0 2rem;
  }
  .toc details { border: 0; background: none; }
  .toc summary {
    padding: 0 0 0.6rem;
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
  }
  .toc summary::after { display: none; }
  .toc ul { padding: 0; border-left: 1px solid var(--border); }
  .toc ul ul { padding: 0; }
  .toc a { margin-left: -1px; padding: 0.28rem 0.75rem; border-left: 2px solid transparent; }
  .toc ul ul a { padding-left: 1.5rem; font-size: 0.9rem; }
  .toc a[aria-current="location"] { border-left-color: var(--accent); }
}

/* ---------- Content ---------- */

.page-content > :first-child,
.page-content > noscript:first-child + * { margin-top: 0; }
.page-content h2 + p, .page-content h3 + p { margin-top: 0; }

.page-content ul:not([class]), .page-content ol:not([class]) { padding-left: 1.4em; }
.page-content :is(ul, ol):not([class]) > li { margin: 0.3rem 0; }
.page-content li > p { margin-bottom: 0.5rem; }
.page-content li::marker { color: var(--muted); }

blockquote {
  margin-left: 0;
  padding: 0.25rem 0 0.25rem 1.25rem;
  border-left: 3px solid var(--border-strong);
  color: var(--muted);
}

code, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--code-bg);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}
pre {
  overflow-x: auto;
  padding: 1rem 1.25rem;
  background: var(--code-bg);
  border-radius: var(--radius);
  line-height: 1.5;
}
pre code { padding: 0; background: none; }

/* Figures */
.page-content img {
  background: var(--figure-bg);
  border-radius: var(--radius);
}
.align-center { display: block; margin: 1.75rem auto; }
.align-left { float: left; margin: 0.25rem 1.5rem 1rem 0; }
.align-right { float: right; margin: 0.25rem 0 1rem 1.5rem; }
@media (prefers-color-scheme: dark) {
  .page-content img { padding: 0.5rem; }
}
@media (max-width: 40em) {
  /* Figures sized as a percentage on desktop would be tiny on a phone. */
  .page-content img[width] { width: auto; }
}

/* Display math: scroll sideways instead of widening the page (WCAG 1.4.10).
   site.js gives overflowing equations tabindex="0" so keyboards can scroll. */
mjx-container[display="true"] {
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  padding: 0.15em 0;
}

/* Edge shadows show that a box scrolls; they fade as you reach each end. */
mjx-container[data-scrolls], .table-wrap[data-scrolls] {
  background:
    linear-gradient(to right, var(--scroll-bg, var(--bg)) 30%, transparent) left / 2rem 100% no-repeat local,
    linear-gradient(to left, var(--scroll-bg, var(--bg)) 30%, transparent) right / 2rem 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgb(0 0 0 / 0.3), transparent) left / 0.75rem 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgb(0 0 0 / 0.3), transparent) right / 0.75rem 100% no-repeat scroll;
}
@media (prefers-color-scheme: dark) {
  mjx-container[data-scrolls], .table-wrap[data-scrolls] {
    background:
      linear-gradient(to right, var(--scroll-bg, var(--bg)) 30%, transparent) left / 2rem 100% no-repeat local,
      linear-gradient(to left, var(--scroll-bg, var(--bg)) 30%, transparent) right / 2rem 100% no-repeat local,
      radial-gradient(farthest-side at 0 50%, rgb(140 196 245 / 0.35), transparent) left / 0.75rem 100% no-repeat scroll,
      radial-gradient(farthest-side at 100% 50%, rgb(140 196 245 / 0.35), transparent) right / 0.75rem 100% no-repeat scroll;
  }
}

/* Tables (site.js wraps each in .table-wrap) */
.table-wrap { overflow-x: auto; margin: 1.5rem 0; }
.page-content table {
  border-collapse: collapse;
  font-family: var(--font-ui);
  font-size: 0.975rem;
  font-variant-numeric: tabular-nums lining-nums;
  line-height: 1.4;
}
.table-wrap > table { margin: 0; }
.page-content th, .page-content td {
  padding: 0.5rem 0.9rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.page-content thead th {
  font-weight: 650;
  border-bottom: 2px solid var(--border-strong);
  background: var(--surface);
}

/* Notices: kramdown {: .notice--primary} etc. Full-size text, always. */
.notice, .notice--primary, .notice--info, .notice--warning,
.notice--success, .notice--danger, .notice--js {
  --n-bg: var(--surface);
  --n-bar: var(--border-strong);
  --scroll-bg: var(--n-bg);
  margin: 1.75rem 0;
  padding: 1rem 1.25rem;
  font-size: 1em;
  background: var(--n-bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--n-bar);
  border-radius: var(--radius);
}
.notice--primary { --n-bg: var(--key-bg); --n-bar: var(--key-bar); }
.notice--warning, .notice--js { --n-bg: var(--chk-bg); --n-bar: var(--chk-bar); }
.notice--info, .notice--success { --n-bg: var(--inf-bg); --n-bar: var(--inf-bar); }
[class*="notice"] > :first-child { margin-top: 0; }
[class*="notice"] > :last-child { margin-bottom: 0; }
[class*="notice"] > strong:first-child,
[class*="notice"] > p:first-child > strong:first-child {
  font-family: var(--font-ui);
  font-weight: 700;
}

/* Expandable answers and solutions */
.page-content details {
  margin: 1.25rem 0 1.75rem;
  padding: 0 1.1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
}
.page-content details > summary {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 -1.1rem;
  padding: 0.65rem 1.1rem;
  font-family: var(--font-ui);
  color: var(--accent);
  cursor: pointer;
  list-style: none;
  border-radius: var(--radius);
}
.page-content details > summary::-webkit-details-marker { display: none; }
.page-content details > summary::before {
  content: "";
  flex: none;
  width: 0.45em;
  height: 0.45em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
}
.page-content details[open] > summary::before { transform: translateY(-20%) rotate(45deg); }
.page-content details > summary:hover { background: var(--surface); }
.page-content details[open] > summary {
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
}
.page-content details > :last-child:not(summary) { margin-bottom: 1.1rem; }

/* ---------- Lists of pages ---------- */

.chapter-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  font-family: var(--font-ui);
  border-top: 1px solid var(--border);
}
.chapter-list li { margin: 0; border-bottom: 1px solid var(--border); }
.chapter-list a {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.7rem 0.5rem;
  color: var(--ink);
  text-decoration: none;
}
.chapter-list a:hover { background: var(--surface); color: var(--accent); }
.chapter-list__num {
  flex: none;
  width: 1.75rem;
  text-align: right;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums lining-nums;
}
.chapter-list__title { font-size: 1.075rem; font-weight: 550; }

.entry-list { list-style: none; margin: 1rem 0 0; padding: 0; font-family: var(--font-ui); }
.entry-list li { margin: 0; padding: 0.7rem 0; border-bottom: 1px solid var(--border); }
.entry-list li:first-child { border-top: 1px solid var(--border); }
.entry-list a { font-size: 1.1rem; font-weight: 600; text-decoration: none; }
.entry-list a:hover { text-decoration: underline; }
.entry-list p { margin: 0.2rem 0 0; color: var(--muted); }

.cards {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
}
.card { margin: 0; }
.card a {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.25rem 1.25rem 1.1rem;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.card a:hover { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.card__code { font-size: 0.875rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.card__title { margin: 0.35rem 0 1.25rem; font-size: 1.2rem; font-weight: 650; line-height: 1.3; }
.card__meta { margin-top: auto; font-size: 0.9375rem; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .card a { transition: none; } }

/* ---------- Pager ---------- */

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  font-family: var(--font-ui);
}
.pager__link {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--ink);
  text-decoration: none;
}
.pager__link:hover { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); color: var(--ink); }
.pager__link--next { grid-column: 2; text-align: right; }
.pager__dir { font-size: 0.875rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.pager__title { color: var(--accent); font-weight: 600; line-height: 1.3; }
@media (max-width: 30em) {
  .pager { grid-template-columns: 1fr; }
  .pager__link--next { grid-column: auto; }
}

/* ---------- Home ---------- */

.home {
  max-width: calc(64rem + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter) 4rem;
}
.hero { padding: 3.5rem 0 2.75rem; }
.hero h1 { font-size: clamp(1.875rem, 1.6rem + 1.2vw, 2.375rem); font-weight: 650; margin: 0.25rem 0 0; }
.hero h1::after {
  content: "";
  display: block;
  width: 3.5rem;
  height: 5px;
  margin-top: 1.25rem;
  border-radius: 3px;
  background: var(--gold);
}
.hero .lede { max-width: 38rem; margin-top: 1.25rem; font-size: 1.25rem; }
.byline { margin: 1rem 0 0; font: 500 0.95rem/1.4 var(--font-ui); color: var(--muted); }

.home-section { padding: 2.25rem 0 0.5rem; }
.home-section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
}
.home-section h2 { margin: 0; font-size: 1.5rem; }
.home-section__head a { font-family: var(--font-ui); font-weight: 600; }

/* ---------- Footer ---------- */

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.95rem;
}
.site-footer__inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 1.75rem var(--gutter);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 2rem;
}
.site-footer p { margin: 0; }
.site-footer__links { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; margin: 0; padding: 0; list-style: none; }
.site-footer a { color: var(--muted); display: inline-block; padding: 0.2rem 0; }
.site-footer a:hover { color: var(--accent); }

/* ---------- Print ---------- */

@media print {
  :root { --ink: #000; --muted: #333; --accent: #000; --bg: #fff; --surface: #fff; --figure-bg: transparent; }
  body { font-size: 11pt; }
  .skip-link, .site-nav, .course-nav, .toc, .pager, .site-footer { display: none !important; }
  .masthead { border: 0; }
  .doc, .doc__main { display: block !important; max-width: none !important; padding: 0 !important; }
  .page-header::after { display: none; }
  a { text-decoration: none; }
  [class*="notice"], details, img, table, mjx-container { break-inside: avoid; }
}
