:root {
  color-scheme: light;
  --bg: #f6f4ef;
  --panel: #fffaf0;
  --ink: #1f2933;
  --muted: #5b6673;
  --line: #ded8cc;
  --accent: #9a3412;
  --accent-2: #2563eb;
  --accent-3: #047857;
  --shadow: 0 18px 50px rgba(31, 41, 51, 0.12);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(154, 52, 18, 0.13), transparent 34rem),
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.10), transparent 30rem),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
}

code {
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 0.35rem;
  padding: 0.08rem 0.28rem;
}

pre {
  overflow-x: auto;
  margin: 16px 0;
  padding: 16px;
  background: #1f2933;
  border-radius: 16px;
  color: #fffaf0;
  font-size: 0.92rem;
  line-height: 1.55;
}

pre code {
  display: block;
  padding: 0;
  background: transparent;
  border: 0;
  color: inherit;
}

.hero,
main {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  padding: 34px 0 48px;
}

.hero.compact {
  padding-bottom: 28px;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 56px;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 14px;
  background: rgba(255, 250, 240, 0.74);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.92rem;
  text-decoration: none;
}

.nav-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 5px;
  background: rgba(255, 250, 240, 0.44);
  border: 1px solid rgba(222, 216, 204, 0.78);
  border-radius: 999px;
}

.nav-group > span {
  padding: 0 7px;
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--ink);
  border-color: rgba(154, 52, 18, 0.45);
  box-shadow: 0 8px 24px rgba(154, 52, 18, 0.08);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 900px;
  margin-bottom: 20px;
  font-size: clamp(3rem, 7vw, 6.4rem);
  line-height: 0.92;
  letter-spacing: -0.065em;
}

.compact h1 {
  font-size: clamp(2.8rem, 6vw, 5rem);
}

h2 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1;
  letter-spacing: -0.045em;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.16rem;
  line-height: 1.25;
}

.lede {
  max-width: 800px;
  color: var(--muted);
  font-size: clamp(1.1rem, 2vw, 1.35rem);
}

main {
  padding-bottom: 70px;
}

section {
  margin: 28px 0;
  scroll-margin-top: 16px;
}

.panel {
  padding: clamp(22px, 4vw, 38px);
  background: rgba(255, 250, 240, 0.82);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.8fr);
  gap: 28px;
  align-items: start;
}

.callout {
  padding: 22px;
  background: #1f2933;
  border-radius: 18px;
  color: #fdf8ed;
}

.callout p,
.callout li {
  color: rgba(253, 248, 237, 0.84);
}

.callout p:last-child,
.callout ol:last-child {
  margin-bottom: 0;
}

.plain-list {
  padding-left: 1.2rem;
}

.section-heading {
  max-width: 800px;
  margin-bottom: 18px;
}

.cards {
  display: grid;
  gap: 14px;
}

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

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

.card {
  padding: 22px;
  background: rgba(255, 250, 240, 0.84);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.card:nth-child(3n + 1) {
  border-top: 4px solid var(--accent);
}

.card:nth-child(3n + 2) {
  border-top: 4px solid var(--accent-2);
}

.card:nth-child(3n) {
  border-top: 4px solid var(--accent-3);
}

.fit,
.examples {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.path-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.path-card {
  display: grid;
  gap: 8px;
  padding: 22px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line);
  border-radius: 18px;
  text-decoration: none;
}

.path-card:hover {
  border-color: rgba(37, 99, 235, 0.35);
  transform: translateY(-1px);
}

.path-card strong {
  font-size: 1.25rem;
}

.path-card span:last-child {
  color: var(--muted);
}

.path-kicker {
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.scenario-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.scenario-card {
  display: grid;
  gap: 10px;
  min-height: 210px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid var(--line);
  border-top: 6px solid var(--accent);
  border-radius: 18px;
  text-decoration: none;
}

.scenario-card:nth-child(2) {
  border-top-color: var(--accent-2);
}

.scenario-card:nth-child(3) {
  border-top-color: var(--accent-3);
}

.scenario-card:hover {
  border-color: rgba(37, 99, 235, 0.35);
  transform: translateY(-2px);
}

.scenario-card strong {
  font-size: 1.25rem;
  line-height: 1.2;
}

.scenario-card span:last-child {
  color: var(--muted);
}

.scenario-input {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.quick-map {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.quick-map a {
  min-height: 130px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 20px;
  background: rgba(255, 250, 240, 0.86);
  border: 1px solid var(--line);
  border-radius: 18px;
  text-decoration: none;
}

.quick-map a:hover {
  border-color: rgba(37, 99, 235, 0.35);
  transform: translateY(-1px);
}

.quick-map strong {
  font-size: 1.05rem;
}

.quick-map span {
  color: var(--muted);
}

.learning-path {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(125px, 1fr));
  gap: 8px;
}

.learning-path a {
  display: grid;
  gap: 10px;
  align-content: start;
  min-height: 118px;
  padding: 14px;
  background: rgba(255, 250, 240, 0.86);
  border: 1px solid var(--line);
  border-radius: 16px;
  text-decoration: none;
}

.learning-path a:hover {
  border-color: rgba(37, 99, 235, 0.35);
  transform: translateY(-1px);
}

.learning-path span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  background: #1f2933;
  border-radius: 50%;
  color: #fffaf0;
  font-size: 0.82rem;
  font-weight: 900;
}

.learning-path strong {
  line-height: 1.15;
}

.decision-map {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.decision-root,
.decision-card {
  display: grid;
  gap: 8px;
  min-height: 150px;
  padding: 22px;
  border-radius: 18px;
}

.decision-root {
  grid-column: 1 / -1;
  min-height: 120px;
  background: #1f2933;
  color: #fffaf0;
}

.decision-root span:last-child {
  color: rgba(253, 248, 237, 0.78);
}

.decision-card {
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}

.decision-card:hover {
  border-color: rgba(154, 52, 18, 0.35);
  transform: translateY(-1px);
}

.decision-card strong {
  font-size: 1.12rem;
}

.decision-card span:last-child {
  color: var(--muted);
}

.decision-label {
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.visual-stack {
  display: grid;
  gap: 10px;
}

.visual-layer {
  display: grid;
  grid-template-columns: 58px minmax(180px, 0.9fr) minmax(220px, 1fr);
  gap: 16px;
  align-items: center;
  padding: 18px 20px;
  background: rgba(255, 250, 240, 0.86);
  border: 1px solid var(--line);
  border-left: 8px solid var(--accent);
  border-radius: 18px;
  text-decoration: none;
}

.visual-layer:hover {
  border-color: rgba(37, 99, 235, 0.32);
  transform: translateX(2px);
}

.visual-layer > span:last-child {
  color: var(--muted);
}

.visual-layer.governance,
.visual-layer.runtime,
.visual-layer.capabilities {
  border-left-color: var(--accent);
}

.visual-layer.orchestration,
.visual-layer.packaging,
.visual-layer.foundation {
  border-left-color: var(--accent-2);
}

.visual-layer.hosts,
.visual-layer.protocols {
  border-left-color: var(--accent-3);
}

.object-map {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.object-map a {
  display: grid;
  gap: 8px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line);
  border-radius: 16px;
  text-decoration: none;
}

.object-map a:hover {
  border-color: rgba(154, 52, 18, 0.35);
  transform: translateY(-1px);
}

.object-map span {
  color: var(--muted);
}

.coverage-map {
  display: grid;
  gap: 8px;
  overflow-x: auto;
  padding: 16px;
  background:
    linear-gradient(rgba(31, 41, 51, 0.035) 1px, transparent 1px),
    rgba(255, 255, 255, 0.36);
  background-size: 100% 48px;
  border: 1px solid var(--line);
  border-radius: 24px;
}

.coverage-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.05fr) repeat(5, minmax(120px, 1fr));
  gap: 8px;
  align-items: stretch;
  min-width: 860px;
}

.coverage-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  min-width: 860px;
  padding: 0 0 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.coverage-legend span {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.legend-dot {
  width: 12px;
  height: 12px;
  background: var(--accent-2);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.10);
}

.legend-dot.strong {
  width: 16px;
  height: 16px;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(154, 52, 18, 0.10);
}

.legend-empty {
  color: rgba(91, 102, 115, 0.52);
  font-style: normal;
  font-weight: 900;
}

.coverage-row > * {
  display: grid;
  align-items: center;
  min-height: 54px;
  padding: 10px 12px;
  background: rgba(255, 250, 240, 0.78);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.coverage-row > a {
  color: var(--ink);
  font-weight: 900;
  text-decoration: none;
}

.coverage-row > a:hover {
  border-color: rgba(37, 99, 235, 0.35);
}

.coverage-head > span {
  min-height: 44px;
  background: #1f2933;
  border-color: rgba(31, 41, 51, 0.24);
  color: #fffaf0;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.coverage-head > span:first-child {
  text-align: left;
}

.coverage-dot {
  position: relative;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 750;
  text-align: center;
}

.coverage-dot::before {
  content: "";
  justify-self: center;
  width: 14px;
  height: 14px;
  margin-bottom: 6px;
  background: var(--accent-2);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.10);
}

.coverage-dot.strong {
  background: rgba(37, 99, 235, 0.10);
  border-color: rgba(37, 99, 235, 0.24);
  color: var(--ink);
}

.coverage-dot.strong::before {
  width: 18px;
  height: 18px;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(154, 52, 18, 0.10);
}

.coverage-empty {
  color: rgba(91, 102, 115, 0.42);
  font-size: 1.2rem;
  text-align: center;
}

.system-sketch {
  display: grid;
  grid-template-columns: minmax(210px, 0.95fr) 44px minmax(260px, 1.08fr) 44px minmax(210px, 0.95fr);
  gap: 14px;
  align-items: center;
  padding: 22px;
  background:
    radial-gradient(circle at 50% 50%, rgba(154, 52, 18, 0.10), transparent 17rem),
    linear-gradient(rgba(31, 41, 51, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 41, 51, 0.045) 1px, transparent 1px),
    rgba(255, 255, 255, 0.45);
  background-size: auto, 28px 28px, 28px 28px, auto;
  border: 1px solid var(--line);
  border-radius: 24px;
}

.sketch-column {
  display: grid;
  gap: 12px;
}

.sketch-label {
  margin: 0;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sketch-card,
.agent-loop-card,
.behavior-rail {
  color: inherit;
  text-decoration: none;
}

.sketch-card {
  display: grid;
  gap: 5px;
  min-height: 120px;
  padding: 16px 18px;
  background: rgba(255, 250, 240, 0.92);
  border: 1px solid var(--line);
  border-left: 7px solid var(--accent);
  border-radius: 18px;
  box-shadow: 0 14px 28px rgba(31, 41, 51, 0.08);
}

.sketch-card:hover,
.agent-loop-card:hover,
.behavior-rail:hover,
.choice-card:hover {
  border-color: rgba(37, 99, 235, 0.35);
  transform: translateY(-2px);
}

.sketch-card span,
.choice-card span {
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sketch-card strong,
.choice-card strong {
  font-size: 1.1rem;
  line-height: 1.18;
}

.sketch-card em,
.agent-loop-card em,
.behavior-rail span {
  color: var(--muted);
  font-style: normal;
}

.sketch-card.model,
.sketch-card.host {
  border-left-color: var(--accent-2);
}

.sketch-card.protocol,
.sketch-card.governance {
  border-left-color: var(--accent-3);
}

.sketch-arrow {
  justify-self: center;
  color: rgba(31, 41, 51, 0.42);
  font-size: 2.25rem;
  font-weight: 900;
}

.agent-loop-card {
  display: grid;
  gap: 14px;
  justify-items: center;
  min-height: 385px;
  padding: 24px;
  background: #1f2933;
  border: 1px solid rgba(255, 250, 240, 0.22);
  border-radius: 28px;
  box-shadow: 0 24px 60px rgba(31, 41, 51, 0.20);
  color: #fffaf0;
  text-align: center;
}

.agent-loop-card .sketch-label {
  color: rgba(255, 250, 240, 0.72);
}

.agent-loop-card > strong {
  font-size: 1.55rem;
  line-height: 1;
}

.agent-loop-card em {
  color: rgba(255, 250, 240, 0.72);
}

.loop-ring {
  position: relative;
  display: grid;
  place-items: center;
  width: min(250px, 100%);
  aspect-ratio: 1;
  border: 2px solid rgba(255, 250, 240, 0.30);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 250, 240, 0.18) 0 31%, transparent 32%),
    conic-gradient(from -30deg, rgba(37, 99, 235, 0.22), rgba(4, 120, 87, 0.22), rgba(154, 52, 18, 0.22), rgba(37, 99, 235, 0.22));
}

.loop-ring::after {
  content: "";
  width: 36%;
  aspect-ratio: 1;
  background: #fffaf0;
  border-radius: 50%;
  box-shadow: inset 0 0 0 9px rgba(31, 41, 51, 0.18);
}

.loop-ring span {
  position: absolute;
  z-index: 1;
  padding: 5px 9px;
  background: rgba(255, 250, 240, 0.95);
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
}

.loop-ring span:nth-child(1) {
  top: 10px;
}

.loop-ring span:nth-child(2) {
  right: -6px;
}

.loop-ring span:nth-child(3) {
  bottom: 10px;
}

.loop-ring span:nth-child(4) {
  left: -8px;
}

.behavior-rail {
  grid-column: 1 / -1;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  background: rgba(255, 250, 240, 0.90);
  border: 1px dashed rgba(154, 52, 18, 0.45);
  border-radius: 18px;
}

.behavior-rail strong {
  white-space: nowrap;
}

.choice-wheel {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding: 24px;
  background:
    radial-gradient(circle at center, rgba(31, 41, 51, 0.08), transparent 14rem),
    rgba(255, 255, 255, 0.36);
  border: 1px solid var(--line);
  border-radius: 24px;
}

.choice-wheel::before,
.choice-wheel::after {
  content: "";
  position: absolute;
  background: rgba(123, 132, 144, 0.30);
}

.choice-wheel::before {
  top: 50%;
  left: 8%;
  right: 8%;
  height: 2px;
}

.choice-wheel::after {
  top: 9%;
  bottom: 9%;
  left: 50%;
  width: 2px;
}

.choice-card,
.choice-center {
  position: relative;
  z-index: 1;
  min-height: 140px;
  padding: 20px;
  border-radius: 22px;
  text-align: center;
}

.choice-card {
  display: grid;
  align-content: center;
  gap: 8px;
  background: rgba(255, 250, 240, 0.92);
  border: 1px solid var(--line);
  border-top: 7px solid var(--accent);
  text-decoration: none;
}

.choice-center {
  display: grid;
  place-items: center;
  background: #1f2933;
  border: 1px solid rgba(31, 41, 51, 0.16);
  border-radius: 50%;
  box-shadow: 0 22px 50px rgba(31, 41, 51, 0.18);
  color: #fffaf0;
  font-size: 1.2rem;
  line-height: 1.1;
}

.choice-card.context,
.choice-card.host {
  border-top-color: var(--accent-2);
}

.choice-card.connect,
.choice-card.govern {
  border-top-color: var(--accent-3);
}

.diagram-shell {
  overflow-x: auto;
  padding: 18px;
  background:
    linear-gradient(rgba(31, 41, 51, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 41, 51, 0.045) 1px, transparent 1px),
    rgba(255, 255, 255, 0.42);
  background-size: 28px 28px;
  border: 1px solid var(--line);
  border-radius: 22px;
}

.ecosystem-svg {
  display: block;
  min-width: 900px;
  width: 100%;
  height: auto;
}

.flow-line {
  fill: none;
  stroke: #7b8490;
  stroke-width: 3;
  stroke-linecap: round;
}

.muted-line {
  stroke: rgba(123, 132, 144, 0.46);
  stroke-dasharray: 8 9;
}

.svg-node rect {
  fill: #fffaf0;
  stroke: var(--line);
  stroke-width: 2;
  filter: drop-shadow(0 10px 16px rgba(31, 41, 51, 0.10));
}

.svg-node text {
  fill: var(--ink);
  font-size: 19px;
  font-weight: 850;
}

.svg-node .small {
  fill: var(--muted);
  font-size: 15px;
  font-weight: 650;
}

.svg-node .tiny {
  fill: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.ecosystem-svg a {
  cursor: pointer;
}

.ecosystem-svg a:hover rect {
  stroke: var(--accent-2);
  stroke-width: 3;
}

.node-blue rect {
  fill: rgba(37, 99, 235, 0.08);
  stroke: rgba(37, 99, 235, 0.22);
}

.node-green rect {
  fill: rgba(4, 120, 87, 0.08);
  stroke: rgba(4, 120, 87, 0.22);
}

.node-amber rect {
  fill: rgba(154, 52, 18, 0.09);
  stroke: rgba(154, 52, 18, 0.23);
}

.node-red rect {
  fill: rgba(127, 29, 29, 0.08);
  stroke: rgba(127, 29, 29, 0.22);
}

.branch-map {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 22px 12px;
  padding-top: 18px;
}

.branch-map::before {
  content: "";
  position: absolute;
  top: 112px;
  left: 8.3%;
  right: 8.3%;
  height: 2px;
  background: rgba(123, 132, 144, 0.45);
}

.branch-root {
  grid-column: 1 / -1;
  justify-self: center;
  position: relative;
  display: grid;
  place-items: center;
  width: min(360px, 100%);
  min-height: 86px;
  padding: 18px;
  background: #1f2933;
  border-radius: 999px;
  color: #fffaf0;
  text-align: center;
  z-index: 1;
}

.branch-root::after {
  content: "";
  position: absolute;
  bottom: -27px;
  left: 50%;
  width: 2px;
  height: 27px;
  background: rgba(123, 132, 144, 0.55);
}

.branch-card {
  position: relative;
  display: grid;
  align-content: center;
  gap: 8px;
  min-height: 150px;
  padding: 18px;
  background: rgba(255, 250, 240, 0.86);
  border: 1px solid var(--line);
  border-top: 8px solid var(--accent);
  border-radius: 18px;
  text-align: center;
  text-decoration: none;
  z-index: 1;
}

.branch-card::before {
  content: "";
  position: absolute;
  top: -24px;
  left: 50%;
  width: 2px;
  height: 24px;
  background: rgba(123, 132, 144, 0.55);
}

.branch-card:hover {
  transform: translateY(-2px);
  border-color: rgba(37, 99, 235, 0.32);
}

.branch-card span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.branch-card strong {
  font-size: 1.08rem;
  line-height: 1.18;
}

.branch-card.context,
.branch-card.decide {
  border-top-color: var(--accent-2);
}

.branch-card.action,
.branch-card.coordinate {
  border-top-color: var(--accent);
}

.branch-card.connect,
.branch-card.package {
  border-top-color: var(--accent-3);
}

.visual-stack-pyramid {
  justify-items: center;
}

.visual-stack-pyramid .visual-layer {
  width: 100%;
}

.visual-stack-pyramid .visual-layer:nth-child(1) {
  width: 68%;
}

.visual-stack-pyramid .visual-layer:nth-child(2) {
  width: 74%;
}

.visual-stack-pyramid .visual-layer:nth-child(3) {
  width: 80%;
}

.visual-stack-pyramid .visual-layer:nth-child(4) {
  width: 86%;
}

.visual-stack-pyramid .visual-layer:nth-child(5) {
  width: 92%;
}

.two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.two-column > div {
  padding: 18px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.walkthrough {
  display: grid;
  gap: 12px;
}

.walk-step {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 18px;
  background: rgba(255, 250, 240, 0.86);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.walk-step > span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: var(--ink);
  border-radius: 50%;
  color: #fffaf0;
  font-weight: 900;
}

.walk-step p {
  margin-bottom: 0;
}

.stack {
  display: grid;
  gap: 12px;
}

.stack-layer {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 18px;
  padding: 22px;
  background: rgba(255, 250, 240, 0.86);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.layer-number {
  color: var(--accent);
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.diagram {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  margin: 26px 0;
}

.node {
  min-height: 120px;
  display: grid;
  place-items: center;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 800;
}

.node span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
}

.node.primary {
  background: #1f2933;
  color: #fffaf0;
}

.node.accent {
  background: rgba(154, 52, 18, 0.1);
  border-color: rgba(154, 52, 18, 0.3);
}

.arrow {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-align: center;
  text-transform: uppercase;
}

.three-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.three-columns > div {
  padding: 18px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line);
  border-radius: 16px;
}

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

.comparison-grid article {
  padding: 18px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.timeline {
  display: grid;
  gap: 12px;
  padding: 0;
  list-style: none;
  counter-reset: timeline;
}

.timeline li {
  position: relative;
  padding: 22px 22px 22px 76px;
  background: rgba(255, 250, 240, 0.86);
  border: 1px solid var(--line);
  border-radius: 18px;
  counter-increment: timeline;
}

.timeline li::before {
  content: counter(timeline);
  position: absolute;
  left: 22px;
  top: 22px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: var(--ink);
  border-radius: 50%;
  color: #fffaf0;
  font-weight: 900;
}

.lab-list {
  display: grid;
  gap: 14px;
}

.lab-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 20px;
  padding: 24px;
  background: rgba(255, 250, 240, 0.86);
  border: 1px solid var(--line);
  border-left: 8px solid var(--accent);
  border-radius: 20px;
}

.lab-card:nth-child(3n + 2) {
  border-left-color: var(--accent-2);
}

.lab-card:nth-child(3n) {
  border-left-color: var(--accent-3);
}

.lab-number {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  background: #1f2933;
  border-radius: 50%;
  color: #fffaf0;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.lab-card p:last-child {
  margin-bottom: 0;
}

.lab-output {
  display: grid;
  gap: 6px;
  margin: 14px 0;
  padding: 14px 16px;
  background: rgba(31, 41, 51, 0.055);
  border: 1px solid rgba(31, 41, 51, 0.10);
  border-radius: 14px;
}

.lab-output span {
  color: var(--muted);
}

table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.wide-table-wrapper {
  width: 100%;
  overflow-x: auto;
  border-radius: 16px;
}

.wide-table-wrapper table {
  min-width: 960px;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: rgba(31, 41, 51, 0.06);
  font-size: 0.86rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.experiment-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.experiment-list article {
  padding: 20px;
  background: rgba(255, 250, 240, 0.86);
  border: 1px solid var(--line);
  border-radius: 18px;
}

details {
  margin-top: 14px;
}

summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 800;
}

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

.glossary {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 0;
  margin: 0;
}

.glossary dt,
.glossary dd {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.glossary dt {
  font-weight: 900;
}

.glossary dd {
  margin: 0;
  color: var(--muted);
}

.concept-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.concept-card {
  display: grid;
  gap: 12px;
  padding: 22px;
  background: rgba(255, 250, 240, 0.86);
  border: 1px solid var(--line);
  border-top: 6px solid var(--accent);
  border-radius: 18px;
}

.concept-card:nth-child(3n + 2) {
  border-top-color: var(--accent-2);
}

.concept-card:nth-child(3n) {
  border-top-color: var(--accent-3);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid rgba(31, 41, 51, 0.12);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tag.default {
  background: rgba(4, 120, 87, 0.12);
  border-color: rgba(4, 120, 87, 0.24);
  color: #065f46;
}

.tag.niche {
  background: rgba(37, 99, 235, 0.11);
  border-color: rgba(37, 99, 235, 0.22);
  color: #1d4ed8;
}

.tag.absorbed {
  background: rgba(154, 52, 18, 0.1);
  border-color: rgba(154, 52, 18, 0.22);
  color: #9a3412;
}

.tag.legacy {
  background: rgba(91, 102, 115, 0.1);
  border-color: rgba(91, 102, 115, 0.18);
  color: #4b5563;
}

.concept-card p:last-child {
  margin-bottom: 0;
}

@media (max-width: 980px) {
  .cards-3,
  .path-grid,
  .scenario-grid,
  .quick-map,
  .learning-path,
  .decision-map,
  .object-map,
  .three-columns,
  .experiment-list,
    .comparison-grid,
    .concept-grid {
    grid-template-columns: 1fr 1fr;
  }

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

  .system-sketch {
    grid-template-columns: 1fr;
  }

  .sketch-arrow {
    transform: rotate(90deg);
  }

  .behavior-rail {
    grid-column: auto;
    align-items: flex-start;
    flex-direction: column;
  }

  .behavior-rail strong {
    white-space: normal;
  }

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

  .choice-wheel::before,
  .choice-wheel::after {
    display: none;
  }

  .choice-center {
    grid-column: 1 / -1;
    min-height: 110px;
    border-radius: 22px;
  }

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

  .branch-map::before,
  .branch-root::after,
  .branch-card::before {
    display: none;
  }

  .decision-root {
    grid-column: auto;
  }

  .visual-layer {
    grid-template-columns: 48px 1fr;
  }

  .visual-layer > span:last-child {
    grid-column: 2;
  }

  .visual-stack-pyramid .visual-layer {
    width: 100%;
  }
}

@media (max-width: 680px) {
  .hero,
  main {
    width: min(100% - 20px, 1120px);
  }

  .intro-grid,
  .cards-2,
    .cards-3,
    .path-grid,
    .scenario-grid,
    .quick-map,
    .learning-path,
    .decision-map,
    .object-map,
    .choice-wheel,
    .branch-map,
    .two-column,
  .three-columns,
  .experiment-list,
    .comparison-grid,
    .concept-grid,
    .lab-card,
    .stack-layer,
    .glossary {
    grid-template-columns: 1fr;
  }

  .site-nav {
    margin-bottom: 34px;
  }

  .stack-layer {
    gap: 4px;
  }

  .timeline li {
    padding-left: 22px;
    padding-top: 70px;
  }

  .walk-step {
    grid-template-columns: 1fr;
  }

  th,
  td {
    padding: 12px;
  }

  table {
    display: block;
    overflow-x: auto;
    white-space: normal;
  }
}
