:root {
  --ink: #17201d;
  --muted: #67706b;
  --paper: #f4f0e6;
  --paper-strong: #fffdf7;
  --line: #d7d0c1;
  --dark: #17201d;
  --sand: #e3ad55;
  --sand-soft: #f1d18c;
  --water: #2f8e91;
  --water-soft: #b7ded7;
  --heat: #db6748;
  --violet: #6962a7;
  --green: #346f52;
  --shadow: 0 20px 55px rgba(50, 44, 33, 0.11);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--paper); }
button, a { font: inherit; }
a { color: inherit; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid var(--water); outline-offset: 3px; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 100; padding: .8rem 1rem; background: white; }
.skip-link:focus { top: 1rem; }

.site-header {
  min-height: 76px;
  padding: 0 clamp(1rem, 4vw, 4.5rem);
  display: flex;
  align-items: center;
  gap: 2rem;
  color: #f7f2e8;
  background: var(--dark);
  border-bottom: 1px solid #33403b;
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: .8rem; text-decoration: none; margin-right: auto; }
.brand strong { display: block; letter-spacing: -.025em; }
.brand small { color: #aeb7b2; display: block; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; margin-top: .15rem; }
.brand-mark { width: 34px; height: 34px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px; transform: rotate(45deg); }
.brand-mark i:nth-child(1) { background: var(--sand); }
.brand-mark i:nth-child(2) { background: var(--water); }
.brand-mark i:nth-child(3) { background: var(--heat); }
.brand-mark i:nth-child(4) { background: #ede5d3; }
nav { display: flex; align-items: stretch; align-self: stretch; }
nav a { position: relative; display: grid; place-items: center; padding: 0 1rem; color: #bdc4c0; text-decoration: none; font-size: .88rem; }
nav a:hover, nav a[aria-current="page"] { color: white; }
nav a[aria-current="page"]::after { content: ""; position: absolute; inset: auto 1rem 0; height: 3px; background: var(--sand); }
.build-chip { color: #b7c2bc; font-size: .72rem; white-space: nowrap; }
.build-chip span, .live-dot::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: .4rem; border-radius: 50%; background: #5fc786; box-shadow: 0 0 0 4px rgba(95,199,134,.12); }
.nav-toggle { display: none; }

main { min-height: calc(100vh - 150px); }
.view { max-width: 1480px; margin: 0 auto; padding: clamp(2rem, 5vw, 5.5rem) clamp(1rem, 5vw, 5rem); }
.view[hidden] { display: none; }
.eyebrow, .step-label, .metric-label { margin: 0 0 .8rem; color: var(--green); font: 700 .68rem/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .13em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 1.5rem; font-size: clamp(2.35rem, 5.4vw, 5.6rem); line-height: .98; letter-spacing: -.06em; }
h1 em { color: var(--heat); font-style: normal; }
.lede { max-width: 670px; color: #4b554f; font-size: clamp(1rem, 1.5vw, 1.25rem); line-height: 1.65; }
.button { display: inline-flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 48px; padding: .85rem 1.1rem; border: 1px solid var(--ink); text-decoration: none; font-size: .85rem; font-weight: 750; }
.button.primary { color: white; background: var(--ink); }
.button.primary:hover { background: #29342f; }
.button.secondary { background: transparent; }
.button.secondary:hover { background: var(--paper-strong); }
.text-button, .plain-link a, .evidence-details a, .source-grid a { color: #276a68; font-weight: 700; text-underline-offset: 3px; }
.status { display: inline-flex; align-items: center; gap: .35rem; width: max-content; padding: .35rem .55rem; border-radius: 2px; font: 750 .62rem/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .05em; text-transform: uppercase; }
.status.official { color: #225b42; background: #d4eadc; }
.status.community { color: #51468d; background: #e1ddf5; }
.status.provisional { color: #875326; background: #f2ddba; }
.status.changed { color: #913f2c; background: #f4d5cb; }
.status.cross { color: #24686a; background: #d0e9e7; }

.hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr); gap: clamp(2rem, 6vw, 7rem); align-items: center; min-height: 570px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin: 2rem 0 1.4rem; }
.plain-link { color: var(--muted); font-size: .78rem; }
.flow-console { color: #ecf0ed; background: #1e2925; border: 1px solid #3a4842; box-shadow: var(--shadow); }
.console-head, .console-foot { display: flex; justify-content: space-between; gap: 1rem; padding: 1rem 1.1rem; color: #aab4ae; font: 700 .63rem/1 ui-monospace, monospace; letter-spacing: .08em; text-transform: uppercase; border-bottom: 1px solid #3a4842; }
.console-foot { border: 0; border-top: 1px solid #3a4842; align-items: center; text-transform: none; }
.mini-flow { padding: clamp(1.2rem, 4vw, 3rem); }
.flow-node { padding: 1rem; border: 1px solid #48554f; background: #25322d; }
.flow-node small, .flow-node span { display: block; color: #9eaaa4; font-size: .65rem; }
.flow-node strong { display: block; margin: .3rem 0; font-size: 1.08rem; }
.flow-node.symptom { border-left: 4px solid var(--heat); }
.flow-node.transform { border-left: 4px solid var(--water); }
.flow-node.pattern { border-left: 4px solid var(--sand); }
.flow-line { position: relative; height: 58px; display: grid; place-items: center; color: #9ba59f; font-size: .65rem; }
.flow-line b { position: absolute; width: 1px; inset: 6px auto; background: #66736c; }
.flow-line b::after { content: ""; position: absolute; bottom: -1px; left: -3px; width: 7px; height: 7px; border-right: 1px solid #9ca8a2; border-bottom: 1px solid #9ca8a2; transform: rotate(45deg); }
.flow-line span { position: relative; padding: .2rem .5rem; background: #1e2925; }
.responsibility-strip { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: clamp(2rem, 4vw, 4rem); border: solid var(--line); border-width: 1px 0; }
.responsibility-strip a { padding: 1.2rem; text-decoration: none; border-right: 1px solid var(--line); }
.responsibility-strip a:last-child { border: 0; }
.responsibility-strip span { color: var(--heat); font: 700 .65rem ui-monospace, monospace; }
.responsibility-strip strong, .responsibility-strip small { display: block; }
.responsibility-strip strong { margin: .4rem 0; font-size: .9rem; }
.responsibility-strip small { color: var(--muted); }

.view-heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 3rem; border-bottom: 1px solid var(--line); }
.view-heading h1 { max-width: 970px; font-size: clamp(2.4rem, 4.6vw, 4.8rem); }
.heading-note { max-width: 370px; margin-bottom: 1.8rem; color: var(--muted); line-height: 1.6; }
.compact-heading h1 { font-size: clamp(2.2rem, 4vw, 4.1rem); }
.trust-summary { display: flex; gap: .6rem; align-items: center; margin-bottom: 1.5rem; color: var(--muted); font-size: .72rem; }
.diagnose-layout { display: grid; grid-template-columns: minmax(290px, .72fr) minmax(420px, 1.28fr); gap: 1.3rem; }
.symptom-panel, .diagnosis-card { padding: clamp(1rem, 3vw, 2rem); border: 1px solid var(--line); background: var(--paper-strong); }
.choice-list { display: grid; gap: .65rem; }
.diagnostic-choice { display: flex; width: 100%; align-items: center; gap: 1rem; padding: .95rem; text-align: left; color: var(--ink); border: 1px solid var(--line); background: transparent; cursor: pointer; }
.diagnostic-choice:hover, .diagnostic-choice.is-active { border-color: var(--ink); background: #f1ece0; }
.diagnostic-choice span:last-child { display: grid; gap: .25rem; }
.diagnostic-choice small { color: var(--muted); }
.choice-icon { flex: 0 0 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; font-weight: 900; }
.choice-icon.reaction { color: #814c27; background: #f2d6af; }
.choice-icon.layers { color: #23676a; background: #cde9e6; }
.choice-icon.block { color: #684b90; background: #e5ddf1; }
.evidence-details { margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; line-height: 1.55; }
.evidence-details summary { color: var(--ink); cursor: pointer; font-weight: 700; }
.diagnosis-card { box-shadow: var(--shadow); }
.diagnosis-head { display: flex; justify-content: space-between; align-items: start; gap: 1rem; }
.diagnosis-card h2 { max-width: 760px; margin: .5rem 0 1rem; font-size: clamp(1.75rem, 3vw, 3.1rem); line-height: 1.05; letter-spacing: -.04em; }
.diagnosis-lede { max-width: 760px; color: var(--muted); font-size: 1rem; line-height: 1.65; }
.cause-diagram { min-height: 120px; margin: 1.6rem 0; display: flex; align-items: center; justify-content: center; gap: 1rem; background: #ecf1ea; border: 1px dashed #bbc5bc; }
.cause-diagram .particle { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 3px; font: 900 .7rem ui-monospace, monospace; }
.particle.sand { background: var(--sand-soft); }
.particle.water { color: white; background: var(--water); border-radius: 50% 50% 48% 48%; }
.particle.wet { background: #9b7644; color: white; }
.cause-diagram em { color: var(--muted); font-size: .7rem; font-style: normal; }
.cause-diagram.cause-missed .particle, .cause-diagram.cause-blocked .particle { border-radius: 2px; }
.next-check { padding: 1.1rem; border-left: 4px solid var(--heat); background: #f6eadf; }
.next-check strong { display: block; margin-bottom: .55rem; }
.next-check p:last-child { color: #695c51; line-height: 1.55; margin: 0; }
.diagnosis-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-top: 1.2rem; }
.source-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1.3rem; margin-top: 1rem; padding: 1rem; color: var(--muted); border: 1px solid var(--line); font-size: .72rem; }
.source-bar strong { color: var(--ink); }

.pattern-layout { display: grid; grid-template-columns: minmax(480px, 1.25fr) minmax(320px, .75fr); gap: 1.2rem; }
.pattern-canvas { padding: clamp(1rem, 3vw, 2rem); color: white; background: #1c2824; min-height: 560px; }
.canvas-head { display: flex; justify-content: space-between; align-items: center; color: #b7c1bb; font: 700 .68rem ui-monospace, monospace; letter-spacing: .1em; }
.steam-schematic { position: relative; min-height: 380px; margin: 1.5rem 0; border: 1px solid #3a4942; background-image: linear-gradient(#28352f 1px, transparent 1px), linear-gradient(90deg,#28352f 1px,transparent 1px); background-size: 24px 24px; overflow: hidden; }
.machine { position: absolute; padding: .65rem; border: 1px solid #627067; background: #28352f; }
.machine strong, .machine small { display: block; }
.machine small { max-width: 130px; color: #aeb9b3; margin-top: .25rem; font-size: .65rem; }
.lava-bed { left: 10%; bottom: 12%; border-bottom: 5px solid var(--heat); }
.condensers { right: 8%; top: 12%; border-top: 5px solid var(--water); }
.snowmaker { right: 10%; bottom: 12%; }
.consumer { left: 38%; top: 12%; border-top: 5px solid var(--sand); }
.steam-column { position: absolute; left: 28%; bottom: 28%; height: 52%; width: 70px; border-left: 1px dashed #8dbab2; }
.steam-column span, .return-flow span { color: #a5b5ae; font: .62rem ui-monospace, monospace; }
.steam-column i { display: block; width: 13px; height: 13px; margin: 26px -7px; border-radius: 50%; background: #9cd6d1; opacity: .75; }
.return-flow { position: absolute; right: 28%; top: 30%; width: 34%; height: 48%; border-right: 1px dashed #66a6a7; border-bottom: 1px dashed #66a6a7; }
.return-flow span { position: absolute; right: -20px; top: 40%; transform: rotate(90deg); }
.canvas-caption { color: #b9c1bd; line-height: 1.6; font-size: .82rem; }
.variant-panel { padding: clamp(1rem, 3vw, 2rem); border: 1px solid var(--line); background: var(--paper-strong); }
.variant-tabs { display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: 1.6rem; }
.variant-tabs button { padding: .7rem .25rem; border: 0; border-bottom: 2px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; font-size: .75rem; }
.variant-tabs button[aria-selected="true"] { color: var(--ink); border-color: var(--heat); font-weight: 800; }
.variant-copy { display: grid; gap: .35rem; }
.variant-copy strong, .variant-copy span { margin-bottom: 1rem; line-height: 1.5; }
.variant-copy span { color: var(--muted); }
.evidence-callout { margin-top: 1rem; padding: 1rem; border: 1px solid #dfc79b; background: #f7eedc; }
.evidence-callout p { margin: .8rem 0; color: #685c48; line-height: 1.55; font-size: .82rem; }
.evidence-callout a { color: #7d4e27; font-weight: 750; }
.pattern-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1rem; }

.system-board { padding: clamp(1rem, 3vw, 2rem); background: var(--paper-strong); border: 1px solid var(--line); }
.system-legend { display: flex; gap: 1rem; justify-content: end; color: var(--muted); font-size: .68rem; }
.system-legend i { display: inline-block; width: 8px; height: 8px; margin-right: .35rem; }
.legend-official { background: var(--green); }
.legend-community { background: var(--violet); }
.state-map { position: relative; max-width: 920px; height: 480px; margin: 0 auto; }
.state-node, .process-node { position: absolute; z-index: 2; width: 210px; padding: 1rem; background: #fffefa; border: 1px solid var(--line); box-shadow: 0 8px 25px rgba(50,44,33,.07); }
.state-node small, .process-node small { display: block; color: var(--muted); font: 700 .58rem ui-monospace, monospace; letter-spacing: .08em; }
.state-node strong, .process-node strong { display: block; margin: .35rem 0; font-size: 1.05rem; }
.state-node span, .process-node span { color: var(--muted); font-size: .7rem; line-height: 1.4; }
.water-state { left: 5%; top: 8%; border-left: 5px solid var(--water); }
.heat-process { left: 43%; top: 8%; border-left: 5px solid var(--heat); }
.steam-state { right: 3%; bottom: 8%; border-left: 5px solid #7bb8b5; }
.return-process { left: 12%; bottom: 8%; border-left: 5px solid var(--violet); }
.map-lines { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-lines path { fill: none; stroke: #8c9892; stroke-width: 2; stroke-dasharray: 5 6; }
.system-insights { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; border-top: 1px solid var(--line); padding-top: 1.2rem; }
.system-insights article { display: flex; gap: .8rem; }
.system-insights article > span { color: var(--heat); font: 800 .7rem ui-monospace, monospace; }
.system-insights p { margin: .3rem 0 0; color: var(--muted); font-size: .78rem; line-height: 1.5; }
.source-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1rem; }
.source-grid article { padding: 1.1rem; border: 1px solid var(--line); background: var(--paper-strong); }
.source-grid h3 { margin: 1rem 0 .55rem; }
.source-grid p { min-height: 3.8em; color: var(--muted); font-size: .8rem; line-height: 1.55; }
.source-grid a { font-size: .78rem; }

.update-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.update-card { padding: clamp(1rem, 3vw, 2rem); border: 1px solid var(--line); background: var(--paper-strong); }
.current-update { border-top: 5px solid var(--heat); }
.provisional-update { border-top: 5px solid var(--sand); }
.update-meta { display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); font: 750 .63rem ui-monospace, monospace; letter-spacing: .08em; }
.update-card h2 { margin: 1.4rem 0 .8rem; font-size: clamp(1.5rem, 2.6vw, 2.4rem); line-height: 1.08; letter-spacing: -.035em; }
.update-card > p { color: var(--muted); line-height: 1.6; }
.impact-row { display: grid; grid-template-columns: 85px 1fr auto; gap: .8rem; align-items: center; padding: .9rem 0; border-top: 1px solid var(--line); font-size: .76rem; }
.impact-row > span { color: var(--muted); font: 700 .6rem ui-monospace, monospace; }
.impact-row p { margin: 0; }
.method-card { display: grid; grid-template-columns: .8fr 1.2fr; gap: 2rem; margin-top: 1rem; padding: clamp(1rem, 3vw, 2rem); color: white; background: var(--dark); }
.method-card h2 { font-size: clamp(1.5rem, 3vw, 2.8rem); }
.status-list { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.status-list p { display: flex; align-items: center; gap: .7rem; margin: 0; }
.status-list small { color: #bdc5c0; }
.unofficial-note { grid-column: 1 / -1; margin: 0; padding-top: 1rem; color: #aeb8b2; border-top: 1px solid #3e4c46; font-size: .75rem; line-height: 1.55; }

footer { display: flex; justify-content: space-between; gap: 1rem; padding: 1.4rem clamp(1rem, 5vw, 5rem); color: #abb4af; background: var(--dark); border-top: 1px solid #34413b; font-size: .67rem; }
footer p { margin: 0; }

@media (max-width: 980px) {
  .site-header { gap: 1rem; }
  .build-chip { display: none; }
  .hero-grid, .diagnose-layout, .pattern-layout { grid-template-columns: 1fr; }
  .hero-grid { min-height: 0; }
  .flow-console { max-width: 670px; }
  .responsibility-strip { grid-template-columns: 1fr 1fr; }
  .responsibility-strip a:nth-child(2) { border-right: 0; }
  .responsibility-strip a:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .pattern-canvas { min-height: auto; }
  .source-grid, .system-insights { grid-template-columns: 1fr; }
  .source-grid p { min-height: 0; }
  .update-layout { grid-template-columns: 1fr; }
  .method-card { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .site-header { min-height: 68px; }
  .brand small { display: none; }
  .nav-toggle { display: block; padding: .5rem .7rem; color: white; border: 1px solid #53615b; background: transparent; }
  nav { display: none; position: absolute; left: 0; right: 0; top: 68px; padding: .6rem 1rem 1rem; background: var(--dark); border-bottom: 1px solid #48564f; }
  nav.is-open { display: grid; grid-template-columns: 1fr 1fr; }
  nav a { min-height: 44px; justify-content: start; }
  nav a[aria-current="page"]::after { inset: auto .8rem 0; }
  .view { padding-top: 2.5rem; }
  .view-heading { display: block; }
  .heading-note, .trust-summary { margin-bottom: 1rem; }
  .hero-actions { display: grid; }
  .responsibility-strip { grid-template-columns: 1fr; }
  .responsibility-strip a { border-right: 0; border-bottom: 1px solid var(--line); }
  .diagnosis-head, .console-foot { align-items: start; flex-direction: column; }
  .cause-diagram { gap: .5rem; }
  .cause-diagram .particle { width: 40px; height: 40px; }
  .pattern-canvas { padding: 1rem; }
  .steam-schematic { min-height: 420px; }
  .consumer { left: 50%; transform: translateX(-50%); }
  .state-map { height: auto; display: grid; gap: .8rem; margin: 1.5rem 0; }
  .state-node, .process-node { position: relative; inset: auto; width: 100%; }
  .map-lines { display: none; }
  .system-legend { justify-content: start; flex-wrap: wrap; }
  .impact-row { grid-template-columns: 75px 1fr; }
  .impact-row strong { grid-column: 2; }
  .status-list { grid-template-columns: 1fr; }
  footer { display: grid; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

