/* AgentCheckout.org — ledger-ink editorial system (same family as Paid by Agents) */
:root {
  --hue: 155;
  --bg:          oklch(0.985 0.005 var(--hue));
  --surface:     oklch(0.965 0.010 var(--hue));
  --receipt:     oklch(0.995 0.002 var(--hue));
  --ink:         oklch(0.24 0.045 var(--hue));
  --ink-muted:   oklch(0.45 0.040 var(--hue));
  --accent:      oklch(0.52 0.135 var(--hue));
  --accent-deep: oklch(0.38 0.10 var(--hue));
  --accent-ink:  oklch(0.99 0.005 var(--hue));
  --border:      oklch(0.88 0.015 var(--hue));
  --rule:        oklch(0.92 0.010 var(--hue));

  --space-1: .25rem; --space-2: .5rem; --space-3: .75rem; --space-4: 1rem;
  --space-6: 1.5rem; --space-8: 2rem; --space-12: 3rem; --space-16: 4rem;

  --text-sm:   clamp(.83rem, .8rem + .2vw, .9rem);
  --text-base: clamp(1rem, .95rem + .3vw, 1.125rem);
  --text-lg:   clamp(1.25rem, 1.1rem + .6vw, 1.5rem);
  --text-xl:   clamp(1.6rem, 1.3rem + 1.4vw, 2.25rem);
  --text-2xl:  clamp(2.2rem, 1.5rem + 3.2vw, 3.8rem);

  --measure: 68ch;
  --radius: 10px;
  --ease-out: cubic-bezier(.22,1,.36,1);
  --dur: 240ms;
}
*,*::before,*::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Schibsted Grotesk", system-ui, sans-serif;
  font-size: var(--text-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
h1,h2,h3,h4 { line-height: 1.12; letter-spacing: -0.02em; text-wrap: balance; }
p, li { max-width: var(--measure); text-wrap: pretty; }
img { max-width: 100%; display: block; }
a { color: var(--accent-deep); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mono { font-family: "Spline Sans Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; }

.wrap { max-width: 1080px; margin-inline: auto; padding-inline: clamp(1.25rem, 4vw, 2.5rem); }

/* ---------- header ---------- */
header.site {
  border-bottom: 1px solid var(--border);
  padding-block: var(--space-4);
}
.masthead {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--space-4); flex-wrap: wrap;
}
.wordmark {
  font-weight: 900; font-size: 1.15rem; letter-spacing: -0.02em;
  text-decoration: none; color: var(--ink);
}
.wordmark .tld { color: var(--accent); }
.masthead-note { font-size: var(--text-sm); color: var(--ink-muted); }

/* ---------- hero (home) ---------- */
.hero { padding-block: clamp(3rem, 8vw, 6rem); }
.hero .kicker {
  font-size: var(--text-sm); letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent-deep); font-weight: 500;
}
.hero h1 { font-size: var(--text-2xl); font-weight: 900; margin-top: var(--space-3); max-width: 24ch; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lede { margin-top: var(--space-6); font-size: var(--text-lg); color: var(--ink-muted); line-height: 1.5; }
.hero .actions { margin-top: var(--space-8); display: flex; gap: var(--space-3); flex-wrap: wrap; }

.btn {
  display: inline-block; font: inherit; font-weight: 700; text-decoration: none;
  padding: .8rem 1.5rem; border-radius: var(--radius); cursor: pointer;
  transition: background var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
}
.btn-primary { background: var(--accent); color: var(--accent-ink); border: 1.5px solid var(--accent-deep); }
.btn-primary:hover { background: var(--accent-deep); color: var(--accent-ink); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.btn-ghost:hover { background: var(--surface); color: var(--ink); }

/* ---------- ticker ---------- */
.ticker {
  border-block: 1px solid var(--border);
  background: var(--surface);
  padding-block: var(--space-3);
  overflow: hidden; white-space: nowrap;
  font-size: var(--text-sm); color: var(--ink-muted);
}
.ticker span { margin-inline: var(--space-6); }
.ticker b { color: var(--accent-deep); font-weight: 500; }

/* ---------- sections ---------- */
.section { padding-block: clamp(3rem, 7vw, 5rem); }
.section > .wrap > h2, .section h2.title { font-size: var(--text-xl); font-weight: 900; max-width: 26ch; }
.section-lede { margin-top: var(--space-4); color: var(--ink-muted); }

/* featured guide card */
.feature-card {
  margin-top: var(--space-8);
  display: grid; grid-template-columns: minmax(0,3fr) minmax(0,2fr);
  gap: var(--space-8);
  background: var(--receipt);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  box-shadow: 0 12px 32px oklch(0.24 0.045 var(--hue) / 0.08);
}
.feature-card .tag {
  font-size: var(--text-sm); letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent-deep); font-weight: 500;
}
.feature-card h3 { font-size: var(--text-lg); font-weight: 900; margin-top: var(--space-2); }
.feature-card h3 a { color: inherit; text-decoration: none; }
.feature-card h3 a:hover { color: var(--accent-deep); }
.feature-card p { color: var(--ink-muted); margin-top: var(--space-3); }
.feature-card .meta { margin-top: var(--space-4); font-size: var(--text-sm); color: var(--ink-muted); }
.feature-card .contents { border-left: 1px solid var(--rule); padding-left: var(--space-6); }
.feature-card .contents h4 {
  font-size: var(--text-sm); letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-muted); font-weight: 500;
}
.feature-card .contents ul { list-style: none; padding: 0; margin-top: var(--space-3); }
.feature-card .contents li { padding-block: var(--space-1); font-size: var(--text-sm); }

/* protocol table teaser + article tables */
.table-scroll { overflow-x: auto; margin-top: var(--space-8); }
table.ledger { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
table.ledger caption {
  text-align: left; font-size: var(--text-sm); color: var(--ink-muted);
  padding-bottom: var(--space-3);
}
table.ledger th {
  text-align: left; font-weight: 700; padding: .6rem .75rem;
  border-bottom: 2px solid var(--ink); white-space: nowrap;
}
table.ledger td { padding: .6rem .75rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.ledger tbody tr:hover { background: var(--surface); }
table.ledger td b, table.ledger td strong { font-weight: 700; }

/* upcoming list */
.upcoming { margin-top: var(--space-8); display: grid; gap: 0; }
.upcoming .item {
  display: grid; grid-template-columns: minmax(0,2fr) minmax(0,3fr) auto;
  gap: var(--space-4); align-items: baseline;
  padding-block: var(--space-4); border-top: 1px solid var(--rule);
}
.upcoming .item:last-child { border-bottom: 1px solid var(--rule); }
.upcoming .item h3 { font-size: var(--text-base); font-weight: 700; }
.upcoming .item p { font-size: var(--text-sm); color: var(--ink-muted); }
.upcoming .status {
  font-family: "Spline Sans Mono", ui-monospace, monospace;
  font-size: .72rem; letter-spacing: .14em; color: var(--accent-deep);
  border: 1.5px solid var(--accent-deep); border-radius: 4px;
  padding: .1rem .6rem; white-space: nowrap;
}
.upcoming .status.live { color: var(--accent-ink); background: var(--accent); border-color: var(--accent-deep); }

/* newsletter band */
.band { background: var(--ink); color: oklch(0.95 0.01 var(--hue)); }
.band .wrap { padding-block: clamp(3rem, 7vw, 5rem); }
.band h2 { font-size: var(--text-xl); font-weight: 900; max-width: 24ch; }
.band p { color: oklch(0.78 0.02 var(--hue)); margin-top: var(--space-4); }
.band p b { color: oklch(0.95 0.01 var(--hue)); font-weight: 500; }
.band .btn-primary { margin-top: var(--space-6); border-color: transparent; }
.band a:not(.btn) { color: oklch(0.85 0.06 var(--hue)); }

/* ---------- article ---------- */
.article-header { padding-block: clamp(2.5rem, 6vw, 4.5rem) 0; }
.breadcrumb { font-size: var(--text-sm); color: var(--ink-muted); }
.breadcrumb a { color: var(--ink-muted); }
.article-header h1 { font-size: var(--text-2xl); font-weight: 900; margin-top: var(--space-4); }
.article-header .dek { margin-top: var(--space-4); font-size: var(--text-lg); color: var(--ink-muted); line-height: 1.5; }
.article-header .byline {
  margin-top: var(--space-6); font-size: var(--text-sm); color: var(--ink-muted);
  display: flex; gap: var(--space-4); flex-wrap: wrap; align-items: center;
}
.article-header .byline .updated {
  font-family: "Spline Sans Mono", ui-monospace, monospace;
  font-size: .72rem; letter-spacing: .12em; color: var(--accent-deep);
  border: 1.5px solid var(--accent-deep); border-radius: 4px; padding: .1rem .6rem;
}

.article-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 260px;
  gap: clamp(2rem, 5vw, 4rem);
  padding-block: var(--space-8) clamp(3rem, 7vw, 5rem);
}
.toc { position: sticky; top: var(--space-6); align-self: start; font-size: var(--text-sm); }
.toc h2 {
  font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-muted); font-weight: 500;
}
.toc ol { list-style: none; padding: 0; margin-top: var(--space-3); }
.toc li { padding-block: .3rem; border-top: 1px solid var(--rule); }
.toc a { color: var(--ink-muted); text-decoration: none; }
.toc a:hover { color: var(--accent-deep); }

article.guide h2 {
  font-size: var(--text-xl); font-weight: 900;
  margin-top: var(--space-16); padding-top: var(--space-8);
  border-top: 1px solid var(--rule);
  scroll-margin-top: var(--space-6);
}
article.guide h2:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
article.guide h3 { font-size: var(--text-lg); font-weight: 700; margin-top: var(--space-8); }
article.guide p { margin-top: var(--space-4); }
article.guide ul, article.guide ol { margin-top: var(--space-4); padding-left: 1.4rem; }
article.guide li { margin-top: var(--space-2); }
article.guide li::marker { color: var(--accent-deep); }
article.guide .lead-def {
  background: var(--surface); border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: var(--space-4) var(--space-6);
  margin-top: var(--space-4);
  font-size: var(--text-lg); line-height: 1.5;
}
article.guide pre.diagram {
  margin-top: var(--space-6);
  background: var(--receipt); border: 1px solid var(--border); border-radius: var(--radius);
  padding: var(--space-6);
  overflow-x: auto;
  font-family: "Spline Sans Mono", ui-monospace, monospace;
  font-size: .72rem; line-height: 1.5;
  color: var(--ink);
}
article.guide .note {
  font-size: var(--text-sm); color: var(--ink-muted); margin-top: var(--space-3);
}

/* FAQ */
.faq { margin-top: var(--space-6); display: grid; gap: 0; }
.faq details { border-top: 1px solid var(--rule); }
.faq details:last-child { border-bottom: 1px solid var(--rule); }
.faq summary {
  cursor: pointer; font-weight: 700; padding-block: var(--space-4);
  list-style: none; display: flex; justify-content: space-between; gap: var(--space-4);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent-deep); font-weight: 400; }
.faq details[open] summary::after { content: "–"; }
.faq details p { padding-bottom: var(--space-4); color: var(--ink-muted); margin-top: 0; }

/* article CTA */
.article-cta {
  margin-top: var(--space-16);
  background: var(--receipt); border: 1px solid var(--border); border-radius: var(--radius);
  padding: var(--space-8);
}
.article-cta h2 { border: 0 !important; margin-top: 0 !important; padding-top: 0 !important; font-size: var(--text-lg) !important; }
.article-cta p { color: var(--ink-muted); }

/* ---------- footer ---------- */
footer.site { padding-block: var(--space-8); font-size: var(--text-sm); color: var(--ink-muted); border-top: 1px solid var(--border); }
footer.site .wrap { display: flex; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .article-layout { grid-template-columns: 1fr; }
  .toc { position: static; order: -1; }
  .feature-card { grid-template-columns: 1fr; }
  .feature-card .contents { border-left: 0; padding-left: 0; border-top: 1px solid var(--rule); padding-top: var(--space-4); }
  .upcoming .item { grid-template-columns: 1fr; gap: var(--space-2); }
}
@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { transition-duration: .01ms !important; animation: none !important; }
  html { scroll-behavior: auto; }
}
