/* Shared ivory, sage and forest-green theme for the course website. */

@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #fbfaf6;
  --card: #fff;
  --ink: #173b2f;
  --ink-soft: #314b40;
  --dim: #506658;
  --line: #cbd6cb;
  --line-soft: #e0e7dd;
  --mint: #dfecdc;
  --mint-soft: #f0f4ed;
  --teal: #246346;
  --teal-deep: #13462f;
  --focus: #23674c;
  --night: #133d30;
  --on-night: #f6faf3;
  --on-night-dim: #d4e4d6;
  --glow: #cee6c8;
  --glow-soft: #edf8e7;
  --radius: 16px;
  --shadow-sm: 0 1px 2px rgba(17, 42, 35, .05), 0 3px 10px rgba(17, 42, 35, .05);
  --shadow: 0 1px 2px rgba(17, 42, 35, .06), 0 18px 40px -14px rgba(17, 42, 35, .22);
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 64px;
  --ease: cubic-bezier(.2, .75, .2, 1);
}

/* ------------------------------------------------------------------ base */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal); text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: var(--teal-deep); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
.on-dark :focus-visible { outline-color: var(--glow-soft); }
main:focus { outline: none; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.15; letter-spacing: -.025em; font-weight: 680; color: var(--ink); text-wrap: balance; }
p { margin: 0 0 1em; }
code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .86em; background: var(--mint); padding: .1em .35em; border-radius: 5px; }
.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.icon { width: 24px; height: 24px; flex: none; }

.skip {
  position: absolute; left: 12px; top: -64px; z-index: 100;
  background: var(--glow); color: var(--night); padding: 10px 16px; border-radius: 10px;
  font-weight: 600; text-decoration: none; transition: top .2s;
}
.skip:focus { top: 12px; color: var(--night); }

.on-dark { color: var(--on-night); }
.on-dark h1, .on-dark h2, .on-dark h3 { color: #fff; }
.on-dark a:not(.btn) { color: var(--glow-soft); }
.on-dark a:not(.btn):hover { color: #fff; }

/* Sections with layered backgrounds keep their artwork inside the section. */
.hero, .band, .lab-teaser, .cta-card, .site-footer { position: relative; isolation: isolate; overflow: hidden; }
.lab-teaser, .site-footer { background: var(--night); }

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

.site-header {
  position: sticky; top: 0; z-index: 50; background: var(--night); border-bottom: 1px solid #395c49;
  transition: box-shadow .3s;
}
.site-header.is-scrolled { box-shadow: 0 3px 12px rgb(19 61 48 / 12%); }
.site-header :focus-visible { outline-color: var(--glow-soft); }
.site-header__row { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--on-night); text-decoration: none; font-weight: 680; font-size: 17px; letter-spacing: -.02em; white-space: nowrap; }
.brand:hover { color: #fff; }
.on-dark .brand, .on-dark .brand:hover { color: #fff; }
.brand-mark {
  width: 34px; height: 34px; flex: none; border-radius: 9px; background: #214d3e;
  display: flex; align-items: center; justify-content: center; gap: 3px; overflow: hidden;
  border: 1px solid #698b73;
}
.brand-mark i { display: block; width: 3px; height: 12px; background: var(--glow); transform: skew(-21deg); }
.brand-mark i:nth-child(2) { height: 19px; }
.brand-mark i:nth-child(3) { height: 25px; }
.site-nav ul { display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; list-style: none; }
.site-nav a {
  display: block; padding: 8px 14px; border-radius: 999px; color: var(--on-night-dim);
  text-decoration: none; font-size: 15px; font-weight: 560; transition: color .2s, background .2s;
}
.site-nav a:hover { color: #fff; background: rgba(255, 255, 255, .07); }
.site-nav a[aria-current="page"] { color: #fff; background: #315a46; }
.site-nav .nav-cta-item { margin-left: 8px; }
.site-nav a.nav-cta { background: var(--glow); color: var(--night); font-weight: 650; }
.site-nav a.nav-cta:hover { background: var(--glow-soft); color: var(--night); }

/* ------------------------------------------------------------------ buttons and labels */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: 12px 20px; border-radius: 12px; border: 1px solid transparent;
  font: inherit; font-size: 16px; font-weight: 620; line-height: 1.2; text-decoration: none; cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .2s, background .2s, color .2s, border-color .2s;
}
.btn--lg { padding: 15px 24px; font-size: 17px; border-radius: 14px; }
.btn--block { display: flex; width: 100%; }
.btn--primary { background: var(--teal); color: #fff; }
.btn--primary:hover { background: var(--teal-deep); color: #fff; transform: translateY(-1px); }
.on-dark .btn--primary { background: var(--glow); color: var(--night); }
.on-dark .btn--primary:hover { background: var(--glow-soft); color: var(--night); }
.btn--ghost { background: var(--card); color: var(--teal-deep); border-color: #748a79; }
.btn--ghost:hover { background: var(--mint); color: var(--teal-deep); border-color: var(--teal); }
.btn--outline { background: var(--card); color: var(--teal); border-color: var(--line); }
.btn--outline:hover { border-color: var(--teal); color: var(--teal-deep); transform: translateY(-1px); }
.btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; }
.btn__arrow { transition: transform .25s var(--ease); }
.btn:hover .btn__arrow { transform: translateX(3px); }
.arrow-link { font-weight: 620; text-decoration: none; }
.arrow-link:hover { text-decoration: underline; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 14px;
  font-size: 12px; font-weight: 720; letter-spacing: .14em; text-transform: uppercase; color: var(--teal);
}
.eyebrow::before { content: ""; width: 22px; height: 2px; border-radius: 2px; background: currentColor; opacity: .7; }
.on-dark .eyebrow { color: var(--glow-soft); }
.eyebrow--chip { padding: 7px 14px; border-radius: 999px; background: rgba(69, 196, 166, .1); box-shadow: inset 0 0 0 1px rgba(69, 196, 166, .32); letter-spacing: .1em; }
.eyebrow--chip::before { display: none; }

.pill { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px 4px 9px; border-radius: 999px; font-size: 13px; font-weight: 640; line-height: 1.3; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill--available { background: var(--mint); color: var(--teal-deep); }
.pill--coming-soon { background: #eef1ef; color: #55665f; }
.pill--coming-soon::before { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; }
.on-dark .pill--available { background: rgba(69, 196, 166, .16); color: var(--glow-soft); }
.on-dark .pill--coming-soon { background: rgba(255, 255, 255, .08); color: var(--on-night-dim); }

/* ------------------------------------------------------------------ placeholders (visible on purpose) */

.fill {
  background: #fff3d1; color: #5a4313; border: 1px dashed #b7862a; border-radius: 6px;
  padding: .04em .4em; font-size: .9em; font-weight: 500; letter-spacing: 0; line-height: 1.55;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.fill::before { content: "FILL"; margin-right: .55em; font-size: .7em; font-weight: 780; letter-spacing: .1em; color: #9a6c13; }
.fill--instructor { background: #efe9ff; color: #3d2a73; border-color: #7a5cc4; }
.fill--instructor::before { content: "INSTRUCTOR"; color: #6346b0; }
.on-dark .fill { background: rgba(255, 206, 110, .12); color: #ffe2a3; border-color: rgba(255, 206, 110, .55); }
.on-dark .fill::before { color: #f5c56a; }
.on-dark .fill--instructor { background: rgba(190, 170, 255, .13); color: #e2d9ff; border-color: rgba(190, 170, 255, .55); }
.on-dark .fill--instructor::before { color: #c5b4ff; }
.link-unset { text-decoration: underline dotted; cursor: not-allowed; }

/* ------------------------------------------------------------------ home: hero */

.hero {
  padding: clamp(28px, 4vw, 56px) 0 clamp(28px, 4vw, 52px); border-bottom: 1px solid var(--line);
  background: linear-gradient(105deg, #e7eee1, #f5f6ee 82%);
}
.hero__intro {
  display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  gap: clamp(12px, 2vw, 32px); align-items: center;
}
.hero__model {
  position: relative; width: 100%; height: auto; aspect-ratio: 74 / 45;
  mix-blend-mode: multiply; filter: brightness(1.14);
}
.hero__model > img { display: block; width: 100%; height: auto; aspect-ratio: 74 / 45; }
img.hero__model, .hero__model > img, .hero__model > .home-vehicle-stage {
  mask-image: linear-gradient(to right, transparent, black 4%, black 98%, transparent),
              linear-gradient(to bottom, transparent, black 5%, black 98%, transparent);
  mask-composite: intersect;
}
.hero__title { font-size: clamp(54px, 6.8vw, 92px); line-height: 1.04; letter-spacing: -.055em; font-weight: 620; margin: 0 0 18px; }
.hero__lead { margin: 0; max-width: 40ch; font-size: clamp(18px, 1.6vw, 22px); line-height: 1.5; color: var(--ink-soft); text-wrap: balance; }
.pace-features {
  --picture-width: 128px;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px;
  margin-block: clamp(18px, 2.5vw, 34px) 0; padding: 0; list-style: none;
}
.pace-features li {
  display: flex; min-width: 0; isolation: isolate; border: 1px solid var(--line);
  border-radius: 12px; background: var(--card);
}
/* Course illustrations follow the feature order in home.md. */
.pace-features li:nth-child(1) {
  --picture: url("../img/feature-chassis.webp");
}
.pace-features li:nth-child(2) {
  --picture: url("../img/feature-friction-circle.svg");
}
.pace-features li:nth-child(3) {
  --picture: url("../img/feature-steering.webp");
}
.pace-features li:nth-child(4) {
  --picture: url("../img/feature-suspension.svg");
}
.pace-features li > :is(a, strong) {
  position: relative; flex: 1; min-width: 0; display: flex; align-items: center; min-height: calc(var(--picture-width) * .75);
  padding: 6px 18px 6px calc(var(--picture-width) + 10px);
  border-radius: inherit; color: var(--ink); text-decoration: none;
  font-size: 16px; font-weight: 650; line-height: 1.3; letter-spacing: -.02em;
}
.pace-features li > :is(a, strong)::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: var(--picture-width); border-radius: 11px 0 0 11px;
  background: var(--mint-soft) var(--picture) center / cover no-repeat;
}
.pace-features li > strong { padding-right: 10px; }
.pace-features a::after {
  content: ""; position: absolute; right: 8px; top: 50%; width: 5px; height: 5px;
  border: solid var(--teal); border-width: 1.5px 1.5px 0 0; transform: translateY(-50%) rotate(45deg);
}
.pace-features li:has(a:is(:hover, :focus-visible)) { border-color: var(--teal); background: var(--mint-soft); }
.pace-features li > a:is(:hover, :focus-visible) { color: var(--teal-deep); }

/* ------------------------------------------------------------ home: curriculum */

.curriculum { padding-top: clamp(52px, 6vw, 88px); }
.curriculum__head { display: flex; align-items: center; gap: clamp(18px, 3vw, 42px); margin-bottom: clamp(24px, 3.5vw, 44px); }
.curriculum__head::after { content: ""; flex: 1; height: 1px; background: linear-gradient(to right, var(--teal) 0 2.5rem, var(--line) 2.5rem); }
.curriculum__head h2 { margin: 0; font-size: clamp(30px, 3.5vw, 48px); font-weight: 610; letter-spacing: -.05em; }

.module-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(14px, 2vw, 24px);
}
.course-module {
  --module-pad: clamp(22px, 2.6vw, 34px);
  position: relative; display: grid; grid-template-rows: subgrid; grid-row: span 4; align-items: start;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px; padding: var(--module-pad) 0 0; min-width: 0; overflow: hidden;
  border: 1px solid var(--line); border-radius: 14px; background: var(--card);
  color: var(--ink); text-decoration: none; scroll-margin-top: 12px;
}
.course-module:is(:hover, :focus-visible) { border-color: var(--teal); background: var(--mint-soft); }
.course-module__number {
  display: flex; align-items: center; gap: 10px; padding-right: 40px;
  color: var(--teal); font-size: 16px; font-weight: 700; line-height: 1.4;
  letter-spacing: .1em; text-transform: uppercase;
}
.course-module__number::before { content: ""; width: 22px; height: 2px; background: currentColor; }
.course-module h3 {
  margin: 0; font-size: clamp(26px, 2.35vw, 36px); line-height: 1.13; letter-spacing: -.04em;
}
.course-module__level {
  margin: 0; padding-top: 4px; color: var(--ink-soft); font-size: 16px; line-height: 1.5;
}
.course-module__level > em {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px 10px; margin-bottom: 6px;
  font-size: 18px; font-style: normal; line-height: 1.45;
}
.course-module__level strong {
  padding: 2px 9px; border-radius: 5px; background: var(--mint); color: var(--teal-deep);
  font-weight: 650;
}
.course-module__picture {
  display: block; width: 100%; aspect-ratio: 800 / 415; overflow: hidden;
}
.course-module > :is(.course-module__number, h3, .course-module__level) { margin-inline: var(--module-pad); }
.course-module__picture img { width: 100%; height: 100%; object-fit: cover; }
/* The background continues the render's own at its two side edges, top to bottom (tools/make_car_pictures.mjs). */
#module-1 .course-module__picture { position: relative; background: linear-gradient(#e2e2e0, #dddeda 50%, #e0e1dc); }
#module-1 .course-module__picture > img {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: auto; height: 100%; object-fit: contain;
}
#module-1 .course-module__picture > img, .home-vehicle-stage .vp-image {
  mask-image: linear-gradient(to right, transparent, black 4%, black 96%, transparent);
}
/* Frame the front axle inside the lab capture, below the toolbar and left of the readout. */
.course-module__picture--axle img {
  width: calc(100% * 800 / 515); height: auto; max-width: none;
  transform: translate(-5%, -29%);
}
.course-module__arrow {
  position: absolute; right: clamp(22px, 2.6vw, 34px); top: clamp(22px, 2.6vw, 34px);
  color: var(--teal); font-size: 23px; line-height: 1;
}
.home-resources { margin-top: clamp(44px, 6vw, 80px); }

@media (max-width: 640px) {
  .module-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ------------------------------------------------------------------ sections */

.section { padding: clamp(56px, 8vw, 112px) 0; }
.section--tight { padding: clamp(40px, 6vw, 72px) 0; }
.section--tint { background: linear-gradient(180deg, var(--mint-soft), var(--paper)); border-top: 1px solid var(--line-soft); }
.section__head { max-width: 46rem; margin-bottom: clamp(28px, 4vw, 48px); }
.section__head h2 { font-size: clamp(28px, 3.2vw, 42px); letter-spacing: -.035em; }
.section__head p:not(.eyebrow) { color: var(--dim); font-size: 18px; margin: 0; }
.section__head--split { max-width: none; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.section__head--split h2 { margin: 0; }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 0; padding: 0; list-style: none; }
.step { position: relative; padding: 30px 28px 28px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.step .icon { width: 46px; height: 46px; padding: 11px; border-radius: 14px; color: var(--teal); background: linear-gradient(135deg, #e1f1e9, #f2f8f4); box-shadow: inset 0 0 0 1px #cfe3d9; }
.step h3 { font-size: 21px; margin: 18px 0 8px; }
.step p { margin: 0; color: var(--dim); font-size: 16px; }

.home-feature {
  display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); align-items: center;
  overflow: hidden;
  border: 1px solid var(--line); border-radius: 14px; background: var(--card);
}
.home-feature--sim { background: var(--mint-soft); }
.home-feature__media {
  display: block; width: 100%; height: auto;
  border: 0;
}
.home-feature__copy { margin: 0; padding: clamp(20px, 2.15vw, 32px) clamp(22px, 3vw, 40px); list-style: none; }
.home-feature__copy > .step { padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.home-feature__copy .icon { display: none; }
.home-feature__copy h3, .home-feature__copy p > strong:first-child {
  display: block; margin: 0 0 15px; color: var(--ink); font-size: clamp(26px, 2.4vw, 35px);
  line-height: 1.12; letter-spacing: -.04em; font-weight: 680; text-wrap: balance;
}
.home-feature__copy p { max-width: 62ch; margin: 0; color: var(--ink-soft); font-size: 17px; }
.home-feature__copy a { display: block; width: fit-content; margin-top: 18px; font-weight: 660; }

@media (max-width: 1150px) {
  .home-feature { grid-template-columns: minmax(0, 1fr); }
}

.parts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.part-col { padding: 24px 20px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.part-col__num { margin: 0 0 6px; font-size: 12px; font-weight: 720; letter-spacing: .14em; text-transform: uppercase; color: var(--teal); }
.part-col__title { font-size: 20px; margin: 0 0 12px; }
.part-col__title a { color: var(--ink); text-decoration: none; }
.part-col__title a:hover { color: var(--teal); }
.part-col__list { margin: 0; padding: 0; list-style: none; }
.part-col__list li + li { border-top: 1px solid var(--line-soft); }
.part-col__list a { display: grid; grid-template-columns: 26px minmax(0, 1fr) 10px; align-items: baseline; gap: 8px; padding: 10px 0; color: var(--ink-soft); text-decoration: none; font-size: 15px; line-height: 1.4; }
.part-col__list a:hover .t { color: var(--teal); text-decoration: underline; }
.part-col__list .n { font-weight: 700; color: var(--teal); font-variant-numeric: tabular-nums; }
.dot { width: 8px; height: 8px; border-radius: 50%; align-self: center; }
.dot.is-available { background: var(--teal); box-shadow: 0 0 0 3px var(--mint); }
.dot.is-coming-soon { box-shadow: inset 0 0 0 1.5px #9fb0a9; }

.lab-teaser__grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); align-items: center; gap: clamp(32px, 5vw, 72px); }
.lab-teaser h2 { font-size: clamp(30px, 3.4vw, 46px); letter-spacing: -.04em; }
.lab-teaser__text { color: var(--on-night-dim); font-size: 18px; }
.ticks { display: grid; gap: 10px; margin: 22px 0 30px; padding: 0; list-style: none; }
.ticks li { display: flex; align-items: center; gap: 12px; font-weight: 560; }
.ticks .icon { width: 26px; height: 26px; padding: 5px; border-radius: 50%; color: var(--night); background: var(--glow); }
.collage { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; transform: perspective(1800px) rotateY(-7deg) rotateX(2deg); }
.collage img { width: 100%; border-radius: 14px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .12), 0 30px 60px -24px rgba(0, 0, 0, .8); }
.collage__img--1 { grid-column: 1 / -1; }

.duo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.author-card, .cta-card { padding: clamp(28px, 4vw, 48px); border: 1px solid var(--line); border-radius: 14px; }
.author-card { background: var(--card); }
.author-card h2, .cta-card h2 { font-size: clamp(26px, 2.6vw, 34px); letter-spacing: -.035em; }
.author-card p:not(.eyebrow) { color: var(--dim); }
.cta-card { background: var(--mint-soft); }
.cta-card p { color: var(--ink-soft); }

/* ------------------------------------------------------------------ inner page title bands */

.band {
  padding: clamp(48px, 7vw, 96px) 0 clamp(44px, 6vw, 80px);
  background: linear-gradient(105deg, #e7eee1, #f5f6ee 82%); border-bottom: 1px solid var(--line);
}
.band--compact { padding: clamp(44px, 6vw, 80px) 0 clamp(36px, 5vw, 60px); }
.band__inner { position: relative; }
.band__title { font-size: clamp(34px, 4.4vw, 58px); font-weight: 620; line-height: 1.06; letter-spacing: -.045em; max-width: 17em; margin: 0 0 18px; }
.band--compact .band__title { font-size: clamp(32px, 3.8vw, 50px); }
.band__lead { font-size: clamp(17px, 1.4vw, 19px); color: var(--ink-soft); max-width: 40em; }
.band__updated { font-size: 14px; color: var(--dim); margin: 0; }
.band__chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; padding: 0; list-style: none; }
.band__chips li { padding: 6px 13px; border-radius: 999px; font-size: 14px; color: var(--ink-soft); background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
.band__chips strong { color: var(--ink); font-weight: 700; }
.band__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.band__meta .band__chips { margin: 0; }
.band__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.band__numeral {
  position: absolute; right: max(var(--gutter), (100% - var(--wrap)) / 2); bottom: -.2em; z-index: -1;
  font-size: clamp(170px, 26vw, 360px); font-weight: 800; line-height: 1; letter-spacing: -.07em;
  color: transparent; -webkit-text-stroke: 1.5px #cbd9c7; user-select: none;
}
.band--chapter .band__inner > * { max-width: 62%; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 22px; font-size: 14px; color: var(--dim); }
.crumbs a { color: var(--teal); text-decoration: none; }
.crumbs a:hover { color: var(--teal-deep); text-decoration: underline; }

/* ------------------------------------------------------------------ the class */

.offer { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: clamp(48px, 6vw, 80px); }
.offer__tile { padding: 24px 24px 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.offer__tile--lead { background: var(--mint-soft); border-color: var(--line); }
.offer__label { margin: 0 0 6px; font-size: 12px; font-weight: 720; letter-spacing: .14em; text-transform: uppercase; color: var(--teal); }
.offer__big { margin: 0 0 8px; font-size: 30px; font-weight: 740; letter-spacing: -.035em; line-height: 1.15; color: var(--ink); }
.offer__big .fill { font-size: 13px; letter-spacing: 0; vertical-align: middle; }
.offer__tile p:last-of-type { margin: 0; color: var(--dim); font-size: 15px; }
.offer__link { display: inline-block; margin-top: 10px; font-size: 15px; }

.part { margin-bottom: clamp(48px, 6vw, 80px); }
.part__head { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: end; gap: 10px 28px; margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.part__num { margin: 0; display: flex; flex-direction: column; font-size: 12px; font-weight: 720; letter-spacing: .14em; text-transform: uppercase; color: var(--teal); line-height: 1.2; }
.part__num span { margin-top: 2px; font-size: 64px; font-weight: 800; letter-spacing: -.04em; line-height: 1.2; color: transparent; -webkit-text-stroke: 1.5px var(--teal); }
.part__title { font-size: clamp(26px, 2.8vw, 36px); letter-spacing: -.035em; margin: 0 0 4px; }
.part__blurb { margin: 0; color: var(--dim); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 18px; margin: 0; padding: 0; list-style: none; }
.card { position: relative; isolation: isolate; overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); transition: transform .3s var(--ease), box-shadow .3s, border-color .3s; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--teal); }
.card:focus-within { border-color: var(--teal); box-shadow: var(--shadow), 0 0 0 3px rgba(37, 130, 105, .25); }
.chapter-card { display: flex; flex-direction: column; min-height: 232px; padding: 24px 24px 18px; }
.chapter-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.chapter-card__num {
  margin: -6px -2px 0 0; font-size: 54px; font-weight: 800; line-height: .9; letter-spacing: -.06em;
  color: transparent; -webkit-text-stroke: 1.5px #c3dacf; transition: -webkit-text-stroke-color .35s, transform .5s var(--ease);
}
.card:hover .chapter-card__num { -webkit-text-stroke-color: var(--teal); transform: translateY(2px); }
.chapter-card__kicker { margin: 4px 0 0; font-size: 12px; font-weight: 720; letter-spacing: .14em; text-transform: uppercase; color: var(--teal); }
.chapter-card__title { font-size: 21px; line-height: 1.25; margin: 0 0 10px; }
.chapter-card__title a { color: var(--ink); text-decoration: none; }
.chapter-card__title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.chapter-card__title a:focus-visible { outline: none; }
.chapter-card__teaser { margin: 0 0 18px; color: var(--dim); font-size: 15px; line-height: 1.55; }
.chapter-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: auto 0 0; padding-top: 14px; border-top: 1px solid var(--line-soft); font-size: 14px; }
.chapter-card__more { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-left: auto; }
.chapter-card__notes, .chapter-card__lab { display: inline-flex; align-items: center; gap: 6px; color: var(--teal); font-weight: 600; }
.chapter-card__notes .icon, .chapter-card__lab .icon { width: 18px; height: 18px; }

/* ------------------------------------------------------------------ chapter page */

.draft-note { background: repeating-linear-gradient(-45deg, #fff3d1 0 14px, #fcecc0 14px 28px); border-bottom: 1px solid #e8cf8e; color: #5a4313; font-size: 15px; }
.draft-note .wrap { padding: 12px 0; }
.draft-note code { background: rgba(255, 255, 255, .7); }
.chapter { display: grid; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; gap: clamp(32px, 5vw, 72px); padding: clamp(40px, 6vw, 80px) 0; }
.chapter__main > section + section { margin-top: clamp(36px, 5vw, 56px); padding-top: clamp(36px, 5vw, 56px); border-top: 1px solid var(--line); }
.chapter__aside { position: sticky; top: calc(var(--header-h) + 24px); }

.prose { max-width: 44rem; }
.prose h2 { font-size: clamp(24px, 2.4vw, 30px); letter-spacing: -.03em; margin: 0 0 18px; }
.prose h3 { font-size: 20px; margin: 30px 0 10px; }
.prose > h2:not(:first-child) { margin-top: 44px; }
.prose p, .prose li { color: var(--ink-soft); }
.prose ul, .prose ol { margin: 0 0 1em; padding: 0; list-style: none; }
.prose li { position: relative; margin: 0 0 10px; padding-left: 28px; }
.prose ul > li::before { content: ""; position: absolute; left: 6px; top: .6em; width: 8px; height: 8px; border-radius: 2px; background: var(--teal); transform: rotate(45deg) scale(.82); }
.prose ol { counter-reset: item; }
.prose ol > li { counter-increment: item; }
.prose ol > li::before { content: counter(item); position: absolute; left: 0; top: .1em; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--teal); background: var(--mint); }
.prose blockquote { margin: 0 0 1em; padding: 4px 0 4px 18px; border-left: 3px solid var(--teal); }
.summary p:first-of-type { font-size: 19px; line-height: 1.6; color: var(--ink); }
.goals ul > li { padding-left: 34px; }
.goals ul > li::before { left: 0; top: .2em; width: 22px; height: 22px; border-radius: 50%; background: var(--mint); transform: none; }
.goals ul > li::after { content: ""; position: absolute; left: 8px; top: calc(.2em + 5px); width: 6px; height: 10px; border: solid var(--teal); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.covers ul { margin-left: 7px; border-left: 2px solid var(--line); }
.covers ul > li { padding: 0 0 4px 24px; margin: 0 0 12px; }
.covers ul > li::before { left: -8px; top: .48em; width: 14px; height: 14px; border-radius: 50%; background: var(--paper); border: 2px solid var(--teal); transform: none; }
.covers li strong:first-child { display: inline-block; min-width: 2.6em; color: var(--teal); font-variant-numeric: tabular-nums; }

/* Pictures and lab views inside a lesson: ![alt](figures/... "Caption") and ::lab[module/topic] */
.prose .figure, .prose .embed { margin: 30px 0 34px; }
.figure__frame {
  width: fit-content; max-width: 100%; margin-inline: auto; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--radius);
}
.figure__frame img { display: block; width: auto; height: auto; max-width: 100%; }
.figure__caption { margin: 12px 4px 0; font-size: 15px; line-height: 1.55; color: var(--dim); }
.figure__caption strong { color: var(--ink-soft); }

/* The chapter's detailed notes, in the aside */
.notes-box {
  position: relative; overflow: hidden; padding: 30px 24px 22px; background: var(--card);
  border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow);
}
.notes-box::before, .unlock::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: linear-gradient(90deg, var(--teal), var(--glow), var(--glow-soft)); }
.notes-box__kicker, .note-side__kicker { margin: 0 0 4px; font-size: 12px; font-weight: 720; letter-spacing: .14em; text-transform: uppercase; color: var(--teal); }
.notes-box__title { font-size: 28px; letter-spacing: -.035em; margin: 0 0 6px; }
.notes-box__text { margin: 0 0 16px; color: var(--dim); font-size: 15px; }
.notes-box__empty { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--mint-soft); font-size: 14px; color: var(--ink-soft); }
.notes-box__all { display: inline-block; margin-top: 16px; font-size: 15px; }
.notes-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.notes-list a {
  display: grid; grid-template-columns: 38px minmax(0, 1fr); column-gap: 12px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 14px; color: var(--ink); text-decoration: none;
  transition: border-color .25s, background-color .25s, transform .25s var(--ease);
}
.notes-list a:hover { border-color: var(--teal); background: var(--mint-soft); color: var(--ink); transform: translateY(-1px); }
.notes-list .icon { grid-row: 1 / span 3; width: 38px; height: 38px; padding: 9px; border-radius: 11px; color: var(--teal); background: var(--mint); }
.notes-list__id { font-size: 12px; font-weight: 720; letter-spacing: .12em; text-transform: uppercase; line-height: 1.5; color: var(--teal); }
.notes-list__title { font-weight: 640; line-height: 1.35; }
.notes-list__meta { margin-top: 2px; font-size: 13px; line-height: 1.4; color: var(--dim); }

/* "More details in Note X": ::note[X] inside a lesson */
.note-ref {
  position: relative; display: flex; align-items: center; gap: 16px; margin: 24px 0; padding: 16px 20px 16px 16px;
  background: var(--mint-soft); border: 1px solid var(--line); border-radius: 16px;
  transition: border-color .25s, transform .25s var(--ease), box-shadow .25s;
}
.note-ref:hover { border-color: var(--teal); transform: translateY(-2px); box-shadow: var(--shadow); }
.note-ref:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(37, 130, 105, .25); }
.note-ref__icon { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; color: var(--night); background: var(--glow); }
.note-ref__icon .icon { width: 26px; height: 26px; }
.note-ref__body { display: grid; min-width: 0; }
.note-ref__kicker { font-size: 12px; font-weight: 720; letter-spacing: .12em; text-transform: uppercase; color: var(--teal); }
.note-ref__title { font-size: 17px; font-weight: 660; line-height: 1.35; color: var(--ink); text-decoration: none; }
.note-ref__title::after { content: ""; position: absolute; inset: 0; border-radius: 16px; }
.note-ref__title:focus-visible { outline: none; }
.note-ref__meta { font-size: 14px; color: var(--dim); }
.note-ref__go { margin-left: auto; padding-left: 8px; font-size: 22px; color: var(--teal); transition: transform .25s var(--ease); }
.note-ref:hover .note-ref__go { transform: translateX(4px); }
.note-ref--unset { background: var(--mint-soft); border-style: dashed; }
.note-ref--unset .note-ref__icon { background: #e1e8e4; color: var(--dim); }

/* ------------------------------------------------------------------ a note: its first pages, then the lock */

.note { display: grid; grid-template-columns: minmax(0, 1fr) 320px; align-items: start; gap: clamp(32px, 5vw, 64px); padding: clamp(40px, 6vw, 80px) 0 clamp(56px, 7vw, 96px); }
.note__main { min-width: 0; max-width: 820px; }
.note__aside { position: sticky; top: calc(var(--header-h) + 24px); display: grid; gap: 16px; }
.sheets { display: grid; gap: clamp(24px, 3vw, 36px); }
.sheet { margin: 0; }
.sheet__paper {
  position: relative; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 6px;
  box-shadow: 0 1px 2px rgba(17, 42, 35, .06), 0 26px 50px -26px rgba(17, 42, 35, .4);
}
.sheet__zoom { display: block; cursor: zoom-in; }
.sheet__paper img { width: 100%; }
.sheet--empty .sheet__paper { display: grid; place-items: center; aspect-ratio: 8.5 / 11; padding: 24px; text-align: center; background: repeating-linear-gradient(-45deg, #fbfcfb 0 14px, #f3f7f5 14px 28px); }
.sheet--empty .sheet__paper p { margin: 0; max-width: 26em; }
.sheet__label { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; font-size: 13px; font-weight: 620; letter-spacing: .02em; color: var(--dim); }

.locked { position: relative; isolation: isolate; margin-top: clamp(24px, 3vw, 36px); padding: clamp(72px, 10vw, 120px) clamp(0px, 3vw, 28px) 0; }
.locked__ghost {
  position: absolute; inset: 0 0 auto; height: min(100%, 680px); z-index: -1; overflow: hidden;
  background: #fff; border: 1px solid var(--line); border-radius: 6px 6px 0 0;
  -webkit-mask-image: linear-gradient(180deg, #000 35%, transparent 98%); mask-image: linear-gradient(180deg, #000 35%, transparent 98%);
}
.locked__ghost::before {
  content: ""; position: absolute; inset: 64px 11% 0; filter: blur(3px);
  background: repeating-linear-gradient(180deg, #d5dfda 0 8px, transparent 8px 26px);
  -webkit-mask-image: linear-gradient(90deg, #000 62%, transparent 96%); mask-image: linear-gradient(90deg, #000 62%, transparent 96%);
}
.locked__ghost::after { content: ""; position: absolute; left: 28%; right: 28%; top: 44%; height: 34px; border-radius: 6px; background: #d9e3de; filter: blur(5px); }
.unlock {
  position: relative; overflow: hidden; max-width: 480px; margin: 0 auto; padding: 34px clamp(20px, 4vw, 34px) 28px; text-align: center;
  background: rgba(255, 255, 255, .9); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow);
}
.unlock__icon { display: inline-grid; place-items: center; width: 56px; height: 56px; margin-bottom: 14px; border-radius: 50%; color: var(--night); background: var(--glow); box-shadow: 0 0 0 8px rgba(69, 196, 166, .16); }
.unlock__icon .icon { width: 26px; height: 26px; }
.unlock h2 { font-size: clamp(23px, 2.4vw, 29px); letter-spacing: -.03em; margin: 0 0 10px; }
.unlock__text { margin: 0 auto 20px; max-width: 30em; color: var(--dim); font-size: 15.5px; }
.unlock__unset { margin: 10px 0 0; font-size: 13px; }
.unlock__delivery { margin: 14px 0 0; color: var(--dim); font-size: 14px; }
.unlock__back { display: inline-block; margin-top: 16px; font-size: 14px; font-weight: 620; text-decoration: none; }
.unlock__back:hover { text-decoration: underline; }
.note-side { padding: 26px 24px 22px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-sm); }
.note-side__body { margin: 8px 0 18px; font-size: 15px; }
.note-side__body ul, .note-side__body ol { margin: 0; }
.note-side__body li { margin-bottom: 8px; }
.note-side__small { margin: 10px 0 0; font-size: 13px; text-align: center; color: var(--dim); }
.note-side .notes-list { margin-top: 12px; }

/* The notes page: every note, in chapter order */
.notes-grid { margin-bottom: clamp(40px, 5vw, 64px); }
.note-card { display: flex; flex-direction: column; min-height: 210px; padding: 22px 22px 18px; }
.note-card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.note-card__kicker { margin: 0; font-size: 12px; font-weight: 720; letter-spacing: .14em; text-transform: uppercase; color: var(--teal); }
.note-card__head .icon { width: 40px; height: 40px; padding: 9px; border-radius: 12px; color: var(--teal); background: var(--mint); transition: background-color .3s, color .3s; }
.card:hover .note-card__head .icon { color: var(--night); background: var(--glow); }
.note-card__title { font-size: 20px; line-height: 1.3; margin: 0 0 8px; }
.note-card__title a { color: var(--ink); text-decoration: none; }
.note-card__title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.note-card__title a:focus-visible { outline: none; }
.note-card__summary { margin: 0 0 16px; color: var(--dim); font-size: 15px; line-height: 1.55; }
.note-card__meta { margin: auto 0 0; padding-top: 12px; border-top: 1px solid var(--line-soft); font-size: 14px; color: var(--dim); }
.notes-empty { margin: 0 0 40px; padding: 18px 20px; border-radius: 14px; background: var(--mint-soft); color: var(--ink-soft); }

.embeds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.embeds > .embed:first-child:nth-last-child(odd) { grid-column: 1 / -1; }
.embed { margin: 0; overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.embed__stage { position: relative; display: block; overflow: hidden; background: var(--mint-soft); }
.embed__stage--live { aspect-ratio: 16 / 10; }
.embed--wide .embed__stage--live { aspect-ratio: 16 / 9; }
.embed__poster { width: 100%; height: auto; }
.embed__veil { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8, 19, 15, 0) 35%, rgba(8, 19, 15, .5)); transition: opacity .3s; }
a.embed__stage:hover .embed__veil { opacity: .7; }
.embed__cta {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: inline-flex; align-items: center; gap: 12px; padding: 10px 20px 10px 10px; border-radius: 999px;
  color: #fff; font-weight: 630; font-size: 15px; white-space: nowrap;
  background: rgb(19 61 48 / 94%); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: inset 0 0 0 1px rgba(155, 227, 207, .25), 0 14px 34px -10px rgba(0, 0, 0, .55);
  transition: transform .3s var(--ease), background .3s;
}
a.embed__stage:hover .embed__cta, a.embed__stage:focus-visible .embed__cta { transform: translate(-50%, -50%) scale(1.05); background: var(--teal-deep); }
.embed__play { position: relative; width: 36px; height: 36px; border-radius: 50%; background: var(--glow); flex: none; }
.embed__play::after { content: ""; position: absolute; left: 14px; top: 11px; border-style: solid; border-width: 7px 0 7px 11px; border-color: transparent transparent transparent var(--night); }
.embed__frame { position: absolute; inset: 0; display: block; width: 100%; height: 100%; border: 0; background: var(--paper); }
.embed__caption { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 14px 18px 16px; font-size: 15px; }
.embed__text strong { display: block; color: var(--ink); }
.embed__sub { display: block; color: var(--dim); font-size: 14px; }
.embed__open { flex: none; font-size: 14px; font-weight: 620; text-decoration: none; white-space: nowrap; }
.embed__open:hover { text-decoration: underline; }

/* A page's 3D model (::model[id], templates/partials/model.html): a click-to-load frame like a lab
   view. The poster and the loaded frame share one shape, so nothing moves on the click. No title box
   under it (the instructor, 2026-11-20): Enlarge (once the tool has loaded) and Open on its own page
   stand on a small tab at the frame's top-right corner, in the space above the frame, so they cover
   nothing of any tool at any size; a caption line stands under the frame only where the page's text
   does not say what the tool is for (content/models.toml). */
.model { margin: 22px 0 30px; max-width: 980px; }
.prose .model .embed { margin: 0; }
.embed--model .embed__stage { aspect-ratio: 16 / 10; }
.embed--model .embed__poster { width: 100%; height: 100%; object-fit: cover; }
.model__bar { position: relative; z-index: 1; display: flex; justify-content: flex-end; align-items: flex-end; gap: 6px; margin-bottom: -1px; padding: 0 16px; }
.model__btn {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px;
  border: 1px solid var(--line); border-bottom: 0; border-radius: 10px 10px 0 0; background: var(--card); color: var(--ink);
  font: inherit; font-size: 13.5px; font-weight: 620; line-height: 1; text-decoration: none; white-space: nowrap; cursor: pointer;
}
.model__btn:hover { background: var(--mint-soft); color: var(--ink); }
.model__btn:focus-visible { outline: 3px solid var(--teal); outline-offset: 1px; }
.model__btn[hidden] { display: none; }
.model__icon { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.model__icon--shrink, .model--max .model__icon--grow { display: none; }
.model--max .model__icon--shrink { display: block; }
.model__badge {
  margin-right: auto; align-self: center; padding: 1px 9px; border: 1px solid #e8cf8e; border-radius: 999px;
  background: #fff3d1; color: #5a4313; font-size: 12px; font-weight: 650;
}
.model__caption { margin: 12px 4px 0; font-size: 15px; line-height: 1.55; color: var(--dim); }
@media (max-width: 640px) {
  .embed--model .embed__stage { aspect-ratio: 4 / 5; }
  .model__bar { padding: 0 10px; }
  .model__btn { padding: 0 9px; font-size: 13px; }
}
/* Enlarged: the tool fills the window, under a slim bar with Close (or the Escape key) */
.model.model--max {
  position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column;
  max-width: none; margin: 0; background: var(--card);
}
.model--max .model__bar { flex: none; align-items: center; margin: 0; padding: 6px 12px; border-bottom: 1px solid var(--line); }
.model--max .model__btn { border-bottom: 1px solid var(--line); border-radius: 999px; }
.model--max .model__open, .model--max .model__caption { display: none; }
.model--max .embed--model { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; border: 0; border-radius: 0; box-shadow: none; }
.model--max .embed--model .embed__stage { flex: 1 1 auto; min-height: 0; aspect-ratio: auto; }
.has-max-embed { overflow: hidden; }
.device-note { margin: 18px 0 0; color: var(--dim); font-size: 14px; }
.nolab { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.nolab h2 { font-size: clamp(22px, 2.2vw, 28px); margin-bottom: 6px; }
.nolab p:not(.eyebrow) { margin: 0; color: var(--dim); }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: clamp(40px, 5vw, 64px) 0 clamp(56px, 7vw, 96px); }
.pager a { display: block; padding: 20px 22px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; font-weight: 620; transition: border-color .25s, transform .25s var(--ease), box-shadow .25s; }
.pager a:hover { border-color: var(--teal); transform: translateY(-2px); box-shadow: var(--shadow); color: var(--ink); }
.pager small { display: block; margin-bottom: 4px; font-size: 12px; font-weight: 720; letter-spacing: .12em; text-transform: uppercase; color: var(--teal); }
.pager__next { grid-column: 2; text-align: right; }

/* ------------------------------------------------------------------ the lab page */

.topic-group { margin-bottom: 40px; }
.topic-group__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-bottom: 16px; }
.topic-group__num { margin: 0; font-size: 12px; font-weight: 720; letter-spacing: .14em; text-transform: uppercase; color: var(--teal); }
.topic-group__head h2, .topic-group__head h3 { margin: 0; font-size: 21px; }
.topic-group__head h2 a, .topic-group__head h3 a { color: var(--ink); text-decoration: none; }
.topic-group__head h2 a:hover, .topic-group__head h3 a:hover { color: var(--teal); text-decoration: underline; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.tile__link { display: block; height: 100%; overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: 14px; color: var(--ink); text-decoration: none; box-shadow: var(--shadow-sm); transition: transform .3s var(--ease), box-shadow .3s, border-color .3s; }
.tile__link:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--teal); color: var(--ink); }
.tile__link img { width: 100%; height: auto; border-bottom: 1px solid var(--line-soft); }
.tile__body { display: block; padding: 12px 14px 14px; }
.tile__body strong { display: block; font-size: 16px; }
.tile__body span { display: block; color: var(--dim); font-size: 14px; line-height: 1.45; }

/* ------------------------------------------------------------------ text pages */

.prose--page { max-width: 46rem; }

/* ------------------------------------------------------------------ footer */

.site-footer { padding: 72px 0 32px; color: var(--on-night-dim); font-size: 15px; border-top: 1px solid #395c49; }
.footer__grid { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr)); gap: 32px; }
.footer__brand .brand { white-space: normal; font-size: 18px; }
.footer__brand p { max-width: 24em; margin: 16px 0 0; }
.footer__col h2 { margin: 6px 0 14px; font-size: 12px; font-weight: 720; letter-spacing: .14em; text-transform: uppercase; color: #fff; }
.footer__col ul { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.on-dark .footer__col a { color: var(--on-night-dim); text-decoration: none; }
.on-dark .footer__col a:hover { color: #fff; text-decoration: underline; }
.footer__base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-top: 56px; padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, .09); font-size: 14px; }
.footer__base p { margin: 0; }

/* ------------------------------------------------------------------ Module 1 vehicle menu and readings */

body.page-vehicle-fundamentals .band { padding-block: clamp(22px, 2.4vw, 36px); }
body.page-vehicle-fundamentals .band__inner {
  display: grid; justify-items: start; gap: 8px;
}
body.page-vehicle-fundamentals .band__inner > * { margin: 0; }
body.page-vehicle-fundamentals .band__title {
  max-width: none; font-size: clamp(1rem, 7.7vw, 3.8rem); line-height: 1.06; white-space: nowrap;
}
body.page-vehicle-fundamentals .band__lead { max-width: 65ch; }
body.page-vehicle-fundamentals .section { padding-block: clamp(18px, 2vw, 30px) clamp(44px, 5vw, 76px); }
article.page-vehicle-fundamentals { max-width: none; margin: 0; }
article.page-vehicle-fundamentals > .figure {
  display: flex; align-items: center; gap: 18px; max-width: 42rem; padding-block: 8px; margin: 0;
  border-bottom: 1px solid var(--line-soft); animation: none;
}
article.page-vehicle-fundamentals > .figure .figure__frame { width: 82px; flex: none; border: none; box-shadow: none; }
article.page-vehicle-fundamentals > .figure .figure__caption { margin: 0; }
body[class^="page-fundamentals-"] .prose--page { margin-inline: auto; }
body[class^="page-fundamentals-"] .figure__frame { background: #fbfcf8; box-shadow: none; }
/* Illustrated subsystem readings share the Engine lesson's layout, including its static outline. */
@scope (body:is(.page-fundamentals-engine, .page-fundamentals-power-transmitting-unit, .page-fundamentals-transmission, .page-fundamentals-power-dividing-unit,
                .page-fundamentals-wheels-and-tires, .page-fundamentals-suspension, .page-fundamentals-steering, .page-fundamentals-brakes)) {
  :scope .band { padding-block: clamp(28px, 3.5vw, 48px); }
  :scope .band__title {
    margin-bottom: 10px; font-size: clamp(46px, 5vw, 70px);
  }
  :scope .band__lead { margin: 0; max-width: 57ch; }
  :scope .section--tight { padding-block: clamp(18px, 3vw, 40px) 64px; }
  article.prose--page { --engine-figure-width: 22.5rem; max-width: 56rem; min-width: 0; }
  .module-layout > article.prose--page { width: 100%; }
  article.prose--page :is(h2, h3, h4)[id] { scroll-margin-top: 4rem; }
  article.prose--page h2 { margin: 0 0 20px; font-size: clamp(28px, 3.1vw, 40px); line-height: 1.12; }
  article.prose--page h3[id] { margin: 0 0 16px; font-size: clamp(22px, 2.1vw, 28px); color: var(--teal); }
  article.prose--page h4 { margin: 0 0 12px; font-size: clamp(19px, 1.6vw, 22px); }
  .engine-section + .engine-section {
    border-top: 1px solid var(--line); margin-top: clamp(32px, 4vw, 54px); padding-top: clamp(24px, 3vw, 38px);
  }
  .engine-topic { margin-top: clamp(22px, 3vw, 34px); }
  .engine-topic:has(.engine-type) + .engine-topic { padding-top: 22px; border-top: 1px solid var(--line); }
  .engine-type + .engine-type { margin-top: 26px; }
  .engine-section p:last-child, .engine-reading-copy > :last-child { margin-bottom: 0; }
  .engine-reading-copy ul { margin: 14px 0 0; }
  .engine-reading-copy li { padding-left: 0; }
  .engine-reading-copy li::before { display: none; }
  .engine-reading-copy ol > li { padding-left: 28px; }  /* a numbered list keeps its badge (.prose ol) and its room */
  .engine-reading-copy li strong { color: var(--ink); }
  article.prose--page .figure { width: min(100%, var(--engine-figure-width)); margin: 1rem 0; animation: none; }
  article.prose--page .figure__frame {
    width: 100%; border: 0; border-radius: 8px; background: var(--card);
    outline: 1px solid var(--line); outline-offset: -1px;
  }
  article.prose--page .figure__frame img { width: 100%; }
  article.prose--page .figure__frame:has(img[src$=".svg"]) { background: transparent; outline: 0; }
  article.prose--page .figure__caption {
    margin: 8px 0 0; font-size: .83rem; line-height: 1.5; color: var(--dim); overflow-wrap: anywhere;
  }
  article.prose--page .figure__caption strong { display: block; font-weight: 550; }
  article.prose--page .figure__caption a { color: var(--teal); }
  .engine-reading-pair { display: grid; gap: 16px; align-items: start; }
  article.prose--page .engine-reading-pair > .figure { margin: 0; }
  @media (min-width: 720px) {
    .engine-reading-pair { grid-template-columns: minmax(0, 1fr) clamp(19.5rem, 31vw, var(--engine-figure-width)); gap: clamp(20px, 2.5vw, 36px); }
  }
  @media (min-width: 1040px) {
    .module-layout > article.prose--page { margin: 0; max-width: none; }
    article.prose--page :is(h2, h3, h4)[id] { scroll-margin-top: 12px; }
  }
}
/* The navigation panel of a module's page (build.py module_nav): the module's pages, then the
   sections of this page. A bar under the header that opens on a tap; from 1040 px, in a
   module-layout, a panel beside the text. A page with a layout of its own keeps the bar. */
.module-nav {
  position: sticky; top: var(--header-h); z-index: 4; margin-bottom: 24px; border-block: 1px solid var(--line);
  background: var(--paper); color: var(--ink);
}
.module-nav details { max-height: calc(100dvh - var(--header-h) - 12px); overflow: auto; }
.module-nav summary {
  display: flex; align-items: center; gap: 6px; list-style: none;
  min-height: 46px; padding: 8px 10px; font-weight: 650; cursor: pointer;
}
.module-nav summary::-webkit-details-marker { display: none; }
.module-nav summary::after {
  content: ""; width: 8px; height: 8px; margin: 0 4px 0 auto; border: solid currentColor; border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
.module-nav details[open] summary::after { transform: rotate(225deg); }
.module-nav details:not([open]) > :not(summary) { display: none; }  /* a closed panel holds no laid-out text */
.module-nav__title { min-width: 0; line-height: 1.3; }   /* a long page title takes a second line; nothing is cut */
.module-nav__here { font-weight: 500; color: var(--dim); }
.module-nav ul { margin: 0; padding: 0 4px 10px; list-style: none; }
.module-nav a {
  display: block; padding: 6px 10px; border-inline-start: 2px solid transparent; color: var(--ink-soft);
  font-size: .92rem; line-height: 1.35; text-decoration: none;
}
.module-nav__sub a { padding-left: 23px; color: var(--dim); font-size: .85rem; }
.module-nav a:hover, .module-nav a:focus-visible { color: var(--ink); text-decoration: underline; }
.module-nav a[aria-current="page"] { color: var(--ink); font-weight: 650; border-color: var(--teal-deep); }
.module-nav a[aria-current="location"] { color: var(--teal-deep); border-color: var(--teal); background: var(--mint); }
.module-nav__label {
  margin: 0; padding: 12px 10px 6px; border-top: 1px solid var(--line);
  font-size: .76rem; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; color: var(--dim);
}
:where(.module-nav) ~ article :where(h2, h3, h4)[id] { scroll-margin-top: 4rem; }
@media (min-width: 1040px) {
  .module-layout { display: grid; grid-template-columns: clamp(11rem, 16vw, 13rem) minmax(0, 1fr); gap: clamp(28px, 3.5vw, 50px); }
  .module-layout > article.prose--page { min-width: 0; margin-inline: 0; }
  .module-layout > .module-nav { align-self: start; top: calc(var(--header-h) + 24px); margin: 0; border: 0; }
  .module-layout > .module-nav details {
    max-height: calc(100dvh - var(--header-h) - 40px); scrollbar-width: thin; scrollbar-color: var(--line) transparent;
  }
  .module-layout > .module-nav summary {
    min-height: 0; padding: 0 0 12px; font-size: .76rem; text-transform: uppercase; letter-spacing: .1em;
    color: var(--dim); cursor: default;
  }
  .module-layout > .module-nav summary::after, .module-layout > .module-nav .module-nav__here { display: none; }
  .module-layout > .module-nav ul { padding: 0; }
  .module-layout > .module-nav a { padding-block: 5px; font-size: .88rem; }
  .module-layout > .module-nav .module-nav__sub a { font-size: .82rem; }
  .module-layout > .module-nav .module-nav__label { margin-top: 12px; padding: 12px 0 6px; }
  :where(.module-layout) > article :where(h2, h3, h4)[id] { scroll-margin-top: 12px; }
}
@media print {
  .module-layout { display: block; }
  .module-nav { display: none; }
}
/* Vehicle History pairs each dated account with its credited photograph. */
body.page-fundamentals-vehicle-history .band { padding-block: clamp(32px, 4vw, 60px); border-bottom: 0; }
body.page-fundamentals-vehicle-history .band__title { font-size: clamp(40px, 4.3vw, 60px); }
body.page-fundamentals-vehicle-history .section--tight { padding-block: clamp(24px, 3vw, 42px) 64px; }
article.page-fundamentals-vehicle-history {
  --timeline-gutter: clamp(22px, 2.6vw, 36px);
  position: relative; padding-inline-start: var(--timeline-gutter); max-width: 68rem;
}
article.page-fundamentals-vehicle-history::after {
  content: ""; position: absolute; inset-inline-start: 5px; inset-block: 0;
  border-inline-start: 2px solid #79967d; pointer-events: none;
}
article.page-fundamentals-vehicle-history h3 strong {
  display: block; margin: 0 0 6px; color: var(--teal); font-size: 14px;
  font-weight: 600; line-height: 1.45; letter-spacing: .025em;
}
article.page-fundamentals-vehicle-history > h3 > strong { position: relative; }
article.page-fundamentals-vehicle-history > h3 > strong::before {
  content: ""; position: absolute; z-index: 1; inset-inline-start: calc(0px - var(--timeline-gutter));
  top: .725em; transform: translateY(-50%); width: 12px; height: 12px;
  border: 2px solid var(--teal); border-radius: 50%; background: var(--paper);
}
article.page-fundamentals-vehicle-history > h3:is(:first-of-type, :last-of-type) > strong::before { background: var(--teal); }
/* Anchor the ends to the dots so photo heights and date wrapping can change freely. */
@supports (top: anchor(--history-first center)) {
  article.page-fundamentals-vehicle-history > h3:first-of-type > strong::before { anchor-name: --history-first; }
  article.page-fundamentals-vehicle-history > h3:last-of-type > strong::before { anchor-name: --history-last; }
  article.page-fundamentals-vehicle-history::after {
    top: anchor(--history-first center); bottom: anchor(--history-last center);
  }
}
article.page-fundamentals-vehicle-history :is(h2, h3) { scroll-margin-top: 6rem; }
article.page-fundamentals-vehicle-history > h2 {
  margin: 0 0 24px; font-size: clamp(27px, 3.1vw, 40px);
}
article.page-fundamentals-vehicle-history > h2:not(:first-child) {
  margin-top: 24px; padding-top: clamp(21px, 2.5vw, 32px); border-top: 2px solid var(--teal);
}
article.page-fundamentals-vehicle-history > h3 {
  margin: 30px 0 10px; font-size: clamp(21px, 2vw, 27px); line-height: 1.22;
}
article.page-fundamentals-vehicle-history > .figure { width: min(100%, 26rem); margin: 14px 0 18px; animation: none; }
article.page-fundamentals-vehicle-history .figure__frame {
  width: 100%; border-radius: 8px;
}
article.page-fundamentals-vehicle-history .figure__frame img {
  width: 100%;
}
article.page-fundamentals-vehicle-history .figure__caption {
  margin: 8px 1px 0; font-size: .875rem; line-height: 1.5; color: var(--dim); overflow-wrap: anywhere;
}
article.page-fundamentals-vehicle-history .figure__caption strong {
  display: block; font-weight: 500; color: var(--ink-soft);
}
article.page-fundamentals-vehicle-history .figure__caption a { color: var(--teal); text-underline-offset: .15em; }
article.page-fundamentals-vehicle-history > p:last-child {
  margin: 20px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: .875rem; color: var(--dim);
}
@media (min-width: 760px) {
  body.page-fundamentals-vehicle-history .band__inner {
    display: grid; gap: 8px; max-width: 68rem;
  }
  body.page-fundamentals-vehicle-history .band__inner > * { margin: 0; }
  article.page-fundamentals-vehicle-history {
    --entry-gap: clamp(28px, 4.1vw, 52px);
    --history-gap: clamp(26px, 4.5vw, 68px);
    --copy-width: calc((100% - var(--history-gap)) * .512);
    display: flow-root;
  }
  /* Pair the starts of the two columns. A tall portrait can extend alongside
     the entire account without inserting space between its date and its text. */
  article.page-fundamentals-vehicle-history > :is(h2, h3, p:last-child) { clear: both; }
  article.page-fundamentals-vehicle-history > h3 {
    float: left; width: var(--copy-width); margin: 0 0 10px;
  }
  article.page-fundamentals-vehicle-history > p:not(:last-child) {
    clear: left; width: var(--copy-width); margin: 0 0 var(--entry-gap); overflow-wrap: break-word;
  }
  article.page-fundamentals-vehicle-history > .figure {
    float: right; width: min(26rem, calc(100% - var(--copy-width) - var(--history-gap)));
    margin: 0 0 var(--entry-gap);
    margin-inline-end: max(0px, calc(100% - var(--copy-width) - var(--history-gap) - 26rem));
  }
  article.page-fundamentals-vehicle-history > p:has(+ p:not(:last-child)) { margin-bottom: 12px; }
}

/* ------------------------------------------------------------------ motion (only when the reader allows it) */

@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes reveal { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .rise { animation: rise .9s var(--ease) both; }
  .d1 { animation-delay: .08s; }
  .d2 { animation-delay: .16s; }
  .d3 { animation-delay: .24s; }
  .d4 { animation-delay: .32s; }
  /* Fade in over the first 140 px of scrolling, whatever the block's height, so a tall section
     is never read half-faded; browsers without scroll-driven animations show it plainly. */
  @supports (animation-timeline: view()) and (animation-range: entry 0px entry 140px) {
    .reveal { animation: reveal linear both; animation-timeline: view(); animation-range: entry 0px entry 140px; }
  }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .collage { transform: none; }
}

/* ------------------------------------------------------------------ smaller screens */

@media (680px < width < 1280px) {
  .pace-features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .pace-features { --picture-width: clamp(96px, 29vw, 128px); grid-template-columns: minmax(0, 1fr); gap: 7px; }
}
@media (max-width: 1080px) {
  .parts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 960px) {
  .lab-teaser__grid { grid-template-columns: minmax(0, 1fr); }
  .collage { transform: none; }
  .chapter { grid-template-columns: minmax(0, 1fr); }
  .chapter__aside { position: static; max-width: 520px; }
  .note { grid-template-columns: minmax(0, 1fr); }
  .note__aside { position: static; max-width: 560px; }
  .site-nav .nav-cta-item { display: none; }
  .offer { grid-template-columns: minmax(0, 1fr); }
  .band__numeral { display: none; }
  .band--chapter .band__inner > * { max-width: none; }
}
@media (max-width: 640px) {
  .hero__intro { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .hero__model { width: min(100%, 27rem); justify-self: center; }
}
@media (max-width: 760px) {
  .steps, .duo { grid-template-columns: minmax(0, 1fr); }
  .embeds { grid-template-columns: minmax(0, 1fr); }
  .pager { grid-template-columns: minmax(0, 1fr); }
  .pager__next { grid-column: 1; }
  .part__head { grid-template-columns: minmax(0, 1fr); }
  .part__num { flex-direction: row; align-items: baseline; gap: 10px; }
  .part__num span { font-size: 40px; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .site-header .brand { gap: 6px; font-size: 15px; }
  .site-nav a { padding: 8px 11px; font-size: 14px; }
  .parts { grid-template-columns: minmax(0, 1fr); }
  .footer__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .band__actions .btn { width: 100%; }
  .embed__caption { flex-direction: column; gap: 6px; }
  .figure__caption { font-size: 14px; }
  .note-ref { align-items: flex-start; gap: 12px; padding: 14px; }
  .note-ref__icon { width: 40px; height: 40px; border-radius: 12px; }
  .note-ref__go { display: none; }
  .unlock { padding: 28px 18px 22px; }
}

/* The Credits page: the picture credits register (content/credits.toml, ::credits[pictures]). */
.prose .credits { display: grid; gap: 12px; margin: 0 0 1.8rem; padding: 0; list-style: none; }
.prose .credits li { display: grid; gap: 3px; margin: 0; padding: 12px 0 0; border-top: 1px solid var(--line); }
.prose .credits li::before { content: none; }
.credits__title { color: var(--ink); font-weight: 600; }
.credits__who, .credits__changes, .credits__also { color: var(--dim); font-size: .9rem; overflow-wrap: anywhere; }
.credits__changes code { font-size: .8rem; }
/* Tables in lessons and pages (a pipe table in Markdown). On a phone each row becomes a card whose
   cells are labelled with their column's name (data-label, written by build.py). */
.prose .table { margin: 1.2rem 0 1.6rem; }
.prose .table table { width: 100%; border-collapse: collapse; font-size: .92rem; line-height: 1.45; }
.prose .table th, .prose .table td { padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose .table thead th { color: var(--dim); font-size: .8rem; font-weight: 650; }
.prose .table td { font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .prose .table thead { display: none; }
  .prose .table tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .prose .table td { display: grid; grid-template-columns: minmax(0, 7.5rem) minmax(0, 1fr); gap: 10px; padding: 3px 0; border: 0; }
  .prose .table td::before { content: attr(data-label); color: var(--dim); font-weight: 600; }
}
/* Equations (texmath.py writes MathML) and source citations, in any text. */
math { font-family: "Cambria Math", "STIX Two Math", "Latin Modern Math", math; font-size: 1.1em; }
td math[display="block"] { margin: 2px 0; text-align: left; }
.cite { color: var(--dim); font-size: .8em; }
