


.hero { position: relative; }
.hero-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; background: #fff; }
.hero-plot { position: absolute; inset: 0; }
.hero-plot canvas { display: block; width: 100%; height: 100%; }
.hero-still { position: absolute; inset: auto 0 0 0; width: 100%; height: auto; opacity: 0.9; }
.hero--live .hero-still { display: none; }
.hero-anchors { position: absolute; inset: 0; pointer-events: none; }

.hero-stage::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(255,255,255,0.98) 0%, rgba(255,255,255,0.96) 42%, rgba(255,255,255,0) 64%);
  opacity: clamp(0, calc(1 - var(--hp, 0) * 3.2), 1);
}
@media (max-width: 959px) { .hero-stage::after { background: linear-gradient(0deg, rgba(255,255,255,0.97) 0%, rgba(255,255,255,0.9) 42%, rgba(255,255,255,0) 70%); } }
.hero-anchor {
  position: absolute; left: 0; top: 0; opacity: 0; white-space: nowrap;
  padding: 7px 10px; border: 1px solid var(--border, #e8e7ec); border-radius: 999px; background: #fff;
  font: 500 11px/1 var(--font-mono, "Geist Mono", monospace); letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--foreground, #17141d); box-shadow: 0 6px 18px rgba(21, 13, 43, 0.08);
}
.hero-anchor.is-accent { color: var(--accent, #6d3fd6); }
.hero-flow { position: relative; margin-top: -100vh; margin-top: -100svh; pointer-events: none; }
.hero-flow a, .hero-flow details, .hero-flow summary { pointer-events: auto; }
.hero-title { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; justify-content: center; max-width: 600px; padding-top: var(--nav-h, 64px); }
.hero-title .post-header-intro { display: block; }
.hero-title .post-header-subtitle { margin-bottom: 14px; }
.hero-step { min-height: 92vh; min-height: 92svh; display: flex; align-items: center; }
.hero-step p {
  max-width: 470px; margin: 0; padding: 22px 24px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.93); box-shadow: 0 10px 30px rgba(21, 13, 43, 0.08);
  font-family: var(--font-serif, Newsreader, serif); font-size: 21px; line-height: 1.55; color: var(--publication-ink, #150d2b);
}
.hero-step:last-child { min-height: 110vh; }
@media (max-width: 959px) {
  .hero-title { justify-content: flex-end; padding-bottom: 10svh; }
  .hero-title > * { position: relative; }
  .hero-title { background: linear-gradient(to top, rgba(255,255,255,0.96) 45%, rgba(255,255,255,0)); }
  .hero-step { align-items: flex-end; padding-bottom: 8svh; }
  .hero-step p { font-size: 18px; }
}

.hero--static .hero-stage, html:not(.js) .hero-stage { position: relative; height: auto; }
.hero--static .hero-still, html:not(.js) .hero-still { position: static; display: block; }
.hero--static .hero-flow, html:not(.js) .hero-flow { margin-top: 0; pointer-events: auto; }

.hero--static, html:not(.js) .hero { display: flex; flex-direction: column; }
.hero--static .hero-stage, html:not(.js) .hero-stage { order: 2; }
.hero--static .hero-still, html:not(.js) .hero-still { max-height: 45vh; width: 100%; object-fit: cover; }
.hero--static .hero-title, .hero--static .hero-step, html:not(.js) .hero-title, html:not(.js) .hero-step { min-height: 0; padding: 24px 0; }


.story { padding-bottom: 48px; }
.story-narrow { max-width: 720px; margin-left: auto; margin-right: auto; }
.story-toc { max-width: 720px; margin: 24px auto 0; }
.story .post-section.story-narrow { margin-top: 96px; }


.chapter { margin-top: 112px; scroll-margin-top: 96px; }
.chapter-head { max-width: 720px; margin: 0 auto; padding-top: 40px; border-top: 1px solid var(--border, #e8e7ec); }
.chapter-head h2 {
  max-width: 24ch; margin: 0; font-size: clamp(28px, 3.2vw, 42px); font-weight: 650; line-height: 1.08;
  letter-spacing: -0.035em; color: var(--publication-ink, #150d2b); text-wrap: balance;
}
.chapter-body { margin-top: 24px; }
.chapter-step > * + * { margin-top: 16px; }
.chapter-visual .fig, .chapter-visual figure { margin: 0; }

.chapters-live .chapter-body { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; align-items: start; }
.chapters-live .chapter-steps { grid-column: 1; grid-row: 1; padding: 10vh 0 30vh; }
.chapters-live .chapter-stage {
  grid-column: 2; grid-row: 1; position: sticky; top: calc(var(--nav-h, 64px) + 20px);
  height: calc(100vh - var(--nav-h, 64px) - 40px); display: grid; align-items: center;
}
.chapters-live .chapter-visual { grid-area: 1 / 1; opacity: 0; transform: translateY(12px); transition: opacity 0.6s ease, transform 0.6s ease; pointer-events: none; }
.chapters-live .chapter-visual.is-active { opacity: 1; transform: none; pointer-events: auto; }
.chapters-live .chapter-stage .fig-body svg { max-height: calc(100vh - var(--nav-h, 64px) - 260px); }
.chapters-live .chapter-step { min-height: 72vh; display: flex; flex-direction: column; justify-content: center; }
.chapters-live .chapter-step--spacer { min-height: 55vh; }
.chapters-live .chapter-step .prose { color: var(--muted-foreground, #605b68); transition: color 0.3s ease; }
.chapters-live .chapter-step.is-active .prose { color: var(--publication-ink, #150d2b); }


.chapter--live .chapter-visual .grow {
  transform: scaleX(clamp(0, calc((var(--shown, 0) - var(--i, 0)) * 999), 1)) !important;
  transition: transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) !important;
}
.chapter--live .chapter-visual .fade {
  opacity: clamp(0, calc((var(--shown, 0) - var(--i, 0)) * 999), 1) !important;
  transition: opacity 0.5s ease 0.15s !important;
}
.chapter--live .chapter-visual .slide {
  transform: translateX(calc(var(--dx, 0px) * (1 - clamp(0, calc((var(--shown, 0) - var(--i, 0)) * 999), 1)))) !important;
  transition: transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) !important;
}

@media (max-width: 899px) {
  .chapters-live .chapter-body { display: flex; flex-direction: column; }
  .chapters-live .chapter-stage { order: -1; position: sticky; top: calc(var(--nav-h, 56px) + 4px); height: 54svh; z-index: 1; background: #fff; display: grid; align-items: center; }
  .chapters-live .chapter-stage .fig-take, .chapters-live .chapter-stage .fig-src, .chapters-live .chapter-stage figcaption .fig-take { display: none; }
  .chapters-live .chapter-stage .fig-body svg { max-height: 40svh; }
  .chapters-live .chapter-steps { position: relative; z-index: 2; padding: 0 0 24vh; }
  .chapters-live .chapter-step { min-height: 78svh; justify-content: flex-end; padding-bottom: 6svh; }
  .chapters-live .chapter-step > * { background: rgba(255, 255, 255, 0.97); border: 1px solid var(--border, #e8e7ec); border-radius: 10px; padding: 14px 16px; }
  .chapters-live .chapter-step--spacer { min-height: 45svh; }
}


.cast-map svg { width: 100%; height: auto; max-height: calc(100vh - var(--nav-h, 64px) - 80px); }
.cast-spine { stroke: var(--border, #e8e7ec); stroke-width: 2; }
.cast-node circle { fill: #fff; stroke: var(--publication-ink, #150d2b); stroke-width: 2; }
.cast-node.is-creator circle { fill: var(--accent, #6d3fd6); stroke: var(--accent, #6d3fd6); }
.cast-label { font: 600 16px/1 var(--font-sans, "Hanken Grotesk", sans-serif); fill: var(--publication-ink, #150d2b); }
.cast-card { padding: 18px 20px; border: 1px solid var(--border, #e8e7ec); border-radius: 10px; background: #fff; }
.cast-name { margin: 0 0 6px; font: 700 18px/1.25 var(--font-sans, "Hanken Grotesk", sans-serif); color: var(--publication-ink, #150d2b); }
.cast-card p { margin: 0; font-family: var(--font-serif, Newsreader, serif); font-size: 17px; line-height: 1.55; }
.cast-card dl { margin: 12px 0 0; display: grid; gap: 8px; }
.cast-card dt { font: 500 11px/1 var(--font-mono, "Geist Mono", monospace); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-foreground, #605b68); }
.cast-card dd { margin: 4px 0 0; font-size: 15px; line-height: 1.5; }


.traffic { margin: 40px auto; max-width: 1180px; }
.tl-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.tl-filters button { padding: 8px 14px; border: 1px solid var(--border, #e8e7ec); border-radius: 999px; background: #fff; font: 500 12px/1 var(--font-mono, "Geist Mono", monospace); letter-spacing: 0.04em; text-transform: uppercase; cursor: pointer; color: var(--publication-ink, #150d2b); }
.tl-filters button.is-on { background: var(--publication-ink, #150d2b); color: #fff; border-color: var(--publication-ink, #150d2b); }
.tl-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: start; }

.tl-board:has(.tl-col[hidden]) { grid-template-columns: 1fr; }
.tl-board:has(.tl-col[hidden]) .tl-col:not([hidden]) ul { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.tl-col h3 { margin: 0 0 12px; font: 700 15px/1 var(--font-sans, "Hanken Grotesk", sans-serif); letter-spacing: 0.01em; }
.tl-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tl-card { position: relative; padding: 14px 16px 14px 44px; border-radius: 10px; border: 1px solid var(--border, #e8e7ec); background: #fff; }
.tl-mark { position: absolute; left: 14px; top: 13px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font: 700 13px/1 var(--font-sans, sans-serif); }
.tl-safe .tl-mark { border: 1.5px solid var(--publication-ink, #150d2b); color: var(--publication-ink, #150d2b); }
.tl-questionable { background: #f3effc; border-color: #ddd3f7; }
.tl-questionable .tl-mark { background: var(--accent, #6d3fd6); color: #fff; }
.tl-forbidden { background: var(--publication-ink, #150d2b); border-color: var(--publication-ink, #150d2b); color: #fff; }
.tl-forbidden .tl-mark { background: #fff; color: var(--publication-ink, #150d2b); }
.tl-forbidden .tl-why, .tl-forbidden .tl-why a { color: rgba(255,255,255,0.8); }
.tl-practice { margin: 0; font-weight: 600; font-size: 15px; line-height: 1.4; }
.tl-why { margin: 6px 0 0; font-size: 14px; line-height: 1.5; color: var(--muted-foreground, #605b68); }
.tl-wait .tl-card { opacity: 0; transform: translateY(8px); }
.tl-in .tl-card { opacity: 1; transform: none; transition: opacity 0.45s ease calc(var(--i, 0) * 70ms), transform 0.45s ease calc(var(--i, 0) * 70ms); }
@media (max-width: 899px) { .tl-board { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .tl-wait .tl-card { opacity: 1; transform: none; } }
.fig-new { border: 1px dashed var(--border, #e8e7ec); border-radius: 10px; padding: 18px 20px; }



@media (min-width: 1024px) { .story .peak-inner { margin-left: 0; } }

@media (max-width: 899px) {
  .chapters-live .chapter--tall .chapter-stage { position: relative; top: auto; height: auto; display: block; }
  .chapters-live .chapter--tall .chapter-visual { display: none; }
  .chapters-live .chapter--tall .chapter-visual.is-active { display: block; }
  .chapters-live .chapter--tall .chapter-stage .fig-body svg { max-height: none; }
  .chapters-live .chapter--tall .chapter-stage .fig-take, .chapters-live .chapter--tall .chapter-stage .fig-src { display: block; }
  .chapters-live .chapter--tall .chapter-step { min-height: 0; padding: 24px 0 0; justify-content: flex-start; }
  .chapters-live .chapter--tall .chapter-steps { padding-bottom: 0; }
  .chapters-live .chapter--tall .chapter-step--spacer { display: none; }
}

@media (min-width: 1024px) { .story .story-toc { display: block; } }

.story-wide { max-width: 1040px; margin: 96px auto 0; }
.story-wide > h2 { max-width: 720px; margin-left: auto; margin-right: auto; }

:root:not(.chapters-live) .chapter-body { display: flex; flex-direction: column; max-width: 720px; margin-inline: auto; }
:root:not(.chapters-live) .chapter-stage { order: -1; margin-bottom: 24px; }
