/* chapter2.css — Chapter 2 (산업의 시선 / Live Value Chain) 데모 전용 스타일
   원본: chapter2.html 의 <style> 블록
   - 외부 페이지와 충돌하지 않도록 .chapter2-demo 컨테이너 아래로 모두 스코프
*/

.chapter2-demo {
    --bg: var(--white);
    --bg-soft: #F5F5F2;
    --ink: #0F1115;
    --ink-soft: #2A2C33;
    --muted: #6B6E76;
    --muted-soft: #8E9098;
    --line: #E5E5E0;
    --line-soft: #EEEEE9;
    --accent: var(--mint);
    --accent-soft: rgba(var(--mint-rgb), 0.14);
    --accent-dim: rgba(var(--mint-rgb), 0.05);
    --hot: #DC2626;
    --hot-soft: rgba(220, 38, 38, 0.08);
    --live: var(--mint);
    --c-buy: #C9A56B;
    --c-sell: var(--mint);
    --c-rival: #D87A7A;
    --serif: var(--font-fraunces), 'Fraunces', 'Times New Roman', serif;
    --sans: 'Pretendard', -apple-system, sans-serif;
    --mono: var(--font-jetbrains-mono), 'JetBrains Mono', monospace;

  /* 원본 body 룰 → 컨테이너에 적용 */
  font-family: var(--sans);
  font-weight: 500;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  /* overlay/popout을 demo 영역 내부로 한정시키는 anchor */
  position: relative;
}

/* 원본의 * 리셋을 .chapter2-demo 아래로 한정 */
.chapter2-demo,
.chapter2-demo *,
.chapter2-demo *::before,
.chapter2-demo *::after { box-sizing: border-box; }
.chapter2-demo :is(div, section, ul, ol, li, p, h1, h2, h3, h4, h5, h6,
                   figure, blockquote, button) { margin: 0; padding: 0; }
.chapter2-demo button { background: none; border: none; cursor: pointer; font: inherit; color: inherit; }

/* ===== 본문 규칙 (CSS nesting으로 .chapter2-demo 스코프 내부에 위치) ===== */
.chapter2-demo {
  /* 외곽 카드는 chapter3 의 .lens-card (lenses.css) 가 담당 — chapter1·2·3 공통 shell */

  /* ===== INTRO ===== */
  .intro {
    text-align: center;
    margin-bottom: 40px;
  }

  .intro-label {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0;
    color: var(--muted);
    margin-bottom: 16px;
  }

  .intro-title {
    font-family: var(--sans);
    font-size: 44px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.04em;
    color: var(--ink);
    margin-bottom: 14px;
  }

  .intro-title em {
    font-style: italic;
    font-weight: 300;
    color: var(--accent);
  }

  .intro-sub {
    font-size: 16px;
    color: var(--muted);
    line-height: 1.55;
    max-width: 620px;
    margin: 0 auto;
  }

  /* ===== DEMO STATUS BAR ===== */
  .demo-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin: 0 auto 18px;
    padding: 8px 18px;
    background: var(--ink);
    color: white;
    border-radius: 100px;
    max-width: max-content;
    font-size: 10px;
    letter-spacing: 0;
  }

  .demo-dot {
    width: 6px;
    height: 6px;
    background: var(--live);
    border-radius: 50%;
    animation: livePulse 1.4s ease-in-out infinite;
  }

  .demo-action {
    color: rgba(255,255,255,0.6);
  }

  .demo-action strong {
    color: var(--accent);
    font-weight: 600;
  }

  .demo-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    border-radius: 100px;
    padding: 3px 10px;
    font-size: 9px;
    letter-spacing: 0;
    cursor: pointer;
    transition: all 0.2s;
  }

  .demo-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.4);
  }

  /* ===== LENS BAR ===== */
  .lens-bar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    margin-bottom: 18px;
  }

  .lens-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .lens-label {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0;
    color: var(--muted);
    margin-right: 8px;
    min-width: 56px;
  }

  .lens-chip {
    background: white;
    border: 1px solid var(--line);
    border-radius: 100px;
    padding: 7px 13px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink);
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: var(--sans);
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }

  .lens-chip:hover { border-color: var(--ink); }

  .lens-chip.active {
    background: var(--ink);
    color: white;
    border-color: var(--ink);
  }

  /* + add chip — implies "more / customizable" */
  .lens-chip.add-chip {
    background: transparent;
    border: 1px dashed var(--line);
    color: var(--muted);
    padding: 7px 11px;
    font-size: 11px;
    letter-spacing: 0;
    font-weight: 500;
  }

  .lens-chip.add-chip:hover {
    border-color: var(--accent);
    color: var(--accent);
    border-style: solid;
  }

  .lens-chip.add-chip .add-icon {
    display: inline-block;
    width: 14px;
    height: 14px;
    line-height: 13px;
    text-align: center;
    border: 1px solid currentColor;
    border-radius: 50%;
    font-size: 10px;
    margin-right: 4px;
  }

  .lens-chip.auto-pulse {
    animation: chipPulse 0.6s ease;
  }


  .flag {
    font-size: 13px;
    line-height: 1;
  }

  /* universe stats */
  .universe-stats {
    text-align: center;
    margin-bottom: 16px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: 0;
  }

  .universe-stats strong {
    color: var(--accent);
    font-weight: 600;
    font-size: 13px;
  }

  /* ===== UNIVERSE GRID ===== */
  /* Universe 단계와 Value Chain 단계가 같은 세로 공간을 차지하도록 min-height 고정.
     lens-card-body 안에서 남는 세로 공간을 흡수 — chapter3 의 .pol-stage 와 동일한 flex 패턴.
     flex column 으로 만들어 grid 아래 남는 공간에 caption 이 margin:auto 로
     vertical 가운데 정렬되도록. */
  .universe {
    position: relative;
    padding: 0;
    /* min-height 600 → 700 — vchain-layers 가 L1~L5 카드 + filter + bottom
       padding 까지 합쳐 600 을 살짝 넘어 overflow-hidden 에 의해 카드 하단이
       잘려 보이는 문제 해결. */
    min-height: 700px;
    overflow: hidden;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
  }

  /* 42개 (7×6) 회사가 깔끔하게 채워지도록 — 카드 minmax 와 gap 을 키워서
     lens-card 의 가로 폭에 정확히 6 칸이 들어가도록. */
  .universe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 6px;
    flex: 0 0 auto; /* universe flex column 안에서 자연스러운 높이만 차지 */
  }

  /* Universe 단계 설명 캡션 — grid 아래 남는 공간의 vertical 가운데에 배치.
     margin: auto 0 가 flex column 안에서 위·아래 공간을 동등하게 흡수해서
     caption 을 중앙 정렬시킴. */
  .universe-caption {
    margin: auto 0;
    padding: 16px 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 0 0 auto;
  }
  .universe-caption-line {
    font-size: 14px;
    line-height: 1.5;
    color: var(--ink-soft);
    font-weight: 500;
  }
  .universe-caption-line.muted {
    color: var(--muted);
    font-size: 15px;
    font-weight: 400;
  }

  .company {
    background: var(--bg-soft);
    border: 1px solid transparent;
    border-radius: 7px;
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    min-height: 64px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  /* 데모용 "더보기" 카드 — universe-grid 끝에 표시 */
  .company-more {
    background: var(--accent-soft);
    border: 1px dashed var(--accent);
    cursor: default;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--ink);
  }
  .company-more:hover { transform: none; }
  .company-more-num {
    font-family: var(--mono);
    font-size: 16px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -0.01em;
  }
  .company-more-text {
    font-size: 10px;
    color: var(--muted);
    margin-top: 2px;
    line-height: 1.3;
  }

  .company-top {
    display: flex;
    align-items: center;
    gap: 5px;
  }

  .company-flag {
    font-size: 12px;
    line-height: 1;
    flex-shrink: 0;
  }

  .company-name {
    font-weight: 600;
    font-size: 12.5px;
    line-height: 1.2;
    color: var(--ink-soft);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .company-tag {
    font-size: 10px;
    letter-spacing: 0;
    color: var(--muted-soft);
    margin-top: 6px;
  }

  .company.dimmed {
    opacity: 0.2;
  }

  .company.highlight {
    background: var(--accent-soft);
    border-color: var(--accent);
  }

  .company.highlight .company-name { color: var(--ink); }
  .company.highlight .company-tag { color: var(--accent); }

  .company.spotlight {
    background: var(--ink);
    border-color: var(--ink);
    z-index: 10;
    box-shadow: 0 14px 36px rgba(0,0,0,0.32), 0 0 0 3px rgba(17,19,23,0.08);
  }

  .company.spotlight .company-name { color: white; }
  .company.spotlight .company-tag { color: rgba(255,255,255,0.7); }

  .company.live::after {
    content: '';
    position: absolute;
    top: 7px;
    right: 7px;
    width: 6px;
    height: 6px;
    background: var(--hot);
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.5);
    animation: hotPulse 1.6s ease-in-out infinite;
  }



  /* ===== LIVE TICKER ===== */
  .live-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    padding: 12px 18px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 8px;
  }

  .live-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .live-dot {
    width: 7px;
    height: 7px;
    background: var(--live);
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(0, 200, 150, 0.6);
    animation: livePulse 1.4s ease-in-out infinite;
  }

  .live-text {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0;
    color: var(--ink);
  }

  .live-feed {
    font-size: 11px;
    color: var(--muted);
    flex: 1;
    text-align: right;
    margin-left: 24px;
    overflow: hidden;
    white-space: nowrap;
    transition: opacity 0.3s ease;
  }

  /* ===== OVERLAY — popout 뒷배경 blur. header / progress bar 는 별도
     z-index 로 위에 올라가므로 blur 영향 없음. */
  .overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
  }

  .overlay.show {
    opacity: 1;
    pointer-events: auto;
  }

  /* ===== POPOUT ===== */
  .popout {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -45%) scale(0.96);
    width: min(980px, 94vw);
    max-height: 88vh;
    background: white;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.28);
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: all 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .popout.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
  }

  .popout-head {
    padding: 18px 26px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-shrink: 0;
    background: white;
    position: relative;
  }

  /* live indicator inside popout */
  .popout-live {
    position: absolute;
    top: 18px;
    right: 56px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    padding: 5px 12px;
    border-radius: 100px;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0;
    color: var(--ink);
  }

  .popout-live-dot {
    width: 6px;
    height: 6px;
    background: var(--live);
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(0, 200, 150, 0.6);
    animation: livePulse 1.4s ease-in-out infinite;
  }

  .popout-live-time {
    color: var(--muted);
    font-weight: 500;
    letter-spacing: 0;
  }

  .popout-id { flex: 1; }

  .popout-eyebrow {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0;
    color: var(--accent);
    margin-bottom: 8px;
  }

  .popout-name {
    font-family: var(--sans);
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--ink);
    line-height: 1.1;
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .popout-name .flag,
  .popout-name .fi { font-size: 22px; }

  .popout-name-tag {
    font-size: 9px;
    letter-spacing: 0;
    color: var(--muted);
    background: var(--bg-soft);
    padding: 4px 8px;
    border-radius: 4px;
    margin-left: 4px;
  }

  .popout-close {
    background: var(--bg-soft);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    color: var(--muted);
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    align-self: flex-start;
  }

  .popout-close:hover { background: var(--line); }

  .popout-body {
    overflow-y: auto;
    padding: 22px 26px 26px;
  }

  /* breadcrumb */
  .breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 10px;
    letter-spacing: 0;
    color: var(--muted);
  }

  .breadcrumb-item {
    cursor: pointer;
    transition: color 0.2s;
  }

  .breadcrumb-item:hover { color: var(--ink); }

  .breadcrumb-item.active {
    color: var(--accent);
    font-weight: 600;
  }

  .breadcrumb-sep { opacity: 0.4; }

  /* SpaceX card content */
  .sx-summary {
    font-size: 14px;
    color: var(--ink-soft);
    line-height: 1.6;
    margin-bottom: 16px;
    padding: 14px 16px;
    background: var(--bg-soft);
    border-radius: 8px;
    position: relative;
  }

  .sx-summary strong { color: var(--ink); font-weight: 600; }

  .sx-meta {
    display: flex;
    gap: 18px;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px dashed var(--line);
    align-items: center;
    flex-wrap: wrap;
  }

  .sx-meta strong { color: var(--accent); font-weight: 600; }

  .sx-meta-live {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--live);
    font-weight: 600;
  }

  .sx-meta-live-dot {
    width: 5px;
    height: 5px;
    background: var(--live);
    border-radius: 50%;
    animation: livePulse 1.4s ease-in-out infinite;
  }

  .nv-row {
    display: grid;
    grid-template-columns: 200px 1fr auto;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line-soft);
    align-items: center;
    opacity: 0;
    transform: translateY(10px);
    animation: rowIn 0.5s ease forwards;
    position: relative;
  }

  .nv-row:last-child { border-bottom: none; }
  .nv-row:nth-child(1) { animation-delay: 0.15s; }
  .nv-row:nth-child(2) { animation-delay: 0.30s; }
  .nv-row:nth-child(3) { animation-delay: 0.45s; }
  .nv-row:nth-child(4) { animation-delay: 0.60s; }


  /* NEW badge on live signal */
  .nv-row.is-new::before {
    content: 'NEW';
    position: absolute;
    top: 8px;
    left: -8px;
    background: var(--hot);
    color: white;
    font-size: 8px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 3px;
    letter-spacing: 0;
    box-shadow: 0 2px 8px rgba(220,38,38,0.3);
    animation: livePulse 1.4s ease-in-out infinite;
  }

  .nv-row-cat {
    display: flex;
    flex-direction: column;
    gap: 5px;
  }

  .nv-row-tag {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .nv-row-tag .num {
    background: var(--accent);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
  }

  .nv-row-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.3;
  }

  .nv-row-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .nv-row-item {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 13px;
  }

  .nv-row-item-name {
    font-weight: 600;
    color: var(--ink);
  }

  .nv-row-item-sub {
    font-size: 11px;
    color: var(--muted);
  }

  .nv-row-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
  }

  .nv-row-evidence {
    font-size: 11px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
  }

  .nv-row-time {
    font-family: var(--mono);
    font-size: 9px;
    color: var(--muted-soft);
    letter-spacing: 0.05em;
  }

  .nv-row.is-new .nv-row-time {
    color: var(--hot);
    font-weight: 600;
  }

  /* link to next view */
  .next-link {
    margin-top: 22px;
    padding: 16px 18px;
    background: var(--accent-dim);
    border: 1px dashed var(--accent);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.25s;
  }

  .next-link:hover {
    background: var(--accent-soft);
  }

  .next-link.auto-flash {
    animation: linkFlash 1.4s ease;
  }


  .next-link-content { flex: 1; }

  .next-link-eyebrow {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0;
    color: var(--accent);
    margin-bottom: 4px;
  }

  .next-link-text {
    font-size: 13px;
    color: var(--ink-soft);
    line-height: 1.4;
  }

  .next-link-text strong {
    color: var(--ink);
    font-weight: 600;
  }

  .next-link-arrow {
    font-size: 18px;
    color: var(--accent);
    margin-left: 12px;
  }

  /* 옛 SVG 기반 vchain-graph CSS 는 제거 — 새 3-column 레이아웃은
     아래 "MICRON TRADE NETWORK POPUP" 블록 (.vchain-cols 등) 참고 */

  /* ===== RESPONSIVE ===== */
  @media (max-width: 1024px) {
    .section { padding: 0 0 24px; }
    .intro-title { font-size: 34px; }
    .universe-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
    .popout { width: 95vw; max-height: 92vh; }
    .nv-row { grid-template-columns: 1fr; gap: 6px; }
    .nv-row-meta { align-items: flex-start; }
  }

  @media (max-width: 640px) {
    .intro-title { font-size: 26px; }
    .universe-grid { grid-template-columns: repeat(2, 1fr); }
    .lens-row { justify-content: flex-start; }
    .popout-head { padding: 14px 16px; }
    .popout-body { padding: 14px 16px; }
    .popout-live { right: 50px; top: 14px; padding: 4px 8px; font-size: 8px; }
  }

  /* ============================================
     ===== V5: BUILD VALUE CHAIN — NEW STYLES =====
     ============================================ */

  /* hide old lens-bar (kept in CSS but not rendered) */
  .lens-bar { display: none !important; }
  .universe-stats { display: none !important; }

  /* === BUILD CTA BAR ===
     chapter1 의 .demo-status pill 톤으로 통일 — 검정 배경 pill + mono uppercase 텍스트 */
  .build-cta-bar {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    align-self: center;
    margin: 4px auto 18px;
    padding: 6px 8px 6px 18px;
    background: var(--ink);
    border: none;
    border-radius: 100px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
  }
  .build-cta-stats {
    font-size: 11.5px;
    letter-spacing: 0;
    color: rgba(255, 255, 255, 0.6);
  }
  .build-cta-stats strong { color: var(--accent); font-weight: 600; }
  .build-cta-btn {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 28px;
    padding: 0 14px 0 12px;
    background: var(--accent);
    color: var(--ink);
    border: none;
    border-radius: 100px;
    cursor: pointer;
    font-family: var(--sans);
    transition: filter 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
    box-shadow: 0 2px 8px rgba(var(--mint-rgb), 0.35);
  }
  .build-cta-btn:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(var(--mint-rgb), 0.5);
  }
  .build-cta-icon {
    color: var(--ink);
    font-size: 11px;
    animation: pulseIcon 1.6s ease-in-out infinite;
  }
  .build-cta-label {
    display: flex;
    align-items: center;
    text-align: left;
  }
  .build-cta-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.005em;
  }
  .build-cta-sub {
    /* sub 텍스트 숨김 — Build 버튼을 Reset 버튼과 같은 단일-라인 높이로 통일 */
    display: none;
  }
  .build-cta-arrow {
    color: var(--ink);
    font-size: 13px;
    font-weight: 600;
  }
  .build-cta-reset {
    display: none;
    align-items: center;
    height: 28px;
    padding: 0 14px;
    background: transparent;
    color: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 100px;
    cursor: pointer;
    font-size: 11.5px;
    letter-spacing: 0;
    transition: all 0.18s ease;
  }
  .build-cta-reset:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.4);
    color: white;
  }
  .build-cta-bar.is-built .build-cta-btn { display: none; }
  .build-cta-bar.is-built .build-cta-reset { display: inline-flex; margin-left: auto; }

  .build-cta-replay {
    display: inline-flex;
    align-items: center;
    height: 34px;
    padding: 0 14px;
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    cursor: pointer;
    font-size: 10px;
    letter-spacing: 0;
    transition: all 0.18s ease;
  }
  .build-cta-replay:hover {
    border-color: var(--ink);
    color: var(--ink);
  }

  .build-cta-btn.auto-flash {
    animation: flashCta 0.7s ease-in-out 2;
  }

  /* === UNIVERSE container becomes positioned for layer overlay === */
  .universe { position: relative; }

  /* fade out off-chain companies */
  .company.is-fading {
    opacity: 0.12;
    filter: grayscale(0.7);
    transition: opacity 0.6s ease, filter 0.6s ease, transform 0.6s ease;
    transform: scale(0.94);
  }

  /* when layers are shown, hide grid completely (가치사슬로 순차 전환) */
  .universe.show-layers .universe-grid {
    display: none;
  }
  .universe.show-layers .universe-caption {
    display: none;
  }

  /* === VALUE CHAIN LAYERS === */
  .vchain-layers {
    position: relative;
    background: var(--bg);
    /* bottom padding 14 → 24 — layer-card 들의 아래 테두리가 .universe
       overflow-hidden 의 가장자리 / LIVE SIGNALS 바에 너무 붙어 잘려 보이던
       문제 해결. */
    padding: 14px 8px 24px;
    border-radius: 8px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
    display: none;
    flex-direction: column;
    gap: 10px;
  }
  .vchain-layers.show {
    display: flex;
    opacity: 1;
    pointer-events: auto;
  }
  /* header-only state: filters and grid hidden so we can let the title land first */
  .vchain-layers.header-only .vchain-filters,
  .vchain-layers.header-only .vchain-layer-grid-wrap {
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
  }
  .vchain-filters,
  .vchain-layer-grid-wrap {
    transition: opacity 0.5s ease, transform 0.5s ease;
  }
  /* title pulses in subtly */
  .vchain-layers.show .vchain-title {
    animation: titlePop 0.7s ease;
  }
  .vchain-layers.show .vchain-eyebrow,
  .vchain-layers.show .vchain-hint {
    animation: fadeIn 0.6s ease;
  }

  .vchain-layer-header {
    text-align: left;
    padding: 0 8px;
  }
  .vchain-eyebrow {
    font-size: 10px;
    letter-spacing: 0;
    color: var(--accent);
    margin-bottom: 6px;
  }
  .vchain-title {
    font-family: var(--sans);
    font-size: 22px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.03em;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
  }
  .vchain-title-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--accent);
  }
  .vchain-hint {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.5;
  }
  .vchain-hint strong { color: var(--accent); font-weight: 600; }

  .vchain-layer-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr auto 1fr;
    align-items: stretch;
    gap: 4px;
    padding: 4px 8px;
  }
  .layer-card {
    background: white;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease, border-color 0.18s ease, box-shadow 0.18s ease;
    min-height: 140px;
  }
  .layer-card.appeared {
    opacity: 1;
    transform: translateY(0);
  }
  .universe.built .layer-card:hover {
    border-color: var(--ink);
    box-shadow: 0 6px 22px rgba(0,0,0,0.08);
    transform: translateY(-2px);
  }
  .universe.built .layer-card.is-selected {
    border-color: var(--accent);
    background: var(--accent-dim);
    box-shadow: 0 8px 24px rgba(var(--mint-rgb),0.22);
  }
  .layer-card.auto-flash {
    animation: layerFlash 0.7s ease-in-out 2;
  }
  .layer-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted-soft);
    font-size: 14px;
    padding: 0 2px;
  }
  .layer-head {
    border-bottom: 1px solid var(--line-soft);
    padding-bottom: 8px;
  }
  .layer-label {
    font-size: 10.5px;
    letter-spacing: 0;
    color: var(--accent);
    margin-bottom: 4px;
    /* 좁은 카드 폭에서 "L3 · FAB·MEMORY" 가 공백에서 wrap 되는 걸 방지 —
       L1~L5 header 가 같은 줄 수로 정렬되도록. */
    white-space: nowrap;
  }
  .layer-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: -0.01em;
    /* L3 "Foundry & memory" 같은 16-char 이름이 좁은 column 에서 두 줄로
       꺾이지 않도록 — L1~L5 이름이 한 줄로 정렬되어 보임. */
    white-space: nowrap;
  }
  .layer-companies {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
  }
  .layer-chip {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 8px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: white;
    font-size: 12px;
    color: var(--ink-soft);
    opacity: 0;
    transform: scale(0.85);
    animation: chipIn 0.4s ease forwards;
  }
  .layer-card.appeared .layer-chip {
    /* trigger via JS appeared cascade */
  }
  .layer-card.appeared .layer-chip:nth-child(1) { animation-delay: 0.05s; }
  .layer-card.appeared .layer-chip:nth-child(2) { animation-delay: 0.12s; }
  .layer-card.appeared .layer-chip:nth-child(3) { animation-delay: 0.18s; }
  .layer-card.appeared .layer-chip:nth-child(4) { animation-delay: 0.24s; }
  .layer-card.appeared .layer-chip:nth-child(5) { animation-delay: 0.30s; }
  .layer-card.appeared .layer-chip:nth-child(n+6) { animation-delay: 0.36s; }
  .layer-chip.is-primary {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--ink);
    font-weight: 600;
  }
  .layer-chip-flag { font-size: 12.5px; }
  .layer-chip-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .layer-chip.auto-flash {
    /* base .layer-chip 의 chipIn animation 을 새 animation 으로 덮어쓰면
       chipIn 의 forwards 끝 상태 (opacity:1, scale:1) 가 깨져서 chip 이
       base 의 opacity:0 으로 되돌아가 "사라진 것처럼" 보임. 명시적으로
       끝 상태를 잡아둬서 filterFlash 가 box-shadow 만 pulsing 하도록. */
    opacity: 1;
    transform: scale(1);
    animation: filterFlash 0.9s ease-in-out 1;
  }

  .layer-risk-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px dashed var(--line);
  }
  .layer-risk-tag {
    font-size: 10.5px;
    padding: 4px 8px;
    background: rgba(201, 165, 107, 0.14);
    color: #8B6F3F;
    border-radius: 3px;
    letter-spacing: 0;
  }

  .vchain-summary {
    padding: 14px 16px;
    margin: 0 8px;
    background: var(--bg-soft);
    border-left: 3px solid var(--accent);
    border-radius: 0 6px 6px 0;
    font-size: 13px;
    line-height: 1.6;
    color: var(--ink-soft);
  }
  .vchain-summary strong { color: var(--ink); font-weight: 600; }

  /* === COMPARISON PANEL (unstructured signal compare) === */
  /* compare-panel: chapter2-demo 내부로 한정, top/bottom 고정 */
  .compare-panel {
    position: absolute;
    /* top: 96px = lens-card-header 와 겹치지 않도록 breathing room 포함. */
    top: 96px;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%) scale(0.97);
    width: min(620px, 92%);
    background: white;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.18);
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .compare-panel.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) scale(1);
  }
  .compare-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 18px 10px;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
  }
  .compare-panel-eyebrow {
    font-size: 11px;
    letter-spacing: 0;
    color: var(--accent);
    margin-bottom: 4px;
    font-weight: 600;
  }
  .compare-panel-title {
    font-family: var(--sans);
    font-size: 17px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.03em;
    line-height: 1.25;
  }
  .compare-panel-close {
    background: none;
    border: 1px solid var(--line);
    width: 26px; height: 26px;
    border-radius: 6px;
    font-size: 16px;
    color: var(--muted);
    cursor: pointer;
    line-height: 1;
    flex-shrink: 0;
    transition: all 0.18s ease;
  }
  .compare-panel-close:hover {
    border-color: var(--ink);
    color: var(--ink);
  }
  .compare-panel-summary {
    padding: 8px 14px;
    background: var(--bg-soft);
    border-left: 3px solid var(--accent);
    margin: 10px 18px 8px;
    border-radius: 0 6px 6px 0;
    font-size: 13px;
    line-height: 1.55;
    color: var(--ink-soft);
    flex-shrink: 0;
  }
  .compare-panel-summary strong { color: var(--ink); font-weight: 600; }
  .compare-panel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    padding: 4px 18px 16px;
    overflow-y: auto;
    /* 남는 공간 모두 차지 → 콘텐츠 많을 때 내부 스크롤 */
    flex: 1;
    min-height: 0;
  }
  .compare-col {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    background: white;
    display: flex;
    flex-direction: column;
    gap: 7px;
    /* 회사당 1개 signal 만 보여주므로 min-height 100 정도면 충분.
       이전 140 은 2~3개 signal 기준. */
    min-height: 100px;
    /* mobile 에서 안쪽 compare-signal 의 gray 배경이 rounded card 의 모서리
       밖으로 살짝 삐져나오는 시각 버그 방지. card 자체를 clip. */
    overflow: hidden;
    min-width: 0;
    max-width: 100%;
  }
  .compare-col.is-primary {
    background: var(--accent-dim);
    border-color: var(--accent);
  }
  .compare-col-head {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--line-soft);
  }
  .compare-col-flag { font-size: 13.5px; }
  .compare-col-name {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink);
  }
  .compare-col-signals {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .compare-signal {
    display: flex;
    flex-direction: column;
    gap: 3px;
  }
  .compare-signal-time {
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.06em;
    color: var(--muted);
  }
  .compare-signal-text {
    font-size: 12px;
    line-height: 1.45;
    color: var(--ink-soft);
  }
  .compare-signal-text strong { color: var(--ink); font-weight: 600; }

  /* Override existing overlay to support compare-panel close */
  .overlay { z-index: 1900; }

  /* ============================================
     ===== V6: FILTERS / EDGES / SENTIMENT =====
     ============================================ */

  /* === VCHAIN FILTERS — chapter3 의 .pol-builder 와 동일한 톤으로 작은 카드화 */
  .vchain-filters {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 12px;
    padding: 14px 16px;
    background: #FFFFFF;
    border: 1px solid rgba(15, 17, 21, 0.06);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(15, 17, 21, 0.03);
  }
  .vchain-filter-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
  }
  /* chapter1 의 .lens-label / chapter3 의 .pol-builder-label 과 동일 톤으로 통일 */
  .vchain-filter-label {
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0;
    color: var(--muted);
    margin-right: 8px;
    min-width: 60px;
    flex-shrink: 0;
  }
  /* chapter1 의 .lens-chip / chapter3 의 .pol-builder-chip 과 동일한 사이즈로 통일 */
  .vchain-filter-chip {
    padding: 7px 13px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 100px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink);
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: var(--sans);
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }
  .vchain-filter-chip:hover {
    border-color: var(--ink);
    color: var(--ink);
  }
  .vchain-filter-chip.active {
    background: var(--ink);
    border-color: var(--ink);
    color: white;
  }
  .vchain-filter-chip.auto-flash {
    animation: filterFlash 0.7s ease-in-out;
  }

  /* === EDGE OVERLAY === */
  .vchain-layer-grid-wrap {
    position: relative;
  }
  .layer-edges-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.4s ease;
  }
  .layer-edges-svg.show { opacity: 1; }
  .edge-path {
    fill: none;
    stroke-width: 1.5;
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    animation: drawEdge 0.9s ease forwards;
    opacity: 0.45;
    transition: opacity 0.3s ease;
  }
  .edge-path.edge-supply { stroke: var(--accent); }
  .edge-path.edge-rival { stroke: #D87A7A; stroke-dasharray: 4 4; opacity: 0.35; animation: none; }
  .edge-path.edge-invest { stroke: #C9A56B; }
  .edge-path.filter-dim { opacity: 0.08; }

  /* chips above edges */
  .layer-chip { position: relative; z-index: 2; }

  /* === SPOTLIGHT (build animation step) === */
  .layer-card.spotlit {
    transform: translateY(-4px) scale(1.02);
    border-color: var(--accent);
    background: var(--accent-dim);
    box-shadow: 0 12px 32px rgba(var(--mint-rgb),0.25);
    z-index: 4;
    transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease, background 0.4s ease;
  }
  .layer-card.spot-dimmed {
    opacity: 0.35;
    filter: grayscale(0.4);
    transition: opacity 0.4s ease, filter 0.4s ease;
  }

  /* === FILTER DIM on chips (very strong) === */
  .layer-chip.filter-dim {
    opacity: 0.05;
    filter: grayscale(1);
    transform: scale(0.9);
    transition: opacity 0.35s ease, filter 0.35s ease, transform 0.35s ease;
  }
  .layer-chip {
    transition: opacity 0.3s ease, filter 0.3s ease, transform 0.3s ease, background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  }
  /* matched chips when a filter is active = strong highlight */
  .universe.is-filtered .layer-chip:not(.filter-dim) {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    box-shadow: 0 4px 14px rgba(var(--mint-rgb),0.4);
    transform: scale(1.03);
  }
  .universe.is-filtered .layer-chip:not(.filter-dim) .layer-chip-name { color: white; }
  /* if a layer-card has no matched chips, dim the whole card */
  .layer-card.layer-empty {
    opacity: 0.35;
    transition: opacity 0.35s ease;
  }

  /* === SENTIMENT BADGES (subtle dot) === */
  .sig-badge {
    display: inline-block;
    width: 6px; height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
  }
  .sig-pos { background: var(--accent); }
  .sig-neg { background: #D87A7A; }
  .sig-neu { background: var(--muted-soft); }

  /* === COMPARE SIGNAL with sentiment (no left bar) === */
  .compare-signal {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 10px;
    border-radius: 6px;
    background: var(--bg-soft);
    opacity: 0;
    transform: translateY(6px);
    animation: signalIn 0.4s ease forwards;
  }
  .compare-signal-row {
    display: flex;
    align-items: center;
    gap: 7px;
  }
  .compare-signal-time {
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.08em;
    color: var(--muted);
  }
  .sig-label {
    margin-left: auto;
    font-size: 9px;
    letter-spacing: 0;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
  }
  .compare-signal.is-pos .sig-label {
    color: #2E8B6E;
    background: rgba(var(--mint-rgb), 0.14);
  }
  .compare-signal.is-neg .sig-label {
    color: #B85454;
    background: rgba(216, 122, 122, 0.14);
  }
  .compare-signal.is-neu .sig-label {
    color: var(--muted);
    background: rgba(107, 110, 118, 0.10);
  }
  .compare-empty {
    grid-column: 1 / -1;
    padding: 30px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
  }

  /* compare-col stagger */
  .compare-col {
    opacity: 0;
    transform: translateY(8px);
    animation: colIn 0.35s ease forwards;
  }

  /* === overall L5 column tighter so it doesn't look long === */
  .layer-card[data-layer="L5"] .layer-companies { gap: 4px; }

  /* ============================================================
     ===== MICRON TRADE NETWORK POPUP (SVG graph) =====
     SVG 곡선으로 trade flow 를 시각화한 옛 그래프 — chapter 1 의
     SpaceX 팝업 다음에 띄우던 구조를 chapter 2 의 L3 Micron drill-down
     으로 재배치. */

  /* chapter2 의 기본 .popout 은 position:fixed 의 뷰포트-modal 인데,
     compare-panel 과 동일하게 lens-card 안 absolute 로 한정해서 통일감. */
  .vchain-popout {
    position: absolute;
    top: 96px;
    /* bottom: 10px → trade network graph + legend 가 scroll 없이 다 보이는
       높이로 조정. */
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%) scale(0.97);
    width: min(740px, 94%);
    max-height: none;
    z-index: 2000;
    /* base .popout 의 0.45s 동안 popout 이 fade-in 하면서 그 뒤 micron chip
       을 반투명하게 가려 "사라진 듯한" 어색함이 생기던 걸 0.2s 로 단축. */
    transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .vchain-popout.show {
    transform: translateX(-50%) scale(1);
  }

  .vchain-body {
    /* 위·아래 padding 축소 (20/26 → 14/16) — popout 안에 intro + 460px graph
       + legend 까지 한 화면에 fit 되도록. */
    padding: 14px 26px 16px;
    overflow-y: auto;
    flex: 1 1 auto;
  }
  .vchain-intro {
    /* 14 → 8 — intro 와 graph 사이 공간 단축. */
    margin-bottom: 8px;
    padding: 10px 16px;
    background: var(--bg-soft);
    border-radius: 8px;
    font-size: 13px;
    color: var(--ink-soft);
    line-height: 1.5;
  }
  .vchain-intro strong { color: var(--ink); font-weight: 600; }

  .vchain-graph {
    position: relative;
    width: 100%;
    height: 460px;
  }
  .vchain-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
  }

  .edge-line {
    fill: none;
    stroke-width: 1.6;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawLine 1.4s ease forwards;
    opacity: 0.75;
  }
  .edge-line.thick { stroke-width: 2.4; opacity: 0.95; }
  .edge-buy { stroke: var(--c-buy); animation-delay: 0.4s; }
  .edge-sell { stroke: var(--c-sell); animation-delay: 0.8s; }
  /* 점선 → 실선: legend 의 솔리드 바와 일치하도록 통일. 빨간색만으로도
     충분히 다른 edge 와 구분되어서 dasharray 없이도 가독성 OK.
     base .edge-line 의 stroke-dasharray:1000 + offset:1000 (drawLine 애니메이션
     초기 상태) 을 명시적으로 풀어주지 않으면 rival 선이 완전히 안 보임. */
  .edge-rival {
    stroke: var(--c-rival);
    stroke-dasharray: none;
    stroke-dashoffset: 0;
    animation: none;
    opacity: 0.6;
  }

  .vchain-node {
    position: absolute;
    transform: translate(-50%, -50%);
    background: white;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 12px;
    min-width: 110px;
    text-align: center;
    opacity: 0;
    animation: nodeIn 0.5s ease forwards;
    z-index: 2;
  }
  .vchain-node.hub {
    background: var(--ink);
    border-color: var(--ink);
    padding: 12px 18px;
    min-width: 150px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.22);
    z-index: 3;
  }
  .vchain-node.hub .vchain-n-name { color: white; font-size: 16px; }
  .vchain-node.hub .vchain-n-sub { color: rgba(255,255,255,0.7); }
  .vchain-n-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--ink);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
  }
  .vchain-n-sub {
    font-size: 9px;
    color: var(--muted);
    letter-spacing: 0;
    margin-top: 3px;
  }
  .vchain-node.up-1 { animation-delay: 0.15s; }
  .vchain-node.up-2 { animation-delay: 0.25s; }
  .vchain-node.up-3 { animation-delay: 0.35s; }
  .vchain-node.hub { animation-delay: 0s; }
  .vchain-node.down-1 { animation-delay: 0.95s; }
  .vchain-node.down-2 { animation-delay: 1.05s; }
  .vchain-node.down-3 { animation-delay: 1.15s; }
  .vchain-node.down-4 { animation-delay: 1.25s; }
  .vchain-node.rival-1 { animation-delay: 1.5s; }
  .vchain-node.rival-2 { animation-delay: 1.6s; }

  /* highlight the musk-group node since this is where SpaceX connects */
  .vchain-node.down-4 {
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: 0 4px 16px rgba(var(--mint-rgb),0.2);
  }
  .vchain-node.down-4 .vchain-n-name { color: var(--ink); }

  /* edge labels — 좌측 색깔 bar 는 제외 (화살표 자체가 buy/sell 색을
     이미 가지므로 라벨에 또 색바를 두면 시각 노이즈). */
  .edge-label {
    position: absolute;
    transform: translate(-50%, -50%);
    background: white;
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 5px 8px;
    font-size: 10px;
    color: var(--ink-soft);
    line-height: 1.3;
    pointer-events: none;
    z-index: 1;
    max-width: 130px;
    opacity: 0;
    animation: nodeIn 0.4s ease forwards;
    animation-delay: 1.7s;
    text-align: center;
  }
  .edge-label-amount {
    display: block;
    font-size: 9px;
    color: var(--muted);
    margin-top: 2px;
  }
  .edge-label.musk { background: var(--accent-soft); border-color: var(--accent); }

  /* legend */
  .vchain-legend {
    display: flex;
    justify-content: center;
    gap: 18px;
    /* margin/padding 12 → 6 — legend 가 popout 바닥에 잘리지 않도록 위쪽 공간 단축. */
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--line-soft);
    font-size: 10px;
    color: var(--muted);
    letter-spacing: 0;
  }
  .legend-item { display: flex; align-items: center; gap: 6px; }
  .legend-dot { width: 16px; height: 2px; border-radius: 1px; }

  /* layer-chip 중 Micron 만 클릭 가능하도록 시각적 affordance */
  .layer-chip[data-id="micron"] {
    cursor: pointer;
    position: relative;
  }
  .layer-chip[data-id="micron"]::after {
    content: '↗';
    font-size: 10px;
    color: var(--accent);
    margin-left: 4px;
    opacity: 0.7;
  }
  .layer-chip[data-id="micron"]:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
  }

  /* mobile tweaks */
  @media (max-width: 1024px) {
    /* 가로 스크롤 가치사슬: 5단 pipeline 의 시각 은유 (L1→L2→L3→L4→L5) 를
       모바일에서도 유지하기 위해, grid 를 desktop-스러운 폭으로 고정시키고
       wrap 을 horizontal-scroll 컨테이너로 만든다. 사용자는 옆으로 스와이프해서
       전 레이어를 훑어볼 수 있음. */
    .vchain-layer-grid-wrap {
      overflow-x: auto;
      overflow-y: visible;
      -webkit-overflow-scrolling: touch;
      padding-bottom: 10px;
      /* 첫 화면에 L1 만 보이지 않도록 살짝 padding 줘서 다음 layer 일부 노출 */
      padding-left: 2px;
      padding-right: 2px;
    }
    .vchain-layer-grid {
      /* grid 폭을 데스크탑 수준으로 고정 — wrap 보다 넓으면 자동 가로 스크롤 */
      min-width: 880px;
    }
    .layer-card { min-height: auto; }
    .build-cta-bar {
      /* desktop 의 ink-color pill 은 inline 환경에 어울리지만, mobile 에서
         column 으로 stretch 되면 큼지막한 검정 박스가 흉함. 배경/그림자 제거하고
         stats + button 만 평범하게 표시. */
      flex-direction: column;
      align-items: stretch;
      gap: 8px;
      background: transparent;
      box-shadow: none;
      padding: 0;
      margin: 4px 8px 14px;
    }
    /* dark pill 안에서는 white-faded 였지만 light bg 위로 옮기면 안 보임 → 다크화. */
    .build-cta-stats { color: var(--muted); text-align: center; }
    .build-cta-btn {
      margin-left: 0;
      justify-content: center;
      height: 40px;
    }
    .layer-edges-svg { display: none; }
    /* vchain-graph height 는 아래 별도 블록에서 압축 노드 layout 에 맞게 360px 로 재정의 */
    /* universe 의 overflow: hidden 은 그대로 두되 (build animation 보호),
       min-height 는 모바일에서 너무 큰 빈 공간 만들지 않게 살짝 줄임. */
    .universe { min-height: 560px; }
  }

  /* Micron trade network popout — mobile 에선 10 개 노드가 너무 빽빽하므로
     1 upstream (Techwing 중앙) + 2 rivals + 2 downstream (AMD · Musk) 만 노출.
     모든 edge-label 도 숨겨서 edge 색깔만 메시지를 전달하도록 단순화.
     popup 은 viewport-fixed 로 띄워서 chapter2-demo 의 거대한 height 에 끌려
     늘어나는 문제 해결 (header z-index 3000 이라 popup 이 nav 위로 못 올라옴). */
  @media (max-width: 1024px) {
    .vchain-node.up-1,
    .vchain-node.up-3,
    .vchain-node.down-1,
    .vchain-node.down-3 { display: none; }
    .vchain-svg [data-edge="up-1"],
    .vchain-svg [data-edge="up-3"],
    .vchain-svg [data-edge="down-1"],
    .vchain-svg [data-edge="down-3"] { display: none; }
    /* mobile 에선 edge-label (Test equipment supply / HBM4 supply 등) 전부 숨김 —
       그래프 가독성을 높이고 edge 색만 두드러지게. */
    .edge-label { display: none; }
    /* 라벨이 사라지므로 edge stroke 자체를 두껍게 + 풀-opacity 로 키워서
       upstream(gold) / downstream(mint) / rival(red) 관계가 한눈에. */
    .edge-line { stroke-width: 3; opacity: 1; }
    .edge-line.thick { stroke-width: 4; opacity: 1; }
    .edge-rival { stroke-width: 2.4; opacity: 0.95; }
    /* SK hynix / Samsung 가 hub Micron 과 같은 vertical 라인에 있어 좁은 폭에서
       시각적으로 겹침. 살짝 대각선 (SK hynix ↗ 왼쪽 위, Samsung ↘ 오른쪽 아래)
       으로 배치하고 rival path 의 d 도 그에 맞게 재계산. */
    .vchain-node.rival-1 { top: 60% !important; }
    .vchain-node.rival-2 { top: 40% !important; }
    .vchain-svg [data-edge="rival-1"] {
      d: path("M 595 240 C 680 250, 750 256, 810 266");
    }
    .vchain-svg [data-edge="rival-2"] {
      d: path("M 405 220 C 320 210, 250 200, 190 194");
    }
    /* L1~L5 layer 카드 안 회사 chip 이 너무 많음 (L3 는 8개). 모바일에서는 첫 4개
       만 노출해서 카드 세로 길이 단축. */
    .layer-companies > .layer-chip:nth-child(n+5) { display: none; }
    /* popup 을 viewport-fixed 로 — chapter2-demo 의 lens-card 높이에 끌려
       세로로 늘어나던 문제 해결. content 크기로만 자동 sized. */
    .vchain-popout {
      position: fixed;
      top: 50%;
      left: 50%;
      right: auto;
      bottom: auto;
      transform: translate(-50%, -50%) scale(0.97);
      width: min(560px, calc(100vw - 24px));
      max-height: calc(100vh - 100px);
    }
    .vchain-popout.show {
      transform: translate(-50%, -50%) scale(1);
    }
    .vchain-graph { height: 360px; }
    .vchain-body { padding: 14px 18px 16px; }
  }

  /* Phone: 카드 비교 표 / Micron 팝업이 vchain-popout 안에서 잘릴 위험이 있어
     기본 vh-기반 단위 살짝 조정. */
  @media (max-width: 640px) {
    /* chapter2 의 universe-grid 는 42 회사 — chapter 1 과 같은 이유로 12 장
       (2×6) cap. value chain build 후의 layer-chip 들은 별도 (영향 없음). */
    .universe-grid .company:nth-child(n+13) { display: none; }
    /* chapter1 과 동일 — mobile 에서 .company.spotlight 의 scale(1.08) 가
       2-col grid cell 밖으로 튀어나오므로 제거. 어두운 배경 + 그림자 만으로 강조. */
    .company.spotlight { transform: none; }
    .vchain-popout { width: 96%; }
    .vchain-body { padding: 12px 14px 14px; }
    /* phone 에선 더 압축 — 노드 6개라 더 작은 캔버스로 충분 */
    .vchain-graph { height: 320px; }
    .vchain-node { min-width: 90px; padding: 6px 8px; }
    .vchain-n-name { font-size: 12px; }
    .vchain-n-sub { font-size: 8px; }
  }
}

/* ==========================================================================
   @keyframes — CSS Nesting 안에 두면 일부 브라우저가 무시하므로 외부로 분리
   ========================================================================== */
@keyframes chipPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); box-shadow: 0 4px 16px rgba(15,17,21,0.25); }
  100% { transform: scale(1); }
}


@keyframes hotPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.5); }
  50% { box-shadow: 0 0 0 5px rgba(220, 38, 38, 0); }
}


@keyframes livePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 200, 150, 0.6); }
  50% { box-shadow: 0 0 0 4px rgba(0, 200, 150, 0); }
}


@keyframes rowIn {
  to { opacity: 1; transform: translateY(0); }
}


@keyframes linkFlash {
  0%, 100% { background: var(--accent-dim); }
  50% { background: var(--accent-soft); box-shadow: 0 4px 16px rgba(var(--mint-rgb),0.25); }
}


@keyframes drawLine {
  to { stroke-dashoffset: 0; }
}


@keyframes nodeIn {
  to { opacity: 1; }
}


@keyframes pulseIcon {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}


@keyframes flashCta {
  0%, 100% { box-shadow: 0 4px 14px rgba(0,0,0,0.12); }
  50% { box-shadow: 0 0 0 6px var(--accent-soft), 0 4px 14px rgba(0,0,0,0.12); }
}


@keyframes titlePop {
  0% { opacity: 0; transform: translateY(-6px); }
  100% { opacity: 1; transform: translateY(0); }
}


@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}


@keyframes layerFlash {
  0%, 100% { box-shadow: 0 0 0 0 rgba(var(--mint-rgb),0); }
  50% { box-shadow: 0 0 0 4px var(--accent-soft); border-color: var(--accent); }
}


@keyframes chipIn {
  to { opacity: 1; transform: scale(1); }
}


@keyframes filterFlash {
  0%, 100% { box-shadow: 0 0 0 0 rgba(var(--mint-rgb),0); }
  50% { box-shadow: 0 0 0 5px var(--accent-soft); }
}


@keyframes drawEdge {
  to { stroke-dashoffset: 0; }
}


@keyframes signalIn {
  to { opacity: 1; transform: translateY(0); }
}


@keyframes colIn {
  to { opacity: 1; transform: translateY(0); }
}


