  /* ── Stage activation animations ── */
  /* Left side: slides in from left toward center (→) */
  .pipe-stage:not(.stage-activated) .pipe-left > * {
    opacity: 0;
    transform: translateX(-30px);
  }
  /* Right side: slides in from right toward center (←) */
  .pipe-stage:not(.stage-activated) .pipe-right > * {
    opacity: 0;
    transform: translateX(30px);
  }
  .stage-activated .pipe-left > * {
    transition: opacity 0.5s ease, transform 0.5s ease;
    opacity: 1;
    transform: translateX(0);
  }
  .stage-activated .pipe-right > * {
    transition: opacity 0.5s ease, transform 0.5s ease;
    opacity: 1;
    transform: translateX(0);
  }
  .stage-activated .pipe-left > *:nth-child(1),
  .stage-activated .pipe-right > *:nth-child(1) { transition-delay: 0.05s; }
  .stage-activated .pipe-left > *:nth-child(2),
  .stage-activated .pipe-right > *:nth-child(2) { transition-delay: 0.15s; }
  .stage-activated .pipe-left > *:nth-child(3),
  .stage-activated .pipe-right > *:nth-child(3) { transition-delay: 0.25s; }
  .stage-activated .pipe-left > *:nth-child(4),
  .stage-activated .pipe-right > *:nth-child(4) { transition-delay: 0.35s; }
  .stage-activated .pipe-left > *:nth-child(5),
  .stage-activated .pipe-right > *:nth-child(5) { transition-delay: 0.45s; }
  .stage-activated .pipe-left > *:nth-child(6),
  .stage-activated .pipe-right > *:nth-child(6) { transition-delay: 0.55s; }

  /* Security stack activation */
  .pipe-security-stack:not(.stage-activated) .pipe-security-bar {
    opacity: 0; transform: translateY(10px);
  }
  .pipe-security-stack.stage-activated .pipe-security-bar {
    transition: opacity 0.5s ease, transform 0.5s ease;
    opacity: 1; transform: translateY(0);
  }
  .pipe-security-stack.stage-activated .pipe-security-bar:nth-child(2) {
    transition-delay: 0.3s;
  }

  /* ── Stage 0: Typing demo ── */
  .pipe-typing-demo {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 12px;
    background: var(--slate);
    color: #7ec8a0;
    padding: 16px 20px;
    border: 1px solid #2a3545;
    line-height: 1.8;
    min-height: 48px;
    position: relative;
  }
  .pipe-typing-demo .typing-cursor {
    display: inline-block;
    width: 8px;
    height: 15px;
    background: var(--gold);
    vertical-align: text-bottom;
    animation: cursor-blink 0.8s step-end infinite;
    margin-left: 2px;
  }
  @keyframes cursor-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
  }
  .pipe-typing-demo .typing-prompt {
    color: var(--gold);
    margin-right: 6px;
  }

  /* ── Stage 1: Security shield sweep ── */
  .pipe-security-bar .shield-sweep {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,58,58,0.12) 40%, rgba(255,255,255,0.08) 50%, transparent 100%);
    transform: translateX(-100%);
    pointer-events: none;
    z-index: 1;
  }
  .pipe-security-stack.stage-activated .pipe-security-bar:nth-child(1) .shield-sweep {
    animation: shield-sweep-anim 1.2s 0.4s ease-out forwards;
  }
  .pipe-security-stack.stage-activated .pipe-security-bar:nth-child(2) .shield-sweep {
    animation: shield-sweep-anim 1.2s 0.7s ease-out forwards;
  }
  @keyframes shield-sweep-anim {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
  }
  .pipe-security-stack.stage-activated .pipe-tag.warn {
    animation: tag-flash-red 0.6s ease forwards;
  }
  .pipe-security-stack.stage-activated .pipe-security-bar:nth-child(1) .pipe-tag.warn:nth-child(1) { animation-delay: 0.5s; }
  .pipe-security-stack.stage-activated .pipe-security-bar:nth-child(1) .pipe-tag.warn:nth-child(2) { animation-delay: 0.7s; }
  .pipe-security-stack.stage-activated .pipe-security-bar:nth-child(1) .pipe-tag.warn:nth-child(3) { animation-delay: 0.9s; }
  .pipe-security-stack.stage-activated .pipe-security-bar:nth-child(1) .pipe-tag.warn:nth-child(4) { animation-delay: 1.1s; }
  .pipe-security-stack.stage-activated .pipe-security-bar:nth-child(1) .pipe-tag.warn:nth-child(5) { animation-delay: 1.3s; }
  .pipe-security-stack.stage-activated .pipe-security-bar:nth-child(2) .pipe-tag.warn:nth-child(1) { animation-delay: 0.8s; }
  .pipe-security-stack.stage-activated .pipe-security-bar:nth-child(2) .pipe-tag.warn:nth-child(2) { animation-delay: 1.0s; }
  .pipe-security-stack.stage-activated .pipe-security-bar:nth-child(2) .pipe-tag.warn:nth-child(3) { animation-delay: 1.2s; }
  @keyframes tag-flash-red {
    0% { box-shadow: none; }
    40% { box-shadow: 0 0 8px rgba(255,58,58,0.5); border-color: #ff5a4a; }
    100% { box-shadow: none; border-color: rgba(139,58,42,0.4); }
  }

  /* ── Stage 2: Code lines stagger ── */
  .pipe-code .code-line {
    display: block;
    opacity: 0;
    transform: translateX(-12px);
    transition: opacity 0.35s ease, transform 0.35s ease;
  }
  .stage-activated .pipe-code .code-line {
    opacity: 1;
    transform: translateX(0);
  }
  .stage-activated .pipe-code .code-line:nth-child(1) { transition-delay: 0.15s; }
  .stage-activated .pipe-code .code-line:nth-child(2) { transition-delay: 0.30s; }
  .stage-activated .pipe-code .code-line:nth-child(3) { transition-delay: 0.45s; }
  .stage-activated .pipe-code .code-line:nth-child(4) { transition-delay: 0.60s; }
  .stage-activated .pipe-code .code-line:nth-child(5) { transition-delay: 0.75s; }
  .stage-activated .pipe-code .code-line:nth-child(6) { transition-delay: 0.90s; }
  .stage-activated .pipe-code .code-line:nth-child(7) { transition-delay: 1.05s; }

  /* Check marks on accent tags */
  .check-mark {
    display: inline-block;
    opacity: 0;
    transform: scale(0);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: #7ec8a0;
    margin-left: 3px;
    font-weight: 700;
  }
  .stage-activated .check-mark {
    opacity: 1;
    transform: scale(1);
    transition-delay: 1.2s;
  }

  /* ── Stage 3: Embedding transformation ── */
  .embed-source-text {
    font-family: 'IBM Plex Serif', serif;
    font-style: italic;
    color: var(--muted);
    font-size: 0.85rem;
    transition: opacity 0.6s ease, filter 0.6s ease;
  }
  .stage-activated .embed-source-text {
    animation: text-dissolve 1s 3.5s ease forwards;
  }
  @keyframes text-dissolve {
    0%   { opacity: 1; filter: blur(0); }
    100% { opacity: 0; filter: blur(4px); }
  }
  .embed-vector-text {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 11px;
    color: var(--gold);
    opacity: 0;
    transition: opacity 0.5s ease;
  }
  .stage-activated .embed-vector-text {
    animation: vector-appear 0.6s 4s ease forwards;
  }
  @keyframes vector-appear {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .embed-dims .bar {
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  }
  .stage-activated .embed-dims .bar { transform: scaleY(1); }
  .stage-activated .embed-dims .bar:nth-child(1) { transition-delay: 0.4s; }
  .stage-activated .embed-dims .bar:nth-child(2) { transition-delay: 0.43s; }
  .stage-activated .embed-dims .bar:nth-child(3) { transition-delay: 0.46s; }
  .stage-activated .embed-dims .bar:nth-child(4) { transition-delay: 0.49s; }
  .stage-activated .embed-dims .bar:nth-child(5) { transition-delay: 0.52s; }
  .stage-activated .embed-dims .bar:nth-child(6) { transition-delay: 0.55s; }
  .stage-activated .embed-dims .bar:nth-child(7) { transition-delay: 0.58s; }
  .stage-activated .embed-dims .bar:nth-child(8) { transition-delay: 0.61s; }
  .stage-activated .embed-dims .bar:nth-child(9) { transition-delay: 0.64s; }
  .stage-activated .embed-dims .bar:nth-child(10) { transition-delay: 0.67s; }
  .stage-activated .embed-dims .bar:nth-child(11) { transition-delay: 0.70s; }
  .stage-activated .embed-dims .bar:nth-child(12) { transition-delay: 0.73s; }
  .stage-activated .embed-dims .bar:nth-child(13) { transition-delay: 0.76s; }
  .stage-activated .embed-dims .bar:nth-child(14) { transition-delay: 0.79s; }
  .stage-activated .embed-dims .bar:nth-child(15) { transition-delay: 0.82s; }
  .stage-activated .embed-dims .bar:nth-child(16) { transition-delay: 0.85s; }

  /* ── Stage 4: DB query pulse ── */
  @keyframes db-query-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(122,255,74,0); }
    50% { box-shadow: 0 0 18px 6px rgba(122,255,74,0.25); }
  }
  .stage-activated .pipe-node.cylinder {
    animation: db-query-pulse 1s 0.5s ease 3;
  }
  @keyframes tag-slide-in {
    from { opacity: 0; transform: translateX(12px); }
    to { opacity: 1; transform: translateX(0); }
  }

  /* ── Stage 5: PII redaction bar ── */
  .pii-redact-bar {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(139,58,42,0.7);
    transform: scaleX(0);
    transform-origin: left;
    z-index: 1;
    pointer-events: none;
  }
  .pii-row { position: relative; }
  .pipe-stage:not(.stage-activated) .pii-raw {
    text-decoration: none;
    opacity: 1;
  }
  .stage-activated .pii-redact-bar {
    animation: pii-sweep 0.6s ease forwards;
  }
  .stage-activated .pii-row:nth-child(1) .pii-redact-bar { animation-delay: 0.4s; }
  .stage-activated .pii-row:nth-child(2) .pii-redact-bar { animation-delay: 0.9s; }
  @keyframes pii-sweep {
    0% { transform: scaleX(0); }
    50% { transform: scaleX(1); }
    100% { transform: scaleX(0); transform-origin: right; }
  }
  .stage-activated .pii-raw {
    animation: pii-strike 0.3s 0.7s ease forwards;
  }
  .stage-activated .pii-row:nth-child(2) .pii-raw { animation-delay: 1.2s; }
  @keyframes pii-strike {
    from { text-decoration: none; opacity: 1; }
    to { text-decoration: line-through; opacity: 0.6; }
  }
  .stage-activated .pii-masked {
    opacity: 0;
    animation: pii-mask-in 0.4s ease forwards;
  }
  .stage-activated .pii-row:nth-child(1) .pii-masked { animation-delay: 0.8s; }
  .stage-activated .pii-row:nth-child(2) .pii-masked { animation-delay: 1.3s; }
  @keyframes pii-mask-in {
    from { opacity: 0; transform: translateX(8px); }
    to { opacity: 1; transform: translateX(0); }
  }

  /* ── Stage 6+7: Rerank + Assembly combined section ── */
  .rerank-assembly-section {
    position: relative;
    padding: 20px 0 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    min-height: 440px;
  }

  /* Background box for the left assembly area (like mermaid-wrap) */
  .ra-assembly-box {
    position: absolute;
    left: 2%;
    top: 100px;
    width: 46%;
    height: 300px;
    background: var(--slate);
    border: 1px solid #2a3545;
    border-radius: 4px;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.5s ease;
    transition-delay: 1.2s;
  }

  /* Rerank panel — initial list on right */
  .ra-rerank-panel {
    position: absolute;
    top: 10px;
    right: 10%;
    width: 260px;
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    z-index: 3;
  }
  .ra-label {
    font-family: var(--ff-mono);
    font-size: 0.65rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 2px;
  }
  .ra-title {
    font-family: var(--ff-mono);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 10px;
  }
  .ra-chunk {
    font-family: var(--ff-mono);
    font-size: 0.7rem;
    color: var(--muted);
    padding: 7px 12px;
    background: var(--slate-mid);
    border: 1px solid var(--divider);
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: opacity 0.5s ease, transform 0.7s cubic-bezier(0.34,1.2,0.64,1),
                border 0.3s ease, border-radius 0.3s ease, color 0.3s ease,
                font-weight 0.3s ease, width 0.7s cubic-bezier(0.34,1.2,0.64,1);
  }
  .ra-chunk span {
    font-weight: 600;
    color: var(--gold);
  }
  .ra-chunk-reject span {
    color: var(--muted) !important;
  }

  /* Threshold line */
  .ra-threshold {
    font-family: var(--ff-mono);
    font-size: 0.6rem;
    color: var(--gold);
    text-align: center;
    border-top: 2px dashed var(--gold);
    padding-top: 6px;
    margin-top: 4px;
    opacity: 0;
    transition: opacity 0.4s ease;
  }

  /* SVG connectors — positioned over the left half */
  .ra-connectors {
    position: absolute;
    top: 0;
    left: 0;
    width: 48%;
    height: 440px;
    z-index: 1;
    pointer-events: none;
  }
  .ra-path {
    fill: none;
    stroke: var(--gold);
    stroke-width: 2;
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    transition: stroke-dashoffset 0.6s ease;
  }

  /* Builder node — LEFT of center */
  .ra-builder-node {
    position: absolute;
    top: 250px;
    left: 24%; transform: translateX(-50%) scale(0.7);
    padding: 10px 28px;
    border: 2px solid var(--gold);
    border-radius: 8px;
    background: var(--slate-mid);
    color: var(--gold);
    font-family: var(--ff-mono);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.4s ease;
    z-index: 3;
  }

  /* Prompt node — LEFT of center */
  .ra-prompt-node {
    position: absolute;
    top: 330px;
    left: 24%; transform: translateX(-50%) scale(0.3);
    padding: 10px 28px;
    border: 2px solid var(--gold);
    border-radius: 8px;
    background: var(--gold);
    color: var(--slate);
    font-family: var(--ff-mono);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.6s cubic-bezier(0.34,1.56,0.64,1);
    z-index: 3;
  }

  /* Tags — right side, below the panel */
  .ra-tags {
    position: absolute;
    right: 10%;
    top: 260px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    max-width: 260px;
  }
  .ra-tags .pipe-tag {
    opacity: 0;
    transform: translateY(8px);
  }

  /* ── Activation sequence ── */
  /* 0.0s: Rerank panel slides in */
  .stage-activated.rerank-assembly-section .ra-rerank-panel {
    opacity: 1;
    transform: translateX(0);
  }

  /* 0.3s: Threshold line */
  .stage-activated.rerank-assembly-section .ra-threshold {
    opacity: 1;
    transition-delay: 0.3s;
  }

  /* 0.8s: Rejected chunk fades */
  .stage-activated.rerank-assembly-section .ra-chunk-reject {
    opacity: 0.15;
    transform: scale(0.95);
    text-decoration: line-through;
    transition-delay: 0.8s;
  }

  /* 1.2s: Assembly background box fades in */
  .stage-activated.rerank-assembly-section .ra-assembly-box {
    opacity: 1;
  }

  /* 1.3s: Surviving chunks gain gold border + transform LEFT to horizontal row */
  /* Panel children: 1=.ra-label, 2=.ra-title, 3=chunk1, 4=chunk2, 5=chunk3, 6=threshold, 7=rejected */
  /* Positions computed dynamically by JS via --ra-tx, --ra-ty, --ra-w */
  .stage-activated.rerank-assembly-section .ra-chunk:nth-child(3),
  .stage-activated.rerank-assembly-section .ra-chunk:nth-child(4),
  .stage-activated.rerank-assembly-section .ra-chunk:nth-child(5) {
    border: 2px solid var(--gold);
    border-radius: 0;
    color: var(--gold);
    font-weight: 700;
    width: var(--ra-w, 150px);
    transform: translate(var(--ra-tx, -400px), var(--ra-ty, 80px));
    z-index: 5;
  }
  .stage-activated.rerank-assembly-section .ra-chunk:nth-child(3) {
    transition-delay: 1.3s;
  }
  .stage-activated.rerank-assembly-section .ra-chunk:nth-child(4) {
    transition-delay: 1.45s;
  }
  .stage-activated.rerank-assembly-section .ra-chunk:nth-child(5) {
    transition-delay: 1.6s;
  }

  /* 2.0s: SVG paths chunks→builder */
  .stage-activated.rerank-assembly-section .ra-path-1 { stroke-dashoffset: 0; transition-delay: 2.0s; }
  .stage-activated.rerank-assembly-section .ra-path-2 { stroke-dashoffset: 0; transition-delay: 2.1s; }
  .stage-activated.rerank-assembly-section .ra-path-3 { stroke-dashoffset: 0; transition-delay: 2.2s; }

  /* 2.4s: Builder node appears + glow */
  .stage-activated.rerank-assembly-section .ra-builder-node {
    opacity: 1;
    transform: translateX(-50%) scale(1);
    box-shadow: 0 0 20px rgba(232,200,74,0.3);
    transition-delay: 2.4s;
  }

  /* 2.7s: SVG path builder→prompt */
  .stage-activated.rerank-assembly-section .ra-path-4 { stroke-dashoffset: 0; transition-delay: 2.7s; }

  /* 3.0s: Prompt node appears */
  .stage-activated.rerank-assembly-section .ra-prompt-node {
    opacity: 1;
    transform: translateX(-50%) scale(1);
    transition-delay: 3.0s;
    animation: ra-prompt-pop 0.6s 3.0s cubic-bezier(0.34,1.56,0.64,1) both;
  }
  @keyframes ra-prompt-pop {
    0% { transform: translateX(-50%) scale(0.3); opacity: 0; box-shadow: none; }
    50% { transform: translateX(-50%) scale(1.15); }
    100% { transform: translateX(-50%) scale(1); opacity: 1;
      box-shadow: 0 0 30px 10px rgba(232,200,74,0.35), 0 0 60px 20px rgba(232,200,74,0.1); }
  }

  /* 3.4s: Tags cascade */
  .stage-activated.rerank-assembly-section .ra-tags .pipe-tag {
    animation: tag-cascade 0.5s ease forwards;
  }
  .stage-activated.rerank-assembly-section .ra-tags .pipe-tag:nth-child(1) { animation-delay: 3.4s; }
  .stage-activated.rerank-assembly-section .ra-tags .pipe-tag:nth-child(2) { animation-delay: 3.55s; }
  .stage-activated.rerank-assembly-section .ra-tags .pipe-tag:nth-child(3) { animation-delay: 3.7s; }
  .stage-activated.rerank-assembly-section .ra-tags .pipe-tag:nth-child(4) { animation-delay: 3.85s; }
  .stage-activated.rerank-assembly-section .ra-tags .pipe-tag:nth-child(5) { animation-delay: 4.0s; }
  .stage-activated.rerank-assembly-section .ra-tags .pipe-tag:nth-child(6) { animation-delay: 4.15s; }

  /* ── Stage 8: AI hero entrance ── */
  .ai-thinking-indicator {
    display: flex;
    gap: 8px;
    justify-content: center;
    padding: 16px;
    opacity: 0;
  }
  .stage-activated .ai-thinking-indicator {
    animation: fade-in-out 1.8s ease forwards;
  }
  @keyframes fade-in-out {
    0% { opacity: 0; }
    15% { opacity: 1; }
    85% { opacity: 1; }
    100% { opacity: 0; height: 0; padding: 0; overflow: hidden; }
  }
  .ai-dot {
    width: 10px;
    height: 10px;
    background: var(--gold);
    border-radius: 50%;
    animation: ai-dot-bounce 1.4s ease-in-out infinite;
  }
  .ai-dot:nth-child(2) { animation-delay: 0.2s; }
  .ai-dot:nth-child(3) { animation-delay: 0.4s; }
  @keyframes ai-dot-bounce {
    0%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-12px); }
  }
  .stage-activated[data-beam-zone="response"] .pipe-node.large {
    animation: hero-entrance 0.8s 1.8s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  }
  @keyframes hero-entrance {
    0% { transform: scale(0.5); opacity: 0.3; box-shadow: none; }
    60% { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1;
      box-shadow: 0 0 30px 10px rgba(232,200,74,0.4), 0 0 80px 25px rgba(232,200,74,0.15); }
  }
  .stage-activated[data-beam-zone="response"] .pipe-right > * {
    transition-delay: 2s !important;
  }
  .stage-activated[data-beam-zone="response"] .pipe-right > *:nth-child(2) { transition-delay: 2.15s !important; }
  .stage-activated[data-beam-zone="response"] .pipe-right > *:nth-child(3) { transition-delay: 2.3s !important; }
  .stage-activated[data-beam-zone="response"] .pipe-right > *:nth-child(4) { transition-delay: 2.45s !important; }
  .stage-activated[data-beam-zone="response"] .pipe-tags .pipe-tag {
    opacity: 0;
    animation: tag-cascade 0.5s ease forwards;
  }
  .stage-activated[data-beam-zone="response"] .pipe-tags .pipe-tag:nth-child(1) { animation-delay: 2.5s; }
  .stage-activated[data-beam-zone="response"] .pipe-tags .pipe-tag:nth-child(2) { animation-delay: 2.65s; }
  .stage-activated[data-beam-zone="response"] .pipe-tags .pipe-tag:nth-child(3) { animation-delay: 2.8s; }
  .stage-activated[data-beam-zone="response"] .pipe-tags .pipe-tag:nth-child(4) { animation-delay: 2.95s; }

  /* ── Stage 8: AI Hero — multi-node layout ── */
  .ai-hero-section {
    position: relative;
    padding: 20px 0 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    min-height: 320px;
    margin-bottom: 15px;
  }

  /* SVG connector paths */
  .ai-connectors {
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 400px;
    height: 230px;
    z-index: 1;
    pointer-events: none;
  }
  .ai-path {
    fill: none;
    stroke: var(--gold);
    stroke-width: 2;
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
    transition: stroke-dashoffset 0.6s ease;
  }

  /* Router diamond node */
  .ai-router-node {
    position: absolute;
    top: 10px;
    left: 50%; transform: translateX(-50%) rotate(45deg);
    width: 48px; height: 48px;
    border: 2px solid var(--gold);
    background: var(--slate-mid);
    display: flex; align-items: center; justify-content: center;
    opacity: 0;
    z-index: 3;
    box-shadow: 0 0 12px rgba(232,200,74,0.15);
    transition: opacity 0.4s;
  }
  .ai-router-node svg {
    width: 22px; height: 22px;
    stroke: var(--gold);
    transform: rotate(-45deg);
  }

  /* Model label nodes — positioned absolutely to match SVG coords */
  .ai-model-node {
    position: absolute;
    padding: 8px 20px;
    border: 2px solid var(--gold);
    border-radius: 8px;
    background: var(--slate-mid);
    color: var(--gold);
    font-family: var(--ff-mono);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    opacity: 0;
    transform: scale(0.7);
    transition: opacity 0.35s, transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
    z-index: 3;
    white-space: nowrap;
  }
  /* Position each model node to sit between top and bottom SVG paths */
  .ai-model-1 { top: 72px; left: 50%; transform: translateX(calc(-50% - 130px)) scale(0.7); }
  .ai-model-2 { top: 72px; left: 50%; transform: translateX(-50%) scale(0.7); }
  .ai-model-3 { top: 72px; left: 50%; transform: translateX(calc(-50% + 130px)) scale(0.7); }

  /* Gold response node */
  .ai-response-node {
    position: absolute;
    top: 175px;
    left: 50%; transform: translateX(-50%) scale(0.3);
    width: 72px; height: 72px;
    background: var(--gold);
    border: 3px solid #d4b44a;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    opacity: 0;
    z-index: 3;
    transition: opacity 0.5s, transform 0.6s cubic-bezier(0.34,1.56,0.64,1);
  }
  .ai-response-node svg {
    width: 32px; height: 32px;
    stroke: var(--slate);
  }

  /* Tags */
  .ai-hero-tags {
    position: absolute;
    top: 280px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    max-width: 600px;
  }
  .ai-hero-tags .pipe-tag {
    opacity: 0;
    transform: translateY(8px);
  }

  /* ── Stage 8 activation sequence ── */
  /* 1. Router pops in */
  .stage-activated.ai-hero-section .ai-router-node {
    opacity: 1;
    animation: router-pop 0.5s cubic-bezier(0.34,1.56,0.64,1) both;
  }
  @keyframes router-pop {
    0% { opacity: 0; transform: translateX(-50%) rotate(45deg) scale(0.3); }
    100% { opacity: 1; transform: translateX(-50%) rotate(45deg) scale(1); }
  }

  /* 2. Top paths draw (router → models) */
  .stage-activated.ai-hero-section .ai-path-1 { stroke-dashoffset: 0; transition-delay: 0.3s; }
  .stage-activated.ai-hero-section .ai-path-2 { stroke-dashoffset: 0; transition-delay: 0.4s; }
  .stage-activated.ai-hero-section .ai-path-3 { stroke-dashoffset: 0; transition-delay: 0.5s; }

  /* 3. Model nodes appear (between top and bottom paths) */
  .stage-activated.ai-hero-section .ai-model-node { opacity: 1; }
  .stage-activated.ai-hero-section .ai-model-1 { transform: translateX(calc(-50% - 130px)) scale(1); transition-delay: 0.5s; }
  .stage-activated.ai-hero-section .ai-model-2 { transform: translateX(-50%) scale(1); transition-delay: 0.6s; }
  .stage-activated.ai-hero-section .ai-model-3 { transform: translateX(calc(-50% + 130px)) scale(1); transition-delay: 0.7s; }

  /* 4. Bottom paths draw (models → response) */
  .stage-activated.ai-hero-section .ai-path-4 { stroke-dashoffset: 0; transition-delay: 0.85s; }
  .stage-activated.ai-hero-section .ai-path-5 { stroke-dashoffset: 0; transition-delay: 0.95s; }
  .stage-activated.ai-hero-section .ai-path-6 { stroke-dashoffset: 0; transition-delay: 1.05s; }

  /* 5. Gold response node — dramatic entrance */
  .stage-activated.ai-hero-section .ai-response-node {
    opacity: 1;
    transform: translateX(-50%) scale(1);
    transition-delay: 1.3s;
    animation: gold-burst 0.8s 1.3s cubic-bezier(0.34,1.56,0.64,1) both;
  }
  @keyframes gold-burst {
    0% { transform: translateX(-50%) scale(0.3); opacity: 0; box-shadow: none; }
    50% { transform: translateX(-50%) scale(1.2); }
    100% { transform: translateX(-50%) scale(1); opacity: 1;
      box-shadow: 0 0 40px 15px rgba(232,200,74,0.45), 0 0 100px 30px rgba(232,200,74,0.15); }
  }

  /* 6. Tags cascade */
  .stage-activated.ai-hero-section .ai-hero-tags .pipe-tag {
    animation: tag-cascade 0.5s ease forwards;
  }
  .stage-activated.ai-hero-section .ai-hero-tags .pipe-tag:nth-child(1) { animation-delay: 1.7s; }
  .stage-activated.ai-hero-section .ai-hero-tags .pipe-tag:nth-child(2) { animation-delay: 1.85s; }
  .stage-activated.ai-hero-section .ai-hero-tags .pipe-tag:nth-child(3) { animation-delay: 2.0s; }
  .stage-activated.ai-hero-section .ai-hero-tags .pipe-tag:nth-child(4) { animation-delay: 2.15s; }
  .stage-activated.ai-hero-section .ai-hero-tags .pipe-tag:nth-child(5) { animation-delay: 2.3s; }
  .stage-activated.ai-hero-section .ai-hero-tags .pipe-tag:nth-child(6) { animation-delay: 2.45s; }
  @keyframes tag-cascade {
    from { opacity: 0; transform: scale(0.7) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
  }

  /* ── Stage 9: Audit log terminal ── */
  .audit-log {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 10px;
    background: var(--slate);
    color: #7ec8a0;
    padding: 14px 18px;
    border: 1px solid #2a3545;
    margin-top: 10px;
    line-height: 2;
  }
  .audit-line {
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.4s ease, transform 0.4s ease;
  }
  .stage-activated .audit-line { opacity: 1; transform: translateY(0); }
  .stage-activated .audit-line:nth-child(1) { transition-delay: 0.3s; }
  .stage-activated .audit-line:nth-child(2) { transition-delay: 0.6s; }
  .stage-activated .audit-line:nth-child(3) { transition-delay: 0.9s; }
  .stage-activated .audit-line:nth-child(4) { transition-delay: 1.2s; }

  /* ── Mermaid diagram containers ── */
  .mermaid-wrap {
    margin-top: 10px;
    padding: 10px;
    background: var(--slate);
    border: 1px solid #2a3545;
    border-radius: 2px;
    overflow: hidden;
  }
  .mermaid-wrap .mermaid {
    display: flex;
    justify-content: center;
  }
  .mermaid-wrap .mermaid svg,
  .mermaid-wrap .mermaid-img {
    max-width: 100%;
    max-height: 180px;
    height: auto;
    width: auto;
  }
  .mermaid-img {
    display: block;
    margin: 0 auto;
  }
  /* Mermaid text overrides for readability */
  .mermaid-wrap .nodeLabel,
  .mermaid-wrap .edgeLabel {
    font-family: 'Goldman', 'IBM Plex Serif', serif !important;
    font-size: 10px !important;
  }

  /* ── Two stacked security bars ── */
  .pipe-security-stack {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 10px;
  }

  .pipe-security-bar {
    background: var(--slate);
    border: 1px solid #2a3545;
    padding: 14px 32px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 20px;
    position: relative;
    overflow: hidden;
  }

  .pipe-security-bar::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.03;
    background: repeating-linear-gradient(90deg, transparent 0, transparent 20px, rgba(255,255,255,0.1) 20px, rgba(255,255,255,0.1) 21px);
  }

  .pipe-security-bar .bar-icon {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .pipe-security-bar .bar-icon svg {
    width: 28px;
    height: 28px;
  }

  .bar-label {
    font-family: 'Goldman', sans-serif;
    font-size: 11px;
    color: var(--gold);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    white-space: nowrap;
    text-align: right;
  }

  .bar-label small {
    display: block;
    font-family: 'IBM Plex Serif', serif;
    font-size: 10px;
    letter-spacing: 0;
    text-transform: none;
    color: #6a7a8a;
    margin-top: 3px;
  }

  .bar-provides {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
  }

  .bar-provides .pipe-tag {
    background: rgba(255,255,255,0.05);
    border-color: #3a4555;
    color: #8899aa;
    font-size: 8px;
  }

  .bar-provides .pipe-tag.warn {
    border-color: rgba(139,58,42,0.4);
    color: #c47a6a;
    background: rgba(139,58,42,0.1);
  }

  .bar-line-sample {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
  }

  .bar-line-sample .wavy-line svg {
    width: 50px;
    height: 10px;
  }

  .bar-line-sample .dashed-line {
    width: 50px;
    border-top: 2px dashed var(--copper);
  }

  .bar-line-sample span {
    font-family: 'Goldman', sans-serif;
    font-size: 8px;
    color: #5a6a7a;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }

  /* ── Embedding visualization ── */
  .embed-visual {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 12px;
    padding: 16px 20px;
    background: rgba(184,150,62,0.04);
    border: 1px solid var(--divider);
  }

  .embed-dims {
    display: flex;
    gap: 2px;
    align-items: flex-end;
    height: 32px;
  }

  .embed-dims .bar {
    width: 3px;
    background: var(--gold);
    opacity: 0.8;
    border-radius: 1px;
    transition: opacity 0.2s;
  }

  .embed-visual:hover .embed-dims .bar {
    opacity: 1;
  }

  .embed-meta {
    font-family: 'Goldman', 'IBM Plex Serif', serif;
    font-size: 10px;
    color: var(--muted);
    letter-spacing: 0.1em;
  }

  .embed-meta strong {
    color: var(--ink);
    font-weight: 400;
  }
