/* ============================================================================
   Sema PTA landing — 11 — Story-B infographic player (main story)
   ----------------------------------------------------------------------------
   To edit this section, open css/storyB.css. All rules are grouped here.
   ============================================================================ */

.header-cta {
    padding: 10px 20px;
    background: var(--sema-500);
    color: #2A1206;
    font-weight: 600; font-size: 14px;
    border-radius: 100px;
    transition: background .2s, transform .2s;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.08) inset, 0 4px 20px rgba(255,138,76,0.3);
  }

.header-cta:hover { background: var(--sema-300); transform: translateY(-1px); }

.eyebrow {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 7px 14px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    font-size: 12px; font-weight: 500;
    letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--sema-300);
    background: rgba(255, 138, 76, 0.06);
    font-family: var(--font-mono);
  }

.eyebrow .pulse {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--sema-500);
    box-shadow: 0 0 12px var(--sema-500);
    animation: pulse 2s ease-in-out infinite;
  }

h1 {
    font-size: clamp(48px, 6.5vw, 88px);
    font-weight: 600;
    line-height: 0.98;
    letter-spacing: -0.035em;
    margin: 24px 0 24px;
    max-width: 12ch;
  }

h1 .accent {
    color: var(--sema-500);
    font-weight: 500;
    position: relative;
    white-space: nowrap;
  }

h1 .accent::after {
    content: "";
    position: absolute; left: 0; right: 0; bottom: 4px;
    height: 6px;
    background: linear-gradient(90deg, transparent, var(--sema-700) 20%, var(--sema-500) 50%, var(--sema-700) 80%, transparent);
    opacity: 0.35;
    z-index: -1;
    filter: blur(4px);
  }

.lead {
    font-size: clamp(16px, 1.15vw, 19px);
    color: var(--text-dim);
    max-width: 44ch;
    line-height: 1.55;
    margin-bottom: 40px;
  }

.lead strong { color: var(--text); font-weight: 500; }

/* Rotating typewriter phrase */

.rotator {
    display: inline-block;
    color: var(--sema-300);
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 0.95em;
    position: relative;
  }

.rotator::after {
    content: ""; display: inline-block;
    width: 2px; height: 1em;
    background: var(--sema-500);
    vertical-align: -0.15em;
    margin-left: 2px;
    animation: blink 1s step-end infinite;
  }

/* Form */

.form {
    display: flex; gap: 8px;
    padding: 6px;
    background: rgba(20, 16, 12, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 100px;
    max-width: 460px;
    transition: border-color .2s;
  }

.form:focus-within { border-color: var(--border-strong); }

.form input {
    flex: 1;
    padding: 12px 20px;
    background: transparent;
    border: 0;
    color: var(--text);
    font: inherit; font-size: 15px;
    outline: none;
  }

.form input::placeholder { color: var(--text-mute); }

.form button {
    padding: 12px 22px;
    background: var(--sema-500);
    color: #2A1206;
    font-weight: 600; font-size: 14px;
    border-radius: 100px;
    transition: background .2s, transform .2s;
    white-space: nowrap;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.08) inset;
  }

.form button:hover { background: var(--sema-300); transform: translateY(-1px); }

.form button:active { transform: translateY(0); }

.form-meta {
    display: flex; align-items: center; gap: 12px;
    margin-top: 20px;
    font-size: 13px; color: var(--text-mute);
    font-family: var(--font-mono);
  }

.form-meta b { color: var(--sema-500); font-weight: 500; }

/* Trust badges */

.badges {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin-top: 44px;
  }

.badge {
    padding: 8px 14px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 12px;
    font-family: var(--font-mono);
    color: var(--text-dim);
    letter-spacing: 0.02em;
    display: inline-flex; align-items: center; gap: 8px;
    transition: border-color .2s, color .2s;
  }

.badge:hover { border-color: var(--border-strong); color: var(--text); }

.badge .dot {
    width: 5px; height: 5px; border-radius: 50%;
    background: var(--sema-500);
  }

/* Overlay HUD */

.hud {
    position: absolute; inset: 0;
    pointer-events: none;
    padding: 20px;
    display: flex; flex-direction: column; justify-content: space-between;
  }

.hud-top {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 16px;
    font-family: var(--font-mono); font-size: 11px;
    letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--text-mute);
  }

.hud-top .status {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 12px;
    background: rgba(14,11,8,0.7);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 100px;
    color: var(--sema-300);
  }

.hud-top .status .live {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--sema-500);
    animation: pulse 2s ease-in-out infinite;
  }

.hud-top .meta {
    text-align: right;
    padding: 8px 12px;
    background: rgba(14,11,8,0.7);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 12px;
    line-height: 1.4;
  }

.hud-top .meta b { display: block; color: var(--text); font-family: var(--font-display); font-size: 14px; font-weight: 500; letter-spacing: normal; text-transform: none; margin-top: 2px; }

.insight {
    pointer-events: auto;
    padding: 16px 18px;
    background: rgba(14,11,8,0.85);
    backdrop-filter: blur(16px) saturate(140%);
    border: 1px solid var(--border-strong);
    border-radius: 16px;
    max-width: 360px;
    opacity: 0; transform: translateY(10px);
    transition: opacity .5s ease, transform .5s ease;
  }

.insight.visible { opacity: 1; transform: translateY(0); }

.insight .insight-label {
    font-family: var(--font-mono); font-size: 10px;
    letter-spacing: 0.16em; text-transform: uppercase;
    color: var(--sema-500);
    margin-bottom: 8px;
    display: flex; align-items: center; gap: 8px;
  }

.insight .insight-label::before {
    content: ""; width: 14px; height: 14px;
    border-radius: 4px;
    background: linear-gradient(135deg, var(--sema-500), var(--sema-700));
    box-shadow: 0 0 12px var(--sema-500);
  }

.insight .insight-text {
    font-size: 14px; line-height: 1.45; color: var(--text);
  }

.insight .insight-text em {
    font-style: normal;
    color: var(--sema-300);
    background: rgba(255,138,76,0.08);
    padding: 1px 6px;
    border-radius: 4px;
  }

/* Legend */

.legend {
    position: absolute; bottom: 20px; right: 20px;
    display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-end;
    max-width: 200px;
    pointer-events: none;
  }

.legend .item {
    display: flex; align-items: center; gap: 6px;
    font-family: var(--font-mono); font-size: 10px;
    color: var(--text-mute);
    letter-spacing: 0.06em;
    padding: 4px 8px;
    background: rgba(14,11,8,0.6);
    backdrop-filter: blur(8px);
    border-radius: 100px;
  }

.legend .swatch { width: 8px; height: 8px; border-radius: 50%; }

/* Scroll indicator */

.scroll-hint {
    position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.2em;
    color: var(--text-mute);
    animation: bob 2s ease-in-out infinite;
    z-index: 10;
  }

.scroll-hint .arrow {
    width: 1px; height: 20px;
    background: linear-gradient(180deg, var(--text-mute), transparent);
  }

/* ========== Fake next section marker ========== */

.below {
    height: 400px;
    background: linear-gradient(180deg, var(--bg), var(--bg-2));
    display: flex; align-items: center; justify-content: center;
    text-align: center;
    padding: 40px;
    position: relative; z-index: 1;
  }

.below .below-inner {
    max-width: 620px;
    color: var(--text-mute);
  }

.below h3 {
    font-size: 24px;
    color: var(--text-dim);
    margin-bottom: 12px;
    font-weight: 500;
    letter-spacing: -0.01em;
  }

.below p { font-size: 14px; line-height: 1.6; }

.below .note {
    display: inline-block;
    margin-top: 24px;
    padding: 8px 16px;
    border: 1px dashed var(--border-strong);
    border-radius: 100px;
    font-family: var(--font-mono); font-size: 11px;
    color: var(--sema-300); letter-spacing: 0.14em; text-transform: uppercase;
  }

.fade-in { animation: fadeInUp .5s ease both; }

/* ============ FAQ ============ */

.faq-list { display: flex; flex-direction: column; gap: 12px; max-width: 900px; margin: 0 auto; }

.faq-item {
    border: 1px solid var(--border); border-radius: 16px;
    background: var(--bg-2);
    overflow: hidden;
    transition: border-color .3s;
  }

.faq-item[open] { border-color: var(--border-strong); }

.faq-item summary {
    padding: 22px 24px; cursor: pointer;
    display: flex; align-items: center; justify-content: space-between;
    font-size: 17px; font-weight: 500;
    list-style: none;
  }

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
    content: "+"; font-size: 24px; color: var(--sema-500);
    transition: transform .3s;
  }

.faq-item[open] summary::after { content: "–"; }

.faq-item .faq-body { padding: 0 24px 22px; color: var(--text-dim); font-size: 15px; line-height: 1.65; }

.foot-brand { display: flex; align-items: center; gap: 10px; }

.foot-brand .logo-mark { width: 20px; height: 20px; border-radius: 6px; background: linear-gradient(135deg, var(--sema-500), var(--sema-700)); }

/* the accented word - just color, no chip, no rotation, no border */

.invert-word {
    color: #FFFFFF;
    display: inline-block;
  }

/* ============================================================================
     TRANSITION BRIDGE — orange to black gradient
     ============================================================================ */

.bridge {
    position: relative;
    height: 42vh;
    min-height: 260px;
    /* multi-stop smooth exponential fade orange → black, no visible bands */
    background:
      linear-gradient(
        to bottom,
        #F26A2E 0%,
        #E9591F 8%,
        #D24713 18%,
        #A93408 30%,
        #7C2405 42%,
        #521904 54%,
        #341005 66%,
        #1F0A05 78%,
        #120705 88%,
        #0A0705 100%
      );
    /* film grain to eliminate any residual banding */
    box-shadow: inset 0 0 200px rgba(0,0,0,0.15);
  }

.bridge::before {
    /* SVG-based noise layer prevents banding across the gradient */
    content: '';
    position: absolute; inset: 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.5  0 0 0 0 0.3  0 0 0 0 0.1  0 0 0 0.5 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
    background-size: 140px 140px;
    opacity: 0.05;
    mix-blend-mode: overlay;
    pointer-events: none;
  }

/* ============================================================================
     STORY B — cinematic infographic player (dark theme)
     Fully responsive: 320 → 2560+ px
     ============================================================================ */

.storyB {
    position: relative;
    /* smooth gradient from body colour into deeper story background — removes visible seam */
    background: linear-gradient(180deg, var(--bg) 0%, #0A0705 12%, #0A0705 88%, var(--bg) 100%);
    color: #F4EEE6;
    /* tighter section: was min-height: 100vh which caused giant empty space — use content-driven sizing */
    padding: clamp(60px, 8vh, 100px) clamp(16px, 5vw, 80px) clamp(60px, 8vh, 100px);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }

.storyB::before {
    content: '';
    position: absolute; inset: 0;
    background:
      radial-gradient(60% 40% at 20% 20%, rgba(255,138,76,0.06), transparent 60%),
      radial-gradient(50% 40% at 80% 80%, rgba(255,138,76,0.05), transparent 60%);
    pointer-events: none;
    z-index: 0;
  }

.storyB-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: clamp(14px, 2vh, 22px); /* tighter vertical rhythm */
  }

/* topbar */

.storyB-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
  }

.storyB-eye {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: clamp(11px, 1vw, 13px);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--sema-500);
  }

.storyB-counter {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: clamp(12px, 1.1vw, 14px);
    color: var(--text-dim);
    letter-spacing: 0.05em;
  }

.storyB-counter .cur { color: #F4EEE6; font-weight: 600; }

.storyB-counter .sep { margin: 0 4px; color: var(--text-mute); }

.storyB-counter .tot { color: var(--text-mute); }

/* stage */

.storyB-stage {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(20px, 3vh, 32px);
  }

/* CANVAS */

.stage-canvas {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 52vh;
    background: linear-gradient(135deg, rgba(255,138,76,0.045), rgba(255,138,76,0.015));
    border: 1px solid rgba(255,138,76,0.14);
    border-radius: clamp(14px, 1.5vw, 22px);
    overflow: hidden;
  }

/* SVG lines */

.stage-lines {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    z-index: 1;
    pointer-events: none;
  }

.stage-lines .sln {
    stroke: var(--sema-500);
    stroke-width: 1.2;
    stroke-linecap: round;
    stroke-dasharray: 6 6;
    opacity: 0;
    filter: drop-shadow(0 0 4px rgba(255,138,76,0.5));
    transition: opacity 0.5s ease;
  }

.storyB[data-phase="2"] .stage-lines .sln,
  .storyB[data-phase="3"] .stage-lines .sln,
  .storyB[data-phase="4"] .stage-lines .sln,
  .storyB[data-phase="5"] .stage-lines .sln,
  .storyB[data-phase="5"] .stage-lines .sln {
    opacity: 0.55;
    animation: slnDash 1.6s linear infinite;
  }

/* phase 2 — sequential attempts to find connections */

.storyB[data-phase="2"] .stage-lines .s-ln1 { animation-delay: 0.0s; opacity: 0.7; }

.storyB[data-phase="2"] .stage-lines .s-ln5 { animation-delay: 0.2s; opacity: 0.55; }

.storyB[data-phase="2"] .stage-lines .s-ln8 { animation-delay: 0.4s; opacity: 0.55; }

.storyB[data-phase="2"] .stage-lines .s-ln2 { animation-delay: 0.6s; opacity: 0.45; }

.storyB[data-phase="2"] .stage-lines .s-ln7 { animation-delay: 0.8s; opacity: 0.55; }

.storyB[data-phase="2"] .stage-lines .s-ln10 { animation-delay: 1.0s; opacity: 0.45; }

.storyB[data-phase="5"] .stage-lines .sln,
  .storyB[data-phase="5"] .stage-lines .sln { opacity: 0.2; }

/* NOTES */

.snote {
    position: absolute;
    z-index: 2;
    width: clamp(140px, 20%, 220px);
    padding: 12px 14px;
    background: rgba(20,14,10,0.9);
    border: 1px solid rgba(255,138,76,0.28);
    border-radius: 10px;
    color: #F4EEE6;
    font-size: clamp(11px, 0.9vw, 13px);
    line-height: 1.4;
    opacity: 0;
    transform: translateY(8px) scale(0.96);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.2,0.9,0.3,1), border-color 0.4s ease, box-shadow 0.4s ease;
    backdrop-filter: blur(6px);
  }

/* TASK is a visually distinct card: warmer bg, dashed border, checkbox icon */

.snote.task,
  .snote.task-note {
    border-style: dashed;
    border-color: rgba(255,138,76,0.55);
    background: linear-gradient(135deg, rgba(255,138,76,0.14), rgba(20,14,10,0.9));
  }

.snote.task .snote-tag,
  .snote.task-note .snote-tag { color: #FFD9BF; font-weight: 700; }

.task-check {
    display: inline-block;
    width: 18px; height: 18px;
    border: 2px solid var(--sema-500);
    border-radius: 4px;
    margin-right: 10px;
    position: relative;
    flex-shrink: 0;
    background: rgba(255,138,76,0.10);
    box-shadow: 0 0 0 2px rgba(255,138,76,0.15);
  }

.task-check::after {
    content: '';
    position: absolute;
    top: 2px; left: 6px;
    width: 5px; height: 10px;
    border-right: 2.5px solid var(--sema-500);
    border-bottom: 2.5px solid var(--sema-500);
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity 0.3s ease 0.2s;
  }

.storyB[data-phase="4"] .snote.task .task-check::after,
  .storyB[data-phase="5"] .task-note.tk-finance .task-check::after,
  .storyB[data-phase="6"] .task-note.tk-roadmap .task-check::after { opacity: 1; }

.snote-head {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 4px;
    margin-bottom: 6px;
  }

.snote-head .snote-dot { margin-left: auto; }

.snote-tag {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10px;
    color: var(--sema-500);
    letter-spacing: 0.06em;
  }

.snote-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--sema-500);
    box-shadow: 0 0 6px var(--sema-500);
  }

/* Typing effect: title/body reveal char-by-char via data-text attr */

.snote-title,
  .snote-body,
  .stage-draft-title,
  .stage-draft-line,
  .stage-guide-step .gtxt {
    white-space: normal;
    overflow: hidden;
  }

.snote-title[data-text]::before,
  .snote-body[data-text]::before,
  .stage-draft-title[data-text]::before,
  .stage-guide-step .gtxt[data-text]::before {
    content: attr(data-text);
    display: inline-block;
    max-width: 0;
    overflow: hidden;
    white-space: nowrap;
    vertical-align: bottom;
    transition: max-width 1.1s steps(40, end);
  }

.snote-title { font-weight: 600; margin-bottom: 3px; letter-spacing: -0.005em; min-height: 1.2em; }

.snote-body { color: var(--text-dim); font-size: clamp(10px, 0.75vw, 12px); min-height: 1em; }

/* trigger typing when phase 1 is active (all notes type at once, staggered) */

.storyB[data-phase="1"] .snote-title[data-text]::before,
  .storyB[data-phase="1"] .snote-body[data-text]::before,
  .storyB[data-phase="2"] .snote-title[data-text]::before,
  .storyB[data-phase="2"] .snote-body[data-text]::before,
  .storyB[data-phase="3"] .snote-title[data-text]::before,
  .storyB[data-phase="3"] .snote-body[data-text]::before,
  .storyB[data-phase="4"] .snote-title[data-text]::before,
  .storyB[data-phase="4"] .snote-body[data-text]::before,
  .storyB[data-phase="5"] .snote-title[data-text]::before,
  .storyB[data-phase="5"] .snote-body[data-text]::before,
  .storyB[data-phase="5"] .snote-title[data-text]::before,
  .storyB[data-phase="5"] .snote-body[data-text]::before,
  .storyB[data-phase="6"] .snote-title[data-text]::before,
  .storyB[data-phase="6"] .snote-body[data-text]::before {
    max-width: 100%;
  }

/* Stagger typing during phase 1 with delays */

.storyB[data-phase="1"] .sn-a .snote-title::before { transition-delay: 0.10s; }

.storyB[data-phase="1"] .sn-a .snote-body::before  { transition-delay: 0.55s; }

.storyB[data-phase="1"] .sn-b .snote-title::before { transition-delay: 0.30s; }

.storyB[data-phase="1"] .sn-b .snote-body::before  { transition-delay: 0.75s; }

.storyB[data-phase="1"] .sn-c .snote-title::before { transition-delay: 0.50s; }

.storyB[data-phase="1"] .sn-c .snote-body::before  { transition-delay: 0.95s; }

.storyB[data-phase="1"] .sn-d .snote-title::before { transition-delay: 0.70s; }

.storyB[data-phase="1"] .sn-d .snote-body::before  { transition-delay: 1.15s; }

.storyB[data-phase="1"] .sn-e .snote-title::before { transition-delay: 0.90s; }

.storyB[data-phase="1"] .sn-e .snote-body::before  { transition-delay: 1.35s; }

.snote-caret {
    display: inline-block;
    width: 6px; height: 12px;
    background: var(--sema-500);
    animation: caretBlink 1s step-end infinite;
    vertical-align: text-bottom;
    margin-left: 2px;
    opacity: 0;
  }

.storyB[data-phase="1"] .snote-caret { opacity: 1; }

/* AUTO-TAG floating pill on each note, revealed on phase 2 */

.snote-autotag {
    position: absolute;
    top: -8px;
    right: 8px;
    padding: 3px 8px;
    background: var(--sema-500);
    color: #0A0705;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.04em;
    border-radius: 10px;
    opacity: 0;
    transform: translateY(4px) scale(0.85);
    transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.2,0.9,0.3,1);
    box-shadow: 0 4px 12px rgba(255,138,76,0.4);
    z-index: 3;
  }

.storyB[data-phase="2"] .snote-autotag,
  .storyB[data-phase="3"] .snote-autotag,
  .storyB[data-phase="4"] .snote-autotag {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

.storyB[data-phase="2"] .sn-a .snote-autotag { transition-delay: 0.10s; }

.storyB[data-phase="2"] .sn-b .snote-autotag { transition-delay: 0.25s; }

.storyB[data-phase="2"] .sn-c .snote-autotag { transition-delay: 0.40s; }

.storyB[data-phase="2"] .sn-d .snote-autotag { transition-delay: 0.55s; }

.storyB[data-phase="2"] .sn-e .snote-autotag { transition-delay: 0.70s; }

.storyB[data-phase="2"] .sn-f .snote-autotag { transition-delay: 0.85s; }

.storyB[data-phase="2"] .sn-g .snote-autotag { transition-delay: 1.00s; }

/* CLUSTER LABEL — a hovering pill showing cluster count (phase 2) */

.cluster-label {
    position: absolute;
    z-index: 4;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255,138,76,0.15);
    border: 1px dashed rgba(255,138,76,0.5);
    color: var(--sema-500);
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10px;
    letter-spacing: 0.06em;
    font-weight: 600;
    opacity: 0;
    transform: scale(0.7);
    transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.2,0.9,0.3,1);
  }

.cluster-code { top: 15%; left: 30%; }

.cluster-bio  { top: 60%; left: 4%; }

.cluster-body { top: 78%; right: 20%; }

.cluster-arch { top: 12%; right: 30%; }

.storyB[data-phase="2"] .cluster-label {
    opacity: 1;
    transform: scale(1);
    transition-delay: 1.15s;
  }

/* positions of notes */

.sn-a { top: 8%;  left: 4%; }

.sn-b { top: 44%; left: 4%; }

.sn-c { top: 8%;  right: 4%; }

.sn-d { top: 44%; right: 4%; }

.sn-e { top: 30%; left: 40%; }

.sn-f { top: 76%; left: 20%; }

.sn-g { top: 76%; right: 20%; }

/* base visibility — all notes visible from phase 1..5 */

.storyB[data-phase="1"] .snote,
  .storyB[data-phase="2"] .snote,
  .storyB[data-phase="3"] .snote,
  .storyB[data-phase="4"] .snote,
  .storyB[data-phase="5"] .snote,
  .storyB[data-phase="5"] .snote,
  .storyB[data-phase="6"] .snote {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

/* phase 1 — 5 base notes visible; extra notes (f,g) hidden */

.storyB[data-phase="1"] .sn-f,
  .storyB[data-phase="1"] .sn-g { opacity: 0; }

.storyB[data-phase="1"] .sn-a { transition-delay: 0.05s; }

.storyB[data-phase="1"] .sn-b { transition-delay: 0.25s; }

.storyB[data-phase="1"] .sn-c { transition-delay: 0.45s; }

.storyB[data-phase="1"] .sn-d { transition-delay: 0.65s; }

.storyB[data-phase="1"] .sn-e { transition-delay: 0.85s; }

/* phase 2 — auto-tags + cluster labels appear, sn-f/g fade in */

.storyB[data-phase="2"] .snote { transition-delay: 0s; }

/* phase 3 — sociology ↔ physics synthesis */

.storyB[data-phase="3"] .snote { opacity: 0.28; filter: blur(0.5px); transition-delay: 0s; }

.storyB[data-phase="3"] .sn-b,
  .storyB[data-phase="3"] .sn-c { opacity: 1; filter: none;
    border-color: var(--sema-500);
    box-shadow: 0 0 0 1px rgba(255,138,76,0.4), 0 0 32px rgba(255,138,76,0.25);
  }

/* phase 4 — meeting ↔ db-design synthesis */

.storyB[data-phase="4"] .snote { opacity: 0.28; filter: blur(0.5px); transition-delay: 0s; }

.storyB[data-phase="4"] .sn-d,
  .storyB[data-phase="4"] .sn-e { opacity: 1; filter: none;
    border-color: var(--sema-500);
    box-shadow: 0 0 0 1px rgba(255,138,76,0.4), 0 0 32px rgba(255,138,76,0.22);
  }

/* ============================================================
     PHASE HIGHLIGHTS — which notes stay visible on which phase
     ------------------------------------------------------------
     Phase 1 & 2: all base notes visible
     Phase 3: sn-b (sociology) + sn-c (physics)
     Phase 4: sn-d (task MEETING) + sn-e (db-design)
     Phase 5: tk-finance TASK + sn-f + sn-g
     Phase 6: tk-roadmap TASK + rm-alpha + rm-beta + rm-v1
     ============================================================ */
/* Task-note position (both share top-left because only one visible at a time) */
/* TASK note position: same slot for both — only one is visible per phase (phase 5 or 6) */

.task-note.tk-finance,
  .task-note.tk-roadmap { top: 4%; left: 4%; width: clamp(200px, 26%, 280px); }

/* Roadmap notes positions (phase 6) — three cards under the TASK, all in the LEFT column so they don't overlap the guide on the right */

.rm-note.rm-alpha { top: 30%; left: 4%; }

.rm-note.rm-beta  { top: 54%; left: 4%; }

.rm-note.rm-v1    { top: 78%; left: 4%; }

.rm-note { width: clamp(200px, 26%, 280px); }

/* Task-note + rm-note default hidden. Uses visibility so hit-tests and paint don't leak between phases. */

.task-note, .rm-note { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .35s ease, visibility 0s linear .35s; }

.storyB[data-phase="5"] .tk-finance,
  .storyB[data-phase="6"] .tk-roadmap,
  .storyB[data-phase="6"] .rm-note { transition-delay: 0s; }

/* --- PHASE 5: TASK finance + две фин-заметки --- */

.storyB[data-phase="5"] .snote { opacity: 0.16; filter: blur(1px); transition-delay: 0s; }

.storyB[data-phase="5"] .tk-finance { opacity: 1; visibility: visible; filter: none; pointer-events: auto;
    border-color: var(--sema-500);
    box-shadow: 0 0 0 1px rgba(255,138,76,0.45), 0 0 28px rgba(255,138,76,0.28);
  }

.storyB[data-phase="5"] .sn-f,
  .storyB[data-phase="5"] .sn-g { opacity: 1; filter: none;
    border-color: var(--sema-500);
    box-shadow: 0 0 0 1px rgba(255,138,76,0.35), 0 0 20px rgba(255,138,76,0.18);
  }

/* --- PHASE 6: TASK roadmap + 3 roadmap-заметки, базовые скрыты --- */

.storyB[data-phase="6"] .snote { opacity: 0; filter: blur(1px); transition-delay: 0s; pointer-events: none; visibility: hidden; }

.storyB[data-phase="6"] .tk-roadmap { opacity: 1; visibility: visible; filter: none; pointer-events: auto;
    border-color: var(--sema-500);
    box-shadow: 0 0 0 1px rgba(255,138,76,0.45), 0 0 28px rgba(255,138,76,0.28);
  }

.storyB[data-phase="6"] .rm-note { opacity: 1; visibility: visible; filter: none; pointer-events: auto;
    border-color: var(--sema-500);
    box-shadow: 0 0 0 1px rgba(255,138,76,0.35), 0 0 20px rgba(255,138,76,0.18);
  }

/* Phase-specific finance/roadmap lines: hide them outside their target phase so they don't clutter earlier phases */

.stage-lines .s-fin-1, .stage-lines .s-fin-2,
  .stage-lines .s-rm-1, .stage-lines .s-rm-2, .stage-lines .s-rm-3 { opacity: 0; }

/* SVG lines behavior per phase */

.storyB[data-phase="3"] .stage-lines .sln { opacity: 0.12; }

.storyB[data-phase="3"] .stage-lines .s-ln6 { opacity: 1; stroke-width: 2; filter: drop-shadow(0 0 8px rgba(255,138,76,0.9)); }

.storyB[data-phase="4"] .stage-lines .sln { opacity: 0.12; }

.storyB[data-phase="4"] .stage-lines .s-ln5 { opacity: 1; stroke-width: 2; filter: drop-shadow(0 0 8px rgba(255,138,76,0.9)); }

/* phase 5 — TASK finance → fin-notes */

.storyB[data-phase="5"] .stage-lines .sln { opacity: 0.08; }

.storyB[data-phase="5"] .stage-lines .s-fin-1,
  .storyB[data-phase="5"] .stage-lines .s-fin-2 { opacity: 1; stroke-width: 2; filter: drop-shadow(0 0 8px rgba(255,138,76,0.9)); }

/* phase 6 — TASK roadmap → 3 rm-notes */

.storyB[data-phase="6"] .stage-lines .sln { opacity: 0.08; }

.storyB[data-phase="6"] .stage-lines .s-rm-1,
  .storyB[data-phase="6"] .stage-lines .s-rm-2,
  .storyB[data-phase="6"] .stage-lines .s-rm-3 { opacity: 1; stroke-width: 2; filter: drop-shadow(0 0 8px rgba(255,138,76,0.9)); }

/* NOTIFICATION cards — top-right, don't overlap notes; slide in like a system notification */

.snote-notif {
    position: absolute;
    z-index: 5;
    top: 12px;
    right: 12px;
    width: min(300px, 42%);
    padding: 10px 14px 12px;
    background: linear-gradient(135deg, rgba(255,138,76,0.98), rgba(230,110,50,0.98));
    color: #0A0705;
    border-radius: 12px;
    font-size: clamp(11px, 0.85vw, 13px);
    line-height: 1.35;
    opacity: 0;
    transform: translateX(20px) translateY(-6px) scale(0.94);
    transition: opacity 0.5s ease, transform 0.55s cubic-bezier(0.16,1,0.3,1);
    box-shadow: 0 18px 44px rgba(255,138,76,0.32), 0 4px 16px rgba(0,0,0,0.3);
    pointer-events: none;
  }

.notif-head {
    display: flex; align-items: center; gap: 6px;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 4px;
  }

.notif-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: #0A0705;
    color: var(--sema-500);
    font-size: 10px;
    font-weight: 700;
  }

.notif-body { font-weight: 500; }

/* phase 3 notification (bio↔code) delayed to give notes time */

.storyB[data-phase="3"] .notif-bio-code {
    opacity: 1;
    transform: translateX(0) translateY(0) scale(1);
    transition-delay: 1.5s;
  }

/* phase 4 notification (train↔sleep) */

.storyB[data-phase="4"] .notif-train-sleep {
    opacity: 1;
    transform: translateX(0) translateY(0) scale(1);
    transition-delay: 1.5s;
  }

/* Q&A stage removed — was old phase 5 dialogue; Sema is autonomous now */
/* draft artifact (phase 3) */

.stage-draft {
    position: absolute;
    z-index: 3;
    top: 8%; right: 6%;
    width: clamp(220px, 34%, 380px);
    padding: 16px 18px;
    background: rgba(20,14,10,0.94);
    border: 1px solid rgba(255,138,76,0.35);
    border-radius: 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(0.96);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.2,0.9,0.3,1), visibility 0s linear 0.5s;
    backdrop-filter: blur(8px);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  }

.stage-draft-head {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
  }

.stage-draft-tag {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--sema-500);
  }

.stage-draft-title {
    font-weight: 700;
    font-size: clamp(12px, 1vw, 14px);
    color: #F4EEE6;
  }

.stage-draft-line {
    /* was bar; now real text lines with typing */
    font-size: clamp(11px, 0.88vw, 13px);
    line-height: 1.5;
    color: var(--text-dim);
    margin-bottom: 4px;
    min-height: 1.3em;
  }

.stage-draft-src {
    margin-top: 6px;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10px;
    color: var(--text-mute);
    letter-spacing: 0.04em;
  }

.storyB[data-phase="5"] .stage-draft { visibility: visible; transition-delay: 0s;
    opacity: 1;
    transform: translateY(0) scale(1);
    transition-delay: 0.15s;
  }

/* Typing draft lines sequentially in phase 6 */

.stage-draft-title[data-text]::before,
  .stage-draft-line[data-text]::before {
    content: attr(data-text);
    display: inline-block;
    max-width: 0;
    overflow: hidden;
    white-space: nowrap;
    vertical-align: bottom;
    transition: max-width 1.2s steps(60, end);
  }

.storyB[data-phase="5"] .stage-draft-title[data-text]::before { max-width: 100%; transition-delay: 0.4s; }

.storyB[data-phase="5"] .ml1[data-text]::before { max-width: 100%; transition-delay: 0.9s; transition-duration: 0.9s; }

.storyB[data-phase="5"] .ml2[data-text]::before { max-width: 100%; transition-delay: 1.4s; transition-duration: 0.9s; }

.storyB[data-phase="5"] .ml3[data-text]::before { max-width: 100%; transition-delay: 1.9s; transition-duration: 0.9s; }

.storyB[data-phase="5"] .ml4[data-text]::before { max-width: 100%; transition-delay: 2.4s; transition-duration: 0.7s; }

.storyB[data-phase="5"] .ml5[data-text]::before { max-width: 100%; transition-delay: 2.9s; transition-duration: 0.5s; }

/* guide artifact (phase 4) */

.stage-guide {
    position: absolute;
    z-index: 3;
    top: 8%; right: 6%;
    width: clamp(240px, 36%, 420px);
    padding: 16px 18px;
    background: rgba(20,14,10,0.94);
    border: 1px solid rgba(255,138,76,0.35);
    border-radius: 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(0.96);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.2,0.9,0.3,1), visibility 0s linear 0.5s;
    backdrop-filter: blur(8px);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  }

.stage-guide-head {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 14px;
  }

.stage-guide-tag {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--sema-500);
  }

.stage-guide-title {
    font-weight: 700;
    font-size: clamp(12px, 1vw, 14px);
    color: #F4EEE6;
  }

.stage-guide-step {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 6px 0;
    font-size: clamp(11px, 0.85vw, 13px);
    color: var(--text-dim);
    line-height: 1.4;
    opacity: 0;
    transform: translateX(-8px);
    transition: opacity 0.4s ease, transform 0.4s ease;
  }

.stage-guide-step .num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: rgba(255,138,76,0.14);
    color: var(--sema-500);
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
  }

.storyB[data-phase="6"] .stage-guide {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    transition-delay: 0.15s;
  }

.storyB[data-phase="6"] .stage-guide-step {
    opacity: 1;
    transform: translateX(0);
  }

.storyB[data-phase="6"] .stage-guide-step:nth-child(2) { transition-delay: 0.35s; }

.storyB[data-phase="6"] .stage-guide-step:nth-child(3) { transition-delay: 0.5s; }

.storyB[data-phase="6"] .stage-guide-step:nth-child(4) { transition-delay: 0.65s; }

.storyB[data-phase="6"] .stage-guide-step:nth-child(5) { transition-delay: 0.8s; }

/* Guide steps: no typing animation — show text immediately so the card is never empty. */

.stage-guide-step .gtxt { display: block; white-space: normal; word-break: normal; overflow-wrap: anywhere; }

.stage-guide-step .gtxt[data-text]::before { content: none; }

/* CAPTIONS */

.stage-captions {
    position: relative;
    min-height: clamp(100px, 14vh, 160px);
    padding: 0 2vw;
  }

.scap {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.2,0.9,0.3,1);
    pointer-events: none;
  }

.scap-eye {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: clamp(10px, 0.85vw, 12px);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--sema-500);
  }

.scap h3 {
    font-family: 'Space Grotesk', ui-sans-serif, system-ui;
    font-weight: 700;
    font-size: clamp(22px, 3.2vw, 40px);
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin: 0;
    color: #F4EEE6;
  }

.scap p {
    font-size: clamp(13px, 1.1vw, 16px);
    line-height: 1.55;
    color: var(--text-dim);
    max-width: 640px;
    margin: 0;
  }

.storyB[data-phase="1"] .scap[data-slide="1"],
  .storyB[data-phase="2"] .scap[data-slide="2"],
  .storyB[data-phase="3"] .scap[data-slide="3"],
  .storyB[data-phase="4"] .scap[data-slide="4"],
  .storyB[data-phase="5"] .scap[data-slide="5"],
  .storyB[data-phase="6"] .scap[data-slide="6"] {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

/* CONTROLS */

.storyB-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(8px, 1.5vw, 16px);
    padding: 4px 0;
  }

.sctrl {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255,138,76,0.32);
    background: rgba(255,138,76,0.06);
    color: var(--sema-500);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    flex-shrink: 0;
  }

.sctrl:hover {
    background: rgba(255,138,76,0.14);
    border-color: var(--sema-500);
    transform: translateY(-1px);
  }

.sctrl:active { transform: translateY(0); }

.sctrl:focus-visible { outline: 2px solid var(--sema-500); outline-offset: 3px; }

.sctrl-dots {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
  }

.sdot {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid rgba(255,255,255,0.09);
    background: transparent;
    color: var(--text-dim);
    border-radius: 999px;
    cursor: pointer;
    font: inherit;
    font-size: clamp(11px, 0.85vw, 13px);
    letter-spacing: 0.005em;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  }

.sdot span {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    transition: background 0.2s ease, box-shadow 0.2s ease;
  }

.sdot:hover { color: #F4EEE6; border-color: rgba(255,255,255,0.2); }

.storyB[data-phase="1"] .sdot[data-goto="1"],
  .storyB[data-phase="2"] .sdot[data-goto="2"],
  .storyB[data-phase="3"] .sdot[data-goto="3"],
  .storyB[data-phase="4"] .sdot[data-goto="4"],
  .storyB[data-phase="5"] .sdot[data-goto="5"],
  .storyB[data-phase="6"] .sdot[data-goto="6"] {
    color: #F4EEE6;
    border-color: var(--sema-500);
    background: rgba(255,138,76,0.08);
  }

.storyB[data-phase="1"] .sdot[data-goto="1"] span,
  .storyB[data-phase="2"] .sdot[data-goto="2"] span,
  .storyB[data-phase="3"] .sdot[data-goto="3"] span,
  .storyB[data-phase="4"] .sdot[data-goto="4"] span,
  .storyB[data-phase="5"] .sdot[data-goto="5"] span,
  .storyB[data-phase="6"] .sdot[data-goto="6"] span {
    background: var(--sema-500);
    box-shadow: 0 0 8px var(--sema-500);
  }

/* progress bar (autoplay indicator) */

.storyB-progress {
    height: 2px;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    background: rgba(255,255,255,0.06);
    border-radius: 2px;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.4s ease;
  }

.sprogress-bar {
    display: block;
    height: 100%;
    width: 0%;
    background: var(--sema-500);
    transition: width 0.15s linear;
  }

.storyB[data-mode="auto"] .storyB-progress { opacity: 1; }
