/* ---------- story (scrollytelling) ---------- */
.story-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 64px; align-items: start; }
.story-left { position: relative; }
.story-rail { position: absolute; left: 27px; top: 32vh; bottom: 32vh; width: 2px; border-radius: 2px; background: var(--line); overflow: hidden; }
.story-rail i { display: block; width: 100%; height: 100%; transform-origin: 50% 0; transform: scaleY(0); background: var(--acc); }
.story-steps { list-style: none; margin: 0; padding: 0; }
.story-step { display: flex; align-items: center; gap: 24px; min-height: 64vh; opacity: .26; cursor: pointer; transition: opacity .5s var(--ease-out); }
.story-step.active { opacity: 1; }
.st-num {
  position: relative; z-index: 1; flex: none; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 18px;
  font: 600 16px var(--display); background: var(--bg-2); border: 1px solid var(--line-2);
  transition: color .4s, border-color .4s, box-shadow .4s;
}
.story-step.active .st-num { color: var(--acc); border-color: rgba(var(--acc-rgb), .5); box-shadow: 0 0 0 6px rgba(var(--acc-rgb), .07); }
.story-step h3 { font: 600 clamp(24px, 2.6vw, 34px)/1.1 var(--display); letter-spacing: -.035em; margin-bottom: 12px; }
.story-step p { margin: 0; max-width: 440px; color: var(--text-2); font-size: 17px; }
.st-chip { display: inline-block; margin-top: 18px; padding: 7px 12px; border-radius: 10px; font-size: 13px; color: #e7e7e2; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .1); }

.story-stage-wrap { position: sticky; top: max(100px, calc(50vh - 300px)); }
.story-stage {
  position: relative; aspect-ratio: 1; container: stage / inline-size; border-radius: 34px; overflow: hidden;
  background: #111113;
  border: 1px solid var(--line-2); box-shadow: 0 40px 100px -40px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .05);
}
.story-stage::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px); background-size: 22px 22px;
  mask-image: radial-gradient(ellipse at 50% 35%, #000 20%, transparent 75%); -webkit-mask-image: radial-gradient(ellipse at 50% 35%, #000 20%, transparent 75%);
}
.stage-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; will-change: transform; }
.stage-svg .trk { fill: none; stroke: rgba(255, 255, 255, .08); stroke-width: 2; stroke-dasharray: 3 6; }
.stage-svg .ln { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1s var(--ease-in-out), stroke .5s, opacity .5s; }
.ln-a { stroke: var(--acc); }
.ln-b { stroke: #e7e7e2; }
.ln-cf { stroke: var(--amber); }
.ln-cf2 { transition-delay: .45s; }
.ge-2 .ln-a, .ge-4 .ln-b, .at-5 .ln-cf { stroke-dashoffset: 0; }
.at-5 .ln-b { stroke: var(--amber); opacity: .3; }
.spk { opacity: 0; transition: opacity .4s; }
.ge-2 .spk-a, .ge-4 .spk-b, .at-5 .spk-cf { opacity: 1; }
.at-5 .spk-b { opacity: 0; }

.nd { opacity: .22; transition: opacity .6s var(--ease-out); }
.ge-1 .nd-px, .ge-2 .nd-tg, .ge-4 .nd-dc { opacity: 1; }
.nd .tile { fill: #19191c; stroke: rgba(255, 255, 255, .13); stroke-width: 1; }
.nd .tile.core { stroke: rgba(var(--acc-rgb), .55); }
.nd .tile.amber { stroke: rgba(255, 194, 77, .55); }
.nd .eb { font: 600 11px var(--mono); letter-spacing: .12em; fill: var(--text-3); }
.nd .eb.mono { letter-spacing: .02em; fill: var(--acc); }
.nd .nm { font: 700 15px var(--sans); fill: var(--text); }
.nd .nm.sm { font-size: 14px; }
.nd-cf { opacity: 0; transform: translateY(12px); transition: opacity .6s var(--ease-out), transform .7s var(--ease-out); }
.at-5 .nd-cf { opacity: 1; transform: none; }
.ripple { fill: none; stroke: var(--acc); stroke-width: 1.5; opacity: 0; transition: opacity .5s; }
.ripple.r2 { display: none; }
.at-1 .ripple { opacity: .4; }

.bdg { opacity: 0; transform: scale(.7); transform-box: fill-box; transform-origin: center; transition: opacity .35s, transform .55s var(--ease-out); }
.bdg-dc rect { fill: var(--acc); stroke: var(--acc); }
.bdg-dc text, .bdg-302 text { font: 700 13px var(--mono); }
.bdg-dc text { fill: var(--acc-ink); }
.bdg-lock circle { fill: #1a1f0d; stroke: rgba(var(--acc-rgb), .65); }
.bdg-lock .ic { fill: none; stroke: var(--green); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bdg-302 rect { fill: rgba(255, 194, 77, .15); stroke: rgba(255, 194, 77, .75); }
.bdg-302 text { fill: var(--amber); }
.ge-3 .bdg-dc, .at-4 .bdg-lock, .at-5 .bdg-302 { opacity: 1; transform: none; }

.sc {
  position: absolute; left: 5%; right: 5%; top: 65%; bottom: 4.5%; display: flex; flex-direction: column; gap: .4em;
  padding: 3cqw 3.6cqw; border-radius: 4cqw; overflow: hidden; pointer-events: none;
  font: 500 clamp(10px, 2.5cqw, 14px)/1.55 var(--mono); color: var(--text-2);
  background: rgba(12, 12, 14, .82); border: 1px solid var(--line-2);
  opacity: 0; translate: 0 14px;
  transition: opacity .45s var(--ease-out), translate .6s var(--ease-out);
}
.at-1 .sc-1, .at-2 .sc-2, .at-3 .sc-3, .at-4 .sc-4, .at-5 .sc-5 { opacity: 1; translate: none; filter: none; }
.sc-h { display: flex; align-items: center; gap: .6em; margin-bottom: .2em; font: 700 1.02em var(--sans); color: var(--text); }
.sc-h .i { color: var(--acc); }
.kv { display: flex; align-items: center; gap: 1em; white-space: nowrap; }
.kv > span { min-width: 6.4em; color: var(--text-3); }
.kv b { font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.kv b.cy { color: var(--acc); }
.kv b.dim { color: var(--text-3); letter-spacing: .08em; }
.kv b.ok { color: var(--green); }
.kv > .ok-dot { min-width: 0; width: .62em; height: .62em; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }
.kv > .arr { min-width: 1.4em; display: grid; place-items: center; }
.arr .i { width: 1.1em; height: 1.1em; color: var(--acc); }
.arr.in .i { transform: scaleX(-1); color: var(--green); }
.hex { display: grid; grid-template-columns: auto repeat(var(--n, 16), 1fr); gap: .18em .2em; font-size: .9em; }
.hex .off { padding-right: .6em; color: #46506a; }
.hex .b { text-align: center; color: #76819d; border-radius: .3em; }
.hex .b.tag { color: #fff; background: rgba(255, 255, 255, .14); }
.hex .b.dc { color: var(--acc-ink); background: var(--acc); font-weight: 700; }
.hex .more { grid-column: 1 / -1; color: #46506a; }
.hex-legend { display: flex; flex-wrap: wrap; gap: .3em 1.2em; margin-top: auto; font-size: .9em; }
.hex-legend span { display: inline-flex; align-items: center; gap: .5em; }
.hex-legend span::before { content: ""; width: .7em; height: .7em; border-radius: .2em; }
.lg-tag::before { background: rgba(255, 255, 255, .7); }
.lg-dc::before { background: var(--acc); }
.route { display: flex; align-items: center; justify-content: space-between; padding: .4em .8em; border-radius: .7em; background: rgba(255, 255, 255, .03); border: 1px solid var(--line); }
.st { font: 700 .88em var(--mono); font-style: normal; padding: .12em .6em; border-radius: .5em; color: var(--text-3); background: rgba(255, 255, 255, .05); }
.st-warn { color: var(--amber); background: rgba(255, 194, 77, .12); }
.st-ok { color: var(--green); background: rgba(var(--acc-rgb), .12); }
.stage-dots { position: absolute; left: 50%; top: 3.4%; translate: -50% 0; display: flex; gap: 6px; }
.stage-dots i { width: 6px; height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .16); transition: width .45s var(--ease-out), background-color .45s; }
.at-1 .stage-dots i:nth-child(1), .at-2 .stage-dots i:nth-child(2), .at-3 .stage-dots i:nth-child(3), .at-4 .stage-dots i:nth-child(4), .at-5 .stage-dots i:nth-child(5) { width: 22px; background: var(--acc); }

/* ---------- features bento ---------- */
.bento { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.bc {
  position: relative; display: flex; flex-direction: column; border-radius: 28px; overflow: hidden; isolation: isolate;
  background: var(--card);
  border: 1px solid var(--line); transition: border-color .4s;
}
.b-route { grid-column: span 4; grid-row: span 2; }
.b-tray, .b-fall, .b-port, .b-upd, .b-os { grid-column: span 2; }
.b-oss { grid-column: span 6; flex-direction: row; }
.bc-viz {
  position: relative; height: 196px; margin: 10px 10px 0; border-radius: 20px; overflow: hidden;
  display: grid; place-items: center; align-content: center; gap: 14px;
  background: rgba(0, 0, 0, .26); border: 1px solid var(--line);
}
.b-route .bc-viz { flex: 1; min-height: 320px; }
.bc-body { padding: 24px 28px 28px; }
.bc h3 { font: 600 20px/1.2 var(--display); letter-spacing: -.03em; margin-bottom: 10px; }
.b-route h3 { font-size: 28px; }
.bc p { margin: 0; color: var(--text-2); font-size: 15.5px; }

/* route */
.viz-route { background: rgba(0, 0, 0, .26); }
.route-row { display: flex; align-items: center; width: 86%; }
.rn { flex: none; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.rn .gi { width: 80px; height: 80px; padding: 16px; border-radius: 24px; background: #19191c; border: 1px solid var(--line-2); filter: none; box-shadow: 0 14px 30px -12px rgba(0, 0, 0, .8); }
.rn.core .gi { padding: 12px; border-color: rgba(var(--acc-rgb), .5); box-shadow: 0 0 0 6px rgba(var(--acc-rgb), .07); }
.rn span { font-size: 13px; font-weight: 700; color: var(--text-2); }
.rl { flex: 1; height: 2px; margin: 0 12px 31px; position: relative; overflow: hidden; border-radius: 2px; background: rgba(255, 255, 255, .1); }
.rl i { position: absolute; inset: 0 auto 0 0; width: 22%; border-radius: 2px; background: var(--acc); animation: travel 1.6s var(--ease-in-out) infinite; }
@keyframes travel { from { transform: translateX(-100%); } to { transform: translateX(460%); } }
.rn.core + .rl i { animation-delay: .8s; }
.ghost {
  position: absolute; top: 13%; left: 50%; translate: -50% 0; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 14px;
  font-size: 13px; font-weight: 700; white-space: nowrap; color: rgba(255, 107, 122, .9); background: rgba(255, 107, 122, .05); border: 1px dashed rgba(255, 107, 122, .45);
  animation: ghost 4s ease-in-out infinite;
}
.ghost .i { width: 16px; height: 16px; }
.ghost .strike { position: absolute; left: 8px; right: 8px; top: 50%; height: 2px; border-radius: 2px; background: var(--red); transform: rotate(-6deg); box-shadow: 0 0 10px rgba(255, 107, 122, .6); }
@keyframes ghost { 0%, 100% { translate: -50% 0; } 50% { translate: -50% -6px; } }
.route-note {
  position: absolute; bottom: 16px; left: 50%; translate: -50% 0; display: inline-flex; align-items: center; gap: 10px; white-space: nowrap;
  padding: 8px 14px 8px 8px; border-radius: 14px; font-size: 13.5px; color: var(--text-2);
  background: rgba(var(--acc-rgb), .06); border: 1px solid rgba(var(--acc-rgb), .22);
}
.route-note .gi { width: 26px; height: 26px; }
.route-note b { color: var(--green); font-family: var(--display); }

/* tray */
.viz-tray { background: radial-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px) 0 0 / 16px 16px, #17171a; }
.mt-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 40px; display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 0 14px; color: var(--text-2); background: rgba(12, 12, 14, .88); border-top: 1px solid var(--line-2); }
.mt-bar .i { width: 15px; height: 15px; }
.mt-ico { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; animation: icoClick 6s infinite; }
.mt-ico svg { width: 18px; height: 18px; }
.mt-time { font: 600 12px var(--mono); }
.mt-menu {
  position: absolute; right: 14px; bottom: 50px; width: 196px; padding: 6px; border-radius: 14px;
  background: rgba(24, 24, 27, .97); border: 1px solid var(--line-2); box-shadow: 0 20px 40px -12px rgba(0, 0, 0, .85);
  transform-origin: 80% 100%; animation: menuPop 6s var(--ease-out) infinite;
}
.mt-menu span { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 9px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.mt-menu span:first-child { animation: itemHl 6s infinite; }
.mt-menu .i { width: 14px; height: 14px; color: var(--text-2); }
.mt-cursor { position: absolute; right: 62px; bottom: 8px; width: 20px; height: 20px; fill: #fff; stroke: #0a0a0b; stroke-width: 1.4; stroke-linejoin: round; animation: cursorMove 6s var(--ease-in-out) infinite; }
@keyframes cursorMove {
  0%, 100% { transform: translate(-90px, -96px); }
  15%, 21% { transform: translate(0, 0); }
  18% { transform: translate(0, 0) scale(.84); }
  34%, 48%, 54% { transform: translate(-58px, -108px); }
  51% { transform: translate(-58px, -108px) scale(.84); }
  72% { transform: translate(-90px, -96px); }
}
@keyframes menuPop { 0%, 19% { opacity: 0; transform: translateY(6px) scale(.94); } 24%, 57% { opacity: 1; transform: none; } 63%, 100% { opacity: 0; transform: translateY(6px) scale(.96); } }
@keyframes itemHl { 0%, 47% { background-color: transparent; } 50%, 57% { background-color: rgba(255, 255, 255, .14); } 61%, 100% { background-color: transparent; } }
@keyframes icoClick { 0%, 16% { background-color: transparent; } 18%, 58% { background-color: rgba(255, 255, 255, .13); } 63%, 100% { background-color: transparent; } }

/* fallback lanes */
.viz-fall { display: flex; flex-direction: column; justify-content: center; align-items: stretch; gap: 12px; padding: 0 18px; }
.lane { display: grid; grid-template-columns: 78px 1fr 64px; align-items: center; gap: 12px; font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.lane .trk { position: relative; height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .06); container-type: inline-size; }
.lane .dot { position: absolute; top: 50%; left: 0; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; opacity: 0; }
.l1 .dot { background: var(--amber); box-shadow: 0 0 12px var(--amber); animation: d1 4.6s var(--ease-in-out) infinite; }
.l2 .dot { background: var(--green); box-shadow: 0 0 12px var(--green); animation: d2 4.6s var(--ease-in-out) infinite; }
.lane .st { justify-self: end; opacity: .3; }
.l1 .st { animation: s1 4.6s infinite; }
.l2 .st { animation: s2 4.6s infinite; }
@keyframes d1 { 0% { translate: 0 0; opacity: 0; } 5% { opacity: 1; } 26% { translate: 58cqw 0; opacity: 1; } 31% { translate: 50cqw 0; opacity: 1; } 38%, 100% { translate: 50cqw 0; opacity: 0; } }
@keyframes d2 { 0%, 34% { translate: 0 0; opacity: 0; } 38% { opacity: 1; } 68% { translate: 100cqw 0; opacity: 1; } 74%, 100% { translate: 100cqw 0; opacity: 0; } }
@keyframes s1 { 0%, 25% { opacity: .3; scale: 1; } 29% { opacity: 1; scale: 1.15; } 33%, 90% { opacity: 1; scale: 1; } 96%, 100% { opacity: .3; } }
@keyframes s2 { 0%, 66% { opacity: .3; scale: 1; } 70% { opacity: 1; scale: 1.15; } 74%, 90% { opacity: 1; scale: 1; } 96%, 100% { opacity: .3; } }

/* portable */
.viz-port .gi.big { width: 96px; height: 96px; animation: floaty 5s ease-in-out infinite; }
@keyframes floaty { 50% { transform: translateY(-8px) rotate(-3deg); } }
.fchips { display: flex; gap: 8px; }
.fchip { padding: 6px 10px; border-radius: 10px; font-size: 12px; white-space: nowrap; color: var(--text-2); background: rgba(255, 255, 255, .05); border: 1px solid var(--line-2); }
.fchip.flag { color: var(--acc); background: rgba(var(--acc-rgb), .08); border-color: rgba(var(--acc-rgb), .3); }

/* updates */
.upd-ring { position: relative; width: 96px; height: 96px; }
.upd-ring > svg:first-child { width: 100%; height: 100%; transform: rotate(-90deg); }
.upd-ring .rt { fill: none; stroke: rgba(255, 255, 255, .08); stroke-width: 6; }
.upd-ring .rp { fill: none; stroke: var(--acc); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: prog 4.6s var(--ease-in-out) infinite; }
.upd-ring .ck { position: absolute; left: 22px; top: 22px; width: 52px; height: 52px; opacity: 0; animation: ckPop 4.6s var(--ease-out) infinite; }
.viz-upd .fchip { animation: chipOk 4.6s infinite; }
@keyframes prog { 0% { stroke-dashoffset: 1; stroke: #e7e7e2; opacity: 1; } 50% { stroke-dashoffset: 0; stroke: #e7e7e2; } 56%, 90% { stroke-dashoffset: 0; stroke: var(--green); opacity: 1; } 100% { stroke-dashoffset: 0; stroke: var(--green); opacity: 0; } }
@keyframes ckPop { 0%, 50% { opacity: 0; scale: .5; } 58%, 90% { opacity: 1; scale: 1; } 100% { opacity: 0; scale: .9; } }
@keyframes chipOk { 0%, 52% { opacity: .3; } 60%, 92% { opacity: 1; color: var(--green); border-color: rgba(var(--acc-rgb), .35); } 100% { opacity: .3; } }

/* OS */
.viz-os { grid-template-columns: repeat(3, auto); gap: 12px; }
.os-t { width: 60px; height: 60px; border-radius: 19px; display: grid; place-items: center; background: #19191c; border: 1px solid var(--line-2); box-shadow: 0 14px 26px -12px rgba(0, 0, 0, .85), inset 0 1px 0 rgba(255, 255, 255, .06); animation: osBob 4s ease-in-out infinite; }
.os-t:nth-child(2) { animation-delay: -1s; }
.os-t:nth-child(3) { animation-delay: -2s; }
.os-t:nth-child(4) { animation-delay: -3s; }
.os-t .i { width: 26px; height: 26px; color: var(--text); }
@keyframes osBob { 50% { transform: translateY(-7px); } }

/* privacy card */
.oss-l { flex: 1.1; padding: 34px; }
.oss-l .gi { width: 54px; height: 54px; margin-bottom: 22px; }
.oss-l h3 { font-size: 26px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.tags span { padding: 6px 12px; border-radius: 99px; font-size: 13px; font-weight: 600; color: var(--text-2); background: rgba(255, 255, 255, .02); border: 1px solid var(--line-2); }
.oss-stats { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px; }
.stat { display: flex; flex-direction: column; gap: 4px; padding: 20px; border-radius: 20px; background: rgba(0, 0, 0, .26); border: 1px solid var(--line); transition: border-color .3s, background-color .3s, scale .16s var(--ease-out); }
.stat:active { scale: .98; }
.st-ic { width: 42px; height: 42px; margin-bottom: auto; display: grid; place-items: center; border-radius: 13px; color: var(--text-2); background: rgba(255, 255, 255, .05); border: 1px solid var(--line-2); }
.st-ic .gi { width: 26px; height: 26px; }
.st-ic .i { width: 20px; height: 20px; }
.stat b { margin-top: 18px; font: 600 30px/1.1 var(--display); letter-spacing: -.04em; }
.stat > span:last-child { font-size: 13px; font-weight: 600; color: var(--text-3); }

@media (hover: hover) and (pointer: fine) {
  .story-step:hover { opacity: .6; }
  .story-step.active:hover { opacity: 1; }
  .bc:hover { border-color: var(--line-2); }
  .stat:hover { border-color: var(--line-3); background: rgba(255, 255, 255, .04); }
}

@media (max-width: 1000px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .b-route, .b-os, .b-oss { grid-column: span 2; }
  .b-route { grid-row: auto; }
  .b-tray, .b-fall, .b-port, .b-upd { grid-column: span 1; }
  .b-oss { flex-direction: column; }
}
@media (max-width: 900px) {
  .story-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .story-stage-wrap { order: -1; position: sticky; top: 86px; z-index: 3; padding-bottom: 8px; }
  .story-stage { max-width: 460px; margin: 0 auto; border-radius: 26px; background: #111113; }
  .story-rail { display: none; }
  .story-step { min-height: 58vh; align-items: flex-start; padding-top: 18vh; }
  .story-step p { font-size: 16px; }
}
@media (max-width: 640px) {
  .bento { grid-template-columns: minmax(0, 1fr); }
  .b-route, .b-tray, .b-fall, .b-port, .b-upd, .b-os, .b-oss { grid-column: auto; }
  .b-route .bc-viz { min-height: 270px; }
  .rn .gi { width: 62px; height: 62px; padding: 12px; border-radius: 19px; }
  .rn.core .gi { padding: 9px; }
  .rl { margin: 0 6px 31px; }
  .route-note { width: max-content; max-width: calc(100% - 24px); white-space: normal; font-size: 12px; line-height: 1.35; }
  .bc-body { padding: 22px 22px 24px; }
  .b-route h3, .oss-l h3 { font-size: 23px; }
  .oss-l { padding: 26px 24px; }
  .stat { padding: 16px; }
  .stat b { font-size: 24px; }
  .st-num { width: 48px; height: 48px; border-radius: 15px; font-size: 14px; }
  .story-step { gap: 16px; }
}
