/* Vehicle Dynamics Lab. The look is the Axle-V website's: its colours, font, header, band, buttons and pills.
   The tokens below repeat static/css/site.css of the website; checks/check_look.py holds the two equal. */

@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);
  /* the lab's own: the two curves of a plot, and the steering parts' colour on the car */
  --curve-a: #246346;
  --curve-b: #c2702a;
  --amber: #d9912b;
}

/* ------------------------------------------------------------------ base (as the site) */

*, *::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;
}
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; }
button, select, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.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; }
.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 a:not(.btn) { color: var(--glow-soft); }
.on-dark a:not(.btn):hover { color: #fff; }

/* ------------------------------------------------------------------ header and footer (as the site) */

.site-header { position: sticky; top: 0; z-index: 50; background: var(--night); border-bottom: 1px solid #395c49; }
.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; }
.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-footer { background: var(--night); padding: 40px 0 28px; color: var(--on-night-dim); font-size: 15px; border-top: 1px solid #395c49; }
.site-footer .brand, .site-footer .brand:hover { color: #fff; }
.footer__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 32px; }
.footer__row p { margin: 0; max-width: 46em; }
.footer__base { margin-top: 26px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .09); font-size: 14px; }
.footer__base p { margin: 0; }

/* ------------------------------------------------------------------ buttons, labels, pills (as the site) */

.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--primary { background: var(--teal); color: #fff; }
.btn--primary:hover { background: var(--teal-deep); color: #fff; }
.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--sm { padding: 7px 12px; font-size: 14px; border-radius: 10px; }
.btn[aria-pressed="true"] { background: var(--teal); color: #fff; border-color: var(--teal); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.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; }
.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; }

/* ------------------------------------------------------------------ band and sections (as the site) */

.band {
  padding: clamp(40px, 6vw, 80px) 0 clamp(36px, 5vw, 60px);
  background: linear-gradient(105deg, #e7eee1, #f5f6ee 82%); border-bottom: 1px solid var(--line);
}
.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__lead { font-size: clamp(17px, 1.4vw, 19px); color: var(--ink-soft); max-width: 40em; 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; }
.section { padding: clamp(40px, 6vw, 80px) 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(22px, 3vw, 36px); }
.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; }

/* ------------------------------------------------------------------ the 3D stage (showroom and lesson) */

.stage {
  position: relative; overflow: hidden; width: 100%; min-height: 280px;
  background: linear-gradient(180deg, #f6f7f1, #e6ede1); border: 1px solid var(--line); border-radius: var(--radius);
}
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline-offset: -3px; }
.stage__note {
  position: absolute; left: 12px; bottom: 12px; max-width: calc(100% - 24px); margin: 0; padding: 5px 10px; border-radius: 8px;
  background: rgba(251, 250, 246, .88); border: 1px solid var(--line); color: var(--dim); font-size: 13px; line-height: 1.4; pointer-events: none;
}
.stage__status {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; text-align: center;
  color: var(--ink-soft); font-size: 16px; background: rgba(246, 247, 241, .9);
}
.stage__status--error { color: #7a2a1c; }
.stage__tools { position: absolute; left: 12px; top: 12px; right: 12px; display: flex; flex-wrap: wrap; gap: 6px; pointer-events: none; }
.stage__tools > * { pointer-events: auto; }
/* the level of detail: the simplified model or the full-detail one */
.stage__detail {
  position: absolute; right: 12px; bottom: 12px; max-width: calc(100% - 24px); display: flex; flex-wrap: wrap; justify-content: flex-end;
  align-items: center; gap: 6px;
}
.stage__detail[hidden] { display: none; }
.stage__detail-status {
  margin: 0; padding: 5px 10px; border-radius: 8px; background: rgba(251, 250, 246, .88); border: 1px solid var(--line); color: var(--dim);
  font-size: 13px; line-height: 1.4;
}
.stage__detail-status:empty { display: none; }
.stage--detail .stage__note { bottom: 54px; }
.chip-btn {
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, .92); color: var(--ink-soft);
  font-size: 14px; font-weight: 600; line-height: 1.3; cursor: pointer;
}
.chip-btn:hover { border-color: var(--teal); color: var(--teal-deep); }
.chip-btn[aria-pressed="true"] { background: var(--teal); border-color: var(--teal); color: #fff; }
.chip-btn:disabled { opacity: .55; cursor: not-allowed; }

/* ------------------------------------------------------------------ landing: the showroom */

.showroom { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(280px, 1fr); gap: clamp(16px, 2.4vw, 28px); align-items: start; }
.showroom .stage { width: 100%; aspect-ratio: 16 / 10; }
.panel-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: clamp(18px, 2vw, 26px); }
.panel-card h3 { font-size: 21px; margin: 0 0 6px; }
.panel-card p { color: var(--dim); font-size: 15px; line-height: 1.55; }
.part-info { min-height: 132px; margin: 0 0 16px; padding: 14px 16px; border-radius: 12px; background: var(--mint-soft); border: 1px solid var(--line-soft); }
.part-info__name { margin: 0 0 4px; font-size: 18px; font-weight: 680; color: var(--ink); }
.part-info__job { margin: 0; color: var(--ink-soft); font-size: 15px; line-height: 1.5; }
.toggles { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; margin: 0; }
.facts div { min-width: 0; }
.facts dt { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.facts dd { margin: 0; font-size: 18px; font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }
.facts dd small { font-size: 13px; font-weight: 500; color: var(--dim); }
.provenance { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line-soft); color: var(--dim); font-size: 13px; line-height: 1.5; }
.provenance code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .95em; }

/* ------------------------------------------------------------------ landing: the lesson library */

.tabs { display: inline-flex; flex-wrap: wrap; gap: 6px; padding: 5px; margin: 0 0 26px; border-radius: 14px; background: var(--mint); }
.tabs button {
  padding: 9px 16px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-soft); font-size: 15px; font-weight: 620; cursor: pointer;
}
.tabs button[aria-selected="true"] { background: var(--card); color: var(--teal-deep); box-shadow: var(--shadow-sm); }
.lib-group { margin: 0 0 34px; }
.lib-group__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: 0 0 12px; }
.lib-group__num { margin: 0; font-size: 12px; font-weight: 720; letter-spacing: .14em; text-transform: uppercase; color: var(--teal); }
.lib-group__head h3 { margin: 0; font-size: 21px; }
.lib-group__none { margin: 0; color: var(--dim); font-size: 15px; }
.lesson-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.lesson-card {
  position: relative; display: flex; flex-direction: column; gap: 8px; height: 100%; padding: 16px 18px 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
}
.lesson-card--open { border-color: var(--teal); box-shadow: var(--shadow-sm); }
.lesson-card--open:hover { box-shadow: var(--shadow); background: var(--mint-soft); }
.lesson-card__q { margin: 0; font-size: 17px; font-weight: 650; line-height: 1.3; letter-spacing: -.015em; color: var(--ink); }
.lesson-card__q a { color: inherit; text-decoration: none; }
.lesson-card__q a::after { content: ""; position: absolute; inset: 0; border-radius: 14px; }
.lesson-card__name { margin: 0; color: var(--dim); font-size: 14px; line-height: 1.45; }
.lesson-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: auto; padding-top: 6px; font-size: 13px; color: var(--dim); }
.lesson-card--coming .lesson-card__q { color: var(--ink-soft); font-weight: 600; }
.extra-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; margin: 0 0 30px; padding: 0; list-style: none; }

/* ------------------------------------------------------------------ the lesson screen */

.lesson-bar { border-bottom: 1px solid var(--line); background: linear-gradient(105deg, #e7eee1, #f5f6ee 82%); }
.lesson-bar__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 10px 0; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0; padding: 0; list-style: none; font-size: 14px; color: var(--dim); }
.crumbs li + li::before { content: "›"; margin-right: 8px; color: var(--dim); }
.crumbs a { text-decoration: none; font-weight: 600; }
.crumbs [aria-current] { color: var(--ink); font-weight: 650; }
.lesson-bar__actions { display: flex; flex-wrap: wrap; gap: 6px; }
.lesson { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); gap: 16px; padding: 16px 0 28px; align-items: start; }
.lesson__view { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; min-width: 0; }
.lesson__view .stage { height: clamp(320px, calc(100vh - 330px), 760px); }
.lesson__panel { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; min-width: 0; }
.lesson__panel .panel-card { padding: 16px 18px; }
.lesson-q { margin: 0 0 6px; font-size: clamp(21px, 2vw, 25px); line-height: 1.2; }
.lesson-watch { margin: 0; color: var(--ink-soft); font-size: 15px; line-height: 1.5; }
.numbers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.number { min-width: 0; padding: 10px 12px; border-radius: 12px; background: var(--mint-soft); border: 1px solid var(--line-soft); }
.number dt { font-size: 12px; font-weight: 700; line-height: 1.3; color: var(--dim); }
.number dd { margin: 2px 0 0; font-size: 24px; font-weight: 680; line-height: 1.15; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.number dd small { margin-left: 2px; font-size: 14px; font-weight: 600; color: var(--dim); }
.number--a { border-left: 4px solid var(--curve-a); }
.number--b { border-left: 4px solid var(--curve-b); }
.number__sign { margin: 8px 0 0; color: var(--dim); font-size: 13px; line-height: 1.45; }
.plot { position: relative; width: 100%; aspect-ratio: 4 / 3; }
.plot canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; touch-action: none; }
.plot__legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 6px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--ink-soft); }
.plot__legend li::before { content: ""; display: inline-block; width: 14px; height: 3px; margin-right: 6px; border-radius: 2px; vertical-align: middle; background: var(--c); }
.panel-card h2 { margin: 0 0 8px; font-size: 13px; font-weight: 720; letter-spacing: .12em; text-transform: uppercase; color: var(--teal); }
.try-list { margin: 0; padding-left: 20px; color: var(--ink-soft); font-size: 15px; line-height: 1.5; }
.try-list li + li { margin-top: 6px; }
details.explain summary { cursor: pointer; font-size: 13px; font-weight: 720; letter-spacing: .12em; text-transform: uppercase; color: var(--teal); }
details.explain p { margin: 10px 0 0; color: var(--ink-soft); font-size: 15px; line-height: 1.55; }
details.explain .explain__ref { color: var(--dim); font-size: 14px; }

.timeline { display: grid; gap: 8px; padding: 12px 16px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.timeline__row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.timeline__play { min-width: 92px; }
.timeline label { font-size: 14px; color: var(--dim); }
.timeline select { padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); font-size: 14px; }
.timeline__now { margin-left: auto; font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--ink); }
.scrub { position: relative; padding: 0 0 22px; }
.scrub input[type="range"] { width: 100%; margin: 0; accent-color: var(--teal); cursor: pointer; }
.scrub__scale { position: absolute; left: 8px; right: 8px; bottom: 0; height: 20px; font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; }
.scrub__tick { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.scrub__tick::before { content: ""; position: absolute; left: 50%; top: -5px; width: 1px; height: 5px; background: var(--line); }
.scrub__tick--mark { color: var(--teal-deep); font-weight: 700; }
.scrub__tick--mark::before { background: var(--teal); width: 2px; height: 7px; top: -7px; }

.help-dialog { max-width: min(560px, calc(100vw - 32px)); padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); background: var(--card); box-shadow: var(--shadow); }
.help-dialog::backdrop { background: rgba(19, 61, 48, .35); }
.help-dialog h2 { font-size: 22px; }
.help-dialog dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0 0 16px; font-size: 15px; }
.help-dialog dt { font-weight: 680; white-space: nowrap; }
.help-dialog dd { margin: 0; color: var(--ink-soft); }
kbd { padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line); background: var(--mint-soft); font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .86em; }

/* instructor mode: large text, the side panel hidden, the view as large as the window allows */
.is-instructor .lesson { grid-template-columns: minmax(0, 1fr); }
.is-instructor .lesson__panel > :not(.panel-card--numbers) { display: none; }
.is-instructor .lesson__view .stage { height: clamp(360px, calc(100vh - 360px), 1100px); }
.is-instructor .number dd { font-size: 40px; }
.is-instructor .number dt { font-size: 16px; }
.is-instructor .timeline__now { font-size: 22px; }
.is-instructor .site-header, .is-instructor .site-footer { display: none; }

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

@media (max-width: 1000px) {
  .showroom { grid-template-columns: minmax(0, 1fr); }
  .lesson { grid-template-columns: minmax(0, 1fr); }
  .lesson__view .stage { height: auto; aspect-ratio: 4 / 3; }
  .is-instructor .lesson__view .stage { height: auto; aspect-ratio: 4 / 3; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .site-nav a { padding: 8px 9px; font-size: 14px; }
  .brand-name { display: none; }
  .number dd { font-size: 20px; }
  .number { padding: 8px 9px; }
  .timeline__now { margin-left: 0; width: 100%; }
  .footer__row { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
