:root {
  /* Foundations from the reference guide */
  --surface-base: #0b0b0c; --surface-raised: #141416; --surface-muted: #1e1e21;
  --text-primary: #ecebe8; --text-secondary: #9d9ca1; --text-tertiary: #8e8d93; --line: rgba(255,255,255,.07); --line-strong: rgba(255,255,255,.14);
  --invert-bg: #ecebe8; --invert-fg: #0b0b0c;
  --accent: #d6c3a1;
  --paid: #8fc9a6; --wait: #dcb36e; --stop: #e07b74;
  --paid-text: #8fc9a6; --wait-text: #dcb36e; --stop-text: #e07b74; --accent-text: #d6c3a1;
  --shadow-1: rgba(0,0,0,.3) 15px 15px 50px 0px;
  --fs-xs: 13px; --fs-sm: 16px; --fs-md: 17px; --fs-lg: 19px; --fs-xl: 20px; --fs-2xl: 24px; --fs-3xl: 26px; --fs-4xl: 38.4px;
  --s1: 3px; --s2: 5px; --s3: 8px; --s4: 10px; --s5: 20px; --s6: 30px; --s7: 35px; --s8: 40px;
  --t-instant: 200ms; --t-fast: 250ms; --t-normal: 500ms; --ease: cubic-bezier(.2,.8,.2,1);
  --radius: 18px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --surface-base: #ffffff; --surface-raised: #f4f4f6; --surface-muted: #e9e9ee;
  --text-primary: #212529; --text-secondary: #55595f; --text-tertiary: #686c73; --line: rgba(0,0,0,.08); --line-strong: rgba(0,0,0,.16);
  --invert-bg: #000000; --invert-fg: #ffffff;
  --paid: #12865a; --wait: #b86e00; --stop: #d42f3a; --accent: #8a6d3b;
  --paid-text: #0c6e49; --wait-text: #8a5200; --stop-text: #b3212c; --accent-text: #75592c;
  --shadow-1: rgba(0,0,0,.08) 15px 15px 50px 0px;
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --surface-base: #ffffff; --surface-raised: #f4f4f6; --surface-muted: #e9e9ee;
    --text-primary: #212529; --text-secondary: #55595f; --text-tertiary: #686c73; --line: rgba(0,0,0,.08); --line-strong: rgba(0,0,0,.16);
    --invert-bg: #000000; --invert-fg: #ffffff;
    --paid: #12865a; --wait: #b86e00; --stop: #d42f3a; --accent: #8a6d3b;
    --paid-text: #0c6e49; --wait-text: #8a5200; --stop-text: #b3212c; --accent-text: #75592c;
    --shadow-1: rgba(0,0,0,.08) 15px 15px 50px 0px;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
               background: radial-gradient(1100px 600px at 75% -10%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 70%); }
body { margin: 0; background: var(--surface-base); color: var(--text-primary); font: 400 var(--fs-sm)/24px "Poppins", sans-serif;
       -webkit-font-smoothing: antialiased; transition: background-color var(--t-normal), color var(--t-normal); overflow-x: hidden; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 var(--s8); }
button { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--text-primary); outline-offset: 3px; border-radius: 8px; }
.eyebrow { font-size: var(--fs-xs); font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--text-secondary); }
.num { font-variant-numeric: tabular-nums; }

/* Nav */
header { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--surface-base) 82%, transparent);
         backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); }
header .wrap { display: flex; align-items: center; gap: var(--s6); height: 80px; }
.logo { font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -.03em; text-decoration: none; }
.logo span { color: var(--accent); }
.nav-links { display: flex; gap: var(--s6); }
.nav-links a { text-decoration: none; font-size: var(--fs-sm); font-weight: 500; color: var(--text-secondary); transition: color var(--t-instant); padding: var(--s3) 0; }
.nav-links a:hover { color: var(--text-primary); }
.grow { flex: 1; }
.ghost { border: 1px solid var(--line-strong); background: transparent; border-radius: 99px; padding: var(--s3) 18px; cursor: pointer; font-size: var(--fs-xs); font-weight: 500;
         color: var(--text-secondary); min-height: 40px; transition: color var(--t-instant), border-color var(--t-instant); }
.ghost:hover { color: var(--text-primary); border-color: var(--text-primary); }
.kill { display: inline-flex; align-items: center; gap: var(--s4); background: var(--surface-raised); border: 1px solid var(--line); border-radius: 99px;
        padding: var(--s2) 18px var(--s2) var(--s2); cursor: pointer; font-size: var(--fs-xs); font-weight: 600; min-height: 40px; transition: all var(--t-fast); }
.kill:hover { border-color: var(--text-primary); }
.kill .sw { width: 40px; height: 28px; border-radius: 99px; background: var(--surface-muted); position: relative; transition: background var(--t-fast); }
.kill .sw::after { content: ""; position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border-radius: 50%; background: var(--text-primary);
                   transition: transform var(--t-normal) cubic-bezier(.5,1.6,.4,1); }
.kill[aria-checked="true"] { color: var(--stop); border-color: var(--stop); }
.kill[aria-checked="true"] .sw { background: var(--stop); }
.kill[aria-checked="true"] .sw::after { transform: translateX(12px); background: #fff; }

.freeze-bar { background: var(--stop); color: #fff; text-align: center; font-size: var(--fs-xs); font-weight: 600; letter-spacing: .04em;
              max-height: 0; overflow: hidden; transition: max-height var(--t-normal) var(--ease); }
body.frozen .freeze-bar { max-height: 44px; padding: var(--s4); }

/* Hero */
.hero { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; padding: 90px 0 70px; }
h1 { font-size: clamp(40px, 4.3vw, 66px); line-height: 1.02; letter-spacing: -.045em; font-weight: 700; margin: var(--s5) 0 var(--s6); }
h1 em { font-style: normal; font-weight: 300; color: var(--text-secondary); }
.lede { font-size: var(--fs-md); line-height: 30px; color: var(--text-secondary); max-width: 500px; margin: 0 0 var(--s8); }
.ctas { display: flex; gap: var(--s4); flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s4); min-height: 56px; padding: 0 var(--s6); border-radius: 99px;
       font-size: var(--fs-sm); font-weight: 600; cursor: pointer; text-decoration: none; border: 1px solid var(--line-strong); background: transparent;
       transition: transform var(--t-fast) var(--ease), background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast); }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn.solid { background: var(--invert-bg); color: var(--invert-fg); border-color: var(--invert-bg); }
.btn.solid:hover { box-shadow: var(--shadow-1); }
.btn.go { background: var(--accent); border-color: var(--accent); color: #17130c; }
.btn.sm { min-height: 44px; padding: 0 var(--s5); font-size: var(--fs-xs); }
.btn:disabled { opacity: .5; cursor: progress; transform: none; }
.btn .arr { transition: transform var(--t-fast); } .btn:hover .arr { transform: translateX(4px); }

/* Glossy 3D agent card */
.card-stage { perspective: 1400px; display: grid; place-items: center; padding: var(--s8) 0; }
.agent-card { position: relative; width: min(520px, 100%); aspect-ratio: 1.586; border-radius: 26px; transform-style: preserve-3d;
              transform: rotateX(var(--rx, 8deg)) rotateY(var(--ry, -16deg)); transition: transform var(--t-normal) var(--ease), box-shadow var(--t-normal);
              background:
                radial-gradient(120% 140% at 0% 0%, #3a3b42 0%, #17171b 45%, #050506 100%);
              box-shadow: 0 50px 80px -30px rgba(0,0,0,.8), 0 0 0 1px rgba(214,195,161,.22) inset, 0 1px 0 rgba(255,255,255,.3) inset, 0 0 90px -30px rgba(214,195,161,.25);
              color: #f4f4f6; animation: float 6s ease-in-out infinite; }
@keyframes float { 50% { translate: 0 -12px; } }
.agent-card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
                      background: repeating-linear-gradient(115deg, rgba(255,255,255,.025) 0 2px, transparent 2px 5px); }
.agent-card .sheen { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; mix-blend-mode: screen;
                     background: radial-gradient(500px 260px at var(--gx, 20%) var(--gy, 0%), rgba(255,255,255,.28), transparent 55%),
                                 linear-gradient(115deg, transparent 30%, rgba(255,255,255,.10) 45%, transparent 60%); }
.agent-card .glow { position: absolute; inset: -2px; border-radius: 28px; pointer-events: none; opacity: 0; transition: opacity var(--t-normal);
                    box-shadow: 0 0 0 2px var(--g), 0 0 60px -6px var(--g); }
.agent-card.react .glow { opacity: 1; }
.agent-card.shake { animation: shake .5s var(--ease), float 6s ease-in-out infinite; }
@keyframes shake { 20%,60% { translate: -8px 0; } 40%,80% { translate: 8px 0; } }
.ac-in { position: absolute; inset: 0; padding: 28px 34px; display: flex; flex-direction: column; transform: translateZ(16px); }
.ac-row { display: flex; justify-content: space-between; align-items: center; }
.ac-brand { font-weight: 700; font-size: var(--fs-2xl); letter-spacing: -.03em; }
.ac-brand span { color: #d6c3a1; }
.ac-tag { font-size: 11px; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: #9a9aa3; }
.chip { width: 52px; height: 40px; border-radius: 9px; margin-top: 26px;
        background: linear-gradient(135deg, #e9d9a6, #b89a52 40%, #f3e6bd 60%, #a7883f); box-shadow: inset 0 0 0 1px rgba(0,0,0,.25); position: relative; overflow: hidden; }
.chip::after { content: ""; position: absolute; inset: 8px 0; border-top: 1px solid rgba(0,0,0,.25); border-bottom: 1px solid rgba(0,0,0,.25); }
.ac-limit { margin-top: auto; }
.ac-limit b { display: block; font-size: var(--fs-4xl); font-weight: 600; letter-spacing: -.03em; line-height: 1.1; }
.ac-limit small { color: #9a9aa3; font-size: var(--fs-xs); }
.ac-status { display: inline-flex; align-items: center; gap: var(--s3); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.ac-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--g, #3ddc97); box-shadow: 0 0 12px var(--g, #3ddc97); }
.card-caption { margin-top: var(--s6); text-align: center; font-size: var(--fs-xs); color: var(--text-secondary); min-height: 24px; transition: opacity var(--t-fast); }

/* Stats strip */
.stats { display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat { padding: var(--s8) var(--s6); border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; padding-left: 0; }
.stat b { display: block; font-size: var(--fs-4xl); font-weight: 600; letter-spacing: -.03em; line-height: 1.2; margin-top: var(--s3); }
.stat .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; }
.meter { height: 4px; border-radius: 4px; background: var(--surface-muted); margin-top: var(--s4); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--text-primary); border-radius: 4px; transition: width 1.2s var(--ease), background var(--t-fast); }

/* How it works */
.how { padding: 100px 0 40px; }
.sec-title { display: flex; justify-content: space-between; align-items: end; gap: var(--s5); margin-bottom: var(--s8); flex-wrap: wrap; }
h2 { font-size: clamp(32px, 4vw, 52px); line-height: 1.08; letter-spacing: -.04em; font-weight: 700; margin: var(--s4) 0 0; }
.sec-title p { color: var(--text-secondary); max-width: 420px; margin: 0; }
.how-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s5); }
.how-item { background: var(--surface-raised); border-radius: var(--radius); padding: var(--s6); position: relative; overflow: hidden;
            transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast); }
.how-item:hover { transform: translateY(-6px); box-shadow: var(--shadow-1); }
.how-item .n { font-size: 60px; font-weight: 800; letter-spacing: -.05em; line-height: 1; color: color-mix(in srgb, var(--text-tertiary) 42%, var(--surface-raised)); }
.how-item h3 { font-size: var(--fs-xl); font-weight: 600; margin: var(--s5) 0 var(--s3); letter-spacing: -.01em; }
.how-item p { font-size: var(--fs-xs); line-height: 22px; color: var(--text-secondary); margin: 0; }
.how-item .tag { position: absolute; top: var(--s6); right: var(--s6); font-size: 11px; font-weight: 600; letter-spacing: .06em; padding: var(--s1) var(--s4); border-radius: 99px; }
.tag.stop { color: var(--stop-text); background: color-mix(in srgb, var(--stop) 14%, transparent); }
.tag.wait { color: var(--wait-text); background: color-mix(in srgb, var(--wait) 14%, transparent); }

/* Payments + rules */
.work { display: grid; grid-template-columns: 1.6fr 1fr; gap: var(--s6); padding: 80px 0 120px; align-items: start; }
.pay { background: var(--surface-raised); border-radius: var(--radius); padding: var(--s6); margin-bottom: var(--s5); position: relative;
       transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast); }
.pay:hover { transform: translateY(-3px); box-shadow: var(--shadow-1); }
.pay.waiting { box-shadow: 0 0 0 1px color-mix(in srgb, var(--wait) 70%, transparent); }
.pay.enter { animation: rise var(--t-normal) var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.pay-head { display: flex; justify-content: space-between; gap: var(--s5); align-items: flex-start; }
.pay-item { font-size: var(--fs-xl); font-weight: 600; letter-spacing: -.01em; line-height: 28px; }
.pay-meta { font-size: var(--fs-xs); color: var(--text-tertiary); margin-top: var(--s1); }
.pay-amt { font-size: var(--fs-3xl); font-weight: 600; letter-spacing: -.02em; text-align: right; }
.badge { display: inline-block; margin-top: var(--s3); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: var(--s1) var(--s4); border-radius: 99px; }
.badge.paid { color: var(--paid-text); background: color-mix(in srgb, var(--paid) 11%, transparent); }
.badge.waiting { color: var(--wait-text); background: color-mix(in srgb, var(--wait) 14%, transparent); }
.badge.refunded { color: var(--wait-text); background: color-mix(in srgb, var(--wait) 14%, transparent); }
.badge.blocked, .badge.cancelled { color: var(--stop-text); background: color-mix(in srgb, var(--stop) 14%, transparent); }
.flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s2); margin: var(--s5) 0; }
.flow div { height: 4px; border-radius: 4px; background: var(--surface-muted); position: relative; }
.flow div span { position: absolute; top: 10px; left: 0; font-size: 11px; font-weight: 500; color: var(--text-tertiary); white-space: nowrap; }
.flow .ok { background: var(--paid); } .flow .ok span { color: var(--text-secondary); }
.flow .warn { background: var(--wait); } .flow .warn span { color: var(--wait-text); }
.flow .no { background: var(--stop); } .flow .no span { color: var(--stop-text); }
.pay.enter .flow div { animation: fill var(--t-normal) var(--ease) both; transform-origin: left; }
.pay.enter .flow div:nth-child(2) { animation-delay: .15s; } .pay.enter .flow div:nth-child(3) { animation-delay: .3s; } .pay.enter .flow div:nth-child(4) { animation-delay: .45s; }
@keyframes fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.why { margin-top: 38px; display: grid; gap: var(--s3); }
.why div { display: grid; grid-template-columns: 52px 1fr; gap: var(--s4); font-size: var(--fs-xs); line-height: 21px; color: var(--text-secondary); }
.why b { font-size: 10px; font-weight: 600; letter-spacing: .12em; color: var(--text-tertiary); padding-top: 1px; }
.why b.ai { color: var(--accent-text); }
.task { margin-top: var(--s4); font-size: var(--fs-xs); color: var(--text-tertiary); }
.acts { display: flex; gap: var(--s4); margin-top: var(--s5); flex-wrap: wrap; }
.empty { background: var(--surface-raised); border-radius: var(--radius); padding: 60px var(--s6); text-align: center; color: var(--text-secondary); }
.empty code { display: inline-block; margin-top: var(--s4); padding: var(--s2) var(--s4); background: var(--surface-muted); border-radius: 8px; font-size: var(--fs-xs); color: var(--text-primary); }

.side { background: var(--surface-raised); border-radius: var(--radius); padding: var(--s6); position: sticky; top: 104px; }
.side h3 { font-size: var(--fs-2xl); font-weight: 600; margin: var(--s3) 0 var(--s5); letter-spacing: -.02em; }
.rules { list-style: none; margin: 0 0 var(--s6); padding: 0; }
.rules li { display: flex; justify-content: space-between; gap: var(--s5); padding: 14px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-xs); color: var(--text-secondary); }
.rules li b { font-weight: 600; color: var(--text-primary); text-align: right; }
label.lb { display: block; font-size: var(--fs-xs); font-weight: 600; margin-bottom: var(--s3); }
textarea { width: 100%; min-height: 120px; resize: vertical; padding: 14px var(--s5); border-radius: 14px; border: 1px solid var(--line-strong);
           background: var(--surface-base); color: var(--text-primary); font: 400 var(--fs-xs)/22px "Poppins"; transition: border-color var(--t-instant); }
textarea:focus { outline: none; border-color: var(--text-primary); box-shadow: 0 0 0 1px var(--text-primary); }
.hint { font-size: 12px; color: var(--text-tertiary); margin: var(--s3) 0 var(--s5); line-height: 19px; }
.draft { margin-top: var(--s5); padding: var(--s5); border-radius: 14px; background: var(--surface-muted); animation: rise var(--t-normal) var(--ease) both; }
.draft p { font-size: var(--fs-xs); color: var(--text-secondary); margin: var(--s3) 0 0; line-height: 21px; }
.vault { display: flex; justify-content: space-between; margin-top: var(--s6); font-size: var(--fs-xs); color: var(--text-secondary); }
.vault b { color: var(--text-primary); font-weight: 600; }

.audit { padding: 0 0 120px; }
.week { padding: var(--s6); margin-bottom: var(--s5); background: var(--surface-raised); border-radius: var(--radius); }
.week-head { display: flex; flex-wrap: wrap; gap: var(--s4); justify-content: space-between; align-items: center; }
.week-head b { display: block; font-size: var(--fs-lg); font-weight: 600; }
.week-head span { font-size: var(--fs-xs); color: var(--text-tertiary); }
.week-note { margin: var(--s5) 0 0; font-size: var(--fs-sm); line-height: 26px; color: var(--text-secondary); }
.week-watch { margin: var(--s3) 0 0; font-size: var(--fs-xs); font-weight: 600; color: var(--wait); }
.week-agents { list-style: none; margin: var(--s5) 0 0; padding: 0; font-size: var(--fs-xs); }
.week-agents li { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); justify-content: space-between; padding: var(--s3) 0; border-top: 1px solid var(--line); color: var(--text-secondary); }
.week-agents b { color: var(--text-primary); font-weight: 600; overflow-wrap: anywhere; }
.audit-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); margin-bottom: var(--s5); }
.audit-chips { display: flex; flex-wrap: wrap; flex: none; max-width: 100%; gap: var(--s2); }
.filter-chip { flex: none; white-space: nowrap; font: inherit; font-size: var(--fs-xs); color: var(--text-secondary); background: transparent; border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 14px; cursor: pointer; transition: background var(--t-instant), color var(--t-instant); }
.filter-chip b { font-weight: 600; margin-left: 4px; }
.filter-chip:hover { color: var(--text-primary); }
.filter-chip[aria-pressed="true"] { background: var(--invert-bg); color: var(--invert-fg); border-color: var(--invert-bg); }
.audit-search { font: inherit; font-size: var(--fs-xs); flex: 1 1 200px; min-width: 0; color: var(--text-primary); background: var(--surface-raised); border: 1px solid var(--line-strong); border-radius: 999px; padding: 7px 16px; }
#audit-grid { width: 100%; }
#audit-grid .ag-floating-filter input:not([type="date"]):not([disabled]) { padding-right: 26px; }
#audit-grid .ag-floating-filter input[type="number"] { appearance: textfield; }
#audit-grid .ag-floating-filter input[type="number"]::-webkit-inner-spin-button { appearance: none; }
#audit-grid .ag-floating-filter[col-id="when"] input[type="date"] { padding-right: 4px; font-size: 12px; }
.cell-paid { color: var(--paid-text); font-weight: 600; }
.cell-waiting { color: var(--wait-text); font-weight: 600; }
.cell-stopped { color: var(--stop-text); font-weight: 600; }
.audit-detail { margin-top: var(--s5); padding: var(--s6); background: var(--surface-raised); border-radius: var(--radius); }
.audit-detail h3 { margin: 0 0 var(--s4); font-size: var(--fs-lg); font-weight: 600; overflow-wrap: anywhere; }
.audit-facts { margin: var(--s4) 0 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--s2) var(--s5); font-size: var(--fs-xs); }
.audit-facts dt { color: var(--text-tertiary); }
.audit-facts dd { margin: 0; color: var(--text-secondary); overflow-wrap: anywhere; }

.tg { margin-top: var(--s4); }
.tg .btn { margin-top: var(--s3); }
.tg-pair { margin-top: var(--s3); }
/* Scanners need dark squares on white in both themes */
.tg-qr { width: 196px; max-width: 100%; margin: var(--s3) 0; padding: 8px; background: #fff; border-radius: 10px; }
.tg-qr svg { display: block; width: 100%; height: auto; }
.tg-cmd { display: block; padding: var(--s3); font-size: var(--fs-xs); background: var(--surface-muted); border-radius: 8px; overflow-wrap: anywhere; user-select: all; }
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: rot .8s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

.toasts { position: fixed; right: var(--s5); bottom: var(--s5); z-index: 50; display: grid; gap: var(--s4); width: min(360px, calc(100vw - 32px)); }
.toast { background: var(--invert-bg); color: var(--invert-fg); border-radius: 14px; padding: 14px var(--s5); font-size: var(--fs-xs); line-height: 20px;
         box-shadow: var(--shadow-1); animation: rise var(--t-normal) var(--ease) both; display: flex; gap: var(--s4); align-items: center; }
.toast i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.toast.out { animation: out var(--t-fast) ease forwards; }
@keyframes out { to { opacity: 0; transform: translateY(10px); } }

.reveal { animation: rise 800ms var(--ease) both; }
.d1 { animation-delay: 100ms; } .d2 { animation-delay: 200ms; } .d3 { animation-delay: 300ms; }

@media (max-width: 1024px) {
  .hero, .work { grid-template-columns: 1fr; }
  .how-grid { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .stat:nth-child(4) { border-left: 0; padding-left: 0; }
  .side { position: static; }
  .nav-links { display: none; }
  /* Gentler resting tilt on tablets and phones, so the text keeps an even margin */
  .agent-card { --ry: -9deg; --rx: 6deg; }
}
/* Large touch screens have no pointer to tilt the card either */
@media (pointer: coarse) { .agent-card { --ry: -9deg; --rx: 6deg; } }
@media (max-width: 600px) {
  .wrap { padding: 0 16px; }
  header .wrap { gap: var(--s4); }
  .ghost .lbl { display: none; }
  #theme-name { text-transform: capitalize; }
  .logo { padding: 6px 0; }
  .foot a, .note a { display: inline-block; padding: 8px 4px; }
  .faq details { padding: var(--s3) 0; }
  .faq summary { padding: 10px 0; }
  .ghost { padding: 8px 12px; white-space: nowrap; }
  .kill { gap: 6px; padding-right: 10px; }
  .kill .sw { flex: none; }
  .kill .lbl { width: min-content; font-size: 10px; line-height: 1.1; text-align: left; }
  .hero { padding: 50px 0 40px; gap: 20px; }
  .how-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat { padding: var(--s5) var(--s4); }
  .stat:nth-child(odd) { border-left: 0; padding-left: 0; }
  .stat:nth-child(4) { border-left: 1px solid var(--line); padding-left: var(--s4); }
  .pay-head { flex-direction: column; } .pay-amt { text-align: left; }
  .ac-in { padding: 22px 24px; transform: translateZ(12px); } .ac-limit b { font-size: var(--fs-3xl); } .chip { margin-top: 14px; width: 42px; height: 32px; }
}
@media (max-width: 380px) {
  header #theme { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Keyboard focus and skip link */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--invert-bg); color: var(--invert-fg); padding: var(--s3) var(--s5); border-radius: 99px; }
.skip:focus { left: 16px; }

/* Public site */
.band { padding: 90px 0; border-top: 1px solid var(--line); }
.stops { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s5); list-style: none; padding: 0; margin: 0; }
.stops li { background: var(--surface-raised); border: 1px solid var(--line); border-radius: 18px; padding: var(--s6); }
.stops h3 { margin: 0 0 var(--s4); font-size: var(--fs-lg); font-weight: 600; }
.stops p { margin: 0; color: var(--text-secondary); font-size: var(--fs-sm); line-height: 1.6; }
.stops .tag { display: inline-block; position: static; margin-bottom: var(--s4); }
.code { background: var(--surface-raised); border: 1px solid var(--line); border-radius: 14px; padding: var(--s5); overflow-x: auto; font: 13px/1.6 ui-monospace, Consolas, monospace; margin: 0 0 var(--s5); }
.video { position: relative; aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-raised); }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.faq details { border-bottom: 1px solid var(--line); padding: var(--s5) 0; }
.faq summary { cursor: pointer; font-weight: 500; font-size: var(--fs-md); }
.faq p { margin: var(--s4) 0 0; color: var(--text-secondary); line-height: 1.7; max-width: 760px; }
.foot { border-top: 1px solid var(--line); padding: var(--s8) 0; color: var(--text-secondary); font-size: var(--fs-xs); }
.foot .wrap { display: flex; flex-wrap: wrap; gap: var(--s5); align-items: center; }
.foot a { color: inherit; }
.note { color: var(--text-secondary); font-size: var(--fs-xs); line-height: 1.7; }

/* Login and 404 */
.center { min-height: 100vh; display: grid; place-items: center; padding: var(--s5); }
.panel { width: min(420px, 100%); background: var(--surface-raised); border: 1px solid var(--line); border-radius: 22px; padding: var(--s8); box-shadow: var(--shadow-1); }
.panel h1 { font-size: var(--fs-3xl); margin: var(--s5) 0 var(--s4); font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
.panel p { color: var(--text-secondary); margin: 0 0 var(--s5); font-size: var(--fs-sm); line-height: 1.6; }
.panel input { width: 100%; min-height: 52px; box-sizing: border-box; padding: 0 var(--s5); margin-bottom: var(--s5); border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface-base); color: var(--text-primary); font: inherit; }
.panel .btn { width: 100%; }
.panel .error { color: var(--stop); font-size: var(--fs-xs); min-height: 20px; margin: 0 0 var(--s4); }

@media (max-width: 760px) {
  .band { padding: 60px 0; }
  .stops { grid-template-columns: 1fr; }
  .panel { padding: var(--s6); }
}
