/* Shared course design. System fonts, local assets, no build-time CSS dependencies. */
:root {
  --ink: #20263c;
  --muted: #626c83;
  --primary: #4e5bb8;
  --primary-soft: #eef0fc;
  --paper: #fff;
  --canvas: #f7f8fc;
  --border: #e3e6ef;
  --green: #29705b;
  --green-soft: #edf7f2;
  --radius: 14px;
  --header: 76px;
  color-scheme: light;
  font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-size: 1rem;
  line-height: 1.75;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button,
a,
input,
summary {
  touch-action: manipulation;
}
a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}
button,
summary {
  cursor: pointer;
}
button {
  border: 0;
  background: none;
}
button:disabled {
  cursor: wait;
  opacity: 0.65;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #7180df;
  outline-offset: 4px;
}
h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}
h1,
h2,
h3,
h4 {
  line-height: 1.4;
}
h1 {
  letter-spacing: -0.04em;
}
h2 {
  letter-spacing: -0.025em;
}
p:last-child {
  margin-bottom: 0;
}
img,
canvas {
  max-width: 100%;
  height: auto;
}
svg {
  max-width: 100%;
}
[hidden] {
  display: none !important;
}
html:not(.enhanced) .js-only {
  display: none !important;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 0.875rem;
}
.eyebrow,
.section-eyebrow {
  font-size: 0.8125rem;
  letter-spacing: 0.14em;
  font-weight: 650;
  color: var(--muted);
  line-height: 1.5;
}
.eyebrow {
  margin-bottom: 18px;
}
.skip-link {
  position: fixed;
  top: -100px;
  left: 20px;
  z-index: 100;
  background: white;
  padding: 12px;
}
.skip-link:focus {
  top: 10px;
}
.site-header {
  height: var(--header);
  border-bottom: 1px solid var(--border);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 30;
}
.header-inner {
  max-width: 1320px;
  padding: 0 44px;
  margin: auto;
  display: flex;
  align-items: center;
  gap: 48px;
  height: 100%;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
  color: var(--ink);
  font-weight: 700;
  line-height: 1.3;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
}
.brand:hover {
  text-decoration: none;
}
.brand-symbol {
  display: grid;
  place-items: center;
  width: 37px;
  height: 37px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
}
.brand-symbol svg {
  width: 25px;
  height: 25px;
}
.brand small {
  display: block;
  font-size: 0.625rem;
  letter-spacing: 0.13em;
  margin-top: 5px;
  font-weight: 500;
  color: var(--muted);
}
.site-nav {
  display: flex;
  gap: 30px;
  align-items: center;
  white-space: nowrap;
  min-width: 0;
}
.chapter-links {
  display: flex;
  align-items: center;
  gap: 30px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.chapter-links::-webkit-scrollbar {
  display: none;
}
.site-nav a {
  font-size: 0.9375rem;
  color: var(--muted);
  padding: 27px 0;
}
.site-nav a.chapter-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.875rem;
}
.chapter-no {
  color: #8992ae;
  font: 0.6875rem Consolas, monospace;
}
.site-nav a[aria-current] {
  color: var(--primary);
  box-shadow: 0 2px var(--primary);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}
.header-mode-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.header-mode {
  padding: 5px 9px;
  font-size: 0.8125rem;
  white-space: nowrap;
}
.mode-short {
  display: none;
}
.search-trigger {
  display: flex !important;
  align-items: center;
  gap: 10px;
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 5px 12px;
  color: var(--muted);
  font-size: 0.875rem;
  white-space: nowrap;
}
.search-trigger > span:first-child {
  font-size: 1.4375rem;
  line-height: 1;
}
kbd {
  font-family: inherit;
  font-size: 0.75rem;
  color: #717b92;
  margin-left: 20px;
}
.language-button {
  font-size: 0.875rem;
  font-weight: 600;
  padding: 8px;
}
.home-main {
  max-width: 1232px;
  padding: 0 44px;
  margin: auto;
}
.hero {
  display: grid;
  grid-template-columns: 1.08fr 1fr;
  gap: 70px;
  align-items: center;
  padding: 65px 0 54px;
}
.live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #6caa95;
  border-radius: 50%;
  margin: 0 7px 1px 0;
}
.hero h1 {
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 20px;
  letter-spacing: -0.025em;
}
.hero h1 em {
  font-style: normal;
  color: var(--primary);
}
.hero-description {
  font-size: 1.25rem;
  color: var(--muted);
  line-height: 1.95;
  max-width: 450px;
}
.hero-meta {
  margin-top: 12px;
  font-size: 0.875rem;
  line-height: 1.9;
  color: var(--muted);
}
.hero-meta a {
  text-underline-offset: 3px;
  text-decoration: underline;
}
.hero-actions {
  display: flex;
  gap: 24px;
  align-items: center;
  margin-top: 27px;
}
.button {
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 20px;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.6;
  border: 1px solid transparent;
  cursor: pointer;
}
.button:hover {
  text-decoration: none;
}
.button.primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 3px 8px #3a459315;
}
.button.primary:hover {
  background: #424eaa;
}
.button.secondary {
  background: white;
  border-color: var(--border);
  color: var(--ink);
}
.button.secondary:hover {
  border-color: #9ba5dd;
  background: var(--primary-soft);
}
.text-link {
  font-size: 0.875rem;
}
.hero-facts {
  display: flex;
  gap: 33px;
  margin-top: 35px;
}
.hero-facts > span {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.875rem;
  color: var(--muted);
}
.hero-facts strong {
  font-size: 1.375rem;
  color: var(--ink);
  font-weight: 550;
  font-variant-numeric: tabular-nums;
}
.hero-visual {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 26px 18px;
  box-shadow: 0 14px 45px #35416b07;
  position: relative;
  overflow: hidden;
}
.visual-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #77819a;
}
.mini-label {
  font-size: 0.75rem;
  letter-spacing: 0.17em;
}
.visual-number {
  font:
    10px Consolas,
    monospace;
}
.hero-visual h2 {
  font-size: 1.25rem;
  margin-top: 17px;
  margin-bottom: 5px;
  letter-spacing: 0;
}
.hero-visual svg {
  width: 100%;
  height: auto;
  display: block;
}
.encoding-options {
  display: flex !important;
  background: #f4f5fa;
  width: max-content;
  padding: 3px;
  border-radius: 7px;
  margin: 14px auto 12px;
}
.encoding-options button {
  font-size: 0.875rem;
  border-radius: 5px;
  padding: 4px 20px;
  color: var(--muted);
}
.encoding-options button[aria-pressed="true"] {
  background: white;
  color: var(--primary);
  box-shadow: 0 1px 4px #20294413;
}
.visual-caption {
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 14px;
  min-height: 20px;
}
.visual-source {
  font-size: 0.75rem;
  color: #6f7890;
  display: block;
  text-align: center;
  letter-spacing: 0.03em;
}
.learning-route {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 22px 0 25px;
}
.section-eyebrow {
  letter-spacing: 0.1em;
}
.route-track {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin-top: 13px;
  gap: 16px;
}
.route-step {
  color: var(--ink);
  font-size: 0.9375rem;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}
.route-step > span:first-child {
  border: 1px solid #cbd1e5;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 0.75rem;
  color: var(--primary);
  background: white;
  flex-shrink: 0;
}
.route-step:not(:last-child):after {
  content: "→";
  color: #a4acc0;
  margin-left: auto;
}
.curriculum {
  padding: 47px 0 52px;
  scroll-margin-top: 95px;
}
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 25px;
}
.section-heading h2 {
  font-size: 2rem;
  margin: 6px 0 0;
}
.section-heading .eyebrow {
  margin-bottom: 8px;
  font-size: 0.75rem;
}
.section-heading > p {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 0 0 2px;
}
.curriculum-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 28px;
}
.course-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.course-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  transition:
    border-color 0.18s,
    box-shadow 0.18s;
}
.course-card:hover {
  border-color: #aab3dd;
  box-shadow: 0 3px 12px #28345e05;
}
.course-card-link {
  display: grid;
  grid-template-columns: 145px minmax(0, 1fr);
  padding: 24px;
  gap: 23px;
  color: var(--ink);
  height: 100%;
}
.course-card-link:hover {
  text-decoration: none;
}
.course-art {
  border-radius: 10px;
  background: #f3f4fb;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2px;
}
.chapter-art {
  width: 132px;
}
.chapter-number {
  margin: 4px 0 10px;
  padding: 1px 8px;
  border: 1px solid #d9ddf7;
  border-radius: 999px;
  background: #fff;
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  line-height: 1.6;
}
.course-card h3 {
  font-size: 1.5rem;
  margin: 5px 0 8px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.course-card h3 > span:last-child:not([data-lang]) {
  font-size: 1.125rem;
  color: #a0a7bf;
}
.card-kicker {
  color: var(--muted);
  font-size: 0.8125rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.card-kicker-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.card-chapter {
  padding: 1px 8px;
  border: 1px solid #d9ddf7;
  border-radius: 4px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.course-card p {
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.8;
  margin-bottom: 8px;
}
.tagline {
  font-size: 0.8125rem;
  color: #656f9d;
  letter-spacing: 0.02em;
}
.course-card .prerequisite {
  font-size: 0.8125rem;
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px solid #f0f1f7;
  margin-bottom: 0;
  color: #6e7891;
}
.progress-card {
  border: 1px solid var(--border);
  background: white;
  border-radius: var(--radius);
  padding: 23px;
}
.progress-overview {
  margin: 17px 0 15px;
  display: flex;
  align-items: end;
  gap: 12px;
}
.progress-overview strong {
  font-size: 2.125rem;
  font-weight: 550;
  line-height: 1.2;
  letter-spacing: -0.04em;
}
.progress-overview strong span {
  font-size: 1.0625rem;
  color: #7a839b;
  font-weight: 400;
  letter-spacing: 0;
}
.progress-overview > span {
  font-size: 0.8125rem;
  color: var(--muted);
  padding-bottom: 3px;
}
progress {
  width: 100%;
  height: 5px;
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  display: block;
  background: #edf0f7;
  accent-color: var(--primary);
}
progress::-webkit-progress-bar {
  background: #edf0f7;
}
progress::-webkit-progress-value {
  background: var(--primary);
  border-radius: 10px;
}
.progress-card > p.muted {
  font-size: 0.8125rem;
  line-height: 1.8;
  margin: 16px 0;
}
.progress-card > .button {
  width: 100%;
  font-size: 0.875rem;
}
.aside-note {
  padding: 25px 17px 15px;
  margin-top: 13px;
}
.aside-note-icon {
  font-size: 1.5rem;
  color: var(--primary);
}
.aside-note h3 {
  font-size: 1.125rem;
  margin: 8px 0 12px;
}
.aside-note p {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.9;
}
.saved-sections {
  padding: 20px 17px;
  border-top: 1px solid var(--border);
  margin-top: 18px;
}
.saved-sections h3 {
  font-size: 0.875rem;
  margin-bottom: 14px;
}
#saved-list a {
  display: block;
  font-size: 0.875rem;
  margin: 10px 0;
}
.guide {
  border-top: 1px solid var(--border);
  padding: 45px 0;
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 80px;
  scroll-margin-top: 95px;
}
.guide h2 {
  font-size: 2rem;
}
.guide p {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.9;
}
.guide ol {
  list-style: none;
  padding: 0;
  margin: 0;
}
.guide li {
  display: flex;
  gap: 20px;
  margin-bottom: 21px;
}
.guide li > span {
  font-size: 0.875rem;
  color: #7a86bd;
  background: var(--primary-soft);
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  flex-shrink: 0;
}
.guide li h3 {
  font-size: 1.125rem;
  margin: 0 0 4px;
}
.guide li p {
  font-size: 1rem;
  margin: 0;
}
.local-data {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 25px;
  background: #eff1f8;
  border-radius: 12px;
  padding: 25px 30px;
  margin: 0 0 55px;
}
.local-data h2 {
  font-size: 1.125rem;
  margin-bottom: 7px;
}
.local-data p {
  font-size: 0.875rem;
  color: var(--muted);
  max-width: 550px;
}
.record-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}
.record-actions .button {
  font-size: 0.8125rem;
  padding: 8px 12px;
  position: relative;
}
.file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  cursor: pointer;
}
.record-actions label:focus-within {
  outline: 3px solid #7180df;
  outline-offset: 3px;
}
.site-footer {
  max-width: 1144px;
  margin: 0 auto;
  border-top: 1px solid var(--border);
  padding: 30px 0 35px;
  display: flex;
  justify-content: space-between;
  gap: 25px;
  font-size: 0.8125rem;
  color: var(--muted);
}
.site-footer strong {
  font-size: 1rem;
  color: var(--ink);
  font-weight: 600;
}
.site-footer p {
  margin: 6px 0 0;
  line-height: 1.9;
}
.site-footer > p {
  text-align: right;
}
/* Lesson reading experience */
.lesson-layout {
  max-width: 1320px;
  margin: auto;
  display: grid;
  grid-template-columns: 255px minmax(0, 1fr);
  gap: 48px;
  padding: 0 44px;
}
.lesson-sidebar {
  position: sticky;
  top: var(--header);
  height: calc(100dvh - var(--header));
  overflow: auto;
  padding: 30px 18px 30px 0;
  border-right: 1px solid var(--border);
  scrollbar-width: thin;
}
.mobile-contents > summary {
  display: none;
}
.chapter-group {
  margin: 8px 0;
}
.chapter-group > summary {
  font-size: 0.9375rem;
  font-weight: 650;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 0;
  line-height: 1.6;
}
.chapter-group > summary:after {
  content: "+";
  font-weight: 400;
  color: var(--muted);
  margin-left: auto;
}
.chapter-group[open] > summary:after {
  content: "−";
}
.group-number {
  font-size: 0.75rem;
  color: #8992ae;
}
.chapter-strip {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 7px;
  overflow-x: auto;
  padding: 8px 0 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  scrollbar-width: thin;
}
.chapter-strip::-webkit-scrollbar {
  height: 4px;
}
.chapter-strip::-webkit-scrollbar-thumb {
  background: #cbd1e5;
  border-radius: 999px;
}
.chapter-strip a {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.5;
}
.chapter-strip a:hover {
  border-color: #aab3dd;
  background: var(--primary-soft);
  text-decoration: none;
}
.chapter-strip a[aria-current="page"] {
  border-color: #cdd3f2;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 650;
}
.strip-num {
  color: #7b849e;
  font: 0.6875rem Consolas, monospace;
}
.sidebar-chapter {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin: 4px 0 12px;
  padding: 8px 0 4px;
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 650;
  line-height: 1.55;
}
.section-picker {
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}
.section-picker > summary {
  padding: 9px 11px;
  list-style: none;
  cursor: pointer;
}
.section-picker > summary::-webkit-details-marker {
  display: none;
}
.section-picker > summary:after {
  content: "⌄";
  float: right;
  color: var(--muted);
}
.picker-label {
  display: block;
  color: var(--muted);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
}
.picker-current {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 0.8125rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.picker-list {
  display: grid;
  gap: 2px;
  padding: 0 6px 7px;
}
.picker-list a {
  display: flex;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 5px;
  color: var(--muted);
  font-size: 0.8125rem;
}
.picker-list a:hover {
  background: #f1f3fb;
  text-decoration: none;
}
.picker-list a[aria-current] {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}
.section-outline {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 8px;
}
.section-outline a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 9px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.875rem;
}
.section-outline a:hover {
  background: #eef0f9;
  text-decoration: none;
}
.section-outline a[aria-current="location"] {
  color: var(--primary);
  background: #f5f6fd;
  box-shadow: inset 2px 0 #c7cdf0;
}
.outline-index {
  color: #8992ae;
  font: 0.6875rem Consolas, monospace;
}
.chapter-group ol {
  list-style: none;
  margin: 0;
  padding: 0;
}
.section-link {
  display: flex;
  align-items: baseline;
  gap: 9px;
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.65;
  padding: 10px 9px;
  border-radius: 6px;
}
.section-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.section-item {
  margin: 1px 0;
}
.section-item > .section-outline {
  margin: -2px 0 6px 26px;
  padding-left: 7px;
  border-left: 1px solid var(--border);
}
.section-link:hover {
  background: #edeff8;
  text-decoration: none;
}
.section-link[aria-current="location"] {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
  box-shadow: inset 2px 0 var(--primary);
}
.section-index {
  font-size: 0.75rem;
  opacity: 0.8;
}
.section-status {
  color: var(--green);
  margin-left: auto;
}
.sidebar-bottom {
  border-top: 1px solid var(--border);
  margin-top: 23px;
  padding-top: 20px;
}
.sidebar-bottom a {
  display: block;
  font-size: 0.875rem;
  margin-bottom: 12px;
}
.sidebar-bottom p {
  font-size: 0.75rem;
  margin-top: 24px;
}
.lesson-content {
  min-width: 0;
  padding-bottom: 60px;
}
.lesson-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  color: var(--muted);
  position: sticky;
  top: var(--header);
  z-index: 20;
  padding: 13px 0;
  min-height: 64px;
  background: var(--canvas);
  border-bottom: 1px solid var(--border);
}
.toolbar-options {
  display: flex !important;
  gap: 10px;
  margin-left: auto;
}
.quiet-button {
  font-size: 0.875rem;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: white;
  color: var(--muted);
  white-space: nowrap;
}
.quiet-button:hover,
.quiet-button[aria-pressed="true"] {
  border-color: #a7b1df;
  color: var(--primary);
  background: var(--primary-soft);
}
.lesson-section {
  scroll-margin-top: 100px;
}
.lesson-section + .lesson-section {
  border-top: 1px solid var(--border);
  margin-top: 55px;
  padding-top: 40px;
}
.lesson-section .eyebrow {
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 13px;
}
.level-tag {
  letter-spacing: 0;
  font-size: 0.75rem;
  background: #e9ecf5;
  padding: 2px 7px;
  border-radius: 4px;
  color: var(--muted);
}
.lesson-heading h1 {
  font-size: 2.125rem;
  line-height: 1.45;
  margin-bottom: 15px;
}
.section-tools {
  display: flex !important;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
}
.read-status {
  font-size: 0.8125rem;
  color: var(--green);
}
.learning-objective {
  padding: 19px 24px;
  background: #eef1fb;
  border-left: 3px solid #6976c8;
  border-radius: 0 9px 9px 0;
  margin-bottom: 27px;
}
.learning-objective > span {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--primary);
  font-weight: 650;
}
.learning-objective p {
  font-size: 1rem;
  line-height: 1.9;
  margin: 7px 0 0;
  color: #37426c;
}
.section-key-points {
  margin: 0 0 23px;
  padding: 16px 20px 17px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}
.key-points-title {
  margin: 0 0 7px;
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}
.section-key-points ul {
  margin: 0;
  padding-left: 1.2em;
  display: grid;
  gap: 5px;
}
.section-key-points li {
  color: #3c4762;
  font-size: 0.9375rem;
  line-height: 1.8;
}
.lab-takeaway {
  margin: 18px 0 0;
  border: 1px solid #cfe0d6;
  border-radius: 8px;
  background: #f3faf6;
}
.lab-takeaway > summary {
  padding: 11px 16px;
  color: #265f4c;
  font-size: 0.9375rem;
  font-weight: 650;
}
.lab-takeaway-body {
  padding: 0 16px 14px;
  color: #3d5b50;
  font-size: 0.9375rem;
  line-height: 1.85;
}
@media print {
  .lab-takeaway:not([open]) .lab-takeaway-body {
    display: block;
  }
  .lab-takeaway > summary {
    list-style: none;
  }
}
.flow-nav {
  display: flex;
  gap: 25px;
  border-bottom: 1px solid var(--border);
  padding: 0 0 13px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.flow-nav a {
  font-size: 0.875rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 7px;
}
.flow-nav a > span:first-child {
  font-size: 0.75rem;
  color: #8d96b1;
}
.part-heading {
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 23px;
}
.part-heading > span:first-child {
  font-size: 0.8125rem;
  color: #7883b2;
  font-weight: 500;
  letter-spacing: 0.05em;
}
.reading-content {
  font-size: 1rem;
  line-height: 1.9;
  overflow-wrap: anywhere;
}
.reading-content h3 {
  font-size: 1.25rem;
  margin: 26px 0 12px;
}
.reading-content h4 {
  font-size: 1.125rem;
  margin: 20px 0 10px;
}
.reading-content p {
  color: #46516a;
  margin-bottom: 16px;
}
.reading-content ul,
.reading-content ol {
  padding-left: 23px;
  margin: 10px 0 22px;
}
.reading-content li {
  margin: 6px 0;
  color: #46516a;
}
.reading-content strong {
  color: var(--ink);
  font-weight: 650;
}
.reading-content code,
.demo-mount code {
  font:
    0.875rem/1.6 Consolas,
    "SFMono-Regular",
    monospace;
  background: #edf0f8;
  color: #4e5894;
  border-radius: 4px;
  padding: 2px 5px;
  overflow-wrap: anywhere;
}
.reading-content pre,
.console {
  font:
    0.875rem/1.8 Consolas,
    "SFMono-Regular",
    monospace;
  max-width: 100%;
  overflow: auto;
  padding: 20px;
  border-radius: 8px;
  background: #222a40;
  color: #e5e9f6;
  white-space: pre;
}
.reading-content pre {
  position: relative;
}
.reading-content pre code {
  padding: 0;
  background: none;
  color: inherit;
  font-size: inherit;
  overflow-wrap: normal;
}
.kw {
  color: #c9adf7;
}
.str {
  color: #a0dcc3;
}
.num {
  color: #edc087;
}
.fn {
  color: #8ecbf0;
}
.cmt {
  color: #b1bacf;
}
.star {
  color: #edc087;
}
.code-copy {
  display: block;
  margin-left: auto;
  margin-bottom: 6px;
  font-size: 0.75rem;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #fff;
  color: var(--muted);
}
.reading-content .note,
.reading-content .key-point,
.reading-content .code-purpose {
  padding: 15px 18px;
  border-left: 3px solid #acb7e4;
  background: #f0f3fa;
  border-radius: 0 6px 6px 0;
  color: #46516a;
  font-size: 0.9375rem;
  line-height: 1.85;
}
.reading-content .note {
  background: #faf6eb;
  border-color: #d5bd7d;
}
.model-comparison {
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.model-diagram {
  overflow-x: auto;
}
.model-diagram svg {
  min-width: 520px;
}
.model-detail {
  margin: 0 0 12px;
  line-height: 1.85;
}
.story-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}
.story-frame {
  max-width: 100%;
  overflow-x: auto;
}
@media (max-width: 560px) {
  .demo-mount .story-frame svg {
    min-width: 760px !important;
  }
}
.story-legend button {
  padding: 5px 9px;
  font-size: 0.875rem;
}
.theory-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  line-height: 1.8;
  margin: 16px 0;
}
.theory-table td,
.theory-table th {
  padding: 10px 13px;
  border: 1px solid var(--border);
  text-align: left;
  color: #46516a;
}
.theory-table th {
  background: #f1f3f9;
  font-weight: 650;
}
.table-scroll {
  max-width: 100%;
  overflow: auto;
}
.theory-figure {
  margin: 20px 0;
}
.theory-figure img {
  width: auto;
  max-height: 480px;
  object-fit: contain;
  display: block;
  margin: auto;
}
.theory-figure figcaption {
  font-size: 0.875rem;
  text-align: center;
  color: var(--muted);
}
.concept,
.lab-section,
.code-details,
.source-details,
.knowledge-check {
  scroll-margin-top: 100px;
}
.lab-section {
  margin: 36px 0 28px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}
.lab-title {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 15px;
}
.lab-title .part-heading {
  margin: 0;
}
.lab-actions {
  display: flex !important;
  gap: 7px;
}
.lab-task {
  font-size: 1rem;
  line-height: 1.9;
  margin-bottom: 18px;
  color: #4c5874;
}
.lab-task strong {
  color: var(--primary);
}
.demo-mount {
  background: #fafbfe;
  border: 1px solid #e5e9f3;
  border-radius: 8px;
  padding: 20px;
  min-width: 0;
  overflow-x: auto;
  font-size: 0.9375rem;
  line-height: 1.8;
}
.demo-mount h4 {
  font-size: 1.125rem;
}
.demo-mount h5 {
  font-size: 1rem;
}
.demo-mount .controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
}
.demo-mount button,
.demo-mount select,
.demo-mount
  input:not([type="range"]):not([type="checkbox"]):not([type="radio"]) {
  border: 1px solid #c8d0e6;
  border-radius: 5px;
  background: white;
  color: #455280;
  padding: 7px 11px;
  font-size: 0.875rem;
  max-width: 100%;
}
.demo-mount .demo-btn,
.demo-mount button.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.demo-mount input[type="range"] {
  max-width: 100%;
  accent-color: var(--primary);
}
.demo-mount svg {
  height: auto;
}
.demo-mount .demo-hint {
  background: #edf1fa;
  color: #4d5c7c;
  padding: 12px;
  font-size: 0.875rem;
}
.demo-mount .color-cell,
.demo-mount .cvd-cell {
  position: relative;
  text-shadow: 0 1px 2px #0008;
  font-size: 0.875rem;
}
.demo-mount .color-cell small {
  font-size: 0.875rem;
}
.demo-mount .color-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.demo-mount .color-space-cards {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.demo-mount .cvd-paper-card {
  overflow: auto;
}
.lab-section > p.small {
  margin-top: 14px;
  font-size: 0.8125rem;
}
.lab-expanded .lesson-layout {
  grid-template-columns: minmax(0, 1fr);
  max-width: 1200px;
}
.lab-expanded .lesson-sidebar {
  display: none;
}
.lab-expanded .lab-section.is-expanded {
  box-shadow: 0 0 0 3px #c1c9ee;
}
.code-details {
  border: 1px solid var(--border);
  border-radius: 9px;
  background: white;
  margin: 28px 0;
}
.code-details > summary {
  padding: 18px 21px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  list-style: none;
}
.code-details > summary .part-heading {
  margin: 0;
  font-size: 1.25rem;
}
.code-details > summary > .small {
  font-size: 0.75rem;
  color: var(--muted);
}
.code-content {
  padding: 0 24px 24px;
}
.source-details {
  margin: 28px 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}
.source-details > summary {
  padding: 16px 22px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
}
.source-content {
  padding: 0 24px 24px;
}
.source-note,
.original-lab-notes {
  padding: 12px 16px;
  background: #f3f5fb;
  border-left: 3px solid #bbc5e5;
  font-size: 0.9375rem;
  line-height: 1.8;
}
.original-lab-notes {
  margin-top: 18px;
}
.original-lab-notes p {
  margin: 0 0 5px;
}
.source-section-title {
  font-weight: 650;
}
[data-source-panel] + [data-source-panel] {
  border-top: 1px solid var(--border);
  padding-top: 18px;
  margin-top: 24px;
}
.missing-resource {
  background: #faf8f1;
}
.knowledge-check {
  padding: 25px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin: 30px 0;
}
.quiz fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 20px;
  min-width: 0;
}
.quiz legend {
  font-size: 1.0625rem;
  font-weight: 600;
  margin-bottom: 15px;
}
.quiz-option {
  display: flex;
  gap: 11px;
  align-items: baseline;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 7px;
  margin: 10px 0;
  font-size: 1rem;
  cursor: pointer;
}
.quiz-option:has(input:checked) {
  border-color: #8b98d9;
  background: #f0f2fc;
}
.quiz-option input {
  accent-color: var(--primary);
  margin: 0;
}
.option-letter {
  font-size: 0.8125rem;
  color: #7b87ae;
}
.quiz-feedback {
  padding: 14px 17px;
  border-radius: 8px;
  background: #fff7e7;
  color: #73521d;
  font-size: 0.9375rem;
  line-height: 1.9;
  margin-top: 18px;
}
.quiz-feedback.correct {
  background: var(--green-soft);
  color: var(--green);
}
.quiz-feedback strong {
  display: block;
  margin-bottom: 5px;
}
.completion-row {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 32px 0;
}
.completion-row p {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 0;
}
.completion-row button[aria-pressed="true"] {
  background: var(--green-soft);
  color: var(--green);
  border-color: #b3d6c7;
}
.section-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  border-top: 1px solid var(--border);
  padding-top: 23px;
}
.pager-link {
  font-size: 0.9375rem;
}
.pager-link small {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  margin-bottom: 6px;
}
.pager-next {
  text-align: right;
}
.presentation .lesson-layout {
  grid-template-columns: minmax(0, 1fr);
  max-width: 1100px;
}
.presentation .lesson-sidebar {
  display: none;
}
.presentation .reading-content {
  font-size: 1.125rem;
}
.presentation .lesson-heading h1 {
  font-size: 2.375rem;
}
.presentation .demo-mount {
  font-size: 1rem;
}
.reading-all .lesson-section h1 {
  font-size: 1.875rem;
}
.lesson-error {
  padding: 18px;
  background: #fff3e7;
  border-radius: 8px;
  color: #72521c;
}
.join-summary {
  font-size: 0.9375rem;
  line-height: 1.9;
  background: #eef2fc;
  padding: 13px 16px;
  border-radius: 7px;
  margin-top: 16px;
}
.join-chart {
  min-width: 490px;
  display: block;
  width: 100%;
}
.pipeline-steps {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.pipeline-steps button[aria-pressed="true"] {
  background: var(--primary);
  color: white;
}
.pipeline-stage {
  margin: 18px 0 0;
  padding: 18px;
  border: 1px solid var(--border);
  background: white;
  border-radius: 8px;
}
.pipeline-stage h4 {
  margin: 0 0 13px;
}
.gamut-layout {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 1fr;
  gap: 24px;
  align-items: center;
}
.gamut-layout canvas {
  width: 100%;
  image-rendering: auto;
  border: 1px solid var(--border);
}
.temporal-frame {
  overflow: auto;
  margin-top: 16px;
}
.calendar-chart {
  display: block;
  width: 100%;
  min-width: 900px !important;
}
.spiral-chart {
  display: block;
  width: 100%;
  max-width: 580px;
  min-width: 300px !important;
  margin: auto;
}
.temporal-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 15px;
  font-size: 0.875rem;
}
.temporal-legend > div {
  width: 180px;
  height: 14px;
  border-radius: 3px;
}
.palette-choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.demo-mount .palette-choice {
  padding: 14px;
  text-align: left;
  white-space: normal;
}
.palette-choice svg {
  display: block;
  width: 100%;
  margin-top: 10px;
}
.palette-choice[aria-pressed="true"] {
  outline: 2px solid var(--primary);
  background: #f0f3fc;
}
.tree-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 6px 0;
}
.tree-row [data-select][aria-pressed="true"] {
  background: #e7edfb;
}
.tree-list ul {
  list-style: none;
  padding-left: 22px;
}
.tree-list > ul {
  padding-left: 0;
}
.demo-mount pre {
  max-width: 100%;
  overflow: auto;
  white-space: pre;
  font:
    0.875rem/1.8 Consolas,
    monospace;
}
.demo-mount .color-cell,
.demo-mount .cvd-cell,
.demo-mount .philosophy-paper-card {
  text-shadow: none;
  padding: 12px;
}
.demo-mount .cvd-cell {
  min-height: 70px;
}
.demo-mount .harmony-preview {
  display: none;
}
.demo-mount .harmony-card,
.demo-mount .attr-card {
  cursor: default;
}
.demo-mount .demo-control label {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  margin: 4px 10px 4px 0;
}
.demo-mount .cvd-paper-card > div {
  grid-template-columns: repeat(3, minmax(220px, 1fr)) !important;
}
.demo-mount .controls label {
  max-width: 100%;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.demo-mount .controls input[type="date"] {
  min-width: 145px;
}
/* Resource library and search */
.resource-main {
  max-width: 1144px;
  margin: 52px auto 60px;
}
.resource-main > h1 {
  font-size: 2.25rem;
  margin-bottom: 12px;
}
.resource-intro {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 45px;
}
.resource-group {
  margin: 40px 0;
  scroll-margin-top: 105px;
}
.resource-group h2 {
  font-size: 1.5rem;
}
.resource-group .section-heading > a {
  font-size: 0.875rem;
}
.resource-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.resource-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: white;
  border: 1px solid var(--border);
  padding: 18px 20px;
  border-radius: 8px;
  font-size: 1rem;
  color: var(--ink);
}
.resource-link small {
  font-size: 0.8125rem;
  color: var(--muted);
  flex-shrink: 0;
}
.resource-link:hover {
  text-decoration: none;
  border-color: #9eaada;
}
.extra-resources {
  margin: 18px 0;
}
.extra-resources summary {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 15px;
}
.references {
  border-top: 1px solid var(--border);
  padding-top: 35px;
}
.references h2 {
  font-size: 1.5rem;
}
.references p {
  font-size: 0.9375rem;
  color: var(--muted);
}
.references > a {
  font-size: 0.9375rem;
  margin: 15px 0;
  display: block;
}
dialog {
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 27px;
  width: min(640px, calc(100vw - 32px));
  max-height: 80dvh;
  color: var(--ink);
  box-shadow: 0 25px 100px #10193740;
}
dialog::backdrop {
  background: #17203c80;
  backdrop-filter: blur(3px);
}
.dialog-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.dialog-top h2 {
  font-size: 1.3125rem;
  margin: 0;
}
.dialog-top button {
  font-size: 1.625rem;
  width: 35px;
  height: 35px;
}
.search-field {
  display: block;
  font-size: 0.875rem;
  color: var(--muted);
}
.search-field input {
  display: block;
  width: 100%;
  font-size: 1rem;
  padding: 13px;
  margin-top: 8px;
  border: 1px solid #b5bfdf;
  border-radius: 7px;
  background: #fafbff;
}
#search-status {
  font-size: 0.875rem;
  margin: 16px 0;
}
.search-result {
  display: block;
  border-top: 1px solid var(--border);
  padding: 15px 3px;
  color: var(--ink);
}
.search-result:hover {
  text-decoration: none;
  background: #f7f8fd;
}
.search-result strong {
  font-size: 1rem;
  display: block;
}
.search-result small {
  font-size: 0.75rem;
  color: var(--primary);
  display: block;
  margin-bottom: 5px;
}
.search-result p {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 5px 0 0;
  line-height: 1.7;
}
.search-result mark {
  background: #e9edf9;
  color: #3e4da0;
}
.toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100vw - 30px);
  padding: 12px 22px;
  background: #28344e;
  color: white;
  border-radius: 8px;
  z-index: 100;
  font-size: 0.875rem;
  box-shadow: 0 5px 25px #1f294033;
}
@media (min-width: 1600px) {
  :root {
    --header: 82px;
  }
  .header-inner,
  .lesson-layout {
    max-width: 1430px;
  }
  .home-main {
    max-width: 1320px;
  }
  .hero {
    gap: 100px;
    padding-top: 75px;
  }
  .hero h1 {
    font-size: 3.5rem;
  }
  .site-footer,
  .resource-main {
    max-width: 1232px;
  }
  .lesson-layout {
    grid-template-columns: 270px minmax(0, 1fr);
    gap: 70px;
  }
  .lesson-content {
    max-width: 920px;
  }
}
@media (max-width: 1100px) {
  .header-inner {
    gap: 30px;
    padding: 0 28px;
  }
  .site-nav {
    gap: 20px;
  }
  .search-trigger kbd {
    display: none;
  }
  .home-main {
    padding: 0 28px;
  }
  .hero {
    gap: 35px;
  }
  .hero h1 {
    font-size: 3rem;
  }
  .hero-facts {
    gap: 21px;
  }
  .curriculum-grid {
    grid-template-columns: minmax(0, 1fr) 235px;
    gap: 22px;
  }
  .course-card-link {
    grid-template-columns: 110px minmax(0, 1fr);
    padding: 20px;
    gap: 20px;
  }
  .chapter-art {
    width: 105px;
  }
  .course-card h3 {
    font-size: 1.375rem;
  }
  .site-footer,
  .resource-main {
    margin-left: 28px;
    margin-right: 28px;
  }
  .lesson-layout {
    padding: 0 28px;
    grid-template-columns: 215px minmax(0, 1fr);
    gap: 28px;
  }
  .lesson-sidebar {
    padding-right: 12px;
  }
  .flow-nav {
    gap: 20px;
  }
  .lesson-heading h1 {
    font-size: 1.875rem;
  }
  .lesson-toolbar {
    flex-wrap: wrap;
  }
  .toolbar-options {
    gap: 5px;
  }
  .lab-section {
    padding: 18px;
  }
  .lab-actions {
    gap: 4px;
  }
  .lab-title {
    flex-wrap: wrap;
  }
  .guide {
    gap: 35px;
  }
  .local-data {
    padding: 23px;
    gap: 20px;
  }
}
@media (max-width: 800px) {
  :root {
    --header: 67px;
  }
  .header-inner {
    padding: 0 22px;
    gap: 25px;
  }
  .brand {
    font-size: 1.125rem;
  }
  .brand-symbol {
    width: 33px;
    height: 33px;
  }
  .site-nav {
    gap: 17px;
  }
  .site-nav a {
    font-size: 0.9375rem;
  }
  .header-actions {
    gap: 7px;
  }
  .search-label {
    display: none;
  }
  .search-trigger {
    border: 0;
    background: none;
    padding: 5px;
  }
  .hero {
    padding-top: 40px;
    gap: 25px;
  }
  .hero h1 {
    font-size: 2.625rem;
  }
  .hero-description {
    font-size: 1.125rem;
  }
  .hero-actions {
    gap: 14px;
    flex-wrap: wrap;
  }
  .hero-facts {
    gap: 15px;
    flex-wrap: wrap;
  }
  .hero-facts > span {
    font-size: 0.875rem;
  }
  .hero-facts strong {
    font-size: 1.125rem;
  }
  .hero-visual {
    padding: 20px 17px 16px;
  }
  .hero-visual h2 {
    font-size: 1.25rem;
  }
  .encoding-options button {
    padding: 4px 14px;
  }
  .visual-caption {
    font-size: 0.875rem;
  }
  .route-track {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px 20px;
  }
  .route-step {
    font-size: 0.9375rem;
    gap: 7px;
  }
  .route-step:after {
    display: none;
  }
  .route-step > span:first-child {
    width: 24px;
    height: 24px;
  }
  .curriculum-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .learning-aside {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
  .aside-note {
    margin: 0;
    padding: 20px;
  }
  .saved-sections {
    grid-column: 1/-1;
    margin: 0;
    padding: 10px 0;
  }
  .section-heading > p {
    display: none;
  }
  .lesson-layout {
    display: block;
    padding: 0 22px;
  }
  .lesson-sidebar {
    position: static;
    height: auto;
    padding: 0;
    border: 0;
    overflow: visible;
  }
  .mobile-contents {
    border: 1px solid var(--border);
    background: white;
    border-radius: 8px;
    margin-top: 20px;
  }
  .mobile-contents > summary {
    display: block;
    list-style: none;
    padding: 12px 15px;
    font-size: 0.875rem;
    font-weight: 600;
  }
  .mobile-contents > summary:after {
    content: "⌄";
    float: right;
  }
  .mobile-contents > nav {
    padding: 10px 18px 18px;
  }
  .lesson-toolbar {
    padding: 20px 0;
    min-height: 65px;
  }
  .lesson-heading h1 {
    font-size: 1.875rem;
  }
  .lesson-layout .sidebar-bottom {
    margin: 12px 0 0;
  }
  .lesson-toolbar > span:nth-of-type(2) {
    max-width: 160px;
  }
  .site-footer {
    margin-left: 22px;
    margin-right: 22px;
  }
  .local-data {
    flex-wrap: wrap;
  }
  .guide {
    gap: 30px;
  }
  .guide h2 {
    font-size: 1.75rem;
  }
  .presentation .lesson-layout {
    padding: 0 22px;
  }
}
@media (max-width: 560px) {
  .header-inner {
    gap: 15px;
    padding: 0 17px;
  }
  .site-nav {
    margin-left: auto;
  }
  .site-nav a {
    padding: 22px 0;
  }
  .header-actions {
    margin-left: 0;
  }
  .header-mode-actions {
    gap: 3px;
  }
  .header-mode {
    min-height: 30px;
    padding: 3px 6px;
    font-size: 0.75rem;
  }
  .mode-long {
    display: none;
  }
  .mode-short {
    display: inline;
  }
  .brand small {
    font-size: 0.625rem;
  }
  .brand {
    font-size: 1rem;
    gap: 9px;
  }
  .brand-symbol {
    width: 31px;
    height: 31px;
  }
  .home-main {
    padding: 0 20px;
  }
  .hero {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 35px 0;
  }
  .hero h1 {
    font-size: 2.375rem;
  }
  .hero .eyebrow {
    font-size: 0.75rem;
  }
  .hero-description {
    font-size: 1.125rem;
    max-width: 100%;
  }
  .hero-facts {
    margin-top: 25px;
    gap: 25px;
  }
  .hero-visual {
    padding: 20px 22px;
  }
  .hero-visual h2 {
    font-size: 1.25rem;
  }
  .hero-visual svg {
    max-height: 205px;
  }
  .visual-caption {
    font-size: 0.875rem;
  }
  .route-track {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 20px;
  }
  .route-step {
    font-size: 0.9375rem;
    gap: 14px;
  }
  .route-step > span:first-child {
    width: 28px;
    height: 28px;
  }
  .route-step:not(:last-child):before {
    content: "";
    position: absolute;
    left: 13px;
    top: 28px;
    width: 1px;
    height: 12px;
    background: #d4daee;
  }
  .learning-route {
    padding: 22px 0;
  }
  .curriculum {
    padding-top: 32px;
  }
  .section-heading h2 {
    font-size: 1.75rem;
  }
  .course-card-link {
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 15px;
    padding: 18px 16px;
  }
  .course-art {
    background: #f4f5fb;
  }
  .chapter-art {
    width: 75px;
  }
  .chapter-number {
    font-size: 0.6875rem;
    letter-spacing: 0.06em;
    margin: 2px 0 7px;
    padding: 0 6px;
  }
  .course-card h3 {
    font-size: 1.375rem;
  }
  .course-card p {
    font-size: 0.9375rem;
  }
  .card-kicker {
    font-size: 0.8125rem;
  }
  .tagline {
    font-size: 0.8125rem;
  }
  .course-card .prerequisite {
    font-size: 0.8125rem;
  }
  .learning-aside {
    display: block;
  }
  .aside-note {
    padding: 25px 8px;
  }
  .saved-sections {
    padding: 18px 8px;
  }
  .progress-card {
    padding: 22px;
  }
  .guide {
    grid-template-columns: 1fr;
    gap: 25px;
    padding: 30px 0;
  }
  .guide ol {
    margin-bottom: 0;
  }
  .local-data {
    margin-bottom: 30px;
    padding: 22px;
  }
  .local-data h2 {
    font-size: 1.125rem;
  }
  .site-footer {
    flex-direction: column;
    gap: 10px;
    padding: 25px 0;
    font-size: 0.75rem;
  }
  .site-footer > p {
    text-align: left;
  }
  .lesson-layout {
    padding: 0 17px;
  }
  .lesson-heading h1 {
    font-size: 1.75rem;
  }
  .lesson-section .eyebrow {
    gap: 8px;
  }
  .lesson-toolbar {
    gap: 7px;
    font-size: 0.875rem;
  }
  .toolbar-options {
    width: 100%;
    margin: 0;
    padding-top: 5px;
  }
  .lesson-heading .section-tools {
    margin-bottom: 20px;
  }
  .learning-objective {
    padding: 16px 18px;
  }
  .learning-objective p {
    font-size: 1rem;
  }
  .flow-nav {
    gap: 10px 12px;
    justify-content: flex-start;
  }
  .flow-nav a {
    font-size: 0.875rem;
    gap: 4px;
  }
  .flow-nav a > span:first-child:not([data-lang]) {
    display: none;
  }
  .part-heading {
    font-size: 1.25rem;
  }
  .lab-section {
    padding: 15px;
    margin-left: 0;
    margin-right: 0;
  }
  .demo-mount {
    padding: 12px;
  }
  .lab-title {
    gap: 13px;
  }
  .lab-task {
    font-size: 1rem;
  }
  .demo-mount .color-grid,
  .demo-mount .color-space-cards,
  .demo-mount .curve-compare,
  .demo-mount .attr-grid,
  .gamut-layout {
    grid-template-columns: 1fr;
  }
  .demo-mount .cvd-row {
    flex-wrap: wrap;
  }
  .demo-mount .cvd-cell {
    min-width: 100px;
  }
  .demo-mount .color-picker-row {
    display: flex;
    flex-wrap: wrap;
  }
  .demo-mount .color-picker-row > label {
    flex: 1 1 90px;
  }
  .demo-mount .color-picker-row > div {
    flex: 1 1 100%;
  }
  .demo-mount [style*="grid-template-columns: 1fr 1fr"],
  .demo-mount [style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
  .knowledge-check {
    padding: 19px 16px;
  }
  .quiz legend {
    font-size: 1.0625rem;
  }
  .quiz-option {
    font-size: 1rem;
    padding: 12px 10px;
    gap: 8px;
  }
  .code-content {
    padding: 0 16px 16px;
  }
  .code-details > summary {
    padding: 16px;
  }
  .code-details > summary > .small {
    display: none;
  }
  .reading-content pre {
    font-size: 0.875rem;
    padding: 15px;
  }
  .completion-row {
    align-items: start;
    flex-direction: column;
    gap: 14px;
  }
  .section-pager {
    gap: 15px;
  }
  .pager-link {
    font-size: 0.9375rem;
  }
  .resource-main {
    margin: 33px 20px;
  }
  .resource-main > h1 {
    font-size: 1.875rem;
  }
  .resource-grid {
    grid-template-columns: 1fr;
  }
  .resource-link {
    font-size: 1rem;
    padding: 15px;
  }
  .resource-link small {
    font-size: 0.8125rem;
  }
  .resource-group h2 {
    font-size: 1.375rem;
  }
  .resource-group .section-heading {
    align-items: baseline;
  }
  .resource-group .section-heading > a {
    font-size: 0.75rem;
  }
  .presentation .reading-content {
    font-size: 1.125rem;
  }
  .presentation .lesson-heading h1 {
    font-size: 1.8125rem;
  }
  dialog {
    padding: 21px;
  }
  .dialog-top h2 {
    font-size: 1.125rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}
@media print {
  .site-header,
  .lesson-sidebar,
  .lesson-toolbar,
  .flow-nav,
  .section-tools,
  .lab-actions,
  .completion-row,
  .section-pager,
  .site-footer,
  .search-trigger,
  .code-copy,
  .toast,
  .skip-link,
  .js-only {
    display: none !important;
  }
  .lesson-layout {
    display: block;
    padding: 0;
    max-width: none;
  }
  .lesson-section[hidden] {
    display: block !important;
  }
  .lesson-section {
    page-break-before: always;
    margin: 0 !important;
    border: 0 !important;
    padding: 0 !important;
  }
  .lesson-section:first-of-type {
    page-break-before: auto;
  }
  body {
    background: white;
    font-size: 11pt;
  }
  .reading-content {
    font-size: 11pt;
  }
  .lab-section,
  .knowledge-check {
    break-inside: avoid;
  }
  .code-details {
    display: block;
  }
  .code-content {
    display: block !important;
  }
  .lesson-heading h1 {
    font-size: 22pt;
  }
  a {
    color: inherit;
  }
  pre {
    white-space: pre-wrap !important;
    background: #f2f2f2 !important;
    color: black !important;
  }
  .reading-content .cmt,
  .reading-content .kw,
  .reading-content .str,
  .reading-content .fn,
  .reading-content .num {
    color: inherit;
  }
  .learning-objective {
    background: #f4f4f4;
  }
  .quiz-feedback[hidden] {
    display: none !important;
  }
}

.join-mobile {
  display: none;
}
.swatch-label {
  display: inline-block;
  padding: 5px 8px;
  background: white;
  color: #26314a;
  border-radius: 4px;
  text-shadow: none;
}
.demo-mount .color-cell small {
  color: inherit;
}
.demo-mount .attr-card[role="button"] {
  cursor: pointer;
}
@media (max-width: 560px) {
  .join-chart {
    display: none !important;
  }
  .join-mobile {
    display: table;
  }
  .join-mobile th,
  .join-mobile td {
    padding: 8px 6px;
    font-size: 0.875rem;
  }
  .spiral-chart {
    min-width: 0 !important;
  }
  .header-inner {
    gap: 10px;
  }
  .brand {
    white-space: nowrap;
  }
  .site-nav {
    flex-shrink: 0;
  }
  .header-actions {
    flex-shrink: 0;
  }
  .lesson-heading h1 {
    overflow-wrap: anywhere;
  }
}

@media print {
  .demo-mount:not([data-rendered="true"]) {
    display: none;
  }
}

/* Course map: one compact visual index of all 27 sections. */
.course-map {
  padding: 40px 0 26px;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 95px;
}
.course-map .section-heading {
  margin-bottom: 16px;
}
.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.8125rem;
}
.map-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.map-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1px solid #cbd1e5;
  background: #fff;
  display: inline-block;
}
.map-dot.done {
  background: var(--green-soft);
  border-color: #a9cdbf;
}
.map-dot.saved {
  background: #fdf9ee;
  border-color: #dcc07d;
}
.map-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.map-chapter {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  padding: 13px 0;
  border-top: 1px dashed var(--border);
}
.map-chapter:first-child {
  border-top: 0;
  padding-top: 2px;
}
.map-chapter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 2px;
}
.map-chapter-title {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.45;
}
.map-chapter-title:hover {
  text-decoration: none;
  color: var(--primary);
}
.map-chapter-no {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid #cbd1e5;
  border-radius: 50%;
  background: #fff;
  color: var(--primary);
  font-size: 0.6875rem;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.map-chapter-meta {
  color: var(--muted);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}
.map-chapter-meta .is-complete {
  color: var(--green);
  font-weight: 600;
}
.map-chapter.is-complete .map-chapter-no {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}
.map-sections {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 1px;
}
.map-section {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 6px 12px 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 0.875rem;
  line-height: 1.55;
}
.map-section:hover {
  border-color: #aab3dd;
  background: var(--primary-soft);
  text-decoration: none;
}
.map-index {
  color: #7b849e;
  font: 0.75rem Consolas, monospace;
  flex-shrink: 0;
}
.map-section-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.map-check {
  width: 12px;
  color: var(--green);
  font-size: 0.75rem;
  text-align: center;
  flex-shrink: 0;
}
.map-section.is-done {
  border-color: #b9d9cc;
  background: var(--green-soft);
  color: var(--green);
}
.map-section.is-done .map-index {
  color: var(--green);
}
.map-section.is-saved {
  border-color: #dcc07d;
}
.map-section.is-saved:not(.is-done) {
  background: #fdf9ee;
}
@media (max-width: 1100px) {
  .map-chapter {
    grid-template-columns: 165px minmax(0, 1fr);
    gap: 16px;
  }
}
@media (max-width: 800px) {
  .course-map {
    padding: 30px 0 22px;
  }
  .map-chapter {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
  .map-chapter-head {
    justify-content: flex-start;
  }
  .map-chapter-meta {
    margin-left: auto;
  }
}
@media (max-width: 560px) {
  .map-section {
    font-size: 0.75rem;
    padding: 3px 9px 3px 8px;
  }
  .map-legend {
    gap: 12px;
  }
}

/* Give lesson pages more room on wide screens: a narrower table of contents
   and less outer gutter, while keeping the article at a readable width. */
@media screen and (min-width: 1200px) {
  body[data-lesson] .header-inner {
    max-width: 1440px;
    padding-left: 36px;
    padding-right: 36px;
  }
  .lesson-layout {
    max-width: 1440px;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 40px;
    padding: 0 36px;
  }
  .lesson-content {
    max-width: 960px;
  }
  .presentation .lesson-content,
  .lab-expanded .lesson-content {
    margin-left: auto;
    margin-right: auto;
  }
  body[data-lesson] .site-footer {
    max-width: 1440px;
    padding-left: 36px;
    padding-right: 36px;
  }
}

/* Anchor targets clear the sticky header. */
.lesson-layout {
  row-gap: 0;
}
.lesson-section,
.concept,
.lab-section,
.code-details,
.source-details,
.knowledge-check {
  scroll-margin-top: calc(var(--header) + 18px);
}

/* On narrow screens the chapter links move to a second row inside the same
   sticky header, so they stay available without covering the article. */
@media (max-width: 1200px) {
  :root {
    --header: 114px;
  }
  .site-header {
    height: auto;
  }
  .header-inner {
    flex-wrap: wrap;
    padding-top: 12px;
    padding-bottom: 0;
  }
  .brand {
    order: 1;
  }
  .header-actions {
    order: 2;
    margin-left: auto;
  }
  .site-nav {
    order: 3;
    flex-basis: 100%;
    width: 100%;
    min-width: 0;
    margin-left: 0;
    gap: 18px;
    overflow: visible;
    border-top: 1px solid var(--border);
    padding: 2px 0;
  }
  .chapter-links {
    flex: 1;
    gap: 18px;
  }
  .site-nav a {
    padding: 9px 0;
  }
  .site-nav a.chapter-link {
    padding: 9px 0;
  }
  .chapter-name {
    font-size: 0.8125rem;
  }
}
@media (min-width: 561px) and (max-width: 900px) {
  .demo-mount .color-grid,
  .demo-mount .color-space-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

