/* 链图学堂 — warm editorial notebook + systems map */
:root {
  --paper: #f5f2e9;
  --paper-deep: #ebe6d8;
  --surface: rgba(255, 253, 247, 0.86);
  --surface-solid: #fffdf7;
  --ink: #15211d;
  --muted: #66736d;
  --line: rgba(21, 33, 29, 0.13);
  --line-strong: rgba(21, 33, 29, 0.25);
  --teal: #0a6f62;
  --teal-bright: #13a68e;
  --lime: #c9f15a;
  --coral: #ff765f;
  --yellow: #f5c84c;
  --blue: #4e7cff;
  --code: #13231f;
  --code-ink: #eaf6ee;
  --shadow-sm: 0 4px 18px rgba(28, 45, 38, 0.07);
  --shadow-md: 0 20px 60px rgba(28, 45, 38, 0.12);
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 28px;
  --sidebar: 282px;
  --header: 72px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

html[data-theme="dark"] {
  --paper: #101714;
  --paper-deep: #0b110f;
  --surface: rgba(24, 34, 30, 0.9);
  --surface-solid: #18221e;
  --ink: #eef4ef;
  --muted: #9aaba2;
  --line: rgba(238, 244, 239, 0.11);
  --line-strong: rgba(238, 244, 239, 0.23);
  --teal: #5cdbc4;
  --teal-bright: #61e4ca;
  --lime: #bce653;
  --coral: #ff806c;
  --yellow: #f5c84c;
  --blue: #83a2ff;
  --code: #09100e;
  --code-ink: #edf8f1;
  --shadow-sm: 0 4px 18px rgba(0, 0, 0, 0.18);
  --shadow-md: 0 20px 60px rgba(0, 0, 0, 0.3);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(rgba(21, 33, 29, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 33, 29, 0.025) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::selection { background: var(--lime); color: #15211d; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button { color: inherit; }

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(1px);
  pointer-events: none;
  opacity: 0.45;
}

.ambient-a { width: 360px; height: 360px; right: 3vw; top: 12vh; background: radial-gradient(circle, rgba(201, 241, 90, 0.23), transparent 68%); }
.ambient-b { width: 440px; height: 440px; left: 20vw; bottom: -170px; background: radial-gradient(circle, rgba(19, 166, 142, 0.12), transparent 70%); }

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  left: 16px;
  top: -60px;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 8px;
  text-decoration: none;
  transition: top 0.2s;
}

.skip-link:focus { top: 12px; }

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

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--header);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(18px) saturate(1.3);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  width: 38px;
  height: 38px;
  display: block;
  border: 1.5px solid var(--ink);
  border-radius: 11px;
  transform: rotate(-3deg);
  background: var(--lime);
  box-shadow: 3px 3px 0 var(--ink);
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  height: 1.5px;
  background: var(--ink);
  transform-origin: left center;
}

.brand-mark::before { width: 17px; left: 9px; top: 12px; transform: rotate(29deg); }
.brand-mark::after { width: 16px; left: 9px; top: 25px; transform: rotate(-32deg); }
.brand-mark i { position: absolute; z-index: 1; width: 7px; height: 7px; border: 1.5px solid var(--ink); background: var(--paper); border-radius: 50%; }
.brand-mark i:nth-child(1) { left: 6px; top: 7px; }
.brand-mark i:nth-child(2) { right: 5px; top: 15px; }
.brand-mark i:nth-child(3) { left: 6px; bottom: 5px; }
.brand b { display: block; font-size: 16px; line-height: 1.15; letter-spacing: 0.06em; }
.brand small { display: block; margin-top: 4px; color: var(--muted); font-size: 8px; font-weight: 750; line-height: 1; letter-spacing: 0.17em; }

.top-actions { display: flex; align-items: center; gap: 10px; }
.quiet-link { padding: 7px 5px; color: var(--muted); font-size: 11px; font-weight: 720; text-decoration: none; }
.quiet-link:hover { color: var(--teal); }
.quiet-button, .icon-button, .primary-button, .outline-button, .chip-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s;
}
.quiet-button:hover, .icon-button:hover, .primary-button:hover, .outline-button:hover, .chip-button:hover { transform: translateY(-2px); }
.quiet-button { height: 40px; padding: 0 11px; color: var(--muted); background: transparent; border-radius: 10px; }
.quiet-button:hover { color: var(--ink); background: var(--surface); }
kbd { padding: 2px 6px; border: 1px solid var(--line); border-bottom-color: var(--line-strong); border-radius: 5px; color: var(--muted); background: var(--surface-solid); font: 10px/1.5 ui-monospace, monospace; }
.icon-button { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); }
.primary-button { min-height: 42px; padding: 0 18px; border-radius: 11px; background: var(--ink); color: var(--paper); font-size: 13px; font-weight: 750; box-shadow: 3px 3px 0 color-mix(in srgb, var(--teal) 65%, transparent); }
.primary-button:hover { box-shadow: 5px 5px 0 color-mix(in srgb, var(--teal) 65%, transparent); }
.outline-button { min-height: 42px; padding: 0 18px; border: 1px solid var(--line-strong); border-radius: 11px; background: var(--surface); font-size: 13px; font-weight: 700; }

.app-shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); padding-top: var(--header); min-height: 100vh; }
.course-sidebar {
  position: fixed;
  z-index: 40;
  left: 0;
  top: var(--header);
  bottom: 0;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(15px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sidebar-progress { margin: 20px 18px 13px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.progress-copy { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--muted); }
.progress-copy strong { color: var(--ink); font: 750 11px/1 ui-monospace, monospace; }
.progress-track { height: 5px; margin-top: 10px; overflow: hidden; border-radius: 999px; background: var(--paper-deep); }
.progress-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--teal-bright); transition: width 0.5s var(--ease); }

#course-nav { flex: 1; padding: 4px 12px 16px; }
.nav-tier + .nav-tier { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line-strong); }
.nav-tier-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 9px 3px; color: var(--ink); font: 800 9px/1.3 ui-monospace, monospace; letter-spacing: 0.08em; }
.nav-tier-head span { display: flex; align-items: center; gap: 7px; }
.nav-tier-head i { width: 14px; height: 4px; border-radius: 999px; background: var(--tier-color); }
.nav-tier-head b { padding: 4px 6px; border-radius: 5px; color: var(--muted); background: var(--surface); font-size: 8px; }
.nav-module { margin-top: 9px; }
.nav-module-title { position: relative; display: grid; grid-template-columns: 8px 1fr auto; align-items: center; gap: 8px; padding: 8px 9px; border-radius: 9px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; cursor: pointer; list-style: none; }
.nav-module-title::-webkit-details-marker { display: none; }
.nav-module-title:hover { color: var(--ink); background: var(--surface); }
.nav-module-title i { width: 7px; height: 7px; border-radius: 2px; background: var(--module-color, var(--teal)); transform: rotate(45deg); }
.nav-module-title b { width: 20px; height: 20px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 6px; font: 750 8px/1 ui-monospace, monospace; }
.nav-module-title::after { content: "⌄"; position: absolute; right: 41px; font-size: 10px; transition: transform 0.2s; }
.nav-module[open] .nav-module-title::after { transform: rotate(180deg); }
.nav-module-lessons { padding-top: 2px; }
.lesson-nav-link { position: relative; display: grid; grid-template-columns: 25px minmax(0, 1fr) 16px; align-items: center; gap: 6px; min-height: 40px; padding: 5px 7px; border-radius: 10px; color: var(--muted); font-size: 12px; line-height: 1.25; text-decoration: none; transition: background 0.18s, color 0.18s; }
.lesson-nav-link:hover { background: var(--surface); color: var(--ink); }
.lesson-nav-link.active { color: var(--ink); background: var(--surface-solid); box-shadow: var(--shadow-sm); }
.lesson-nav-link.active::before { content: ""; position: absolute; left: -12px; width: 3px; height: 20px; border-radius: 0 5px 5px 0; background: var(--teal-bright); }
.lesson-index { font: 700 10px/1 ui-monospace, monospace; opacity: 0.75; }
.lesson-title-nav { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lesson-check { width: 15px; height: 15px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; font-size: 9px; }
.lesson-nav-link.completed .lesson-check { border-color: var(--teal-bright); background: var(--teal-bright); color: #06251f; }
.sidebar-foot { display: grid; grid-template-columns: 10px 1fr; column-gap: 7px; padding: 14px 20px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.sidebar-foot small { grid-column: 2; opacity: 0.75; }
.status-dot { width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: var(--teal-bright); box-shadow: 0 0 0 4px color-mix(in srgb, var(--teal-bright) 15%, transparent); }

#main-content { grid-column: 2; min-width: 0; }
.page-wrap { width: min(1180px, calc(100% - 64px)); margin: 0 auto; padding: 46px 0 80px; }

/* Home */
.home-page { overflow: hidden; }
.home-hero { position: relative; display: grid; grid-template-columns: minmax(0, 1.03fr) minmax(430px, 0.97fr); gap: 50px; align-items: center; min-height: 560px; padding: 38px 0 45px; }
.hero-copy { position: relative; z-index: 2; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 22px; color: var(--teal); font-size: 11px; font-weight: 800; letter-spacing: 0.12em; }
.eyebrow i { width: 23px; height: 2px; background: currentColor; box-shadow: 8px -4px 0 -0.5px currentColor; transform: rotate(-7deg); }
.hero-copy h1 { margin: 0; font-size: clamp(45px, 5.3vw, 78px); line-height: 1.05; letter-spacing: -0.055em; font-weight: 900; }
.hero-copy h1 em { position: relative; color: var(--teal); font-style: normal; white-space: nowrap; }
.hero-copy h1 em::after { content: ""; position: absolute; left: 3%; right: 0; bottom: -3px; height: 10px; border-top: 3px solid var(--coral); border-radius: 50%; transform: rotate(-1deg); }
.hero-copy > p { max-width: 610px; margin: 28px 0; color: var(--muted); font-size: 16px; line-height: 1.9; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-actions .primary-button, .hero-actions .outline-button { min-height: 50px; padding-inline: 21px; font-size: 14px; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 33px; color: var(--muted); font-size: 11px; }
.hero-facts span { display: flex; align-items: center; gap: 7px; }
.hero-facts i { width: 6px; height: 6px; border-radius: 50%; background: var(--lime); border: 1px solid var(--ink); }

.hero-map { position: relative; min-height: 480px; }
.map-paper { position: absolute; inset: 18px 15px 23px; border: 1px solid var(--line-strong); border-radius: 24px; background: var(--surface); box-shadow: 13px 16px 0 color-mix(in srgb, var(--paper-deep) 75%, transparent), var(--shadow-md); transform: rotate(1.4deg); overflow: hidden; }
.map-paper::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(var(--line-strong) 0.8px, transparent 0.8px); background-size: 18px 18px; opacity: 0.5; }
.map-label { position: absolute; z-index: 2; left: 26px; top: 22px; display: flex; gap: 8px; align-items: center; font: 800 10px/1 ui-monospace, monospace; letter-spacing: 0.12em; color: var(--muted); }
.map-label::before { content: "LIVE MAP"; padding: 5px 7px; border-radius: 5px; background: var(--ink); color: var(--paper); }
.map-stage { position: absolute; inset: 65px 24px 53px; z-index: 2; }
.map-node { position: absolute; display: grid; place-items: center; width: 106px; min-height: 58px; padding: 9px; border: 1.5px solid var(--ink); border-radius: 14px; color: #15211d; background: var(--node-color, #fff); box-shadow: 4px 4px 0 var(--ink); text-align: center; font-size: 12px; font-weight: 800; transition: transform 0.25s var(--ease), filter 0.25s, opacity 0.25s; }
.map-node small { display: block; margin-top: 2px; font: 600 9px/1.2 ui-monospace, monospace; opacity: 0.68; }
.map-node[data-node="input"] { left: 1%; top: 43%; --node-color: #fffdf7; }
.map-node[data-node="prompt"] { left: 32%; top: 9%; --node-color: #f5c84c; }
.map-node[data-node="model"] { left: 35%; top: 66%; --node-color: #c9f15a; }
.map-node[data-node="tools"] { right: 1%; top: 6%; --node-color: #ff8d78; }
.map-node[data-node="memory"] { right: 0; top: 67%; --node-color: #89c9ff; }
.map-core { position: absolute; left: calc(50% - 42px); top: calc(50% - 42px); z-index: 3; width: 84px; height: 84px; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 50%; color: #15211d; background: var(--surface-solid); box-shadow: 0 0 0 10px color-mix(in srgb, var(--teal-bright) 16%, transparent), 5px 6px 0 var(--ink); text-align: center; font-size: 12px; font-weight: 900; }
.map-core span { display: block; font: 700 8px/1.3 ui-monospace, monospace; color: var(--teal); }
.map-line { position: absolute; z-index: 1; height: 2px; background: var(--ink); transform-origin: left center; opacity: 0.62; }
.map-line::after { content: ""; position: absolute; right: -1px; top: -3px; width: 7px; height: 7px; border-right: 2px solid var(--ink); border-top: 2px solid var(--ink); transform: rotate(45deg); }
.map-line.l1 { width: 142px; left: 19%; top: 51%; transform: rotate(-7deg); }
.map-line.l2 { width: 105px; left: 48%; top: 31%; transform: rotate(52deg); }
.map-line.l3 { width: 133px; left: 57%; top: 48%; transform: rotate(-34deg); }
.map-line.l4 { width: 130px; left: 57%; top: 57%; transform: rotate(32deg); }
.map-line.l5 { width: 102px; left: 42%; top: 65%; transform: rotate(-58deg); }
.map-node.is-running, .flow-node.is-running { transform: translate(-2px, -4px) scale(1.04); filter: saturate(1.25); box-shadow: 7px 8px 0 var(--ink); }
.map-node.is-done { opacity: 0.55; }
.map-footer { position: absolute; z-index: 3; left: 27px; right: 27px; bottom: 17px; display: flex; align-items: center; justify-content: space-between; }
.map-run { display: inline-flex; align-items: center; gap: 8px; padding: 7px 11px; border: 1px solid var(--ink); border-radius: 8px; color: var(--ink); background: var(--lime); font-size: 10px; font-weight: 800; cursor: pointer; box-shadow: 2px 2px 0 var(--ink); }
.map-run:disabled { opacity: 0.6; cursor: wait; }
.map-footer small { color: var(--muted); font: 9px/1 ui-monospace, monospace; }
.paper-tape { position: absolute; z-index: 5; width: 76px; height: 24px; background: rgba(246, 201, 87, 0.58); backdrop-filter: blur(2px); }
.paper-tape.t1 { top: 6px; right: 74px; transform: rotate(7deg); }
.paper-tape.t2 { bottom: 9px; left: -5px; transform: rotate(-8deg); }

.section-rule { display: flex; align-items: center; gap: 14px; margin: 18px 0 28px; }
.section-rule span { color: var(--muted); font: 800 10px/1 ui-monospace, monospace; letter-spacing: 0.14em; white-space: nowrap; }
.section-rule::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.home-section { padding: 35px 0 55px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 27px; }
.section-head h2 { margin: 0; font-size: clamp(28px, 3.2vw, 44px); line-height: 1.12; letter-spacing: -0.04em; }
.section-head p { max-width: 510px; margin: 0; color: var(--muted); font-size: 13px; }

.route-map { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; }
.route-map::before { content: ""; position: absolute; left: 8%; right: 8%; top: 32px; height: 2px; background: repeating-linear-gradient(90deg, var(--line-strong) 0 6px, transparent 6px 12px); }
.route-card { position: relative; z-index: 1; min-height: 220px; padding: 20px 17px 16px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); text-decoration: none; transition: transform 0.2s var(--ease), box-shadow 0.2s; }
.route-card:hover { transform: translateY(-6px) rotate(-0.5deg); box-shadow: var(--shadow-md); }
.route-stop { width: 26px; height: 26px; display: grid; place-items: center; margin-bottom: 29px; border: 2px solid var(--ink); border-radius: 50%; color: #15211d; background: var(--module-color); box-shadow: 0 0 0 5px var(--paper); font: 900 9px/1 ui-monospace, monospace; }
.route-card h3 { margin: 0 0 6px; font-size: 15px; }
.route-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.route-code { display: block; margin: -20px 0 29px 36px; color: var(--muted); font: 700 8px/1 ui-monospace, monospace; letter-spacing: 0.08em; }
.route-card footer { position: absolute; left: 17px; right: 17px; bottom: 13px; display: flex; justify-content: space-between; color: var(--muted); font: 700 9px/1 ui-monospace, monospace; }

.tier-overview-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.tier-overview-card { position: relative; min-height: 240px; padding: 24px; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: inset 0 5px 0 var(--tier-color); }
.tier-overview-card::after { content: ""; position: absolute; right: -45px; bottom: -55px; width: 150px; height: 150px; border: 26px solid color-mix(in srgb, var(--tier-color) 13%, transparent); border-radius: 50%; }
.tier-overview-card > span { color: var(--tier-color); font: 800 9px/1 ui-monospace, monospace; letter-spacing: 0.11em; }
.tier-overview-card h3 { position: relative; z-index: 1; display: flex; align-items: end; justify-content: space-between; margin: 23px 0 10px; font-size: 24px; }
.tier-overview-card h3 b { color: var(--tier-color); font: 900 42px/0.85 ui-monospace, monospace; }
.tier-overview-card p { position: relative; z-index: 1; margin: 0 0 24px; color: var(--muted); font-size: 12px; line-height: 1.75; }
.tier-overview-card a { position: absolute; z-index: 2; left: 24px; bottom: 20px; color: var(--teal); font-size: 11px; font-weight: 800; text-decoration: none; }
.tier-route-group + .tier-route-group { margin-top: 55px; padding-top: 47px; border-top: 1px dashed var(--line-strong); }
.tier-route-group > header { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 13px; margin-bottom: 20px; }
.tier-route-group > header > span { padding: 6px 8px; border-radius: 6px; color: #10201b; background: var(--tier-color); font: 850 9px/1 ui-monospace, monospace; }
.tier-route-group > header h3 { margin: 0; font-size: 22px; }
.tier-route-group > header p { margin: 0; color: var(--muted); font-size: 11px; }

.concept-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.concept-card { position: relative; min-height: 180px; padding: 21px; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.concept-card::after { content: attr(data-symbol); position: absolute; right: -2px; bottom: -32px; color: color-mix(in srgb, var(--ink) 6%, transparent); font: 900 112px/1 serif; transform: rotate(-8deg); }
.concept-card .tag { display: inline-block; padding: 4px 7px; border-radius: 5px; color: #15211d; background: var(--card-color, var(--lime)); font: 800 9px/1 ui-monospace, monospace; }
.concept-card h3 { position: relative; z-index: 1; margin: 19px 0 7px; font-size: 20px; }
.concept-card p { position: relative; z-index: 1; max-width: 85%; margin: 0; color: var(--muted); font-size: 12px; }

.promise-panel { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 0; overflow: hidden; border: 1px solid var(--ink); border-radius: 24px; background: var(--ink); color: var(--paper); box-shadow: 8px 9px 0 var(--teal-bright); }
.promise-copy { padding: 38px 41px; }
.promise-copy span { color: var(--lime); font: 750 10px/1 ui-monospace, monospace; letter-spacing: 0.12em; }
.promise-copy h2 { margin: 14px 0 12px; font-size: clamp(28px, 3.5vw, 47px); line-height: 1.1; letter-spacing: -0.04em; }
.promise-copy p { max-width: 590px; margin: 0 0 24px; color: color-mix(in srgb, var(--paper) 72%, transparent); font-size: 13px; }
.promise-list { display: grid; align-content: center; gap: 12px; padding: 35px; border-left: 1px dashed color-mix(in srgb, var(--paper) 25%, transparent); background: color-mix(in srgb, var(--teal) 23%, var(--ink)); }
.promise-list div { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; font-size: 12px; }
.promise-list i { width: 23px; height: 23px; display: grid; place-items: center; border: 1px solid var(--lime); border-radius: 50%; color: var(--lime); font-style: normal; font-size: 10px; }
.site-footer { display: flex; justify-content: space-between; gap: 20px; padding: 26px 0 10px; color: var(--muted); font-size: 10px; }
.site-footer a { text-underline-offset: 3px; }

.compact-section { padding-top: 20px; }
.track-preview-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.track-preview { position: relative; min-height: 230px; padding: 21px; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); text-decoration: none; transition: transform 0.2s var(--ease), box-shadow 0.2s; }
.track-preview::before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; background: var(--track-color); }
.track-preview:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.track-preview > span { display: inline-block; padding: 4px 7px; border-radius: 5px; color: #15211d; background: var(--track-color); font: 800 8px/1 ui-monospace, monospace; }
.track-preview h3 { margin: 18px 0 8px; font-size: 19px; }
.track-preview p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.75; }
.track-preview b { position: absolute; left: 21px; bottom: 18px; color: var(--teal); font-size: 10px; }
.resource-callout { display: flex; align-items: center; justify-content: space-between; gap: 30px; margin: 25px 0 35px; padding: 34px 38px; border: 1px solid var(--ink); border-radius: 23px; background: color-mix(in srgb, var(--yellow) 20%, var(--surface)); box-shadow: 7px 7px 0 var(--ink); }
.resource-callout > div:first-child { max-width: 750px; }
.resource-callout > div > span { color: var(--teal); font: 800 9px/1 ui-monospace, monospace; letter-spacing: 0.12em; }
.resource-callout h2 { margin: 11px 0 7px; font-size: clamp(24px, 3vw, 38px); line-height: 1.15; letter-spacing: -0.04em; }
.resource-callout p { margin: 0; color: var(--muted); font-size: 12px; }
.resource-callout-actions { flex: none; display: grid; gap: 9px; }

/* Lesson */
.lesson-page { width: min(980px, calc(100% - 64px)); margin: 0 auto; padding: 46px 0 100px; }
.lesson-breadcrumb { display: flex; align-items: center; gap: 8px; margin-bottom: 25px; color: var(--muted); font-size: 11px; }
.lesson-breadcrumb a { text-decoration: none; }
.lesson-breadcrumb a:hover { color: var(--teal); }
.lesson-breadcrumb i { width: 4px; height: 4px; border-radius: 50%; background: var(--line-strong); }
.lesson-header { position: relative; padding-bottom: 29px; border-bottom: 1px solid var(--line); }
.lesson-kicker { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; color: var(--module-color, var(--teal)); font: 800 10px/1 ui-monospace, monospace; letter-spacing: 0.13em; }
.lesson-kicker::before { content: ""; width: 28px; height: 8px; border-top: 2px solid currentColor; border-bottom: 1px solid currentColor; transform: skew(-25deg); }
.lesson-header h1 { max-width: 820px; margin: 0; font-size: clamp(36px, 5.2vw, 64px); line-height: 1.08; letter-spacing: -0.05em; }
.lesson-subtitle { max-width: 730px; margin: 18px 0 0; color: var(--muted); font-size: 16px; line-height: 1.85; }
.lesson-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.meta-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--surface); font-size: 10px; }
.meta-pill i { width: 5px; height: 5px; border-radius: 50%; background: var(--pill-color, var(--teal-bright)); }
.tier-meta-pill { border-color: color-mix(in srgb, var(--tier-color) 45%, var(--line)); color: var(--ink); background: color-mix(in srgb, var(--tier-color) 10%, var(--surface)); }
.lesson-complete-top { position: absolute; right: 0; top: 8px; }
.complete-button { display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); font-size: 11px; font-weight: 750; cursor: pointer; }
.complete-button i { width: 16px; height: 16px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; font-style: normal; }
.complete-button.is-complete { border-color: var(--teal-bright); color: var(--teal); background: color-mix(in srgb, var(--teal-bright) 10%, var(--surface)); }
.complete-button.is-complete i { border-color: var(--teal-bright); background: var(--teal-bright); color: #06251f; }

.lesson-overview { display: grid; grid-template-columns: 1fr 1.35fr; gap: 14px; margin: 26px 0 44px; }
.overview-card { padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.overview-card h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 11px; font-size: 12px; }
.overview-card h2 span { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 7px; color: #15211d; background: var(--lime); font-size: 10px; }
.overview-card ul { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: 11px; }
.overview-card li { position: relative; padding-left: 14px; }
.overview-card li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 6px; height: 1.5px; background: var(--teal-bright); }
.analogy-card { position: relative; overflow: hidden; }
.analogy-card p { position: relative; z-index: 1; margin: 0; color: var(--ink); font-size: 12px; }
.learning-contract { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; margin: -25px 0 30px; }
.learning-contract article { position: relative; padding: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.learning-contract article::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--tier-color); }
.learning-contract span { color: var(--tier-color); font: 800 8px/1 ui-monospace, monospace; letter-spacing: 0.08em; }
.learning-contract h2 { margin: 9px 0 6px; font-size: 14px; }
.learning-contract p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.65; }
.analogy-card::after { content: "≈"; position: absolute; right: 10px; bottom: -28px; color: color-mix(in srgb, var(--coral) 14%, transparent); font: 900 100px/1 serif; }
.stage-context { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: -25px 0 48px; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: var(--line); }
.stage-context > div { padding: 16px 18px; background: var(--surface); }
.stage-context span { color: var(--teal); font: 800 8px/1 ui-monospace, monospace; letter-spacing: 0.08em; }
.stage-context p { margin: 7px 0 0; color: var(--muted); font-size: 10px; line-height: 1.65; }

.lesson-content { max-width: 820px; margin: 0 auto; }
.lesson-block { margin: 48px 0; }
.block-heading { position: relative; margin: 0 0 17px; font-size: 26px; line-height: 1.25; letter-spacing: -0.025em; }
.block-heading .heading-number { position: absolute; right: calc(100% + 13px); top: 2px; color: var(--teal); font: 800 10px/1.8 ui-monospace, monospace; }
.lesson-block > p, .prose p { margin: 0 0 14px; color: var(--muted); font-size: 15px; line-height: 2; }
.lesson-block strong, .prose strong { color: var(--ink); font-weight: 780; }
.lesson-block code:not(pre code), .prose code { padding: 2px 5px; border: 1px solid var(--line); border-radius: 5px; color: var(--teal); background: var(--surface); font: 0.88em/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; }
.key-sentence { position: relative; margin: 22px 0; padding: 17px 20px 17px 46px; border-left: 4px solid var(--coral); border-radius: 0 13px 13px 0; background: color-mix(in srgb, var(--coral) 8%, var(--surface)); color: var(--ink); font-size: 15px; font-weight: 720; }
.key-sentence::before { content: "!"; position: absolute; left: 17px; top: 17px; width: 18px; height: 18px; display: grid; place-items: center; border: 1px solid var(--coral); border-radius: 50%; color: var(--coral); font: 900 10px/1 ui-monospace, monospace; }

.story-block { display: grid; grid-template-columns: 47px 1fr; gap: 15px; padding: 21px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.story-icon { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--ink); border-radius: 13px; color: #15211d; background: var(--yellow); box-shadow: 3px 3px 0 var(--ink); font-weight: 900; }
.story-block h3 { margin: 0 0 6px; font-size: 15px; }
.story-block p { margin: 0; color: var(--muted); font-size: 12px; }

.mini-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.mini-card { padding: 17px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.mini-card .mini-number { display: inline-grid; place-items: center; min-width: 23px; height: 23px; padding: 0 6px; border-radius: 7px; color: #15211d; background: var(--mini-color, var(--lime)); font: 800 9px/1 ui-monospace, monospace; }
.mini-card h3 { margin: 12px 0 5px; font-size: 14px; }
.mini-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; }

.steps-list { position: relative; display: grid; gap: 0; }
.step-item { position: relative; display: grid; grid-template-columns: 42px 1fr; gap: 14px; padding-bottom: 24px; }
.step-item:not(:last-child)::after { content: ""; position: absolute; left: 20px; top: 37px; bottom: 3px; width: 1px; border-left: 1px dashed var(--line-strong); }
.step-number { z-index: 1; width: 41px; height: 41px; display: grid; place-items: center; border: 1px solid var(--ink); border-radius: 12px; color: #15211d; background: var(--step-color, var(--lime)); box-shadow: 3px 3px 0 var(--ink); font: 900 10px/1 ui-monospace, monospace; }
.step-content { padding-top: 2px; }
.step-content h3 { margin: 0 0 4px; font-size: 14px; }
.step-content p { margin: 0; color: var(--muted); font-size: 12px; }

.compare-table { overflow: hidden; border: 1px solid var(--line-strong); border-radius: 16px; background: var(--surface); }
.compare-row { display: grid; grid-template-columns: 0.7fr 1fr 1fr; }
.compare-row:not(:last-child) { border-bottom: 1px solid var(--line); }
.compare-row > div { padding: 13px 15px; font-size: 11px; }
.compare-row > div:not(:last-child) { border-right: 1px solid var(--line); }
.compare-row.header { color: var(--ink); background: var(--paper-deep); font-weight: 800; }
.compare-row:not(.header) > div:first-child { color: var(--ink); font-weight: 700; }
.compare-row:not(.header) > div:not(:first-child) { color: var(--muted); }

.flow-figure { margin: 22px 0; padding: 23px; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.flow-caption { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 20px; }
.flow-caption h3 { margin: 0; font-size: 13px; }
.flow-caption p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.flow-run { flex: none; padding: 7px 11px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface-solid); font-size: 10px; font-weight: 750; cursor: pointer; }
.flow-canvas { position: relative; display: flex; align-items: stretch; justify-content: center; gap: 27px; min-height: 96px; padding: 8px 2px; }
.flow-node { position: relative; z-index: 2; flex: 1; min-width: 0; max-width: 145px; display: grid; place-items: center; align-content: center; padding: 13px 8px; border: 1.5px solid var(--ink); border-radius: 13px; color: #15211d; background: var(--flow-color, #fffdf7); box-shadow: 3px 3px 0 var(--ink); text-align: center; font-size: 11px; font-weight: 800; transition: transform 0.2s, filter 0.2s, opacity 0.2s; }
.flow-node small { display: block; margin-top: 3px; font: 600 8px/1.25 ui-monospace, monospace; opacity: 0.65; }
.flow-node:not(:last-child)::after { content: "→"; position: absolute; left: calc(100% + 7px); top: 50%; color: var(--ink); font: 700 14px/1 ui-monospace, monospace; transform: translateY(-50%); }
.flow-node.is-done { opacity: 0.5; }
.flow-canvas.branch { display: grid; grid-template-columns: 1fr 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 18px 50px; }
.flow-canvas.branch .flow-node { width: 100%; max-width: none; }
.flow-canvas.branch .flow-node:first-child { grid-row: 1 / 3; align-self: center; }
.flow-canvas.branch .flow-node:last-child { grid-column: 3; grid-row: 1 / 3; align-self: center; }
.flow-canvas.branch .flow-node:nth-child(2) { grid-column: 2; grid-row: 1; }
.flow-canvas.branch .flow-node:nth-child(3) { grid-column: 2; grid-row: 2; }
.flow-canvas.branch .flow-node::after { display: none; }
.branch-path { position: absolute; left: 30%; right: 30%; height: 1px; background: var(--line-strong); z-index: 0; }

.code-shell { overflow: hidden; border: 1px solid rgba(255,255,255,0.09); border-radius: 17px; background: var(--code); box-shadow: var(--shadow-md); }
.code-head { display: flex; align-items: center; justify-content: space-between; min-height: 43px; padding: 0 11px 0 16px; border-bottom: 1px solid rgba(255,255,255,0.09); color: rgba(234,246,238,0.7); }
.code-title { display: flex; align-items: center; gap: 10px; font: 650 10px/1 ui-monospace, SFMono-Regular, Consolas, monospace; }
.code-dots { display: flex; gap: 4px; }
.code-dots i { width: 6px; height: 6px; border-radius: 50%; background: #ff765f; }
.code-dots i:nth-child(2) { background: #f5c84c; }
.code-dots i:nth-child(3) { background: #5cdbc4; }
.copy-button { display: inline-flex; align-items: center; gap: 5px; padding: 6px 8px; border: 1px solid rgba(255,255,255,0.13); border-radius: 7px; color: rgba(234,246,238,0.68); background: rgba(255,255,255,0.04); font: 650 9px/1 ui-monospace, monospace; cursor: pointer; }
.copy-button:hover { color: var(--code-ink); background: rgba(255,255,255,0.08); }
.code-shell pre { margin: 0; padding: 19px 21px 22px; overflow-x: auto; color: var(--code-ink); font: 12px/1.75 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; tab-size: 4; }
.code-shell code { font: inherit; }
.tok-key { color: #ff9a88; }
.tok-str { color: #c9f15a; }
.tok-fn { color: #8db5ff; }
.tok-num { color: #f5c84c; }
.tok-comment { color: #7f9389; font-style: italic; }
.code-notes { display: grid; gap: 7px; margin-top: 12px; padding: 0 4px; color: var(--muted); font-size: 11px; }
.code-notes span { display: flex; gap: 8px; }
.code-notes i { flex: none; width: 18px; height: 18px; display: grid; place-items: center; margin-top: 1px; border-radius: 50%; color: #15211d; background: var(--yellow); font: 800 8px/1 ui-monospace, monospace; font-style: normal; }

.callout { display: grid; grid-template-columns: 33px 1fr; gap: 12px; padding: 17px; border: 1px solid color-mix(in srgb, var(--callout-color, var(--teal-bright)) 35%, var(--line)); border-radius: 14px; background: color-mix(in srgb, var(--callout-color, var(--teal-bright)) 7%, var(--surface)); }
.callout-icon { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--callout-color, var(--teal-bright)); border-radius: 9px; color: var(--callout-color, var(--teal)); font-size: 12px; font-weight: 900; }
.callout h3 { margin: 0 0 4px; font-size: 12px; }
.callout p { margin: 0; color: var(--muted); font-size: 11px; }

.formula-paper { position: relative; padding: 26px; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 18px; background:
  linear-gradient(rgba(78,124,255,0.055) 1px, transparent 1px),
  linear-gradient(90deg, rgba(78,124,255,0.055) 1px, transparent 1px),
  var(--surface); background-size: 22px 22px; }
.formula-paper::after { content: "∑"; position: absolute; right: 10px; bottom: -35px; color: color-mix(in srgb, var(--blue) 8%, transparent); font: 900 120px/1 Georgia, serif; transform: rotate(-8deg); }
.formula-expression { position: relative; z-index: 1; padding: 20px; overflow-x: auto; border: 1.5px solid var(--ink); border-radius: 13px; color: #15211d; background: #fffdf7; box-shadow: 4px 4px 0 var(--ink); text-align: center; white-space: nowrap; font: 700 clamp(18px, 3vw, 27px)/1.3 Georgia, "Times New Roman", serif; }
.formula-paper > p { position: relative; z-index: 1; margin: 18px 0 13px; color: var(--ink); font-size: 13px; font-weight: 650; text-align: center; }
.formula-variables { position: relative; z-index: 1; display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; }
.formula-variables span { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: var(--surface-solid); font-size: 9px; }
.formula-variables b { color: var(--teal); font: 800 11px/1 ui-monospace, monospace; }
.formula-variables i { color: var(--line-strong); font-style: normal; }
.formula-example { position: relative; z-index: 1; margin-top: 15px; padding: 10px 12px; border-left: 3px solid var(--yellow); border-radius: 0 9px 9px 0; color: var(--muted); background: color-mix(in srgb, var(--yellow) 10%, var(--surface)); font-size: 10px; }
.formula-example b { color: var(--ink); }

.exercise-card { position: relative; padding: 25px; border: 1.5px solid var(--ink); border-radius: 19px; background: color-mix(in srgb, var(--blue) 5%, var(--surface-solid)); box-shadow: 6px 6px 0 var(--blue); }
.exercise-head { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font: 700 8px/1 ui-monospace, monospace; letter-spacing: 0.08em; }
.exercise-head span { padding: 5px 7px; border-radius: 5px; color: #fff; background: var(--blue); }
.exercise-head b { align-self: center; font-weight: 650; }
.exercise-card h2 { margin: 15px 0 8px; font-size: 21px; }
.exercise-prompt { margin: 0 0 15px !important; color: var(--ink) !important; font-size: 13px !important; line-height: 1.8 !important; }
.exercise-checklist { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 15px; margin: 0 0 16px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); list-style: none; }
.exercise-checklist li { position: relative; padding-left: 17px; color: var(--muted); font-size: 10px; }
.exercise-checklist li::before { content: "□"; position: absolute; left: 0; color: var(--blue); }
.exercise-hint { margin: 10px 0; padding: 10px 12px; border: 1px dashed var(--line-strong); border-radius: 9px; background: var(--surface); }
.exercise-hint summary { color: var(--teal); font-size: 10px; font-weight: 750; cursor: pointer; }
.exercise-hint p { margin: 8px 0 0; color: var(--muted); font-size: 10px; }
.exercise-reveal { margin-top: 5px; padding: 9px 12px; border: 1px solid var(--ink); border-radius: 9px; color: #fff; background: var(--ink); font-size: 10px; font-weight: 750; cursor: pointer; }
.exercise-answer { display: none; margin-top: 14px; padding: 15px; border: 1px solid var(--teal-bright); border-radius: 11px; background: color-mix(in srgb, var(--teal-bright) 8%, var(--surface)); }
.exercise-answer.show { display: block; }
.exercise-answer span { color: var(--teal); font: 800 8px/1 ui-monospace, monospace; letter-spacing: 0.08em; }
.exercise-answer p { margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.8; }

.quiz-card { padding: 23px; border: 1.5px solid var(--ink); border-radius: 18px; background: var(--surface-solid); box-shadow: 6px 6px 0 var(--yellow); }
.quiz-label { display: inline-flex; align-items: center; gap: 7px; color: var(--teal); font: 800 9px/1 ui-monospace, monospace; letter-spacing: 0.1em; }
.quiz-label::before { content: "?"; width: 19px; height: 19px; display: grid; place-items: center; border-radius: 6px; color: #15211d; background: var(--yellow); }
.quiz-card h3 { margin: 13px 0 15px; font-size: 16px; }
.quiz-options { display: grid; gap: 8px; }
.quiz-option { display: grid; grid-template-columns: 25px 1fr; gap: 9px; align-items: center; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); text-align: left; font-size: 11px; cursor: pointer; }
.quiz-option:hover { border-color: var(--teal-bright); }
.quiz-option span:first-child { width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 6px; font: 700 9px/1 ui-monospace, monospace; }
.quiz-option.correct { border-color: var(--teal-bright); background: color-mix(in srgb, var(--teal-bright) 10%, var(--surface)); }
.quiz-option.wrong { border-color: var(--coral); background: color-mix(in srgb, var(--coral) 9%, var(--surface)); }
.quiz-feedback { display: none; margin-top: 13px; padding-top: 12px; border-top: 1px dashed var(--line); color: var(--muted); font-size: 11px; }
.quiz-feedback.show { display: block; }

.source-list { display: grid; gap: 8px; padding: 0; list-style: none; }
.source-list a { display: grid; grid-template-columns: 28px 1fr auto; gap: 9px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: var(--surface); font-size: 10px; text-decoration: none; }
.source-list a:hover { color: var(--ink); border-color: var(--teal-bright); }
.source-list i { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 8px; color: #15211d; background: var(--lime); font: 800 8px/1 ui-monospace, monospace; font-style: normal; }
.source-list small { font: 700 8px/1 ui-monospace, monospace; opacity: 0.75; }

.lesson-finish { margin: 58px 0 0; padding: 27px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); text-align: center; }
.lesson-finish .finish-mark { width: 46px; height: 46px; display: grid; place-items: center; margin: 0 auto 12px; border: 1.5px solid var(--ink); border-radius: 50%; color: #15211d; background: var(--lime); box-shadow: 4px 4px 0 var(--ink); font-weight: 900; }
.lesson-finish h2 { margin: 0 0 5px; font-size: 20px; }
.lesson-finish p { margin: 0 0 17px; color: var(--muted); font-size: 11px; }
.finish-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 9px; }
.lesson-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 22px; }
.pager-link { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); text-decoration: none; }
.pager-link:hover { border-color: var(--teal-bright); }
.pager-link.next { text-align: right; }
.pager-link small { display: block; color: var(--muted); font-size: 9px; }
.pager-link strong { display: block; margin-top: 2px; font-size: 11px; }

/* Roadmap + resource library */
.wide-page-wrap { width: min(1120px, calc(100% - 64px)); margin: 0 auto; padding: 48px 0 90px; }
.roadmap-header, .resources-header { display: grid; grid-template-columns: 1.1fr 0.8fr; column-gap: 40px; align-items: end; margin: 20px 0 40px; }
.roadmap-header .eyebrow, .resources-header .eyebrow { grid-column: 1 / -1; }
.roadmap-header h1, .resources-header h1 { margin: 0; font-size: clamp(48px, 7vw, 82px); line-height: 0.98; letter-spacing: -0.06em; }
.roadmap-header h1 em, .resources-header h1 em { color: var(--teal); font-style: normal; }
.roadmap-header > p, .resources-header > p { margin: 0 0 6px; color: var(--muted); font-size: 13px; line-height: 1.85; }
.path-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin-bottom: 14px; }
.path-tab { min-height: 82px; padding: 13px; border: 1px solid var(--line); border-radius: 13px; color: var(--muted); background: var(--surface); text-align: left; cursor: pointer; }
.path-tab:hover, .path-tab.active { border-color: var(--ink); color: var(--ink); box-shadow: 3px 3px 0 var(--path-color); }
.path-tab span { display: block; margin-bottom: 7px; color: var(--teal); font: 700 8px/1 ui-monospace, monospace; }
.path-tab b { font-size: 13px; }
.selected-path { display: grid; grid-template-columns: 0.9fr 1.1fr; overflow: hidden; border: 1px solid var(--ink); border-radius: 21px; background: var(--ink); color: var(--paper); box-shadow: 7px 7px 0 var(--path-color); }
.selected-path-copy { padding: 30px; }
.selected-path-copy > span { color: var(--path-color); font: 800 8px/1 ui-monospace, monospace; letter-spacing: 0.1em; }
.selected-path h2 { margin: 11px 0 8px; font-size: 31px; }
.selected-path-copy > p { margin: 0; color: color-mix(in srgb, var(--paper) 72%, transparent); font-size: 11px; line-height: 1.8; }
.path-progress { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 8px; margin-top: 24px; }
.path-progress b { color: var(--path-color); font: 800 15px/1 ui-monospace, monospace; }
.path-progress span { color: color-mix(in srgb, var(--paper) 60%, transparent); font-size: 9px; }
.path-progress i { grid-column: 1 / -1; height: 5px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,0.12); }
.path-progress em { display: block; height: 100%; border-radius: inherit; background: var(--path-color); }
.month-plan { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: rgba(255,255,255,0.12); }
.month-plan div { padding: 22px; background: color-mix(in srgb, var(--teal) 24%, var(--ink)); }
.month-plan b { color: var(--path-color); font: 800 9px/1 ui-monospace, monospace; }
.month-plan p { margin: 7px 0 0; color: color-mix(in srgb, var(--paper) 75%, transparent); font-size: 10px; line-height: 1.7; }
.path-sequence { position: relative; display: grid; gap: 14px; max-width: 940px; margin: 0 auto 70px; }
.path-sequence::before { content: ""; position: absolute; left: 31px; top: 30px; bottom: 30px; border-left: 1px dashed var(--line-strong); }
.sequence-stage { position: relative; display: grid; grid-template-columns: 64px 1fr; gap: 19px; }
.sequence-number { z-index: 1; width: 62px; height: 62px; display: grid; place-items: center; border: 1.5px solid var(--ink); border-radius: 17px; color: #15211d; background: var(--module-color); box-shadow: 4px 4px 0 var(--ink); font: 900 12px/1 ui-monospace, monospace; }
.sequence-copy { padding: 22px 23px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); }
.sequence-copy > span { color: var(--teal); font: 750 8px/1 ui-monospace, monospace; letter-spacing: 0.07em; }
.sequence-copy h2 { margin: 8px 0 5px; font-size: 21px; }
.sequence-copy > p { margin: 0 0 15px; color: var(--muted); font-size: 11px; }
.sequence-copy dl { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 0 0 13px; }
.sequence-copy dl div { padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-solid); }
.sequence-copy dt { color: var(--ink); font-size: 9px; font-weight: 800; }
.sequence-copy dd { margin: 4px 0 0; color: var(--muted); font-size: 9px; line-height: 1.6; }
.sequence-copy a { color: var(--teal); font-size: 10px; font-weight: 750; text-decoration: none; }
.roadmap-rules { margin: 60px 0; }
.weekly-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 11px; }
.weekly-grid article { min-height: 180px; padding: 19px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.weekly-grid span { color: var(--teal); font: 750 8px/1 ui-monospace, monospace; }
.weekly-grid h3 { margin: 17px 0 7px; font-size: 16px; }
.weekly-grid p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.75; }
.readiness-panel { display: grid; grid-template-columns: 0.8fr 1.2fr auto; gap: 30px; align-items: center; padding: 30px; border: 1px solid var(--ink); border-radius: 20px; background: color-mix(in srgb, var(--lime) 18%, var(--surface)); box-shadow: 6px 6px 0 var(--ink); }
.readiness-panel > div span { color: var(--teal); font: 800 8px/1 ui-monospace, monospace; }
.readiness-panel h2 { margin: 8px 0 0; font-size: 24px; line-height: 1.2; }
.readiness-panel ul { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.readiness-panel li { display: grid; grid-template-columns: 20px 1fr; gap: 7px; align-items: center; color: var(--muted); font-size: 10px; }
.readiness-panel li i { width: 19px; height: 19px; display: grid; place-items: center; border-radius: 50%; color: #15211d; background: var(--lime); font: 800 8px/1 ui-monospace, monospace; font-style: normal; }

.resource-stats { grid-column: 2; display: flex; flex-wrap: wrap; gap: 15px; margin-top: 20px; }
.resource-stats span { color: var(--muted); font-size: 9px; }
.resource-stats b { display: block; color: var(--ink); font: 900 22px/1.1 ui-monospace, monospace; }
.resource-howto { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-bottom: 25px; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: var(--line); }
.resource-howto > div { display: grid; grid-template-columns: 34px 1fr; gap: 10px; padding: 17px; background: var(--surface); }
.resource-howto b { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 9px; color: #15211d; background: var(--yellow); font: 900 9px/1 ui-monospace, monospace; }
.resource-howto span { color: var(--muted); font-size: 9px; line-height: 1.55; }
.resource-howto strong { display: block; margin-bottom: 3px; color: var(--ink); font-size: 11px; }
.resource-toolbar { position: sticky; z-index: 4; top: calc(var(--header) + 10px); display: grid; grid-template-columns: 1fr 190px 190px; gap: 9px; padding: 11px; border: 1px solid var(--line-strong); border-radius: 15px; background: color-mix(in srgb, var(--surface-solid) 94%, transparent); backdrop-filter: blur(14px); box-shadow: var(--shadow-sm); }
.resource-toolbar label { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 8px; }
.resource-toolbar label > span { color: var(--muted); font-size: 9px; font-weight: 750; }
.resource-toolbar input, .resource-toolbar select { width: 100%; height: 38px; min-width: 0; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--surface); outline: 0; font-size: 10px; }
.resource-toolbar input:focus, .resource-toolbar select:focus { border-color: var(--teal-bright); }
.resource-result-count { margin: 14px 2px 10px; color: var(--muted); font: 700 9px/1 ui-monospace, monospace; }
.resource-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.resource-card { position: relative; min-height: 330px; padding: 20px; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.resource-card::after { content: "↗"; position: absolute; right: -6px; bottom: -28px; color: color-mix(in srgb, var(--ink) 5%, transparent); font: 900 100px/1 serif; }
.resource-card-top { display: flex; justify-content: space-between; align-items: center; }
.resource-card-top span { padding: 4px 7px; border-radius: 5px; color: #15211d; background: var(--lime); font: 800 8px/1 ui-monospace, monospace; }
.resource-card-top b { color: var(--line-strong); font: 800 10px/1 ui-monospace, monospace; }
.resource-card h2 { position: relative; z-index: 1; margin: 19px 0 3px; font-size: 19px; line-height: 1.25; }
.resource-provider { margin: 0 0 13px !important; color: var(--teal) !important; font: 700 9px/1.4 ui-monospace, monospace !important; }
.resource-card > p:not(.resource-provider) { position: relative; z-index: 1; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.75; }
.resource-meta { position: absolute; z-index: 1; left: 20px; right: 20px; bottom: 54px; display: flex; flex-wrap: wrap; gap: 5px; }
.resource-meta span { padding: 4px 6px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); background: var(--surface-solid); font-size: 8px; }
.resource-card > a { position: absolute; z-index: 2; left: 20px; right: 20px; bottom: 17px; display: flex; justify-content: space-between; color: var(--teal); font-size: 10px; font-weight: 800; text-decoration: none; }
.source-policy { margin: 60px 0 20px; padding: 31px; border-left: 5px solid var(--teal-bright); border-radius: 0 18px 18px 0; background: var(--surface); }
.source-policy span { color: var(--teal); font: 800 8px/1 ui-monospace, monospace; letter-spacing: 0.1em; }
.source-policy h2 { margin: 11px 0 8px; font-size: 27px; }
.source-policy p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.9; }

/* Glossary */
.glossary-page { width: min(1050px, calc(100% - 64px)); margin: 0 auto; padding: 52px 0 90px; }
.glossary-header { display: grid; grid-template-columns: 1fr 0.8fr; gap: 30px; align-items: end; margin-bottom: 34px; }
.glossary-header h1 { margin: 0; font-size: clamp(42px, 6vw, 72px); line-height: 1; letter-spacing: -0.06em; }
.glossary-header h1 span { color: var(--teal); }
.glossary-header p { margin: 0; color: var(--muted); font-size: 13px; }
.glossary-filter { display: flex; gap: 9px; margin-bottom: 19px; }
.glossary-filter input { width: 100%; height: 46px; padding: 0 15px; border: 1px solid var(--line-strong); border-radius: 12px; color: var(--ink); background: var(--surface); outline: none; }
.glossary-filter input:focus { border-color: var(--teal-bright); box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal-bright) 15%, transparent); }
.glossary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.glossary-card { position: relative; min-height: 176px; padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.glossary-card::before { content: attr(data-letter); position: absolute; right: 12px; top: 7px; color: color-mix(in srgb, var(--ink) 6%, transparent); font: 900 52px/1 serif; }
.glossary-term { position: relative; z-index: 1; display: flex; align-items: baseline; gap: 7px; }
.glossary-term h2 { margin: 0; font-size: 15px; }
.glossary-term span { color: var(--muted); font: 650 9px/1 ui-monospace, monospace; }
.glossary-card p { position: relative; z-index: 1; margin: 12px 0 9px; color: var(--muted); font-size: 11px; line-height: 1.75; }
.glossary-card small { position: relative; z-index: 1; display: inline-block; padding: 3px 6px; border-radius: 5px; color: #15211d; background: var(--lime); font-size: 8px; }
.empty-state { grid-column: 1 / -1; padding: 50px; border: 1px dashed var(--line-strong); border-radius: 15px; color: var(--muted); text-align: center; }

/* Search */
.search-dialog { width: min(680px, calc(100% - 28px)); max-height: min(650px, calc(100vh - 40px)); padding: 0; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 20px; color: var(--ink); background: var(--surface-solid); box-shadow: var(--shadow-md); }
.search-dialog::backdrop { background: rgba(5, 12, 9, 0.54); backdrop-filter: blur(7px); }
.search-box { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 8px; min-height: 64px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.search-box > span { font-size: 24px; color: var(--teal); transform: rotate(-12deg); }
.search-box input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 15px; }
.search-box input::placeholder { color: var(--muted); opacity: 0.75; }
.search-close { padding: 5px 7px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: var(--paper); font: 700 8px/1 ui-monospace, monospace; cursor: pointer; }
.search-hint { padding: 25px; color: var(--muted); font-size: 11px; text-align: center; }
.search-results { max-height: 500px; padding: 10px; overflow-y: auto; }
.search-result { display: grid; grid-template-columns: 42px 1fr auto; gap: 11px; align-items: center; padding: 12px; border-radius: 12px; text-decoration: none; }
.search-result:hover, .search-result:focus { background: var(--paper-deep); }
.search-result-index { width: 39px; height: 39px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font: 800 10px/1 ui-monospace, monospace; }
.search-result strong { display: block; font-size: 12px; }
.search-result p { margin: 3px 0 0; color: var(--muted); font-size: 9px; }
.search-result > span:last-child { color: var(--muted); font-size: 11px; }

.toast { position: fixed; z-index: 100; left: 50%; bottom: 26px; padding: 9px 14px; border: 1px solid rgba(255,255,255,0.12); border-radius: 10px; color: #eff8f1; background: #13231f; box-shadow: var(--shadow-md); font-size: 11px; transform: translate(-50%, 25px); opacity: 0; pointer-events: none; transition: 0.25s var(--ease); }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.mobile-dock, .sidebar-scrim { display: none; }
.static-fallback { padding: 80px; }
.noscript { margin: 20px; padding: 20px; border: 1px solid var(--coral); border-radius: 12px; }

@media (max-width: 1150px) {
  :root { --sidebar: 250px; }
  .page-wrap { width: min(100% - 42px, 1040px); }
  .home-hero { grid-template-columns: 1fr 440px; gap: 25px; }
  .hero-copy h1 { font-size: clamp(42px, 5vw, 65px); }
  .route-map { grid-template-columns: repeat(3, 1fr); }
  .route-map::before { display: none; }
  .track-preview-grid, .weekly-grid { grid-template-columns: repeat(2, 1fr); }
  .tier-overview-grid { grid-template-columns: repeat(3, 1fr); }
  .resource-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 920px) {
  :root { --header: 64px; }
  .topbar { padding: 0 17px; }
  .desktop-only { display: none !important; }
  .app-shell { display: block; }
  #main-content { grid-column: auto; }
  .course-sidebar { top: 0; z-index: 80; width: min(320px, 88vw); padding-top: 10px; transform: translateX(-103%); transition: transform 0.25s var(--ease); }
  body.sidebar-open { overflow: hidden; }
  body.sidebar-open .course-sidebar { transform: translateX(0); }
  .sidebar-scrim { position: fixed; inset: 0; z-index: 70; display: block; background: rgba(5,12,9,0.48); opacity: 0; pointer-events: none; transition: opacity 0.25s; }
  body.sidebar-open .sidebar-scrim { opacity: 1; pointer-events: auto; }
  .mobile-dock { position: fixed; z-index: 55; left: 10px; right: 10px; bottom: max(9px, env(safe-area-inset-bottom)); height: 58px; display: grid; grid-template-columns: repeat(4, 1fr); padding: 5px; border: 1px solid var(--line-strong); border-radius: 17px; background: color-mix(in srgb, var(--surface-solid) 92%, transparent); box-shadow: var(--shadow-md); backdrop-filter: blur(18px); }
  .mobile-dock a, .mobile-dock button { display: grid; place-items: center; align-content: center; gap: 2px; border: 0; border-radius: 12px; color: var(--muted); background: transparent; font-size: 9px; text-decoration: none; }
  .mobile-dock span { font-size: 16px; line-height: 1; }
  .mobile-dock a.active { color: var(--teal); background: color-mix(in srgb, var(--teal-bright) 10%, transparent); }
  .page-wrap, .lesson-page, .glossary-page, .wide-page-wrap { width: min(100% - 34px, 780px); }
  .home-hero { display: block; min-height: auto; padding: 57px 0 35px; }
  .hero-copy { max-width: 680px; }
  .hero-map { max-width: 560px; min-height: 480px; margin: 45px auto 0; }
  .concept-grid { grid-template-columns: repeat(2, 1fr); }
  .tier-overview-grid { grid-template-columns: 1fr; }
  .tier-overview-card { min-height: 205px; }
  .lesson-page, .glossary-page { padding-bottom: 120px; }
  .glossary-grid { grid-template-columns: repeat(2, 1fr); }
  .roadmap-page, .resources-page { padding-bottom: 80px; }
  .roadmap-header, .resources-header { display: block; }
  .roadmap-header > p, .resources-header > p { margin-top: 20px; max-width: 650px; }
  .path-tabs { grid-template-columns: repeat(2, 1fr); }
  .resource-stats { margin-top: 20px; }
  .resource-toolbar { grid-template-columns: 1fr 1fr; }
  .resource-toolbar label:first-child { grid-column: 1 / -1; }
  .readiness-panel { grid-template-columns: 1fr 1.3fr; }
  .readiness-panel > a { grid-column: 1 / -1; justify-self: start; }
}

@media (max-width: 640px) {
  body { font-size: 15px; background-size: 22px 22px; }
  .brand-mark { width: 34px; height: 34px; }
  .brand small { display: none; }
  .top-actions { gap: 4px; }
  .quiet-button { width: 38px; padding: 0; }
  .quiet-button kbd { display: none; }
  .page-wrap, .lesson-page, .glossary-page, .wide-page-wrap { width: min(100% - 28px, 600px); }
  .home-hero { padding-top: 40px; }
  .hero-copy h1 { font-size: clamp(39px, 13vw, 58px); letter-spacing: -0.06em; }
  .hero-copy > p { font-size: 14px; line-height: 1.85; }
  .hero-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .hero-actions .primary-button, .hero-actions .outline-button { padding-inline: 10px; }
  .hero-facts { gap: 10px 15px; }
  .hero-map { min-height: 405px; margin-top: 32px; }
  .map-paper { inset: 10px 4px 18px; }
  .map-stage { inset: 60px 14px 54px; }
  .map-node { width: 84px; min-height: 50px; padding: 6px; font-size: 10px; box-shadow: 3px 3px 0 var(--ink); }
  .map-core { left: calc(50% - 35px); top: calc(50% - 35px); width: 70px; height: 70px; font-size: 10px; }
  .map-line { opacity: 0.4; }
  .section-head { display: block; }
  .section-head p { margin-top: 12px; }
  .route-map { grid-template-columns: 1fr; }
  .route-card { min-height: 136px; padding-left: 66px; }
  .route-stop { position: absolute; left: 19px; top: 22px; margin: 0; }
  .route-card footer { left: 66px; }
  .concept-grid, .promise-panel { grid-template-columns: 1fr; }
  .track-preview-grid, .weekly-grid, .resource-grid { grid-template-columns: 1fr; }
  .track-preview { min-height: 205px; }
  .resource-callout { display: block; padding: 26px 23px; }
  .resource-callout-actions { margin-top: 20px; }
  .concept-card { min-height: 158px; }
  .promise-copy { padding: 29px 24px; }
  .promise-list { padding: 24px; border-left: 0; border-top: 1px dashed rgba(255,255,255,0.2); }
  .site-footer { display: block; text-align: center; }
  .site-footer span { display: block; margin-top: 7px; }
  .lesson-header h1 { font-size: clamp(35px, 11vw, 52px); }
  .lesson-subtitle { font-size: 14px; }
  .lesson-complete-top { position: static; margin-top: 18px; }
  .lesson-overview, .mini-grid { grid-template-columns: 1fr; }
  .learning-contract { grid-template-columns: 1fr; margin-top: -25px; }
  .tier-route-group > header { grid-template-columns: auto 1fr; }
  .tier-route-group > header p { grid-column: 1 / -1; }
  .stage-context { grid-template-columns: 1fr; }
  .lesson-content { max-width: 100%; }
  .block-heading { font-size: 23px; }
  .block-heading .heading-number { position: static; display: block; margin-bottom: 4px; }
  .lesson-block > p, .prose p { font-size: 14px; }
  .story-block { grid-template-columns: 38px 1fr; padding: 17px; }
  .story-icon { width: 35px; height: 35px; }
  .compare-table { overflow-x: auto; }
  .compare-row { min-width: 620px; }
  .flow-figure { padding: 16px 13px; }
  .flow-canvas:not(.branch) { justify-content: start; gap: 28px; overflow-x: auto; padding-bottom: 14px; }
  .flow-canvas:not(.branch) .flow-node { flex: 0 0 110px; }
  .flow-canvas.branch { gap: 13px 20px; }
  .flow-canvas.branch .flow-node { font-size: 9px; }
  .code-shell { margin-left: -5px; margin-right: -5px; border-radius: 13px; }
  .code-shell pre { padding: 16px; font-size: 11px; }
  .lesson-pager { grid-template-columns: 1fr; }
  .exercise-card { padding: 20px 17px; }
  .exercise-head { display: grid; }
  .exercise-checklist { grid-template-columns: 1fr; }
  .formula-paper { padding: 18px 13px; }
  .roadmap-header h1, .resources-header h1 { font-size: clamp(43px, 14vw, 64px); }
  .path-tabs { grid-template-columns: 1fr; }
  .selected-path { grid-template-columns: 1fr; }
  .month-plan { grid-template-columns: 1fr; }
  .sequence-stage { grid-template-columns: 45px 1fr; gap: 12px; }
  .sequence-number { width: 43px; height: 43px; border-radius: 12px; }
  .path-sequence::before { left: 21px; }
  .sequence-copy { padding: 18px 15px; }
  .sequence-copy dl { grid-template-columns: 1fr; }
  .readiness-panel { display: block; padding: 24px 20px; }
  .readiness-panel ul { margin: 20px 0; }
  .resource-howto { grid-template-columns: 1fr; }
  .resource-toolbar { position: static; grid-template-columns: 1fr; }
  .resource-toolbar label:first-child { grid-column: auto; }
  .resource-card { min-height: 310px; }
  .glossary-header { display: block; }
  .glossary-header p { margin-top: 15px; }
  .glossary-grid { grid-template-columns: 1fr; }
  .toast { bottom: 80px; }
}

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

@media print {
  .topbar, .course-sidebar, .mobile-dock, .lesson-complete-top, .flow-run, .copy-button { display: none !important; }
  .app-shell { display: block; padding: 0; }
  #main-content { display: block; }
  .lesson-page { width: 100%; padding: 0; }
  body { background: #fff; color: #111; }
  .lesson-block, .code-shell, .flow-figure { break-inside: avoid; }
}
