:root {
  --bg: #e7ece9;
  --surface: #f4f6f3;
  --ink: #15231f;
  --muted: #50605a;
  --line: rgba(21, 35, 31, .22);
  --accent: #bd4f32;
  --accent-2: #2f6558;
  --on-accent: #fff9f3;
  --route: #bd4f32;
  --page-x: clamp(1.25rem, 4vw, 4.5rem);
  --max: 92rem;
  --header-h: 4.5rem;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-standard: cubic-bezier(.2, 0, 0, 1);
  --font-display: "IBM Plex Sans Condensed", "Avenir Next Condensed", "DIN Condensed", sans-serif;
  --font-body: "IBM Plex Sans", "Avenir Next", "Century Gothic", sans-serif;
  --font-mono: "IBM Plex Mono", "Cascadia Code", "SFMono-Regular", monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }
body {
  margin: 0;
  min-width: 320px;
  overflow-x: clip;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  transition: background-color .7s var(--ease-out), color .7s var(--ease-out);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: .15;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.88' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}
body.is-dialog-open { overflow: hidden; }

::selection { background: var(--accent); color: var(--on-accent); }
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }

.skip-link {
  position: fixed;
  top: .75rem;
  left: .75rem;
  z-index: 1000;
  padding: .75rem 1rem;
  background: var(--ink);
  color: var(--surface);
  transform: translateY(-160%);
  transition: transform .2s var(--ease-out);
}
.skip-link:focus { transform: translateY(0); }

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

.site-header {
  position: fixed;
  z-index: 100;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 0 var(--page-x);
  color: var(--ink);
  transition: background-color .35s var(--ease-out), border-color .35s var(--ease-out), transform .35s var(--ease-out), color .7s var(--ease-out);
}
.site-header.is-scrolled {
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px) saturate(130%);
}
.identity-mark {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  min-width: 3.5rem;
  min-height: 2.75rem;
  color: inherit;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-decoration: none;
}
.identity-mark i {
  width: .65rem;
  height: .65rem;
  border: 2px solid currentColor;
  border-radius: 50%;
  transition: background .25s var(--ease-out), transform .25s var(--ease-out);
}
.identity-mark:hover i { background: var(--accent); transform: rotate(45deg) scale(.82); }
.site-nav { display: flex; align-items: center; gap: clamp(1rem, 2.4vw, 2.5rem); margin-left: auto; }
.site-nav a, .header-contact {
  position: relative;
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  color: inherit;
  font-family: var(--font-mono);
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-decoration: none;
  text-transform: uppercase;
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: .5rem;
  height: 2px;
  background: var(--accent);
  transition: right .35s var(--ease-out);
}
.site-nav a:hover::after, .site-nav a:focus-visible::after { right: 0; }
.header-contact {
  justify-content: center;
  min-width: 4.8rem;
  border: 1px solid currentColor;
  border-radius: 999px;
}

.route-layer {
  position: fixed;
  z-index: 6;
  top: 0;
  left: clamp(1.05rem, 3vw, 3rem);
  width: 1rem;
  height: 100vh;
  pointer-events: none;
  overflow: visible;
}
.route-layer path { fill: none; vector-effect: non-scaling-stroke; }
.route-shadow { stroke: var(--line); stroke-width: 1.3; }
.route-progress { stroke: var(--route); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke .7s var(--ease-out); }

.trace-nav {
  position: fixed;
  z-index: 55;
  right: 1.15rem;
  top: 50%;
  width: 3.25rem;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  color: var(--ink);
  transition: color .7s var(--ease-out);
}
.trace-nav__label {
  margin-bottom: .9rem;
  font-family: var(--font-mono);
  font-size: .58rem;
  letter-spacing: .18em;
  writing-mode: vertical-rl;
}
.trace-nav a {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 3rem;
  min-height: 2.5rem;
  color: inherit;
  text-decoration: none;
}
.trace-nav a b { font-family: var(--font-mono); font-size: .68rem; font-weight: 500; }
.trace-nav a span {
  position: absolute;
  right: 2.4rem;
  white-space: nowrap;
  padding: .35rem .55rem;
  background: var(--ink);
  color: var(--surface);
  font-family: var(--font-mono);
  font-size: .66rem;
  letter-spacing: .05em;
  opacity: 0;
  transform: translateX(.5rem);
  pointer-events: none;
  transition: opacity .2s ease, transform .3s var(--ease-out), background .7s var(--ease-out), color .7s var(--ease-out);
}
.trace-nav a:hover span, .trace-nav a:focus-visible span { opacity: 1; transform: translateX(0); }
.trace-nav a::after {
  content: "";
  position: absolute;
  right: -.2rem;
  width: .45rem;
  height: .45rem;
  border: 1px solid currentColor;
  border-radius: 50%;
  transform: scale(.55);
  transition: transform .35s var(--ease-out), background .35s var(--ease-out);
}
.trace-nav a.is-active::after { background: var(--accent); transform: scale(1); }

.hero {
  position: relative;
  overflow: clip;
  min-height: 100svh;
  display: flex;
  align-items: center;
  gap: clamp(2rem, 5vw, 7rem);
  padding: calc(var(--header-h) + 3rem) max(var(--page-x), 6vw) 5rem;
  background: var(--bg);
}
.hero::before {
  content: "";
  position: absolute;
  top: 17%;
  left: 0;
  width: clamp(1rem, 3vw, 3rem);
  height: 42%;
  background: var(--accent);
  transform-origin: top;
  animation: hero-rule .8s var(--ease-out) .12s both;
}
.hero__copy { position: relative; z-index: 2; flex: 0 1 52rem; max-width: 52rem; }
.eyebrow, .section-code, .chapter__index {
  margin: 0 0 1.4rem;
  font-family: var(--font-mono);
  font-size: clamp(.67rem, .8vw, .79rem);
  font-weight: 600;
  letter-spacing: .13em;
  line-height: 1.4;
  text-transform: uppercase;
}
.eyebrow span { display: block; margin-top: .55rem; color: var(--muted); font-weight: 500; }
.hero h1 {
  margin: 0;
  max-width: 13ch;
  font-family: var(--font-display);
  font-size: clamp(4.2rem, 9vw, 9.3rem);
  font-weight: 600;
  letter-spacing: -.055em;
  line-height: .82;
  text-wrap: balance;
}
.hero h1 em { color: var(--accent); font-style: normal; }
.hero__lead {
  max-width: 37rem;
  margin: clamp(2rem, 4vw, 3.7rem) 0 0;
  font-size: clamp(1.2rem, 2vw, 1.65rem);
  line-height: 1.35;
  text-wrap: pretty;
}
.hero__grounding { max-width: 37rem; margin: 1.1rem 0 0; color: var(--muted); font-size: .98rem; }
.hero__actions, .chapter__actions, .contact__actions { display: flex; align-items: center; flex-wrap: wrap; gap: 1.15rem; margin-top: 2.2rem; }
.primary-action, .machine-button {
  position: relative;
  min-height: 3.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  padding: .85rem 1.25rem;
  border: 0;
  background: var(--ink);
  color: var(--surface);
  font-family: var(--font-mono);
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color .25s var(--ease-out), color .25s var(--ease-out), transform .25s var(--ease-out), box-shadow .25s var(--ease-out);
}
.primary-action::before, .machine-button::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid currentColor;
  opacity: .18;
  transform: translate(5px, 5px);
  transition: transform .25s var(--ease-out);
}
.primary-action:hover::before, .machine-button:hover::before { transform: translate(2px, 2px); }
.primary-action svg { width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 1.7; }
.text-action {
  min-height: 3rem;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: inherit;
  font-family: var(--font-mono);
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
}

.hero__machine { position: relative; flex: 0 1 42rem; min-width: min(39vw, 36rem); transform-style: preserve-3d; perspective: 1200px; }
.machine-plate {
  position: relative;
  aspect-ratio: 1;
  padding: clamp(1.1rem, 2vw, 1.8rem);
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: color-mix(in srgb, var(--surface) 76%, transparent);
  box-shadow: 0 2rem 6rem rgba(20, 39, 33, .12);
  transition: transform .45s var(--ease-out), box-shadow .45s var(--ease-out);
}
.machine-plate::before, .machine-plate::after {
  content: "";
  position: absolute;
  inset: 7%;
  border: 1px dashed var(--line);
  border-radius: 50%;
  pointer-events: none;
}
.machine-plate::after { inset: 2.8%; border-style: solid; opacity: .5; }
.machine-plate__serial {
  position: absolute;
  z-index: 2;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: .62rem;
  letter-spacing: .16em;
  white-space: nowrap;
}
.loop-machine { width: 100%; height: 100%; overflow: visible; }
.loop-track { fill: none; vector-effect: non-scaling-stroke; }
.loop-track--shadow { stroke: var(--line); stroke-width: 2; }
.loop-track--draw { stroke: var(--accent); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: draw-loop 1.6s var(--ease-out) .25s forwards; }
.loop-node circle { fill: var(--surface); stroke: var(--ink); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.loop-node text { fill: var(--ink); font-family: var(--font-mono); font-size: 12px; font-weight: 600; text-anchor: middle; }
.loop-node { opacity: 0; transform-box: fill-box; transform-origin: center; animation: node-settle .65s var(--ease-out) forwards; }
.loop-node:nth-of-type(3) { animation-delay: .32s; }
.loop-node:nth-of-type(4) { animation-delay: .39s; }
.loop-node:nth-of-type(5) { animation-delay: .46s; }
.loop-node:nth-of-type(6) { animation-delay: .53s; }
.loop-node:nth-of-type(7) { animation-delay: .6s; }
.loop-core circle { fill: color-mix(in srgb, var(--surface) 75%, var(--accent) 25%); stroke: var(--ink); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.loop-core circle:nth-child(2) { fill: var(--ink); }
.loop-core path { fill: none; stroke: var(--surface); stroke-width: 1.2; opacity: .38; }
.loop-core text { fill: var(--surface); font-family: var(--font-mono); font-size: 18px; font-weight: 600; text-anchor: middle; }
.loop-core text:last-child { font-size: 11px; letter-spacing: .08em; }
.loop-packet { fill: var(--accent); stroke: var(--surface); stroke-width: 3; }
.machine-readout {
  position: absolute;
  left: 13%;
  right: 13%;
  bottom: 9%;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: .55rem;
  letter-spacing: .07em;
}
.machine-readout span { display: inline-flex; align-items: center; gap: .45rem; }
.machine-readout i { width: .5rem; height: .5rem; border-radius: 50%; background: var(--accent-2); }
.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .45rem;
  color: inherit;
  font-family: var(--font-mono);
  font-size: .58rem;
  letter-spacing: .16em;
  text-decoration: none;
  transform: translateX(-50%);
}
.scroll-cue i { width: 1px; height: 2.4rem; background: var(--ink); transform-origin: top; animation: scroll-line 2s var(--ease-standard) infinite; }

.pattern {
  min-height: 90svh;
  display: flex;
  align-items: center;
  gap: clamp(3rem, 8vw, 10rem);
  padding: 8rem max(var(--page-x), 9vw);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.pattern__statement { flex: 1 1 42rem; }
.pattern h2, .method h2, .range h2, .about h2, .contact h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(3.3rem, 7vw, 7.6rem);
  font-weight: 600;
  letter-spacing: -.045em;
  line-height: .93;
  text-wrap: balance;
}
.pattern__stack { flex: 0 1 45rem; width: 100%; border-top: 1px solid var(--ink); }
.stack-line {
  width: 100%;
  min-height: 6.3rem;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1rem 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: padding .35s var(--ease-out), background-color .35s var(--ease-out);
}
.stack-line span { width: 2rem; font-family: var(--font-mono); font-size: .68rem; }
.stack-line b { width: 7.4rem; font-family: var(--font-display); font-size: 1.45rem; }
.stack-line i { flex: 1; color: var(--muted); font-style: normal; }
.stack-line::after { content: "+"; margin-left: auto; font-family: var(--font-mono); font-size: 1rem; transition: transform .35s var(--ease-out); }
.stack-line:hover, .stack-line[aria-pressed="true"] { padding-left: 1rem; padding-right: 1rem; background: color-mix(in srgb, var(--accent) 10%, transparent); }
.stack-line[aria-pressed="true"]::after { transform: rotate(45deg); }

.chapters { position: relative; }
.chapter {
  position: relative;
  min-height: 110svh;
  display: flex;
  align-items: center;
  gap: clamp(3rem, 7vw, 9rem);
  padding: 8rem max(var(--page-x), 8vw);
  overflow: clip;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
}
.chapter:nth-child(even) { flex-direction: row-reverse; }
.chapter__copy { position: relative; z-index: 3; flex: 0 1 36rem; }
.chapter__index { display: flex; align-items: center; gap: .8rem; }
.chapter__index span {
  width: 2.15rem;
  height: 2.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  color: var(--accent);
}
.chapter h2 {
  margin: 0;
  max-width: 11ch;
  font-family: var(--font-display);
  font-size: clamp(3.3rem, 6.2vw, 7rem);
  font-weight: 600;
  letter-spacing: -.048em;
  line-height: .9;
  text-wrap: balance;
}
.chapter__lead { max-width: 35rem; margin: 2rem 0 0; font-size: clamp(1.08rem, 1.6vw, 1.34rem); line-height: 1.45; text-wrap: pretty; }
.chapter__proof { display: flex; flex-wrap: wrap; gap: .5rem .7rem; margin-top: 1.65rem; }
.chapter__proof span {
  padding: .35rem .6rem;
  border: 1px solid currentColor;
  font-family: var(--font-mono);
  font-size: .64rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.private-label { font-family: var(--font-mono); font-size: .65rem; letter-spacing: .08em; }
.visual-stage { position: relative; z-index: 2; flex: 1 1 52rem; min-width: 0; margin: 0; transform-style: preserve-3d; perspective: 1400px; }
.visual-stage figcaption, .switchboard__header, .map-topline, .spine-machine__topline, .memory-machine__header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: .61rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.chapter--cairn { --accent: #315f8c; --accent-2: #bd4f32; }
.cairn-map {
  padding: 1rem;
  border: 1px solid var(--ink);
  background: #dce7ee;
  box-shadow: .9rem .9rem 0 rgba(32, 52, 67, .12);
  transition: transform .45s var(--ease-out), box-shadow .45s var(--ease-out);
}
.cairn-map figcaption { padding: .35rem .35rem 1rem; border-bottom: 1px solid rgba(20, 38, 50, .22); }
.cairn-map svg { width: 100%; height: auto; }
.graph-edges path { fill: none; stroke: rgba(26, 56, 78, .33); stroke-width: 2; stroke-dasharray: 8 10; vector-effect: non-scaling-stroke; }
.is-active .graph-edges path { animation: graph-drift 14s linear infinite; }
.graph-node { cursor: pointer; transition: transform .35s var(--ease-out), filter .35s var(--ease-out); }
.graph-node circle, .graph-node rect { fill: #eef3f5; stroke: #20394b; stroke-width: 2; vector-effect: non-scaling-stroke; transition: fill .3s var(--ease-out), stroke .3s var(--ease-out); }
.graph-node text { fill: #20394b; font-family: var(--font-mono); font-size: 15px; font-weight: 600; text-anchor: middle; pointer-events: none; }
.graph-node text:first-of-type { font-size: 10px; letter-spacing: .1em; opacity: .7; }
.graph-node--system circle { fill: #c9dce8; }
.graph-node--focus circle { fill: #bd4f32; stroke: #bd4f32; }
.graph-node--focus text { fill: #fff8f2; }
.graph-node--note rect { fill: #f1dfc8; }
.graph-node:hover circle, .graph-node:focus-visible circle, .graph-node:hover rect, .graph-node:focus-visible rect { fill: #fff; stroke: #bd4f32; }
.cairn-evidence {
  position: relative;
  right: auto;
  bottom: auto;
  width: 100%;
  min-height: 7.5rem;
  display: flex;
  align-items: flex-start;
  gap: clamp(1rem, 2.4vw, 2.4rem);
  padding: 1.2rem;
  background: #172b38;
  color: #f4f8f8;
}
.cairn-evidence span {
  flex: 0 0 8.5rem;
  font-family: var(--font-mono);
  font-size: .6rem;
  letter-spacing: .08em;
}
.cairn-evidence b {
  flex: 0 0 min(18rem, 35%);
  display: block;
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  line-height: 1.05;
}
.cairn-evidence p {
  flex: 1;
  margin: 0;
  color: #c8d6dc;
  font-size: .82rem;
}

.chapter--openspine { --bg: #10251f; --surface: #eaf1ed; --ink: #edf4ef; --muted: #adc1b7; --line: rgba(237,244,239,.2); --accent: #d4a93d; --accent-2: #e26f48; color-scheme: dark; }
.spine-machine { padding: clamp(1rem, 2vw, 1.8rem); border: 1px solid rgba(237,244,239,.55); background: #0b1c17; box-shadow: 1rem 1rem 0 rgba(0,0,0,.18); }
.spine-machine__topline { padding-bottom: 1rem; border-bottom: 1px solid rgba(237,244,239,.18); }
.pipeline { position: relative; min-height: 31rem; display: flex; align-items: center; justify-content: space-between; gap: .7rem; padding: 5rem 0 3rem; }
.pipeline__rail { position: absolute; left: 5%; right: 5%; top: 50%; height: 2px; background: rgba(237,244,239,.2); }
.pipeline__token {
  position: absolute;
  z-index: 6;
  left: 4%;
  top: calc(50% - 1.85rem);
  width: 3.7rem;
  height: 3.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #d4a93d;
  border-radius: 50%;
  background: #10251f;
  box-shadow: 0 0 0 .45rem #0b1c17;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: .54rem;
  font-weight: 600;
  letter-spacing: .07em;
}
.pipeline__stage {
  position: relative;
  z-index: 3;
  flex: 1;
  min-width: 0;
  padding: 1.2rem .6rem;
  border-top: 1px solid rgba(237,244,239,.25);
  border-bottom: 1px solid rgba(237,244,239,.25);
  background: #0b1c17;
  text-align: center;
  transition: background .25s var(--ease-out), color .25s var(--ease-out), transform .35s var(--ease-out);
}
.pipeline__stage span { display: block; margin-bottom: .4rem; color: #d4a93d; font-family: var(--font-mono); font-size: .55rem; }
.pipeline__stage b { display: block; font-family: var(--font-display); font-size: clamp(.95rem, 1.5vw, 1.35rem); letter-spacing: .02em; }
.pipeline__stage i { display: block; margin-top: .35rem; color: #adc1b7; font-size: .67rem; font-style: normal; }
.pipeline__stage.is-active { background: #d4a93d; color: #10251f; transform: translateY(-.75rem); }
.pipeline__stage.is-active span, .pipeline__stage.is-active i { color: #10251f; }
.pipeline__stage--gate::before, .pipeline__stage--gate::after { content: ""; position: absolute; top: -2.3rem; bottom: -2.3rem; width: 2px; background: #e26f48; transition: transform .4s var(--ease-out); }
.pipeline__stage--gate::before { left: 15%; transform-origin: top; }
.pipeline__stage--gate::after { right: 15%; transform-origin: top; }
.pipeline__stage--gate.is-active::before { transform: rotate(-18deg); }
.pipeline__stage--gate.is-active::after { transform: rotate(18deg); }
.spine-machine__controls { display: flex; align-items: center; gap: 1.5rem; padding-top: 1rem; border-top: 1px solid rgba(237,244,239,.18); }
.spine-machine__controls .machine-button { flex: 0 0 auto; background: #d4a93d; color: #10251f; }
.spine-machine__controls p { margin: 0; color: #adc1b7; font-size: .8rem; }
.spine-machine__controls p b { color: #edf4ef; }

.chapter--mag { --accent: #2f6558; --accent-2: #7f4d90; }
.memory-machine { padding: clamp(1rem, 2vw, 1.8rem); border: 1px solid var(--ink); background: #dbe5df; box-shadow: -1rem 1rem 0 rgba(32,60,50,.11); }
.memory-machine__header { align-items: center; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.tool-switch { display: flex; gap: .35rem; }
.tool-switch button { min-height: 2.75rem; padding: .4rem .65rem; border: 1px solid var(--ink); background: transparent; font-family: var(--font-mono); font-size: .57rem; cursor: pointer; transition: background .25s var(--ease-out), color .25s var(--ease-out); }
.tool-switch button.is-selected { background: var(--ink); color: var(--surface); }
.memory-query { margin-top: 1.2rem; padding: clamp(1.1rem, 2.4vw, 2rem); background: #f2f5f2; }
.memory-query > span, .memory-result > span { font-family: var(--font-mono); font-size: .61rem; letter-spacing: .08em; }
.memory-query p { min-height: 4.4rem; margin: 1rem 0 .7rem; font-family: var(--font-display); font-size: clamp(1.5rem, 3vw, 2.4rem); font-weight: 600; line-height: 1.1; }
.query-swap { min-height: 2.75rem; padding: .35rem 0; border: 0; border-bottom: 1px solid var(--ink); background: transparent; font-family: var(--font-mono); font-size: .65rem; cursor: pointer; }
.retrieval-paths { position: relative; display: flex; gap: .7rem; padding: 2.2rem 0; }
.retrieval-paths::before { content: ""; position: absolute; top: 50%; left: 4%; right: 4%; height: 1px; background: var(--line); }
.retrieval-paths > div { position: relative; flex: 1; padding: 1rem; border: 1px solid var(--ink); background: #dbe5df; transition: background .3s var(--ease-out), color .3s var(--ease-out), transform .35s var(--ease-out); }
.retrieval-paths span { display: block; font-family: var(--font-mono); font-size: .55rem; }
.retrieval-paths b { display: block; margin-top: .5rem; font-family: var(--font-display); font-size: 1.1rem; }
.retrieval-paths i { color: var(--muted); font-size: .7rem; font-style: normal; }
.retrieval-paths > div.is-active { background: var(--accent); color: #f7fbf8; transform: translateY(-.65rem); }
.retrieval-paths > div.is-active i { color: #e2eee7; }
.memory-result { padding: clamp(1.1rem, 2.4vw, 2rem); background: var(--ink); color: var(--surface); }
.memory-result blockquote { margin: .8rem 0; font-family: var(--font-display); font-size: clamp(1.45rem, 2.5vw, 2rem); line-height: 1.15; }
.memory-result small { color: color-mix(in srgb, var(--surface) 68%, transparent); }

.chapter--skillkeep { --bg: #e9ddd1; --surface: #fffaf4; --ink: #2d201a; --muted: #6e5a4e; --line: rgba(45,32,26,.22); --accent: #b34d2f; --accent-2: #315f8c; }
.skill-switchboard { min-height: min(48rem, 75vw); border: 1px solid var(--ink); background: #f5e9dc; box-shadow: 1rem 1rem 0 rgba(70,43,30,.12); overflow: hidden; }
.switchboard__header { padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); }
.registry-core {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 50%;
  width: clamp(9rem, 17vw, 14rem);
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: #b34d2f;
  color: #fffaf4;
  transform: translate(-50%, -50%);
}
.registry-core span, .registry-core i { font-family: var(--font-mono); font-size: .57rem; font-style: normal; letter-spacing: .08em; }
.registry-core b { margin: .45rem 0; font-family: var(--font-display); font-size: clamp(1.25rem, 2.4vw, 2rem); }
.client-ring { position: absolute; inset: 4rem 1.5rem 3.5rem; }
.client-ring::before { content: ""; position: absolute; inset: 10%; border: 1px dashed var(--line); border-radius: 50%; }
.client-node { position: absolute; width: clamp(8.8rem, 16vw, 12rem); min-height: 5.5rem; padding: .9rem; border: 1px solid var(--ink); background: #fffaf4; text-align: left; cursor: pointer; transition: background .3s var(--ease-out), color .3s var(--ease-out), transform .35s var(--ease-out); }
.client-node b { display: block; font-family: var(--font-display); font-size: 1.25rem; }
.client-node span { display: block; margin-top: .3rem; color: var(--muted); font-family: var(--font-mono); font-size: .55rem; }
.client-node[aria-pressed="true"] { background: #315f8c; color: #fff; transform: scale(1.05); }
.client-node[aria-pressed="true"] span { color: #dbe8ef; }
.client-node--claude { left: 3%; top: 8%; }
.client-node--codex { right: 3%; top: 8%; }
.client-node--gemini { left: 3%; bottom: 8%; }
.client-node--omp { right: 3%; bottom: 8%; }
.skill-puck { position: absolute; z-index: 8; left: 50%; top: 50%; width: 5.5rem; height: 2.2rem; display: flex; align-items: center; justify-content: center; border: 1px solid var(--ink); background: #fffaf4; box-shadow: .3rem .3rem 0 rgba(45,32,26,.18); transform: translate(-50%, -50%); transition: left .7s var(--ease-out), top .7s var(--ease-out), transform .35s var(--ease-out); }
.skill-puck span { font-family: var(--font-mono); font-size: .58rem; font-weight: 600; }
.switchboard__hint { position: absolute; left: 1.2rem; right: 1.2rem; bottom: .8rem; margin: 0; font-family: var(--font-mono); font-size: .61rem; text-align: center; }

.chapter--holocron { --bg: #0e2230; --surface: #e9f2f5; --ink: #e8f1f4; --muted: #a9c0c9; --line: rgba(232,241,244,.2); --accent: #e2a93d; --accent-2: #55b7a3; color-scheme: dark; }
.holocron-map { border: 1px solid rgba(232,241,244,.54); background: #081924; box-shadow: -1rem 1rem 0 rgba(0,0,0,.2); overflow: hidden; }
.map-topline { padding: 1rem 1.2rem; border-bottom: 1px solid rgba(232,241,244,.16); }
.holocron-map svg { width: 100%; height: auto; }
.map-grid path { fill: none; stroke: rgba(151,194,207,.11); stroke-width: 1; vector-effect: non-scaling-stroke; }
.coastline { fill: #133441; stroke: #3c7080; stroke-width: 2; vector-effect: non-scaling-stroke; }
.satellite rect, .satellite path { fill: none; stroke: #e2a93d; stroke-width: 2; vector-effect: non-scaling-stroke; }
.signal-arc { fill: none; stroke: rgba(226,169,61,.52); stroke-width: 2; stroke-dasharray: 7 8; vector-effect: non-scaling-stroke; }
.signal-arc--2 { opacity: .65; }
.vessel path { fill: #e8f1f4; stroke: #55b7a3; stroke-width: 3; vector-effect: non-scaling-stroke; }
.vessel text { fill: #e8f1f4; font-family: var(--font-mono); font-size: 13px; text-anchor: middle; }
.operations-hub circle { fill: #e2a93d; stroke: #081924; stroke-width: 3; vector-effect: non-scaling-stroke; }
.operations-hub circle:nth-child(2) { fill: #0e2230; }
.operations-hub text { fill: #e8f1f4; font-family: var(--font-mono); font-size: 14px; font-weight: 600; text-anchor: middle; }
.telemetry { fill: none; stroke: #55b7a3; stroke-width: 2.4; stroke-dasharray: 8 8; vector-effect: non-scaling-stroke; transition: opacity .35s var(--ease-out); }
.holocron-map.is-link-down .telemetry--b { opacity: .15; }
.packet circle { fill: #e2a93d; stroke: #081924; stroke-width: 2; }
.packet--a { offset-path: path("M610 310 C530 260 405 210 345 190"); animation: packet-flow 4.3s linear infinite; }
.packet--b { offset-path: path("M440 405 C360 350 312 270 300 234"); animation: packet-flow 3.8s linear infinite; }
.packet--c { offset-path: path("M705 490 C575 440 420 315 325 220"); animation: packet-flow 5.2s linear infinite; }
.holocron-map.is-link-down .packet--b { animation-play-state: paused; opacity: 0; }
.link-control { display: flex; align-items: center; gap: 1.4rem; padding: 1rem 1.2rem; border-top: 1px solid rgba(232,241,244,.16); }
.link-control > div { flex: 1; }
.link-control span { display: block; font-family: var(--font-mono); font-size: .54rem; letter-spacing: .08em; }
.link-control b { display: block; margin-top: .25rem; color: #55b7a3; font-family: var(--font-display); font-size: 1.1rem; }
.holocron-map.is-link-down [data-link-label] { color: #e26f48; }
.link-control .machine-button { min-height: 2.8rem; background: #e2a93d; color: #0e2230; }

.chapter--yarnling { --bg: #dde4e1; --surface: #f7f5ef; --ink: #30251f; --muted: #685c55; --line: rgba(48,37,31,.22); --accent: #a64132; --accent-2: #3f6875; }
.yarnling-stage { min-height: 45rem; border: 1px solid var(--ink); background: #cad8d3; box-shadow: 1rem 1rem 0 rgba(45,55,50,.12); overflow: hidden; }
.yarnling-stage figcaption { position: relative; z-index: 5; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); }
.phone-shell { position: absolute; z-index: 4; top: 5.5rem; left: 50%; width: min(18.8rem, 46%); padding: .72rem; border: 2px solid #30251f; border-radius: 2.4rem; background: #30251f; box-shadow: 0 2rem 4rem rgba(48,37,31,.2); transform: translateX(-50%) rotate(2deg); transition: transform .55s var(--ease-out); }
.yarnling-stage:hover .phone-shell { transform: translateX(-50%) rotate(0deg) translateY(-.35rem); }
.phone-shell img { width: 100%; border-radius: 1.7rem; }
.phone-speaker { width: 4.3rem; height: .33rem; margin: .1rem auto .65rem; border-radius: 999px; background: #86766b; }
.yarn-path { position: absolute; inset: 3.5rem 0 4.5rem; }
.yarn-path svg { width: 100%; height: 100%; }
.yarn-path path { fill: none; stroke: #a64132; stroke-width: 8; stroke-linecap: round; stroke-dasharray: 12 10; vector-effect: non-scaling-stroke; }
.is-active .yarn-path path { animation: yarn-move 12s linear infinite; }
.yarn-knot { position: absolute; width: 1.4rem; height: 1.4rem; border: 4px solid #a64132; border-radius: 50%; background: #cad8d3; }
.yarn-knot--one { left: 8%; top: 17%; }
.yarn-knot--two { right: 8%; top: 22%; }
.yarn-knot--three { left: 13%; bottom: 7%; }
.story-loop { position: absolute; z-index: 5; left: 1.2rem; right: 1.2rem; bottom: 1.2rem; display: flex; align-items: center; justify-content: center; gap: .7rem; padding: .8rem; background: #30251f; color: #f7f5ef; font-family: var(--font-mono); font-size: .58rem; letter-spacing: .07em; }
.story-loop i { width: 2rem; height: 1px; background: #f7f5ef; opacity: .45; }

.method {
  min-height: 110svh;
  display: flex;
  align-items: flex-start;
  gap: clamp(4rem, 10vw, 12rem);
  padding: 10rem max(var(--page-x), 9vw);
  background: var(--bg);
}
.method__heading { position: sticky; top: 8rem; flex: 0 1 43rem; }
.method__heading h2 { max-width: 10ch; }
.method__heading > p:last-child { max-width: 37rem; margin: 2rem 0 0; color: var(--muted); font-size: 1.15rem; }
.method-path { flex: 0 1 42rem; margin: 3rem 0 0; padding: 0; list-style: none; }
.method-path li { position: relative; min-height: 11rem; display: flex; gap: 1.3rem; padding: 0 0 4rem; }
.method-path li:not(:last-child)::before { content: ""; position: absolute; left: 1.15rem; top: 2.7rem; bottom: 0; width: 1px; background: var(--line); }
.method-path li > span { position: relative; z-index: 2; flex: 0 0 2.35rem; height: 2.35rem; display: flex; align-items: center; justify-content: center; border: 1px solid var(--ink); border-radius: 50%; background: var(--bg); color: var(--accent); font-family: var(--font-mono); font-size: .64rem; transition: background .35s var(--ease-out), color .35s var(--ease-out), transform .35s var(--ease-out); }
.method-path li.is-visible > span { background: var(--accent); color: var(--on-accent); transform: scale(1.12); }
.method-path b { display: block; font-family: var(--font-display); font-size: clamp(1.9rem, 3vw, 2.8rem); line-height: 1; }
.method-path p { max-width: 29rem; margin: .75rem 0 0; color: var(--muted); }

.range {
  position: relative;
  min-height: 100svh;
  padding: 8rem 0 7rem max(var(--page-x), 8vw);
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.range__intro { max-width: 46rem; padding-right: var(--page-x); }
.range__intro h2 { max-width: 12ch; }
.range__intro > p:last-of-type { max-width: 38rem; margin: 1.7rem 0 0; color: var(--muted); font-size: 1.05rem; }
.range__controls { display: flex; gap: .6rem; margin-top: 2rem; }
.carousel-button { width: 3.2rem; height: 3.2rem; border: 1px solid var(--ink); border-radius: 50%; background: transparent; cursor: pointer; transition: background .25s var(--ease-out), color .25s var(--ease-out); }
.carousel-button:hover { background: var(--ink); color: var(--surface); }
.side-paths { display: flex; gap: 1rem; margin-top: 4.5rem; padding: .6rem var(--page-x) 2rem 0; overflow-x: auto; overscroll-behavior-inline: contain; scroll-snap-type: x mandatory; scrollbar-width: none; cursor: grab; }
.side-paths::-webkit-scrollbar { display: none; }
.side-paths.is-dragging { cursor: grabbing; scroll-snap-type: none; user-select: none; }
.side-path {
  position: relative;
  flex: 0 0 clamp(18rem, 31vw, 31rem);
  min-height: 24rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(1.4rem, 3vw, 2.4rem);
  border: 1px solid var(--ink);
  background: var(--surface);
  color: var(--ink);
  scroll-snap-align: start;
  text-decoration: none;
  transition: transform .4s var(--ease-out), background .4s var(--ease-out), color .4s var(--ease-out), box-shadow .4s var(--ease-out);
}
.side-path:nth-child(2n) { transform: translateY(2.5rem); }
.side-path::before { content: ""; position: absolute; top: 1.4rem; left: 1.4rem; width: 3rem; height: 3rem; border-top: 1px solid currentColor; border-left: 1px solid currentColor; }
.side-path:hover { background: var(--ink); color: var(--surface); box-shadow: .75rem .75rem 0 color-mix(in srgb, var(--accent) 45%, transparent); transform: translateY(-.5rem); }
.side-path:nth-child(2n):hover { transform: translateY(2rem); }
.side-path > span { font-family: var(--font-mono); font-size: .61rem; letter-spacing: .09em; }
.side-path b { display: block; margin-top: 1rem; font-family: var(--font-display); font-size: clamp(2rem, 4vw, 3.5rem); line-height: .95; }
.side-path p { margin: 1rem 0 0; color: var(--muted); }
.side-path:hover p { color: color-mix(in srgb, var(--surface) 76%, transparent); }
.side-path i { margin-top: 2rem; font-family: var(--font-mono); font-size: .64rem; font-style: normal; text-transform: uppercase; }
.side-path--physical { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }

.about {
  min-height: 110svh;
  display: flex;
  align-items: flex-start;
  gap: clamp(4rem, 10vw, 12rem);
  padding: 10rem max(var(--page-x), 9vw);
}
.about__origin { position: sticky; top: 8rem; flex: 0 1 44rem; }
.about__origin h2 { max-width: 10ch; }
.about__origin > p:last-child { max-width: 36rem; margin: 2rem 0 0; color: var(--muted); font-size: 1.1rem; }
.career-trace { position: relative; flex: 0 1 44rem; padding-left: 3.4rem; }
.career-line { position: absolute; left: .85rem; top: 1rem; bottom: 2rem; width: 1px; background: var(--line); }
.career-line i { position: absolute; top: 0; left: -2px; width: 5px; height: var(--career-progress, 0%); background: var(--accent); transition: height .1s linear; }
.career-trace article { position: relative; min-height: 12rem; padding-bottom: 3rem; }
.career-trace article::before { content: ""; position: absolute; left: -3.05rem; top: .45rem; width: .9rem; height: .9rem; border: 2px solid var(--ink); border-radius: 50%; background: var(--bg); transition: background .3s var(--ease-out), transform .3s var(--ease-out); }
.career-trace article.is-visible::before { background: var(--accent); transform: scale(1.15); }
.career-trace time { font-family: var(--font-mono); font-size: .64rem; letter-spacing: .08em; }
.career-trace h3 { margin: .7rem 0 0; font-family: var(--font-display); font-size: clamp(1.8rem, 3.2vw, 2.8rem); line-height: 1; }
.career-trace p { max-width: 31rem; margin: .7rem 0 0; color: var(--muted); }

.contact {
  --ink: #15231f;
  --surface: #f4f6f3;
  --muted: #b6c0bb;
  --line: rgba(244,246,243,.2);
  --accent: #d4a93d;
  --on-accent: #15231f;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 9rem max(var(--page-x), 9vw) 2rem;
  background: var(--ink);
  color: var(--surface);
}
.contact .section-code { color: color-mix(in srgb, var(--surface) 65%, transparent); }
.contact h2 { max-width: 11ch; font-size: clamp(4rem, 9vw, 9rem); }
.contact > p:not(.section-code) { max-width: 45rem; margin: 2rem 0 0; color: color-mix(in srgb, var(--surface) 72%, transparent); font-size: 1.15rem; }
.contact__actions { align-items: stretch; margin-top: 4rem; border-top: 1px solid color-mix(in srgb, var(--surface) 22%, transparent); }
.contact-link { flex: 1 1 16rem; min-height: 7.5rem; display: flex; flex-direction: column; justify-content: center; position: relative; padding: 1.3rem 3.8rem 1.3rem 0; border-bottom: 1px solid color-mix(in srgb, var(--surface) 22%, transparent); color: inherit; text-decoration: none; }
.contact-link span { color: color-mix(in srgb, var(--surface) 55%, transparent); font-family: var(--font-mono); font-size: .61rem; letter-spacing: .09em; text-transform: uppercase; }
.contact-link b { margin-top: .45rem; font-family: var(--font-display); font-size: clamp(1.3rem, 2vw, 2rem); }
.contact-link i { position: absolute; right: .8rem; top: 50%; font-family: var(--font-mono); font-size: 1.4rem; font-style: normal; transform: translateY(-50%); transition: transform .3s var(--ease-out); }
.contact-link:hover i { transform: translate(.4rem, -50%); }
.contact footer { display: flex; justify-content: space-between; gap: 2rem; margin-top: auto; padding-top: 5rem; font-family: var(--font-mono); font-size: .58rem; letter-spacing: .08em; }

.notes-dialog {
  position: fixed;
  z-index: 210;
  width: min(48rem, calc(100vw - 2rem));
  max-height: min(48rem, calc(100svh - 2rem));
  margin: auto;
  padding: clamp(1.5rem, 5vw, 4rem);
  border: 1px solid var(--ink);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 1rem 1rem 0 color-mix(in srgb, var(--ink) 20%, transparent);
  opacity: 0;
  transform: translateY(1.2rem) scale(.985);
  transition: opacity .32s ease, transform .45s var(--ease-out), display .45s allow-discrete, overlay .45s allow-discrete;
}
.notes-dialog[open] { opacity: 1; transform: translateY(0) scale(1); }
@starting-style { .notes-dialog[open] { opacity: 0; transform: translateY(1.2rem) scale(.985); } }
.notes-dialog::backdrop { background: transparent; }
.dialog-backdrop { position: fixed; z-index: 205; inset: 0; background: rgba(8,20,16,.7); backdrop-filter: blur(8px); opacity: 0; pointer-events: none; transition: opacity .35s ease; }
body.is-dialog-open .dialog-backdrop { opacity: 1; pointer-events: auto; }
.dialog-close { position: absolute; top: 1rem; right: 1rem; width: 3rem; height: 3rem; border: 1px solid var(--ink); border-radius: 50%; background: transparent; font-size: 1.6rem; cursor: pointer; transition: transform .3s var(--ease-out), background .25s var(--ease-out), color .25s var(--ease-out); }
.dialog-close:hover { background: var(--ink); color: var(--surface); transform: rotate(90deg); }
.notes-dialog h2 { margin: 0; max-width: 12ch; font-family: var(--font-display); font-size: clamp(2.8rem, 7vw, 5rem); font-weight: 600; letter-spacing: -.04em; line-height: .92; }
.notes-dialog > p:not(.section-code) { margin: 1.5rem 0; font-size: 1.05rem; }
.notes-dialog dl { margin: 2rem 0; border-top: 1px solid var(--ink); }
.notes-dialog dl > div { display: flex; gap: 1.5rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.notes-dialog dt { flex: 0 0 7rem; font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; }
.notes-dialog dd { margin: 0; color: var(--muted); }
.architecture-flow { margin: 2rem 0 0; padding: 0; list-style: none; border-top: 1px solid var(--ink); }
.architecture-flow li { display: flex; align-items: baseline; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.architecture-flow span { font-family: var(--font-mono); font-size: .62rem; color: var(--accent); }
.architecture-flow b { flex: 0 0 10rem; font-family: var(--font-display); font-size: 1.25rem; }
.architecture-flow p { margin: 0; color: var(--muted); }
.dialog-note { padding: 1rem; background: color-mix(in srgb, var(--accent) 10%, transparent); font-family: var(--font-mono); font-size: .75rem !important; }
.screen-reader-status { position: fixed; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.tactile { --mx: 0px; --my: 0px; transform: translate3d(var(--mx), var(--my), 0); }
.tactile:active { transform: translate3d(var(--mx), var(--my), 0) scale(.975); }

@keyframes hero-rule { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes draw-loop { to { stroke-dashoffset: 0; } }
@keyframes node-settle { from { opacity: 0; translate: 0 12px; scale: .92; } to { opacity: 1; translate: 0 0; scale: 1; } }
@keyframes scroll-line { 0% { transform: scaleY(0); transform-origin: top; } 45% { transform: scaleY(1); transform-origin: top; } 55% { transform: scaleY(1); transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }
@keyframes graph-drift { to { stroke-dashoffset: -180; } }
@keyframes packet-flow { from { offset-distance: 0%; } to { offset-distance: 100%; } }
@keyframes yarn-move { to { stroke-dashoffset: -220; } }

@media (max-width: 1100px) {
  .trace-nav { display: none; }
  .route-layer { left: .7rem; opacity: .7; }
  .hero { align-items: flex-end; min-height: 110svh; padding-bottom: 7rem; }
  .hero__machine { position: absolute; top: 10%; right: -12%; width: 52vw; min-width: 32rem; opacity: .5; }
  .hero__copy { max-width: 47rem; }
  .pattern, .chapter, .method, .about { gap: 3.5rem; padding-left: max(var(--page-x), 6vw); padding-right: max(var(--page-x), 6vw); }
  .chapter { min-height: auto; padding-top: 8rem; padding-bottom: 8rem; }
  .chapter, .chapter:nth-child(even) { flex-direction: column; align-items: stretch; }
  .chapter__copy { max-width: 46rem; }
  .visual-stage { width: 100%; }
  .method, .about { align-items: stretch; }
  .method__heading, .about__origin { position: static; }
  .method-path, .career-trace { margin-left: auto; width: min(100%, 45rem); }
  .skill-switchboard { min-height: 42rem; }
}

@media (max-width: 760px) {
  :root { --header-h: 4rem; --page-x: 1.15rem; }
  .site-header { gap: .8rem; padding: 0 1rem; }
  .site-nav { display: none; }
  .header-contact { margin-left: auto; }
  .route-layer { display: none; }
  .hero { min-height: 100svh; display: block; padding: 8.4rem 1.25rem 5.5rem; }
  .hero::before { top: 9rem; width: .38rem; height: 11rem; }
  .eyebrow span { display: block; margin-top: .55rem; color: var(--muted); font-weight: 500; }
.hero h1 { max-width: 9ch; font-size: clamp(4rem, 18vw, 6.3rem); line-height: .84; }
  .hero__lead { font-size: 1.16rem; }
  .hero__machine { top: auto; right: -8.5rem; bottom: -6rem; width: 25rem; min-width: 25rem; opacity: .18; }
  .machine-readout, .machine-plate__serial { display: none; }
  .scroll-cue { left: auto; right: 1.25rem; transform: none; }
  .pattern, .method, .about { min-height: auto; display: block; padding: 6.5rem 1.25rem; }
  .pattern h2, .method h2, .range h2, .about h2, .contact h2 { font-size: clamp(3.25rem, 15vw, 5.4rem); }
  .pattern__stack { margin-top: 3rem; }
  .stack-line { display: block; position: relative; min-height: 7.2rem; padding: 1rem 2rem 1rem 0; }
  .stack-line span, .stack-line b, .stack-line i { width: auto; }
  .stack-line span { display: inline-block; margin-right: .8rem; }
  .stack-line b { display: inline; }
  .stack-line i { display: block; margin-top: .45rem; }
  .stack-line::after { position: absolute; right: 0; top: 1.2rem; }
  .chapter { display: block; padding: 6.5rem 1.25rem; }
  .chapter h2 { max-width: 10ch; font-size: clamp(3.35rem, 15vw, 5.6rem); }
  .chapter__lead { font-size: 1.05rem; }
  .visual-stage { margin-top: 3rem; }
  .cairn-map { padding: .65rem; box-shadow: .45rem .45rem 0 rgba(32,52,67,.12); }
  .cairn-evidence { display: block; min-height: 0; margin-top: 0; }
  .cairn-evidence b, .cairn-evidence p { margin-top: .7rem; }
  .pipeline { min-height: 38rem; flex-direction: column; align-items: stretch; padding: 2rem 0; }
  .pipeline__rail { top: 5%; bottom: 5%; left: 50%; right: auto; width: 2px; height: auto; }
  .pipeline__token { left: calc(50% - 1.85rem); top: 4%; transform: translateY(-50%); }
  .pipeline__stage { flex: 0 0 auto; min-height: 5.4rem; display: flex; align-items: center; gap: .7rem; text-align: left; padding: .8rem 1rem; }
  .pipeline__stage span { margin: 0; }
  .pipeline__stage i { margin: 0 0 0 auto; text-align: right; }
  .pipeline__stage.is-active { transform: translateX(.55rem); }
  .pipeline__stage--gate::before, .pipeline__stage--gate::after { top: 15%; bottom: 15%; }
  .spine-machine__controls, .link-control { align-items: stretch; flex-direction: column; }
  .memory-machine__header { display: block; }
  .tool-switch { margin-top: 1rem; }
  .retrieval-paths { display: block; }
  .retrieval-paths > div + div { margin-top: .55rem; }
  .skill-switchboard { min-height: 37rem; }
  .client-ring { inset: 4rem .6rem 3rem; }
  .client-node { width: 8.1rem; min-height: 4.7rem; padding: .7rem; }
  .client-node--claude, .client-node--gemini { left: 0; }
  .client-node--codex, .client-node--omp { right: 0; }
  .registry-core { width: 8.3rem; }
  .skill-puck { width: 4.7rem; }
  .holocron-map svg { min-height: 25rem; object-fit: cover; }
  .yarnling-stage { min-height: 39rem; }
  .phone-shell { top: 4.7rem; width: 13rem; }
  .story-loop { gap: .35rem; font-size: .48rem; }
  .story-loop i { width: .7rem; }
  .method-path { margin-top: 4rem; }
  .method-path li { min-height: 9.5rem; }
  .range { min-height: auto; padding: 6.5rem 0 6rem 1.25rem; }
  .side-paths { margin-top: 3rem; padding-right: 1.25rem; }
  .side-path { flex-basis: 80vw; min-height: 23rem; }
  .side-path:nth-child(2n) { transform: none; }
  .side-path:nth-child(2n):hover { transform: translateY(-.5rem); }
  .career-trace { margin-top: 4rem; padding-left: 2.8rem; }
  .career-trace article::before { left: -2.45rem; }
  .contact { min-height: 100svh; padding: 7rem 1.25rem 1.5rem; }
  .contact__actions { display: block; }
  .contact-link { min-height: 6.5rem; }
  .contact footer { display: block; }
  .contact footer span { display: block; }
  .contact footer span + span { margin-top: .5rem; }
  .notes-dialog { padding: 4.5rem 1.25rem 1.5rem; }
  .notes-dialog dl > div, .architecture-flow li { display: block; }
  .notes-dialog dt, .architecture-flow b { display: block; margin-bottom: .35rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .loop-packet { display: none; }
  .tactile { transform: none !important; }
}

/* Contrast fixes for dark chapters and small technical labels. */
.chapter--openspine .primary-action {
  background: #d4a93d;
  color: #10251f;
}
.chapter--holocron .primary-action {
  background: #e2a93d;
  color: #0e2230;
}
.method-path li > span { color: #8f351f; }
.chapter--skillkeep .chapter__index span { color: #8f351f; }
.memory-result small { color: #bdc9c3; }
.contact .section-code { color: #bcc8c2; }
.contact > p:not(.section-code) { color: #c3cdc8; }
.contact-link span { color: #aebcb5; }
.retrieval-paths > div {
  transition: transform .35s var(--ease-out);
}
.retrieval-paths > div.is-active {
  background: #285a4e;
  color: #ffffff;
}
.retrieval-paths > div.is-active i { color: #ffffff; }
.notes-dialog { overflow-y: auto; overscroll-behavior: contain; }

/* Run continuous motion only while its chapter is in view. */
.packet--a, .packet--b, .packet--c { animation-play-state: paused; }
.chapter--holocron.is-active .packet--a,
.chapter--holocron.is-active .packet--b,
.chapter--holocron.is-active .packet--c { animation-play-state: running; }
.chapter--holocron.is-active .holocron-map.is-link-down .packet--b { animation-play-state: paused; }

.graph-node.is-selected circle,
.graph-node.is-selected rect { fill: #315f8c; stroke: #315f8c; }
.graph-node.is-selected text { fill: #ffffff; }
