.atlas-story {
    background: #0a0d12;
    color: #f2efe9;
  }
  .atlas-story * { box-sizing: border-box; }
  .atlas-story h2.head { font-family: "Source Serif 4", "Source Serif Pro", Georgia, serif; font-weight: 350; letter-spacing: -.022em; color: #f2efe9; font-size: clamp(2rem, 3.6vw, 3rem); line-height: 1.06; margin-bottom: 22px; max-width: 560px; }
  .atlas-story h2.head em { font-style: italic; color: #94b4cc; }
  .atlas-story .mono, .atlas-story .eyebrow, .atlas-story .anchor { font-family: "JetBrains Mono", ui-monospace, monospace; }

  .atlas-story .layout { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
  .atlas-story .atlas-col { position: sticky; top: 88px; height: calc(100vh - 88px); }
  .atlas-story .story-col { padding: 80px 60px 120px 60px; }
  .atlas-story .stage { position: absolute; inset: 0; }
  .atlas-story #atlas { width: 100%; height: 100%; display: block; }

  .atlas-story .atlas-overlay-top { position: absolute; top: 24px; left: 24px; right: 24px; z-index: 5; pointer-events: none; display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
  .atlas-story .focus-pill { padding: 6px 14px; backdrop-filter: blur(10px); background: rgba(74,147,184,.12); border: 1px solid rgba(148,180,204,.32); border-radius: 999px; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: #94b4cc; pointer-events: auto; }
  .atlas-story .focus-pill .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #4a93b8; margin-right: 8px; vertical-align: middle; animation: as-pulse 1.8s ease-in-out infinite; }
  @keyframes as-pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
  .atlas-story .stat-mini { padding: 6px 12px; backdrop-filter: blur(10px); background: rgba(10,13,18,.5); border: 1px solid rgba(255,255,255,.08); border-radius: 6px; font-size: .7rem; color: rgba(242,239,233,.7); letter-spacing: .08em; }
  .atlas-story .stat-mini b { color: #94b4cc; font-weight: 500; }
  .atlas-story .atlas-legend { position: absolute; bottom: 18px; left: 24px; right: 24px; display: flex; gap: 14px; z-index: 5; flex-wrap: wrap; padding: 8px 14px; backdrop-filter: blur(10px); background: rgba(10,13,18,.55); border: 1px solid rgba(255,255,255,.08); border-radius: 999px; font-size: .68rem; color: rgba(242,239,233,.7); letter-spacing: .06em; pointer-events: auto; justify-content: center; }
  .atlas-story .atlas-legend .key { display: flex; align-items: center; gap: 6px; }
  .atlas-story .atlas-legend .dot { width: 7px; height: 7px; border-radius: 50%; }

  .atlas-story section { min-height: 110vh; display: flex; flex-direction: column; justify-content: center; padding: 60px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
  .atlas-story section:last-child { border-bottom: 0; }
  .atlas-story .eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: #94b4cc; margin-bottom: 22px; }
  .atlas-story .eyebrow .num { padding: 3px 9px; border: 1px solid rgba(148,180,204,.4); border-radius: 4px; font-weight: 500; }
  .atlas-story .lede { font-size: 1.08rem; color: rgba(242,239,233,.7); max-width: 540px; margin-bottom: 22px; line-height: 1.55; }
  .atlas-story .body-para { font-size: 1rem; color: rgba(242,239,233,.7); max-width: 540px; margin-bottom: 24px; line-height: 1.6; }
  .atlas-story .body-para strong { color: #f2efe9; font-weight: 500; }
  .atlas-story .not-llm { font-size: .92rem; color: rgba(242,239,233,.6); max-width: 540px; margin-bottom: 30px; line-height: 1.6; padding: 14px 18px; border-left: 2px solid #4a93b8; background: rgba(74,147,184,.06); border-radius: 0 6px 6px 0; }
  .atlas-story .not-llm-tag { color: #94b4cc; font-family: "JetBrains Mono", monospace; font-size: .72rem; letter-spacing: .15em; text-transform: uppercase; margin-right: 8px; }

  .atlas-story .formula { padding: 26px 28px; background: rgba(20,25,42,.55); border: 1px solid rgba(255,255,255,.08); border-left: 2px solid #4a93b8; border-radius: 8px; color: #f2efe9; margin-bottom: 22px; max-width: 580px; overflow-x: auto; }
  .atlas-story .formula .anchor { margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.08); font-size: .72rem; color: rgba(242,239,233,.7); letter-spacing: .04em; line-height: 1.5; }
  .atlas-story .formula .katex { color: #f2efe9; font-size: 1.05em; }
  .atlas-story .formula .katex-display { margin: .35em 0; }

  .atlas-story section.hero-sec { min-height: calc(100vh - 88px); }
  .atlas-story section.hero-sec h2.head { font-size: clamp(2.4rem, 4vw, 3.6rem); max-width: 600px; }

  .atlas-story .cta-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
  .atlas-story .cta-primary { padding: 14px 26px; border-radius: 999px; background: #f2efe9; color: #0a0d12; text-decoration: none; font-weight: 500; font-size: .95rem; }
  .atlas-story .cta-primary:hover { background: #94b4cc; }
  .atlas-story .cta-ghost { padding: 14px 22px; border-radius: 999px; border: 1px solid rgba(255,255,255,.15); color: #f2efe9; text-decoration: none; font-weight: 500; font-size: .95rem; }
  .atlas-story .cta-ghost:hover { border-color: #94b4cc; color: #94b4cc; }

  .atlas-story .atlas-tip { position: absolute; pointer-events: none; padding: 5px 9px; background: rgba(10,13,18,.92); border: 1px solid rgba(148,180,204,.3); border-radius: 5px; font-family: "JetBrains Mono", monospace; font-size: .74rem; color: #f2efe9; opacity: 0; transition: opacity .15s; z-index: 20; white-space: nowrap; }

  /* ---------- Tablet / smaller laptop (≤ 1100px) ---------- */
  @media (max-width: 1100px) {
    .atlas-story .layout { grid-template-columns: 1fr; }
    /* Atlas: sticky at top but allows vertical swipe to scroll through.
       Use dvh (dynamic viewport) so iOS address bar resize doesn't jitter. */
    .atlas-story .atlas-col {
      position: sticky; top: 70px;
      height: 45vh; height: 45dvh; min-height: 280px; z-index: 2;
      touch-action: pan-y;  /* lets vertical drags pass through to page scroll */
      background: #0a0d12;   /* solid bg so story text scrolling behind it is occluded */
      box-shadow: 0 12px 24px -8px rgba(0,0,0,.6);
    }
    .atlas-story #atlas, .atlas-story .stage { touch-action: pan-y; }
    .atlas-story .story-col { padding: 30px 24px 100px; }
    .atlas-story section.hero-sec { min-height: auto; padding-top: 30px; padding-bottom: 60px; }
    .atlas-story section { min-height: auto; padding: 60px 0; }
    .atlas-story h2.head { font-size: clamp(1.6rem, 5.2vw, 2.4rem); }
    .atlas-story section.hero-sec h2.head { font-size: clamp(1.9rem, 6.4vw, 2.8rem); }
    .atlas-story .formula { padding: 16px 18px; font-size: .85rem; }
    .atlas-story .formula .katex { font-size: .92em; }
    .atlas-story .lede, .atlas-story .body-para, .atlas-story .not-llm { font-size: .95rem; max-width: 100%; }
    .atlas-story .atlas-overlay-top { top: 14px; left: 14px; right: 14px; gap: 8px; }
    .atlas-story .focus-pill, .atlas-story .stat-mini { font-size: .62rem; padding: 5px 10px; }
    .atlas-story .atlas-legend { bottom: 10px; left: 10px; right: 10px; padding: 6px 10px; gap: 8px; font-size: .58rem; }
    .atlas-story .atlas-legend .dot { width: 6px; height: 6px; }
    .atlas-story .atlas-panel { position: fixed; top: auto; bottom: 0; left: 0; right: 0; width: 100%; max-height: 60vh; max-height: 60dvh; border-radius: 14px 14px 0 0; padding: 20px 22px 24px; }
    /* SVG circles: keep tap-to-open behaviour but don't capture vertical swipes */
    .atlas-story #atlas circle { touch-action: pan-y; }
  }

  /* ---------- Phone (≤ 700px) ---------- */
  @media (max-width: 700px) {
    .atlas-story .atlas-col { height: 38vh; height: 38dvh; min-height: 240px; }
    .atlas-story .story-col { padding: 20px 18px 80px; }
    .atlas-story section { padding: 40px 0; }
    .atlas-story h2.head { font-size: clamp(1.4rem, 6vw, 2rem); }
    .atlas-story section.hero-sec h2.head { font-size: clamp(1.7rem, 7vw, 2.4rem); }
    .atlas-story .eyebrow { font-size: .62rem; margin-bottom: 14px; }
    .atlas-story .lede, .atlas-story .body-para { font-size: .9rem; line-height: 1.55; }
    .atlas-story .not-llm { padding: 10px 14px; font-size: .82rem; }
    .atlas-story .formula { padding: 12px 14px; font-size: .76rem; }
    .atlas-story .formula .katex { font-size: .82em; }
    .atlas-story .formula .anchor { font-size: .65rem; }
    .atlas-story .cta-row { gap: 10px; }
    .atlas-story .cta-primary, .atlas-story .cta-ghost { padding: 12px 20px; font-size: .9rem; }
    .atlas-story .atlas-legend { font-size: .55rem; padding: 5px 8px; }
    .atlas-story .atlas-legend .key:nth-child(n+5) { display: none; }
  }

.atlas-story .atlas-legend .dot[data-clr="hm"] { background:#8a82b8; }
.atlas-story .atlas-legend .dot[data-clr="tu"] { background:#7058a0; }
.atlas-story .atlas-legend .dot[data-clr="cv"] { background:#3a7ba8; }
.atlas-story .atlas-legend .dot[data-clr="mb"] { background:#4a93a4; }
.atlas-story .atlas-legend .dot[data-clr="im"] { background:#7896b4; }
.atlas-story .atlas-legend .dot[data-clr="cn"] { background:#a0b4c8; }
.atlas-story .atlas-legend .dot[data-clr="or"] { background:#5d6878; }

/* legend dots */
.atlas-story .atlas-legend .dot.clr-hm { background:#8a82b8; }
.atlas-story .atlas-legend .dot.clr-tu { background:#7058a0; }
.atlas-story .atlas-legend .dot.clr-cv { background:#3a7ba8; }
.atlas-story .atlas-legend .dot.clr-mb { background:#4a93a4; }
.atlas-story .atlas-legend .dot.clr-im { background:#7896b4; }
.atlas-story .atlas-legend .dot.clr-cn { background:#a0b4c8; }
.atlas-story .atlas-legend .dot.clr-or { background:#5d6878; }

/* Side panel — opens on node click */
.atlas-story .atlas-panel {
  position: absolute; top: 80px; right: 24px; width: 360px;
  max-height: calc(100vh - 180px); overflow-y: auto;
  backdrop-filter: blur(24px); background: rgba(10,13,18,.88);
  border: 1px solid rgba(148,180,204,.25); border-radius: 14px;
  padding: 24px 26px; z-index: 12;
  opacity: 0; transform: translateX(16px); pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
  font-family: "Inter", system-ui, sans-serif;
  color: #f2efe9;
}
.atlas-story .atlas-panel.open { opacity: 1; transform: translateX(0); pointer-events: auto; }
.atlas-story .atlas-panel-close {
  position: absolute; top: 10px; right: 12px;
  background: none; border: 0; color: rgba(242,239,233,.65);
  cursor: pointer; font-size: 1.5rem; line-height: 1; padding: 4px 8px;
}
.atlas-story .atlas-panel-close:hover { color: #f2efe9; }
.atlas-story .atlas-panel-tag {
  font-family: "JetBrains Mono", monospace; font-size: .68rem;
  color: #94b4cc; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 8px;
}
.atlas-story .atlas-panel-name {
  font-family: "Source Serif 4", Georgia, serif; font-weight: 400;
  font-size: 1.4rem; line-height: 1.2; margin: 0 0 14px; color: #f2efe9;
}
.atlas-story .atlas-panel-desc { font-size: .92rem; line-height: 1.55; color: rgba(242,239,233,.78); margin-bottom: 18px; }
.atlas-story .atlas-panel-metric { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,.06); font-size: .85rem; }
.atlas-story .atlas-panel-metric .k { color: rgba(242,239,233,.65); }
.atlas-story .atlas-panel-metric .v { color: #f2efe9; font-family: "JetBrains Mono", monospace; }
.atlas-story .atlas-panel-metric .atlas-panel-curated { color: #94b4cc; }
.atlas-story .atlas-panel-papers { margin-top: 18px; font-size: .8rem; line-height: 1.5; color: rgba(242,239,233,.7); }
.atlas-story .atlas-panel-papers .pap { padding: 8px 0; border-top: 1px solid rgba(255,255,255,.06); }
.atlas-story .atlas-panel-papers .pap em { color: #94b4cc; font-style: normal; font-family: "JetBrains Mono", monospace; font-size: .72rem; letter-spacing: .04em; margin-right: 6px; }

@media (max-width: 1100px) {
  .atlas-story .atlas-panel { width: 92vw; right: 4vw; top: 16px; max-height: 70vh; }
}

/* ---- Atlas hint, reports grid, vocab chips ---- */
.atlas-story .atlas-hint {
  font-family: "JetBrains Mono", monospace;
  font-size: .78rem;
  color: rgba(148,180,204,.85);
  letter-spacing: .04em;
  margin: -10px 0 22px;
  max-width: 540px;
}

.atlas-story .reports-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 30px;
  max-width: 660px;
}
.atlas-story .report-card {
  padding: 18px 18px 20px;
  background: rgba(20,25,42,.45);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 8px;
  transition: border-color .2s ease, transform .2s ease;
}
.atlas-story .report-card:hover { border-color: rgba(148,180,204,.35); transform: translateY(-2px); }
.atlas-story .report-card .report-num {
  font-family: "JetBrains Mono", monospace;
  font-size: .68rem;
  color: #94b4cc;
  letter-spacing: .14em;
  margin-bottom: 8px;
}
.atlas-story .report-card h4 {
  font-family: "Source Serif 4", Georgia, serif;
  font-weight: 400;
  font-size: 1.05rem;
  color: #f2efe9;
  margin: 0 0 8px;
  letter-spacing: -.012em;
}
.atlas-story .report-card p {
  font-size: .82rem;
  color: rgba(242,239,233,.7);
  line-height: 1.5;
  margin: 0;
}

.atlas-story .vocab-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
  max-width: 640px;
}
.atlas-story .vocab-chip {
  padding: 8px 16px;
  border: 1px solid rgba(148,180,204,.4);
  background: rgba(74,147,184,.08);
  border-radius: 999px;
  font-family: "JetBrains Mono", monospace;
  font-size: .76rem;
  color: #94b4cc;
  letter-spacing: .04em;
}

@media (max-width: 700px) {
  .atlas-story .reports-grid { grid-template-columns: 1fr; gap: 10px; }
  .atlas-story .atlas-hint { font-size: .68rem; }
  .atlas-story .vocab-chip { font-size: .68rem; padding: 6px 12px; }
}
