/* engineering-loops.css — "Engineering Loops" interactive AI Lab explainer.
   Tokens only (base.css :root). Everything is loops- prefixed. Section-commented. */

:root {
    --loops-prompt:  #F2B138;
    --loops-context: var(--accent);
    --loops-harness: #a78bfa;
    --loops-harness-light: #c9bbfd; /* lighter than --loops-harness — small connector labels ("write", "rehydrate")
        need more contrast than the base accent gives them to survive lossy re-compression (e.g. LinkedIn) */
    --loops-caption-light: #a3a3a3; /* lighter than --ink-muted, same reason, for gray (non-accent) captions */
    --loops-loop:    #4F9CFF; /* blue — distinct from prompt/context/harness; old green sat too close to context's teal */
    --loops-loop-glow: rgba(79, 156, 255, 0.45); /* toned-down, ALWAYS-ON version of the loop accent —
        unlike GLOW.loop (a travelDot's transient drop-shadow), this one never turns off */
    --loops-result:  #F59E0B; /* "tool result" docs — accumulation/rot warning, not failure red */
}

/* ─── page frame ─────────────────────────────────────────────────────────────── */

.loops-lab-page {
    background: var(--bg);
    color: var(--ink);
    min-height: calc(100vh / var(--page-zoom, 1));
}

#loops-main {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: calc(var(--nav-h) + var(--space-6)) var(--space-6) var(--space-12);
}

.loops-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    margin-top: var(--space-16);
    padding-top: var(--space-6);
    border-top: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--ink-muted);
}
.loops-footer-back {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--accent);
    text-decoration: none;
    transition: gap var(--dur-fast, 0.15s) var(--ease-out, ease);
}
.loops-footer-back:hover { gap: var(--space-3); }

/* ─── header ─────────────────────────────────────────────────────────────────── */

.loops-header { margin-bottom: var(--space-6); }
.loops-tag {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--accent);
    letter-spacing: 0.04em;
    margin: 0 0 var(--space-2);
}
.loops-h1 {
    font-family: var(--font-sans);
    font-size: clamp(1.8rem, 4vw, var(--text-3xl));
    font-weight: 700;
    line-height: 1.05;
    margin: 0;
}
.loops-sub {
    margin: var(--space-3) 0 0;
    /* wide enough to keep the shortened intro.sub copy on one line at the page's normal
       content width (--max-w: 1200px); still wraps gracefully on narrow viewports */
    max-width: 100ch;
    color: var(--ink-muted);
    font-size: var(--text-base);
    line-height: 1.55;
}

/* ─── body: diagram takes centre stage, detail reads below ───────────────────── */

.loops-stagewrap {
    position: relative;
    /* pure black, same as the Expand overlay — --bg-card (a lighter charcoal) gave the
       inline diagram a slight "glaze" next to the fullscreen view's cleaner true black */
    background: var(--bg);
    border: 1px solid var(--border-strong);
    border-radius: 16px;
    padding: var(--space-5);
}
.loops-svg {
    width: 100%;
    height: auto;
    /* Cap the inline stage so a tall late-layer viewBox can't push the controls below
       the fold. ~340px reserves room for the site nav + lab header + narration panel +
       controls + gaps; the 320px floor keeps it legible on short windows. The SVG's
       preserveAspectRatio (xMidYMid meet) scales the drawing down to fit and centres it.
       Fullscreen (.is-max) overrides this below via higher specificity. */
    max-height: max(320px, calc(100vh - 340px));
    display: block;
    margin-inline: auto; /* centre the letterboxed drawing in the full-width panel */
    overflow: visible;
}

/* max-mode toggle (expand → full-viewport overlay) */
.loops-max {
    position: absolute;
    top: var(--space-3);
    right: var(--space-3);
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 10px;
    border: 1px solid var(--border-strong);
    background: var(--bg-card);
    color: var(--ink-muted);
    cursor: pointer;
    transition: border-color var(--dur-fast, 0.15s) var(--ease-out, ease), color var(--dur-fast, 0.15s) var(--ease-out, ease);
}
.loops-max:hover { border-color: var(--accent); color: var(--accent); }
.loops-max-glyph { font-size: var(--text-lg); line-height: 1; }

/* begin gate — default landing holds on a plain black stage until the visitor clicks;
   nothing animates or even renders underneath, so the overlay is fully opaque (no
   diagram bleeding through behind the button) rather than a translucent scrim. Skipped
   entirely on a deep link (e.g. #context), where arriving is already the explicit
   action. */
.loops-begin-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    border-radius: 16px;
}
.loops-begin-btn {
    font-family: var(--font-mono);
    font-size: var(--text-lg);
    color: var(--accent);
    background: var(--bg-card);
    border: 1px solid var(--accent);
    border-radius: 999px;
    padding: var(--space-3) var(--space-6);
    cursor: pointer;
    transition: background var(--dur-fast, 0.15s) var(--ease-out, ease), box-shadow var(--dur-fast, 0.15s) var(--ease-out, ease), transform var(--dur-fast, 0.15s) var(--ease-out, ease);
}
.loops-begin-btn:hover { background: var(--accent-soft); box-shadow: 0 0 20px var(--accent-glow); transform: translateY(-1px); }

.loops-stagewrap.is-max {
    position: fixed;
    inset: 0;
    z-index: 200;
    margin: 0;
    border: none;
    border-radius: 0;
    padding: clamp(var(--space-6), 4vw, var(--space-12));
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg); /* fully opaque — a translucent backdrop here let the page's
        header/chart/controls bleed through faintly behind the expanded diagram */
}
.loops-stagewrap.is-max {
    touch-action: none; /* pointer events below own pinch/pan — don't let the browser's
        native touch scroll/zoom fight with it */
}
.loops-stagewrap.is-max .loops-svg {
    width: auto;
    height: auto;
    max-width: 96vw;
    max-height: 90vh;
    transform-origin: center center;
    transition: transform 0.15s ease; /* smooths wheel/button zoom steps; skipped for
        active dragging below so panning tracks the pointer with no lag */
}
.loops-stagewrap.is-max .loops-max {
    top: var(--space-5);
    right: var(--space-5);
    z-index: 210;
}
.loops-stagewrap.is-max.is-zoomed .loops-svg { cursor: grab; }
.loops-stagewrap.is-max.is-dragging .loops-svg { cursor: grabbing; transition: none; }

/* zoom controls — only meaningful inside the Expand overlay; wheel/pinch alone is easy
   to miss, so this is the discoverable/keyboard-reachable equivalent */
.loops-zoom-controls {
    display: none;
    position: absolute;
    bottom: var(--space-5);
    right: var(--space-5);
    z-index: 210;
    gap: var(--space-2);
}
.loops-stagewrap.is-max .loops-zoom-controls { display: flex; }
.loops-zoom-btn {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid var(--border-strong);
    background: var(--bg-card);
    color: var(--ink-muted);
    font-family: var(--font-mono);
    font-size: var(--text-base);
    cursor: pointer;
    transition: border-color var(--dur-fast, 0.15s) var(--ease-out, ease), color var(--dur-fast, 0.15s) var(--ease-out, ease);
}
.loops-zoom-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ─── per-layer scenes ───────────────────────────────────────────────────────── */

.loops-scene text { pointer-events: none; }
.loops-glyph { fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.loops-figure { stroke-width: 2.6; }
.loops-dot { pointer-events: none; }

/* additive layers: each fades in/out as a whole; steps stagger inside it */
.loops-layer { transition: opacity var(--dur-med, 0.35s) var(--ease-out, ease); }
.loops-loop-frame { stroke-width: 2; fill: none; opacity: 0.6; }

/* captions + mono labels */
.loops-cap { fill: var(--ink-muted); font-family: var(--font-mono); font-size: 15px; }
.loops-cap-strong { fill: var(--ink); }
.loops-node-mono { fill: var(--ink); font-family: var(--font-mono); font-size: 15px; }
.loops-harness-cap { fill: var(--loops-harness); font-family: var(--font-mono); font-size: 15px; font-weight: 600; }
/* lighter than the base harness accent — small edge verbs ("write", "rehydrate",
   "read next / mark done") need more contrast than a big discipline title does */
.loops-harness-note { fill: var(--loops-harness-light); font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; letter-spacing: 0.01em; }
/* trigger/guard on an edge (e.g. "full / rotting? → compact") — same colour family as the
   verb it gates (loops-harness purple), just dimmed + smaller, so it reads as belonging to
   that edge rather than a disconnected grey note. ink-muted/ink-subtle read as ghosted here. */
.loops-harness-guard { fill: var(--loops-harness); opacity: 0.9; font-family: var(--font-mono); font-size: 12.5px; font-weight: 500; letter-spacing: 0.01em; }
/* muted caption on or beside an edge/node (e.g. "persists across runs", "becomes the next
   window") — lighter than the base ink-muted so it survives lossy re-compression */
.loops-harness-caption { fill: var(--loops-caption-light); font-family: var(--font-mono); font-size: 12.5px; font-weight: 500; letter-spacing: 0.01em; }
/* every discipline's own subtitle — its operating cadence, directly under its name. fill is
   left unset here so each usage's inline `fill` attribute (that layer's own accent color)
   applies, rather than a single shared color; opacity keeps it secondary to the bold
   uppercase discipline title above it. Shared by all four layers (prompt/context/harness/
   loop) so none of them can drift out of sync with the others' size/spacing/format. */
.loops-layer-tagline { font-family: var(--font-mono); font-size: 13px; font-weight: 400; opacity: 0.72; }
/* supervisor's tether to harness — thin + dashed + no arrowhead, reading as watching,
   not driving (contrast with the trigger's solid connector, which does drive a run) */
.loops-supervise-line { stroke: var(--ink-subtle); stroke-width: 1.2; stroke-dasharray: 3 4; fill: none; }
/* frame around the loop layer's own problem annotation — loop-accent stroke marks it as
   this layer's gap, distinct from a stray note floating in the shared margin */
.loops-loop-problem-frame { stroke-width: 1.5; fill: none; opacity: 0.6; }
/* one-word role under each "it grows itself" pill, in the loop accent */
.loops-loop-subrole { fill: var(--loops-loop); font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.01em; }
/* loop layer — the done-gate + its feedback arc (the "runs until done" stopping rule).
   The rect carries its blue stroke inline (matches the animated flash's resting width). */
.loops-done-gate { stroke-width: 1.6; fill: none; }
/* the "not yet → loop again" return leg and the "done → ship it" exit, both recoloured to
   the loop accent so the stopping rule reads as one blue circuit; the short "output" drop
   off the harness stays neutral (it's just the run's result flowing out to be checked) */
.loops-feedback-arc .loops-conn-line,
.loops-done-edge .loops-conn-line { stroke: var(--loops-loop); }
/* the ✓ on the "done, ship it" branch — loop-accent blue, mirroring the red ✗ on "not yet" */
.loops-done-yes { fill: var(--loops-loop); font-weight: 700; }

/* task list — done state */
.loops-task-rect, .loops-task-label { transition: opacity 0.25s ease; }
.loops-task-check { fill: var(--loops-loop); font-family: var(--font-mono); font-size: 14px; opacity: 0; transition: opacity 0.25s ease; }
.loops-task.is-done .loops-task-label { text-decoration: line-through; opacity: 0.55; }
.loops-task.is-done .loops-task-rect { opacity: 0.55; }
.loops-task.is-done .loops-task-check { opacity: 1; }

/* connectors + arrowheads */
.loops-conn-line {
    stroke: var(--ink-muted);
    stroke-width: 1.8;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: miter; /* sharp right-angle bends — these are orthogonal connectors, not curves */
}
/* the LLM panel (Claude + Gemini) */
.loops-llm-rect { stroke-width: 2.4; fill: none; transition: filter var(--dur-fast, 0.15s) var(--ease-out, ease); }
.loops-llm.is-lit .loops-llm-rect { filter: drop-shadow(0 0 9px var(--accent-glow)); }
.loops-llm-title { fill: var(--ink); font-family: var(--font-sans); font-weight: 700; font-size: 26px; }
.loops-brand { overflow: visible; }

/* MCP badge on the gather-context arrow — monochrome, annotates without competing,
   but still needs to actually read against the dark canvas */
.loops-mcp-badge { color: var(--ink); opacity: 0.9; }

/* tagline under a scene */
.loops-tagline { fill: var(--ink-muted); font-family: var(--font-mono); font-size: 16px; font-style: italic; }

/* prompt: retry note */
.loops-retry-x { fill: var(--danger); font-weight: 700; }
.loops-retry-loop { fill: var(--accent); font-weight: 700; }
.loops-hand-loop { stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }

/* context: the window, its fill, docs, drift */
.loops-ctx-win { stroke-width: 2.2; fill: none; }
.loops-ctx-fill { fill: rgba(199, 166, 255, 0.14); }
.loops-ctx-full { fill: var(--danger); font-family: var(--font-mono); font-weight: 700; font-size: 18px; letter-spacing: 0.04em; }
.loops-doc { stroke-width: 1.8; }
.loops-doc.is-result { stroke: var(--loops-result); }
.loops-doc-label { fill: var(--ink-subtle); font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.03em; }
.loops-ctx-dash { stroke: var(--ink-subtle); stroke-width: 1.6; stroke-dasharray: 7 7; }
.loops-ctx-cap { fill: var(--ink-subtle); }

/* the "loop" keyword — always the loop-blue so it stands out wherever it appears, plus a
   persistent soft glow (same drop-shadow technique .loops-llm.is-lit uses, just always-on
   rather than class-toggled, since this word is meant to read as "lit" everywhere). The
   word BEFORE it ("prompt"/"agent"/"orchestration") is handled separately at each call
   site — white, so it reads clearly against its own layer's accent instead of blending in. */
.loops-kw { fill: var(--loops-loop); font-weight: 700; filter: drop-shadow(0 0 3px var(--loops-loop-glow)); }
.loops-agentloop { fill: var(--ink); }

/* the standalone "↻" glyph + its ping rings — see loopGlyph() in engineering-loops.js.
   Motion is CSS, NOT GSAP: `transform-box: fill-box` resolves the pivot at paint time
   against the element's own box, so the glyph always spins in place (GSAP's inline
   transform + getBBox-at-init pivoted on the SVG origin and orbited the whole canvas).
   The Pause button freezes these via animation-play-state (.loops-lab.is-paused below). */
.loops-loop-glyph-wrap { pointer-events: none; }
.loops-loop-glyph {
    transform-box: fill-box;
    transform-origin: center;
    animation: loops-loop-spin 3.4s linear infinite;
}
.loops-loop-ring {
    fill: none;
    stroke-width: 1.4;
    opacity: 0;
    transform-box: fill-box;
    transform-origin: center;
    animation: loops-loop-ping 2.5s ease-out infinite;
}
@keyframes loops-loop-spin { to { transform: rotate(360deg); } }
@keyframes loops-loop-ping {
    0%   { transform: scale(0.6); opacity: 0.5; }
    88%  { transform: scale(1.6); opacity: 0; }
    100% { transform: scale(1.6); opacity: 0; }
}
/* Pause button freezes every CSS-driven glyph/ring animation in step with GSAP + audio. */
.loops-lab.is-paused .loops-loop-glyph,
.loops-lab.is-paused .loops-loop-ring { animation-play-state: paused; }

/* discipline boundaries: soft, solid-edged highlighted regions that name each
   territory — a dim colour wash (inline fill) inside a dim solid border, so
   additive layers read as gentle highlighted zones rather than busy wireframes. */
.loops-bound { stroke-width: 1.5; stroke-opacity: 0.45; }
.loops-bound-label {
    font-family: var(--font-mono);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.9;
}

/* context: the summarize step, made prominent */
.loops-ctx-step { font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: 0.01em; }
.loops-ctx-summ { fill: var(--loops-prompt); }

/* harness + loop scenes */
.loops-taskbar { stroke-width: 1.8; fill: none; }
.loops-toolgrid rect { stroke-width: 1.8; }
.loops-cycle-ring { stroke-width: 2.4; fill: none; opacity: 0.55; }
.loops-chip-rect { stroke-width: 1.8; fill: none; }
.loops-chip-svg-label { fill: var(--ink); font-family: var(--font-mono); font-size: 14px; }

/* ─── controls ───────────────────────────────────────────────────────────────── */

.loops-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-top: var(--space-6);
}
.loops-btn {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--ink);
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    padding: var(--space-2) var(--space-4);
    cursor: pointer;
    transition: border-color var(--dur-fast, 0.15s) var(--ease-out, ease), color var(--dur-fast, 0.15s) var(--ease-out, ease);
}
.loops-btn:hover { border-color: var(--accent); color: var(--accent); }
.loops-tour { color: var(--accent); border-color: var(--accent); }
.loops-tour.is-playing { background: var(--accent-soft); }

/* "Ready to advance" cue: pulse Next (or Restart on the last layer) once a layer's
   narration finishes, so the user knows the walkthrough is done and can move on. */
.loops-next.is-ready {
    border-color: var(--accent);
    color: var(--accent);
    animation: loops-btn-pulse 1.6s ease-in-out infinite;
}
@keyframes loops-btn-pulse {
    0%, 100% { box-shadow: 0 0 0 rgba(0, 0, 0, 0); }
    50%      { box-shadow: 0 0 16px var(--accent-glow); }
}
.loops-pause.is-paused { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

.loops-dots { display: inline-flex; gap: var(--space-2); }
.loops-dot-btn {
    width: 12px;
    height: 12px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid var(--border-strong);
    background: transparent;
    cursor: pointer;
    transition: background var(--dur-fast, 0.15s) var(--ease-out, ease), border-color var(--dur-fast, 0.15s) var(--ease-out, ease);
}
.loops-dot-btn.is-active { background: var(--accent); border-color: var(--accent); }

/* ─── narration panel ────────────────────────────────────────────────────────── */

.loops-narr {
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    padding: var(--space-3) var(--space-4);
    margin-top: var(--space-4);
    overflow: hidden;
    max-height: 40rem;
    transition: opacity 0.4s ease, max-height 0.5s ease, margin-top 0.4s ease,
        padding-top 0.4s ease, padding-bottom 0.4s ease;
}

/* Collapsed out of layout once the lab's final layer finishes; restored on restart/fresh start. */
.loops-narr.is-hidden {
    opacity: 0;
    max-height: 0;
    margin-top: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-width: 0;
    pointer-events: none;
}

.loops-narr-list {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: narr-step;
}

.loops-narr-line {
    counter-increment: narr-step;
    display: flex;
    gap: var(--space-3);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--ink-subtle);
    padding: var(--space-1) 0;
    opacity: 0.4;
    transition: opacity 0.35s ease, color 0.35s ease;
}

.loops-narr-line::before {
    content: counter(narr-step, decimal-leading-zero);
    font-size: var(--text-xs);
    color: inherit;
    flex-shrink: 0;
    min-width: 1.75em;
    opacity: 0.6;
}

.loops-narr-line.is-active {
    color: var(--ink);
    opacity: 1;
}

/* Running subtitle: one line at a time, centred, fading in as narration advances.
   min-height reserves ~2 lines so the panel doesn't jump as line lengths change. */
.loops-narr-cur {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 2.8em;
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    line-height: 1.5;
    color: var(--ink);
    opacity: 0;
}

.loops-narr-cur.is-in {
    animation: loops-cap-in 0.45s ease forwards;
}

@keyframes loops-cap-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}

.loops-voice-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--border-strong);
    background: transparent;
    color: var(--ink-muted);
    font-size: var(--text-base);
    cursor: pointer;
    transition: border-color var(--dur-fast, 0.15s) var(--ease-out, ease), color var(--dur-fast, 0.15s) var(--ease-out, ease), background var(--dur-fast, 0.15s) var(--ease-out, ease);
}
.loops-voice-btn:hover { border-color: var(--accent); color: var(--accent); }
.loops-voice-btn.is-on { background: var(--accent-soft); border-color: var(--accent); }

.loops-closing {
    text-align: center;
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--ink-subtle);
    margin: var(--space-6) 0 0;
}

/* ─── coda chart: "why the outer loop wins" ──────────────────────────────────── */

.loops-chart { margin-top: var(--space-16); }
.loops-chart-eyebrow {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--loops-loop);
    margin: 0 0 var(--space-2);
}
.loops-chart-title {
    font-family: var(--font-sans);
    font-size: clamp(1.4rem, 3vw, var(--text-2xl));
    font-weight: 700;
    line-height: 1.1;
    margin: 0 0 var(--space-2);
    max-width: 30ch;
}
.loops-chart-sub {
    color: var(--ink-muted);
    font-size: var(--text-base);
    line-height: 1.55;
    max-width: 62ch;
    margin: 0 0 var(--space-4);
}
.loops-chart-legend { display: flex; flex-wrap: wrap; gap: var(--space-5); margin-bottom: var(--space-3); }
.loops-legend-item {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--ink-muted);
}
.loops-legend-swatch { width: 22px; height: 3px; border-radius: 2px; }
.loops-legend--hi .loops-legend-swatch { background: var(--loops-loop); }
.loops-legend--lo .loops-legend-swatch { background: var(--ink-muted); }
.loops-legend--hi { color: var(--ink); }

.loops-chart-plot {
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: 16px;
    padding: var(--space-4);
}
.loops-chart-svg { width: 100%; height: auto; display: block; }
.loops-chart-grid { stroke: var(--border); stroke-width: 1; }
.loops-chart-axis { stroke: var(--border-strong); stroke-width: 1; }
.loops-chart-ytick, .loops-chart-xlabel {
    fill: var(--ink-muted);
    font-family: var(--font-mono);
    font-size: 15px;
}
.loops-chart-line { stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.loops-line--hi { stroke: var(--loops-loop); filter: drop-shadow(0 0 4px rgba(74, 222, 128, 0.4)); }
.loops-line--lo { stroke: var(--ink-muted); }
.loops-chart-pt { r: 5; }
.loops-pt--hi { fill: var(--loops-loop); }
.loops-pt--lo { fill: var(--ink-muted); }
.loops-chart-take {
    margin: var(--space-4) 0 0;
    color: var(--ink-muted);
    font-size: var(--text-sm);
    font-style: italic;
    line-height: 1.55;
    max-width: 70ch;
}

/* ─── responsive ─────────────────────────────────────────────────────────────── */

@media (max-width: 720px) {
    #loops-main { padding: calc(var(--nav-h) + var(--space-6)) var(--space-4) var(--space-12); }
    .loops-stagewrap { padding: var(--space-3); }
    .loops-controls { gap: var(--space-2); }
    .loops-btn { padding: var(--space-2) var(--space-3); }
    .loops-narr { padding: var(--space-2) var(--space-3); }
    .loops-narr-line { font-size: var(--text-xs); }
    .loops-narr-cur { font-size: var(--text-xs); min-height: 3.2em; }
}

/* ─── reduced motion ─────────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    .loops-btn, .loops-dot-btn, .loops-llm-rect { transition: none; }
    .loops-stagewrap.is-max .loops-svg { transition: none; } /* zoom/pan itself is an interaction,
        not decorative motion, so it stays available — only the smoothing tween is dropped */
    .loops-narr, .loops-narr-line, .loops-voice-btn { transition: none; }
    .loops-narr-cur { animation: none; opacity: 1; }
    .loops-next.is-ready { animation: none; } /* keep the static accent border, drop the pulse */
    /* glyph spin/ping are decorative — drop them; rings stay invisible via their base opacity:0 */
    .loops-loop-glyph, .loops-loop-ring { animation: none; }
}
