/* claude-automata landing. Skin per site/DESIGN.md (Cursor-derived): warm cream
   canvas, warm near-black ink, display at weight 400 with negative tracking,
   Cursor Orange as the single action voltage, JetBrains Mono on every code
   surface, hairline-only depth. The circuit keeps its two semantic hues, copper
   (working / volatile) oxidizing to verdigris (long-term / verified), re-derived
   from Cursor's timeline pastels (thinking peach, grep mint) and deepened for the
   light canvas; that chroma is the schematic's data encoding, the one place color
   carries meaning. Traveling pulses ride a brighter --travel orange so motion reads
   at a glance; verified pulses (settle, refine) stay verdigris. The claim diamonds
   re-derive --sky from timeline-read likewise. */

/* ---------------------------------------------------------------- fonts */
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap;
  src: url("assets/fonts/inter-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap;
  src: url("assets/fonts/inter-500.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap;
  src: url("assets/fonts/inter-600.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 400 500; font-display: swap;
  src: url("assets/fonts/jetbrains-mono.woff2") format("woff2"); }

/* ---------------------------------------------------------------- tokens */
:root {
  --paper: #f7f7f4;            /* canvas: warm cream, never pure white */
  --panel: #ffffff;            /* surface-card: white card on the cream floor */
  --chip: #e6e5e0;             /* surface-strong: badge pills */
  --ink: #26251e;              /* warm near-black: display and emphasis */
  --body-text: #5a5852;        /* running text */
  --muted: #807d72;            /* labels, captions, fine print */
  --muted-soft: #a09c92;       /* lightest label tier */
  --hairline: #e6e5e0;
  --hairline-strong: #cfcdc4;
  --primary: #f54e00;          /* Cursor Orange: CTA, wordmark, selection, focus */
  --primary-active: #d04200;
  --on-primary: #ffffff;
  --copper: #bf6840;           /* working / volatile: timeline-thinking, stroke weight */
  --copper-deep: #9e512e;      /* working / volatile: text weight on cream */
  --travel: #ef5b1c;           /* live pulse in motion: brightened copper, near Cursor Orange */
  --verdigris: #447e48;        /* long-term / verified: timeline-grep, deepened */
  --sky: #5480ba;              /* principle markers: timeline-read, deepened */
  --display: "Inter", system-ui, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --body: "Inter", system-ui, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", "Fira Code", ui-monospace, monospace;
  --r-md: 8px;
  --r-lg: 12px;
  --r-pill: 999px;
  --wrap: 1200px;
  --cycle: 9s;
}

/* ---------------------------------------------------------------- base */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
main { display: block; }
a { color: inherit; text-decoration: underline; text-decoration-color: var(--hairline-strong); text-underline-offset: 3px; }
a:hover { color: var(--primary); text-decoration-color: var(--primary); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
::selection { background: var(--primary); color: var(--on-primary); }
code { font-family: var(--mono); font-size: 0.92em; }
section[id] { scroll-margin-top: 1.5rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------------- title block */
.titleblock {
  display: flex; flex-wrap: wrap; gap: 0.4rem 1.8rem;
  align-items: baseline; justify-content: space-between;
  max-width: var(--wrap); margin: 0 auto;
  padding: 1.1rem clamp(1.25rem, 4vw, 2.5rem) 0.9rem;
  border-bottom: 1px solid var(--hairline);
}
.tb-name { font-family: var(--display); font-weight: 500; letter-spacing: 0.05em; font-size: 0.95rem; }
.tb-fields { display: flex; flex-wrap: wrap; gap: 0.35rem 1.6rem; }
.tb-field { font-family: var(--body); font-weight: 600; font-size: 0.6875rem; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; }
.tb-k { color: var(--muted); margin-right: 0.45em; }
.tb-k::after { content: " ·"; }
.tb-link { text-decoration: none; }
.tb-link:hover { color: var(--primary); }
.tb-lang { color: var(--muted); }
.tb-lang b { color: var(--ink); font-weight: 600; }
.tb-lang a { text-decoration: none; }
.tb-lang a:hover { color: var(--primary); }

/* ---------------------------------------------------------------- hero */
.hero {
  max-width: var(--wrap); margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4.5rem) clamp(1.25rem, 4vw, 2.5rem) 3.5rem;
}
.eyebrow {
  font-family: var(--body); font-weight: 600; font-size: 0.6875rem; letter-spacing: 0.08em;
  color: var(--muted); text-transform: uppercase; margin-bottom: 1.4rem;
}
.hero h1 {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(2.125rem, 5.6vw, 4.5rem); line-height: 1.1; letter-spacing: -0.03em;
  max-width: 24ch;
}
.thesis {
  max-width: 62ch; margin-top: 2.6rem; color: var(--body-text);
  font-size: clamp(1rem, 1.4vw, 1.125rem); line-height: 1.65;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 2.2rem; }
.btn {
  font-family: var(--body); font-weight: 500; font-size: 0.875rem; line-height: 1;
  text-decoration: none; border: 1px solid #e6e5e0; border-radius: var(--r-md);
  padding: 0.75rem 1.125rem; color: #26251e; background: #e6e5e0;
  transition: color 120ms, border-color 120ms, background 120ms;
}
.btn:hover { color: #26251e; background: #dcdbd4; border-color: #dcdbd4; }
.btn-solid { background: #3b3a33; color: #f7f7f4; border-color: #3b3a33; }
.btn-solid:hover { background: var(--ink); color: #f7f7f4; border-color: var(--ink); }

/* ---------------------------------------------------------------- schematic */
.schematic-figure { position: relative; margin: clamp(1.6rem, 3.5vw, 2.6rem) 0 0; }
.schematic-figure::before, .schematic-figure::after {
  content: "+"; position: absolute; font-family: var(--mono);
  font-size: 0.8rem; color: var(--hairline-strong); line-height: 1;
}
.schematic-figure::before { top: -0.5rem; left: -0.15rem; }
.schematic-figure::after { bottom: 1.4rem; right: -0.15rem; }

.schematic {
  display: grid;
  grid-template-columns: 1fr 64px 1fr 64px 1fr;
  grid-template-rows: auto auto 72px;
  padding: 1.5rem 0 0;
}
.circuit { display: contents; }

/* input rail */
.rail { grid-column: 1; grid-row: 1; display: flex; flex-direction: column; align-items: center; }
.rail-caption {
  font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.14em;
  color: var(--muted); margin-bottom: 0.55rem;
}
.rail-items { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.35rem; }
.event {
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.04em;
  border: 1px solid var(--chip); color: var(--ink);
  padding: 0.18rem 0.5rem; background: var(--chip); border-radius: var(--r-pill);
}
.rail-drop {
  width: 0; height: 48px; border-left: 1.5px solid var(--muted);
  position: relative; margin-top: 0.5rem;
}
.arrowhead.down { left: -4.25px; bottom: 1px; transform: rotate(135deg); }

/* stations */
.station {
  grid-row: 2; border: 1.5px solid var(--ink); background: var(--panel);
  padding: 1.15rem 1rem 1.05rem; text-align: center; border-radius: var(--r-md);
  display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
}
.st-working { grid-column: 1; border-style: dashed; position: relative;
  animation: wm-emit var(--cycle) linear infinite; }   /* impermanent by drawing convention; anchors the drain */
.st-gate    { grid-column: 3; animation: gate-approve var(--cycle) linear infinite; }
.st-ltm     { grid-column: 5; border-color: var(--verdigris); animation: ltm-receive var(--cycle) linear infinite; }
.glyph { width: 84px; height: 84px; margin-bottom: 0.35rem; }
.glyph svg { width: 100%; height: 100%; overflow: visible; }
.st-name { font-family: var(--mono); font-weight: 500; letter-spacing: 0.09em; font-size: 0.8rem; }
.st-plugin { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.03em; }
.plugin-copper { color: var(--copper-deep); }
.plugin-ink { color: var(--ink); }
.plugin-verd { color: var(--verdigris); }
.st-props { font-family: var(--mono); font-size: 0.64rem; color: var(--muted); letter-spacing: 0.02em; }

/* glyph strokes */
.glyph svg * { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.loop-track { stroke: var(--copper); stroke-width: 2; stroke-dasharray: 5 6; }
.orbit-dot { fill: var(--copper); stroke: none; }
.orbiter { transform-box: view-box; transform-origin: center; animation: orbit 3.6s linear infinite; }
.anchor-glyph * { stroke: var(--ink); stroke-width: 2; }
.gate-wall { stroke: var(--ink); stroke-width: 2.5; }
.gate-core { stroke: var(--ink); stroke-width: 2; animation: gate-flash var(--cycle) linear infinite; }
.gate-check { stroke: var(--verdigris); stroke-width: 3; stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: gate-check var(--cycle) linear infinite; }
.strata-frame { stroke: var(--verdigris); stroke-width: 2; }
.stratum { stroke: var(--verdigris); stroke-width: 1.2; opacity: 0.6; }
.tick { stroke: var(--verdigris); stroke-width: 2.5; }
.tick-new { animation: tick-new var(--cycle) linear infinite; }

/* connectors */
.conn { grid-row: 2; align-self: center; position: relative; height: 0;
  border-top: 1.5px solid var(--muted); }
.c1 { grid-column: 2; }
.c2 { grid-column: 4; }
.arrowhead { position: absolute; width: 7px; height: 7px;
  border-top: 1.5px solid var(--muted); border-right: 1.5px solid var(--muted); }
.arrowhead.right { right: 1px; top: -4.25px; transform: rotate(45deg); }
.arrowhead.up { transform: rotate(-45deg); }
.arrowhead.verd { border-color: var(--verdigris); }
.pulse { position: absolute; top: -4px; left: 0; width: 6.5px; height: 6.5px;
  border-radius: 50%; background: var(--travel); opacity: 0; }
.p-pass   { animation: pulse-pass var(--cycle) linear infinite; }
.p-pass2  { animation: pulse-pass2 var(--cycle) linear infinite; }
.p-event  { width: 5.5px; height: 5.5px; background: var(--travel); left: -3.5px; top: 0;
  animation: pulse-event var(--cycle) linear infinite; }
.p-settle { background: var(--verdigris); animation: pulse-settle var(--cycle) linear infinite; }
.refine-riser { display: none; }   /* mobile-only: the return route rides beside c2 */

/* discard drain: unpromoted traces discharge to ground below working memory */
.drain {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.drain-stub { position: relative; width: 0; height: 40px;
  border-left: 1.5px dashed var(--copper); opacity: 0.75; }
.ground { width: 22px; height: 11px; }
.ground line { stroke: var(--copper); stroke-width: 2; stroke-linecap: round; opacity: 0.75; }
.drain-label { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.08em;
  color: var(--muted); }
.p-drain { background: var(--travel); left: -4px; top: 0;
  animation: pulse-drain var(--cycle) linear infinite; }

/* refine return path: LTM -> down -> across -> up -> gate */
.refine-path {
  grid-column: 3 / 6; grid-row: 3; position: relative;
  margin-left: calc((100% - 64px) / 4);
  margin-right: calc((100% - 64px) / 4);
}
.refine-line {
  position: absolute; inset: 0 0 auto 0; height: 40px;
  border-left: 1.5px dashed var(--verdigris);
  border-bottom: 1.5px dashed var(--verdigris);
  border-right: 1.5px dashed var(--verdigris);
}
.refine-line .arrowhead.up { left: -4.25px; top: -2px; border-color: var(--verdigris); }
.p-refine { background: var(--verdigris); animation: pulse-refine var(--cycle) linear infinite; }
.refine-label {
  position: absolute; top: 48px; left: 50%; transform: translateX(-50%);
  font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.05em;
  color: var(--verdigris); white-space: nowrap;
}
.fig-caption {
  margin-top: 2.2rem; padding-top: 0.7rem; border-top: 1px solid var(--hairline);
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.12em; color: var(--muted);
}

/* ------------------------------------------------- schematic choreography
   one 9s master cycle, kept busy end to end: events keep dropping into the
   loop, two traces ride c1 (the second gets verified), the gate's outline
   flushes verdigris as the check draws, long-term memory flushes as the
   settle lands, a rejected trace drains, and a slow refine trace rides the
   U back through the same gate. Stations react by border/background color
   only; geometry never moves. */
@keyframes orbit { to { transform: rotate(360deg); } }
@keyframes pulse-event {
  0%, 1%    { opacity: 0; top: 0; }
  2%        { opacity: 1; top: 0; }
  10%       { opacity: 1; top: calc(100% - 5.5px); }
  11%       { opacity: 0; top: calc(100% - 5.5px); }
  12%, 28%  { opacity: 0; top: 0; }
  29%       { opacity: 1; top: 0; }
  37%       { opacity: 1; top: calc(100% - 5.5px); }
  38%       { opacity: 0; top: calc(100% - 5.5px); }
  39%, 67%  { opacity: 0; top: 0; }
  68%       { opacity: 1; top: 0; }
  76%       { opacity: 1; top: calc(100% - 5.5px); }
  77%       { opacity: 0; top: calc(100% - 5.5px); }
  78%, 100% { opacity: 0; top: 0; }
}
@keyframes pulse-pass2 {
  0%, 8%  { opacity: 0; left: 0; }
  10%     { opacity: 1; }
  20%     { opacity: 1; left: calc(100% - 7px); }
  22%, 100% { opacity: 0; left: calc(100% - 7px); }
}
@keyframes wm-emit {
  0%, 7%   { border-color: var(--ink); }
  10%      { border-color: var(--copper); }
  14%, 35% { border-color: var(--ink); }
  38%      { border-color: var(--copper); }
  42%, 100% { border-color: var(--ink); }
}
@keyframes gate-approve {
  0%, 20%  { border-color: var(--ink); background: var(--panel); }
  22%      { border-color: #6d9a70; background: var(--panel); }
  26%, 46% { border-color: var(--ink); background: var(--panel); }
  50%      { border-color: var(--verdigris); background: #eef4ee; }
  58%      { border-color: var(--verdigris); background: #eef4ee; }
  64%, 100% { border-color: var(--ink); background: var(--panel); }
}
@keyframes ltm-receive {
  0%, 64%  { background: var(--panel); }
  68%      { background: #eaf3ea; }
  74%      { background: #eaf3ea; }
  82%, 100% { background: var(--panel); }
}
@keyframes pulse-pass {
  0%, 36% { opacity: 0; left: 0; }
  38%     { opacity: 1; }
  48%     { opacity: 1; left: calc(100% - 7px); }
  50%, 100% { opacity: 0; left: calc(100% - 7px); }
}
@keyframes gate-flash {
  0%, 48%  { stroke: var(--ink); }
  50%, 58% { stroke: var(--verdigris); }
  62%, 100% { stroke: var(--ink); }
}
@keyframes gate-check {
  0%, 48% { stroke-dashoffset: 1; opacity: 0; }
  50%     { opacity: 1; }
  54%     { stroke-dashoffset: 0; opacity: 1; }
  62%     { stroke-dashoffset: 0; opacity: 1; }
  68%, 100% { stroke-dashoffset: 0; opacity: 0; }
}
@keyframes pulse-settle {
  0%, 56% { opacity: 0; left: 0; }
  58%     { opacity: 1; }
  68%     { opacity: 1; left: calc(100% - 7px); }
  70%, 100% { opacity: 0; left: calc(100% - 7px); }
}
@keyframes tick-new {
  0%, 68% { opacity: 0; }
  72%, 96% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes pulse-drain {   /* never promoted: discharges to ground */
  0%, 76% { opacity: 0; top: 0; transform: scale(1); }
  78%     { opacity: 1; }
  86%     { opacity: 1; top: calc(100% - 6px); transform: scale(1); }
  90%, 100% { opacity: 0; top: calc(100% - 4px); transform: scale(0.2); }
}
@keyframes pulse-refine {   /* travels the U: down the right edge, across, up the left edge */
  0%, 8% { opacity: 0; top: -3px; left: calc(100% - 2.5px); }
  10%    { opacity: 1; top: -3px; left: calc(100% - 2.5px); }
  16%    { top: calc(100% - 2.5px); left: calc(100% - 2.5px); }
  34%    { top: calc(100% - 2.5px); left: -4px; }
  42%    { opacity: 1; top: -3px; left: -4px; }
  46%, 100% { opacity: 0; top: -3px; left: -4px; }
}

/* ---------------------------------------------------------------- sections */
.section {
  max-width: var(--wrap); margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 5rem) clamp(1.25rem, 4vw, 2.5rem);
  border-top: 1px solid var(--hairline);
}
.section h2 {
  font-family: var(--body); font-weight: 600;
  font-size: 0.8125rem; letter-spacing: 0.08em;
  margin-bottom: 2.2rem;
}
.sec-no { font-weight: 600; color: var(--primary); margin-right: 1rem; }
.sec-link { text-decoration: none; }
.sec-link:hover { color: inherit; }
.sec-link::after { content: "#"; margin-left: 0.4rem; color: var(--primary);
  opacity: 0; transition: opacity 0.15s ease; }
.sec-link:hover::after, .sec-link:focus-visible::after { opacity: 1; }
.sec-lede { max-width: 58ch; margin: -1.2rem 0 2.4rem; color: var(--ink);
  font-size: clamp(1.125rem, 1.7vw, 1.375rem); line-height: 1.5; letter-spacing: -0.005em; }

/* 01 the advisor: illustrative exchange */
.exchange {
  background: var(--panel); border: 1px solid var(--hairline); border-radius: var(--r-lg);
  padding: 1.5rem 1.7rem; max-width: 72ch;
  font-family: var(--mono); font-size: 0.8125rem; line-height: 1.65;
}
.xc-line { display: flex; gap: 1.1rem; padding: 0.28rem 0; }
.xc-who { flex: 0 0 4.5rem; text-align: right; font-weight: 500; font-size: 0.78rem;
  letter-spacing: 0.04em; padding-top: 0.1rem; }
.xc-who::after { content: " ›"; color: var(--hairline-strong); }
.xc-agent { color: var(--ink); }
.xc-hook { color: var(--muted); }
.xc-advisor { color: var(--copper-deep); }
.xc-text { flex: 1; color: var(--body-text); }
.xc-text.xc-end { color: var(--verdigris); }
.xc-gap { text-align: center; color: var(--muted); font-size: 0.75rem;
  letter-spacing: 0.08em; padding: 0.7rem 0; }
.xc-note { max-width: 72ch; font-size: 0.88rem; color: var(--body-text); margin-top: 1rem; }
.sec-punch { font-family: var(--display); font-weight: 400;
  font-size: clamp(1.5rem, 2.3vw, 1.75rem); line-height: 1.3; letter-spacing: -0.0125em;
  margin-top: 1.8rem; max-width: 62ch; }

/* 02 premise */
.claims { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem; }
.claim h3 { font-weight: 600; font-size: 1.125rem; margin-bottom: 0.7rem; letter-spacing: 0; }
.claim h3::before { content: ""; display: inline-block; width: 9px; height: 9px;
  border: 1.5px solid var(--sky); border-radius: 1.5px; transform: rotate(45deg);
  margin-right: 0.7rem; vertical-align: 1px; }
.claim p { font-size: 0.95rem; color: var(--body-text); }

/* 02 memory system */
.stages { list-style: none; border-top: 1px solid var(--hairline); }
.stage { display: grid; grid-template-columns: 220px 1fr; gap: 1.5rem;
  padding: 1.4rem 0; border-bottom: 1px solid var(--hairline); }
.stage-key { font-family: var(--mono); font-size: 0.76rem; font-weight: 500; letter-spacing: 0.08em; padding-top: 0.3rem; }
.stage-copper .stage-key { color: var(--copper-deep); }
.stage-ink .stage-key { color: var(--ink); }
.stage-verd .stage-key { color: var(--verdigris); }
.stage-body p { max-width: 68ch; font-size: 0.97rem; color: var(--body-text); }

/* 03 modules */
.modules { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.module { border: 1px solid var(--hairline); background: var(--panel); border-radius: var(--r-lg);
  padding: 1.5rem; display: flex; flex-direction: column; gap: 0.85rem; }
.mod-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  border-bottom: 1px solid var(--hairline); padding-bottom: 0.7rem; }
.mod-name { font-family: var(--mono); font-weight: 500; font-size: 1.05rem; }
.mod-tag { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.05em;
  background: var(--chip); padding: 0.22rem 0.6rem; border-radius: var(--r-pill);
  white-space: nowrap; }
.tag-wm { color: var(--copper-deep); }
.tag-ltm { color: var(--verdigris); }
.module p { font-size: 0.94rem; color: var(--body-text); flex-grow: 1; }

/* 04 getting started */
.code-block { background: var(--panel); border: 1px solid var(--hairline); border-radius: var(--r-lg);
  padding: 1.25rem; overflow-x: auto; font-size: 0.8125rem; line-height: 1.75;
  font-family: var(--mono); color: var(--ink); }
.code-copy { position: relative; }
.copy-btn {
  position: absolute; top: 0.7rem; right: 0.7rem;
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.3rem; height: 2.3rem;
  color: var(--muted); background: var(--paper);
  border: 1px solid var(--hairline-strong); border-radius: var(--r-md);
  cursor: pointer; opacity: 0;
  transition: opacity 120ms, color 120ms, border-color 120ms; }
.copy-btn .ico { width: 1.15rem; height: 1.15rem; }
.copy-btn .ico-check { display: none; }
.code-copy:hover .copy-btn, .copy-btn:focus-visible { opacity: 1; }
.copy-btn:hover { color: var(--ink); border-color: var(--muted); }
.code-copy.copied .copy-btn { opacity: 1; color: var(--verdigris); border-color: var(--verdigris); }
.code-copy.copied .ico-copy { display: none; }
.code-copy.copied .ico-check { display: inline-block; }
@media (hover: none) { .copy-btn { opacity: 1; } }
.c-muted { color: var(--muted); }
.init-disclosure { margin-top: 2.6rem; }
.disclosure-title { font-family: var(--body); font-weight: 600; font-size: 0.8125rem;
  letter-spacing: 0.08em; margin-bottom: 0.9rem; }
.disclosure-note { max-width: 68ch; font-size: 0.9rem; color: var(--body-text); margin: 0.9rem 0; }
.prereq { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em;
  color: var(--muted); margin: -1.6rem 0 1.4rem; }
.prereq a { text-decoration-color: var(--hairline-strong); }
.step-caption { font-family: var(--body); font-size: 0.6875rem; font-weight: 600;
  letter-spacing: 0.08em; color: var(--muted); margin: 1.7rem 0 0.6rem; }
.loop-note { max-width: 68ch; font-size: 0.9rem; color: var(--body-text); }
.spec-table { width: 100%; border-collapse: collapse; border-top: 1px solid var(--hairline-strong); }
.spec-table th, .spec-table td { text-align: left; vertical-align: top;
  padding: 0.65rem 1rem 0.65rem 0; border-bottom: 1px solid var(--hairline); }
.spec-table th { font-family: var(--mono); font-weight: 500; font-size: 0.78rem;
  letter-spacing: 0.02em; white-space: nowrap; width: 1%; padding-right: 2.2rem; }
.spec-table td { font-size: 0.92rem; color: var(--body-text); }
.spec-table td code { color: var(--ink); }
.next-steps { margin-top: 2.6rem; }

/* ---------------------------------------------------------------- footer */
.colophon { max-width: var(--wrap); margin: 0 auto;
  padding: clamp(4rem, 9vw, 6.5rem) clamp(1.25rem, 4vw, 2.5rem) 4rem;
  border-top: 1px solid var(--hairline); text-align: center; }
.outro-label { font-family: var(--body); font-weight: 600; font-size: 0.9375rem;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-soft);
  margin-bottom: 1.2rem; }
.outro { font-family: var(--display); font-weight: 400;
  font-size: clamp(1.9rem, 4vw, 3rem); line-height: 1.18; letter-spacing: -0.025em;
  max-width: 26ch; margin: 0 auto; }
.outro-verd { color: var(--verdigris); }
.colophon-meta { margin-top: 2.4rem; font-family: var(--body); font-size: 0.8125rem;
  color: var(--muted); }

/* ---------------------------------------------------------------- tablet */
@media (max-width: 900px) {
  .claims { grid-template-columns: 1fr; gap: 1.8rem; }
  .modules { grid-template-columns: 1fr; }
  .stage { grid-template-columns: 170px 1fr; gap: 1rem; }
}

/* ---------------------------------------------------------------- mobile */
@media (max-width: 700px) {
  .hero h1 br { display: none; }

  .schematic { display: flex; flex-direction: column; align-items: stretch; }
  .rail { order: 0; }
  .rail-drop { height: 40px; }
  .station { width: 100%; }
  .st-working { order: 1; }
  .conn.c1 { order: 2; }
  .st-gate { order: 3; }
  .conn.c2 { order: 4; }
  .st-ltm { order: 5; }
  .refine-path { order: 6; }

  .conn { align-self: center; height: 58px; width: 0;
    border-top: none; border-left: 1.5px solid var(--muted); }
  .arrowhead.right { right: auto; left: -4.25px; top: auto; bottom: 1px; transform: rotate(135deg); }
  .pulse { left: -4px; top: 0; }
  .p-pass   { animation-name: pulse-pass-y; }
  .p-pass2  { animation-name: pulse-pass2-y; }
  .p-settle { animation-name: pulse-settle-y; }
  .drain { left: 22%; gap: 1px; }   /* beside the descending main flow: center = promotion, side = discharge */
  .drain-stub { height: 24px; }
  .drain-label { font-size: 0.56rem; }

  /* the return route is drawn as a riser beside c2; the label stays below the stack */
  .refine-riser { display: block; position: absolute; left: 30px; top: 0; height: 100%;
    border-left: 1.5px dashed var(--verdigris); }
  .refine-riser::after { content: "↺"; position: absolute; left: 6px; top: 50%;
    transform: translateY(-50%); font-family: var(--mono); font-size: 0.72rem;
    color: var(--verdigris); }
  .refine-riser .riser-head { left: -4.25px; top: -1px; }
  .p-refine-m { background: var(--verdigris); left: -4px; top: 0;
    animation: pulse-refine-m var(--cycle) linear infinite; }
  .refine-path { margin: 0.4rem 0 0; height: auto; position: static; }
  .refine-line { position: static; height: auto; border: none; text-align: center; }
  .refine-line .arrowhead.up { display: none; }
  .p-refine { display: none; }
  .refine-label { position: static; transform: none; display: block; text-align: center;
    white-space: normal; padding: 0.55rem 0 0; }
  .refine-label::before { content: "↺ "; }

  .exchange { padding: 1.1rem 1rem; font-size: 0.82rem; }
  .xc-line { gap: 0.7rem; }
  .xc-who { flex-basis: 3.6rem; }

  .stage { grid-template-columns: 1fr; gap: 0.35rem; padding: 1.15rem 0; }
  .spec-table th { white-space: normal; }
  .spec-table tr { display: block; padding: 0.55rem 0; border-bottom: 1px solid var(--hairline); }
  .spec-table th, .spec-table td { display: block; border: none; padding: 0.1rem 0; width: auto; }
  .titleblock { row-gap: 0.55rem; }
}

@keyframes pulse-pass-y {
  0%, 36% { opacity: 0; top: 0; }
  38%     { opacity: 1; }
  48%     { opacity: 1; top: calc(100% - 7px); }
  50%, 100% { opacity: 0; top: calc(100% - 7px); }
}
@keyframes pulse-pass2-y {
  0%, 8%  { opacity: 0; top: 0; }
  10%     { opacity: 1; }
  20%     { opacity: 1; top: calc(100% - 7px); }
  22%, 100% { opacity: 0; top: calc(100% - 7px); }
}
@keyframes pulse-settle-y {
  0%, 56% { opacity: 0; top: 0; }
  58%     { opacity: 1; }
  68%     { opacity: 1; top: calc(100% - 7px); }
  70%, 100% { opacity: 0; top: calc(100% - 7px); }
}
@keyframes pulse-refine-m {   /* re-grounding trace climbs back into the gate */
  0%, 10% { opacity: 0; top: calc(100% - 7px); }
  12%     { opacity: 1; }
  26%     { opacity: 1; top: 0; }
  30%, 100% { opacity: 0; top: 0; }
}

/* ---------------------------------------------------------------- motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .orbiter, .gate-core, .tick-new, .st-working, .st-gate, .st-ltm { animation: none; }
  .pulse { animation: none; opacity: 0; }
  .gate-check { animation: none; stroke-dashoffset: 0; opacity: 0.85; }
}
