/* oai.io beta. OAI red on Hub midnight; light by default, dark when asked. */
:root {
  --red: #e84c3d;
  --red-deep: #c93a2c;
  --ink: #0e1430;
  --ink-2: #3c4566;
  --muted: #6b7393;
  --line: #e4e7f0;
  --bg: #f6f7fb;
  --card: #ffffff;
  --midnight: #0b1026;
  --midnight-2: #121a44;
  --gold: #ffd27a;
  --blue: #6f8fe6;
  --rose: #ff8a7a;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(14, 20, 48, 0.04), 0 8px 24px rgba(14, 20, 48, 0.06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #eef1fb;
    --ink-2: #c3c9df;
    --muted: #8e97b5;
    --line: #232b4d;
    --bg: #080c1f;
    --card: #0f1533;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3, h4 { line-height: 1.15; margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: 0.92em; }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.small { font-size: 13.5px; color: var(--muted); }
.error { color: var(--red); margin: 12px 0; }

/* Header */
.top {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.top-row { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-name { font-weight: 800; font-size: 19px; letter-spacing: 0.02em; }
.brand-io { color: var(--red); }
.badge-beta {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--red); border: 1px solid color-mix(in srgb, var(--red) 40%, transparent);
  border-radius: 99px; padding: 1px 8px;
}
.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  text-decoration: none; color: var(--ink-2); font-weight: 500; font-size: 14.5px;
  padding: 8px 12px; border-radius: 8px;
}
.nav a:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.nav .nav-cta { background: var(--ink); color: var(--bg); margin-left: 8px; }
.nav .nav-cta:hover { background: var(--red); color: #fff; }
.menu { display: none; }

/* Hero */
.hero { padding: 72px 0 56px; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -40% -10% auto auto; width: 720px; height: 720px;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--red) 16%, transparent), transparent);
  pointer-events: none;
}
.hero-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 56px; align-items: center; position: relative; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--red);
  margin-bottom: 18px;
}
.eyebrow.on-dark { color: var(--gold); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #2ecc71; box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(46, 204, 113, 0); } 100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); } }
h1 { font-size: clamp(38px, 5.4vw, 64px); font-weight: 800; letter-spacing: -0.035em; }
.lede { font-size: 18px; color: var(--ink-2); margin-top: 18px; max-width: 60ch; }
.hero-actions { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; height: 44px; padding: 0 18px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font: 600 15px var(--sans); text-decoration: none; cursor: pointer;
  transition: transform 0.15s, background 0.15s, border-color 0.15s;
}
.btn:hover { border-color: var(--ink-2); transform: translateY(-1px); }
.btn:disabled { opacity: 0.6; cursor: default; transform: none; }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-deep); }
.hero-stats {
  margin: 0; display: grid; gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.hero-stats div { background: var(--card); padding: 20px 24px; }
.hero-stats dt { font-size: 13px; color: var(--muted); font-weight: 500; }
.hero-stats dd { margin: 4px 0 0; font-size: 30px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

/* Sections */
.section { padding: 64px 0; }
.section-head { margin-bottom: 28px; max-width: 760px; }
.section-head.row { display: flex; justify-content: space-between; align-items: end; gap: 24px; max-width: none; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(28px, 3.4vw, 38px); font-weight: 800; }
.section-head p { color: var(--muted); margin-top: 8px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
/* Grid children may shrink below their content (long code lines scroll instead). */
.hero-grid > *, .qem-intro > *, .qem-pair > *, .api-grid > *, .ven-grid > * { min-width: 0; }

/* Ven */
.ven-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.card.ven { padding: 22px; display: flex; flex-direction: column; gap: 6px; min-height: 104px; }
.ven-name { font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.ven-value { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.unit { font-size: 15px; color: var(--muted); font-weight: 500; }
.skeleton { background: linear-gradient(90deg, var(--card), color-mix(in srgb, var(--line) 60%, var(--card)), var(--card)); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Ledger */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  font: 600 13.5px var(--sans); padding: 7px 14px; border-radius: 99px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--ink-2);
}
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.table-card { overflow: hidden; }
.ledger { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.ledger th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); font-weight: 600; padding: 14px 18px; border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 60%, var(--card));
}
.ledger td { padding: 13px 18px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ledger tr:last-child td { border-bottom: 0; }
.ledger tbody tr:hover { background: color-mix(in srgb, var(--ink) 3%, transparent); }
.ledger .num { text-align: right; font-variant-numeric: tabular-nums; }
.ledger .neg { color: var(--red); }
.ledger .empty { text-align: center; color: var(--muted); padding: 40px; white-space: normal; }
tr.fresh { animation: fresh 3s ease-out; }
@keyframes fresh { from { background: color-mix(in srgb, var(--gold) 45%, transparent); } }
.tag { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; letter-spacing: 0.02em; }
.tag-ven { background: color-mix(in srgb, #2f6fed 14%, transparent); color: #2f6fed; }
.tag-propel { background: color-mix(in srgb, #8a4fe0 14%, transparent); color: #8a4fe0; }
.tag-ultra { background: color-mix(in srgb, #d98a00 16%, transparent); color: #b87400; }
.parties { font-family: var(--mono); font-size: 13px; color: var(--ink-2); }
.arrow { color: var(--muted); margin: 0 8px; font-family: var(--sans); }
.ledger-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; gap: 12px; }

/* QEM */
.qem {
  background:
    radial-gradient(ellipse at 20% 0%, rgba(90, 120, 255, 0.18), transparent 55%),
    radial-gradient(ellipse at 90% 30%, rgba(255, 190, 90, 0.10), transparent 50%),
    var(--midnight);
  color: #e9edfb;
}
.qem h2 { font-size: clamp(32px, 4vw, 48px); font-weight: 800; }
.qem .lede { color: #b9c3e6; }
.on-dark { color: #8f9bbf; }
.qem-intro { display: grid; grid-template-columns: 1fr 1.15fr; gap: 48px; align-items: center; }
.principles { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 12px; }
.principles li { padding-left: 22px; position: relative; color: #b9c3e6; }
.principles li::before { content: ""; position: absolute; left: 0; top: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 12px var(--gold); }
.principles strong { color: #fff; }
.qem-figure { margin: 0; }
.qem-figure img { width: 100%; height: auto; display: block; border-radius: var(--radius); border: 1px solid rgba(143, 176, 255, 0.18); }
.qem-figure figcaption { font-size: 13px; color: #8f9bbf; margin-top: 10px; }
.qem-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; margin: 44px 0 20px; background: rgba(143, 176, 255, 0.14); border-radius: var(--radius); overflow: hidden; }
.qstat { background: rgba(10, 15, 42, 0.92); padding: 20px; display: flex; flex-direction: column; gap: 4px; }
.qn { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: #fff; }
.ql { font-size: 13px; color: #9aa6cc; }
.qstat.gold .qn { color: var(--gold); }
.qstat.blue .qn { color: #9fb8ff; }
.qstat.red .qn { color: var(--rose); }
.qem-pair { display: grid; grid-template-columns: 1.25fr 1fr; gap: 20px; }
.card.dark { background: rgba(255, 255, 255, 0.035); border-color: rgba(143, 176, 255, 0.16); box-shadow: none; padding: 26px; }
.card.dark h3 { font-size: 20px; margin-bottom: 8px; color: #fff; }
.card.dark h4 { font-size: 14px; margin: 22px 0 8px; color: #dfe5fb; }
.card.dark .small { color: #9aa6cc; }
.week-rows { display: grid; gap: 12px; margin-top: 20px; }
.week-label { display: flex; justify-content: space-between; font-size: 13.5px; color: #dfe5fb; margin-bottom: 4px; }
.week-bar { display: block; width: 100%; height: 14px; background: rgba(255, 255, 255, 0.05); border-radius: 3px; }
.week-bar .c, .sw.c { fill: var(--gold); background: var(--gold); }
.week-bar .g, .sw.g { fill: #5f7fd6; background: #5f7fd6; }
.week-bar .r, .sw.r { fill: var(--rose); background: var(--rose); }
.week-days { display: grid; grid-template-columns: repeat(var(--days), 1fr); margin-top: 8px; font-size: 11.5px; color: #6f7a9c; }
.week-days span { border-left: 1px solid rgba(143, 176, 255, 0.2); padding-left: 6px; }
.legend { display: flex; gap: 18px; margin-top: 16px; font-size: 13px; color: #9aa6cc; }
.sw { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 7px; vertical-align: -1px; }
.audit-big { display: flex; flex-direction: column; margin: 18px 0 14px; }
.stack { display: flex; height: 14px; border-radius: 99px; overflow: hidden; background: rgba(255, 255, 255, 0.06); }
.stack .c { background: var(--gold); }
.stack .g { background: #5f7fd6; }
.stack .r { background: var(--rose); }
.audit-list, .reasons { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; font-size: 14.5px; color: #dfe5fb; }
.audit-list strong { color: #fff; }
.reasons li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid rgba(143, 176, 255, 0.12); color: #c3cbe8; font-size: 14px; }
.reasons + .small { margin-top: 14px; }
.fine { margin-top: 22px; }

/* How it works, API */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.step { padding: 26px; }
.step-n { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); font-weight: 800; }
.step h3 { font-size: 19px; margin: 16px 0 8px; }
.step p { color: var(--ink-2); font-size: 15px; }
.api-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.card.api { padding: 26px; }
.card.api h3 { font-size: 19px; margin-bottom: 6px; }
.card.api p { color: var(--ink-2); font-size: 15px; }
.card.api pre {
  margin: 14px 0; padding: 14px 16px; border-radius: 10px; overflow-x: auto;
  background: var(--midnight); color: #dfe5fb; font-size: 13px;
}
.card.api p code { background: color-mix(in srgb, var(--ink) 7%, transparent); padding: 1px 6px; border-radius: 5px; }

/* Footer */
.foot { border-top: 1px solid var(--line); padding: 36px 0 48px; }
.foot-row { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.foot-brand { display: flex; gap: 12px; align-items: flex-start; }
.foot-brand p { color: var(--muted); font-size: 14px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 20px; align-content: start; max-width: 520px; }
.foot-links a { color: var(--ink-2); text-decoration: none; font-size: 14px; }
.foot-links a:hover { color: var(--red); }

/* Narrow screens */
@media (max-width: 980px) {
  .hero-grid, .qem-intro, .qem-pair { grid-template-columns: 1fr; gap: 32px; }
  .ven-grid { grid-template-columns: 1fr 1fr; }
  .qem-stats { grid-template-columns: repeat(2, 1fr); }
  .qem-stats .qstat:last-child { grid-column: span 2; }
  .steps, .api-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .nav {
    display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch;
    background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 16px 16px;
  }
  .top.open .nav { display: flex; }
  .nav .nav-cta { margin: 8px 0 0; text-align: center; }
  .menu {
    display: grid; gap: 6px; align-content: center; justify-items: center; width: 40px; height: 40px;
    border: 1px solid var(--line); border-radius: 10px; background: var(--card); cursor: pointer;
  }
  .menu span { display: block; width: 18px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform 0.2s; }
  .top.open .menu span:first-child { transform: translateY(4px) rotate(45deg); }
  .top.open .menu span:last-child { transform: translateY(-4px) rotate(-45deg); }
  .hero { padding: 44px 0 32px; }
  .lede { font-size: 16.5px; }
  .ven-value { font-size: 21px; }
  .section { padding: 48px 0; }
  /* The ledger becomes a list of cards. */
  .ledger thead { display: none; }
  .ledger, .ledger tbody, .ledger tr, .ledger td { display: block; width: 100%; }
  .ledger tr { padding: 12px 16px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; }
  .ledger td { padding: 0; border: 0; white-space: normal; }
  .ledger td[data-label="Receipt"] { font-size: 12.5px; color: var(--muted); }
  .ledger td[data-label="When"] { text-align: right; font-size: 13px; color: var(--muted); }
  .ledger td[data-label="Amount"] { text-align: right; font-weight: 600; font-size: 16px; }
  .ledger td.parties { grid-column: 1 / -1; font-size: 12px; }
  .ledger-foot { flex-direction: column; align-items: stretch; }
  .week-days span { font-size: 0; }
  .week-days span::first-letter { font-size: 11px; }
}

/* Links, and the public record page */
.link { color: var(--red); text-decoration: none; font-weight: 600; font-size: 14.5px; }
.link:hover { text-decoration: underline; }
.back { display: inline-block; margin-bottom: 20px; }
.record { padding-top: 40px; }
.record-title { font-size: clamp(30px, 4vw, 46px); font-weight: 800; letter-spacing: -0.03em; }
.pulse.still { background: var(--muted); animation: none; box-shadow: none; }
.record-meta { display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: center; margin: 14px 0 12px; }
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pg { height: 38px; padding: 0 14px; font-size: 14px; }
.pg.off { opacity: 0.4; cursor: default; }
.pg.off:hover { transform: none; border-color: var(--line); }
.pg-now { font-weight: 600; font-size: 14.5px; padding: 0 8px; font-variant-numeric: tabular-nums; }
.jump { display: flex; align-items: center; gap: 8px; }
.jump input {
  width: 96px; height: 38px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font: 500 14.5px var(--sans);
}
.jump .btn { height: 38px; }
@media (max-width: 760px) {
  .pager { justify-content: space-between; }
  .pg { padding: 0 10px; font-size: 13px; }
  .pg-now { width: 100%; order: -1; padding: 0; }
  .jump { justify-content: space-between; }
}
