/* The marketing home page. Its parts are prefixed mh- so they never collide with the shared mk- styles the
   other marketing pages use. The look is quiet on purpose: hairlines, monospaced annotations and one accent,
   so the moving parts (the murmuration, the demo, the exploded workflow) carry the page. */
.mh-hero, .mh-section, .mh-strip {
  --mh-ink: #16132b; --mh-muted: #5e5a7a; --mh-faint: #8a86a3; --mh-line: #e6e4f0; --mh-paper: #faf9fd; --mh-quiet: #f4f3f9;
  --mh-accent: #7c5cf0; --mh-accent-ink: #5b3fd6; --mh-accent-wash: #f1edfe; --mh-ai: #a21caf; --mh-ok: #15803d;
  --mh-mono: "JetBrains Mono", var(--bulma-family-code), monospace;
}

.mh-mono { font-family: var(--mh-mono); font-size: .75rem; color: var(--mh-faint); letter-spacing: 0; display: inline-flex; align-items: center; gap: .4rem; }

.mh-button { display: inline-flex; align-items: center; gap: .45rem; padding: .55rem .9rem; border: 1px solid #d9d6e8; border-radius: 7px; background: #fff; color: var(--mh-ink); font-size: .92rem; font-weight: 500; line-height: 1.2; cursor: pointer; transition: border-color .15s, background .15s, transform .15s; white-space: nowrap; }
.mh-button:hover { border-color: var(--mh-ink); color: var(--mh-ink); }
.mh-button:active { transform: translateY(1px); }
.mh-button .icon svg { width: .95em; height: .95em; }
.mh-button kbd { font-family: var(--mh-mono); font-size: .68rem; padding: .05rem .3rem; border: 1px solid rgba(255,255,255,.45); border-radius: 4px; background: transparent; color: inherit; }
.mh-button.is-primary { background: var(--mh-accent); border-color: var(--mh-accent); color: #fff; }
.mh-button.is-primary:hover { background: var(--mh-accent-ink); border-color: var(--mh-accent-ink); color: #fff; }
.mh-button.is-dark { background: var(--mh-ink); border-color: var(--mh-ink); color: #fff; }
.mh-button.is-dark:hover { background: #2a2548; color: #fff; }
.mh-button.is-small { padding: .4rem .7rem; font-size: .82rem; }

.mh-section { padding: 7rem 0; background: var(--mh-paper); color: var(--mh-ink); }
.mh-section.is-quiet { background: var(--mh-quiet); }
.mh-heading { margin-bottom: 3.5rem; }
.mh-heading h2 { font-size: clamp(2rem, 4.2vw, 3.3rem); font-weight: 650; letter-spacing: -.045em; line-height: 1.04; color: var(--mh-ink); }
.mh-heading p { margin-top: 1rem; font-size: 1.12rem; line-height: 1.6; color: var(--mh-muted); max-width: 42rem; }
.mh-heading.is-centered { text-align: center; }
.mh-heading.is-centered p { margin-left: auto; margin-right: auto; }
.mh-heading.is-split { display: flex; justify-content: space-between; align-items: flex-end; gap: 2rem; }

/* Hero */
.mh-hero { background: var(--mh-paper); color: var(--mh-ink); padding: 4.5rem 0 2rem; overflow: hidden; }
.mh-hero-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 2rem; align-items: center; min-height: min(78vh, 720px); }
.mh-hero h1 { font-size: clamp(2.6rem, 5.4vw, 4.6rem); font-weight: 650; letter-spacing: -.05em; line-height: 1; color: var(--mh-ink); }
.mh-lead { margin: 1.6rem 0 2rem; font-size: 1.18rem; line-height: 1.6; color: var(--mh-muted); max-width: 34rem; }
.mh-pill { display: inline-flex; align-items: center; gap: .55rem; margin-bottom: 2rem; padding: .3rem .75rem .3rem .6rem; border: 1px solid var(--mh-line); border-radius: 999px; background: #fff; font-size: .82rem; color: var(--mh-muted); }
.mh-pill:hover { color: var(--mh-ink); border-color: #cfcbe3; }
.mh-pill .icon svg { width: .85em; height: .85em; }
.mh-pill-dot { width: 7px; height: 7px; border-radius: 2px; background: var(--mh-accent); }
.mh-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.mh-agents { margin-top: 1.75rem; display: flex; align-items: center; gap: 1rem; font-size: .9rem; color: var(--mh-muted); }
.mh-agents > span { border-bottom: 1px dashed #c9c5dc; }
.mh-agent-icons { display: inline-flex; gap: .7rem; color: var(--mh-ink); }
.mh-agent-icons .icon svg { width: 1.05rem; height: 1.05rem; }

.mh-murmuration { position: relative; height: min(78vh, 680px); min-height: 480px; }
.mh-murmuration canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.mh-node-label { position: absolute; display: flex; align-items: center; gap: .5rem; font-family: var(--mh-mono); font-size: .72rem; color: #6b6787; white-space: nowrap; transform: translate(12px, -50%); opacity: 0; transition: opacity .6s ease, transform .6s cubic-bezier(.2,.8,.2,1); pointer-events: none; }
.mh-node-label i { width: 1.6rem; height: 1px; background: #bdb8d3; }
.mh-node-label span { background: var(--mh-paper); }
.mh-node-label.is-left { flex-direction: row-reverse; transform: translate(calc(-100% - 12px), -50%); }
.mh-node-label.is-start { transform: translate(18px, -50%); color: var(--mh-ink); }
.mh-node-label.is-ai { color: var(--mh-ai); }
.mh-node-label:not(.is-on) { opacity: 0; }
.mh-node-label.is-on { opacity: 1; }

.mh-strip { background: var(--mh-paper); padding: 2.5rem 0 3.5rem; border-bottom: 1px solid var(--mh-line); text-align: center; }
.mh-strip-items { margin-top: 1.25rem; display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem 2.5rem; color: var(--mh-muted); font-weight: 600; font-size: .95rem; }
.mh-strip-items > * { display: inline-flex; align-items: center; gap: .5rem; color: inherit; }
.mh-strip-items a:hover { color: var(--mh-accent-ink); }
.mh-strip-items .icon svg { width: 1.25em; height: 1.25em; }

/* The scripted demo */
.mh-demo { position: relative; }
.mh-window { position: relative; border: 1px solid var(--mh-line); border-radius: 16px; background: #fff; overflow: hidden; box-shadow: 0 40px 80px -40px rgba(22,19,43,.28), 0 0 0 6px rgba(124,92,240,.05); }
.mh-window-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 1rem; border-bottom: 1px solid var(--mh-line); font-size: .85rem; color: var(--mh-muted); }
.mh-crumbs { display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; min-width: 0; }
.mh-crumbs-root { display: inline-flex; align-items: center; gap: .4rem; }
.mh-crumbs strong { color: var(--mh-ink); font-weight: 600; }
.mh-crumbs .icon svg { width: .8em; height: .8em; }
.mh-version { font-family: var(--mh-mono); font-size: .7rem; padding: .1rem .45rem; border-radius: 5px; background: var(--mh-quiet); color: var(--mh-muted); }
.mh-window-actions { display: inline-flex; align-items: center; gap: .5rem; }
.mh-chip { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .55rem; border: 1px solid var(--mh-line); border-radius: 6px; font-family: var(--mh-mono); font-size: .72rem; }
.mh-run-button { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .7rem; border-radius: 6px; background: var(--mh-accent); color: #fff; font-weight: 600; font-size: .8rem; transition: transform .12s, box-shadow .3s; }
.mh-run-button.is-pressed { transform: scale(.94); box-shadow: 0 0 0 6px rgba(124,92,240,.18); }
.mh-run-button .icon svg { width: .85em; height: .85em; }

.mh-window-body { display: grid; grid-template-columns: 320px minmax(0, 1fr); height: 540px; }
.mh-chat { display: flex; flex-direction: column; border-right: 1px solid var(--mh-line); background: #fcfcfe; padding: 1rem; min-height: 0; }
.mh-chat-title { display: flex; align-items: center; gap: .4rem; font-size: .8rem; font-weight: 600; color: var(--mh-ink); margin-bottom: 1rem; }
.mh-chat-log { flex: 1; display: flex; flex-direction: column; gap: .75rem; overflow: hidden; }
.mh-bubble { font-size: .84rem; line-height: 1.5; padding: .65rem .8rem; border-radius: 10px; transition: opacity .35s, transform .35s cubic-bezier(.2,.8,.2,1); }
.mh-bubble.is-user { align-self: flex-end; max-width: 92%; background: var(--mh-ink); color: #fff; border-bottom-right-radius: 3px; }
.mh-bubble.is-assistant { background: #fff; border: 1px solid var(--mh-line); color: var(--mh-ink); display: flex; flex-direction: column; gap: .35rem; }
.mh-tool-call { display: flex; align-items: center; gap: .4rem; font-family: var(--mh-mono); font-size: .7rem; color: var(--mh-muted); transition: opacity .3s, transform .3s; }
.mh-tool-call em { margin-left: auto; font-style: normal; color: var(--mh-ok); }
.mh-tool-call .icon svg { width: .9em; height: .9em; }
.mh-composer { position: relative; margin-top: .75rem; min-height: 4.6rem; padding: .65rem 2.4rem .65rem .75rem; border: 1px solid #d9d6e8; border-radius: 10px; background: #fff; font-size: .84rem; line-height: 1.45; color: var(--mh-ink); }
.mh-caret { display: inline-block; width: 1px; height: 1em; margin-left: 1px; vertical-align: -2px; background: var(--mh-accent); animation: mh-blink 1s steps(1) infinite; }
.mh-send { position: absolute; right: .5rem; bottom: .5rem; display: grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 6px; background: var(--mh-ink); color: #fff; }
.mh-send .icon svg { width: .8rem; height: .8rem; }

.mh-canvas { position: relative; padding: 1.75rem; min-width: 0; background-color: #fff; background-image: radial-gradient(#dcd9ea 1px, transparent 1px); background-size: 18px 18px; overflow: hidden; }
.mh-canvas-empty { display: none; position: absolute; inset: 0; place-items: center; font-family: var(--mh-mono); font-size: .8rem; color: var(--mh-faint); }
.mh-steps { display: flex; flex-direction: column; align-items: stretch; width: min(360px, 100%); }
.mh-step { position: relative; display: flex; align-items: center; gap: .7rem; padding: .6rem .75rem; border: 1px solid var(--mh-line); border-radius: 10px; background: #fff; box-shadow: 0 6px 16px -10px rgba(22,19,43,.25); transition: opacity .35s, transform .45s cubic-bezier(.2,.8,.2,1), border-color .3s, box-shadow .3s; }
.mh-step-icon { display: grid; place-items: center; flex: none; width: 1.9rem; height: 1.9rem; border-radius: 7px; background: var(--mh-quiet); color: var(--mh-accent-ink); }
.mh-step.is-ai .mh-step-icon { background: #fbeafd; color: var(--mh-ai); }
.mh-step-icon .icon svg { width: .95rem; height: .95rem; }
.mh-step-text { display: flex; flex-direction: column; min-width: 0; }
.mh-step-text strong { font-size: .84rem; font-weight: 600; color: var(--mh-ink); }
.mh-step-text code { background: none; padding: 0; font-family: var(--mh-mono); font-size: .68rem; color: var(--mh-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mh-step-status { margin-left: auto; flex: none; width: .9rem; height: .9rem; border-radius: 50%; border: 1.5px solid #d9d6e8; transition: background .3s, border-color .3s; }
.mh-step-result { position: absolute; left: calc(100% + .75rem); top: 50%; transform: translate(-6px, -50%); white-space: nowrap; font-family: var(--mh-mono); font-size: .68rem; color: var(--mh-ok); opacity: 0; transition: opacity .35s, transform .35s; }
.mh-step.is-running { border-color: var(--mh-accent); box-shadow: 0 0 0 4px rgba(124,92,240,.12); }
.mh-step.is-running .mh-step-status { border-color: var(--mh-accent); border-right-color: transparent; animation: mh-spin .7s linear infinite; }
.mh-step.is-done .mh-step-status { border-color: var(--mh-ok); background: var(--mh-ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 6.2l2 2 4-4.4' fill='none' stroke='%23fff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 80% no-repeat; }
.mh-step.is-done .mh-step-result { opacity: 1; transform: translate(0, -50%); }
.mh-step-edge { align-self: center; width: 1px; height: 1.1rem; background: #cfcbe3; transform-origin: top; transition: transform .3s, opacity .3s; }

.mh-inspector { position: absolute; right: 1.25rem; top: 1.25rem; width: min(330px, 42%); padding: .9rem 1rem; border-radius: 12px; background: var(--mh-ink); color: #e6e3f8; box-shadow: 0 30px 60px -24px rgba(8,5,30,.55); transition: opacity .4s, transform .4s cubic-bezier(.2,.8,.2,1); }
.mh-inspector .mh-mono { color: #8f89b6; justify-content: space-between; width: 100%; }
.mh-inspector .mh-mono span { color: #c4b5fd; }
.mh-inspector pre { margin-top: .6rem; padding: 0; background: none; color: #e6e3f8; font-family: var(--mh-mono); font-size: .72rem; line-height: 1.6; white-space: pre-wrap; min-height: 9rem; }
.mh-cursor { position: absolute; z-index: 5; left: 50%; top: 80%; pointer-events: none; transition: left .9s cubic-bezier(.45,0,.2,1), top .9s cubic-bezier(.45,0,.2,1), opacity .25s; filter: drop-shadow(0 2px 3px rgba(0,0,0,.25)); }

/* Hidden until the demo reveals them. Without the controller everything shows as the finished scene. */
.mh-demo.is-live .mh-bubble:not(.is-shown), .mh-demo.is-live .mh-step:not(.is-shown), .mh-demo.is-live .mh-inspector:not(.is-shown) { opacity: 0; transform: translateY(8px); }
.mh-demo.is-live .mh-tool-call:not(.is-shown) { display: none; }
.mh-demo.is-live .mh-step-edge:not(.is-shown) { transform: scaleY(0); opacity: 0; }
.mh-demo.is-live .mh-canvas-empty.is-shown { display: grid; }
.mh-demo.is-live .mh-cursor:not(.is-shown) { opacity: 0; }
.mh-demo:not(.is-live) .mh-cursor { display: none; }
.mh-demo:not(.is-live) .mh-step .mh-step-result { opacity: 1; transform: translate(0, -50%); }

.mh-phases { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.5rem; margin-top: 1.75rem; }
.mh-phase { display: flex; flex-direction: column; gap: .35rem; padding: 0; border: none; background: none; text-align: left; font: inherit; color: var(--mh-faint); cursor: pointer; transition: color .3s; }
.mh-phase strong { color: var(--mh-muted); font-weight: 600; font-size: 1rem; transition: color .3s; }
.mh-phase > span:last-child { font-size: .88rem; line-height: 1.5; }
.mh-phase-bar { display: block; height: 2px; margin-bottom: .75rem; background: var(--mh-line); overflow: hidden; }
.mh-phase-bar i { display: block; height: 100%; width: 0; background: var(--mh-ink); }
.mh-phase.is-done .mh-phase-bar i { width: 100%; background: #b9b4d2; }
.mh-phase.is-active { color: var(--mh-muted); }
.mh-phase.is-active strong, .mh-phase:hover strong { color: var(--mh-ink); }
.mh-phase.is-active .mh-phase-bar i { animation: mh-progress var(--duration, 4s) linear forwards; }

/* Use-case picker */
.mh-picker { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 2rem; }
.mh-picker-rail { position: relative; display: flex; flex-direction: column; gap: 5.2rem; padding-top: .5rem; }
.mh-picker-rail::before { content: ""; position: absolute; left: 3px; top: 1.3rem; height: 5.4rem; width: 1px; background: #cfcbe3; }
.mh-rail-label { display: flex; align-items: center; gap: .8rem; font-weight: 500; color: var(--mh-ink); }
.mh-rail-label i { width: 7px; height: 7px; background: var(--mh-ink); }
.mh-rail-label.is-accent i { background: var(--mh-accent); }
.mh-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }
.mh-chip-button { display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .85rem; border: 1px solid var(--mh-line); border-radius: 999px; background: #fff; font: inherit; font-size: .88rem; color: var(--mh-muted); cursor: pointer; transition: border-color .2s, color .2s, box-shadow .2s; }
.mh-chip-button:hover { color: var(--mh-ink); }
.mh-chip-button.is-active { border-color: var(--mh-ink); color: var(--mh-ink); box-shadow: inset 0 0 0 .5px var(--mh-ink); }
.mh-chip-button .icon svg { width: .95em; height: .95em; }
.mh-prompt-card { border: 1px solid var(--mh-line); border-radius: 14px; background: #fff; box-shadow: 0 24px 48px -32px rgba(22,19,43,.25); }
.mh-prompt { display: none; padding: 1.6rem 1.6rem 1.1rem; }
.mh-prompt.is-active { display: block; animation: mh-fade-up .45s cubic-bezier(.2,.8,.2,1); }
.mh-prompt p { font-size: clamp(1.1rem, 1.8vw, 1.35rem); line-height: 1.5; color: var(--mh-ink); min-height: 6.2rem; }
.mh-prompt-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: 1.25rem; }
.mh-prompt-steps { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .3rem; margin-right: auto; }
.mh-prompt-steps code { padding: .15rem .45rem; border-radius: 5px; background: var(--mh-quiet); color: var(--mh-muted); font-family: var(--mh-mono); font-size: .68rem; }
.mh-prompt-steps code + code::before { content: "→ "; color: #bdb8d3; }
.mh-prompt-meta { display: flex; flex-wrap: wrap; gap: .5rem 2.5rem; padding: .85rem 1.6rem; border-top: 1px solid var(--mh-line); font-family: var(--mh-mono); font-size: .72rem; color: var(--mh-muted); }
.mh-prompt-meta em { font-style: normal; color: var(--mh-faint); margin-right: .6rem; }

/* The exploded workflow */
.mh-anatomy-section { overflow-x: clip; }
.mh-anatomy { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 3rem; }
.mh-anatomy-step { min-height: 78vh; display: flex; flex-direction: column; justify-content: center; opacity: .3; transition: opacity .5s; }
.mh-anatomy-step:first-child { min-height: 60vh; justify-content: flex-start; padding-top: 8vh; }
.mh-anatomy-step.is-current { opacity: 1; }
.mh-anatomy-step h3 { display: flex; align-items: center; gap: .7rem; font-size: 2rem; font-weight: 600; letter-spacing: -.035em; color: var(--mh-ink); }
.mh-anatomy-step h3 i { width: 9px; height: 9px; background: var(--mh-accent); }
.mh-anatomy-step p { margin-top: .85rem; font-size: 1.05rem; line-height: 1.6; color: var(--mh-muted); max-width: 30rem; }
.mh-anatomy-step ul { margin-top: 1.25rem; border-top: 1px solid var(--mh-line); max-width: 30rem; }
.mh-anatomy-step li { padding: .55rem 0; border-bottom: 1px solid var(--mh-line); font-family: var(--mh-mono); font-size: .76rem; color: var(--mh-muted); }

.mh-anatomy-visual { position: sticky; top: calc(50vh - 270px); height: 560px; }
.mh-iso-stage { position: absolute; inset: 0; display: grid; place-items: center; transform: translateX(-70px) scale(1.25); }
.mh-iso { position: relative; width: 300px; height: 300px; transform-style: preserve-3d; transform: translateY(40px) rotateX(58deg) rotateZ(-42deg); transition: transform 1.1s cubic-bezier(.2,.8,.2,1); }
.mh-iso * { transform-style: preserve-3d; }
.mh-iso-floor { position: absolute; inset: -90px -110px -120px -90px; background-image: radial-gradient(#cdc9e0 1.1px, transparent 1.2px); background-size: 16px 16px; mask-image: radial-gradient(closest-side, #000 55%, transparent); }

.mh-slab { position: absolute; left: 20px; top: calc(var(--i) * 56px); width: 270px; height: 42px; display: flex; align-items: center; gap: .6rem; padding: 0 .7rem; border: 1.5px solid var(--mh-ink); border-radius: 4px; background: #fff; transform: translateZ(8px); transition: transform .9s cubic-bezier(.2,.8,.2,1), opacity .6s, border-color .5s, background .5s; transition-delay: calc(var(--i) * 60ms); }
.mh-slab::before { content: ""; position: absolute; left: -1.5px; right: -1.5px; top: 100%; height: 8px; background: #e7e4f3; border: 1.5px solid var(--mh-ink); border-top: none; transform-origin: top; transform: rotateX(-90deg); }
.mh-slab::after { content: ""; position: absolute; top: -1.5px; bottom: -1.5px; left: 100%; width: 8px; background: #d6d1ea; border: 1.5px solid var(--mh-ink); border-left: none; transform-origin: left; transform: rotateY(90deg); }
.mh-slab-icon { display: grid; place-items: center; flex: none; width: 1.5rem; height: 1.5rem; border: 1px solid #cfcbe3; border-radius: 4px; color: var(--mh-ink); }
.mh-slab-icon .icon svg { width: .8rem; height: .8rem; }
.mh-slab-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.mh-slab-text strong { font-size: .78rem; font-weight: 600; color: var(--mh-ink); }
.mh-slab-text code { padding: 0; background: none; font-family: var(--mh-mono); font-size: .6rem; color: var(--mh-faint); white-space: nowrap; }
.mh-slab-check { margin-left: auto; display: grid; place-items: center; width: 1.1rem; height: 1.1rem; border-radius: 50%; background: var(--mh-ok); color: #fff; opacity: 0; transform: scale(.4); transition: opacity .3s, transform .3s; }
.mh-slab-check .icon svg { width: .6rem; height: .6rem; }
.mh-slab [data-anchor], .mh-sheet [data-anchor], .mh-layer [data-anchor] { position: absolute; right: 0; top: 50%; width: 1px; height: 1px; }
.mh-slab.is-ghost { --i: 3; opacity: 0; border-style: dashed; border-color: #bdb8d3; background: transparent; }
.mh-slab.is-ghost::before, .mh-slab.is-ghost::after { display: none; }
.mh-slab.is-ghost .mh-slab-text strong, .mh-slab.is-ghost .mh-slab-text code { color: #bdb8d3; }

.mh-sheet { position: absolute; left: 20px; width: 270px; padding: .7rem .85rem; border: 1px solid #bdb8d3; border-radius: 6px; background: rgba(255,255,255,.92); font-size: .72rem; line-height: 1.45; color: var(--mh-ink); transition: transform 1s cubic-bezier(.2,.8,.2,1), opacity .6s; }
.mh-sheet.is-prompt { top: -10px; transform: translateZ(170px); }
.mh-sheet.is-record { top: 288px; font-family: var(--mh-mono); font-size: .62rem; color: var(--mh-ok); border-color: #86efac; opacity: 0; transform: translateZ(8px); }
.mh-sheet [data-anchor].is-start, .mh-slab [data-anchor].is-start { right: auto; left: 0; }

.mh-layer { position: absolute; left: 20px; top: 112px; width: 270px; height: 42px; display: flex; align-items: center; padding: 0 .75rem; border: 1px dashed var(--mh-accent); border-radius: 4px; background: rgba(241,237,254,.88); opacity: 0; transform: translateZ(10px); transition: transform 1s cubic-bezier(.2,.8,.2,1), opacity .5s; transition-delay: calc(var(--j) * 70ms); }
.mh-layer code { padding: 0; background: none; font-family: var(--mh-mono); font-size: .58rem; color: var(--mh-accent-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mh-token { position: absolute; left: 6px; top: 14px; width: 12px; height: 12px; border-radius: 50%; background: var(--mh-accent); box-shadow: 0 0 0 5px rgba(124,92,240,.2), 0 0 18px rgba(124,92,240,.7); opacity: 0; transform: translateZ(14px); }

/* build */
.mh-anatomy[data-stage="build"] .mh-slab:not(.is-ghost) { animation: mh-drop .8s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i) * 120ms); }

/* bound: the model's step pulled apart into what bounds it */
.mh-anatomy[data-stage="bound"] .mh-iso { transform: translateY(70px) rotateX(58deg) rotateZ(-42deg); }
.mh-anatomy[data-stage="bound"] .mh-sheet.is-prompt { opacity: 0; transform: translateZ(260px); }
.mh-anatomy[data-stage="bound"] .mh-slab:not(.is-review) { opacity: .22; }
.mh-anatomy[data-stage="bound"] .mh-slab.is-review { border-color: var(--mh-ai); background: #fdf4ff; }
.mh-anatomy[data-stage="bound"] .mh-layer { opacity: 1; transform: translateZ(calc(48px + var(--j) * 40px)); }

/* run: a token walks the steps, each checks off, and the record lands underneath */
.mh-anatomy[data-stage="run"] .mh-sheet.is-prompt, .mh-anatomy[data-stage="improve"] .mh-sheet.is-prompt { opacity: 0; transform: translateZ(260px); }
.mh-anatomy[data-stage="run"] .mh-slab-check { opacity: 1; transform: scale(1); transition-delay: calc(.4s + var(--i) * .45s); }
.mh-anatomy[data-stage="run"] .mh-slab.is-review { border-color: var(--mh-ai); }
.mh-anatomy[data-stage="run"] .mh-token { opacity: 1; animation: mh-walk 2.6s cubic-bezier(.5,0,.5,1) infinite; }
.mh-anatomy[data-stage="run"] .mh-sheet.is-record { opacity: 1; transform: translateZ(8px); transition-delay: 2s; }

.mh-slab-text code.is-fixed { display: none; color: var(--mh-accent-ink); }
.mh-anatomy[data-stage="improve"] .mh-slab.is-rule code:not(.is-fixed) { display: none; }
.mh-anatomy[data-stage="improve"] .mh-slab.is-rule code.is-fixed { display: block; }

/* improve: the old rule stays as a ghost while the fixed version lifts onto its own branch */
.mh-anatomy[data-stage="improve"] .mh-slab.is-ghost { opacity: 1; transform: translateZ(2px); }
.mh-anatomy[data-stage="improve"] .mh-slab.is-rule, .mh-anatomy[data-stage="improve"] .mh-slab.is-alert { border-color: var(--mh-accent); background: var(--mh-accent-wash); transform: translate(60px, 0) translateZ(30px); }
.mh-anatomy[data-stage="improve"] .mh-slab.is-rule::before, .mh-anatomy[data-stage="improve"] .mh-slab.is-alert::before,
.mh-anatomy[data-stage="improve"] .mh-slab.is-rule::after, .mh-anatomy[data-stage="improve"] .mh-slab.is-alert::after { border-color: var(--mh-accent); background: #ddd3fc; }
.mh-anatomy[data-stage="improve"] .mh-slab.is-review .mh-slab-check { opacity: 1; transform: scale(1); }

.mh-annotation { position: absolute; z-index: 2; display: flex; align-items: center; gap: 0; font-family: var(--mh-mono); font-size: .7rem; line-height: 1.45; color: var(--mh-muted); white-space: nowrap; transform: translate(-4px, -50%); opacity: 0; pointer-events: none; transition: opacity .4s; }
.mh-annotation > i { flex: none; width: 8px; height: 8px; border: 1.5px solid var(--mh-ink); background: #fff; }
.mh-annotation > span { position: relative; margin-left: 2.25rem; padding: .1rem .3rem; background: var(--mh-paper); }
.mh-annotation > span::before { content: ""; position: absolute; right: 100%; top: 50%; width: 2.25rem; height: 1px; background: #a9a4c4; }
.mh-annotation.is-left { flex-direction: row-reverse; transform: translate(calc(-100% + 4px), -50%); }
.mh-annotation.is-left > span { margin-left: 0; margin-right: 2.25rem; }
.mh-annotation.is-left > span::before { right: auto; left: 100%; }
.mh-annotation.is-on { opacity: 1; transition-delay: .55s; }
.mh-annotation.is-diff { color: var(--mh-accent-ink); }
.mh-annotation.is-diff > i { border-color: var(--mh-accent); }

/* Version history */
.mh-history { position: relative; }
.mh-history-line { position: absolute; left: 0; top: 0; width: 100%; height: 120px; overflow: visible; }
.mh-history-line path { fill: none; stroke-width: 1.5; vector-effect: non-scaling-stroke; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.6s cubic-bezier(.4,0,.2,1); }
.mh-history-line .is-main { stroke: #cfcbe3; }
.mh-history-line .is-branch { stroke: var(--mh-accent); transition-delay: .9s; }
.mh-history.is-revealed .mh-history-line path { stroke-dashoffset: 0; }
.mh-history-tag { position: absolute; left: 0; top: 108px; font-family: var(--mh-mono); font-size: .68rem; color: var(--mh-faint); }
.mh-history-tag.is-branch { left: 54%; top: -2px; color: var(--mh-accent-ink); }
.mh-history-items { position: relative; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.mh-history-item { position: relative; padding: 140px 1.5rem 0 0; }
.mh-history-dot { position: absolute; left: -5px; top: 95px; width: 11px; height: 11px; border: 1.5px solid var(--mh-ink); background: #fff; transform: scale(0); transition: transform .4s cubic-bezier(.2,.8,.2,1); transition-delay: calc(.3s + var(--i) * .25s); }
.mh-history-item:nth-child(4) .mh-history-dot { top: 18px; border-color: var(--mh-accent); background: var(--mh-accent); }
.mh-history.is-revealed .mh-history-dot { transform: scale(1); }
.mh-history-item > .icon svg { width: 1.1rem; height: 1.1rem; color: var(--mh-ink); }
.mh-history-item:nth-child(4) > .icon svg { color: var(--mh-accent); }
.mh-history-item h3 { margin-top: .9rem; font-size: 1.05rem; font-weight: 600; letter-spacing: -.02em; color: var(--mh-ink); }
.mh-history-item p { margin-top: .35rem; font-size: .9rem; line-height: 1.55; color: var(--mh-muted); }

/* Production grid and models */
.mh-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--mh-line); border-bottom: 1px solid var(--mh-line); }
.mh-grid-cell { padding: 2rem 1.75rem 2.25rem; border-left: 1px solid var(--mh-line); }
.mh-grid-cell:first-child { border-left: none; padding-left: 0; }
.mh-grid-cell .icon svg { width: 1.5rem; height: 1.5rem; color: var(--mh-ink); }
.mh-grid-cell h3 { margin-top: 1.25rem; font-size: 1.15rem; font-weight: 600; letter-spacing: -.02em; color: var(--mh-ink); }
.mh-grid-cell p { margin-top: .5rem; font-size: .9rem; line-height: 1.6; color: var(--mh-muted); }
.mh-models { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 3rem; align-items: start; margin-top: 4rem; }
.mh-models > div p:last-child { margin-top: .75rem; font-size: 1rem; line-height: 1.6; color: var(--mh-muted); }
.mh-models table { width: 100%; border-collapse: collapse; font-size: .85rem; color: var(--mh-ink); caption-side: bottom; }
.mh-models th { padding: 0 0 .6rem; border-bottom: 1px solid var(--mh-line); font-family: var(--mh-mono); font-size: .7rem; font-weight: 500; color: var(--mh-faint); text-align: left; }
.mh-models td { padding: .55rem 0; border-bottom: 1px solid var(--mh-line); }
.mh-models th + th, .mh-models td + td { text-align: right; font-family: var(--mh-mono); font-size: .78rem; }
.mh-models caption { padding-top: .6rem; text-align: left; font-family: var(--mh-mono); font-size: .7rem; color: var(--mh-faint); }

@keyframes mh-blink { 50% { opacity: 0; } }
@keyframes mh-spin { to { transform: rotate(360deg); } }
@keyframes mh-progress { from { width: 0; } to { width: 100%; } }
@keyframes mh-fade-up { from { opacity: 0; transform: translateY(6px); } }
@keyframes mh-drop { from { opacity: 0; transform: translateZ(90px); } to { opacity: 1; transform: translateZ(8px); } }
@keyframes mh-walk {
  0% { top: 14px; opacity: 0; } 8% { opacity: 1; }
  92% { top: 238px; opacity: 1; } 100% { top: 238px; opacity: 0; }
}

@media (max-width: 1023px) {
  .mh-hero { padding-top: 3rem; }
  .mh-hero-grid { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .mh-murmuration { height: 520px; min-height: 0; }
  .mh-heading.is-split { flex-direction: column; align-items: flex-start; }
  .mh-window-body { grid-template-columns: minmax(0, 1fr); height: auto; }
  .mh-chat { border-right: none; border-bottom: 1px solid var(--mh-line); height: 300px; }
  .mh-canvas { min-height: 420px; }
  .mh-phases { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mh-picker { grid-template-columns: minmax(0, 1fr); }
  .mh-picker-rail { display: none; }
  .mh-anatomy { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .mh-anatomy-visual { order: -1; top: 3.25rem; z-index: 3; height: 380px; background: linear-gradient(var(--mh-paper) 88%, transparent); }
  .mh-iso-stage { transform: scale(.68); }
  .mh-anatomy-step, .mh-anatomy-step:first-child { min-height: 70vh; padding-top: 0; justify-content: center; }
  .mh-annotation { font-size: .62rem; }
  .mh-history-line, .mh-history-tag { display: none; }
  .mh-history-items { grid-template-columns: minmax(0, 1fr); gap: 1.75rem; padding-left: 1.75rem; border-left: 1.5px solid #cfcbe3; }
  .mh-history-item { padding: 0; }
  .mh-history-dot, .mh-history-item:nth-child(4) .mh-history-dot { left: calc(-1.75rem - 6.5px); top: .2rem; }
  .mh-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mh-grid-cell:nth-child(3) { border-left: none; padding-left: 0; }
  .mh-grid-cell:nth-child(n + 3) { border-top: 1px solid var(--mh-line); }
  .mh-models { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
}

@media (max-width: 640px) {
  .mh-section { padding: 4.5rem 0; }
  .mh-murmuration { height: 440px; }
  .mh-node-label { font-size: .62rem; }
  .mh-node-label i { width: .8rem; }
  .mh-inspector { position: relative; right: auto; top: auto; width: 100%; margin-top: 1.25rem; }
  .mh-step-result { display: none; }
  .mh-phases { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .mh-window-bar .mh-chip, .mh-crumbs-root { display: none; }
  .mh-chat { height: 380px; }
  .mh-annotation { display: none; }
  .mh-grid { grid-template-columns: minmax(0, 1fr); }
  .mh-grid-cell, .mh-grid-cell:nth-child(3) { border-left: none; padding-left: 0; border-top: 1px solid var(--mh-line); }
  .mh-grid-cell:first-child { border-top: none; }
  .mh-iso-stage { transform: scale(.56); }
}

@media (prefers-reduced-motion: reduce) {
  .mh-iso, .mh-slab, .mh-layer, .mh-sheet, .mh-step, .mh-bubble { transition: none; }
  .mh-anatomy[data-stage] .mh-slab, .mh-anatomy[data-stage] .mh-token { animation: none; }
  .mh-phase.is-active .mh-phase-bar i { animation: none; width: 100%; }
}
