:root {
  --ink: #171612;
  --muted: #565149;
  --paper: #f2efe6;
  --panel: #fbfaf5;
  --line: rgba(23, 22, 18, 0.32);
  --line-strong: #171612;
  --accent: #ef4b2c;
  --accent-dark: #a82d19;
  --cyan: #246c82;
  --amber: #d18a20;
  --mono: Consolas, "Cascadia Mono", "Courier New", monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Malgun Gothic", "맑은 고딕", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.72;
}

a {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(18px, 4vw, 48px);
  color: #fffdf7;
  background: rgba(12, 13, 12, 0.96);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.topbar a {
  font-weight: 800;
  text-decoration: none;
}

.hero {
  color: #fffdf7;
  background: #111210;
  border-bottom: 5px solid var(--accent);
}

.hero-inner,
.page-grid,
.index-layout,
footer {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.hero-inner {
  padding: 54px 0 42px;
}

.eyebrow,
.section-label {
  margin: 0 0 10px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 940px;
  margin: 0;
  font-family: "Arial Black", "Malgun Gothic", sans-serif;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.14;
}

.lead {
  max-width: 930px;
  margin: 18px 0 0;
  color: rgba(255, 253, 247, 0.82);
  font-size: 17px;
}

.analysis-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 1040px;
  margin: 30px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.24);
  border-bottom: 1px solid rgba(255, 255, 255, 0.24);
}

.analysis-strip div {
  min-width: 0;
  padding: 12px 16px;
  border-right: 1px solid rgba(255, 255, 255, 0.16);
}

.analysis-strip div:first-child {
  padding-left: 0;
}

.analysis-strip div:last-child {
  border-right: 0;
}

.analysis-strip dt {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
}

.analysis-strip dd {
  margin: 3px 0 0;
  color: rgba(255, 253, 247, 0.88);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.page-grid,
.index-layout {
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
  gap: 34px;
  padding: 38px 0 86px;
}

.page-grid > article,
.index-layout > article,
.toc {
  min-width: 0;
}

.toc {
  position: sticky;
  top: 72px;
  align-self: start;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.toc strong {
  display: block;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--ink);
  font-size: 14px;
}

.toc a {
  display: block;
  padding: 6px 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.toc a:hover,
.toc a:focus-visible {
  color: var(--accent-dark);
}

article > section {
  scroll-margin-top: 84px;
  margin-bottom: 52px;
}

h2 {
  margin: 0 0 18px;
  font-family: "Arial Black", "Malgun Gothic", sans-serif;
  font-size: 29px;
  line-height: 1.25;
}

h3 {
  margin: 0 0 9px;
  font-size: 18px;
  line-height: 1.35;
}

p {
  margin: 0 0 15px;
  color: var(--muted);
}

.opening-note {
  padding: 20px 22px 5px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 6px solid var(--accent);
}

.system-figure {
  margin: 18px 0 24px;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--line-strong);
}

.system-figure figcaption {
  margin-bottom: 18px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.system-figure > p {
  margin: 16px 0 0;
  font-size: 13px;
}

.system-structure-figure {
  margin: 18px 0 24px;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--line-strong);
}

.system-structure-figure figcaption {
  margin-bottom: 18px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.system-structure-figure > p {
  margin: 16px 0 0;
  font-size: 13px;
}

.structure-canvas {
  min-width: 0;
  padding: 24px;
  overflow: hidden;
  background-color: #f8f7f2;
  background-image:
    linear-gradient(rgba(23, 22, 18, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 22, 18, 0.045) 1px, transparent 1px);
  background-size: 24px 24px;
  border: 1px solid rgba(23, 22, 18, 0.22);
}

.structure-canvas strong,
.structure-canvas h3,
.structure-canvas span,
.structure-canvas li {
  overflow-wrap: anywhere;
}

.structure-canvas ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.structure-canvas li {
  padding: 7px 8px;
  border-top: 1px solid rgba(23, 22, 18, 0.16);
  font-size: 11px;
  line-height: 1.4;
}

.structure-layers {
  max-width: 760px;
  margin: 0 auto;
  border: 2px solid var(--ink);
}

.structure-layer {
  display: grid;
  grid-template-columns: minmax(130px, 0.35fr) minmax(0, 1fr);
  min-height: 62px;
  border-bottom: 1px solid var(--ink);
}

.structure-layer:last-child {
  border-bottom: 0;
}

.structure-layer strong,
.structure-layer span {
  display: flex;
  align-items: center;
  padding: 11px 14px;
}

.structure-layer strong {
  color: #fff;
  background: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
}

.structure-layer span {
  color: var(--ink);
  background: #fff;
  font-size: 12px;
}

.structure-layer[data-tone="libc"] strong,
.structure-layer[data-tone="loader"] strong {
  background: var(--cyan);
}

.structure-layer[data-tone="entry"] strong {
  background: var(--amber);
}

.structure-layer[data-tone="kernel"] strong {
  background: var(--accent-dark);
}

.structure-layer[data-tone="result"] strong {
  color: var(--ink);
  background: #d9e5b4;
}

.exec-path-visual {
  max-width: 820px;
  margin: 0 auto;
}

.exec-command {
  padding: 10px 14px;
  color: #fff;
  background: var(--ink);
  border: 2px solid var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 800;
}

.exec-shell,
.exec-finish {
  display: grid;
  grid-template-columns: minmax(140px, 0.35fr) minmax(0, 1fr);
  background: #fff;
  border: 2px solid var(--ink);
}

.exec-shell strong,
.exec-shell span,
.exec-finish strong,
.exec-finish span {
  display: flex;
  align-items: center;
  padding: 11px 13px;
}

.exec-shell strong,
.exec-finish strong {
  color: #fff;
  background: var(--cyan);
  font-family: var(--mono);
  font-size: 12px;
}

.exec-shell span,
.exec-finish span {
  font-size: 11px;
}

.exec-split-label {
  position: relative;
  height: 60px;
}

.exec-split-label::before {
  position: absolute;
  top: 0;
  bottom: 28px;
  left: 50%;
  width: 2px;
  background: var(--ink);
  content: "";
}

.exec-split-label::after {
  position: absolute;
  right: 25%;
  bottom: 28px;
  left: 25%;
  height: 2px;
  background: var(--ink);
  content: "";
}

.exec-split-label span {
  position: absolute;
  z-index: 1;
  right: 50%;
  bottom: 10px;
  padding: 2px 7px;
  color: var(--accent-dark);
  background: #f8f7f2;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 900;
  transform: translateX(50%);
}

.exec-lanes {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 48px;
}

.exec-lane {
  position: relative;
  min-width: 0;
  background: #fff;
  border: 2px solid var(--ink);
}

.exec-lane::before {
  position: absolute;
  bottom: 100%;
  left: 50%;
  width: 2px;
  height: 30px;
  background: var(--ink);
  content: "";
}

.exec-lane > p {
  margin: 0;
  padding: 5px 10px;
  color: var(--accent-dark);
  background: #ebe8de;
  border-bottom: 1px solid var(--ink);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 900;
}

.exec-lane > h3 {
  margin: 0;
  padding: 10px;
  background: #dce9ef;
  border-bottom: 2px solid var(--ink);
  font-family: var(--mono);
  font-size: 12px;
}

.child-lane > h3 {
  background: #f3d9a4;
}

.exec-wait {
  display: block;
  margin: 18px 12px 12px;
  padding: 10px;
  color: #fff;
  background: var(--cyan);
  border-left: 8px solid var(--ink);
  font-family: var(--mono);
  font-size: 11px;
}

.exec-boundary {
  margin: 14px 12px 12px;
  background: #fff;
  border: 2px solid var(--ink);
}

.exec-boundary > strong {
  display: block;
  padding: 8px 9px;
  color: #fff;
  background: var(--accent-dark);
  font-family: var(--mono);
  font-size: 11px;
}

.runtime-boundary > strong {
  background: #6f842e;
}

.exec-finish {
  position: relative;
  margin-top: 44px;
}

.exec-finish::before {
  position: absolute;
  bottom: 100%;
  left: 50%;
  width: 2px;
  height: 46px;
  background: var(--ink);
  content: "";
}

.exec-finish strong {
  background: var(--accent-dark);
}

.structure-timeline {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 0;
  padding: 6px 0 0;
}

.structure-timeline::before {
  position: absolute;
  top: 47px;
  right: 4%;
  left: 4%;
  height: 2px;
  background: var(--ink);
  content: "";
}

.timeline-event {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: 25px 28px auto auto;
  justify-items: center;
  min-width: 0;
  padding: 0 7px;
  text-align: center;
}

.timeline-time {
  color: var(--accent-dark);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 900;
}

.timeline-event i {
  display: block;
  width: 14px;
  height: 14px;
  margin-top: 10px;
  background: #fff;
  border: 3px solid var(--ink);
}

.timeline-event[data-tone="warn"] i {
  background: var(--accent);
  border-color: var(--accent-dark);
}

.timeline-event strong {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.3;
}

.timeline-event > span:last-child {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.memory-visual {
  display: grid;
  grid-template-columns: 116px minmax(220px, 540px) 54px;
  justify-content: center;
  gap: 16px;
  min-height: 460px;
}

.memory-direction,
.memory-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.memory-direction span:last-child {
  text-align: right;
}

.memory-axis {
  position: relative;
  align-items: center;
  justify-content: center;
  border-left: 2px solid var(--ink);
}

.memory-axis::before,
.memory-axis::after {
  position: absolute;
  left: -6px;
  width: 10px;
  height: 10px;
  border-left: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  content: "";
}

.memory-axis::before {
  top: 0;
  transform: rotate(135deg);
}

.memory-axis::after {
  bottom: 0;
  transform: rotate(-45deg);
}

.memory-axis span {
  padding: 5px;
  background: #f8f7f2;
  writing-mode: vertical-rl;
}

.memory-stage {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 2px solid var(--ink);
}

.memory-block {
  display: grid;
  flex: var(--block-size) 1 0;
  grid-template-columns: minmax(125px, 0.42fr) minmax(0, 1fr);
  min-height: 54px;
  background: #fff;
  border-bottom: 1px solid var(--ink);
}

.memory-block:last-child {
  border-bottom: 0;
}

.memory-block strong,
.memory-block span {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  font-size: 11px;
}

.memory-block strong {
  border-right: 1px solid var(--ink);
  font-family: var(--mono);
}

.memory-block[data-tone="stack"] strong { background: #dce9ef; }
.memory-block[data-tone="shared"] strong { background: #d9e5b4; }
.memory-block[data-tone="loader"] strong { background: #d9e8e6; }
.memory-block[data-tone="gap"] strong { background: #eeeae0; }
.memory-block[data-tone="heap"] strong { background: #f3d9a4; }
.memory-block[data-tone="image"] strong { background: #f2c5bb; }
.memory-block[data-tone="entry"] strong { background: #ecd6a8; }
.memory-block[data-tone="kernel"] strong { color: #fff; background: var(--accent-dark); }

.relation-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
  padding-top: 18px;
}

.relation-grid::before {
  position: absolute;
  top: 49px;
  right: 5%;
  left: 5%;
  height: 3px;
  background: var(--ink);
  content: "";
}

.relation-panel {
  position: relative;
  z-index: 1;
  min-width: 0;
  background: #fff;
  border: 2px solid var(--ink);
  border-top: 8px solid var(--accent);
}

.relation-panel[data-tone="entry"] { border-top-color: var(--amber); }
.relation-panel[data-tone="libc"] { border-top-color: var(--cyan); }
.relation-panel[data-tone="kernel"] { border-top-color: var(--accent-dark); }
.relation-panel[data-tone="shared"] { border-top-color: #6f842e; }

.relation-panel h3,
.hierarchy-branch h3,
.ring-panel h3 {
  min-height: 54px;
  margin: 0;
  padding: 10px 9px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.35;
}

.compare-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 0.72fr) minmax(0, 1fr);
  gap: 28px;
  align-items: stretch;
}

.compare-grid::before {
  position: absolute;
  top: 50%;
  right: 8%;
  left: 8%;
  height: 3px;
  background: var(--accent-dark);
  content: "";
}

.compare-panel {
  position: relative;
  z-index: 1;
  min-width: 0;
  background: #fff;
  border: 2px solid var(--ink);
}

.compare-panel h3 {
  margin: 0;
  padding: 11px 12px;
  font-family: var(--mono);
  font-size: 12px;
  border-bottom: 2px solid var(--ink);
}

.compare-panel.decision {
  align-self: center;
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.compare-panel.decision h3,
.compare-panel.decision li {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}

.compare-panel.after h3 {
  background: #dce9ef;
}

.hierarchy-visual {
  position: relative;
}

.hierarchy-root {
  display: grid;
  grid-template-columns: minmax(150px, 0.35fr) minmax(0, 1fr);
  max-width: 620px;
  margin: 0 auto;
  background: #fff;
  border: 3px solid var(--ink);
}

.hierarchy-root strong,
.hierarchy-root span {
  padding: 12px 14px;
}

.hierarchy-root strong {
  color: #fff;
  background: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
}

.hierarchy-root span {
  font-size: 11px;
}

.hierarchy-trunk {
  width: 2px;
  height: 34px;
  margin: 0 auto;
  background: var(--ink);
}

.hierarchy-branches {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding-top: 22px;
}

.hierarchy-branches::before {
  position: absolute;
  top: 0;
  right: 12.5%;
  left: 12.5%;
  height: 2px;
  background: var(--ink);
  content: "";
}

.hierarchy-branch {
  position: relative;
  min-width: 0;
  background: #fff;
  border: 2px solid var(--ink);
}

.hierarchy-branch::before {
  position: absolute;
  bottom: 100%;
  left: 50%;
  width: 2px;
  height: 24px;
  background: var(--ink);
  content: "";
}

.hierarchy-branch h3 {
  background: #dce9ef;
  border-bottom: 2px solid var(--ink);
}

.buffer-visual {
  min-width: 0;
  overflow-x: auto;
  border-top: 2px solid var(--ink);
}

.buffer-row {
  display: grid;
  grid-template-columns: 124px minmax(max-content, 1fr);
  min-width: max-content;
  border-right: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  border-left: 1px solid var(--ink);
}

.buffer-row > strong {
  position: sticky;
  left: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  width: 124px;
  padding: 10px;
  background: #ebe8de;
  border-right: 1px solid var(--ink);
  font-family: var(--mono);
  font-size: 11px;
}

.buffer-cells {
  display: flex;
  min-width: max-content;
}

.buffer-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 48px;
  padding: 7px 9px;
  background: #fff;
  border-right: 1px solid rgba(23, 22, 18, 0.35);
  font-family: var(--mono);
  font-size: 10px;
}

.buffer-cell[data-mark="done"] { background: #d9e5b4; }
.buffer-cell[data-mark="pending"],
.buffer-cell[data-mark="wait"] { background: #f3d9a4; }
.buffer-cell[data-mark="drop"] { color: #fff; background: var(--accent-dark); }
.buffer-cell[data-mark="cursor"] { background: #dce9ef; border-bottom: 5px solid var(--cyan); }
.buffer-cell[data-mark="meta"],
.buffer-cell[data-mark="size"] { background: #e4e0d7; }
.buffer-cell[data-mark="name"] { background: #fff; }
.buffer-cell[data-mark="pad"] { color: #716b62; background: repeating-linear-gradient(135deg, #eeeae0 0 5px, #fff 5px 10px); }

.range-visual {
  min-width: 0;
}

.range-axis {
  display: flex;
  justify-content: space-between;
  margin-left: 156px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.range-tracks {
  border-top: 2px solid var(--ink);
}

.range-track {
  display: grid;
  grid-template-columns: repeat(var(--range-columns), minmax(42px, 1fr));
  min-height: 52px;
  margin-left: 156px;
  background-image: linear-gradient(90deg, transparent calc(100% - 1px), rgba(23, 22, 18, 0.2) calc(100% - 1px));
  background-size: calc(100% / var(--range-columns)) 100%;
  border-bottom: 1px solid var(--line);
}

.range-bar {
  align-self: center;
  min-height: 34px;
  padding: 7px 9px;
  color: var(--ink);
  background: #dce9ef;
  border: 2px solid var(--cyan);
  font-family: var(--mono);
  font-size: 10px;
}

.range-bar::before {
  float: left;
  width: 146px;
  margin-left: -158px;
  color: var(--ink);
  content: attr(data-tone);
  font-family: var(--mono);
  font-weight: 900;
  text-transform: uppercase;
}

.range-bar[data-tone="write"] { background: #f2c5bb; border-color: var(--accent-dark); }
.range-bar[data-tone="wait"] { background: #f3d9a4; border-color: var(--amber); }
.range-bar[data-tone="exec"] { background: #d9e5b4; border-color: #6f842e; }
.range-bar[data-tone="read"] { background: #dce9ef; border-color: var(--cyan); }

.structure-note {
  margin: 14px 0 0;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  border-left: 5px solid var(--accent);
  font-size: 11px;
}

.queue-visual {
  border: 2px solid var(--ink);
}

.queue-lane {
  display: grid;
  grid-template-columns: minmax(140px, 0.28fr) minmax(0, 1fr);
  min-width: 0;
  border-bottom: 1px solid var(--ink);
}

.queue-lane:last-child {
  border-bottom: 0;
}

.queue-lane > strong {
  display: flex;
  align-items: center;
  padding: 11px;
  background: #ebe8de;
  border-right: 1px solid var(--ink);
  font-family: var(--mono);
  font-size: 11px;
}

.queue-cells {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.queue-cells span {
  min-width: 0;
  padding: 11px 9px;
  background: #fff;
  border-right: 1px solid rgba(23, 22, 18, 0.24);
  font-size: 10px;
  line-height: 1.35;
}

.queue-cells span:last-child {
  border-right: 0;
}

.queue-lane[data-tone="wait"] > strong { background: #f3d9a4; }
.queue-lane[data-tone="ready"] > strong { background: #d9e5b4; }
.queue-lane[data-tone="result"] > strong { background: #dce9ef; }

.matrix-visual {
  display: grid;
  grid-template-columns: repeat(var(--matrix-columns), minmax(0, 1fr));
  min-width: 0;
  background: #fff;
  border-top: 2px solid var(--ink);
  border-left: 1px solid var(--ink);
}

.matrix-head,
.matrix-cell {
  min-width: 0;
  padding: 10px 8px;
  border-right: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  font-size: 10px;
  line-height: 1.35;
}

.matrix-head {
  color: #fff;
  background: var(--ink);
  font-family: var(--mono);
}

.matrix-cell:nth-child(2n) {
  background: #fbfaf5;
}

.ring-grid {
  display: grid;
  gap: 18px;
}

.ring-panel {
  min-width: 0;
  background: #fff;
  border: 2px solid var(--ink);
}

.ring-panel h3 {
  min-height: 0;
  color: #fff;
  background: var(--ink);
}

.ring-index {
  display: flex;
  justify-content: space-between;
  padding: 7px 10px;
  color: var(--accent-dark);
  background: #ebe8de;
  border-bottom: 1px solid var(--ink);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 900;
}

.ring-cells {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
}

.ring-panel:nth-child(2) .ring-cells {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ring-cells > span {
  position: relative;
  min-width: 0;
  min-height: 70px;
  padding: 25px 7px 8px;
  background: #fff;
  border-right: 1px solid var(--ink);
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.3;
}

.ring-cells > span:last-child {
  border-right: 0;
}

.ring-cells small {
  position: absolute;
  top: 4px;
  left: 5px;
  color: #777168;
  font-size: 9px;
}

.ring-cells [data-position="active"] { background: #d9e5b4; }
.ring-cells [data-position="head"] { background: #dce9ef; box-shadow: inset 0 5px 0 var(--cyan); }
.ring-cells [data-position="tail"] { background: #f3d9a4; box-shadow: inset 0 5px 0 var(--amber); }

.flow-diagram {
  display: grid;
  grid-template-columns: repeat(9, auto);
  align-items: stretch;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  padding: 22px 12px;
  background-image:
    linear-gradient(rgba(23, 22, 18, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 22, 18, 0.055) 1px, transparent 1px);
  background-size: 24px 24px;
}

.flow-node {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: min(150px, 16vw);
  min-height: 92px;
  padding: 12px;
  background: #fff;
  border: 2px solid var(--ink);
}

.flow-node.accent {
  border-top: 8px solid var(--accent);
}

.flow-node.terminal {
  border-bottom: 8px solid var(--cyan);
}

.flow-node strong {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.25;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.flow-node span {
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.flow-arrow {
  align-self: center;
  color: var(--accent-dark);
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 900;
}

.table-wrap {
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--line);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 13px 14px;
  text-align: left;
  vertical-align: top;
  border-right: 1px solid rgba(23, 22, 18, 0.16);
  border-bottom: 1px solid rgba(23, 22, 18, 0.16);
}

th:last-child,
td:last-child {
  border-right: 0;
}

tr:last-child td {
  border-bottom: 0;
}

th {
  color: var(--ink);
  background: #ebe8de;
  font-size: 12px;
  font-weight: 900;
}

td a {
  color: var(--accent-dark);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
}

code {
  color: var(--ink);
  font-family: var(--mono);
}

.build-line,
.command-pair > div {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  background: #e8e4d9;
  border: 1px solid var(--line);
}

.build-line code,
.command-pair code {
  overflow-wrap: anywhere;
}

.source-code {
  width: 100%;
  max-width: 100%;
  margin: 0;
  overflow: auto;
  color: #111;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-top: 0;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  tab-size: 4;
}

.source-code code {
  display: table;
  min-width: 100%;
  padding: 16px 0;
}

.code-line {
  display: table-row;
}

.code-line:hover {
  background: rgba(239, 75, 44, 0.08);
}

.line-no,
.line-text {
  display: table-cell;
  white-space: pre;
}

.line-no {
  width: 1%;
  padding: 0 14px;
  color: #8b857b;
  text-align: right;
  user-select: none;
  border-right: 1px solid rgba(23, 22, 18, 0.16);
}

.line-text {
  padding: 0 18px;
  color: #111;
}

.line-note-list {
  border-top: 2px solid var(--ink);
}

.line-note {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.5fr);
  gap: 22px;
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
}

.line-note-code {
  min-width: 0;
}

.line-note-code span {
  display: block;
  margin-bottom: 5px;
  color: var(--accent-dark);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 900;
}

.line-note-code code {
  display: block;
  overflow-x: auto;
  padding: 9px 10px;
  white-space: pre;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 12px;
}

.line-note p {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
}

.walk-list {
  border-top: 2px solid var(--ink);
}

.walk-step {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 18px;
  padding: 22px 0 8px;
  border-bottom: 1px solid var(--line);
}

.step-no {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 900;
}

.lab-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: lab;
  border-top: 2px solid var(--ink);
}

.lab-list li {
  position: relative;
  min-height: 54px;
  padding: 15px 10px 15px 54px;
  border-bottom: 1px solid var(--line);
  counter-increment: lab;
}

.lab-list li::before {
  position: absolute;
  left: 10px;
  content: counter(lab, decimal-leading-zero);
  color: var(--accent-dark);
  font-family: var(--mono);
  font-weight: 900;
}

.command-pair {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.reference-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line-strong);
  border-left: 1px solid var(--line-strong);
}

.reference-list a {
  min-width: 0;
  padding: 13px;
  color: var(--accent-dark);
  background: #fff;
  border-right: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.reference-list a:hover,
.reference-list a:focus-visible {
  color: #fff;
  background: var(--accent-dark);
}

.article-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding-top: 24px;
  border-top: 2px solid var(--ink);
}

.article-nav a {
  padding: 14px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

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

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 0 38px;
  border-top: 1px solid var(--line-strong);
  font-size: 12px;
  font-weight: 800;
}

.index-hero .hero-inner {
  padding-top: 62px;
  padding-bottom: 52px;
}

.series-heading {
  display: grid;
  grid-template-columns: minmax(220px, 0.55fr) minmax(0, 1fr);
  gap: 28px;
  align-items: end;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--ink);
}

.series-heading h2,
.series-heading p {
  margin-bottom: 0;
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.topic-card {
  min-width: 0;
  padding: 18px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.topic-card > span {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 900;
}

.topic-card h3 {
  margin-top: 8px;
}

.topic-card p {
  margin: 0;
  font-size: 13px;
}

.topic-card:hover,
.topic-card:focus-visible {
  color: var(--accent-dark);
  background: #fff;
  box-shadow: inset 5px 0 0 var(--accent);
}

@media (max-width: 920px) {
  .page-grid,
  .index-layout {
    grid-template-columns: 1fr;
  }

  .toc {
    position: static;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px 12px;
  }

  .toc strong {
    grid-column: 1 / -1;
  }

  .flow-diagram {
    grid-template-columns: 1fr;
  }

  .flow-node {
    width: 100%;
    min-height: 0;
  }

  .flow-arrow {
    transform: rotate(90deg);
    justify-self: center;
  }

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

  .relation-grid::before,
  .hierarchy-branches::before,
  .hierarchy-branch::before {
    display: none;
  }
}

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

  .hero-inner,
  .page-grid,
  .index-layout,
  footer {
    width: min(100% - 28px, 1180px);
  }

  .analysis-strip,
  .topic-grid,
  .reference-list,
  .article-nav,
  .series-heading,
  .line-note {
    grid-template-columns: 1fr;
  }

  .analysis-strip div,
  .analysis-strip div:first-child {
    padding: 10px 0;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  }

  .analysis-strip div:last-child {
    border-bottom: 0;
  }

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

  h1 {
    font-size: 34px;
  }

  h2 {
    font-size: 25px;
  }

  .system-figure {
    padding: 14px;
  }

  .system-structure-figure {
    padding: 14px;
  }

  .structure-canvas {
    padding: 14px;
  }

  .structure-layer,
  .memory-block,
  .hierarchy-root,
  .queue-lane,
  .exec-shell,
  .exec-finish {
    grid-template-columns: 1fr;
  }

  .structure-layer strong,
  .memory-block strong,
  .hierarchy-root strong,
  .queue-lane > strong,
  .exec-shell strong,
  .exec-finish strong {
    border-right: 0;
    border-bottom: 1px solid var(--ink);
  }

  .exec-lanes {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .exec-split-label::before,
  .exec-split-label::after,
  .exec-lane::before,
  .exec-finish::before {
    display: none;
  }

  .exec-split-label {
    height: 36px;
  }

  .exec-split-label span {
    bottom: 6px;
  }

  .exec-finish {
    margin-top: 20px;
  }

  .structure-timeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 0;
  }

  .structure-timeline::before {
    display: none;
  }

  .timeline-event {
    grid-template-rows: auto 24px auto auto;
  }

  .memory-visual {
    grid-template-columns: 1fr 30px;
    gap: 10px;
    min-height: 520px;
  }

  .memory-direction {
    display: none;
  }

  .relation-grid,
  .hierarchy-branches,
  .compare-grid {
    grid-template-columns: 1fr;
  }

  .compare-grid {
    gap: 14px;
  }

  .compare-grid::before {
    display: none;
  }

  .hierarchy-root {
    max-width: none;
  }

  .hierarchy-trunk {
    height: 20px;
  }

  .hierarchy-branches {
    padding-top: 0;
  }

  .range-axis {
    margin-left: 0;
  }

  .range-track {
    margin-left: 0;
  }

  .range-bar::before {
    display: none;
  }

  .queue-cells {
    grid-template-columns: 1fr;
  }

  .queue-cells span {
    border-right: 0;
    border-bottom: 1px solid rgba(23, 22, 18, 0.24);
  }

  .queue-cells span:last-child {
    border-bottom: 0;
  }

  .matrix-visual {
    font-size: 9px;
  }

  .matrix-head,
  .matrix-cell {
    padding: 7px 5px;
    font-size: 9px;
  }

  .ring-cells,
  .ring-panel:nth-child(2) .ring-cells {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ring-cells > span,
  .ring-cells > span:last-child {
    border-right: 1px solid var(--ink);
    border-bottom: 1px solid var(--ink);
  }

  .line-note {
    gap: 10px;
  }

  .build-line,
  .command-pair > div {
    grid-template-columns: 1fr;
  }

  .source-code {
    font-size: 12px;
  }

  .walk-step {
    grid-template-columns: 40px minmax(0, 1fr);
  }
}
