:root {
  --paper: #EEF1F0;
  --white: #FFFFFF;
  --ink: #17232C;
  --ink-2: #3E4D55;
  --mute: #5C6B72;
  --line: #CBD3D2;
  --brass: #C99A45;
  --brass-ink: #7D5B1C;
  --patina: #2F6F6A;
  --red: #B23A2E;
  --sans: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --wrap: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: var(--patina); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--brass); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { margin: 0; line-height: 1.12; letter-spacing: -0.015em; }
h2 { font-size: clamp(1.75rem, 3.2vw, 2.5rem); font-weight: 700; max-width: 22ch; }
h3 { font-size: 1.125rem; font-weight: 650; line-height: 1.3; letter-spacing: -0.005em; }
p { margin: 0; }
code { font-family: var(--mono); font-size: 0.9em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

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

.skip { position: absolute; left: 1rem; top: -4rem; background: var(--ink); color: var(--white); padding: .6rem 1rem; z-index: 10; border-radius: 6px; }
.skip:focus { top: 1rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 1.4rem;
  background: var(--ink); color: var(--white);
  font-weight: 600; text-decoration: none; border-radius: 999px;
  border: 1.5px solid var(--ink);
  transition: background-color .15s ease, color .15s ease;
}
.btn:hover { background: var(--patina); border-color: var(--patina); color: var(--white); }
.btn-quiet { background: transparent; color: var(--ink); }
.btn-quiet:hover { background: var(--ink); border-color: var(--ink); }
.btn-small { min-height: 40px; padding: 0 1.05rem; font-size: .95rem; }
.btn-light { background: var(--brass); border-color: var(--brass); color: var(--ink); }
.btn-light:hover { background: var(--white); border-color: var(--white); color: var(--ink); }

/* Header */
.site-head { border-bottom: 1px solid var(--line); background: var(--paper); }
.head-row { display: flex; align-items: center; gap: 2rem; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 1.2rem; letter-spacing: -0.01em; }
.site-head nav { margin-left: auto; }
.site-head nav ul { display: flex; gap: 1.6rem; list-style: none; margin: 0; padding: 0; }
.site-head nav a { color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: .98rem; }
.site-head nav a:hover { color: var(--ink); text-decoration: underline; }
@media (max-width: 820px) {
  .site-head nav { display: none; }
  .head-row .btn-small { margin-left: auto; }
}

/* Hero */
.hero { padding: clamp(3rem, 7vw, 6rem) 0 clamp(3rem, 6vw, 5rem); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.hero h1 {
  font-size: clamp(2.5rem, 5.6vw, 4.4rem);
  font-weight: 800; letter-spacing: -0.035em; line-height: 1.02;
  max-width: 14ch;
}
.lede { margin-top: 1.6rem; font-size: 1.2rem; line-height: 1.55; color: var(--ink-2); max-width: 36em; }
.cta-row { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }
.fine { margin-top: 1.4rem; color: var(--mute); font-size: .95rem; }

/* The ledger: the one memorable thing */
.ledger {
  margin: 0; background: var(--ink); color: #DCE4E3;
  border-radius: 18px; padding: 1.4rem 1.4rem 1.2rem;
  box-shadow: 0 30px 60px -30px rgba(23, 35, 44, .55);
}
.ledger figcaption { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 0 .2rem 1rem; border-bottom: 1px solid rgba(255,255,255,.12); }
.ledger figcaption span:first-child { font-weight: 700; color: var(--white); font-size: 1.05rem; }
.ledger-sub { color: #9FB0B3; font-size: .85rem; }
.chain { list-style: none; margin: 1rem 0 0; padding: 0; position: relative; }
.rec {
  position: relative; margin-left: 1.6rem; padding: .8rem 1rem;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.09); border-radius: 10px;
  font-family: var(--mono); font-size: .8rem; line-height: 1.5;
}
.rec + .rec { margin-top: 1.1rem; }
/* chain link between records */
.rec::before {
  content: ""; position: absolute; left: -1.15rem; top: 1.05rem;
  width: 9px; height: 9px; border-radius: 50%; background: var(--brass);
}
.rec:not(:last-child)::after {
  content: ""; position: absolute; left: calc(-1.15rem + 4px); top: calc(1.05rem + 4px);
  width: 1.5px; height: calc(100% + 1.1rem); background: var(--brass);
}
.rec-top { display: flex; justify-content: space-between; gap: .8rem; }
.tool { color: var(--white); font-weight: 500; }
.st { padding: 0 .5rem; border-radius: 4px; font-size: .75rem; }
.st.ok { color: #9ED6C8; background: rgba(47,111,106,.35); }
.st.denied { color: #FFB4A8; background: rgba(178,58,46,.32); }
.rec-meta { color: #9FB0B3; margin-top: .15rem; font-family: var(--sans); font-size: .82rem; }
.rec-hash { display: flex; justify-content: space-between; gap: .8rem; margin-top: .35rem; color: #C9B285; }
.verified { margin-top: 1.1rem; display: flex; align-items: center; gap: .5rem; color: #9ED6C8; font-size: .9rem; font-weight: 500; padding-left: .2rem; }

@media (prefers-reduced-motion: no-preference) {
  .rec, .verified { animation: append .5s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(.35s + var(--i) * .32s); }
  @keyframes append { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
}

/* Generic sections */
.section { padding: clamp(4rem, 8vw, 6.5rem) 0; }
.band { background: var(--white); border-block: 1px solid var(--line); padding: clamp(4rem, 8vw, 6.5rem) 0; }
.section-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem 4rem; align-items: end; margin-bottom: clamp(2.2rem, 4vw, 3.2rem); }
.section-head p { color: var(--ink-2); max-width: 38em; }
.two-col { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.two-col > div:first-child p { margin-top: 1.2rem; color: var(--ink-2); max-width: 30em; }

/* Problem */
.problems { display: grid; gap: 0; }
.problem { padding: 1.4rem 0; border-top: 1px solid var(--line); }
.problem:first-child { border-top: 0; padding-top: 0; }
.problem p { margin-top: .5rem; color: var(--ink-2); max-width: 36em; }

/* Architecture */
.arch { margin: 0; }
.arch-scroll { overflow-x: auto; background: var(--white); border: 1px solid var(--line); border-radius: 18px; padding: clamp(1rem, 3vw, 2rem); }
.arch svg { display: block; min-width: 760px; width: 100%; height: auto; font-family: var(--sans); }
.arch figcaption { margin-top: 1rem; color: var(--mute); font-size: .95rem; }
.svg-h { font-size: 19px; font-weight: 700; fill: var(--ink); }
.svg-h2 { font-size: 16px; font-weight: 650; fill: var(--ink); }
.svg-s { font-size: 13.5px; fill: var(--ink-2); }
.svg-inv { fill: var(--white); font-size: 20px; }
.svg-inv2 { fill: #9FB0B3; }
.svg-l { font-size: 13px; font-weight: 600; fill: var(--ink); }
.svg-l2 { font-size: 12px; fill: var(--mute); }
.svg-steps rect { fill: rgba(255,255,255,.07); stroke: rgba(255,255,255,.22); }
.svg-steps text { fill: #E3EAE9; font-size: 13.5px; font-weight: 500; }
.svg-audit { font-size: 14.5px; font-weight: 700; fill: var(--ink); }
.svg-muted { font-size: 14px; font-weight: 600; fill: #6B7A80; }
.svg-muted2 { font-size: 12.5px; fill: #6B7A80; }

.steps { list-style: none; counter-reset: step; margin: clamp(2.5rem, 5vw, 3.5rem) 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem; }
.steps li { counter-increment: step; border-top: 2px solid var(--ink); padding-top: 1rem; }
.steps li::before { content: counter(step); display: block; font-weight: 800; font-size: 1.5rem; color: var(--brass-ink); margin-bottom: .4rem; font-variant-numeric: tabular-nums; }
.steps p { margin-top: .5rem; color: var(--ink-2); font-size: 1rem; }

/* Security (dark band) */
.band-dark { background: var(--ink); color: #DCE4E3; }
.band-dark h2 { color: var(--white); }
.band-dark .section-head p { color: #B5C3C5; }
.controls { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 3rem; }
.controls div { padding: 1.5rem 0; border-top: 1px solid rgba(255,255,255,.16); }
.controls dt { font-weight: 700; color: var(--white); font-size: 1.1rem; }
.controls div:nth-child(4) dt { color: var(--brass); }
.controls dd { margin: .5rem 0 0; color: #B5C3C5; font-size: 1rem; }

/* Tokens */
.token-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.levers { list-style: none; margin: 0; padding: 0; }
.levers li { padding: 1rem 0; border-top: 1px solid var(--line); color: var(--ink-2); }
.levers li:first-child { border-top: 0; padding-top: 0; }
.levers strong { color: var(--ink); }
.payloads { display: grid; gap: 1rem; }
.payload { margin: 0; background: var(--white); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.payload figcaption { padding: .7rem 1rem; font-size: .9rem; font-weight: 600; color: var(--ink-2); border-bottom: 1px solid var(--line); }
.payload pre { margin: 0; padding: 1rem; overflow-x: auto; font-size: .78rem; line-height: 1.6; color: var(--mute); }
.payload-lean { border-color: var(--patina); }
.payload-lean figcaption { background: var(--patina); color: var(--white); border-color: var(--patina); }
.payload-lean pre { color: var(--ink); font-size: .85rem; }
.note { color: var(--mute); font-size: .95rem; }

/* Conversation */
.convo { display: grid; gap: .9rem; }
.msg { border-radius: 16px; padding: 1.1rem 1.25rem; }
.msg .who { font-size: .85rem; font-weight: 600; color: var(--mute); margin-bottom: .3rem; }
.msg.user { background: var(--paper); justify-self: end; max-width: 30em; border: 1px solid var(--line); }
.msg.user p:last-child { font-size: 1.1rem; font-weight: 500; }
.msg.ai { background: var(--white); border: 1.5px solid var(--ink); }
.msg.ai > p + p, .msg.ai table + p { margin-top: .8rem; }
.calls { border-left: 2px solid var(--brass); padding: .2rem 0 .2rem 1rem; margin-left: .5rem; color: var(--mute); font-size: .92rem; display: grid; gap: .25rem; }
.calls code { color: var(--brass-ink); font-weight: 500; margin-right: .35rem; }
.convo table { width: 100%; border-collapse: collapse; margin-top: .8rem; font-size: .93rem; }
.convo th, .convo td { text-align: left; padding: .5rem .5rem .5rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.convo th { font-weight: 600; color: var(--mute); font-size: .85rem; }
.convo td:first-child { font-variant-numeric: tabular-nums; font-weight: 600; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; }
.convo td.num:last-child { color: var(--red); font-weight: 600; }

/* Deployment */
.table-wrap { overflow-x: auto; }
.deploy { width: 100%; border-collapse: collapse; min-width: 620px; }
.deploy th, .deploy td { text-align: left; padding: 1.1rem 1.5rem 1.1rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.deploy thead th { font-size: .9rem; color: var(--mute); font-weight: 600; border-bottom: 2px solid var(--ink); }
.deploy tbody th { font-weight: 700; width: 30%; }
.deploy td { color: var(--ink-2); }

/* Roadmap */
.roadmap { list-style: none; margin: 0; padding: 0; }
.roadmap li { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 1rem; padding: 1.25rem 0; border-top: 1px solid var(--line); }
.roadmap li:first-child { border-top: 0; padding-top: 0; }
.roadmap p { margin-top: .35rem; color: var(--ink-2); }
.tag { align-self: start; justify-self: start; font-size: .82rem; font-weight: 600; color: var(--brass-ink); border: 1.5px solid var(--brass); border-radius: 999px; padding: .1rem .65rem; }

/* FAQ */
.faq-wrap { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(2rem, 6vw, 5rem); }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; padding: 1.15rem 2.5rem 1.15rem 0; font-weight: 650; font-size: 1.08rem; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: .4rem; top: 50%; width: 10px; height: 10px; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: translateY(-70%) rotate(45deg); transition: transform .2s ease; }
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq details p { padding: 0 0 1.3rem; color: var(--ink-2); max-width: 40em; }

/* Closing */
.closing { background: var(--ink); color: var(--white); padding: clamp(3.5rem, 7vw, 5rem) 0; }
.closing-row { display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.closing h2 { color: var(--white); max-width: 26ch; font-size: clamp(1.5rem, 2.8vw, 2.1rem); }

/* Footer */
.site-foot { padding: 2.5rem 0 3rem; font-size: .92rem; color: var(--mute); }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 2rem; }
.foot-brand { color: var(--ink); font-weight: 600; }
.legal { max-width: 60em; }

/* Responsive */
@media (max-width: 980px) {
  .hero-grid, .two-col, .token-grid, .faq-wrap, .section-head, .foot-grid { grid-template-columns: minmax(0, 1fr); }
  .controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero h1 { max-width: 16ch; }
}
@media (max-width: 640px) {
  body { font-size: 1rem; }
  .controls, .steps { grid-template-columns: minmax(0, 1fr); }
  .closing-row { flex-direction: column; align-items: flex-start; }
  .roadmap li { grid-template-columns: minmax(0, 1fr); gap: .5rem; }
  .rec-hash { flex-direction: column; gap: 0; }
  .ledger { padding: 1.1rem .9rem 1rem; }
  .rec { margin-left: 1.3rem; }
}
