/* Features page. Everything animates only under .viz.play; base state is the finished state. */
.hero-f { padding-bottom: clamp(40px, 6vw, 72px); overflow: hidden; }
.hero-f h1 { max-width: 16ch; margin-inline: auto; }
.jump { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 32px; }
.jump .chip { font-size: .88rem; padding: 8px 15px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); transition: transform .2s var(--ease), border-color .2s; }
.jump .chip:hover { transform: translateY(-2px); border-color: var(--brand); }
.feat { scroll-margin-top: 70px; }
.feat-row { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.feat.flip .copy { order: 2; } .feat.flip .viz { order: 1; }
.feat h2 { max-width: 18ch; }
.ticks { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 12px; }
.ticks li { position: relative; padding-left: 30px; color: var(--ink-2); }
.ticks li::before { content: ""; position: absolute; left: 0; top: .35em; width: 18px; height: 18px; border-radius: 50%; background: var(--grad); }
.ticks li::after { content: ""; position: absolute; left: 6px; top: calc(.35em + 4px); width: 5px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
@media (max-width: 880px) { .feat-row { grid-template-columns: 1fr; } .feat.flip .copy, .feat.flip .viz { order: initial; } .feat h2 { max-width: none; } }

.viz { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); min-width: 0; }
.viz-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 16px; font-size: .95rem; }
.badge { display: inline-block; font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.badge.ok { background: color-mix(in srgb, var(--good) 15%, transparent); color: var(--good); }
.badge.warn { background: color-mix(in srgb, var(--accent) 20%, transparent); color: #92400e; }
.badge.bad { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.badge.info { background: color-mix(in srgb, var(--violet) 15%, transparent); color: var(--violet); }
:root[data-theme="dark"] .badge.warn { color: #fbbf24; } :root[data-theme="dark"] .badge.ok { color: #4ade80; } :root[data-theme="dark"] .badge.bad { color: #f87171; } :root[data-theme="dark"] .badge.info { color: #a5b4fc; }
.mini { display: inline-block; font-size: .78rem; font-weight: 650; padding: 4px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-2); color: var(--ink); }
.hint { font-size: .82rem; margin: 6px 0 0; }

/* hours */
.legend { display: flex; gap: 16px; font-size: .78rem; color: var(--ink-3); margin-bottom: 10px; }
.k { display: inline-block; width: 12px; height: 8px; border-radius: 3px; margin-right: 6px; } .k.r { border: 2px solid var(--ink-3); height: 10px; background: transparent; } .k.c { background: var(--brand); }
.shift { display: grid; grid-template-columns: 62px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); font-size: .85rem; }
.who { color: var(--ink); font-weight: 600; }
.track { position: relative; height: 24px; background: var(--bg-2); border-radius: 6px; }
.bar { position: absolute; height: 9px; border-radius: 4px; transform-origin: left; }
.bar.r { top: 2px; border: 2px solid var(--ink-3); height: 9px; box-sizing: border-box; background: transparent; }
.bar.c { bottom: 3px; background: var(--brand); }
.shift .badge { min-width: 86px; text-align: center; font-size: .68rem; }
@media (max-width: 440px) { .shift { grid-template-columns: 52px 1fr; } .shift .badge { grid-column: 2; justify-self: start; } }
.play .shift .bar { animation: scaleX .8s var(--ease) both; animation-delay: calc(var(--d) * .35s); }
.play .shift .bar.c { animation-delay: calc(var(--d) * .35s + .3s); }
.play .shift .badge { animation: pop .5s cubic-bezier(.3,1.6,.5,1) both; animation-delay: calc(var(--d) * .35s + 1s); }
@keyframes scaleX { from { transform: scaleX(0); } }
@keyframes pop { from { opacity: 0; transform: scale(.4); } }

/* explain */
.paper { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; font-size: .9rem; position: relative; }
.paper p { margin: 0 0 8px; color: var(--ink-2); } .paper b { color: var(--ink); } .paper .money { color: var(--bad); }
.caret { display: inline-block; width: 2px; height: 1em; background: var(--brand); vertical-align: -2px; }
.actions { display: flex; gap: 8px; margin-top: 14px; }
.play .ln { animation: lineIn .6s var(--ease) both; animation-delay: calc(var(--n) * .9s + .2s); }
.play .caret { animation: blink 1s steps(2) infinite; }
@keyframes lineIn { from { opacity: 0; transform: translateY(6px); clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes blink { 50% { opacity: 0; } }

/* location */
.map { width: 100%; height: auto; border-radius: 12px; }
.m-bg { fill: var(--bg-2); } .m-road { fill: none; stroke: var(--line); stroke-width: 9; stroke-linecap: round; } .m-road.thin { stroke-width: 4; }
.m-rad { fill: color-mix(in srgb, var(--brand) 14%, transparent); stroke: var(--brand); stroke-width: 2; stroke-dasharray: 6 5; }
.m-site { fill: var(--brand); } .m-lbl { fill: var(--ink-2); font-size: 12px; font-weight: 700; }
.dot circle { fill: var(--violet); stroke: #fff; stroke-width: 2; }
.dot.stray circle { fill: var(--bad); }
.dot { transform: translate(var(--x), var(--y)); }
.dot.d1 { --x: 180px; --y: 112px; --sx: 60px; --sy: 40px; } .dot.d2 { --x: 222px; --y: 120px; --sx: 340px; --sy: 210px; }
.dot.d3 { --x: 196px; --y: 154px; --sx: 90px; --sy: 230px; } .dot.d4 { --x: 232px; --y: 146px; --sx: 330px; --sy: 30px; }
.dot.stray { --x: 330px; --y: 70px; --sx: 330px; --sy: 70px; }
.play .dot { animation: snap 1.6s var(--ease) both; }
.play .d2 { animation-delay: .25s; } .play .d3 { animation-delay: .5s; } .play .d4 { animation-delay: .75s; }
.play .stray { animation: stray 2.4s ease-in-out infinite alternate both; }
.play .m-rad { animation: pulseR 3s ease-in-out infinite; }
@keyframes snap { from { transform: translate(var(--sx), var(--sy)); } to { transform: translate(var(--x), var(--y)); } }
@keyframes stray { from { transform: translate(300px, 52px); } to { transform: translate(var(--x), var(--y)); } }
@keyframes pulseR { 50% { fill: color-mix(in srgb, var(--brand) 24%, transparent); } }
.flags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.play .flags .pop { animation: pop .5s cubic-bezier(.3,1.6,.5,1) 1.8s both; }

/* bank */
.field { margin-bottom: 14px; } .field label { font-size: .78rem; font-weight: 650; color: var(--ink-3); display: block; margin-bottom: 4px; }
.input { position: relative; display: flex; align-items: center; justify-content: space-between; border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 14px; background: var(--bg); font-variant-numeric: tabular-nums; height: 44px; }
.input .v { color: var(--ink); letter-spacing: .06em; }
.st { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-style: normal; font-weight: 800; color: #fff; }
.st.t { background: var(--good); } .st.x { background: var(--bad); }
.bsb .fix-v, .bsb .t, .h-fix { display: none; }
.input:has(.bad-v) { border-color: var(--bad); }
.hint.h-bad, .hint.h-dup { color: var(--bad); } .hint.ok-h, .hint.restored { color: var(--good); } .hint.h-fix { color: var(--ink-2); }
.field.dup .input { border-color: var(--bad); }
/* finished state shows the fix applied; animation plays bad -> fix */
.bsb .bad-v, .bsb .x, .h-bad { display: none; } .bsb .fix-v, .bsb .t, .h-fix { display: initial; } .bsb .st.t { display: grid; } .bsb .st.x { display: none; }
.input:has(.fix-v) { border-color: var(--good); }
.bank-anim { }
.play .bsb { animation: errPhase 6s infinite; }
.play .bsb .bad-v { display: initial; animation: showBad 6s infinite; }
.play .bsb .fix-v { animation: showFix 6s infinite; }
.play .bsb .st.x { display: grid; animation: showBad 6s infinite; position: absolute; right: 14px; }
.play .bsb .st.t { animation: showFix 6s infinite; position: absolute; right: 14px; }
.play .h-bad { display: block; animation: showBad 6s infinite; } .play .h-fix { display: block; animation: showFix 6s infinite; }
.play .sug { animation: pulseBtn 6s infinite; }
@keyframes showBad { 0%, 40% { opacity: 1; } 44%, 100% { opacity: 0; } }
@keyframes showFix { 0%, 40% { opacity: 0; } 46%, 94% { opacity: 1; } 100% { opacity: 0; } }
@keyframes errPhase { 0%, 40% { border-color: var(--bad); } 46%, 94% { border-color: var(--good); } }
@keyframes pulseBtn { 30%, 40% { background: var(--brand); color: #fff; } }
.play .bsb .bad-v, .play .h-bad { position: relative; }
.play .bsb .fix-v { position: absolute; left: 14px; }
.play .h-fix { margin-top: -1.3em; }
.play .h-bad { height: 1.3em; }
.play .field.dup { animation: shake .6s 1.2s both; }
@keyframes shake { 20% { transform: translateX(-4px); } 40% { transform: translateX(4px); } 60% { transform: translateX(-3px); } }

/* groups */
.total { text-align: center; padding: 18px; border-radius: 14px; background: var(--grad); color: #fff; margin-bottom: 14px; }
.total .amt { display: block; font-size: clamp(2rem, 6vw, 2.8rem); font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.total small { opacity: .9; }
.parts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 480px) { .parts { grid-template-columns: 1fr; } }
.part { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--bg); display: grid; gap: 2px; }
.part b { font-size: .8rem; color: var(--ink-2); } .part .amt { font-size: 1.15rem; font-weight: 750; color: var(--ink); font-variant-numeric: tabular-nums; } .part small { font-size: .74rem; color: var(--ink-3); }
.lk { font-style: normal; }
.play .part { animation: rise2 .6s var(--ease) both; } .play .part:nth-child(2) { animation-delay: .2s; } .play .part:nth-child(3) { animation-delay: .4s; }
.play .part.lock { animation-name: rise2, lockPulse; animation-duration: .6s, 3s; animation-iteration-count: 1, infinite; animation-delay: .4s, 2s; }
@keyframes rise2 { from { opacity: 0; transform: translateY(14px); } }
@keyframes lockPulse { 50% { border-color: var(--brand); } }

/* audit */
.log { list-style: none; margin: 0; padding: 0; }
.log li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: .86rem; color: var(--ink); }
.log em { color: var(--ink-3); font-style: normal; white-space: nowrap; font-size: .78rem; }
.play .log li { animation: slideIn .6s var(--ease) both; animation-delay: calc(var(--n) * .6s); }
@keyframes slideIn { from { opacity: 0; transform: translateX(30px); } }
.bin { margin-top: 14px; background: var(--bg-2); border-radius: 12px; padding: 14px; font-size: .85rem; }
.binrow { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; } .binrow small { color: var(--ink-3); margin-right: auto; }
.play .restore { animation: pulseBtn2 4s 2.8s infinite; }
@keyframes pulseBtn2 { 0%, 40% { background: var(--bg-2); } 45%, 100% { background: var(--brand); color: #fff; } }
.play .restored { animation: showFix 4s 2.8s infinite; } .hint.restored { margin-top: 8px; }

/* security */
.meter { height: 6px; border-radius: 4px; background: var(--bg-2); margin-top: 8px; overflow: hidden; } .meter i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--bad), var(--accent), var(--good)); transform-origin: left; }
.play .meter i { animation: scaleX 1.4s var(--ease) both; }
.code { display: flex; gap: 8px; } .code b { flex: 1; max-width: 52px; height: 52px; border: 1.5px solid var(--line); border-radius: 10px; display: grid; place-items: center; font-size: 1.3rem; color: var(--ink); background: var(--bg); }
.play .code b { animation: digit .4s var(--ease) both; animation-delay: calc(var(--n) * .3s + 1.2s); }
@keyframes digit { from { opacity: 0; transform: scale(.6); border-color: var(--brand); } }
.trust { margin-top: 6px; } .trusted { font-size: .78rem; padding: 6px 12px; white-space: normal; }
.play .trusted { animation: pop .6s cubic-bezier(.3,1.6,.5,1) 3.2s both; }

/* more + cta */
.more { margin-top: 40px; } .more .card { padding: 22px; } .more h3 { font-size: 1.05rem; } .more p { margin: 0; font-size: .92rem; }
@media (max-width: 980px) { .more.g4 { grid-template-columns: repeat(2, 1fr); } } @media (max-width: 520px) { .more.g4 { grid-template-columns: 1fr; } }
.cta { text-align: center; } .cta .btn { margin: 6px; }

@media (prefers-reduced-motion: reduce) {
  .play * { animation: none !important; }
  .play .bsb .bad-v, .play .bsb .st.x, .play .h-bad { display: none !important; }
  .play .h-fix { margin-top: 6px; }
}
