/* Narrative pages: pinned chapters made of beats. Loaded after style.css and reuses its tokens. */
.story { position: relative; height: calc(var(--n, 4) * 85vh + 100vh); }
.story-pin { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 56px; align-items: center; padding: 80px var(--col) 40px; }
.story-pin.center { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }

/* Things stacked in one grid cell take turns. */
.narr, .set { display: grid; min-width: 0; }
.narr > *, .set > * { grid-area: 1 / 1; }
.set { grid-template-columns: minmax(0, 1fr); place-items: center; position: relative; min-height: 420px; }
.beat, [data-show] { opacity: 0; transform: translateY(24px); transition: opacity .6s, transform .7s cubic-bezier(.2,.8,.2,1); pointer-events: none; }
.beat.past { transform: translateY(-24px); }
.beat.on, [data-show].vis { opacity: 1; transform: none; pointer-events: auto; }
.narr .beat { align-self: center; }

/* chapter marker: day + time, like a log line */
.stamp { font: 500 13px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 12px; margin: 0 0 18px; }
.stamp b { color: var(--signal); font-weight: 500; }
.stamp::before { content: ""; width: 22px; height: 1px; background: var(--signal); }
.line { font-size: clamp(32px, 4.4vw, 58px); font-weight: 600; letter-spacing: -.045em; line-height: 1.05; margin: 0 0 18px; text-wrap: balance; }
.line .mute { color: var(--dim); }
.line .sig { color: var(--signal); }
.note { color: var(--fg-2); font-size: 18px; max-width: 520px; margin: 0; }
.story-pin.center .note { margin-inline: auto; }
.decode-on .wd, .decode .wd { white-space: nowrap; }
.decode-on .ch { display: inline-block; }
.decode-on .ch.scr { color: var(--dim); }

/* ───── tool windows ───── */
.win { width: 100%; max-width: 520px; border-radius: 14px; background: rgba(7,7,8,.92); box-shadow: 0 0 0 1px var(--line-2) inset, 0 40px 120px -40px rgba(143,211,255,.22); overflow: hidden; text-align: left; transition: filter .6s, opacity .6s, box-shadow .6s; }
.win-head { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 500; color: var(--fg-2); }
.win-head svg { width: 16px; height: 16px; color: var(--brand, var(--fg)); }
.win-head .dots { margin-left: auto; display: flex; gap: 6px; }
.win-head .dots i { width: 9px; height: 9px; border-radius: 50%; background: #1d1d20; box-shadow: 0 0 0 1px var(--line-2) inset; }
.win-body { padding: 18px; display: grid; gap: 12px; font-size: 15px; min-height: 230px; align-content: start; }
.msg { display: grid; gap: 4px; }
.msg .who { font: 500 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.msg.you p { color: var(--fg); }
.msg.ai p { color: var(--fg-2); }
.msg p { margin: 0; min-height: 1.6em; }
.typing::after { content: ""; display: inline-block; width: 7px; height: 1em; margin-left: 3px; vertical-align: -2px; background: var(--signal); animation: blink 1s steps(1) infinite; }
.codeblk { font: 13px/1.75 var(--mono); background: #000; border-radius: 10px; padding: 12px 14px; box-shadow: 0 0 0 1px var(--line) inset; white-space: pre-wrap; color: var(--fg-2); margin: 0; }
.codeblk .add { color: var(--bad); background: rgba(248,113,113,.08); display: block; margin: 0 -14px; padding: 0 14px; border-left: 2px solid var(--bad); }
.codeblk .good { color: var(--ok); background: rgba(74,222,128,.07); display: block; margin: 0 -14px; padding: 0 14px; border-left: 2px solid var(--ok); }
.codeblk .mk { color: var(--warn); }
.codeblk .inj { color: var(--fg); background: var(--signal-soft); display: block; margin: 0 -14px; padding: 0 14px; border-left: 2px solid var(--signal); }
.flag { display: inline-flex; align-items: center; gap: 8px; font: 500 12px var(--mono); padding: 6px 10px; border-radius: 8px; width: max-content; }
.flag.bad { color: var(--bad); box-shadow: 0 0 0 1px rgba(248,113,113,.4) inset; }
.flag.ok { color: var(--ok); box-shadow: 0 0 0 1px rgba(74,222,128,.4) inset; }
.flag.sig { color: var(--signal); box-shadow: 0 0 0 1px rgba(143,211,255,.45) inset; }
.flag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.win.gone { filter: grayscale(1) brightness(.35); }
.closed { font: 500 12px var(--mono); color: var(--dim); letter-spacing: .1em; text-transform: uppercase; }

/* a few windows at once */
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; width: 100%; }
.trio .win { width: 100%; }
.trio .win-body { min-height: 0; font-size: 13.5px; padding: 14px; }
.trio .codeblk { font-size: 11.5px; }
.trio .win:nth-child(2) { transition-delay: .12s; } .trio .win:nth-child(3) { transition-delay: .24s; }

/* the "3x" counter */
.tally { display: grid; justify-items: center; gap: 6px; }
.tally b { font-size: clamp(110px, 16vw, 220px); font-weight: 600; letter-spacing: -.07em; line-height: .9; color: var(--fg); }
.tally span { font: 500 13px var(--mono); color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.stack3 { position: relative; width: 100%; max-width: 500px; height: 300px; }
.stack3 .win { position: absolute; left: 0; right: 0; width: auto; }
.stack3 .win:nth-child(1) { top: 0; transform: scale(.88) translateY(-34px); opacity: .35; }
.stack3 .win:nth-child(2) { top: 0; transform: scale(.94) translateY(-14px); opacity: .6; }
.stack3 .win:nth-child(3) { top: 0; }

/* ───── labels orbiting the brain (wake chapter, voice page) ───── */
.orbit { position: absolute; inset: 0; pointer-events: none; }
.orbit span { position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%); display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 500; padding: 7px 12px; border-radius: 10px; background: rgba(7,7,8,.9); color: var(--fg); box-shadow: 0 0 0 1px var(--line-2) inset;
  white-space: nowrap; opacity: 0; transition: opacity .6s, transform .7s cubic-bezier(.2,.8,.2,1); transition-delay: calc(var(--i, 0) * 90ms); }
.orbit span svg { width: 16px; height: 16px; color: var(--brand, var(--fg)); }
.orbit.vis span { opacity: 1; animation: float 6s ease-in-out infinite; animation-delay: calc(var(--i, 0) * -0.8s); }
@keyframes float { 50% { transform: translate(-50%, calc(-50% - 8px)); } }

.caption { position: absolute; left: 50%; bottom: 7vh; transform: translateX(-50%); width: min(760px, calc(100% - 40px)); text-align: center; }
.caption .line { font-size: clamp(28px, 3.6vw, 46px); }
.stage-label { font: 500 12px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--signal); margin-bottom: 12px; }
.phase { display: flex; gap: 8px; justify-content: center; margin-top: 16px; }
.phase i { width: 26px; height: 3px; border-radius: 2px; background: var(--line-2); transition: background .4s, box-shadow .4s; }
.phase i.on { background: var(--signal); box-shadow: 0 0 8px var(--signal); }

/* lock + key */
.vaultcard { width: 100%; max-width: 480px; display: grid; gap: 14px; }
.vaultcard .row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 12px; background: rgba(7,7,8,.9); box-shadow: 0 0 0 1px var(--line-2) inset; font-size: 15px; }
.vaultcard .row svg { width: 20px; height: 20px; color: var(--fg-2); }
.vaultcard .row small { margin-left: auto; font: 12px var(--mono); color: var(--muted); }
.cipher { font: 12px/1.7 var(--mono); color: var(--signal); white-space: pre-wrap; word-break: break-all; padding: 14px 16px; border-radius: 12px;
  background: #000; box-shadow: 0 0 0 1px rgba(143,211,255,.3) inset; min-height: 92px; }

/* ───── voice page ───── */
.voice .line { font-size: clamp(38px, 6vw, 84px); max-width: 15ch; margin-inline: auto; }
.voice .note { font-size: 19px; max-width: 560px; }
.voice .beat { align-self: center; }
.voice .narr { width: 100%; justify-items: center; }
.whisper { position: absolute; left: var(--col); bottom: 6vh; font: 12px/1.9 var(--mono); color: var(--dim); text-align: left; }
.whisper.right { left: auto; right: var(--col); text-align: right; }
.whisper b { color: var(--signal); font-weight: 500; }

/* ───── journey page ───── */
.route { position: absolute; left: var(--col); right: var(--col); top: 92px; display: grid; grid-template-columns: repeat(7, 1fr); }
.route::before { content: ""; position: absolute; left: calc(100% / 14); right: calc(100% / 14); top: 5px; height: 1px; background: var(--line-2); }
.route::after { content: ""; position: absolute; left: calc(100% / 14); top: 5px; height: 1px; background: var(--signal); box-shadow: 0 0 10px var(--signal);
  width: calc((100% - 100% / 7) * var(--p, 0)); }
.route span { position: relative; display: grid; justify-items: center; gap: 10px; font: 500 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); transition: color .4s; }
.route span::before { content: ""; width: 11px; height: 11px; border-radius: 50%; background: #000; box-shadow: 0 0 0 1px var(--line-2) inset; transition: .4s; }
.route span.on, .route span.past { color: var(--fg-2); }
.route span.on { color: var(--signal); }
.route span.on::before, .route span.past::before { background: var(--signal); box-shadow: 0 0 10px var(--signal); }
.journey .story-pin { padding-top: 150px; }
.card { width: 100%; max-width: 560px; border-radius: 16px; background: rgba(7,7,8,.94); box-shadow: 0 0 0 1px var(--line-2) inset, 0 50px 140px -40px rgba(143,211,255,.3); overflow: hidden; text-align: left; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); font: 500 12px var(--mono); color: var(--muted); }
.card-head svg { width: 16px; height: 16px; color: var(--brand, var(--fg)); }
.card-head em { font-style: normal; margin-left: auto; color: var(--signal); }
.card-body { padding: 18px; display: grid; gap: 12px; font-size: 15px; }
.card .codeblk { font-size: 12.5px; }
.journey .set .card { transition: opacity .55s, transform .7s cubic-bezier(.2,.8,.2,1), filter .55s; }
.journey .set .card:not(.vis) { transform: translateY(24px) scale(.96); filter: blur(4px); }
.quote { font-size: 22px; font-weight: 500; letter-spacing: -.02em; color: var(--fg); margin: 0; }
.res { display: grid; grid-template-columns: 46px 1fr; gap: 10px; align-items: baseline; padding: 8px 10px; border-radius: 8px; font-size: 14px; color: var(--fg-2); }
.res b { font: 600 12px var(--mono); color: var(--muted); }
.res.top { background: var(--signal-soft); box-shadow: 0 0 0 1px rgba(143,211,255,.35) inset; color: var(--fg); }
.res.top b { color: var(--signal); }
.release { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 10px; box-shadow: 0 0 0 1px var(--line-2) inset; }
.release svg { width: 22px; height: 22px; }
.release small { color: var(--muted); font: 12px var(--mono); display: block; }
.release em { font: 500 11px var(--mono); font-style: normal; color: var(--ok); box-shadow: 0 0 0 1px rgba(74,222,128,.4) inset; padding: 3px 8px; border-radius: 6px; }

/* story index / switcher */
.switch { position: fixed; z-index: 25; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); display: flex; gap: 4px; padding: 4px;
  border-radius: 12px; background: rgba(0,0,0,.75); box-shadow: 0 0 0 1px var(--line-2) inset; }
.switch a { font: 500 12px var(--mono); color: var(--muted); text-decoration: none; padding: 7px 11px; border-radius: 8px; white-space: nowrap; }
.switch a:hover { color: var(--fg); }
.switch a[aria-current] { color: #000; background: var(--fg); }

.opener { min-height: 100vh; min-height: 100svh; display: grid; align-content: center; padding: 120px var(--col) 80px; position: relative; }
.opener h1 { font-size: clamp(44px, 7vw, 92px); letter-spacing: -.05em; line-height: .98; margin: 18px 0 22px; font-weight: 600; max-width: 12ch; }
.opener .note { font-size: 19px; }
.scrollcue { margin-top: 40px; font: 12px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 10px; }
.scrollcue i { width: 1px; height: 34px; background: linear-gradient(var(--signal), transparent); animation: drip 1.8s ease-in-out infinite; transform-origin: top; }
@keyframes drip { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

@media (max-width: 760px) {
  .story-pin { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; gap: 18px; align-items: start; padding: 84px 20px 76px; }
  .line { font-size: 30px; }
  .note { font-size: 15.5px; }
  .set { min-height: 0; align-self: start; }
  .win-body { min-height: 0; font-size: 14px; padding: 14px; }
  .trio { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .trio .win:nth-child(n+3) { display: none; }
  .tally b { font-size: 120px; }
  .stack3 { height: 240px; }
  .caption { bottom: 90px; }
  .voice .line { font-size: 38px; }
  .whisper { display: none; }
  .route { top: 70px; left: 12px; right: 12px; }
  .route span { font-size: 8px; letter-spacing: .02em; }
  .journey .story-pin { padding-top: 130px; }
  .card-body { padding: 14px; font-size: 14px; }
  .quote { font-size: 18px; }
  .orbit span { font-size: 11px; padding: 5px 9px; }
  .switch a { padding: 6px 8px; font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .beat, [data-show] { transition: none; }
  .orbit.vis span, .scrollcue i, .typing::after { animation: none; }
}

/* the phase ticks are always visible; .vis only lights them */
.phase i[data-show] { opacity: 1; transform: none; }
.phase i.vis { background: var(--signal); box-shadow: 0 0 8px var(--signal); }
.story[data-beat="2"] .win.fades { filter: grayscale(1) brightness(.3); }
.closed { position: absolute; left: 50%; bottom: 8%; transform: translateX(-50%); }
.closed.vis { transform: translateX(-50%); }
.whisper { white-space: pre; }
.codeblk [data-show]:not(.vis) { display: none; }
.decode-in .ch.scr { color: var(--dim); }
.decode-in .wd { white-space: nowrap; } .decode-in .ch { display: inline-block; }
.voice .line, .voice .note, .caption .line, .caption .note { text-shadow: 0 0 24px #000, 0 1px 3px #000; }
.trio .codeblk { white-space: pre; overflow-x: auto; }
.narr .line, .narr .note, .narr .stamp { text-shadow: 0 0 24px #000, 0 1px 3px #000; }
@media (max-width: 760px) { .closed { bottom: -34px; white-space: nowrap; } }

/* combined page: short first-person interludes between the overview chapters */
.interlude { min-height: 75vh; display: grid; align-content: center; justify-items: center; text-align: center; padding: 100px var(--col); }
.interlude .line { font-size: clamp(36px, 5.6vw, 76px); max-width: 16ch; }
.interlude .note { font-size: 19px; max-width: 560px; }
.interlude .line, .interlude .note { text-shadow: 0 0 24px #000, 0 1px 3px #000; }
.interlude.marquee-wrap { min-height: 0; padding: 0; display: block; }
.marquee.static { position: relative; top: auto; bottom: auto; }
.voice .pill { margin-bottom: 22px; }
.voice .works { margin-top: 30px; }
@media (max-width: 760px) { .interlude { min-height: 60vh; padding: 70px 20px; } .interlude .line { font-size: 36px; } }
.switch + .foot { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
@media (max-width: 760px) {
  .story-pin.center { grid-template-rows: none; align-items: center; }
  /* keep orbiting labels in the lower half, clear of the centred line */
  .voice .orbit span { top: calc(60% + var(--y) * .35); }
}

/* ───── numbers: comparison bars, before/after, tokens ───── */
.numbers { padding: 110px var(--col); }
.numbers .sub { max-width: 680px; }
.charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.chartcard { margin: 0; padding: 24px 24px 20px; border-radius: 16px; background: rgba(5,5,6,.9); box-shadow: 0 0 0 1px var(--line-2) inset; min-width: 0; }
.chartcard figcaption { font-size: 14px; color: var(--muted); margin-bottom: 18px; }
.chartcard figcaption b { color: var(--fg); font-weight: 600; }
.fine { color: var(--dim); font-size: 12.5px; line-height: 1.55; margin: 16px 0 0; }
.bars { display: grid; gap: 6px; }
.bar { display: grid; grid-template-columns: 150px minmax(0, 1fr) 46px; align-items: center; gap: 12px; padding: 3px 0; border-radius: 6px; cursor: default; }
.bar span { font-size: 13.5px; color: var(--fg-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar i { height: 14px; border-radius: 0 4px 4px 0; background: #3a3d45; width: 0; transition: width 1.2s cubic-bezier(.2,.8,.2,1); }
.bar b { font: 500 13px var(--mono); color: var(--fg-2); text-align: right; font-variant-numeric: tabular-nums; }
.bar.me span, .bar.me b { color: var(--fg); }
.bar.me i { background: var(--signal); box-shadow: 0 0 14px rgba(143,211,255,.35); }
.bar:hover i { filter: brightness(1.25); }
.in .bar i { width: calc(var(--v) * 100%); }
.bars .bar:nth-child(2) i { transition-delay: .06s; } .bars .bar:nth-child(3) i { transition-delay: .12s; } .bars .bar:nth-child(4) i { transition-delay: .18s; }
.bars .bar:nth-child(5) i { transition-delay: .24s; } .bars .bar:nth-child(6) i { transition-delay: .3s; } .bars .bar:nth-child(7) i { transition-delay: .36s; }
.bars.compact .bar i { height: 10px; }
.hero-num { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.hero-num > b { font-size: 52px; font-weight: 600; letter-spacing: -.05em; line-height: 1; color: var(--signal); }
.hero-num span { color: var(--muted); font-size: 13px; } .hero-num span b { color: var(--fg); font-weight: 500; }

.dumbbells { border-radius: 16px; background: rgba(5,5,6,.9); box-shadow: 0 0 0 1px var(--line-2) inset; padding: 10px 24px 18px; }
.db { display: grid; grid-template-columns: 260px minmax(0, 1fr) 140px; align-items: center; gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.db > span { font-size: 15px; color: var(--fg); } .db > span small { display: block; color: var(--muted); font-size: 12.5px; }
.db > b { font: 500 14px var(--mono); color: var(--fg); text-align: right; font-variant-numeric: tabular-nums; }
.dtrack { position: relative; height: 18px; }
.dtrack::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--line); }
.dtrack i { position: absolute; top: 50%; }
.dtrack .from, .dtrack .to { width: 12px; height: 12px; border-radius: 50%; margin: -6px 0 0 -6px; left: calc(var(--v) * 100%); }
.dtrack .from { background: #000; box-shadow: 0 0 0 2px #6b6f78 inset; }
.dtrack .to { background: var(--signal); box-shadow: 0 0 0 2px #000, 0 0 12px var(--signal); left: calc(var(--from, var(--v)) * 100%); }
.dtrack .line { height: 2px; margin-top: -1px; background: var(--signal); left: calc(var(--a) * 100%); width: 0; opacity: .7; }
.in .dtrack .line { width: calc((var(--b) - var(--a)) * 100%); transition: width 1.1s cubic-bezier(.2,.8,.2,1) .2s; }
.dumbbells .dtrack .to { opacity: 0; transition: opacity .4s 1.1s; }
.dumbbells.in .dtrack .to { opacity: 1; }
.db-legend { display: flex; gap: 20px; padding-top: 14px; font: 12px var(--mono); color: var(--muted); align-items: center; }
.db-legend span { display: inline-flex; gap: 8px; align-items: center; } .db-legend .axis { margin-left: auto; color: var(--dim); }
.db-legend i { width: 10px; height: 10px; border-radius: 50%; } .db-legend .from { box-shadow: 0 0 0 2px #6b6f78 inset; } .db-legend .to { background: var(--signal); }

.tokens { width: 100%; max-width: 520px; padding: 26px; border-radius: 16px; background: rgba(5,5,6,.92); box-shadow: 0 0 0 1px var(--line-2) inset; display: grid; gap: 18px; }
.tk { display: grid; gap: 8px; }
.tk span { font-size: 14px; color: var(--fg-2); }
.tk i { height: 34px; border-radius: 0 6px 6px 0; background: #3a3d45; width: 0; min-width: 3px; transition: width 1.3s cubic-bezier(.2,.8,.2,1); }
.tk b { font: 500 22px var(--mono); color: var(--fg-2); font-variant-numeric: tabular-nums; }
.tk.me span, .tk.me b { color: var(--fg); } .tk.me b { color: var(--signal); }
.tk.me i { background: var(--signal); box-shadow: 0 0 18px rgba(143,211,255,.5); transition-delay: .5s; }
.vis .tk i { width: calc(var(--v) * 100%); }
.tokens .fine { margin: 0; }
.meter-card { width: 100%; max-width: 440px; border-radius: 16px; background: rgba(5,5,6,.94); box-shadow: 0 0 0 1px var(--line-2) inset; overflow: hidden; }
.meter-card .win-head .mark { width: 16px; height: 16px; }
.eg { margin-left: auto; font: 500 10px var(--mono); font-style: normal; letter-spacing: .1em; text-transform: uppercase; color: var(--warn);
  padding: 2px 7px; border-radius: 5px; box-shadow: 0 0 0 1px rgba(251,191,36,.35) inset; }
.meter-body { padding: 26px; display: grid; gap: 6px; }
.big-saved { font-size: 64px; font-weight: 600; letter-spacing: -.05em; line-height: 1; color: var(--fg); font-variant-numeric: tabular-nums; }
.meter-body > span { color: var(--muted); font-size: 14px; }
.mini { display: flex; gap: 22px; margin-top: 14px; font: 13px var(--mono); color: var(--muted); } .mini b { color: var(--signal); font-weight: 500; }

/* loading + folders */
.filed { display: flex; gap: 8px; flex-wrap: wrap; }
.budget { position: relative; height: 22px; border-radius: 6px; background: rgba(255,255,255,.04); box-shadow: 0 0 0 1px var(--line) inset; overflow: hidden; }
.budget span { position: absolute; inset: 0 auto 0 0; width: 0; background: rgba(143,211,255,.35); transition: width 1.4s cubic-bezier(.2,.8,.2,1) .8s; }
.vis .budget span { width: calc(var(--v) * 100%); }
.budget em { position: relative; font: 500 11.5px var(--mono); font-style: normal; color: var(--fg); padding-left: 10px; line-height: 22px; }
.tools-row { display: flex; flex-wrap: wrap; gap: 6px; } .tools-row code { font-size: 11.5px; }
.win .machines { margin-top: 6px; }
.tree { width: 100%; max-width: 520px; border-radius: 14px; background: rgba(5,5,6,.94); box-shadow: 0 0 0 1px var(--line-2) inset; padding: 8px 0 14px; text-align: left; }
.tree-head { display: flex; align-items: center; gap: 10px; padding: 8px 18px 12px; font: 500 13px var(--mono); color: var(--fg-2); border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.tree-head svg { width: 16px; height: 16px; }
.node { display: flex; align-items: center; gap: 10px; padding: 8px 18px 8px 34px; font: 13.5px var(--mono); color: var(--fg-2); transition: background .4s, color .4s; }
.node .fold::before { content: "▸ "; color: var(--dim); }
.node em { margin-left: auto; font-style: normal; color: var(--dim); font-size: 12px; }
.story[data-beat="1"] .node.cur, .story[data-beat="2"] .node.cur { background: var(--signal-soft); color: var(--fg); box-shadow: inset 2px 0 0 var(--signal); }
.story[data-beat="1"] .node.cur em { color: var(--signal); }
.story[data-beat="2"] .node { color: var(--fg); }
.tree-out { padding: 10px 18px 0; }
.tree-out[data-show]:not(.vis) { display: none; }

/* control panel mock + access list */
.access { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 48px; align-items: center; padding: 40px var(--col) 120px; }
.panelui { border-radius: 16px; background: rgba(5,5,6,.94); box-shadow: 0 0 0 1px var(--line-2) inset, 0 50px 120px -50px rgba(143,211,255,.35); overflow: hidden; }
.pu-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); font: 500 12.5px var(--mono); color: var(--fg-2); }
.pu-head .mark { width: 16px; height: 16px; }
.pu-body { padding: 16px; display: grid; gap: 10px; }
.pu-search { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; box-shadow: 0 0 0 1px var(--line-2) inset; font: 14px var(--mono); color: var(--fg); min-height: 42px; }
.pu-search svg { color: var(--muted); }
.pu-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.pu-filters span { font: 12px var(--mono); color: var(--muted); padding: 5px 10px; border-radius: 7px; box-shadow: 0 0 0 1px var(--line) inset; }
.pu-filters .on { color: #000; background: var(--fg); }
.pu-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px; border-radius: 10px; box-shadow: 0 0 0 1px var(--line) inset; align-items: center;
  opacity: 0; transform: translateY(8px); transition: opacity .5s, transform .5s; }
.in .pu-row { opacity: 1; transform: none; }
.in .pu-row:nth-child(4) { transition-delay: .5s; } .in .pu-row:nth-child(5) { transition-delay: .7s; } .in .pu-row:nth-child(6) { transition-delay: .9s; } .in .pu-row:nth-child(7) { transition-delay: 1.1s; }
.pu-row .tag { grid-column: 1; font: 500 10.5px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.pu-row p { grid-column: 1; margin: 0; font-size: 14px; color: var(--fg); }
.pu-row .acts { grid-column: 2; grid-row: 1 / span 2; display: flex; gap: 6px; }
.pu-row .acts i { font: 500 11px var(--mono); font-style: normal; color: var(--fg-2); padding: 5px 8px; border-radius: 6px; box-shadow: 0 0 0 1px var(--line-2) inset; white-space: nowrap; }
.pu-row .acts .pin { color: var(--signal); box-shadow: 0 0 0 1px rgba(143,211,255,.45) inset; }
.pu-row .acts .ok { color: var(--ok); box-shadow: 0 0 0 1px rgba(74,222,128,.4) inset; }
.pu-row.draft { box-shadow: 0 0 0 1px rgba(251,191,36,.35) inset; } .pu-row.draft .tag { color: var(--warn); }
.access-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.access-list li { color: var(--fg-2); font-size: 15px; padding-left: 18px; border-left: 1px solid var(--line-2); }
.access-list b { display: block; color: var(--fg); font-weight: 500; font-size: 17px; margin-bottom: 2px; }
.access-list li:nth-child(2) { transition-delay: .08s; } .access-list li:nth-child(3) { transition-delay: .16s; } .access-list li:nth-child(4) { transition-delay: .24s; }
.access-list li:nth-child(5) { transition-delay: .32s; } .access-list li:nth-child(6) { transition-delay: .4s; }

/* hover tooltip for chart marks */
.tip { position: fixed; z-index: 40; pointer-events: none; font: 12.5px var(--sans); color: var(--fg); background: #0c0c0e; padding: 8px 10px; border-radius: 8px;
  box-shadow: 0 0 0 1px var(--line-2), 0 10px 30px rgba(0,0,0,.6); max-width: 280px; opacity: 0; transition: opacity .15s; }
.tip.on { opacity: 1; }

@media (max-width: 760px) {
  .numbers { padding: 70px 20px; }
  .charts, .access { grid-template-columns: minmax(0, 1fr); }
  .bar { grid-template-columns: 112px minmax(0, 1fr) 40px; gap: 8px; }
  .bar span { font-size: 12px; }
  .db { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; }
  .db > span { grid-column: 1 / -1; }
  .db-legend .axis { display: none; }
  .tokens { padding: 18px; } .tk i { height: 24px; } .tk b { font-size: 17px; }
  .big-saved { font-size: 48px; }
  .access { padding: 20px 20px 80px; gap: 28px; }
  .pu-row { grid-template-columns: minmax(0, 1fr); } .pu-row .acts { grid-column: 1; grid-row: auto; }
}

/* credits + plain pages (blog, privacy, contact) */
.credit { position: absolute; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); margin: 0; white-space: nowrap;
  font: 12px var(--mono); letter-spacing: .06em; color: var(--muted); text-shadow: 0 0 16px #000; }
.credit b { color: var(--fg); font-weight: 500; }
.doc { min-height: 100vh; min-height: 100svh; padding: 140px var(--col) 100px; max-width: calc(760px + 2 * var(--col)); }
.doc h1 { font-size: clamp(40px, 6vw, 76px); letter-spacing: -.05em; line-height: 1; font-weight: 600; margin: 0 0 22px; }
.doc .lede-doc { font-size: 19px; color: var(--fg-2); max-width: 600px; margin: 0 0 12px; }
.doc .updated { font: 12px var(--mono); color: var(--dim); margin: 0 0 40px; }
.doc h2 { font-size: 24px; margin: 44px 0 14px; letter-spacing: -.02em; }
.doc ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.doc li { position: relative; padding-left: 20px; color: var(--fg-2); font-size: 16px; text-shadow: 0 0 20px #000; }
.doc li::before { content: ""; position: absolute; left: 0; top: .7em; width: 6px; height: 6px; border-radius: 50%; background: var(--signal); }
.doc li b { color: var(--fg); font-weight: 500; }
.empty-posts { margin-top: 40px; }
.nav nav a[aria-current] { color: var(--fg); }
@media (max-width: 760px) {
  .credit { bottom: 120px; font-size: 11px; }
  .doc { padding: 110px 20px 80px; }
}
.interlude.marquee-wrap { width: 100%; max-width: 100%; overflow: hidden; }
.marquee.static { width: 100%; max-width: 100%; }

/* phones: logos ring the brain, which shrinks and drops below the text (see data-bm) */
@media (max-width: 760px) {
  .story .orbit span { left: var(--mx); top: calc(var(--cy, 70%) + var(--my)); font-size: 10.5px; padding: 4px 8px; gap: 5px; }
  .story .orbit span svg { width: 12px; height: 12px; }
  .story .orbit span:nth-child(1) { --mx: 50%; --my: -17%; }
  .story .orbit span:nth-child(2) { --mx: 17%; --my: -6%; }
  .story .orbit span:nth-child(3) { --mx: 83%; --my: -6%; }
  .story .orbit span:nth-child(4) { --mx: 22%; --my: 12%; }
  .story .orbit span:nth-child(5) { --mx: 78%; --my: 12%; }
  .story .orbit span:nth-child(6) { --mx: 50%; --my: 12%; }
  .voice .story-pin.center { align-items: start; padding-top: 104px; }
  .voice .line { font-size: 32px; }
  .voice .note { font-size: 15px; }
}

/* Phones: the pinned credit sits where the logos and brain land, so it shows only on the first
   screen; the "I'm Open Agentic Brain and Memory" beat carries its own inline copy instead. */
.credit.inline { position: static; transform: none; display: block; margin: 18px 0 0; white-space: normal; }
.phone-only { display: none !important; }
@media (max-width: 760px) {
  .phone-only { display: block !important; }
  .credit:not(.inline) { transition: opacity .4s; }
  .story[data-beat]:not([data-beat="0"]) .credit:not(.inline) { opacity: 0; }
}

/* phones: the logo ring lives in the band fitPhone() measured (see story.js) */
@media (max-width: 760px) {
  .story .orbit { inset: auto 0; top: var(--ot, 55%); height: var(--oh, 40%); }
  .story .orbit span { top: calc(50% + var(--my)); }
  .story .orbit span:nth-child(1) { --mx: 50%; --my: -42%; }
  .story .orbit span:nth-child(2) { --mx: 14%; --my: -12%; }
  .story .orbit span:nth-child(3) { --mx: 86%; --my: -12%; }
  .story .orbit span:nth-child(4) { --mx: 20%; --my: 36%; }
  .story .orbit span:nth-child(5) { --mx: 80%; --my: 36%; }
  .story .orbit span:nth-child(6) { --mx: 50%; --my: 36%; }
  /* the pinned credit would sit in that band: phones get inline copies instead */
  .credit:not(.inline) { display: none; }
}

@media (max-width: 760px) {
  /* rows pinned to the band's edges in px so they never cross into the text */
  .story .orbit span:nth-child(1) { top: 16px; }
  .story .orbit span:nth-child(2), .story .orbit span:nth-child(3) { top: 50%; }
  .story .orbit span:nth-child(4), .story .orbit span:nth-child(5) { top: calc(100% - 16px); }
  .story .orbit.vis span { animation: none; }
}
@media (max-width: 760px) and (max-height: 700px) {
  .voice .line { font-size: 27px; }
  .voice .note { font-size: 14px; }
  .voice .pill { margin-bottom: 12px; font-size: 11px; }
  .voice .story-pin.center { padding-top: 88px; }
}

/* Off-screen sections pause their looping animations (story.js toggles .idle). */
.idle, .idle *, .idle *::before, .idle *::after { animation-play-state: paused !important; }
/* Phones: drop the always-on repaint animations; transform/opacity loops stay. */
@media (pointer: coarse) {
  .brand .logo, .brand .logo::after { animation: none !important; }
  .pulse { animation: none; box-shadow: 0 0 0 3px rgba(143,211,255,.25); }
  .reveal .w { transition: none; }
}



/* knowledge-graph showcase (home): live canvas graph, see graph.js. minmax(0,1fr) so it can never widen the grid */
.interlude.graph-show { grid-template-columns: minmax(0, 1fr); min-height: 0; padding-top: 120px; padding-bottom: 120px; }
.kg { margin: 34px auto 0; width: 100%; max-width: 1040px; }
.kg-stage { position: relative; height: clamp(440px, 64vh, 660px); border-radius: 18px; overflow: hidden; isolation: isolate;
  background: radial-gradient(800px 480px at 50% 45%, rgba(143,211,255,.07), transparent 65%), radial-gradient(600px 400px at 80% 90%, rgba(190,120,255,.06), transparent 70%), rgba(4,5,8,.72);
  box-shadow: 0 0 0 1px var(--line), 0 40px 120px -40px rgba(0,0,0,.9); text-align: left; }
.kg-stage::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; background: radial-gradient(ellipse at center, transparent 58%, rgba(0,0,0,.55)); }
.kg canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; cursor: pointer; outline: none; }
.kg.is-live canvas { touch-action: none; cursor: grab; }
.kg.is-live .kg-stage { box-shadow: 0 0 0 1px rgba(143,211,255,.35), 0 40px 120px -40px rgba(0,0,0,.9); }
.kg canvas:focus-visible { box-shadow: inset 0 0 0 2px var(--signal); border-radius: 18px; }
.kg-reset { position: absolute; top: 14px; right: 14px; z-index: 3; font: 500 12.5px var(--sans); color: var(--fg-2); background: rgba(10,11,14,.7);
  border: 1px solid var(--line-2); border-radius: 999px; padding: 7px 14px; cursor: pointer; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: color .2s, border-color .2s; }
.kg-reset:hover { color: var(--fg); border-color: rgba(255,255,255,.3); }
.kg-hint { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 3; margin: 0; font: 500 11.5px var(--mono); letter-spacing: .04em; color: var(--muted);
  background: rgba(10,11,14,.7); border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px; white-space: nowrap; pointer-events: none; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.kg-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); margin: 0; }
.kg-tip { position: absolute; left: 0; top: 0; z-index: 4; width: max-content; max-width: 280px; pointer-events: none; opacity: 0; transition: opacity .15s;
  background: rgba(8,9,12,.94); border: 1px solid var(--line-2); border-radius: 12px; padding: 11px 13px; font-size: 12.5px; line-height: 1.45; color: var(--fg-2);
  box-shadow: 0 24px 60px -20px rgba(0,0,0,.9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.kg-tip.on { opacity: 1; }
.kg-tip > * { display: block; }
.kg-tip .k { font: 500 10px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.kg-tip b { color: var(--fg); font-size: 14.5px; margin: 2px 0 2px; }
.kg-tip .m { color: var(--muted); font-size: 12px; }
.kg-tip .ps, .kg-tip .cs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.kg-tip .ps i, .kg-tip .cs i { font-style: normal; font-size: 11px; padding: 2px 8px; border-radius: 99px; color: hsl(var(--h),80%,84%); background: hsla(var(--h),80%,60%,.14); }
.kg-tip .mem { margin-top: 9px; padding-top: 8px; border-top: 1px solid var(--line); display: grid; gap: 5px; }
.kg-tip q { display: block; color: var(--fg); font-size: 12.5px; quotes: none; padding-left: 10px; border-left: 2px solid rgba(143,211,255,.45); }
.kg-tip .h { margin-top: 8px; font-size: 11px; color: var(--signal); }
.kg figcaption { margin-top: 12px; font-size: 12.5px; color: var(--muted); text-align: center; }
@media (max-width: 760px) {
  .interlude.graph-show { padding: 80px 16px; }
  .kg { margin-top: 26px; }
  .kg-stage { height: 480px; border-radius: 14px; }
  .kg-tip { max-width: 240px; }
  .kg-reset { top: 10px; right: 10px; }
}
@media (prefers-reduced-motion: reduce) { .kg-tip { transition: none; } }
