:root {
  color-scheme: light;
  --paper: #ffffff;
  --surface: #f8f8f3;
  --ink: #202f28;
  --green: #294e3e;
  --accent: #a7472c;
  --muted: #586258;
  --line: #d2d4c7;
  --pale: #edeee3;
  --tint: var(--tint);
  --hover: var(--hover);
  --tab-hover: var(--tab-hover);
  --line-strong: var(--line-strong);
  --dim: var(--dim);
  --code-bg: #24372e;
  --code-fg: #ebeee3;
  --prose: #29372e;
  --syn-num: #7d5d20;
  --syn-errline: rgba(194, 64, 31, 0.12);
  --serif:
    "Baskervville", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "DM Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", Menlo, Consolas, monospace;
  /* Real rendered height of .site-head (the sticky platform bar + mast
     unit, see layout.mjs) at this breakpoint. Drives html's scroll-padding-
     top and the reader outline's sticky offset below, so both stay
     calibrated to the sticky header's actual height instead of a guess.
     Overridden at 760px, where the platform bar hides and only the mast
     remains sticky. Measured with Playwright against the built site. */
  --head-h: 120px;
  font: 16px/1.55 var(--sans);
  background: var(--paper);
  color: var(--ink);
}

/* Themes. Day is the default token set in :root above; Dark is the same
   tokens with dark values — components never hard-code theme colors, so
   overriding the tokens restyles the whole site. data-theme is set on <html>
   before first paint by the inline script in layout.mjs (values "light" /
   "dark"); no attribute means "system", which follows the OS preference via
   the media block below. The two blocks are intentionally identical. */
[data-theme="dark"] {
  color-scheme: dark;
  --paper: #121713;
  --surface: #1a211b;
  --ink: #e4e8e0;
  --green: #a9c8ad;
  --accent: #e89a7c;
  --muted: #9ba79a;
  --line: #2d362e;
  --pale: #212a22;
  --tint: #28402f;
  --hover: #202b21;
  --tab-hover: #ffffff12;
  --line-strong: #4e5f4f;
  --dim: #76816f;
  --code-bg: #0f1511;
  --code-fg: #d9e0d4;
  --prose: #ced6ca;
  --syn-num: #cfb069;
  --syn-errline: rgba(229, 137, 120, 0.18);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  color-scheme: dark;
  --paper: #121713;
  --surface: #1a211b;
  --ink: #e4e8e0;
  --green: #a9c8ad;
  --accent: #e89a7c;
  --muted: #9ba79a;
  --line: #2d362e;
  --pale: #212a22;
  --tint: #28402f;
  --hover: #202b21;
  --tab-hover: #ffffff12;
  --line-strong: #4e5f4f;
  --dim: #76816f;
  --code-bg: #0f1511;
  --code-fg: #d9e0d4;
  --prose: #ced6ca;
  --syn-num: #cfb069;
  --syn-errline: rgba(229, 137, 120, 0.18);
  }
}
html {
  /* Clears .site-head on every in-page jump (outline links, #practice,
     breadcrumb fragments, quiz links) so the target heading lands fully
     visible below the sticky bar+mast, not hidden underneath it. */
  scroll-padding-top: calc(var(--head-h) + 16px);
}
* {
  box-sizing: border-box;
}
body,
figure,
h1,
h2,
h3,
p {
  margin: 0;
}
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main {
  flex: 1;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
summary,
select,
label:has(input[type="radio"]) {
  cursor: pointer;
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
button {
  border: 0;
  background: none;
}
button:disabled {
  cursor: default;
}
a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #a24c30;
  outline-offset: 4px;
}
::selection {
  background: #f0c3a9;
  color: var(--ink);
}
[hidden] {
  display: none !important;
}
h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.037em;
}
h1 {
  font-size: clamp(2.6rem, 5.5vw, 4.6rem);
}
h2 {
  font-size: clamp(2rem, 3.2vw, 2.85rem);
}
h3 {
  font-size: 1.8rem;
}
.icon {
  display: inline-block;
  vertical-align: middle;
  width: 1.15em;
  height: 1.15em;
  flex: none;
}
.wrap,
.mast-inner,
.atlas-bar-inner {
  width: min(1800px, calc(100% - clamp(32px, 3vw, 80px)));
  margin-inline: auto;
}
.sr,
.skip:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.skip:focus {
  position: fixed;
  top: 8px;
  left: 8px;
  background: var(--surface);
  padding: 10px 16px;
  z-index: 50;
}
.site-head {
  /* Wraps .atlas-bar + .mast into one sticky unit (see layout.mjs) so the
     platform tab bar and this guide's own header stay visible together
     while the page scrolls. z-index 10 clears the tallest in-page z-index
     (the mobile outline bar's 2) while staying under the skip link's 50. */
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--paper);
}
.mast {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  position: relative;
  z-index: 5;
}
.mast-inner {
  display: flex;
  align-items: center;
  min-height: 78px;
  gap: clamp(16px, 3vw, 46px);
}
.brand {
  font: 600 24px/1 var(--serif);
  letter-spacing: -1.1px;
  display: inline-flex;
  align-items: center;
  gap: 13px;
  white-space: nowrap;
}
.brand-mark {
  position: relative;
  width: 29px;
  height: 32px;
  display: inline-block;
  flex: none;
}
.brand-mark i {
  position: absolute;
  width: 21px;
  height: 14px;
  transform: rotate(-29deg) skewX(28deg);
  border: 1.4px solid var(--ink);
  left: 4px;
  top: 15px;
  background: #8da68d;
}
.brand-mark i:nth-child(2) {
  background: #f1ddbb;
  top: 10px;
}
.brand-mark i:nth-child(3) {
  background: #cd825d;
  top: 5px;
}
.search-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--green);
  min-height: 34px;
  padding: 0 8px;
  font: 550 0.8rem/1.25 var(--sans);
}
.search-tool:hover {
  border-color: var(--line-strong);
  background: var(--pale);
}
.main-nav a:hover {
  background: var(--hover);
  color: var(--green);
}
.search-tool {
  justify-content: flex-start;
  min-width: 0;
  width: clamp(252px, 24vw, 378px);
  color: var(--muted);
}
.search-tool kbd {
  margin-left: auto;
  padding: 2px 5px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 3px;
  font: 0.68rem/1.3 var(--mono);
  white-space: nowrap;
}
/* Cross-guide access (the other live guide's tab, "All subjects") below
   760px, where .atlas-bar itself is hidden (see its own 760px rule) — the
   main nav keeps wrapping to its own row there (unchanged), so this is
   just the small addition the platform bar's absence leaves behind. */
.mobile-menu {
  display: none;
}
@media (max-width: 760px) {
  .mobile-menu {
    display: block;
    position: relative;
  }
  .mobile-menu summary {
    width: 40px;
    height: 44px;
    display: grid;
    place-content: center;
    list-style: none;
  }
  .mobile-menu summary::-webkit-details-marker {
    display: none;
  }
  .mobile-menu nav {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 1;
    min-width: 180px;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: 0 6px 20px #27352b18;
    border-radius: 6px;
    padding: 6px;
    display: grid;
  }
  .mobile-menu nav a {
    display: flex;
    align-items: center;
    padding: 9px 13px;
    min-height: 44px;
    border-radius: 4px;
    font-size: 0.9rem;
  }
  .mobile-menu nav a:hover {
    background: var(--hover);
    color: var(--green);
  }
}
.main-nav {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-left: auto;
}
.main-nav a {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 0 clamp(8px, 0.95vw, 16px);
  min-height: 44px;
  border-radius: 5px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 550;
  white-space: nowrap;
}
.main-nav a[aria-current] {
  color: var(--green);
  background: var(--tint);
  box-shadow: inset 0 -3px var(--green);
  font-weight: 650;
}
.mast :is(a, button):focus-visible {
  outline-offset: -3px;
}

/* Platform bar: sits above the guide's own header (.mast) on every page of
   every System Atlas publication, inside the sticky .site-head (see
   layout.mjs and .site-head above). Byte-identical in both guides'
   style.css so the platform feels like one product. Left: the "System
   Atlas" wordmark (brand-mark glyph + small-caps label — a platform-level
   identity distinct from the guide tabs), a hairline divider, then one tab
   per live guide (.guide-tabs), the current guide marked
   aria-current="true". Right: "All subjects", quieter than the tabs, with
   a chevron for affordance. Hidden at the same width the mobile nav takes
   over at — below that, the guide's own nav carries cross-guide access
   instead. */
.atlas-bar {
  background: var(--pale);
  border-bottom: 1px solid var(--line);
  font-size: 0.8rem;
}
.atlas-bar-inner {
  display: flex;
  align-items: stretch;
  gap: clamp(10px, 2.4vw, 22px);
  min-height: 40px;
}
.atlas-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 650 0.74rem var(--sans);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--green);
  white-space: nowrap;
}
.atlas-wordmark .brand-mark {
  transform: scale(0.62);
  margin-right: -7px;
}
.atlas-wordmark:hover {
  color: var(--ink);
}
.guide-tabs {
  display: flex;
  align-items: stretch;
  gap: 2px;
}
.guide-tabs::before {
  content: "";
  align-self: center;
  width: 1px;
  height: 20px;
  margin-right: clamp(10px, 2.4vw, 22px);
  background: var(--line);
}
.guide-tabs a {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  font-weight: 550;
  color: var(--muted);
  white-space: nowrap;
}
.guide-tabs a:hover {
  color: var(--ink);
  background: var(--tab-hover);
}
.guide-tabs a[aria-current="true"] {
  color: var(--ink);
  font-weight: 650;
}
.guide-tabs a[aria-current="true"]::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 14px;
  right: 14px;
  height: 2px;
  background: var(--accent);
}
.guide-tabs a.planned {
  color: var(--muted);
  opacity: 0.75;
}
.guide-tabs a.planned small {
  margin-left: 6px;
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: 600 0.58rem/1.4 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
/* Roadmap and "soon" tabs are secondary; with three of them the bar only
   fits from ~1130px (measured on /system-design/subjects/), so free it up
   below that. Below this same width only the live tabs remain (six of them
   once Java joined Python/SQL/AI/FDE as a live guide), so their padding
   tightens a little too — otherwise six live tabs plus the wordmark and
   "All subjects" no longer fit down to the 760px floor where the whole bar
   hides in favor of the mobile menu. Nine live tabs (Next.js joined
   Kotlin/React) no longer fit this band's original 10px padding either
   (overflowed just above the 899px band below, at 900-901px) — tightened
   to 7px to clear that gap too, then 6px: the bolder current-page "All
   subjects" on /system-design/subjects/ still overflowed ~3px at 900px. */
@media (max-width: 1151px) {
  .guide-tabs a.planned,
  .guide-tabs a.roadmap {
    display: none;
  }
  .guide-tabs a {
    padding: 0 6px;
  }
}
/* Eight live tabs (Kotlin and React joined Java as live guides) no longer
   fit the ~81px narrower box around 768px even with the 1151px tightening
   above, measured on /system-design/subjects/ — so this narrower band
   tightens further still: smaller tab padding and a tighter gap between
   the wordmark / tabs / "All subjects" / theme toggle. Scoped below 900px,
   where the wider breakpoint already fits with room to spare. Nine live
   tabs (Next.js joined Kotlin/React as a live guide) overflowed again at
   768px with the previous values (measured the same way), so the padding,
   gap, and the tab-row's own separator margin are tightened a second time
   here rather than adding yet another breakpoint band. */
@media (max-width: 899px) {
  .atlas-bar-inner {
    gap: clamp(3px, 0.6vw, 8px);
  }
  .guide-tabs::before {
    margin-right: clamp(4px, 1vw, 10px);
  }
  .guide-tabs a {
    padding: 0 3px;
  }
}
.atlas-all-subjects {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  color: var(--muted);
  white-space: nowrap;
}
.atlas-all-subjects .icon {
  width: 13px;
  height: 13px;
}
.atlas-all-subjects:hover,
.atlas-all-subjects[aria-current="page"] {
  color: var(--ink);
}
.atlas-all-subjects[aria-current="page"] {
  font-weight: 650;
}
.atlas-bar a:focus-visible {
  outline-offset: -3px;
}
@media (max-width: 760px) {
  .atlas-bar {
    display: none;
  }
}

.eyebrow,
.mono,
.count,
.index-num,
.topic-num,
.filter-summary,
figcaption,
.resource-row small {
  font-family: var(--mono);
}
.eyebrow {
  font-size: 0.67rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.135em;
  line-height: 1.65;
  color: var(--green);
  display: flex;
  align-items: center;
  gap: 10px;
}
.accent-line {
  width: 24px;
  height: 2px;
  background: var(--accent);
}
.actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.button {
  border: 1px solid transparent;
  border-radius: 5px;
  min-height: 45px;
  padding: 10px 17px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  font: 600 0.88rem/1.45 var(--sans);
  transition:
    background 0.15s,
    border-color 0.15s;
}
.button.primary {
  background: var(--green);
  color: #fffef6;
  border-color: var(--green);
}
.button.primary:hover {
  background: #1b3b2e;
}
.button.secondary {
  border-color: #acb3a5;
  background: transparent;
}
.button.secondary:hover,
.button.secondary[aria-pressed="true"] {
  background: var(--pale);
  border-color: #839382;
}
.button.primary[aria-pressed="true"] {
  background: var(--pale);
  color: var(--green);
}
.resume-destination {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}
/* The cover and its linked hardware lesson form one spread. */
.hero {
  --cover: #193d32;
  --cover-text: #fff9ea;
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 1fr);
  align-items: stretch;
  margin-top: clamp(18px, 2.2vw, 32px);
  overflow: hidden;
  background: var(--cover);
  color: var(--cover-text);
  border-radius: 12px;
}
.hero-copy {
  align-self: center;
  padding: clamp(28px, 3.25vw, 50px);
}
.track-switch,
.reading-track,
.track-switch a {
  display: flex;
  align-items: center;
}
.track-switch {
  flex-wrap: wrap;
  gap: 3px 12px;
  margin-bottom: 14px;
}
.reading-track {
  gap: 8px;
  border-right: 1px solid #799783;
  padding-right: 12px;
  color: #c9deca;
  font: 600 0.75rem/1.35 var(--mono);
}
.track-switch a {
  min-height: 32px;
  gap: 5px;
  color: var(--cover-text);
  font-size: 0.82rem;
  text-decoration: underline;
  text-decoration-color: #9eb4a3;
  text-underline-offset: 4px;
}
.track-switch a:hover {
  text-decoration-color: currentColor;
}
.reading-track .icon {
  width: 17px;
  height: 17px;
}
.hero h1 {
  font-size: clamp(3.15rem, 5.8vw, 5.45rem);
  line-height: 0.99;
  letter-spacing: -0.055em;
}
.hero h1 em {
  color: #f6bd91;
  font-weight: 400;
}
.intro {
  max-width: 46ch;
  margin: 20px 0 24px;
  color: #e0e9dc;
  font-size: clamp(1rem, 1.18vw, 1.075rem);
  line-height: 1.55;
}
.hero-start {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
}
.hero .button.primary {
  background: var(--cover-text);
  color: var(--cover);
  border-color: var(--cover-text);
}
.hero .button.primary:hover {
  background: #f6dbc2;
  border-color: #f6dbc2;
}
/* "See the curriculum" — the hero sits on the dark cover, so the shared
   secondary-button palette (meant for paper) is re-tinted here. */
.hero .button.secondary {
  border-color: #799783;
  color: var(--cover-text);
}
.hero .button.secondary:hover {
  background: #2a5242;
  border-color: #9eb4a3;
}
.hero a:focus-visible {
  outline-color: #ffd09e;
}
.hero .resume-destination {
  color: #ccdbce;
  flex: 1 1 15ch;
  max-width: 38ch;
  margin: 0;
  overflow-wrap: anywhere;
}
.blueprint {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: clamp(20px, 2.5vw, 38px);
  border-left: 1px solid #446456;
  background-color: #234b3c;
  background-image: linear-gradient(#c9e1bc0c 1px, transparent 1px),
    linear-gradient(90deg, #c9e1bc0c 1px, transparent 1px),
    radial-gradient(ellipse at center, #375b43, transparent 72%);
  background-size: 24px 24px, 24px 24px, 100% 100%;
}
.blueprint:focus-visible {
  outline-offset: -5px;
}
.blueprint picture, .blueprint img {
  display: block;
  width: 100%;
}
.blueprint img {
  max-height: 285px;
  height: auto;
  object-fit: contain;
}
/* Title bar above the exploded drawing — same framed-figure look as the
   course heroes (context on the left, figure number on the right). */
.drawing-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: min(100%, 410px);
  padding-bottom: 12px;
  border-bottom: 1px solid #77917e;
  font: 0.7rem/1.4 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #d8e8d0;
}
.plate-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: min(100%, 410px);
  padding-top: 12px;
  border-top: 1px solid #77917e;
}
.plate-caption small {
  font: 0.7rem/1.4 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #d8e8d0;
}
.plate-caption strong {
  margin-left: 12px;
  font: 500 1.2rem/1.2 var(--serif);
}
.plate-caption > .icon {
  box-sizing: content-box;
  padding: 7px;
  border: 1px solid #799783;
  border-radius: 50%;
}
.blueprint:hover .plate-caption strong {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.blueprint:hover .plate-caption > .icon {
  background: var(--cover-text);
  color: var(--cover);
}

@media (max-width: 900px) {
  .hero-copy, .blueprint {
    padding: 25px;
  }
  .hero-start {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .hero .resume-destination {
    flex: none;
    max-width: 100%;
  }
  .hero .button {
    padding-inline: 12px;
  }
}
@media (max-width: 760px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    margin-top: 16px;
  }
  .hero-copy {
    padding: 24px;
  }
  .hero h1 {
    font-size: clamp(2.8rem, 10vw, 3.75rem);
  }
  .track-switch {
    margin-bottom: 10px;
  }
  .intro {
    margin: 14px 0 18px;
  }
  .blueprint {
    flex-direction: row;
    gap: 18px;
    padding: 8px 24px;
    border-left: 0;
    border-top: 1px solid #537360;
  }
  .blueprint picture {
    width: 94px;
    flex: none;
  }
  /* The compact thumbnail row has no room for the figure title bar. */
  .drawing-head {
    display: none;
  }
  .plate-caption {
    border: 0;
    padding: 0;
    width: auto;
    flex: 1;
  }
  .plate-caption small, .plate-caption strong {
    display: block;
  }
  .plate-caption strong {
    margin: 3px 0 0;
  }
}
@media (max-width: 380px) {
  .hero-copy {
    padding: 21px 17px;
  }
  .hero .button {
    padding-inline: 10px;
    font-size: 0.82rem;
    gap: 6px;
  }
  .blueprint {
    padding-inline: 17px;
    gap: 10px;
  }
  .blueprint picture {
    width: 76px;
  }
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 19px 0;
  border-block: 1px solid #aeb7a6;
}
.stat {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  font-size: 0.84rem;
  color: var(--muted);
  border-left: 1px solid var(--line);
  min-height: 26px;
}
.stat:first-child {
  border-left: 0;
}
.stat > .icon {
  color: var(--green);
  width: 21px;
  height: 21px;
}
.stat b {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 650;
  margin-right: 2px;
}
.stat:hover span {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.home-section {
  margin: 43px 0 54px;
}
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 21px;
}
.section-heading h2 {
  font-size: clamp(2.05rem, 3vw, 2.7rem);
}
.section-heading p,
.page-heading > p:last-child:not(.eyebrow) {
  color: var(--muted);
  margin-top: 8px;
}
.text-link,
.card-link,
.lesson-end > a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--green);
  font-weight: 650;
  font-size: 0.85rem;
}
.text-link:hover,
.lesson-end > a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.section-heading > .text-link {
  white-space: nowrap;
  min-height: 32px;
}
.track-cards,
.catalog-grid,
.resource-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 17px;
}
.core {
  --tint: #e3eddf;
  --tint-ink: #3a634c;
  --plate-rule: #a8bfaa;
}
.senior {
  --tint: #f4e5d7;
  --tint-ink: #8d4d32;
  --plate-rule: #d0b398;
}
.specialist {
  --tint: #e1eaec;
  --tint-ink: #3d6370;
  --plate-rule: #a6bfc4;
}
.track-card {
  --edge: clamp(16px, 1.65vw, 24px);
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid #c4caba;
  border-radius: 8px;
  background: var(--surface);
  transition:
    border-color 0.18s,
    box-shadow 0.18s,
    transform 0.18s;
}
.track-card:has(.current-track:not([hidden])) {
  border-color: var(--tint-ink);
  box-shadow: inset 0 -3px var(--tint-ink);
}
.track-card:hover {
  border-color: var(--tint-ink);
  box-shadow: 0 4px 12px #1a352313;
  transform: translateY(-2px);
}
.project-card:hover,
.resource-row:hover {
  background: var(--pale);
  border-color: #99a28f;
}
.track-figure,
.collection-plate {
  position: relative;
  isolation: isolate;
  background-color: var(--tint);
  background-image: radial-gradient(var(--plate-rule) 0.8px, transparent 0.8px);
  background-size: 10px 10px;
}
.track-figure {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  min-height: 112px;
  border-bottom: 1px solid var(--line);
  padding: 14px var(--edge);
}
.track-figure img {
  position: absolute;
  right: 4%;
  top: 0;
  width: 56%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 3px 2px #27443416);
}
.count {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  color: var(--tint-ink);
  background: var(--tint);
  border: 1px solid var(--plate-rule);
  padding: 3px 7px;
  border-radius: 3px;
  font: 550 0.68rem/1.4 var(--mono);
}
.track-copy {
  padding: 17px var(--edge) 0;
}
.track-card h3 {
  font-size: clamp(1.6rem, 2.3vw, 2.1rem);
}
.track-card p,
.project-card > p {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 7px 0 15px;
}
.track-foot {
  margin: auto var(--edge) 0;
  border-top: 1px solid var(--line);
  padding: 11px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
  flex-wrap: wrap;
}
.card-link {
  color: var(--tint-ink);
}
.card-link .icon,
.text-link .icon {
  width: 16px;
}
.current-track {
  color: var(--tint-ink);
  background: var(--tint);
  border-radius: 3px;
  padding: 3px 6px;
  font: 0.7rem/1.4 var(--mono);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.track-card:hover .card-link {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.learning-tracks {
  scroll-margin-top: 20px;
  margin-top: clamp(28px, 3.4vw, 49px);
}
footer {
  border-top: 1px solid var(--line);
  margin-top: 48px;
}
footer > .wrap.footer-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 28px 56px;
  padding-top: 28px;
  padding-bottom: 28px;
  font-size: 0.8rem;
  color: var(--muted);
}
footer .brand {
  font-size: 19px;
  color: var(--ink);
}
footer .brand-mark {
  transform: scale(0.78);
  margin-right: -4px;
}
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-right: auto;
}
.footer-col {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.footer-col strong {
  color: var(--ink);
  font: 600 0.8rem var(--sans);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 2px;
}
footer a:hover {
  text-decoration: underline;
}
.page-heading {
  max-width: 830px;
  margin: 52px 0 29px;
}
.page-heading .eyebrow,
.reader-head .eyebrow {
  margin-bottom: 13px;
  color: var(--accent);
}
.page-heading > p:last-child:not(.eyebrow) {
  font-size: 1.04rem;
  max-width: 920px;
  line-height: 1.65;
  margin-top: 17px;
}
.crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 0.82rem;
  margin: 24px 0 19px;
}
.crumb .icon {
  width: 13px;
}
.crumb a:hover {
  color: var(--accent);
  text-decoration: underline;
}
.crumb + .page-heading {
  margin-top: 28px;
}
.track-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border: 0;
  padding: 4px;
  border-radius: 6px;
  background: var(--pale);
  width: fit-content;
  margin: 26px 0 12px;
}
.track-filter legend {
  position: absolute;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
}
.track-filter label {
  position: relative;
}
.track-filter input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.track-filter span {
  display: block;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 550;
  color: var(--muted);
}
.track-filter input:checked + span {
  background: var(--surface);
  border-color: #bec6b7;
  color: var(--ink);
  box-shadow: 0 1px 2px #24392612;
}
.track-filter input:focus-visible + span {
  outline: 3px solid var(--accent);
}
.filter-summary {
  font-size: 0.72rem;
  color: var(--muted);
  margin: 14px 0 20px;
}
.part-list {
  border-top: 1px solid var(--line);
}
.part-row,
.topic-row {
  display: flex;
  align-items: center;
  gap: 21px;
  border-bottom: 1px solid var(--line);
  padding: 21px 8px;
}
.part-row:hover,
.topic-row:hover {
  background: var(--pale);
}
.index-num,
.topic-num {
  color: var(--accent);
  font-size: 0.85rem;
}
.row-main {
  display: grid;
  gap: 4px;
  flex: 1;
}
.row-main > strong {
  font-size: 1.1rem;
  font-weight: 600;
}
.row-main > span,
.row-count {
  color: var(--muted);
  font-size: 0.88rem;
}
.row-count {
  white-space: nowrap;
}
.row-count b {
  font-weight: 500;
}
.part-row > .icon,
.topic-row > .icon {
  width: 15px;
  color: var(--muted);
}
.prereq,
.project-meta {
  background: var(--pale);
  border-left: 3px solid #91a78e;
  padding: 13px 16px;
  font-size: 0.91rem;
  max-width: 780px;
}
.prereq b,
.project-meta b {
  margin-right: 10px;
}
.prereq a,
.project-meta a {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.chapter-block,
.part-end {
  margin: 35px 0;
}
.chapter-block h2,
.part-end h2,
.list-heading,
.plan-progress h2 {
  font-size: 2rem;
}
.chapter-block h2 .mono {
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--accent);
  letter-spacing: 0;
  vertical-align: middle;
}
.outcomes {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 12px 0;
}
.outcomes summary {
  width: fit-content;
  padding: 6px 0;
  color: var(--green);
  font-weight: 550;
}
.outcomes .prose {
  margin: 8px 0;
  background: var(--hover);
  padding: 12px 20px;
}
.topic-row {
  padding: 13px 5px;
  gap: 15px;
}
.topic-row strong {
  font-weight: 500;
  flex: 1;
}
.tag {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 3px 9px;
  white-space: nowrap;
  color: var(--muted);
  background: var(--paper);
  font: 500 0.7rem/1.5 var(--sans);
}
.list-heading {
  margin: 31px 0 17px;
}
.part-end .resource-grid {
  margin-top: 20px;
}
.reader-grid {
  display: grid;
  grid-template-columns: 230px minmax(0, 920px);
  gap: clamp(35px, 6vw, 95px);
  align-items: start;
  justify-content: center;
  margin: 35px 0;
}
.reader-grid article {
  min-width: 0;
}
.outline {
  position: sticky;
  /* Docks just below the sticky .site-head instead of at the bare viewport
     top, keeping the original 20px breathing room beneath it. */
  top: calc(var(--head-h) + 20px);
  align-self: start;
}
.outline > div {
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  padding: 5px;
}
.outline .eyebrow {
  margin: 3px 10px 12px;
}
.outline nav {
  display: grid;
}
.outline nav a {
  color: var(--muted);
  font-size: 0.86rem;
  padding: 8px 10px;
  border-left: 3px solid transparent;
}
.outline nav a:hover {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.outline details {
  display: none;
}
.reader-head {
  border-bottom: 1px solid var(--line);
  padding: 0 0 26px;
  margin-bottom: 24px;
}
.reader-head h1,
.reader-grid .page-heading h1 {
  font-size: clamp(2.2rem, 4vw, 3.7rem);
  overflow-wrap: break-word;
}
.reader-head p:not(.eyebrow) {
  color: var(--muted);
  margin: 12px 0 18px;
}
.reader-head .eyebrow span {
  color: var(--dim);
}
.reader-grid .page-heading {
  margin: 0 0 26px;
}
.prose {
  font-size: 1rem;
  line-height: 1.75;
  overflow-wrap: break-word;
  color: var(--prose);
}
.prose section {
  scroll-margin-top: 14px;
}
.prose h2 {
  font-size: 2rem;
  margin: 1.25em 0 0.42em;
}
.prose h3 {
  font-size: 1.58rem;
  margin: 1.1em 0 0.4em;
}
.prose p,
.prose ul,
.prose ol,
.prose .table-scroll,
.prose pre {
  margin: 0 0 1em;
}
.prose ul,
.prose ol {
  padding-left: 1.5em;
}
.prose li {
  padding-left: 0.12em;
  margin: 0.35em 0;
}
.prose code {
  font: 0.85em/1.6 var(--mono);
  background: var(--pale);
  border-radius: 3px;
  padding: 1px 4px;
  overflow-wrap: anywhere;
}
.prose pre {
  background: var(--code-bg);
  color: var(--code-fg);
  border-radius: 6px;
  padding: 18px;
  overflow-x: auto;
  line-height: 1.5;
}
.prose pre code {
  background: transparent;
  padding: 0;
  color: inherit;
  font-size: 0.84rem;
}
.prose a {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.prose hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 24px 0;
}
.table-scroll {
  overflow-x: auto;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
}
table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
  font-size: 0.88rem;
  line-height: 1.55;
}
th,
td {
  padding: 10px 13px;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
th {
  background: var(--pale);
}
tr:last-child td {
  border-bottom: 0;
}
td {
  min-width: 95px;
}
.prose blockquote {
  margin: 1em 0;
  padding-left: 18px;
  border-left: 3px solid var(--line);
}
.lesson-end,
.project-tools {
  border-block: 1px solid var(--line);
  padding: 18px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 25px 0;
}
.project-tools select {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 6px;
  background: var(--surface);
  font-size: 0.9rem;
}
.project-tools label {
  font-size: 0.85rem;
  color: var(--muted);
}
.project-card,
.resource-row,
.plan-progress {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 22px;
}
.project-card {
  display: flex;
  flex-direction: column;
}
.project-card .eyebrow {
  color: var(--accent);
  margin-bottom: 14px;
}
.project-card h2 {
  font-size: 1.75rem;
}
.project-card > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: auto;
  font-size: 0.79rem;
  color: var(--green);
  font-weight: 550;
}
.resource-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}
.resource-row small {
  color: var(--accent);
  display: block;
  font-size: 0.65rem;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  margin-bottom: 5px;
}
.resource-row strong {
  font-size: 1rem;
  font-weight: 580;
}
.plan-progress {
  max-width: 780px;
  background: var(--pale);
}
.plan-progress h2 {
  margin: 10px 0 5px;
}
.plan-progress progress {
  display: block;
  width: min(400px, 100%);
  height: 8px;
  border: 0;
  background: #d0d8c8;
  accent-color: var(--green);
  border-radius: 4px;
  overflow: hidden;
  margin: 14px 0 18px;
}
progress::-webkit-progress-bar {
  background: #d0d8c8;
}
progress::-webkit-progress-value {
  background: var(--green);
}
.saved-row {
  display: flex;
  align-items: center;
  gap: 15px;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}
.saved-row a {
  flex: 1;
}
.saved-row small,
.result small {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
}
.saved-row button {
  font-size: 0.8rem;
  text-decoration: underline;
  min-height: 40px;
}
.empty-state {
  background: var(--hover);
  border: 1px dashed #bfc8b7;
  border-radius: 5px;
  padding: 20px;
}
.empty-state a {
  text-decoration: underline;
}
dialog {
  border: 1px solid #b5bfad;
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  padding: 23px;
  width: min(560px, calc(100% - 28px));
  max-height: 80dvh;
  box-shadow: 0 20px 90px #10271a33;
}
dialog::backdrop {
  background: #202c2678;
}
.dialog-head,
.search-input {
  display: flex;
  align-items: center;
  gap: 10px;
}
.dialog-head {
  justify-content: space-between;
  margin-bottom: 15px;
}
.dialog-head h2 {
  font-size: 1.9rem;
}
.dialog-head button {
  width: 38px;
  height: 38px;
}
.search-input {
  border: 1px solid #879782;
  background: var(--surface);
  border-radius: 5px;
  padding: 0 12px;
}
.search-input input {
  border: 0;
  background: none;
  flex: 1;
  min-width: 0;
  line-height: 46px;
  outline: 0;
}
.search-input:focus-within {
  outline: 2px solid var(--green);
}
#result-count {
  font: 0.77rem/1.5 var(--mono);
  color: var(--muted);
  margin: 13px 0 7px;
}
.result {
  display: block;
  border-bottom: 1px solid var(--line);
  padding: 11px 7px;
}
.result:hover,
.result:focus-visible {
  background: var(--pale);
}
.result:focus-visible {
  /* Rows sit flush; the global +4px outline-offset ring would be painted
     over by the next sibling, so draw the ring inside the row instead. */
  outline-offset: -3px;
}
.result strong {
  font-size: 0.94rem;
  font-weight: 550;
}
@media (max-width: 970px) {
  .reader-grid {
    grid-template-columns: 160px minmax(0, 1fr);
    gap: 30px;
  }
  .catalog-grid,
  .resource-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 980px) {
  :root {
    /* Below 980px the main nav wraps onto its own row (below), making the
       mast itself taller than the single-row desktop height — .site-head
       needs a second step here in addition to the 760px one below, or the
       980–760px band (bar still visible, mast already 2 rows) would
       undershoot and hide part of a jumped-to heading under the header. */
    --head-h: 148px;
  }
  .mast-inner {
    flex-wrap: wrap;
    gap: 0 6px;
    padding-top: 6px;
  }
  .mast .brand {
    gap: 9px;
    font-size: 21px;
  }
  .search-tool {
    width: auto;
    margin-left: auto;
  }
  .search-tool kbd {
    display: none;
  }
  .main-nav {
    flex-basis: 100%;
    flex-wrap: wrap;
    align-self: stretch;
    margin: 5px 0 0;
    padding: 3px 0;
    border-top: 1px solid var(--line);
  }
  .main-nav a {
    flex: 1 1 auto;
    padding-inline: 7px;
  }
}
@media (max-width: 580px) {
  .main-nav {
    gap: 0;
  }
  .main-nav a {
    font-size: 0.83rem;
    padding-inline: 4px;
  }
  .main-nav a .icon {
    display: none;
  }
  .search-tool {
    padding-inline: 8px;
  }
}
@media (max-width: 420px) {
  .mast .brand {
    font-size: clamp(17px, 4.9vw, 20px);
    gap: 6px;
  }
  .search-tool .icon {
    display: none;
  }
  .search-tool {
    padding-inline: 6px;
    font-size: 0.8rem;
    gap: 4px;
  }
  .main-nav a {
    padding-inline: 2px;
    font-size: 0.8rem;
  }
}
@media (max-width: 760px) {
  :root {
    /* The platform bar hides below this width (see .atlas-bar's own
       760px rule) — .site-head's sticky height drops to the (still
       2-row, see the 980px step above) mast alone. */
    --head-h: 107px;
  }
  .wrap,
  .mast-inner {
    width: calc(100% - 40px);
  }
  .stat {
    gap: 6px;
    font-size: 0.77rem;
  }
  .stat > .icon {
    width: 17px;
  }
  .stats {
    padding: 14px 0;
  }
  .track-cards {
    gap: 10px;
  }
  .home-section {
    margin: 32px 0 36px;
  }
  .section-heading {
    align-items: start;
  }
  .section-heading p {
    font-size: 0.94rem;
  }
  .reader-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    margin-top: 17px;
  }
  .outline {
    position: static;
  }
  .outline > div {
    display: none;
  }
  .outline details {
    display: block;
    border-block: 1px solid var(--line);
    padding: 4px 0;
  }
  .outline summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: 600;
    min-height: 42px;
  }
  .outline details[open] summary > .icon {
    transform: rotate(180deg);
  }
  .outline nav a {
    padding: 10px 6px;
  }
  .page-heading {
    margin-top: 34px;
  }
  .prose h2 {
    font-size: 1.75rem;
  }
  .reader-head {
    padding-bottom: 20px;
  }
  footer .wrap > span {
    display: none;
  }
}
@media (max-width: 580px) {
  .stats {
    grid-template-columns: 1fr 1fr;
    padding: 0;
  }
  .stat {
    justify-content: start;
    padding: 12px 7px;
    gap: 9px;
    font-size: 0.8rem;
  }
  .stat:nth-child(odd) {
    border-left: 0;
  }
  .stat:nth-child(even) {
    padding-left: 14px;
  }
  .stat:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
  .section-heading {
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 15px;
  }
  .section-heading > .text-link {
    min-height: 36px;
  }
  .track-cards,
  .catalog-grid,
  .resource-grid {
    grid-template-columns: 1fr;
  }
  .section-heading h2 {
    font-size: 2rem;
  }
  .track-filter {
    gap: 0;
    max-width: 100%;
  }
  .track-filter span {
    padding: 10px 9px;
    font-size: 0.78rem;
  }
  .index-num {
    font-size: 0.75rem;
  }
  .part-row {
    gap: 12px;
    padding: 15px 0;
  }
  .row-main > strong {
    font-size: 1rem;
  }
  .row-main > span {
    font-size: 0.83rem;
  }
  .row-count {
    font-size: 0.71rem;
  }
  .part-row > .icon {
    display: none;
  }
  .topic-row {
    gap: 8px;
    align-items: start;
  }
  .topic-row strong {
    font-size: 0.92rem;
  }
  .topic-row > .icon {
    display: none;
  }
  .tag {
    font-size: 0.65rem;
  }
  .chapter-block h2,
  .part-end h2 {
    font-size: 1.8rem;
  }
  .resource-grid {
    gap: 10px;
  }
  .project-card,
  .resource-row {
    padding: 17px;
  }
  .crumb {
    margin: 18px 0;
  }
  .prose {
    font-size: 1rem;
  }
  .project-tools {
    align-items: start;
  }
  .page-heading h1 {
    font-size: 2.7rem;
  }
  .lesson-end {
    gap: 17px;
  }
  .brand {
    gap: 9px;
  }
  footer .wrap {
    gap: 10px;
    justify-content: space-between;
  }
  footer a:last-child {
    font-size: 0.72rem;
  }
  .saved-row button {
    min-height: 44px;
  }
}
@media (max-width: 350px) {
  .wrap,
  .mast-inner {
    width: calc(100% - 28px);
  }
  .track-filter span {
    padding: 10px 7px;
  }
  .track-filter {
    flex-wrap: wrap;
  }
  .brand {
    font-size: 18px;
  }
  .row-count {
    white-space: normal;
    max-width: 36px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
@media (max-width: 760px) {
  .empty-outline {
    display: none;
  }
}

.prose section:is(#practice, #takeaway) {
  background: #eef0e5;
  border-left: 3px solid #93a68f;
  padding: 1px 18px 12px;
  margin: 22px 0;
}
.prose section:is(#practice, #takeaway) h2 {
  margin-top: 16px;
}
.prose section:is(#practice, #takeaway) > :last-child {
  margin-bottom: 0;
}

/* Reader navigation and search */
.outline nav a[aria-current="location"] {
  border-color: var(--green);
  color: var(--green);
  background: var(--tint);
  font-weight: 650;
}
.outline summary {
  gap: 10px;
}
.outline [data-current-section] {
  margin-left: auto;
  font-weight: 500;
  color: var(--accent);
  text-align: end;
}
#search-dialog[open] {
  display: flex;
  flex-direction: column;
  max-height: min(78dvh, 43rem);
}
.dialog-head,
.search-input,
#result-count {
  flex-shrink: 0;
}
.search-scroll {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px;
  margin: -4px;
}
#more-results {
  width: 100%;
  margin-top: 12px;
}

@media (max-width: 760px) {
  .reader-grid {
    display: block;
  }
  .reader-grid .outline {
    position: sticky;
    /* Docks below the sticky .site-head (mast only at this width — the
       platform bar is hidden) instead of at the bare viewport top. */
    top: var(--head-h);
    z-index: 2;
    margin-bottom: 18px;
    background: var(--paper);
  }
  .outline details[open] nav {
    max-height: min(50dvh, 22rem);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .reader-grid article :is(section[id], h2[id]) {
    /* Unchanged: still just the mobile outline bar's own clearance — it
       stacks with html's scroll-padding-top (which now covers the sticky
       mast) rather than duplicating it. */
    scroll-margin-top: 72px;
  }
}

.collection-heading {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 29%);
  align-items: stretch;
  background: var(--tint);
  border: 1px solid var(--plate-rule);
  border-radius: 8px;
  margin: 36px 0 26px;
  overflow: hidden;
}
.collection-heading .page-heading {
  margin: 0;
  max-width: unset;
  padding: clamp(24px, 3.2vw, 47px);
}
.collection-heading .page-heading .eyebrow {
  color: var(--tint-ink);
}
.collection-heading .page-heading > p:last-child {
  max-width: 57ch;
}
.collection-plate {
  display: grid;
  place-items: center;
  border-left: 1px solid var(--plate-rule);
}
.collection-plate img {
  display: block;
  width: 95%;
  max-width: 360px;
  height: auto;
}
.part-row .index-num {
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  background: #eef0e6;
  border: 1px solid #ccd2c1;
  border-radius: 5px;
  font: 500 0.76rem/1 var(--mono);
  color: var(--green);
}
.reader-grid .prose {
  font-size: 1.08rem;
  line-height: 1.72;
}
.reader-grid .prose :is(p, ul, ol) {
  max-width: none;
}
.reader-grid .prose table p {
  max-width: none;
}
.prose h2 {
  letter-spacing: -0.035em;
}
.plan-progress {
  background-color: var(--tint);
  background-image:
    linear-gradient(95deg, #e7eee0 42%, transparent 87%),
    radial-gradient(#afc1a7 0.8px, transparent 0.8px);
  background-size:
    auto,
    9px 9px;
  border-left: 4px solid #476b50;
}
@media (min-width: 761px) {
  .track-foot {
    min-height: 48px;
  }
}
@media (max-width: 760px) {
  .collection-heading {
    grid-template-columns: minmax(0, 1fr) 24%;
    margin: 24px 0;
  }
  .track-copy {
    padding-top: 13px;
  }
  .track-card {
    --edge: 13px;
  }
  .track-figure {
    min-height: 78px;
    padding: 10px;
  }
  .track-figure img {
    right: 0;
    width: 57%;
  }
  .track-card p {
    font-size: 0.9rem;
  }
  .track-foot {
    font-size: 0.78rem;
  }
  .reader-grid .prose {
    font-size: 1rem;
  }
}
@media (max-width: 580px) {
  .learning-tracks {
    margin-top: 26px;
  }
  .track-card {
    display: grid;
    grid-template-columns: 98px minmax(0, 1fr);
  }
  .track-figure {
    grid-row: span 2;
    align-self: stretch;
    min-height: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    border-bottom: 0;
    border-right: 1px solid var(--line);
    padding: 12px 3px;
  }
  .track-figure img {
    right: -8%;
    top: 28px;
    width: 116%;
    height: calc(100% - 44px);
    max-height: 94px;
  }
  .track-copy {
    padding: 12px 14px 0;
  }
  .track-card h3 {
    font-size: 1.55rem;
  }
  .track-card p {
    font-size: 0.88rem;
    line-height: 1.48;
    margin: 5px 0 9px;
  }
  .track-foot {
    margin: 0 14px;
    padding: 7px 0;
  }
  .card-link {
    font-size: 0.76rem;
  }
  .current-track {
    font-size: 0.65rem;
  }
  .section-heading > .text-link {
    min-height: 32px;
  }
  .collection-heading {
    display: block;
    margin: 21px 0;
  }
  .collection-heading .page-heading {
    padding: 22px;
  }
  .collection-heading .collection-plate {
    display: none;
  }
  .part-row .index-num {
    width: 29px;
    height: 29px;
  }
}
@media (max-width: 350px) {
  .track-card {
    grid-template-columns: 78px minmax(0, 1fr);
  }
}

.practice-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 4px;
  color: var(--green);
  font-size: 0.85rem;
}
.practice-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.lesson-pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.lesson-pager a {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}
.lesson-pager a:last-child {
  background: #e9eee2;
}
.lesson-pager small {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
  color: var(--muted);
  font: 0.72rem/1.45 var(--mono);
}
.lesson-pager strong {
  font: 550 1rem/1.5 var(--sans);
}
.lesson-pager a:hover {
  border-color: var(--green);
}
@media (max-width: 580px) {
  .lesson-pager {
    grid-template-columns: 1fr;
    gap: 7px;
  }
  .lesson-pager a {
    padding: 12px 14px;
  }
}

.subject-section {
  margin-block: 26px 38px;
}
.subject-section > h2 {
  font-size: 1.65rem;
  margin-bottom: 14px;
}
.subject-guide {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
  margin-bottom: 14px;
}
.subject-guide-copy {
  flex: 1;
  padding: clamp(22px, 3.5vw, 44px);
}
.subject-guide-copy h3 {
  font-size: clamp(2rem, 3.5vw, 3rem);
}
.subject-guide-copy p {
  max-width: 51ch;
  margin-top: 12px;
  color: var(--muted);
}
.subject-guide-copy a {
  margin-top: 20px;
}
.subject-art {
  flex: 0 0 35%;
  display: grid;
  place-items: center;
  background-color: #203e34;
  background-image:
    linear-gradient(#a3bd9c18 1px, transparent 1px),
    linear-gradient(90deg, #a3bd9c18 1px, transparent 1px);
  background-size: 20px 20px;
}
.subject-art img {
  /* Height-capped so differently proportioned source art (wide server
     render vs squarer Python layers) sits at one visual scale per plate. */
  width: auto;
  max-width: min(100%, 350px);
  max-height: 190px;
  height: auto;
}
.planned-subjects {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.planned-subjects li,
.planned-subjects > a {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  padding: 16px 20px;
  border-radius: 6px;
  color: var(--ink);
  font: 500 1.35rem/1.25 var(--serif);
}
/* Roadmap cards are real links into roadmaps/<id>/; keep them as quiet as
   the unlinked planned entries, with only hover + chevron as affordance. */
.planned-subjects > a {
  text-decoration: none;
}
.planned-subjects > a:hover {
  border-color: var(--line-strong);
  background: var(--pale);
}
.planned-subjects > a > .icon:last-child {
  margin-left: auto;
  color: var(--muted);
}
.section-note {
  margin: -6px 0 18px;
  color: var(--muted);
  font-size: 0.92rem;
  max-width: 62ch;
}
/* One-line course summary under the title (kept small and muted so the
   card stays as quiet as a bare name). */
.planned-subjects li span,
.planned-subjects > a > span {
  display: grid;
  gap: 4px;
}
.planned-subjects li small,
.planned-subjects > a small {
  color: var(--muted);
  font: 400 0.84rem/1.45 var(--sans);
}
.planned-subjects .icon {
  color: var(--muted);
  width: 20px;
  height: 20px;
}
.planned-subjects li:target {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
@media (max-width: 580px) {
  .subject-art {
    display: none;
  }
  .planned-subjects {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .planned-subjects li {
    padding: 13px 15px;
  }
}

/* Course roadmap pages (roadmaps/<id>/) — long-form markdown from the
   course repos; keep it calm: one status note, a flat section nav, then
   plain prose sections. */
.roadmap-status {
  margin: -8px 0 20px;
  color: var(--muted);
  max-width: 68ch;
}
/* Roadmap pages replace the guide nav with a quiet status label. */
.mast-note {
  margin-left: auto;
  color: var(--muted);
  font: 600 0.72rem/1.3 var(--sans);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  white-space: nowrap;
}
@media (max-width: 980px) {
  .mast-note {
    display: none;
  }
}
.roadmap-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 28px;
}
.roadmap-nav a {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  font: 550 0.82rem/1.3 var(--sans);
  color: var(--green);
  text-decoration: none;
}
@media (pointer: coarse) {
  /* Touch tap-target floor; desktop keeps the compact pill height. */
  .roadmap-nav a {
    min-height: 44px;
  }
}
.roadmap-nav a:hover {
  background: var(--pale);
  border-color: var(--line-strong);
}
.roadmap-section {
  margin: 0 0 34px;
  max-width: 76ch;
}
.roadmap-section > h2 {
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
  scroll-margin-top: calc(var(--head-h, 120px) + 16px);
}
.roadmap-section h3 {
  margin: 1.8em 0 0.5em;
}
.roadmap-section h4 {
  margin: 1.5em 0 0.4em;
}

/* Python workbench (in-lesson playground) */
.workbench {
  margin: 2rem 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.workbench summary {
  cursor: pointer;
  padding: 0.8rem 1rem;
  font: 600 0.95rem var(--sans);
  color: var(--green);
}
.workbench[open] summary { border-bottom: 1px solid var(--line); }
.workbench-note {
  margin: 0.75rem 1rem 0.25rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.workbench textarea {
  display: block;
  width: calc(100% - 2rem);
  margin: 0.75rem 1rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--pale);
  color: var(--ink);
  font: 0.85rem/1.55 var(--mono);
  resize: vertical;
}
.workbench-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 1rem 0.75rem;
}
.workbench-status { font-size: 0.85rem; color: var(--muted); }
.workbench-out {
  margin: 0 1rem 1rem;
  padding: 0.75rem;
  border-radius: 8px;
  background: var(--code-bg);
  color: var(--code-fg);
  font: 0.85rem/1.55 var(--mono);
  overflow-x: auto;
}

/* Layered code editor: a highlight layer sits behind the textarea. The
   textarea keeps the caret and all input, with transparent text so the
   colored layer shows through; font, padding and (no-)wrapping must match
   exactly between the two, or the caret drifts off the glyphs. */
.code-editor {
  position: relative;
  margin: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--pale);
  overflow: hidden;
}
.code-editor textarea,
.code-editor-hl {
  margin: 0;
  padding: 0.75rem;
  font: 0.85rem/1.55 var(--mono);
  white-space: pre;
  overflow-wrap: normal;
  tab-size: 4;
}
.code-editor textarea {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: transparent;
  caret-color: var(--ink);
  resize: vertical;
  overflow: auto;
}
.code-editor textarea:focus-visible { outline-offset: -2px; }
.code-editor-hl {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  color: var(--ink);
}
.code-editor-hl code { display: block; font: inherit; }
.code-editor-hl .syn-kw,
pre code .syn-kw { color: var(--green); font-weight: 600; }
.code-editor-hl .syn-def,
pre code .syn-def { font-weight: 600; }
.code-editor-hl .syn-str,
pre code .syn-str { color: var(--accent); }
.code-editor-hl .syn-num,
pre code .syn-num { color: var(--syn-num); }
.code-editor-hl .syn-com,
pre code .syn-com { color: var(--muted); font-style: italic; }
.code-editor-hl .syn-errline {
  display: inline-block;
  width: 100%;
  background: var(--syn-errline);
}
/* Run output sits on the dark code background in both themes, so a single
   error red reads well everywhere; stdout keeps the normal output color. */
.workbench-out .syn-err,
.block-out .syn-err { color: #ffa38f; }

/* Diagram visualizations */
figure.viz {
  margin: 1.25rem 0;
  padding: 0.5rem 0.5rem 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
figure.viz { overflow-x: auto; }
figure.viz svg { display: block; width: 100%; min-width: 430px; height: auto; }
figure.viz figcaption {
  padding: 0.75rem 0.75rem 0.9rem;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
  color: var(--ink);
}
.viz-text { margin: 0.75rem 0 1.25rem; }
.viz-text summary {
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--muted);
}

/* "Save to plan" sits top-right of any lesson/project heading that carries
   an actions block (same pattern on both publications). :has() scopes the
   grid to exactly those headings; below 980px the button drops back under
   the title, where there is no spare column for it. */
.reader-head:has(> .actions),
.page-heading:has(> .actions) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 24px;
}
.reader-head > .actions,
.page-heading > .actions {
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: center;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
@media (max-width: 980px) {
  .reader-head:has(> .actions),
  .page-heading:has(> .actions) {
    display: block;
  }
  .reader-head > .actions,
  .page-heading > .actions {
    flex-direction: row;
    align-items: center;
    gap: 12px;
  }
}


/* Theme toggle: one button cycling Day -> Dark -> System. CSS shows the
   icon for the active mode (html[data-theme] is set before paint; no
   attribute means "system"). Hidden without JavaScript via .js. It renders
   twice — top-right corner of the platform bar, and in the mast — and the
   rules after this block show exactly one of the two at any width. */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}
.theme-toggle:hover {
  border-color: var(--line-strong);
  background: var(--pale);
  color: var(--green);
}
.theme-toggle .icon {
  display: none;
  width: 17px;
  height: 17px;
}
html:not([data-theme]) .theme-toggle .icon:nth-of-type(3) {
  display: block;
}
[data-theme="light"] .theme-toggle .icon:nth-of-type(1) {
  display: block;
}
[data-theme="dark"] .theme-toggle .icon:nth-of-type(2) {
  display: block;
}
/* The platform-bar copy sits in the page's top-right corner as a quiet
   icon-only button; the mast copy exists for below 760px, where the bar
   itself is hidden (see .atlas-bar's 760px rule). */
.atlas-bar .theme-toggle {
  align-self: center;
  width: 30px;
  height: 30px;
  min-height: 0;
  border: 0;
  background: none;
  border-radius: 5px;
}
.atlas-bar .theme-toggle:hover {
  background: var(--tab-hover);
  color: var(--ink);
}
@media (min-width: 761px) {
  .mast .theme-toggle {
    display: none;
  }
}

/* Course map: lesson, part, and project pages carry a left-most column
   listing every part with its topics and project, so any lesson is one click
   away. :has() scopes the three-column grid to exactly those pages — library
   and revision readers keep the plain two-column grid above. ≤1150px the
   on-this-page outline collapses into its dropdown above the article;
   ≤980px the map itself goes away (small screens keep the dropdown, the
   pager, and the curriculum page). */
.reader-grid:has(> .course-nav) {
  grid-template-columns: fit-content(240px) minmax(0, 920px) fit-content(200px);
  gap: clamp(28px, 3vw, 60px);
  /* Pin the course map to the page's left edge and the outline to its right
     edge; the lesson keeps the centered middle column. (Overrides the base
     .reader-grid's justify-content: center.) */
  justify-content: space-between;
}
.reader-grid:has(> .course-nav) > .course-nav {
  grid-column: 1;
  grid-row: 1;
}
.reader-grid:has(> .course-nav) > article {
  grid-column: 2;
  grid-row: 1;
}
.reader-grid:has(> .course-nav) > .outline {
  grid-column: 3;
  grid-row: 1;
}
.reader-grid article > .actions {
  margin: 22px 0;
}
.course-nav {
  position: sticky;
  top: calc(var(--head-h) + 20px);
  align-self: start;
  max-height: calc(100dvh - var(--head-h) - 40px);
  overflow-y: auto;
  padding-right: 16px;
  border-right: 1px solid var(--line);
}
.course-nav .eyebrow {
  margin: 3px 0 4px;
}
.course-nav nav {
  display: grid;
  padding-bottom: 12px;
}
.course-nav nav a {
  display: flex;
  gap: 9px;
  align-items: baseline;
  font-size: 0.85rem;
  color: var(--muted);
  padding: 5px 0;
}
.course-nav nav a small {
  font: 600 0.7rem/1.5 var(--mono);
  color: var(--dim);
  min-width: 24px;
  flex: none;
}
.course-nav nav a:hover {
  color: var(--green);
}
.course-nav nav a[aria-current="page"],
.course-nav nav a[aria-current="page"] small {
  color: var(--accent);
  font-weight: 600;
}
/* Each part row folds out its topics: the row link opens the part hub, the
   chevron toggles the fold, and only the current part starts open. */
.course-nav .map-part > summary {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  list-style: none;
}
.course-nav .map-part > summary::-webkit-details-marker {
  display: none;
}
.course-nav .map-part > summary a {
  flex: 1;
  min-width: 0;
}
.course-nav .map-part > summary > .icon {
  width: 13px;
  height: 13px;
  color: var(--dim);
  flex: none;
}
.course-nav .map-part:not([open]) > summary > .icon {
  transform: rotate(-90deg);
}
.course-nav .map-topics {
  display: grid;
  margin: 1px 0 7px 14px;
  padding-left: 11px;
  border-left: 1px solid var(--line);
}
.course-nav .map-topics a {
  font-size: 0.8rem;
  padding: 4px 0;
}
/* The map's title row is the whole panel's toggle: closed, it collapses into
   a slim vertical rail (icon on top, title turned vertical) and the
   fit-content() grid column hands the freed width back to the article. The
   summary carries a panel-close and a panel-open icon; CSS shows the one for
   the current state. */
.course-nav > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  min-height: 34px;
}
.course-nav > summary .eyebrow {
  margin: 0;
}
.course-nav > summary .icon {
  width: 16px;
  height: 16px;
  color: var(--muted);
  flex: none;
}
.course-nav > summary:hover .icon {
  color: var(--green);
}
.course-nav[open] > summary .icon:nth-of-type(2),
.course-nav:not([open]) > summary .icon:nth-of-type(1) {
  display: none;
}
.course-nav:not([open]) > summary {
  flex-direction: column;
  justify-content: flex-start;
  gap: 14px;
  min-height: 0;
  padding-top: 5px;
}
.course-nav:not([open]) > summary .eyebrow {
  writing-mode: vertical-rl;
}
.course-nav:not([open]) {
  padding-right: 12px;
}
.course-nav[open] {
  width: 240px;
}
@media (max-width: 1150px) {
  .reader-grid:has(> .course-nav) {
    grid-template-columns: fit-content(220px) minmax(0, 1fr);
  }
  .course-nav[open] {
    width: 220px;
  }
  .reader-grid:has(> .course-nav) > .course-nav {
    grid-row: 1 / span 2;
  }
  .reader-grid:has(> .course-nav) > .outline {
    grid-column: 2;
    grid-row: 1;
    position: static;
  }
  .reader-grid:has(> .course-nav) > article {
    grid-column: 2;
    grid-row: 2;
  }
  /* Same dropdown dress as the ≤760px outline rules above; repeated here
     because on course-map pages the dropdown arrives at 1150px already. */
  .reader-grid:has(> .course-nav) > .outline > div {
    display: none;
  }
  .reader-grid:has(> .course-nav) > .outline details {
    display: block;
    border-block: 1px solid var(--line);
    padding: 4px 0;
  }
  .reader-grid:has(> .course-nav) > .outline summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: 600;
    min-height: 42px;
  }
  .reader-grid:has(> .course-nav) > .outline details[open] summary > .icon {
    transform: rotate(180deg);
  }
  .reader-grid:has(> .course-nav) > .outline nav a {
    padding: 10px 6px;
  }
}
@media (max-width: 980px) {
  .course-nav {
    display: none;
  }
  .reader-grid:has(> .course-nav) {
    grid-template-columns: minmax(0, 1fr);
  }
  .reader-grid:has(> .course-nav) > .outline {
    grid-column: 1;
    grid-row: 1;
  }
  .reader-grid:has(> .course-nav) > article {
    grid-column: 1;
    grid-row: 2;
  }
}
