.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; }
    /* Keep atlas STICKY at top with a reduced height so the scrub-on-scroll narration still works */
    .atlas-story .atlas-col { position: sticky; top: 70px; height: 50vh; min-height: 320px; z-index: 2; }
    .atlas-story .story-col { padding: 30px 24px 100px; }
    .atlas-story section.hero-sec { min-height: calc(100vh - 70px); }
    .atlas-story section { min-height: auto; padding: 50px 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; border-radius: 14px 14px 0 0; padding: 20px 22px 24px; }
  }

  /* ---------- Phone (≤ 700px) ---------- */
  @media (max-width: 700px) {
    .atlas-story .atlas-col { height: 42vh; min-height: 280px; }
    .atlas-story .story-col { padding: 20px 18px 80px; }
    .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; }
    /* On very small screens, hide the legend label text — keep only colour dots */
  }

.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; }
}
