/* ============================================================
   Frai SCM — V2 "Deep dive" (Slice 1, scripted)
   Reuses demo.css :root tokens + gate (linked first in v2.html).
   This file adds only the V2-specific deep-dive layout.
   ============================================================ */

.v2-shell { max-width: 1180px; margin: 0 auto; padding: clamp(20px,4vh,40px) var(--pad) 80px;
  display: grid; grid-template-columns: 260px 1fr; gap: 26px; align-items: start; }

/* ---------- B: architecture map (sidebar) ---------- */
.archmap { position: sticky; top: 84px; }
.archmap h3 { font-family: var(--display); font-weight: 700; font-size: 13px; letter-spacing: 0.12em;
  color: var(--text-faint); text-transform: uppercase; margin-bottom: 12px; }
.node { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid var(--line);
  border-radius: 4px; background: var(--panel); margin-bottom: 8px; position: relative; transition: all 0.25s ease; }
.node .ic { font-size: 20px; width: 24px; text-align: center; }
.node .nm { font-family: var(--display); font-weight: 600; font-size: 14px; line-height: 1.15; }
.node .nm small { display: block; color: var(--text-faint); font-size: 11px; font-weight: 400; letter-spacing: 0.02em; }
.node.active { border-color: var(--accent); background: linear-gradient(180deg, var(--panel-2), var(--panel));
  box-shadow: 0 0 16px var(--accent-glow); }
.node.active .nm { color: var(--accent); }
.node.done { opacity: 0.55; }
.node.done::after { content: "✓"; position: absolute; right: 10px; color: var(--green); font-size: 12px; }
.node.active::after { content: "▸"; position: absolute; right: 8px; color: var(--accent); animation: blink 1s steps(2) infinite; }
.node-link { display: block; }

/* connector line down the rail */
.archmap .rail { position: relative; }

/* ---------- A: guided walkthrough (main) ---------- */
.walk { min-height: 60vh; }
.walk-progress { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.walk-progress span { height: 4px; flex: 1; min-width: 18px; border-radius: 2px; background: var(--line); }
.walk-progress span.on { background: var(--accent); }

.sysbadge { display: inline-flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 600;
  letter-spacing: 0.04em; font-size: 13px; color: var(--accent); border: 1px solid var(--accent);
  border-radius: 2px; padding: 4px 11px; margin-bottom: 12px; }
.walk h2 { font-family: var(--display); font-weight: 700; font-size: clamp(24px,4vw,38px); line-height: 1.06; }
.walk .what { color: var(--text); margin-top: 12px; max-width: 66ch; }

.block { border-left: 2px solid var(--line-2); padding: 4px 0 4px 14px; margin-top: 16px; }
.block b { font-family: var(--display); letter-spacing: 0.05em; font-size: 12px; text-transform: uppercase; color: var(--text-faint); display: block; margin-bottom: 3px; }
.block.wall { border-left-color: var(--red); }
.block.wall b { color: var(--red); }

/* detail cards (LLM box / stock / transport / deep-links) */
.detail { background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line);
  border-radius: 4px; padding: 16px 18px; margin-top: 18px; }
.detail h4 { font-family: var(--display); font-size: 13px; letter-spacing: 0.06em; color: var(--text-dim);
  text-transform: uppercase; margin-bottom: 10px; }

/* scripted LLM response box */
.llm { font-family: var(--mono); font-size: 13px; background: var(--bg-1); border: 1px solid var(--line);
  border-radius: 4px; padding: 12px 14px; white-space: pre-wrap; line-height: 1.5; color: var(--text); }
.llm .ev { color: var(--green); }
.llm-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 11px; color: var(--text-faint); }
.scripted-flag { color: var(--amber-2); }
.live-flag { color: var(--green); font-family: var(--display); font-weight: 600; font-size: 11px;
  letter-spacing: 0.05em; margin-left: 8px; vertical-align: middle; }
.detail.loading { color: var(--text-faint); }
.detail.loading .ev { color: var(--text-faint); animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }

/* stock table with before/after */
.stock { width: 100%; border-collapse: collapse; font-size: 13px; }
.stock th, .stock td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); }
.stock th { color: var(--text-faint); font-weight: 500; font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; }
.stock .num { text-align: right; font-variant-numeric: tabular-nums; }
.stock .drop { color: var(--red); font-weight: 600; }
.stock .rise { color: var(--green); font-weight: 600; }

/* transport card */
.transport { display: flex; gap: 18px; flex-wrap: wrap; }
.transport div { display: flex; flex-direction: column; }
.transport b { font-family: var(--display); font-size: 18px; color: var(--accent); }
.transport small { color: var(--text-faint); font-size: 11px; }

/* deep-links */
.deeplinks { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.deeplink { font-family: var(--display); font-weight: 600; font-size: 13px; letter-spacing: 0.03em;
  border: 1px solid var(--line-2); border-radius: 3px; padding: 8px 13px; color: var(--text-dim); transition: all 0.18s ease; }
.deeplink:hover { border-color: var(--accent); color: var(--accent); }
.deeplink .real { color: var(--green); font-size: 10px; margin-left: 6px; }

/* nav */
.walk-nav { margin-top: 26px; display: flex; gap: 12px; align-items: center; }

/* topbar V1 link */
.back-v1 { font-family: var(--display); font-weight: 600; font-size: 13px; color: var(--text-dim);
  border: 1px solid var(--line-2); border-radius: 3px; padding: 5px 11px; }
.back-v1:hover { color: var(--accent); border-color: var(--accent); }

@media (max-width: 820px) {
  .v2-shell { grid-template-columns: 1fr; }
  .archmap { position: static; }
  .archmap .rail { display: flex; gap: 8px; overflow-x: auto; }
  .node { margin-bottom: 0; min-width: 150px; }
  .transport { gap: 12px; }
}

/* ============================================================
   General-wow polish — motion, climax drama, projector legibility.
   CSS-only (no logic change); reuses demo.css keyframes (blink/sweep).
   ============================================================ */

/* room/projector legibility — the headline story reads from the back */
.walk .what { font-size: 16px; line-height: 1.55; }

/* the LIVE badges breathe so "live" actually reads as live */
.data-mode, .live-flag { animation: livepulse 2.4s ease-in-out infinite; }
@keyframes livepulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }

/* the Sentinel is visibly THINKING while it streams ---------------------- */
.llm.streaming { position: relative; overflow: hidden;
  border-color: var(--accent); box-shadow: 0 0 24px var(--accent-glow); }
/* a scanning beam sweeps the top edge while tokens arrive */
.llm.streaming::before { content: ""; position: absolute; top: 0; left: 0; height: 2px; width: 38%;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: sweep 1.25s linear infinite; }
/* a blinking cursor trails the live token stream */
.llm.streaming::after { content: "\258B"; color: var(--accent);
  animation: blink 0.9s steps(2) infinite; }

/* error frames render RED, never the success green (review #9) */
.llm .ev.err { color: var(--red); font-weight: 600; }

/* the climax: the SAP stock change reads at a glance, with a one-shot flash */
.stock .num { font-size: 16px; }
.stock .drop, .stock .rise { font-size: 20px; font-weight: 700; }
.stock .drop::after { content: " \25BC"; font-size: 12px; }
.stock .rise::after { content: " \25B2"; font-size: 12px; }
.stock td.drop { animation: flashred 1.2s ease-out; }
.stock td.rise { animation: flashgreen 1.2s ease-out; }
@keyframes flashred { 0% { background: rgba(248, 113, 113, 0.32); } 100% { background: transparent; } }
@keyframes flashgreen { 0% { background: rgba(52, 211, 153, 0.26); } 100% { background: transparent; } }

/* ---- step 3: visual "decision" panel (the general reads the verdict) ---- */
.decision { background: var(--bg-1); border: 1px solid var(--line); border-radius: 4px;
  padding: 14px 16px; }
.vthinking { color: var(--accent); font-family: var(--display); font-weight: 600;
  animation: livepulse 1.2s ease-in-out infinite; }
.vrow { display: flex; justify-content: space-between; align-items: baseline; padding: 3px 0; font-size: 14px; }
.vk { color: var(--text-faint); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }
.vv { font-family: var(--mono); font-size: 15px; color: var(--text); }
.vlabel { color: var(--text-faint); font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.07em; margin: 12px 0 7px; }
.cands { display: flex; flex-direction: column; gap: 7px; }
.cand { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border: 1px solid var(--line);
  border-radius: 4px; opacity: 0.62; transition: all 0.2s ease; }
.cand .rk { width: 18px; text-align: center; font-weight: 700; color: var(--text-faint); }
.cand .mode { font-family: var(--display); font-weight: 600; font-size: 15px; }
.cand .eta { color: var(--text-dim); font-size: 13px; }
.cand.win { opacity: 1; border-color: var(--accent);
  background: linear-gradient(180deg, var(--panel-2), var(--panel)); box-shadow: 0 0 16px var(--accent-glow); }
.cand.win .rk { color: var(--accent); font-size: 16px; }
.cand .badge { margin-left: auto; font-family: var(--display); font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent);
  border: 1px solid var(--accent); border-radius: 10px; padding: 2px 9px; }
.verdict { margin-top: 13px; padding: 11px 14px; border-radius: 4px; font-size: 14px; line-height: 1.5; }
.verdict.ok { border: 1px solid var(--green); background: rgba(52, 211, 153, 0.10); }
.verdict.ok b { color: var(--green); }
.verdict.warn { border: 1px solid var(--amber-2); background: rgba(251, 191, 36, 0.10); }
.verdict.warn b { color: var(--amber-2); }
.rawwrap { margin-top: 10px; }
.rawwrap summary { cursor: pointer; color: var(--text-faint); font-family: var(--display);
  font-size: 12px; letter-spacing: 0.04em; padding: 4px 0; user-select: none; }
.rawwrap summary:hover { color: var(--accent); }
.rawwrap[open] summary { margin-bottom: 8px; }

/* ---- theatre map: real projected geography FR → PL → UA; marker flies the route ---- */
.theatre { max-width: 920px; margin: 0 auto; padding: 16px var(--pad) 0; }
.theatre-head { font-family: var(--display); font-weight: 700; font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-faint); margin-bottom: 12px; }
.theatre-map { position: relative; aspect-ratio: 1200 / 500; max-width: 880px; margin: 0 auto;
  border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--bg-1); }
.theatre-bg { width: 100%; height: 100%; display: block; opacity: 0.95; }
.stop { position: absolute; transform: translate(-50%, -50%); z-index: 2; }
.stop .dot { display: block; width: 13px; height: 13px; border-radius: 50%;
  background: var(--panel-2); border: 2px solid var(--line-2); transition: all 0.4s ease; }
.stop.reached .dot { border-color: var(--accent); background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow); }
.stop.current .dot { animation: ping 1.6s ease-out infinite; }
.stop .lbl { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); white-space: nowrap;
  font-family: var(--display); font-weight: 600; font-size: 13px; color: var(--text-dim);
  text-shadow: 0 1px 4px var(--bg), 0 0 4px var(--bg); }
.stop.reached .lbl { color: var(--text); }
.stop .lbl small { display: block; font-weight: 400; font-size: 10px; color: var(--text-faint);
  letter-spacing: 0.02em; text-align: center; }
.stop .flag { font-size: 13px; }
.mover { position: absolute; transform: translate(-50%, -50%); font-size: 19px; z-index: 3;
  transition: left 1.5s cubic-bezier(0.45, 0, 0.4, 1), top 1.5s cubic-bezier(0.45, 0, 0.4, 1);
  filter: drop-shadow(0 0 6px var(--accent-glow)); }
.mover.delivered { filter: drop-shadow(0 0 9px var(--green)); }
@media (max-width: 820px) {
  .stop .lbl small { display: none; } .stop .lbl { font-size: 11px; }
}
/* dashed route through the three stops (the origin leg changes per scenario) */
.theatre-route { position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 1; pointer-events: none; }
#theatre-route { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 5 5;
  opacity: 0.45; vector-effect: non-scaling-stroke; }
/* scenario selector — pick the donor nation; the whole walkthrough re-points */
.theatre-head { display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; }
.scn-select { display: flex; align-items: center; gap: 6px; }
.scn-label { font-size: 10px; letter-spacing: 0.1em; color: var(--text-faint); }
.scn-btn { font-family: var(--display); font-weight: 600; font-size: 11px;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-dim);
  background: var(--panel); cursor: pointer; border: 1px solid var(--line-2);
  border-radius: 999px; padding: 4px 11px; transition: all 0.2s ease; }
.scn-btn:hover { color: var(--text); border-color: var(--accent); }
.scn-btn.active { color: var(--bg); background: var(--accent); border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow); }

/* ---- intro overlay (orient a cold viewer; Begin or Play the full story) ---- */
.intro { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  background: rgba(6, 8, 11, 0.86); backdrop-filter: blur(3px); padding: 20px; }
.intro.hidden { display: none; }
.intro-card { max-width: 560px; background: var(--panel); border: 1px solid var(--line-2);
  border-radius: 10px; padding: 28px 30px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55); }
.intro-kicker { font-family: var(--display); font-weight: 700; font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 12px; }
.intro-card h2 { font-family: var(--display); font-weight: 700; font-size: clamp(22px, 3.4vw, 30px);
  line-height: 1.1; margin-bottom: 12px; }
.intro-card p { color: var(--text-dim); line-height: 1.6; margin-bottom: 22px; }
.intro-card p b { color: var(--text); }
.intro-actions { display: flex; gap: 12px; flex-wrap: wrap; }
