:root {
  --page: #f4f5f7;
  --paper: #ffffff;
  --paper-soft: #f8f8f6;
  --ink: #17191d;
  --ink-soft: #3e424a;
  --muted: #626873;
  --line: #dfe2e6;
  --line-strong: #c9cdd3;
  --blue: #2456d6;
  --blue-soft: #e9efff;
  --teal: #087c68;
  --teal-soft: #e3f4ef;
  --coral: #b63d34;
  --coral-soft: #fae9e6;
  --yellow: #e9b949;
  --code: #13161b;
  --code-ink: #edf1f5;
  --sidebar: 288px;
  --radius: 6px;
  --shadow: 0 14px 36px rgba(23, 25, 29, 0.1);
  color-scheme: light;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--page);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.menu-open {
  overflow: hidden;
}

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

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

::selection {
  color: var(--ink);
  background: #f8dd8e;
}

:focus-visible {
  outline: 3px solid rgba(36, 86, 214, 0.32);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1000;
  padding: 8px 12px;
  color: #fff;
  background: var(--ink);
  border-radius: 4px;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.scroll-progress {
  position: fixed;
  inset: 0 0 auto var(--sidebar);
  z-index: 90;
  height: 3px;
  pointer-events: none;
  background: transparent;
}

.scroll-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--blue);
}

.site-shell {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: 100vh;
}

.site-shell.sidebar-hidden {
  grid-template-columns: 0 minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-self: start;
  width: var(--sidebar);
  height: 100vh;
  overflow: hidden;
  background: var(--paper-soft);
  border-right: 1px solid var(--line);
  transition: width 180ms ease, transform 180ms ease;
}

.site-shell.sidebar-hidden .sidebar {
  width: 0;
  border-right: 0;
}

.sidebar-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 76px;
  padding: 14px 14px 14px 18px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  flex: 1;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.brand-mark {
  display: grid;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  place-items: center;
  color: #fff;
  background: var(--blue);
  border-radius: var(--radius);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  font-weight: 800;
}

.brand-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: 1.25;
}

.brand-copy strong {
  overflow: hidden;
  font-size: 14px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-copy span {
  overflow: hidden;
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.icon-button {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
}

.icon-button:hover {
  color: var(--ink);
  background: var(--paper);
  border-color: var(--line);
}

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 12px 24px;
}

.nav-label,
.part-label,
.eyebrow,
.section-kicker,
.lesson-number,
.tiny-label {
  margin: 0;
  color: var(--blue);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.nav-label {
  padding: 0 10px 8px;
}

.curriculum-nav {
  display: grid;
  gap: 16px;
}

.curriculum-group {
  display: grid;
  gap: 3px;
}

.part-label {
  padding: 2px 10px 6px;
  color: var(--muted);
  font-size: 10px;
}

.curriculum-nav ul {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-link {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: start;
  min-height: 38px;
  padding: 8px 9px;
  color: var(--ink-soft);
  border-left: 2px solid transparent;
  border-radius: 0 4px 4px 0;
  font-size: 13px;
  line-height: 1.35;
  transition: color 140ms ease, background 140ms ease, border-color 140ms ease;
}

.nav-link .nav-number {
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
}

.nav-link:hover,
.nav-link.active {
  color: var(--ink);
  background: var(--blue-soft);
  border-left-color: var(--blue);
}

.nav-link.active .nav-number {
  color: var(--blue);
}

.nav-separator {
  height: 1px;
  margin: 2px 10px;
  background: var(--line);
}

.sidebar-footer {
  flex: 0 0 auto;
  padding: 14px 20px 18px;
  color: var(--muted);
  background: var(--paper-soft);
  border-top: 1px solid var(--line);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
  line-height: 1.7;
}

.sidebar-footer a {
  color: var(--blue);
}

.mobile-header {
  display: none;
}

.menu-scrim {
  display: none;
}

.reopen-index {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 70;
  display: none;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(23, 25, 29, 0.09);
  cursor: pointer;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
}

.site-shell.sidebar-hidden .reopen-index {
  display: inline-flex;
}

.main {
  min-width: 0;
  overflow: hidden;
}

.content-wrap {
  width: min(1120px, calc(100% - 80px));
  margin: 0 auto;
}

.hero {
  display: grid;
  min-height: 620px;
  align-items: center;
  padding: 96px 0 72px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.hero-inner {
  max-width: 920px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.eyebrow::before {
  width: 28px;
  height: 3px;
  content: "";
  background: var(--blue);
}

.hero h1 {
  max-width: 900px;
  margin: 0;
  font-size: 74px;
  font-weight: 900;
  line-height: 0.99;
}

.hero h1 em,
.part-heading h2 em {
  color: var(--blue);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
}

.hero-lead {
  max-width: 760px;
  margin: 30px 0 0;
  color: var(--ink-soft);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 23px;
  line-height: 1.55;
}

.hero-lead a {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 34px;
}

.meta-chip {
  padding: 7px 12px;
  color: var(--ink-soft);
  background: var(--paper-soft);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  white-space: nowrap;
}

.prereq-band {
  padding: 64px 0;
  background: var(--paper-soft);
  border-bottom: 1px solid var(--line);
}

.prereq-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(480px, 1.2fr);
  gap: 64px;
  align-items: center;
}

.prereq-copy h2 {
  margin: 12px 0 14px;
  font-size: 36px;
  line-height: 1.12;
}

.prereq-copy p:not(.section-kicker) {
  margin: 0;
  color: var(--muted);
}

.prereq-copy a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
}

.prereq-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
}

.prereq-list div {
  min-width: 0;
  padding: 17px 20px;
  border-left: 1px solid var(--line-strong);
}

.prereq-list dt {
  margin-bottom: 7px;
  color: var(--teal);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.prereq-list dd {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.5;
}

.part-section {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.part-heading {
  position: relative;
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 32px;
  align-items: end;
  min-height: 300px;
  padding: 76px 0 54px;
  overflow: hidden;
}

.part-index {
  color: var(--line);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 148px;
  font-weight: 700;
  line-height: 0.74;
}

.part-heading h2 {
  max-width: 760px;
  margin: 10px 0 12px;
  font-size: 48px;
  line-height: 1.08;
}

.part-heading p:last-child {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 0 -1px;
  padding-bottom: 82px;
  background: var(--line);
  border: 1px solid var(--line);
}

.module-card {
  position: relative;
  display: flex;
  min-height: 270px;
  flex-direction: column;
  padding: 28px;
  background: var(--paper-soft);
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.module-card:hover {
  z-index: 1;
  background: var(--paper);
  box-shadow: var(--shadow);
  transform: translateY(-4px);
}

.module-card:nth-child(3n + 1) .module-number {
  color: var(--blue);
}

.module-card:nth-child(3n + 2) .module-number {
  color: var(--teal);
}

.module-card:nth-child(3n + 3) .module-number {
  color: var(--coral);
}

.module-number {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  font-weight: 800;
}

.module-card h3 {
  margin: 42px 0 14px;
  font-size: 22px;
  line-height: 1.25;
}

.module-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.module-card .card-arrow {
  margin-top: auto;
  color: var(--blue);
  font-size: 20px;
  font-weight: 700;
}

.system-band {
  padding: 88px 0;
  color: #fff;
  background: var(--ink);
}

.system-band .section-kicker {
  color: #94adff;
}

.system-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(520px, 1.2fr);
  gap: 68px;
  align-items: center;
}

.system-copy h2 {
  margin: 14px 0 20px;
  font-size: 42px;
  line-height: 1.12;
}

.system-copy p {
  margin: 0;
  color: #bfc4ce;
}

.excalidraw-figure {
  margin: 30px 0;
  overflow: hidden;
  background: #f8f8f6;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
}

.diagram-stage {
  display: flex;
  justify-content: center;
  overflow-x: auto;
  padding: 22px;
  background: #f8f8f6;
  overscroll-behavior-inline: contain;
}

.diagram-stage:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: -3px;
}

.diagram-stage img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.diagram-stage picture {
  display: block;
  width: 100%;
}

.excalidraw-figure--portrait .diagram-stage img {
  max-width: 560px;
}

.excalidraw-figure--evidence .diagram-stage img {
  max-width: 620px;
}

.excalidraw-figure--wide .diagram-stage {
  justify-content: flex-start;
}

.excalidraw-figure--wide .diagram-stage img {
  min-width: 920px;
}

.excalidraw-figure figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 15px;
  color: var(--muted);
  background: var(--paper);
  border-top: 1px solid var(--line);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
}

.excalidraw-source {
  flex: 0 0 auto;
  color: var(--blue);
  font-weight: 700;
}

.excalidraw-source-set {
  display: flex;
  flex: 0 0 auto;
  gap: 14px;
}

.excalidraw-source:hover {
  text-decoration: underline;
}

.excalidraw-figure--dark {
  margin: 0;
  border-color: #343943;
}

.excalidraw-figure--dark figcaption {
  color: #aab0ba;
  background: #0c0e12;
  border-top-color: #343943;
}

.excalidraw-figure--dark .excalidraw-source {
  color: #94adff;
}

.evidence-strip {
  padding: 84px 0;
  background: var(--paper-soft);
  border-bottom: 1px solid var(--line);
}

.evidence-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.8fr);
  gap: 70px;
  align-items: center;
}

.evidence-layout h2 {
  margin: 14px 0 18px;
  font-size: 42px;
  line-height: 1.12;
}

.evidence-layout p {
  color: var(--muted);
}

.evidence-list {
  display: grid;
  gap: 1px;
  margin-top: 24px;
  background: var(--line);
  border: 1px solid var(--line);
}

.evidence-list div {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 10px;
  padding: 12px 14px;
  background: var(--paper);
  font-size: 13px;
}

.evidence-list b {
  color: var(--teal);
}

.product-frame {
  padding: 12px;
  background: var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.product-frame img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: top;
  background: #20252d;
  border-radius: 3px;
}

.product-frame figcaption {
  padding: 11px 4px 2px;
  color: #aab0ba;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
}

.closing-band {
  padding: 94px 0;
  color: #fff;
  background: var(--blue);
}

.closing-layout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
}

.closing-band h2 {
  max-width: 720px;
  margin: 0;
  font-size: 48px;
  line-height: 1.08;
}

.primary-link {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 18px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #fff;
  border-radius: var(--radius);
  font-weight: 800;
  white-space: nowrap;
}

.primary-link:hover {
  background: #f3f5ff;
}

.page-footer {
  padding: 28px 0;
  color: var(--muted);
  background: var(--paper);
  font-size: 12px;
}

.page-footer .content-wrap {
  display: flex;
  justify-content: space-between;
  gap: 24px;
}

/* Lessons */
.lesson-hero {
  min-height: 610px;
}

.lesson-part {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.lesson-part-head {
  position: relative;
  padding: 82px 0 46px;
  border-bottom: 1px solid var(--line);
}

.lesson-part-head::after {
  position: absolute;
  right: 0;
  bottom: -18px;
  color: #edf0f3;
  content: attr(data-index);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 156px;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
}

.lesson-part-head h2 {
  position: relative;
  z-index: 1;
  max-width: 780px;
  margin: 12px 0 14px;
  font-size: 46px;
  line-height: 1.1;
}

.lesson-part-head p:last-child {
  position: relative;
  z-index: 1;
  max-width: 700px;
  margin: 0;
  color: var(--muted);
}

.lesson {
  display: grid;
  grid-template-columns: 104px minmax(0, 760px);
  gap: 36px;
  justify-content: center;
  padding: 78px 0;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 12px;
}

.lesson:last-child {
  border-bottom: 0;
}

.lesson-number {
  position: sticky;
  top: 26px;
  align-self: start;
  padding-top: 7px;
  color: var(--blue);
  font-size: 13px;
}

.lesson-body {
  min-width: 0;
}

.lesson-body h3 {
  margin: 0;
  font-size: 38px;
  line-height: 1.12;
}

.lesson-summary {
  margin: 18px 0 26px;
  color: var(--ink-soft);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  line-height: 1.55;
}

.lesson-body h4 {
  margin: 32px 0 10px;
  font-size: 17px;
}

.lesson-body p,
.lesson-body li {
  color: var(--ink-soft);
}

.lesson-body ol,
.lesson-body ul {
  display: grid;
  gap: 10px;
  padding-left: 24px;
}

.lesson-body code:not(pre code) {
  padding: 2px 5px;
  color: #17398c;
  background: var(--blue-soft);
  border-radius: 3px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.88em;
}

.code-frame {
  position: relative;
  margin: 28px 0;
  overflow: hidden;
  background: var(--code);
  border: 1px solid #2f3540;
  border-radius: var(--radius);
}

.code-head {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px 0 15px;
  color: #aeb5c0;
  background: #1b1f26;
  border-bottom: 1px solid #323844;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
}

.copy-button {
  min-width: 58px;
  height: 28px;
  padding: 0 9px;
  color: #dce2ea;
  background: transparent;
  border: 1px solid #444c59;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  font-size: 10px;
}

.copy-button:hover {
  color: #fff;
  background: #2a3039;
}

pre {
  margin: 0;
  overflow: auto;
  padding: 22px;
}

pre code {
  color: var(--code-ink);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.7;
}

.token-comment {
  color: #8d98a8;
}

.token-accent {
  color: #8eacff;
}

.token-good {
  color: #71d8bc;
}

.drill,
.guardrail,
.note {
  margin: 28px 0 0;
  padding: 20px 22px;
  border-left: 4px solid var(--blue);
  background: var(--blue-soft);
}

.guardrail {
  border-left-color: var(--coral);
  background: var(--coral-soft);
}

.note {
  border-left-color: var(--teal);
  background: var(--teal-soft);
}

.drill strong,
.guardrail strong,
.note strong {
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
  text-transform: uppercase;
}

.drill p,
.guardrail p,
.note p {
  margin: 0;
  font-size: 14px;
}

.contract-table {
  width: 100%;
  margin: 28px 0;
  border-collapse: collapse;
  font-size: 13px;
}

.contract-table th,
.contract-table td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  border: 1px solid var(--line);
}

.contract-table th {
  color: var(--ink);
  background: var(--paper-soft);
}

.contract-table td {
  color: var(--ink-soft);
}

.lesson-footer-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line);
}

.lesson-footer-nav a {
  min-height: 126px;
  padding: 28px 36px;
  background: var(--paper-soft);
}

.lesson-footer-nav a:last-child {
  text-align: right;
}

.lesson-footer-nav span {
  display: block;
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
  text-transform: uppercase;
}

.lesson-footer-nav strong {
  display: block;
  margin-top: 8px;
  color: var(--blue);
  font-size: 16px;
}

.lesson-footer-nav a:hover {
  background: var(--paper);
}

.has-js .reveal {
  opacity: 0;
  transform: translateY(16px);
}

.has-js .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 420ms ease, transform 420ms ease;
}

@media (min-width: 1121px) {
  .lesson-body .excalidraw-figure--wide {
    width: 964px;
    margin-left: -102px;
  }
}

@media (max-width: 1120px) {
  :root {
    --sidebar: 264px;
  }

  .content-wrap {
    width: min(100% - 56px, 980px);
  }

  .hero h1 {
    font-size: 62px;
  }

  .module-card {
    min-height: 292px;
    padding: 24px;
  }

  .system-layout,
  .evidence-layout {
    gap: 42px;
  }

  .system-layout {
    grid-template-columns: 1fr;
  }

  .prereq-layout {
    gap: 42px;
  }
}

@media (max-width: 900px) {
  html {
    scroll-padding-top: 72px;
  }

  .site-shell,
  .site-shell.sidebar-hidden {
    display: block;
  }

  .scroll-progress {
    top: 57px;
    left: 0;
  }

  .mobile-header {
    position: sticky;
    top: 0;
    z-index: 70;
    display: flex;
    height: 58px;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--line);
  }

  .mobile-brand {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    font-size: 14px;
    font-weight: 800;
  }

  .mobile-brand .brand-mark {
    flex-basis: 34px;
    width: 34px;
    height: 34px;
    font-size: 11px;
  }

  .mobile-menu-button {
    display: inline-flex;
    height: 36px;
    align-items: center;
    gap: 8px;
    padding: 0 11px;
    color: var(--ink-soft);
    background: var(--paper);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    cursor: pointer;
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 11px;
  }

  .sidebar,
  .site-shell.sidebar-hidden .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 100;
    width: min(86vw, 320px);
    height: 100dvh;
    border-right: 1px solid var(--line);
    box-shadow: var(--shadow);
    transform: translateX(-105%);
  }

  body.menu-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-head {
    min-height: 72px;
  }

  .menu-scrim {
    position: fixed;
    inset: 0;
    z-index: 95;
    display: block;
    visibility: hidden;
    background: rgba(23, 25, 29, 0.52);
    opacity: 0;
    transition: opacity 180ms ease, visibility 180ms ease;
  }

  body.menu-open .menu-scrim {
    visibility: visible;
    opacity: 1;
  }

  .reopen-index,
  .site-shell.sidebar-hidden .reopen-index {
    display: none;
  }

  .hero,
  .lesson-hero {
    min-height: 0;
    padding: 64px 0 68px;
  }

  .content-wrap {
    width: min(100% - 40px, 760px);
  }

  .hero h1 {
    font-size: 54px;
  }

  .hero-lead {
    font-size: 21px;
  }

  .part-heading {
    grid-template-columns: 110px 1fr;
  }

  .part-index {
    font-size: 108px;
  }

  .part-heading h2,
  .closing-band h2,
  .lesson-part-head h2 {
    font-size: 40px;
  }

  .module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .module-card {
    min-height: 260px;
  }

  .evidence-layout {
    grid-template-columns: 1fr;
  }

  .prereq-layout {
    grid-template-columns: 1fr;
  }

  .product-frame {
    max-width: 620px;
  }
}

@media (max-width: 620px) {
  body {
    font-size: 15px;
  }

  .content-wrap {
    width: calc(100% - 36px);
  }

  .hero,
  .lesson-hero {
    padding: 42px 0 56px;
  }

  .eyebrow {
    margin-bottom: 20px;
    font-size: 10px;
  }

  .hero h1 {
    font-size: 44px;
    line-height: 1.02;
  }

  .hero-lead {
    margin-top: 24px;
    font-size: 19px;
  }

  .meta-row {
    gap: 7px;
    margin-top: 26px;
  }

  .meta-chip {
    padding: 6px 10px;
    font-size: 10px;
  }

  .part-heading {
    display: block;
    min-height: 0;
    padding: 54px 0 38px;
  }

  .part-index {
    margin-bottom: 24px;
    font-size: 82px;
    line-height: 0.7;
  }

  .part-heading h2,
  .closing-band h2,
  .lesson-part-head h2,
  .system-copy h2,
  .evidence-layout h2 {
    font-size: 34px;
  }

  .module-grid {
    grid-template-columns: 1fr;
    padding-bottom: 54px;
  }

  .module-card {
    min-height: 220px;
    padding: 22px;
  }

  .module-card h3 {
    margin-top: 30px;
  }

  .system-band,
  .prereq-band,
  .evidence-strip,
  .closing-band {
    padding: 64px 0;
  }

  .prereq-copy h2 {
    font-size: 32px;
  }

  .prereq-list {
    grid-template-columns: 1fr;
  }

  .prereq-list div {
    padding: 15px 0;
    border-top: 1px solid var(--line-strong);
    border-left: 0;
  }

  .diagram-stage {
    padding: 12px;
  }

  .excalidraw-figure--wide .diagram-stage img {
    min-width: 0;
    max-width: 440px;
    margin-inline: auto;
  }

  .excalidraw-figure--wide .diagram-stage {
    justify-content: center;
    overflow-x: hidden;
  }

  .excalidraw-figure figcaption {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    font-size: 9px;
  }

  .excalidraw-source-set {
    flex-wrap: wrap;
  }

  .evidence-list div {
    grid-template-columns: 22px 1fr;
  }

  .evidence-list span:last-child {
    grid-column: 2;
  }

  .closing-layout {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-footer .content-wrap {
    align-items: flex-start;
    flex-direction: column;
  }

  .lesson-part-head {
    padding: 58px 0 34px;
  }

  .lesson-part-head::after {
    bottom: -8px;
    font-size: 92px;
  }

  .lesson {
    display: block;
    padding: 56px 0;
  }

  .lesson-number {
    position: static;
    margin-bottom: 14px;
  }

  .lesson-body h3 {
    font-size: 30px;
  }

  .lesson-summary {
    font-size: 18px;
  }

  pre {
    padding: 18px;
  }

  pre code {
    font-size: 12px;
  }

  .contract-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .lesson-footer-nav {
    grid-template-columns: 1fr;
  }

  .lesson-footer-nav a:last-child {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .has-js .reveal {
    opacity: 1;
    transform: none;
  }
}
