:root {
  color-scheme: light;
  --ink: #13201e;
  --ink-soft: #46514f;
  --paper: #f3f0e7;
  --paper-deep: #e9e4d8;
  --surface: #fffefa;
  --line: #c9c6bb;
  --line-soft: rgba(19, 32, 30, 0.12);
  --teal: #006d74;
  --teal-bright: #25b6b5;
  --teal-soft: #d9eeee;
  --copper: #b86c38;
  --copper-soft: #f1dfd0;
  --lime: #70a943;
  --red: #b44b41;
  --dark: #071312;
  --dark-2: #0d201e;
  --dark-ink: #f3f0e7;
  --shadow: 8px 8px 0 rgba(19, 32, 30, 0.08);
  --radius: 7px;
  --progress: 0%;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.42;
  background-image:
    linear-gradient(rgba(19, 32, 30, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(19, 32, 30, 0.055) 1px, transparent 1px);
  background-size: 32px 32px;
}

a { color: inherit; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid rgba(8, 126, 134, 0.35);
  outline-offset: 3px;
}
code, pre, .eyebrow, .lesson-number, .hero-meta, .part-band, .board-head, .board-title > div > span,
.framework-detail span, .source-grid span, .concept-grid > article > span, .api-anatomy > article > span,
.auth-grid > article > span, .version-grid > article > span, .style-detail > div > span {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.wrap { width: min(100% - 40px, 1280px); margin-inline: auto; }
.skip-link {
  position: fixed;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 14px;
  color: white;
  background: var(--dark);
  border-radius: 0 0 6px 6px;
  font-weight: 800;
}
.skip-link:focus { top: 0; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 68px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 254, 250, 0.92);
  backdrop-filter: blur(18px);
}
.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: var(--progress);
  height: 3px;
  background: var(--teal);
}
.header-inner {
  min-height: 68px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(240px, 0.65fr) minmax(300px, 1fr);
  align-items: center;
  gap: 22px;
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; min-width: 0; }
.brand img { width: 38px; height: 38px; border-radius: 6px; }
.brand span, .brand strong, .brand small { display: block; min-width: 0; }
.brand strong { font-size: 0.93rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand small { color: var(--ink-soft); font: 0.64rem/1.4 ui-monospace, monospace; letter-spacing: 0.03em; text-transform: uppercase; }
.lesson-status { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 12px; min-width: 0; }
.lesson-status span { font-size: 0.76rem; font-weight: 850; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lesson-status progress { width: 100%; height: 4px; border: 0; appearance: none; }
.lesson-status progress::-webkit-progress-bar { background: var(--paper-deep); }
.lesson-status progress::-webkit-progress-value { background: var(--teal); }
.lesson-status progress::-moz-progress-bar { background: var(--teal); }
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.header-actions a, .icon-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 850;
}
.icon-button { min-width: 40px; }
.header-actions a:hover, .icon-button:hover { border-color: var(--teal); color: var(--teal); }

.hero { min-height: calc(100vh - 68px); display: grid; align-items: center; border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(34px, 6vw, 86px); align-items: center; padding-block: 86px; }
.eyebrow { display: inline-block; color: var(--teal); font-size: 0.69rem; font-weight: 900; letter-spacing: 0.075em; }
.hero h1, .section-heading h2, .lesson-intro h2, .protocol-heading h2, .closing h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  letter-spacing: -0.045em;
}
.hero h1 { max-width: 760px; margin: 18px 0 22px; font-size: clamp(3.8rem, 6.4vw, 6.8rem); line-height: 1; }
.hero h1 > span, .hero h1 > i { display: block; }
.hero h1 i { margin-top: 0.04em; color: var(--teal); font-weight: 400; }
.hero-thesis { margin: 0; font-size: clamp(1.25rem, 2vw, 1.65rem); font-weight: 900; }
.hero-lede { max-width: 660px; margin: 18px 0 0; color: var(--ink-soft); font-size: 1.06rem; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 26px; font-size: 0.68rem; font-weight: 900; }
.publication-note { max-width: 690px; margin: 21px 0 0; padding: 13px 15px; border-left: 3px solid var(--teal); background: rgba(255, 254, 250, 0.72); font: 0.75rem/1.65 ui-monospace, monospace; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 27px; }
.command {
  min-height: 45px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 15px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  font-weight: 900;
  font-size: 0.82rem;
}
.command:hover { transform: translateY(-2px); box-shadow: 4px 4px 0 rgba(19, 32, 30, 0.08); }
.command.primary { border-color: var(--dark); background: var(--dark); color: white; }
.command:disabled { opacity: 0.58; cursor: wait; transform: none; }

.hero-board, .board, .chooser-board, .request-lab, .framework-lab, .style-lab, .connection-board,
.reliability-board, .build-board, .release-board, .code-board {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 254, 250, 0.94);
  box-shadow: var(--shadow);
}
.hero-board { padding: clamp(22px, 4vw, 42px); }
.board-head, .board-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.board-title > div { min-width: 0; }
.board-head { padding-bottom: 18px; border-bottom: 1px solid var(--line); color: var(--teal); font: 0.65rem/1.4 ui-monospace, monospace; }
.board-head b { color: #416f27; }
.system-map {
  display: grid;
  grid-template-columns: minmax(92px, 1fr) 30px minmax(96px, 1.06fr) 30px minmax(88px, 0.9fr) 30px minmax(100px, 1.08fr);
  gap: 6px;
  align-items: stretch;
  margin: 32px 0 20px;
}
.system-node { min-height: 138px; display: grid; align-content: center; padding: 14px 12px; border: 1px solid var(--ink-soft); border-radius: 5px; background: white; font-size: 0.86rem; font-weight: 900; line-height: 1.28; }
.system-node small { display: block; margin-top: 8px; color: var(--ink-soft); font: 0.62rem/1.5 ui-monospace, monospace; }
.system-node.framework { border-color: var(--teal); background: var(--teal-soft); }
.system-node.api { border-color: var(--copper); background: var(--copper-soft); }
.system-link { position: relative; display: grid; place-items: center; min-height: 42px; }
.system-link i { width: 100%; height: 2px; background: var(--teal); }
.system-link i::after { content: ""; position: absolute; right: -1px; top: calc(50% - 6px); border: 6px solid transparent; border-left-color: var(--teal); }
.system-link em { position: absolute; top: calc(50% - 25px); padding: 1px 4px; background: var(--surface); color: var(--teal); font: normal 0.49rem ui-monospace, monospace; white-space: nowrap; }
.map-caption { margin: 0 0 23px; padding: 12px 14px; border-left: 3px solid var(--teal); background: var(--teal-soft); color: var(--ink-soft); font-size: 0.76rem; line-height: 1.55; }
.hero-result { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.hero-result > div { padding: 18px 12px 0; }
.hero-result > div + div { border-left: 1px solid var(--line); padding-left: 22px; }
.hero-result span, .hero-result strong, .hero-result small { display: block; }
.hero-result span { color: var(--ink-soft); font: 0.65rem ui-monospace, monospace; }
.hero-result strong { margin-top: 7px; font-size: 0.9rem; }
.hero-result small { margin-top: 7px; color: var(--ink-soft); font-size: 0.69rem; line-height: 1.5; }

.contents { padding: 100px 0; background: rgba(255, 254, 250, 0.58); border-bottom: 1px solid var(--line); }
.section-heading { display: grid; grid-template-columns: 1fr minmax(280px, 0.55fr); gap: 60px; align-items: end; margin-bottom: 42px; }
.section-heading h2 { margin: 9px 0 0; font-size: clamp(2.8rem, 6vw, 5.4rem); line-height: 0.95; }
.section-heading > p { margin: 0; color: var(--ink-soft); }
.contents-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.contents-grid a { min-height: 124px; display: grid; grid-template-columns: 44px 1fr; gap: 12px; padding: 20px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-decoration: none; background: rgba(255, 254, 250, 0.5); }
.contents-grid a:hover { background: var(--teal-soft); }
.contents-grid > a > span { color: var(--teal); font: 800 0.72rem ui-monospace, monospace; }
.contents-grid strong, .contents-grid small { display: block; }
.contents-grid small { margin-top: 7px; color: var(--ink-soft); line-height: 1.45; }
.part-band { border-bottom: 1px solid #20302e; background: var(--dark); color: var(--dark-ink); }
.part-band .wrap { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.part-band strong { font-size: 0.77rem; }
.part-band span { color: var(--teal-bright); font-size: 0.63rem; letter-spacing: 0.08em; }

.lesson { padding: 110px 0; border-bottom: 1px solid var(--line); }
.lesson-layout { display: grid; grid-template-columns: minmax(260px, 0.48fr) minmax(0, 1fr); gap: clamp(50px, 7vw, 100px); align-items: start; }
.lesson-intro { min-width: 0; position: sticky; top: 100px; display: grid; gap: 36px; }
.lesson-intro > div { width: 100%; min-width: 0; max-width: 100%; }
.lesson-number { color: var(--teal); font-size: 0.7rem; font-weight: 900; }
.lesson-intro h2 { max-width: 100%; margin: 12px 0 0; font-size: clamp(2.8rem, 4.5vw, 4.8rem); line-height: 0.96; overflow-wrap: break-word; hyphens: auto; }
.lesson-definition, .lesson-rule { margin: 0; color: var(--ink-soft); }
.lesson-definition strong { color: var(--ink); }
.lesson-rule { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); font-weight: 850; color: var(--ink); }
.lesson-content { min-width: 0; display: grid; gap: 24px; }
.board, .chooser-board, .request-lab, .framework-lab, .style-lab, .connection-board,
.reliability-board, .build-board, .release-board { padding: clamp(20px, 3.4vw, 36px); }
.board-title { margin-bottom: 26px; }
.board-title > div > span { color: var(--teal); font-size: 0.64rem; font-weight: 900; }
.board-title h3 { margin: 6px 0 0; font-size: clamp(1.2rem, 2vw, 1.65rem); }
.board-description { margin: -10px 0 22px; color: var(--ink-soft); font-size: 0.82rem; }
.segment { max-width: 100%; flex: 0 0 auto; display: inline-flex; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; background: var(--paper); }
.segment button { min-width: max-content; min-height: 38px; flex: 0 0 auto; padding: 8px 14px; border: 0; background: transparent; color: var(--ink-soft); font-size: 0.72rem; font-weight: 850; white-space: nowrap; }
.segment button + button { border-left: 1px solid var(--line); }
.segment button[aria-pressed="true"] { background: var(--dark); color: white; }
.status-line { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 24px; padding-top: 17px; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 0.82rem; }
.status-line strong { color: var(--teal); font: 900 0.68rem ui-monospace, monospace; white-space: nowrap; }
.control-stage { display: grid; grid-template-columns: 1fr 46px 1fr; align-items: center; }
.control-card { min-height: 122px; display: grid; align-content: center; padding: 20px; border: 1px solid var(--line); background: var(--paper); border-radius: 5px; }
.control-card span, .control-card strong { display: block; }
.control-card span { color: var(--ink-soft); font: 0.65rem ui-monospace, monospace; }
.control-card strong { margin-top: 8px; }
.control-card.engine { border-color: var(--teal); background: var(--teal-soft); }
.control-stage[data-mode="library"] .control-arrow { transform: rotate(180deg); }
.control-arrow { text-align: center; color: var(--teal); font-weight: 900; transition: transform 180ms ease; }
.concept-grid, .api-anatomy, .auth-grid, .failure-grid, .version-grid, .criteria-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.concept-grid article, .api-anatomy article, .auth-grid article, .failure-grid article, .version-grid article, .criteria-grid article {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(255, 254, 250, 0.72);
}
.concept-grid span, .api-anatomy span, .auth-grid span, .version-grid span { color: var(--teal); font-size: 0.62rem; font-weight: 900; }
.concept-grid h3, .api-anatomy h3, .auth-grid h3, .failure-grid h3, .version-grid h3, .criteria-grid h3 { margin: 8px 0; font-size: 1rem; }
.concept-grid p, .api-anatomy p, .auth-grid p, .failure-grid p, .version-grid p, .criteria-grid p { margin: 0; color: var(--ink-soft); font-size: 0.87rem; }
.concept-grid small { display: block; margin-top: 12px; color: var(--copper); font-size: 0.72rem; }

.tone-dark { color: var(--dark-ink); background: var(--dark); border-color: #243431; }
.tone-dark .lesson-number, .tone-dark .board-title > div > span { color: var(--teal-bright); }
.tone-dark .lesson-definition, .tone-dark .lesson-rule { color: #bbc7c4; border-color: #31413e; }
.tone-dark .lesson-definition strong, .tone-dark .lesson-rule { color: white; }
.tone-dark .framework-lab, .tone-dark .style-lab, .tone-dark .build-board, .tone-dark .code-board { border-color: #31413e; background: var(--dark-2); box-shadow: 8px 8px 0 rgba(0,0,0,0.28); }

.live-pill { align-self: center; padding: 6px 9px; border: 1px solid rgba(37,182,181,0.5); border-radius: 99px; color: var(--teal-bright); font: 800 0.58rem ui-monospace, monospace; }
.framework-picker { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.framework-chip { min-height: 76px; display: grid; align-content: center; text-align: left; padding: 12px; border: 1px solid #31413e; border-radius: 5px; background: #102321; color: #dfe9e6; }
.framework-chip small { margin-top: 4px; color: #91a39f; font-size: 0.68rem; }
.framework-chip:hover, .framework-chip.is-active { border-color: var(--teal-bright); background: #15312e; }
.framework-chip.is-active b { color: var(--teal-bright); }
.framework-detail { display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 0; margin-top: 14px; border: 1px solid #31413e; border-radius: 5px; overflow: hidden; }
.framework-detail > div { padding: 20px; }
.framework-detail > div + div { border-left: 1px solid #31413e; }
.framework-detail span { color: var(--teal-bright); font-size: 0.6rem; font-weight: 900; }
.framework-detail h3 { margin: 8px 0 0; font-size: 1.5rem; }
.framework-detail p { margin: 9px 0 0; color: #bbc7c4; font-size: 0.82rem; }
.framework-detail > a { grid-column: 1 / -1; padding: 12px 20px; border-top: 1px solid #31413e; color: var(--teal-bright); text-decoration: none; font-size: 0.78rem; font-weight: 850; }
.decision-note { display: flex; gap: 14px; padding: 18px 20px; border: 1px solid #31413e; background: #0d201e; }
.decision-note strong { color: var(--copper); }
.decision-note p { margin: 0; color: #bbc7c4; }

.chooser-fields, .endpoint-builder { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.chooser-fields label, .endpoint-builder label { display: grid; gap: 7px; }
.chooser-fields label > span, .endpoint-builder label > span { color: var(--ink-soft); font-size: 0.68rem; font-weight: 850; }
.chooser-fields select, .endpoint-builder select, .endpoint-builder input { width: 100%; min-height: 46px; border: 1px solid var(--line); border-radius: 5px; padding: 9px 11px; background: white; color: var(--ink); }
.recommendation { margin-top: 18px; padding: 22px; border: 1px solid var(--teal); background: var(--teal-soft); border-radius: 5px; }
.recommendation > div:first-child { display: flex; justify-content: space-between; gap: 18px; align-items: baseline; }
.recommendation span { color: var(--teal); font: 900 0.62rem ui-monospace, monospace; }
.recommendation h3 { margin: 0; font-size: 1.35rem; }
.recommendation p { margin: 14px 0; color: var(--ink-soft); }
.recommendation-stack { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.recommendation-stack span { padding: 7px 10px; border: 1px solid rgba(8,126,134,0.35); border-radius: 4px; background: white; color: var(--ink); }
.recommendation-stack i { color: var(--teal); }
.criteria-grid article { position: relative; padding-left: 52px; }
.criteria-grid b { position: absolute; left: 18px; top: 20px; color: var(--teal); font: 900 0.68rem ui-monospace, monospace; }

.request-flow { display: grid; grid-template-columns: 1fr 96px 1fr; align-items: center; margin-top: 22px; }
.http-card { min-height: 156px; padding: 18px; border: 1px solid var(--line); border-radius: 5px; background: var(--dark); color: white; }
.http-card.response { background: #11302c; }
.http-card span, .http-card code, .http-card small { display: block; }
.http-card span { color: var(--teal-bright); font: 800 0.62rem ui-monospace, monospace; }
.http-card code { margin: 20px 0; color: white; font-size: 0.9rem; overflow-wrap: anywhere; }
.http-card small { color: #a8bbb6; font: 0.67rem/1.55 ui-monospace, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.http-wire { display: grid; place-items: center; gap: 7px; }
.http-wire i { width: 100%; height: 2px; background: var(--teal); }
.http-wire b { color: var(--teal); font: 800 0.56rem ui-monospace, monospace; }
.api-anatomy code { padding: 1px 4px; background: var(--paper-deep); }

.style-tabs { width: 100%; min-width: 0; max-width: 100%; display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; }
.style-tabs button { min-height: 40px; padding: 8px 12px; border: 1px solid #31413e; border-radius: 4px; background: #102321; color: #aabbb7; font-weight: 850; white-space: nowrap; }
.style-tabs button.is-active { border-color: var(--teal-bright); color: var(--teal-bright); }
.style-detail { min-width: 0; max-width: 100%; display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 28px; margin-top: 14px; padding: 24px; border: 1px solid #31413e; border-radius: 5px; background: #102321; }
.style-detail h3 { margin: 8px 0; font-size: 2.3rem; }
.style-detail p { color: #bbc7c4; }
.style-facts { min-width: 0; display: grid; gap: 11px; }
.style-facts > div { min-width: 0; display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 12px; }
.style-facts strong { color: var(--teal-bright); font-size: 0.73rem; font-weight: 900; }
.style-facts p { margin: 0; font-size: 0.82rem; }
.comparison-table { width: 100%; min-width: 0; max-width: 100%; border: 1px solid #31413e; overflow-x: auto; }
.comparison-table table { width: 100%; border-collapse: collapse; min-width: 680px; }
.comparison-table th, .comparison-table td { padding: 13px 15px; border-bottom: 1px solid #31413e; text-align: left; font-size: 0.8rem; }
.comparison-table th { color: var(--teal-bright); font: 900 0.63rem ui-monospace, monospace; }
.comparison-table td { color: #bbc7c4; }
.comparison-table td:nth-child(2) { color: white; font-weight: 850; }

.architecture { display: grid; grid-template-columns: 1fr 28px 1fr 28px 1fr 28px 1fr; gap: 6px; align-items: center; }
.arch-node { min-height: 112px; display: grid; align-content: center; padding: 15px; border: 1px solid var(--line); border-radius: 5px; background: var(--paper); }
.arch-node span { color: var(--teal); font: 800 0.62rem ui-monospace, monospace; }
.arch-node strong, .arch-node small { display: block; }
.arch-node strong { margin-top: 8px; font-size: 0.88rem; }
.arch-node small { margin-top: 4px; color: var(--ink-soft); font-size: 0.66rem; }
.architecture > i { text-align: center; color: var(--teal); font-style: normal; font-weight: 900; }
.architecture[data-mode="scaled"] .arch-node { border-color: var(--teal); background: var(--teal-soft); }
.boundary-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; }
.boundary-row span { padding: 6px 9px; border: 1px solid var(--line); border-radius: 99px; color: var(--ink-soft); font: 800 0.64rem ui-monospace, monospace; }

.reliability-controls, .release-checks { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.reliability-controls label, .release-checks label { display: flex; gap: 11px; align-items: flex-start; padding: 14px; border: 1px solid var(--line); border-radius: 5px; background: var(--paper); cursor: pointer; }
.reliability-controls input, .release-checks input { width: 18px; height: 18px; accent-color: var(--teal); }
.reliability-controls span, .release-checks span, .reliability-controls b, .release-checks b, .reliability-controls small, .release-checks small { display: block; }
.reliability-controls b, .release-checks b { font-size: 0.82rem; }
.reliability-controls small, .release-checks small { margin-top: 3px; color: var(--ink-soft); font-size: 0.7rem; }
.reliability-meter { height: 8px; margin-top: 20px; background: var(--paper-deep); overflow: hidden; border-radius: 99px; }
.reliability-meter i { display: block; width: 33.333%; height: 100%; background: var(--copper); transition: width 220ms ease, background 220ms ease; }
.failure-grid b { color: var(--copper); font: 900 1.15rem ui-monospace, monospace; }

.build-flow { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 0; margin: 0; list-style: none; }
.build-flow li { display: grid; grid-template-columns: 36px 1fr; gap: 8px; align-items: center; min-height: 76px; padding: 12px; border: 1px solid #31413e; background: #102321; transition: border-color 160ms ease, background 160ms ease; }
.build-flow li.is-on { border-color: var(--teal-bright); background: #15312e; }
.build-flow li > span { color: var(--teal-bright); font: 900 0.68rem ui-monospace, monospace; }
.build-flow strong, .build-flow small { display: block; }
.build-flow small { color: #98aaa6; font-size: 0.69rem; }
.tone-dark .status-line { border-color: #31413e; color: #bbc7c4; }
.tone-dark .status-line strong { color: var(--teal-bright); }
.code-board { overflow: hidden; }
.code-head { min-height: 48px; display: flex; align-items: center; justify-content: space-between; padding: 8px 16px; border-bottom: 1px solid #31413e; color: #a9bab6; font: 0.7rem ui-monospace, monospace; }
.code-head button { border: 1px solid #31413e; border-radius: 4px; padding: 5px 9px; background: #102321; color: var(--teal-bright); }
.code-board pre { margin: 0; padding: 22px; overflow: auto; color: #d7e5e1; font-size: 0.77rem; line-height: 1.65; }

.release-result { display: grid; grid-template-columns: 150px 1fr; gap: 16px; align-items: center; margin-top: 18px; padding: 18px; border: 1px solid var(--line); background: var(--paper); }
.release-result span { color: var(--red); font: 900 0.72rem ui-monospace, monospace; }
.release-result p { margin: 0; color: var(--ink-soft); }
.release-result.is-ready { border-color: var(--lime); background: #e5f1df; }
.release-result.is-ready span { color: #39751d; }

#protocol { background: var(--copper-soft); }
.protocol-heading { display: grid; grid-template-columns: 0.3fr 1fr 0.55fr; gap: 30px; align-items: end; margin-bottom: 44px; }
.protocol-heading h2 { margin: 0; font-size: clamp(3rem, 6vw, 6rem); line-height: 0.9; }
.protocol-heading p { margin: 0; color: var(--ink-soft); }
.protocol-grid { display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid rgba(19,32,30,0.22); border-left: 1px solid rgba(19,32,30,0.22); }
.protocol-grid article { min-height: 150px; display: grid; grid-template-columns: 48px 1fr; gap: 14px; padding: 22px; border-right: 1px solid rgba(19,32,30,0.22); border-bottom: 1px solid rgba(19,32,30,0.22); }
.protocol-grid article > span { color: var(--copper); font: 900 0.72rem ui-monospace, monospace; }
.protocol-grid h3 { margin: 0; font-size: 1rem; }
.protocol-grid p { margin: 8px 0 0; color: var(--ink-soft); font-size: 0.84rem; }

.glossary, .sources { padding: 110px 0; border-bottom: 1px solid var(--line); }
.glossary { background: rgba(255, 254, 250, 0.72); }
.glossary-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.glossary-grid article { min-height: 116px; padding: 17px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.glossary-grid b { color: var(--teal); }
.glossary-grid p { margin: 8px 0 0; color: var(--ink-soft); font-size: 0.78rem; }
.sources { color: var(--dark-ink); background: var(--dark); }
.sources .section-heading > p { color: #adbbb7; }
.source-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.source-grid a { min-height: 184px; padding: 20px; border: 1px solid #31413e; border-radius: 5px; background: #0d201e; text-decoration: none; }
.source-grid a:hover { border-color: var(--teal-bright); transform: translateY(-2px); }
.source-grid span { color: var(--teal-bright); font-size: 0.6rem; font-weight: 900; }
.source-grid h3 { margin: 12px 0 8px; font-size: 1rem; }
.source-grid p { margin: 0; color: #a9bab6; font-size: 0.8rem; }
.source-note { margin: 24px 0 0; padding: 18px; border: 1px solid #31413e; color: #a9bab6; }
.source-note strong { color: var(--copper); }

.closing { padding: 90px 0; background: white; }
.closing-grid { display: grid; grid-template-columns: 1fr 0.55fr; gap: 70px; align-items: end; }
.closing h2 { margin: 10px 0 0; max-width: 860px; font-size: clamp(3rem, 6vw, 6rem); line-height: 0.9; }
.closing p { margin: 0; color: var(--ink-soft); }
.site-footer { color: var(--dark-ink); background: var(--dark); }
.footer-inner { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 20px; color: #a9bab6; font: 0.64rem ui-monospace, monospace; }

.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 520ms ease, transform 520ms ease; }
.js .reveal.is-seen { opacity: 1; transform: none; }

@media (max-width: 1180px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero { min-height: auto; }
  .hero-copy { max-width: 900px; }
}

@media (max-width: 1050px) {
  .header-inner { grid-template-columns: 1fr auto; }
  .lesson-status { display: none; }
  .lesson-layout { grid-template-columns: 1fr; }
  .lesson-intro { position: static; grid-template-columns: 1fr 1fr; }
  .framework-picker { grid-template-columns: repeat(2, 1fr); }
  .framework-detail { grid-template-columns: 1fr; }
  .framework-detail > div + div { border-left: 0; border-top: 1px solid #31413e; }
  .contents-grid, .glossary-grid, .source-grid { grid-template-columns: repeat(2, 1fr); }
  .protocol-heading { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .wrap { width: min(100% - 24px, 1280px); }
  .site-header { position: relative; }
  .header-inner { min-height: 62px; grid-template-columns: 1fr auto; gap: 8px; }
  .brand small { display: none; }
  .header-actions a:first-child { display: none; }
  .header-actions a, .icon-button { min-height: 36px; padding: 6px 9px; font-size: 0.7rem; }
  .hero-grid { padding-block: 58px; gap: 42px; }
  .hero h1 { font-size: clamp(3.5rem, 18vw, 5.4rem); }
  .system-map { grid-template-columns: 1fr; }
  .system-link { height: 50px; }
  .system-link i { width: 2px; height: 100%; }
  .system-link i::after { right: auto; left: 50%; top: auto; bottom: -4px; transform: translateX(-50%) rotate(90deg); }
  .system-link em { top: 14px; }
  .hero-result, .section-heading, .closing-grid { grid-template-columns: 1fr; }
  .hero-result > div + div { border-left: 0; border-top: 1px solid var(--line); margin-top: 14px; padding-top: 18px; padding-left: 12px; }
  .contents, .lesson, .glossary, .sources { padding: 72px 0; }
  .contents-grid, .glossary-grid, .source-grid, .concept-grid, .api-anatomy, .auth-grid, .failure-grid,
  .version-grid, .criteria-grid, .protocol-grid, .build-flow, .reliability-controls, .release-checks { grid-template-columns: 1fr; }
  .contents-grid a { min-height: 108px; }
  .lesson-layout, .lesson-intro, .lesson-content { min-width: 0; max-width: 100%; grid-template-columns: minmax(0, 1fr); }
  .lesson-content > *, .style-lab, .style-detail > *, .style-facts > div > * { min-width: 0; max-width: 100%; }
  .lesson-intro { gap: 20px; }
  .lesson-intro h2 { font-size: clamp(2.45rem, 11vw, 4rem); overflow-wrap: break-word; }
  .board-title { display: grid; }
  .board-title .segment, .board-title .command { justify-self: start; }
  .segment { max-width: 100%; overflow-x: auto; }
  .control-stage, .request-flow { grid-template-columns: 1fr; gap: 12px; }
  .control-arrow { transform: rotate(90deg); }
  .control-stage[data-mode="library"] .control-arrow { transform: rotate(-90deg); }
  .chooser-fields, .endpoint-builder { grid-template-columns: 1fr; }
  .recommendation > div:first-child { display: block; }
  .recommendation h3 { margin-top: 7px; }
  .http-wire { min-height: 52px; }
  .http-wire i { width: 2px; height: 52px; }
  .style-detail { grid-template-columns: minmax(0, 1fr); padding: 18px; }
  .style-facts > div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .style-detail p, .style-facts p { overflow-wrap: anywhere; }
  .architecture { grid-template-columns: 1fr; }
  .architecture > i { transform: rotate(90deg); }
  .release-result { grid-template-columns: 1fr; }
  .protocol-grid { border-left: 1px solid rgba(19,32,30,0.22); }
  .footer-inner, .part-band .wrap { align-items: flex-start; flex-direction: column; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}

@media print {
  .site-header, .hero-actions, button, .part-band { display: none !important; }
  body, .tone-dark, .sources { color: #111; background: white; }
  body::before { display: none; }
  .hero, .lesson, .contents, .glossary, .sources { min-height: 0; padding: 32px 0; break-inside: avoid; }
  .hero-grid, .lesson-layout { grid-template-columns: 1fr; }
  .lesson-intro { position: static; }
  .hero-board, .board, .chooser-board, .request-lab, .framework-lab, .style-lab, .connection-board,
  .reliability-board, .build-board, .release-board, .code-board, .source-grid a { box-shadow: none; color: #111; background: white; border-color: #777; }
  .framework-detail p, .style-detail p, .decision-note p, .tone-dark .lesson-definition, .tone-dark .lesson-rule, .source-grid p, .sources .section-heading > p { color: #333; }
  .js .reveal { opacity: 1; transform: none; }
}
