:root {
  /* Aliases onto the shared design tokens (site/tokens.css <- design/tokens.css) */
  --paper: var(--ie-paper);
  --paper-2: var(--ie-paper-2);
  --ink: var(--ie-ink);
  --ink-2: var(--ie-ink-2);
  --ink-3: var(--ie-ink-3);
  --rule: var(--ie-rule);
  --stamp: var(--ie-stamp);
  --ledger: var(--ie-ledger);
  --receipt: var(--ie-receipt);
  --serif: var(--ie-font-display);
  --sans: var(--ie-font-sans);
  --mono: var(--ie-font-mono);
  --wrap: min(1160px, calc(100vw - 48px));
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
code { font-family: var(--mono); font-size: 0.86em; background: var(--paper-2); padding: 0.1em 0.38em; border-radius: 3px; }
img { display: block; }

/* paper grain + ledger lines */
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: 0.5;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.09 0 0 0 0 0.08 0 0 0 0 0.06 0 0 0 0.10 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
body > *:not(.grain) { position: relative; z-index: 1; }

/* top bar */
.topbar {
  width: var(--wrap); margin: 0 auto; padding: 22px 0;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  border-bottom: 1px solid var(--rule);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--mono); font-weight: 600; font-size: 14px; letter-spacing: 0.04em; text-transform: uppercase; }
.topbar nav { display: flex; gap: 26px; font-size: 14px; }
.topbar nav a { text-decoration: none; color: var(--ink-2); }
.topbar nav a:hover { color: var(--ink); }
.topbar nav .gh { color: var(--ink); font-weight: 600; }

main { width: var(--wrap); margin: 0 auto; }

/* hero */
.hero {
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 64px; align-items: center;
  padding: 88px 0 96px;
}
.kicker { font-family: var(--mono); font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); margin: 0 0 22px; display: flex; align-items: center; gap: 10px; }
.kicker .beta { background: var(--stamp); color: var(--paper); padding: 2px 8px; border-radius: var(--ie-radius-sm); font-weight: 600; }
.beta-note { margin: 18px 0 0; font-size: 14px; color: var(--ink-3); max-width: 46em; }
.kicker .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ledger); box-shadow: 0 0 0 4px rgba(29,107,76,0.15); }
h1 {
  font-family: var(--serif); font-weight: 400; font-size: clamp(48px, 6.4vw, 86px); line-height: 0.98; letter-spacing: -0.015em;
  margin: 0 0 28px;
}
h1 em { color: var(--stamp); }
.lede { font-size: 19px; color: var(--ink-2); max-width: 34em; margin: 0 0 36px; }
.lede strong { color: var(--ink); font-weight: 600; }

.cta { display: flex; flex-wrap: wrap; gap: 14px; align-items: stretch; }
.btn { text-decoration: none; display: inline-flex; flex-direction: column; justify-content: center; padding: 14px 24px; border-radius: 4px; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.btn.primary { background: var(--ink); color: var(--paper); box-shadow: 4px 4px 0 var(--stamp); }
.btn.primary:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--stamp); }
.btn-label { font-weight: 600; font-size: 17px; }
.btn-sub { font-family: var(--mono); font-size: 12px; opacity: 0.75; }
.btn.ghost { border: 1.5px solid var(--ink); font-weight: 600; }
.btn.ghost:hover { background: var(--ink); color: var(--paper); }

.facts { list-style: none; padding: 0; margin: 44px 0 0; display: flex; gap: 36px; font-size: 14px; color: var(--ink-2); }
.facts b { display: block; font-family: var(--serif); font-weight: 400; font-size: 40px; line-height: 1; color: var(--ink); }

/* receipt */
.receipt-wrap { display: flex; justify-content: center; perspective: 1200px; }
.receipt {
  position: relative; width: 100%; max-width: 380px; background: var(--receipt);
  padding: 26px 26px 34px; font-family: var(--mono); font-size: 13px;
  box-shadow: 0 1px 0 var(--rule), 0 24px 50px -24px rgba(22,20,15,0.35);
  transform: rotate(1.6deg);
  -webkit-mask: radial-gradient(circle 7px at 50% 100%, transparent 98%, #000) 0 0 / 18px 100% repeat-x;
          mask: radial-gradient(circle 7px at 50% 100%, transparent 98%, #000) 0 0 / 18px 100% repeat-x;
  animation: print 1.1s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes print { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
.receipt-head { display: flex; justify-content: space-between; font-weight: 600; letter-spacing: 0.08em; }
.receipt-sub { color: var(--ink-3); border-bottom: 1px dashed var(--ink-3); padding: 6px 0 12px; margin-bottom: 8px; }
.tape { list-style: none; margin: 0; padding: 0; }
.tape li {
  display: grid; grid-template-columns: 18px 1fr auto auto; gap: 10px; align-items: center;
  padding: 8px 0; border-bottom: 1px dotted var(--rule);
  opacity: 0; animation: line .35s ease forwards;
}
.tape li img { width: 16px; height: 16px; border-radius: 3px; }
.tape .amt { color: var(--ink-3); }
.tape .ok { color: var(--ledger); font-weight: 600; }
.tape .ok::before { content: "✓ "; }
.tape li:nth-child(1) { animation-delay: .7s; }
.tape li:nth-child(2) { animation-delay: .95s; }
.tape li:nth-child(3) { animation-delay: 1.2s; }
.tape li:nth-child(4) { animation-delay: 1.45s; }
.tape li:nth-child(5) { animation-delay: 1.7s; }
.tape li:nth-child(6) { animation-delay: 1.95s; }
.tape li:nth-child(7) { animation-delay: 2.2s; }
@keyframes line { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.receipt-total { display: flex; justify-content: space-between; font-weight: 600; padding-top: 14px; border-top: 2px solid var(--ink); margin-top: 10px; }
.stamp {
  position: absolute; right: 18px; bottom: 58px; font-family: var(--mono); font-weight: 600; font-size: 26px; letter-spacing: 0.18em;
  color: var(--stamp); border: 3px solid var(--stamp); padding: 4px 14px; border-radius: 6px; transform: rotate(-14deg);
  opacity: 0; animation: stamp .35s cubic-bezier(.3,1.6,.5,1) 2.7s forwards; mix-blend-mode: multiply;
}
@keyframes stamp { from { opacity: 0; transform: rotate(-14deg) scale(1.8); } to { opacity: .9; transform: rotate(-14deg) scale(1); } }

/* sections */
section { padding: 84px 0; border-top: 1px solid var(--rule); }
.section-title { font-family: var(--serif); font-weight: 400; font-size: clamp(34px, 4vw, 52px); line-height: 1.05; margin: 0 0 44px; display: flex; align-items: baseline; gap: 18px; }
.section-title span { font-family: var(--mono); font-size: 14px; color: var(--stamp); letter-spacing: 0.08em; }
h3 { font-size: 20px; line-height: 1.3; margin: 0 0 10px; font-weight: 600; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.steps article { border-top: 2px solid var(--ink); padding-top: 22px; }
.steps p { color: var(--ink-2); margin: 0; }
.step-n { font-family: var(--serif); font-size: 44px; line-height: 1; color: var(--stamp); margin-bottom: 14px; }

.mode-grid { display: grid; grid-template-columns: 1fr 1.25fr; gap: 28px; }
.mode { padding: 34px; border-radius: 6px; }
.mode.human { background: var(--receipt); border: 1px solid var(--rule); }
.mode.agent { background: var(--ink); color: var(--paper); }
.mode.agent p { color: #cfc8b8; }
.mode .tag { font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--stamp) !important; margin: 0 0 8px; }
.mode h3 { font-family: var(--serif); font-weight: 400; font-size: 34px; margin-bottom: 14px; }
.mode p { color: var(--ink-2); }
.ticks { list-style: none; padding: 0; margin: 20px 0 0; }
.ticks li { padding: 8px 0; border-top: 1px dashed var(--rule); }
.ticks li::before { content: "✓"; color: var(--ledger); font-weight: 700; margin-right: 10px; }

.term { background: #0d0c09; color: #e9e2d3; border-radius: 6px; padding: 18px 20px; font-family: var(--mono); font-size: 13.5px; line-height: 1.7; overflow-x: auto; margin: 22px 0 0; border: 1px solid #2c2922; }
.term code { background: none; padding: 0; font-size: inherit; }
.term .p { color: var(--stamp); }
.term .c { color: #8fc5a8; }
.term.small { font-size: 12.5px; margin: 10px 0 4px; }

.providers { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0; border-top: 1px solid var(--ink); border-left: 1px solid var(--rule); }
.providers li { display: flex; align-items: center; gap: 12px; padding: 18px 16px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); font-weight: 500; transition: background .15s; }
.providers li:hover { background: var(--receipt); }
.providers img { width: 22px; height: 22px; border-radius: 4px; }
.providers .add a { font-family: var(--mono); font-size: 14px; color: var(--stamp); text-decoration: none; font-weight: 600; }

.install-lede { max-width: 46em; color: var(--ink-2); margin: -20px 0 34px; }
.tabs { display: inline-flex; border: 1.5px solid var(--ink); border-radius: 5px; overflow: hidden; margin-bottom: 26px; }
.tabs button { font: 600 15px var(--sans); padding: 10px 24px; background: transparent; border: 0; color: var(--ink); cursor: pointer; }
.tabs button + button { border-left: 1.5px solid var(--ink); }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.howto { counter-reset: s; list-style: none; padding: 0; margin: 0; max-width: 820px; }
.howto li { counter-increment: s; position: relative; padding: 18px 0 18px 64px; border-top: 1px dashed var(--rule); }
.howto li::before { content: counter(s); position: absolute; left: 0; top: 12px; font-family: var(--serif); font-size: 40px; line-height: 1; color: var(--stamp); }
.howto a { color: var(--ledger); font-weight: 600; }
.agent-note { margin-top: 40px; padding: 26px 30px; background: var(--receipt); border-left: 4px solid var(--ledger); max-width: 820px; }
.agent-note p { margin: 0 0 10px; }
.agent-note blockquote { margin: 0; font-family: var(--serif); font-size: 26px; line-height: 1.25; font-style: italic; }

.trust-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.trust-grid p { margin: 0; color: var(--ink-2); border-top: 2px solid var(--ink); padding-top: 20px; }
.trust-grid b { display: block; color: var(--ink); font-size: 19px; margin-bottom: 8px; }

.foot { width: var(--wrap); margin: 0 auto; padding: 40px 0 56px; border-top: 2px solid var(--ink); display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; font-size: 14px; color: var(--ink-2); }
.foot p { margin: 8px 0 0; }
.foot nav { display: flex; gap: 22px; flex-wrap: wrap; }
.foot nav a { text-decoration: none; }
.foot nav a:hover { color: var(--ink); text-decoration: underline; }

@media (max-width: 900px) {
  .topbar nav a:not(.gh) { display: none; }
  .hero { grid-template-columns: 1fr; gap: 48px; padding: 56px 0 64px; }
  .steps, .trust-grid, .mode-grid { grid-template-columns: 1fr; }
  .facts { gap: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .tape li, .stamp { opacity: 1; }
  .stamp { opacity: .9; }
}
