/* How it works: a calm product page. Colors come only from base.css tokens, so dark mode follows. */

html { scroll-behavior: smooth; }
main section[id] { scroll-margin-top: 64px; }
h1, h2, h3 { text-wrap: balance; }

.eyebrow { margin: 0 0 14px; color: var(--accent); font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.kicker { margin: 0 0 18px; color: var(--ink-3); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.ic { display: grid; place-items: center; flex: none; }
.ic.ok { background: var(--accent-soft); color: var(--accent); }
.ic.bad { background: var(--danger-soft); color: var(--danger); }
.ic.warn { background: var(--warn-soft); color: var(--warn); }
.ic.no { background: var(--field); color: var(--ink-3); }

/* Hero */
.hero { padding: clamp(64px, 9vw, 112px) 24px clamp(40px, 5vw, 64px); text-align: center; }
.hero h1 { margin: 0 auto; max-width: 1000px; font-size: clamp(40px, 7.4vw, 100px); line-height: 1.02; letter-spacing: -.05em; font-weight: 700; }
.hero h1 span { display: block; color: var(--ink-3); }
.lead { margin: 28px auto 0; max-width: 640px; font-size: clamp(17px, 1.7vw, 21px); line-height: 1.5; color: var(--ink-2); text-wrap: balance; }
.cta { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 40px; }
.cta .btn { padding: 16px 26px; font-size: 16px; }
.cta .btn.ghost { background: var(--surface); box-shadow: var(--shadow-chip); }
.cta .btn.ghost:hover { background: var(--surface); box-shadow: var(--shadow); transform: translateY(-1px); }

/* Sections */
.sec { padding: clamp(48px, 7vw, 88px) 0; }
.band { background: var(--surface); margin: clamp(48px, 7vw, 88px) 0; padding: clamp(80px, 10vw, 128px) 0; }
.head { max-width: 880px; margin: 0 auto clamp(40px, 5.5vw, 72px); text-align: center; }
.head h2 { margin: 0; font-size: clamp(32px, 5vw, 60px); line-height: 1.05; letter-spacing: -.04em; font-weight: 700; }
.head h2 span { display: block; color: var(--ink-3); }
.head > p:not(.eyebrow) { margin: 22px auto 0; max-width: 600px; font-size: clamp(16px, 1.4vw, 19px); line-height: 1.55; color: var(--ink-2); text-wrap: pretty; }
.head.left { margin: 0; text-align: left; }
.head.left > p:not(.eyebrow) { margin-left: 0; }

/* Flow: nodes light up in order; each connector fills on the way to the next node. */
.flow { padding: clamp(36px, 5vw, 64px) clamp(20px, 3.5vw, 44px); }
.steps { --g: 20px; --n: 64px; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--g); }
.step { --t: calc(var(--i) * 560ms); position: relative; text-align: center; }
.step:not(:last-child)::before, .step:not(:last-child)::after {
  content: ""; position: absolute; top: calc(var(--n) / 2 - 1px); left: calc(50% + var(--n) / 2 + 10px);
  width: calc(100% + var(--g) - var(--n) - 20px); height: 2px; border-radius: 2px; background: var(--line);
}
.step:not(:last-child)::after { background: var(--accent); transform-origin: left; }
.node {
  position: relative; z-index: 1; width: var(--n); height: var(--n); margin: 0 auto; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent-line);
}
.you .node { background: var(--primary); color: var(--on-primary); box-shadow: 0 8px 24px var(--primary-glow); }
.step h3 { margin: 22px 0 0; font-size: 20px; letter-spacing: -.025em; font-weight: 700; }
.by { display: inline-block; margin-top: 8px; padding: 3px 10px; border-radius: 999px; background: var(--field); color: var(--ink-2); font-size: 12px; font-weight: 600; white-space: nowrap; }
.you .by { background: var(--brand-soft); color: var(--brand); }
.step p { margin: 12px auto 0; max-width: 210px; color: var(--ink-2); font-size: 14.5px; line-height: 1.5; }

/* Armed by main.ts; .play runs the sequence. */
.flow[data-armed] .node { background: var(--surface-2); color: var(--ink-3); box-shadow: none; }
.flow[data-armed] .step-txt { opacity: .4; }
.flow[data-armed] .step:not(:last-child)::after { transform: scaleX(0); }
.flow[data-armed].play .node { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent-line); animation: nudge .7s var(--spring) var(--t) both; }
.flow[data-armed].play .you .node { background: var(--primary); color: var(--on-primary); box-shadow: 0 8px 24px var(--primary-glow); }
.flow[data-armed].play .step-txt { opacity: 1; }
.flow[data-armed].play .step:not(:last-child)::after { transform: none; }
.flow[data-armed].play .node { transition: background .5s var(--ease) var(--t), color .5s var(--ease) var(--t), box-shadow .5s var(--ease) var(--t); }
.flow[data-armed].play .step-txt { transition: opacity .6s var(--ease) var(--t); }
.flow[data-armed].play .step:not(:last-child)::after { transition: transform .46s cubic-bezier(.45, 0, .55, 1) calc(var(--t) + 100ms); }
@keyframes nudge { 0%, 100% { transform: none; } 45% { transform: scale(1.1); } }

/* x402 */
.x402 { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(40px, 6vw, 96px); align-items: center; }
.points { list-style: none; margin: 36px 0 0; padding: 0; display: grid; gap: 20px; }
.points li { display: grid; grid-template-columns: 38px 1fr; gap: 14px; align-items: start; }
.points .ic { width: 38px; height: 38px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.points b { display: block; font-size: 16px; font-weight: 600; letter-spacing: -.015em; }
.points div > span { display: block; margin-top: 2px; color: var(--ink-2); font-size: 14.5px; }

.seq { --lane: 72px; margin: 0; padding: clamp(24px, 3.4vw, 36px); }
.seq-top { display: flex; justify-content: space-between; }
.actor { width: calc(var(--lane) * 2); display: grid; justify-items: center; text-align: center; }
.actor .av { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink); margin-bottom: 10px; }
.actor b { font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.actor small { color: var(--ink-3); font-size: 12px; }
.seq-rows { position: relative; list-style: none; margin: 10px 0 0; padding: 14px 0 6px; display: grid; gap: 14px; }
/* Lifelines */
.seq-rows::before, .seq-rows::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: calc(var(--lane) - 1px); border-left: 2px dotted var(--ink-3); opacity: .45; transform-origin: top;
}
.seq-rows::after { left: auto; right: calc(var(--lane) - 1px); }
.msg { position: relative; z-index: 1; margin: 0 var(--lane); text-align: center; }
.lbl { display: inline-block; font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.lbl b { font: 600 12.5px var(--mono); padding: 2px 7px; border-radius: 999px; margin-right: 2px; }
.code402 { background: var(--brand-soft); color: var(--brand); }
.code200 { background: var(--accent-soft); color: var(--accent); }
.ln { position: relative; display: block; height: 2px; margin: 8px 0 0; border-radius: 2px; background: var(--ink-2); transform-origin: left; }
.ln::after {
  content: ""; position: absolute; top: 50%; right: -1px; width: 8px; height: 8px;
  border-top: 2px solid var(--ink-2); border-right: 2px solid var(--ink-2); transform: translateY(-50%) rotate(45deg);
}
.l .ln { transform-origin: right; }
.l .ln::after { right: auto; left: -1px; transform: translateY(-50%) rotate(-135deg); }
.ok .ln { background: var(--accent); }
.ok .ln::after { border-color: var(--accent); }
.sub { display: block; margin-top: 7px; color: var(--ink-3); font-size: 12.5px; }
code.sub { font-family: var(--mono); font-size: 12px; }
.self { display: flex; align-items: center; gap: 12px; width: fit-content; max-width: calc(100% - var(--lane) + 20px); margin: 4px 0 4px calc(var(--lane) - 20px); text-align: left; }
.self.api { flex-direction: row-reverse; text-align: right; margin: 4px calc(var(--lane) - 20px) 4px auto; }
.self .dot { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface); color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent-line); }
.self:not(.api) .dot { color: var(--brand); box-shadow: inset 0 0 0 1.5px var(--brand-line); }
.self .txt { background: var(--surface-2); border-radius: 16px; padding: 10px 14px; }
.self .txt b { display: block; font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.self .txt span { display: block; color: var(--ink-2); font-size: 12.5px; }
.seq-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 13px; }
.replay {
  display: inline-flex; align-items: center; gap: 6px; flex: none; border: 0; border-radius: 999px; padding: 7px 14px;
  background: var(--field); color: var(--ink); font-size: 13px; font-weight: 600; cursor: pointer; transition: background .2s, transform .2s var(--ease);
}
.replay:hover { background: var(--field-hover); }
.replay:active { transform: scale(.96); }
.replay svg { transition: transform .5s var(--ease); }
.replay:hover svg { transform: rotate(-60deg); }

.seq[data-armed] .msg { opacity: 0; transform: translateY(8px); }
.seq[data-armed] .ln { transform: scaleX(0); }
.seq[data-armed] .seq-rows::before, .seq[data-armed] .seq-rows::after { transform: scaleY(0); }
.seq[data-armed].play .msg { opacity: 1; transform: none; transition: opacity .5s var(--ease), transform .5s var(--ease); transition-delay: calc(var(--i) * 620ms + 300ms); }
.seq[data-armed].play .ln { transform: none; transition: transform .55s var(--ease) calc(var(--i) * 620ms + 420ms); }
.seq[data-armed].play .seq-rows::before, .seq[data-armed].play .seq-rows::after { transform: none; transition: transform 1s var(--ease); }
.seq.reset *, .seq.reset *::before, .seq.reset *::after { transition: none !important; }

/* Trust boundary */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.tile { background: var(--surface-2); border-radius: var(--r-xl); padding: clamp(26px, 3vw, 36px); }
.tile-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tile .ic { width: 48px; height: 48px; border-radius: 16px; background: var(--surface); color: var(--accent); box-shadow: var(--shadow-chip); }
.tile h3 { margin: 30px 0 0; font-size: clamp(24px, 2.4vw, 30px); line-height: 1.1; letter-spacing: -.035em; font-weight: 700; }
.tile p { margin: 12px 0 0; color: var(--ink-2); font-size: 15.5px; line-height: 1.55; }

.rules { margin-top: clamp(56px, 7vw, 88px); text-align: center; }
.nums { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.nums li { padding: 6px 12px; display: grid; gap: 6px; align-content: start; }
.nums li + li { border-left: 1px solid var(--line); }
.nums b { font-size: clamp(30px, 3.4vw, 44px); line-height: 1; font-weight: 700; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.nums small, .proof-stats small { margin-left: 5px; font-size: .38em; font-weight: 600; letter-spacing: -.01em; color: var(--ink-3); }
.nums span { color: var(--ink-2); font-size: 13.5px; }
.rules .fine { margin-top: 24px; }

/* Safety */
.safety { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 20px; }
.safe { grid-column: span 2; display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r-xl); padding: 28px; box-shadow: var(--shadow); }
.safe.wide { grid-column: span 3; }
.safe-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.safe .ic { width: 42px; height: 42px; border-radius: 14px; }
.safe h3 { margin: 24px 0 0; font-size: 19px; letter-spacing: -.02em; font-weight: 700; }
.safe p { margin: 8px 0 0; color: var(--ink-2); font-size: 15px; line-height: 1.55; }
.demo { margin-top: auto; padding-top: 22px; }
.demo > * { background: var(--surface-2); }
.inject { display: grid; gap: 10px; }
.quote { justify-self: start; border-radius: 14px; padding: 10px 14px; color: var(--ink-3); font: 12.5px/1.5 var(--mono); }
/* Strike drawn as a background so it follows each wrapped line. */
.quote s {
  text-decoration: none; background: linear-gradient(var(--danger), var(--danger)) no-repeat 0 55% / 0 1.5px;
  transition: background-size .9s var(--ease) .5s;
}
.in .quote s { background-size: 100% 1.5px; }
.fields { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; border-radius: 14px; padding: 10px; }
.fields em { font-style: normal; color: var(--ink-3); font-size: 12px; font-weight: 600; margin: 0 4px; }
.fields i { font: normal 500 12px var(--mono); padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.swap > div { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border-radius: 14px; padding: 10px; }
.swap > div > * { background: none; }
.acct { padding: 9px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.acct:first-child { background: var(--danger-soft); color: var(--danger); }
.acct:last-child { background: var(--accent-soft); color: var(--accent); }
.neq { color: var(--danger); font-size: 22px; font-weight: 600; line-height: 1; }

/* Proof */
.proof { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); padding: clamp(28px, 4.4vw, 56px); }
.proof-main { align-self: center; }
.proof-status { display: flex; align-items: center; gap: 14px; }
.proof-status b { display: block; font-size: 17px; letter-spacing: -.015em; }
.proof-status span { color: var(--ink-2); font-size: 14px; }
.tick { width: 52px; height: 52px; flex: none; }
.tick circle { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 2.5; stroke-dasharray: 151; stroke-dashoffset: 151; }
.tick path { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 36; stroke-dashoffset: 36; }
.proof.in .tick circle { animation: draw .8s var(--ease) .3s forwards; }
.proof.in .tick path { animation: draw .5s var(--ease) .9s forwards; }
.proof-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin: 36px 0 32px; }
.proof-stats b { display: block; font-size: clamp(48px, 6vw, 76px); line-height: 1; font-weight: 700; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.proof-stats > div > span { display: block; margin-top: 10px; color: var(--ink-2); font-size: 14.5px; }
.tx {
  display: inline-flex; align-items: center; gap: 10px; max-width: 100%; padding: 10px 16px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-size: 14px; font-weight: 600; transition: background .2s, transform .25s var(--ease);
}
.tx:hover { background: var(--accent-line); transform: translateY(-1px); }
.tx .mono { font-weight: 500; }
.tx svg { transition: transform .25s var(--ease); }
.tx:hover svg { transform: translate(2px, -2px); }
.facts { margin: 0; align-self: center; }
.facts div { display: flex; justify-content: space-between; gap: 16px; padding: 15px 0; border-top: 1px solid var(--line); font-size: 15px; }
.facts div:last-child { border-bottom: 1px solid var(--line); }
.facts dt { color: var(--ink-2); flex: none; }
.facts dd { margin: 0; text-align: right; font-weight: 500; }
.facts .num { font-variant-numeric: tabular-nums; }

/* Real vs simulated */
.truth { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0; }
.truth-col { padding: clamp(28px, 4vw, 48px); }
.truth-col + .truth-col { border-left: 1px solid var(--line); }
.truth h3 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -.02em; }
.truth h3:not(:first-child) { margin-top: 34px; }
.truth .ic { width: 26px; height: 26px; border-radius: 50%; }
.truth ul { list-style: none; margin: 14px 0 0; padding: 0; }
.truth li { padding: 11px 0 11px 36px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 15px; }
.truth li:first-child { border-top: 0; }

/* Built with */
.stack-sec { text-align: center; padding-top: 0; }
.stack { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.stack li { padding: 11px 20px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-chip); font-size: 15px; font-weight: 500; }

/* Closing */
.closer { text-align: center; background: var(--surface); border-radius: 36px; padding: clamp(48px, 8vw, 104px) clamp(20px, 5vw, 64px); box-shadow: var(--shadow); }
.mark.xl { width: 64px; height: 64px; border-radius: 24%; margin: 0 auto 32px; font-size: 30px; }
.closer h2 { margin: 0 auto; max-width: 820px; font-size: clamp(32px, 5vw, 60px); line-height: 1.05; letter-spacing: -.04em; font-weight: 700; }
.closer h2 span { display: block; color: var(--ink-3); }
.closer-lead { margin: 22px auto 0; max-width: 560px; color: var(--ink-2); font-size: clamp(16px, 1.4vw, 19px); line-height: 1.55; }
.team { list-style: none; margin: 40px 0 0; padding: 0; display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.team li { display: flex; align-items: center; gap: 12px; padding: 10px 22px 10px 10px; border-radius: 999px; background: var(--surface-2); text-align: left; }
.team .av { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-size: 14px; font-weight: 700; }
.team b { display: block; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.team span:not(.av) { color: var(--ink-2); font-size: 13px; }
.closer .cta { margin-top: 36px; }
.closer .fine { margin-top: 22px; }

footer { padding-top: 24px; }

@media (max-width: 980px) {
  .x402 { grid-template-columns: 1fr; }
  .head.left { max-width: 640px; }
  .tiles { grid-template-columns: 1fr; }
  .nums { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 28px; }
  .nums li:nth-child(4) { border-left: 0; }
  .safety { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .safe, .safe.wide { grid-column: span 1; }
  .safe.wide { grid-column: span 2; }
  .safe:last-child { grid-column: span 2; }
  .proof { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .steps { --n: 52px; grid-template-columns: 1fr; gap: 0; }
  .step { display: grid; grid-template-columns: var(--n) 1fr; gap: 18px; text-align: left; padding-bottom: 30px; }
  .step:last-child { padding-bottom: 0; }
  .step:not(:last-child)::before, .step:not(:last-child)::after { top: calc(var(--n) + 8px); bottom: 8px; left: calc(var(--n) / 2 - 1px); width: 2px; height: auto; }
  .step:not(:last-child)::after { transform-origin: top; }
  .flow[data-armed] .step:not(:last-child)::after { transform: scaleY(0); }
  .node { margin: 0; }
  .step-txt { padding-top: 4px; }
  .step h3 { display: inline; margin: 0; font-size: 18px; }
  .by { margin: 0 0 0 8px; vertical-align: 2px; }
  .step p { margin: 6px 0 0; max-width: none; }
}
@media (max-width: 640px) {
  .truth { grid-template-columns: 1fr; }
  .truth-col + .truth-col { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 560px) {
  .hero { padding-left: 16px; padding-right: 16px; }
  .cta .btn { flex: 1 1 100%; }
  .seq { --lane: 52px; }
  .actor .av { width: 42px; height: 42px; border-radius: 14px; }
  .lbl { font-size: 13px; }
  .self .txt { padding: 9px 12px; }
  .safety { grid-template-columns: 1fr; }
  .safe, .safe.wide, .safe:last-child { grid-column: auto; padding: 22px; border-radius: 24px; }
  .nums { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nums li:nth-child(4) { border-left: 1px solid var(--line); }
  .nums li:nth-child(odd) { border-left: 0; }
  .proof-stats { gap: 16px; }
  .tx > span:not(.mono) { display: none; }
  .swap > div { gap: 8px; }
  .acct { padding: 8px 11px; font-size: 12.5px; }
  .closer { border-radius: 28px; }
  .team li { width: 100%; max-width: 320px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .flow *, .flow *::before, .flow *::after, .seq *, .seq *::before, .seq *::after { transition-delay: 0s !important; animation-delay: 0s !important; }
}
