/* The landing page: five short scenes on the tokens of site.css. Round shapes carry the story: an orbit of harnesses
   around the layer, a brain for the memory, a ring for each workflow and an arc of MCP servers. Everything reads
   without script; home.js adds the motion, and nothing moves under reduced motion (site.css). */

/* Shared pieces */
.cmd { display: flex; align-items: stretch; gap: var(--space-xs); padding: var(--space-2xs); border: 1px solid var(--color-rule-2); border-radius: 999px; background: color-mix(in srgb, var(--color-paper-2) 82%, transparent); backdrop-filter: blur(6px); container-type: inline-size; }
.cmd pre { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; padding: var(--space-xs) var(--space-md); font-size: var(--text-sm); line-height: 1.5; white-space: nowrap; overflow: hidden; border-radius: 999px; font-variant-ligatures: none; }
.cmd-prompt { color: var(--color-muted); user-select: none; }
.cmd .copy { align-self: center; border-radius: 999px; }

.sec-head { display: grid; gap: var(--space-md); justify-items: start; max-width: 46rem; margin-bottom: var(--space-3xl); }
.sec-head h2 { font-size: var(--text-section); line-height: 1.06; max-width: 20ch; }
.eyebrow { display: inline-flex; align-items: center; gap: var(--space-xs); font-size: var(--text-xs); font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-accent); }
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--color-accent); }
.lead { font-size: var(--text-lead); line-height: 1.55; color: var(--color-ink-2); max-width: 56ch; }
.lead code, .lede code, .memory-text code, .loops-foot code, .cap-plugs code, .phase-name code { font-size: 0.9em; color: var(--color-ink); }
.label { display: block; margin-bottom: var(--space-2xs); font-size: var(--text-sm); font-weight: 500; color: var(--color-ink-2); }
.go { display: inline-flex; align-items: center; min-height: 44px; color: var(--color-accent); font-weight: 500; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 0.25em; transition: text-decoration-color var(--dur-micro) var(--ease-out); }
.go:hover { text-decoration-color: currentColor; }
section { position: relative; }
main > section:not(.hero) { padding-block: var(--section-pad); }

/* Scroll reveal: only once home.js runs, so the page never hides content it cannot show again. */
:root.reveal-on .reveal { opacity: 0; transform: translateY(18px); transition: opacity 700ms var(--ease-settle), transform 700ms var(--ease-settle); }
:root.reveal-on .reveal.is-in { opacity: 1; transform: none; }

/* 1. Hero ---------------------------------------------------------------------------------------------------- */
.hero { overflow: hidden; padding-block: var(--space-3xl) var(--space-2xl); isolation: isolate; }
.aurora { position: absolute; inset: -20% -10% 0; z-index: -1; pointer-events: none; }
.aurora i { position: absolute; border-radius: 50%; }
.aurora i:nth-child(1) { width: 62vmax; height: 62vmax; left: 38%; top: -18%; background: radial-gradient(closest-side, var(--color-glow), transparent); animation: drift-a 22s var(--ease-io) infinite alternate; }
.aurora i:nth-child(2) { width: 48vmax; height: 48vmax; left: 58%; top: 22%; background: radial-gradient(closest-side, var(--color-glow-2), transparent 70%); opacity: 0.55; animation: drift-b 26s var(--ease-io) infinite alternate; }
.aurora i:nth-child(3) { width: 34vmax; height: 34vmax; left: 4%; top: 46%; background: radial-gradient(closest-side, var(--color-eye-glow), transparent 72%); opacity: 0.4; animation: drift-c 30s var(--ease-io) infinite alternate; }
@keyframes drift-a { to { transform: translate(-8%, 6%) scale(1.08); } }
@keyframes drift-b { to { transform: translate(-14%, -8%) scale(0.92); } }
@keyframes drift-c { to { transform: translate(10%, -12%) scale(1.15); } }

.hero-in { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: var(--space-3xl); align-items: center; min-height: min(760px, calc(100svh - var(--bar) - 180px)); }
.hero-copy { display: grid; gap: var(--space-lg); justify-items: start; }
.hero h1 { font-size: var(--text-display); line-height: 1.02; letter-spacing: -0.04em; max-width: 14ch; background: linear-gradient(180deg, var(--color-ink) 55%, color-mix(in srgb, var(--color-ink) 62%, var(--color-accent))); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lede { font-size: var(--text-lead); line-height: 1.55; color: var(--color-ink-2); max-width: 52ch; }
.install { width: 100%; max-width: 40rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: var(--space-sm); }
.btn { display: inline-flex; align-items: center; gap: var(--space-xs); min-height: 48px; padding-inline: var(--space-lg); border-radius: 999px; font-weight: 500; text-decoration: none; cursor: pointer; transition: transform var(--dur-micro) var(--ease-out), box-shadow var(--dur-short) var(--ease-out), border-color var(--dur-micro) var(--ease-out); }
.btn:active { transform: translateY(1px); }
.btn-solid { background: var(--color-ink); color: var(--color-paper); transition: transform var(--dur-micro) var(--ease-out), background var(--dur-short) var(--ease-out); }
.btn-solid:hover { background: color-mix(in srgb, var(--color-ink) 84%, var(--color-paper)); }
.btn-line { border: 1px solid var(--color-rule-2); color: var(--color-ink); background: color-mix(in srgb, var(--color-paper-2) 70%, transparent); }
.btn-line:hover { border-color: var(--color-accent); }
.btn-line .icon { width: 16px; height: 16px; fill: currentColor; stroke: none; }

/* The orbit: sizes are fractions of its own width (container units), so it scales as one picture. */
.orbit-fig { position: relative; display: grid; justify-items: center; gap: var(--space-md); }
.orbit { position: relative; width: min(560px, 100%); aspect-ratio: 1; container-type: inline-size; }
.orbit-rings i { position: absolute; left: 50%; top: 50%; border-radius: 50%; transform: translate(-50%, -50%); border: 1px solid var(--color-rule); }
.orbit-rings i:nth-child(1) { width: 84cqi; height: 84cqi; border-style: dashed; border-color: var(--color-rule-2); }
.orbit-rings i:nth-child(2) { width: 52cqi; height: 52cqi; }
.orbit-rings i:nth-child(3) { width: 100cqi; height: 100cqi; border-color: transparent; background: radial-gradient(closest-side, var(--color-glow-soft), transparent); }
.ring { position: absolute; inset: 0; }
.ring-agents { animation: spin 96s linear infinite; }
.ring-tools { animation: spin 140s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }
.agents { list-style: none; padding: 0; margin: 0; }
.orbit-item { position: absolute; left: 50%; top: 50%; width: var(--d); height: var(--d); margin: calc(var(--d) / -2) 0 0 calc(var(--d) / -2); transform: rotate(var(--a)) translate(var(--r)) rotate(calc(-1 * var(--a))); }
.agent-item { --d: clamp(48px, 15cqi, 84px); --r: 42cqi; }
.tool-item { --d: clamp(26px, 7.4cqi, 42px); --r: 26cqi; }
.ring-threads { pointer-events: none; }
.ring-agents .face { animation: spin 96s linear infinite reverse; }
.ring-tools .face { animation: spin 140s linear infinite; }
.face { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; background: var(--color-paper-2); border: 1px solid var(--color-rule-2); box-shadow: 0 10px 30px -14px var(--color-shadow); }
.tool-item .face img { width: 52%; height: 52%; }
.tool-item .face .icon { width: 52%; height: 52%; color: var(--color-ink-2); }
.agent { all: unset; box-sizing: border-box; display: block; width: 100%; height: 100%; border-radius: 50%; cursor: pointer; }
.agent .face img { width: 46%; height: 46%; }
.agent .face { transition: border-color var(--dur-short) var(--ease-out), box-shadow var(--dur-short) var(--ease-out), scale var(--dur-short) var(--ease-settle); }
.agent:hover .face { scale: 1.06; border-color: var(--color-accent); }
.agent:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 4px; }
.agent[aria-pressed="true"] .face { scale: 1.1; border-color: var(--hc, var(--color-accent)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--hc, var(--color-accent)) 22%, transparent), 0 12px 36px -10px var(--hc, var(--color-glow)); }
.agent-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.agent[data-harness="claude"] { --hc: var(--h-claude); }
.agent[data-harness="codex"] { --hc: var(--h-codex); }
.agent[data-harness="opencode"] { --hc: var(--h-opencode); }
.agent[data-harness="omp"] { --hc: var(--h-omp); }
.agent[data-harness="qwen"] { --hc: var(--h-qwen); }
.agent[data-harness="pi"] { --hc: var(--h-pi); }
.agent[data-harness="agy"] { --hc: var(--h-agy); }
.threads { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.thread { stroke: var(--color-accent); stroke-width: 0.25; opacity: 0.28; }
.spark { stroke: var(--color-accent); stroke-width: 0.6; stroke-linecap: round; stroke-dasharray: 3 30; stroke-dashoffset: 3; animation: flow 3.2s var(--ease-io) infinite; animation-delay: calc(var(--i) * -0.46s); }
.thread.is-on { opacity: 0.7; stroke-width: 0.4; }
.spark.is-on { stroke-width: 0.9; }
@keyframes flow { from { stroke-dashoffset: 3; } to { stroke-dashoffset: -21; } }
.core { position: absolute; left: 50%; top: 50%; width: 30cqi; height: 30cqi; transform: translate(-50%, -50%); display: grid; place-items: center; align-content: center; gap: 1.6cqi; border-radius: 50%; background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--color-from) 30%, var(--color-paper-2)), var(--color-paper-2) 70%); border: 1px solid color-mix(in srgb, var(--color-accent) 45%, transparent); box-shadow: 0 0 60px -10px var(--color-glow-2), inset 0 0 30px -12px var(--color-glow); }
.core img { width: 9cqi; height: 9cqi; image-rendering: pixelated; }
.core-name { font-size: clamp(11px, 2.6cqi, 15px); font-weight: 600; letter-spacing: -0.01em; }
.core-pulse { position: absolute; inset: 0; border-radius: 50%; border: 1px solid var(--color-accent); opacity: 0; animation: pulse 4.8s var(--ease-out) infinite; }
.core-pulse + .core-pulse { animation-delay: 2.4s; }
@keyframes pulse { 0% { transform: scale(1); opacity: 0.5; } 100% { transform: scale(1.75); opacity: 0; } }
.orbit-caption { display: grid; justify-items: center; gap: var(--space-2xs); min-height: 6.5em; max-width: 34rem; text-align: center; font-size: var(--text-sm); color: var(--color-ink-2); }
.orbit-caption > * { animation: swap var(--dur-long) var(--ease-settle); }
.cap-name { font-size: var(--text-lg); font-weight: 600; color: var(--color-ink); }
.cap-invoke code { color: var(--color-accent); }

.numbers { list-style: none; padding: var(--space-xl) 0 0; margin-top: var(--space-2xl); display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--space-lg); border-top: 1px solid var(--color-rule); }
.numbers li { display: grid; gap: var(--space-2xs); align-content: start; }
.num-v { font-size: clamp(2rem, 1.4rem + 1.6vw, 2.75rem); font-weight: 600; line-height: 1; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; color: var(--color-ink); }
.num-l { font-size: var(--text-sm); color: var(--color-ink-2); line-height: 1.4; max-width: 18ch; }

/* 2. Film ---------------------------------------------------------------------------------------------------- */
.film-sec .sec-head { justify-items: center; text-align: center; margin-inline: auto; }
.film { max-width: 1080px; margin-inline: auto; padding: 1px; border-radius: 28px; background: var(--color-rule-2); box-shadow: 0 40px 120px -40px var(--color-shadow); }
.film video { width: 100%; border-radius: 27px; background: #05060a; }

/* 3. Memory -------------------------------------------------------------------------------------------------- */
.memory-grid { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: var(--space-3xl); align-items: center; }
.memory .sec-head { margin-bottom: var(--space-lg); }
.memory-text { display: grid; gap: var(--space-md); color: var(--color-ink-2); max-width: 52ch; }
.brain-card { margin-top: var(--space-xl); display: grid; gap: var(--space-sm); padding: var(--space-lg); border-radius: 24px; border: 1px solid var(--color-rule-2); background: color-mix(in srgb, var(--color-paper-2) 88%, transparent); box-shadow: 0 24px 60px -32px var(--color-shadow); --sc: var(--color-accent); }
.brain-card[data-side="person"] { --sc: var(--color-eye); }
.brain-card > * { animation: swap var(--dur-long) var(--ease-settle); }
.bc-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs); }
.bc-kind { padding: 2px 10px; border-radius: 999px; background: color-mix(in srgb, var(--sc) 14%, transparent); color: var(--sc); font-size: var(--text-xs); }
.bc-layer { font-size: var(--text-xs); color: var(--color-ink-2); letter-spacing: 0.04em; text-transform: uppercase; }
.bc-title { font-size: var(--text-title); font-weight: 600; line-height: 1.3; letter-spacing: -0.02em; color: var(--color-ink); }
.bc-facts { display: grid; gap: var(--space-2xs); margin: 0; font-size: var(--text-sm); }
.bc-facts div { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.bc-facts dt { color: var(--color-muted); min-width: 7.5em; }
.bc-facts dd { margin: 0; color: var(--color-ink-2); overflow-wrap: anywhere; }
.bc-facts code { font-size: 0.92em; color: var(--color-ink); }
.bc-path { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs) var(--space-sm); padding-top: var(--space-sm); border-top: 1px solid var(--color-rule); font-size: var(--text-sm); color: var(--color-ink-2); }
.bc-agent { display: inline-flex; align-items: center; gap: var(--space-xs); }
.bc-agent img, .bc-agent .icon { width: 20px; height: 20px; }
.bc-agent b { color: var(--color-ink); font-weight: 600; }
.bc-arrow { width: 28px; height: 1px; background: linear-gradient(90deg, var(--color-rule-2), var(--sc)); position: relative; }
.bc-arrow::after { content: ""; position: absolute; right: -1px; top: -3px; border: 3.5px solid transparent; border-left-color: var(--sc); border-right: 0; }

.brain { position: relative; margin: 0; }
.brain-example { margin-bottom: var(--space-sm); font-size: var(--text-xs); color: var(--color-muted); text-align: center; }
.brain-stage { position: relative; }
.brain-svg { display: block; width: 100%; height: auto; overflow: visible; }
.hemi { position: absolute; top: 0; display: grid; gap: 2px; font-size: var(--text-sm); font-weight: 600; color: var(--color-ink); pointer-events: none; }
.hemi small { font-size: var(--text-xs); font-weight: 400; color: var(--color-ink-2); font-family: var(--font-mono); }
.hemi[data-side="project"] { left: 0; }
.hemi[data-side="person"] { right: 0; text-align: right; }
.hemi::before { content: ""; width: 10px; height: 10px; border-radius: 50%; margin-bottom: 4px; background: var(--color-accent); box-shadow: 0 0 10px var(--color-glow); }
.hemi[data-side="person"]::before { justify-self: end; background: var(--color-eye); box-shadow: 0 0 10px var(--color-eye-glow); }
.bg-in { stop-color: var(--color-glow); stop-opacity: 0.55; }
.bg-out { stop-color: var(--color-glow); stop-opacity: 0; }
.brain-shell { stroke-width: 1.4; }
.brain-shell[data-side="project"] { fill: color-mix(in srgb, var(--color-accent) 7%, var(--color-paper-2)); stroke: color-mix(in srgb, var(--color-accent) 55%, var(--color-rule-2)); }
.brain-shell[data-side="person"] { fill: color-mix(in srgb, var(--color-eye) 6%, var(--color-paper-2)); stroke: color-mix(in srgb, var(--color-eye) 55%, var(--color-rule-2)); }
.brain-folds path { fill: none; stroke: var(--color-ink); stroke-opacity: 0.11; stroke-width: 1.6; stroke-linecap: round; }
.bl { stroke: var(--color-ink); stroke-opacity: 0.16; stroke-width: 1; transition: stroke var(--dur-short) var(--ease-out), stroke-opacity var(--dur-short) var(--ease-out), stroke-width var(--dur-short) var(--ease-out); }
.bl-live { stroke: var(--color-accent); stroke-opacity: 0.6; stroke-dasharray: 5 60; animation: signal 5s linear infinite; animation-delay: var(--d); }
@keyframes signal { from { stroke-dashoffset: 65; } to { stroke-dashoffset: 0; } }
.bl.is-on { stroke: var(--sc, var(--color-accent)); stroke-opacity: 0.95; stroke-width: 1.8; }
.bn { fill: var(--color-ink-2); opacity: 0.45; animation: fire 7s ease-in-out infinite; animation-delay: var(--d); }
@keyframes fire { 0%, 86%, 100% { opacity: 0.4; } 92% { opacity: 1; fill: var(--color-accent); } }
.bm { cursor: pointer; outline: none; --sc: var(--color-accent); }
.bm[data-side="person"] { --sc: var(--color-eye); }
.bm-dot { fill: var(--sc); transition: r var(--dur-short) var(--ease-settle); }
.bm-ring { fill: color-mix(in srgb, var(--sc) 12%, transparent); stroke: var(--sc); stroke-opacity: 0.45; stroke-width: 1; transform-box: fill-box; transform-origin: center; transition: transform var(--dur-long) var(--ease-settle), stroke-opacity var(--dur-short) var(--ease-out); }
.bm:hover .bm-ring { transform: scale(1.15); stroke-opacity: 0.9; }
.bm.is-on .bm-ring { transform: scale(1.45); stroke-opacity: 1; animation: halo 2.4s var(--ease-out) infinite; }
.bm.is-on .bm-dot { r: 9px; }
.bm:focus-visible .bm-ring { stroke: var(--color-focus); stroke-width: 3; stroke-opacity: 1; }
@keyframes halo { 0%, 100% { fill: color-mix(in srgb, var(--sc) 14%, transparent); } 50% { fill: color-mix(in srgb, var(--sc) 32%, transparent); } }
.brain-list { margin-top: var(--space-2xl); font-size: var(--text-sm); color: var(--color-ink-2); }
.brain-list summary { display: inline-flex; align-items: center; min-height: 44px; cursor: pointer; color: var(--color-accent); }
.brain-list > ul { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-lg); margin-top: var(--space-md); }
.brain-list h3 { font-size: var(--text-md); margin-bottom: var(--space-xs); color: var(--color-ink); }
.brain-list li ul { list-style: none; padding: 0; }
.brain-list li li { padding-block: 3px; }

/* 4. Workflows ----------------------------------------------------------------------------------------------- */
.tablist { display: inline-flex; flex-wrap: wrap; gap: var(--space-2xs); padding: var(--space-2xs); margin-bottom: var(--space-2xl); border: 1px solid var(--color-rule-2); border-radius: 999px; background: color-mix(in srgb, var(--color-paper-2) 70%, transparent); }
.tab { min-height: 44px; padding-inline: var(--space-lg); border: 0; border-radius: 999px; background: transparent; color: var(--color-ink-2); cursor: pointer; transition: background var(--dur-short) var(--ease-out), color var(--dur-micro) var(--ease-out); }
.tab code { font-size: var(--text-sm); }
.tab:hover { color: var(--color-ink); background: var(--color-hover); }
.tab[aria-selected="true"] { color: var(--color-paper); background: var(--color-ink); }
.js [data-tabs] .tabpanel[data-later] { display: none; }
.tabpanel { animation: swap var(--dur-long) var(--ease-settle); }
.tabpanel:focus-visible { outline-offset: 8px; border-radius: 20px; }
.loop { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-3xl); align-items: center; }
:root:not(.js) .loop + .loop { margin-top: var(--space-4xl); }
.ring-fig { position: relative; width: min(500px, 100%); margin-inline: auto; aspect-ratio: 1; }
.ring-svg { width: 100%; height: 100%; overflow: visible; }
.ring-base { fill: none; stroke: var(--color-rule-2); stroke-width: 2; }
.ring-prog { fill: none; stroke-width: 3.5; stroke-linecap: round; stroke-dasharray: 0 1000; }
.stop-from { stop-color: var(--color-from); }
.stop-to { stop-color: var(--color-to); }
.ring-back { fill: none; stroke: var(--color-eye); stroke-width: 1.5; stroke-dasharray: 5 6; opacity: 0.8; }
.ring-arrow { fill: var(--color-eye); }
.rn circle, .rn rect { fill: var(--color-paper-2); stroke: var(--color-rule-2); stroke-width: 1.5; transition: stroke var(--dur-short) var(--ease-out), fill var(--dur-short) var(--ease-out); }
.rn text { font-family: var(--font-mono); font-size: 13px; fill: var(--color-ink-2); }
.rn.is-gate rect { stroke: color-mix(in srgb, var(--color-eye) 70%, var(--color-rule-2)); }
.rn.is-past circle, .rn.is-past rect { stroke: var(--color-accent); }
.rn.is-now circle, .rn.is-now rect { fill: var(--color-accent); stroke: var(--color-accent); }
.rn.is-now text { fill: var(--color-accent-ink); }
.ring-dot { fill: var(--color-accent); filter: drop-shadow(0 0 6px var(--color-glow-2)); }
.ring-centre { position: absolute; inset: 24%; display: grid; place-content: center; justify-items: center; gap: var(--space-2xs); text-align: center; }
.rc-k { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-muted); }
.rc-name { font-size: clamp(1.125rem, 0.85rem + 1vw, 1.625rem); font-weight: 600; line-height: 1.15; letter-spacing: -0.02em; text-wrap: balance; }
.rc-detail { font-size: var(--text-sm); color: var(--color-ink-2); }
.rc-name, .rc-detail { animation: swap var(--dur-short) var(--ease-settle); }
.loop-info { display: grid; gap: var(--space-lg); align-content: start; }
.loop-cmd { font-size: var(--text-section-s); line-height: 1.1; }
.loop-cmd code { color: var(--color-accent); }
.loop-when { color: var(--color-ink-2); max-width: 46ch; }
.phases { list-style: none; padding: 0; display: grid; gap: var(--space-2xs); }
.phase { display: flex; align-items: flex-start; gap: var(--space-sm); padding: var(--space-xs) var(--space-sm); border-radius: 14px; color: var(--color-ink-2); transition: background var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out); }
.phase-k { position: relative; flex-shrink: 0; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--color-rule-2); font-family: var(--font-mono); font-size: var(--text-xs); }
/* A gate is a diamond, as on the ring; the number stays upright inside it. */
.phase.is-gate .phase-k { border-color: transparent; }
.phase.is-gate .phase-k::before { content: ""; position: absolute; inset: 3px; border: 1px solid color-mix(in srgb, var(--color-eye) 70%, var(--color-rule-2)); border-radius: 4px; transform: rotate(45deg); }
.phase-text { display: grid; padding-top: 2px; }
.phase-detail { font-size: var(--text-xs); color: var(--color-muted); }
.phase.is-now { background: var(--color-accent-subtle); color: var(--color-ink); }
.phase.is-now .phase-k { border-color: var(--color-accent); color: var(--color-accent); }
.phase.is-gate.is-now .phase-k { border-color: transparent; }
.phase.is-gate.is-now .phase-k::before { border-color: var(--color-accent); }
.loop-return { display: flex; gap: var(--space-xs); align-items: flex-start; font-size: var(--text-sm); color: var(--color-ink-2); }
.loop-return .icon { color: var(--color-eye); margin-top: 2px; }
.loop-example code { display: inline-block; padding: var(--space-xs) var(--space-md); border-radius: 999px; border: 1px solid var(--color-rule-2); background: var(--color-paper-2); font-size: var(--text-sm); font-variant-ligatures: none; overflow-wrap: anywhere; }
.loops-foot { margin-top: var(--space-2xl); max-width: 70ch; font-size: var(--text-sm); color: var(--color-ink-2); }

/* 5. Tools --------------------------------------------------------------------------------------------------- */
.router { position: relative; display: grid; justify-items: center; gap: var(--space-md); }
.answers { width: min(44rem, 100%); min-height: 10.5rem; text-align: center; }
.answer { display: grid; justify-items: center; gap: var(--space-xs); animation: swap var(--dur-long) var(--ease-settle); }
.answer-q { display: grid; gap: var(--space-2xs); }
.answer-q .label { margin: 0; }
.answer-q-text { font-size: clamp(1.25rem, 0.95rem + 1vw, 1.75rem); font-weight: 600; line-height: 1.25; letter-spacing: -0.02em; color: var(--color-ink); text-wrap: balance; }
.answer-q-text::before { content: "\201C"; color: var(--color-accent); }
.answer-q-text::after { content: "\201D"; color: var(--color-accent); }
.answer-who { display: inline-flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: var(--space-xs); font-size: var(--text-sm); color: var(--color-ink-2); }
.answer-who code { color: var(--color-accent); font-weight: 600; }
.answer-who a { color: inherit; }
.answer-adds { color: var(--color-ink-2); max-width: 52ch; }
.router-stage { position: relative; width: 100%; height: 300px; }
.router-beam { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.router-beam path { fill: none; stroke: var(--color-accent); stroke-width: 1.5; stroke-dasharray: 4 7; opacity: 0.8; animation: beam 1.2s linear infinite; }
.router-beam circle { fill: var(--color-accent); filter: drop-shadow(0 0 6px var(--color-glow-2)); }
@keyframes beam { to { stroke-dashoffset: -11; } }
.servers { list-style: none; padding: 0; margin: 0; position: absolute; inset: 0; }
.servers li { position: absolute; left: var(--x); top: var(--y); transform: translateX(-50%); }
.srv { display: grid; justify-items: center; gap: var(--space-xs); padding: 0; border: 0; background: none; cursor: pointer; color: var(--color-ink-2); }
.srv-face { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; border: 1px solid var(--color-rule-2); background: var(--color-paper-2); box-shadow: 0 12px 30px -16px var(--color-shadow); transition: border-color var(--dur-short) var(--ease-out), box-shadow var(--dur-short) var(--ease-out), scale var(--dur-short) var(--ease-settle); }
.srv-face img { width: 30px; height: 30px; }
.srv-face .icon { width: 28px; height: 28px; color: var(--color-ink-2); }
.lsp-marks { display: grid; grid-template-columns: repeat(2, 14px); gap: 2px; }
.lsp-marks img { width: 14px; height: 14px; }
.srv-id { font-family: var(--font-mono); font-size: var(--text-xs); white-space: nowrap; }
.srv:hover .srv-face { border-color: var(--color-accent); scale: 1.05; }
.srv:focus-visible { outline: none; }
.srv:focus-visible .srv-face { outline: 2px solid var(--color-focus); outline-offset: 3px; }
.srv[aria-pressed="true"] { color: var(--color-ink); }
.srv[aria-pressed="true"] .srv-face { border-color: var(--color-accent); scale: 1.12; box-shadow: 0 0 0 5px var(--color-accent-subtle), 0 14px 40px -12px var(--color-glow-2); }

.strip-box { margin-top: var(--space-3xl); display: grid; gap: var(--space-md); }
.strip-label { text-align: center; font-size: var(--text-sm); color: var(--color-ink-2); }
.marquee { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee-track { display: flex; width: max-content; animation: marquee 48s linear infinite; }
.marquee:hover .marquee-track, .marquee:focus-within .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }
.strip { list-style: none; padding: 0 var(--space-xs) 0 0; margin: 0; display: flex; gap: var(--space-xs); }
.strip li { display: inline-flex; align-items: center; gap: var(--space-xs); min-height: 44px; padding: var(--space-2xs) var(--space-md) var(--space-2xs) var(--space-xs); border-radius: 999px; border: 1px solid var(--color-rule); background: color-mix(in srgb, var(--color-paper-2) 70%, transparent); font-size: var(--text-sm); white-space: nowrap; }
.strip li:not(:has(img)) { padding-left: var(--space-md); }
.strip img { width: 22px; height: 22px; }

.guards { margin: var(--space-3xl) auto 0; width: min(44rem, 100%); display: grid; gap: var(--space-md); }
.guards-title { font-size: var(--text-title); text-align: center; }
.guard-list { list-style: none; padding: 0; display: grid; gap: var(--space-xs); }
.guard { display: flex; align-items: center; gap: var(--space-sm); min-height: 56px; padding: var(--space-xs) var(--space-xs) var(--space-xs) var(--space-md); border-radius: 999px; border: 1px solid var(--color-rule-2); background: var(--color-paper-2); --vc: var(--color-alert); }
.guard[data-verdict="ask"] { --vc: var(--color-eye); }
.guard-tool .icon { color: var(--color-muted); }
.guard code { flex: 1 1 auto; min-width: 0; font-size: var(--text-sm); overflow-wrap: anywhere; font-variant-ligatures: none; }
.verdict { flex-shrink: 0; padding: var(--space-2xs) var(--space-md); border-radius: 999px; font-size: var(--text-sm); font-weight: 600; color: var(--vc); background: color-mix(in srgb, var(--vc) 14%, transparent); border: 1px solid color-mix(in srgb, var(--vc) 45%, transparent); }
:root.reveal-on .guards .verdict { opacity: 0; transform: scale(1.4); transition: opacity 360ms var(--ease-out), transform 520ms var(--ease-settle); }
:root.reveal-on .guards.is-in .verdict { opacity: 1; transform: none; }
:root.reveal-on .guards.is-in .guard:nth-child(2) .verdict { transition-delay: 450ms; }
:root.reveal-on .guards.is-in .guard:nth-child(3) .verdict { transition-delay: 900ms; }

/* Footer: the closing line, the open source band */
.foot-close { grid-column: 1 / -1; display: grid; justify-items: center; gap: var(--space-xl); padding-block: var(--space-3xl) var(--space-4xl); margin-bottom: var(--space-xl); border-bottom: 1px solid var(--color-rule); text-align: center; }
.foot-close h2 { font-size: var(--text-display); line-height: 1.04; max-width: 18ch; letter-spacing: -0.04em; }
.foot-close .cmd { width: 100%; max-width: 40rem; text-align: left; }
.oss { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: var(--space-xl) var(--space-3xl); padding-bottom: var(--space-2xl); margin-bottom: var(--space-md); border-bottom: 1px solid var(--color-rule); }
.oss-head { display: grid; gap: var(--space-sm); align-content: start; }
.oss h2 { font-size: var(--text-section-s); line-height: 1.1; }
.oss-head p { color: var(--color-ink-2); max-width: 46ch; }
.oss-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-xs); align-content: start; }
.oss-list a { display: inline-flex; align-items: center; gap: var(--space-xs); min-height: 44px; padding: var(--space-2xs) var(--space-md) var(--space-2xs) var(--space-sm); border: 1px solid var(--color-rule); border-radius: 999px; font-size: var(--text-sm); color: var(--color-ink-2); text-decoration: none; transition: border-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out); }
.oss-list a:hover { color: var(--color-ink); border-color: var(--color-accent); }
.oss-list img { width: 18px; height: 18px; }

/* Narrow screens */
@media (max-width: 60rem) {
  .hero-in, .memory-grid, .loop { grid-template-columns: minmax(0, 1fr); }
  .hero-in { min-height: 0; gap: var(--space-2xl); }
  .numbers { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .brain { order: -1; }
  .oss { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 40rem) {
  .hero { padding-top: var(--space-2xl); }
  .numbers { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-md); }
  .cmd { flex-wrap: wrap; border-radius: 20px; }
  .cmd pre { flex-basis: 100%; padding-inline: var(--space-2xs); font-size: min(var(--text-sm), 2.9cqi); }
  .cmd .copy { flex: 1 1 100%; border-radius: 14px; }
  .brain-list > ul { grid-template-columns: minmax(0, 1fr); }
  .tablist { display: flex; border-radius: 22px; }
  .tab { flex: 1 1 40%; padding-inline: var(--space-sm); }
  .router-stage { height: auto; }
  .router-beam { display: none; }
  .servers { position: static; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-lg) var(--space-xs); }
  .servers li { position: static; transform: none; display: grid; justify-items: center; }
  .answers { min-height: 13rem; }
  .guard { border-radius: 20px; flex-wrap: wrap; padding: var(--space-sm) var(--space-md); }
}
