/* ==========================================================================
   Uroboros site system. One stylesheet for every page.
   House theme: monochrome, Geist + Geist Mono,
   hairlines instead of cards, red reserved for Panic / frozen states only.
   ========================================================================== */
:root {
  color-scheme: dark;
  --bg: #050505;
  --surface: #0C0C0C;
  --surface-2: #131313;
  --surface-footer: #070707;
  --accent: #FFFFFF;
  --accent-ink: #050505;
  --text: #EDEDED;
  --text-muted: rgba(237, 237, 237, 0.68);
  --text-faint: rgba(237, 237, 237, 0.54);
  --text-ghost: rgba(237, 237, 237, 0.28);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --line-hover: rgba(255, 255, 255, 0.28);
  --grid-line: rgba(255, 255, 255, 0.035);
  --negative: #FF3B3B;          /* Panic and frozen only */
  --negative-soft: rgba(255, 59, 59, 0.10);
  --negative-line: rgba(255, 59, 59, 0.45);

  --font-body: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --r-sm: 4px; --r-md: 6px; --r-lg: 8px;

  --container: 1120px;
  --gutter: 40px;
  --bar-h: 64px;
  --strip-h: 32px;
  --nav-h: 96px;
  --section-y: 112px;
  --head-gap: 56px;

  /* type scale (ratio ~1.25 from 16, display set by eye) */
  --fs-display: 72px;  --lh-display: 1.0;
  --fs-h1: 56px;       --lh-h1: 1.04;
  --fs-h2: 44px;       --lh-h2: 1.08;
  --fs-h3: 22px;       --lh-h3: 1.3;
  --fs-lead: 19px;     --lh-lead: 1.5;
  --fs-body: 16px;     --lh-body: 1.6;
  --fs-sm: 14px;       --lh-sm: 1.55;
  --fs-xs: 12px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 150ms;
}
@media (max-width: 1023px) {
  :root { --gutter: 32px; --section-y: 88px; --head-gap: 44px;
    --fs-display: 56px; --fs-h1: 44px; --fs-h2: 36px; --fs-h3: 20px; }
}
@media (max-width: 767px) {
  :root { --gutter: 16px; --section-y: 64px; --head-gap: 32px;
    --fs-display: 40px; --fs-h1: 36px; --fs-h2: 30px; --fs-h3: 19px; --fs-lead: 17px; }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 16px); scroll-behavior: smooth; }
html, body { overflow-x: clip; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-body);
  font-size: var(--fs-body); line-height: var(--lh-body); letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4 { margin: 0; font-weight: 500; color: var(--text); text-wrap: balance; }
h1 { font-weight: 600; letter-spacing: -0.045em; }
h2 { letter-spacing: -0.038em; }
h3 { letter-spacing: -0.02em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; }
input, select, textarea, button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.num, td, th { font-variant-numeric: tabular-nums; }
.mono, code { font-family: var(--font-mono); letter-spacing: 0; }
code { font-size: .92em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }
::selection { background: var(--accent); color: var(--accent-ink); }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.link { text-decoration: underline; text-decoration-color: var(--line-hover); text-underline-offset: 3px; }
.link:hover { text-decoration-color: var(--text); }
.prose a { text-decoration: underline; text-decoration-color: var(--line-hover); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--text); }

.container { width: 100%; max-width: calc(var(--container) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: calc(var(--section-y) * .8); position: relative; }
.rule-top::before { content: ""; position: absolute; top: 0; left: 50%; width: 100vw; height: 1px; transform: translateX(-50%); background: var(--line); pointer-events: none; }

/* section head: h2 on the left, the sub on the right, bottoms aligned */
.split-head { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: end; margin: 0 0 var(--head-gap); }
.split-head h2 { grid-column: 1 / span 7; font-size: var(--fs-h2); line-height: var(--lh-h2); }
.split-head > p:not(.kicker) { grid-column: 9 / -1; max-width: 420px; color: var(--text-muted); font-size: 15px; line-height: 1.55; padding-bottom: 4px; }
@media (max-width: 1023px) {
  .split-head h2, .split-head > p:not(.kicker) { grid-column: 1 / -1; }
  .split-head > p:not(.kicker) { margin-top: 16px; max-width: 560px; padding-bottom: 0; }
}

/* numbered mono index line that opens every section */
.kicker { display: flex; align-items: center; gap: 10px; margin: 0 0 16px;
  font-family: var(--font-mono); font-size: 12px; line-height: 1.4; font-weight: 400;
  letter-spacing: .08em; text-transform: uppercase; color: var(--text-faint); }
.kicker .n { color: var(--text); }
.kicker .n::after { content: ""; display: inline-block; width: 16px; height: 1px;
  margin-left: 10px; vertical-align: middle; background: var(--line-strong); }
.split-head > .kicker { grid-column: 1 / -1; }

/* hairline definition rows for prose lists */
.rows { margin: 0; border-top: 1px solid var(--line-strong); }
.rows > div { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.rows dt { grid-column: 1 / span 5; font-size: 17px; font-weight: 500; letter-spacing: -.02em; }
.rows dd { grid-column: 7 / -1; margin: 0; color: var(--text-muted); font-size: 15px;
  line-height: 1.5; max-width: 520px; }
.rows > div:hover { background: linear-gradient(90deg, rgba(255,255,255,.025), transparent 80%); }
@media (max-width: 1023px) {
  .rows > div { grid-template-columns: minmax(0, 1fr); row-gap: 6px; }
  .rows dt, .rows dd { grid-column: 1 / -1; }
}

/* mono spec strip under the hero */
.spec-sec { padding-top: 32px; padding-bottom: 24px; }
.spec-line { display: flex; flex-wrap: wrap; border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line); font-family: var(--font-mono); font-size: 12px;
  color: var(--text-muted); }
.spec-line span { padding: 14px 20px; border-left: 1px solid var(--line); }
.spec-line span:first-child { border-left: 0; padding-left: 0; color: var(--text); }
@media (max-width: 767px) {
  .spec-line { flex-direction: column; }
  .spec-line span, .spec-line span:first-child { padding: 10px 0; border-left: 0; }
  .spec-line span + span { border-top: 1px solid var(--line); }
}

/* closing CTA with a command block */
.cta { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 64px;
  align-items: end; }
.cta h2 { max-width: 640px; font-size: var(--fs-h2); line-height: var(--lh-h2); }
.cta .sub { margin-top: 16px; max-width: 560px; color: var(--text-muted); font-size: 16px;
  line-height: 1.55; }
.cta .btn { margin-top: 32px; }
.cta-cmd { border-top: 1px solid var(--line-strong); padding-top: 16px; min-width: 0; }
.cta-cmd .cmd-head { display: flex; justify-content: space-between; align-items: center; gap: 12px;
  font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); }
.cta-cmd code { display: block; margin-top: 12px; padding: 16px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-md); font-family: var(--font-mono);
  font-size: 13px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 1023px) { .cta { grid-template-columns: minmax(0, 1fr); gap: 40px; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border: 1px solid transparent; border-radius: var(--r-md);
  font-size: 14px; font-weight: 500; line-height: 1; letter-spacing: -0.006em;
  white-space: nowrap; cursor: pointer; background: none;
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.btn:active { transform: translateY(1px); }
.btn--lg { height: 44px; padding: 0 20px; font-size: 15px; }
.btn--sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn--primary { background: var(--text); color: var(--accent-ink); border-color: var(--text); }
.btn--primary:hover { background: var(--accent); border-color: var(--accent); }
.btn--secondary { color: var(--text); border-color: var(--line-strong); }
.btn--secondary:hover { background: rgba(255, 255, 255, 0.05); border-color: var(--line-hover); }
.btn--danger { color: var(--negative); border-color: var(--negative-line); }
.btn--danger:hover { background: var(--negative-soft); border-color: var(--negative); }
.btn--danger.armed { background: var(--negative); color: #050505; border-color: var(--negative); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .4; cursor: not-allowed; transform: none; }

/* ---------- nav + CA strip ---------- */
.nav { position: fixed; inset: 0 0 auto 0; z-index: 50; background: transparent; border-bottom: 1px solid transparent; transition: background-color 200ms var(--ease-out), border-color 200ms var(--ease-out); }
.nav.is-scrolled { background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: saturate(150%) blur(14px); -webkit-backdrop-filter: saturate(150%) blur(14px); border-bottom-color: var(--line); }
.nav > .container { height: var(--bar-h); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; }
.logo { display: inline-flex; align-items: center; gap: 10px; justify-self: start; font-size: 18px; font-weight: 600; line-height: 1; letter-spacing: -0.035em; color: var(--text); }
.logo svg { width: 20px; height: 20px; flex: none; }
.nav-links { display: flex; align-items: stretch; gap: 2px; height: var(--bar-h); }
.nav-links a { position: relative; display: inline-flex; align-items: center; padding: 0 12px; font-family: var(--font-mono); font-size: 12px; font-weight: 400; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); transition: color var(--dur-fast); }
.nav-links a:hover, .nav-links a[aria-current] { color: var(--text); }
.nav-links a[aria-current]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 1px; background: var(--text); }
.nav-links a:focus-visible { outline-offset: -8px; }
.nav-cta { justify-self: end; display: flex; align-items: center; gap: 8px; }
.burger { display: none; justify-self: end; width: 40px; height: 40px; margin-right: -10px; border: 0; border-radius: var(--r-md); background: transparent; cursor: pointer; align-items: center; justify-content: center; }
.burger:hover { background: rgba(255, 255, 255, 0.05); }
.burger svg { width: 20px; height: 20px; }
.menu { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; padding: 0 var(--gutter) max(24px, env(safe-area-inset-bottom)); background: var(--bg); opacity: 0; visibility: hidden; transition: opacity 200ms var(--ease-out), visibility 0s linear 200ms; }
.menu.is-open { opacity: 1; visibility: visible; transition: opacity 200ms var(--ease-out); }
.menu-top { display: flex; align-items: center; justify-content: space-between; height: var(--bar-h); border-bottom: 1px solid var(--line); }
.menu nav { display: grid; margin-top: 8px; }
.menu nav a { display: flex; align-items: center; height: 56px; border-bottom: 1px solid var(--line); font-size: 18px; font-weight: 500; letter-spacing: -0.02em; color: var(--text-muted); }
.menu nav a[aria-current] { color: var(--text); }
body.menu-open { overflow: hidden; }
@media (max-width: 1023px) {
  .nav-links { display: none; }
  .nav > .container { grid-template-columns: 1fr auto auto; gap: 12px; }
  .burger { display: inline-flex; }
}
.ca-strip { height: var(--strip-h); border-bottom: 1px solid var(--line); background: var(--bg); font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); }
.ca-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.ca-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ca-copy { all: unset; cursor: pointer; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ca-copy:hover { text-decoration: underline; text-underline-offset: 3px; }
.ca-copy:focus-visible { outline: 1px solid var(--text); outline-offset: 2px; }
.ca-socials { display: flex; align-items: center; gap: 16px; flex: none; }
.ca-socials a:hover { color: var(--text); }
@media (max-width: 560px) { .ca-strip { font-size: 11px; } .ca-socials .ca-scan { display: none; } }

/* ---------- status chips (from status.json) ---------- */
.st { display: inline-flex; align-items: center; gap: 8px; height: 24px; padding: 0 9px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.st::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--text-ghost); }
.st[data-state="live"] { color: var(--accent-ink); background: var(--text); border-color: var(--text); }
.st[data-state="live"]::before { background: var(--accent-ink); }
.st[data-state="pending"]::before { background: var(--text-muted); }
.st[data-state="roadmap"] { border-style: dashed; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-ghost); flex: none; display: inline-block; }
.dot.on { background: var(--text); }
.dot.bad { background: var(--negative); }

/* ---------- tables ---------- */
.tbl-wrap { overflow-x: auto; border-top: 1px solid var(--line-strong); }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
.t th, .t td { padding: 13px 12px 13px 0; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.t thead th { font-weight: 400; font-size: 13px; color: var(--text-faint); white-space: nowrap; }
.t td.r, .t th.r { text-align: right; padding-right: 20px; }
.t tr > :last-child { padding-right: 0; }
.t td b { font-weight: 500; }
.t td small { display: block; margin-top: 2px; font-size: 12px; color: var(--text-faint); }
.t .mono { font-size: 13px; }

/* ---------- facts list ---------- */
.kv { margin: 0; display: grid; border-top: 1px solid var(--line-strong); }
.kv > div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv dt { color: var(--text-faint); }
.kv dd { margin: 0; text-align: right; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }

/* ---------- notes ---------- */
.note { border: 1px solid var(--line-strong); border-radius: var(--r-md); padding: 14px 16px; font-size: 14px; line-height: 1.55; color: var(--text-muted); }
.note b { color: var(--text); font-weight: 500; }
.note.danger { border-color: var(--negative-line); background: var(--negative-soft); color: var(--text); }
.note.danger b { color: var(--negative); }
.empty { border: 1px dashed var(--line-strong); border-radius: var(--r-lg); padding: 28px 24px; color: var(--text-muted); font-size: 15px; display: grid; gap: 10px; justify-items: start; }
.empty h3 { font-size: 18px; }

/* ---------- command blocks ---------- */
.cmd { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); font-family: var(--font-mono); font-size: 12.5px; line-height: 1.6; }
.cmd code { flex: 1; min-width: 0; overflow-wrap: anywhere; white-space: pre-wrap; color: var(--text); }
.copy { flex: none; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: none; padding: 2px 8px; font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); cursor: pointer; }
.copy:hover { color: var(--text); border-color: var(--line-hover); }

/* ---------- FAQ ---------- */
.faq { display: grid; border-top: 1px solid var(--line-strong); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-q { width: 100%; min-height: 60px; padding: 18px 0; display: flex; align-items: center; justify-content: space-between; gap: 24px; background: none; border: 0; font-size: 17px; font-weight: 500; letter-spacing: -0.02em; text-align: left; cursor: pointer; }
.faq-ic { width: 24px; height: 24px; flex: none; border-radius: var(--r-sm);
  border: 1px solid var(--line-strong); background: transparent; color: var(--text-muted);
  display: grid; place-items: center; transition: transform 200ms var(--ease-out); }
.faq-ic svg { width: 12px; height: 12px; display: block; transition: transform 200ms var(--ease-out); }
.faq-item:not(.is-open):hover .faq-ic { transform: rotate(90deg); color: var(--text);
  border-color: var(--line-hover); }
.faq-item.is-open .faq-ic { background: transparent; color: var(--text);
  border-color: var(--line-hover); }
.faq-item.is-open .faq-ic svg { transform: rotate(45deg); }
.faq-a { display: grid; grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows 300ms var(--ease-out), visibility 0s linear 300ms; }
.faq-item.is-open .faq-a { grid-template-rows: 1fr; visibility: visible; transition: grid-template-rows 300ms var(--ease-out), visibility 0s; }
.faq-a > div { overflow: hidden; }
.faq-a p { padding: 0 0 20px; max-width: 68ch; color: var(--text-muted); }
.faq-a p + p { margin-top: -8px; }
/* left rail: kicker + title pinned in columns 1-3, accordion in 5-12 */
.faq-wrap { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px; align-items: start; }
.faq-head { grid-column: 1 / span 3; position: sticky; top: calc(var(--nav-h) + 32px); }
.faq-head h2 { font-size: var(--fs-h2); line-height: var(--lh-h2); }
.faq-head > p:last-child { margin-top: 16px; color: var(--text-muted); font-size: 15px; line-height: 1.55; }
.faq-wrap .faq { grid-column: 5 / -1; border-top: 1px solid var(--line-strong); }
.faq-wrap .faq-item { background: none; border: 0; border-bottom: 1px solid var(--line);
  border-radius: 0; box-shadow: none; }
.faq-wrap .faq-q { padding: 20px 0; border-radius: 0; }
.faq-wrap .faq-a p { padding: 0 48px 22px 0; font-size: 15px; line-height: 1.6; max-width: 62ch; }
@media (max-width: 1023px) {
  .faq-head { grid-column: 1 / -1; position: static; margin-bottom: 32px; }
  .faq-wrap .faq { grid-column: 1 / -1; }
  .faq-wrap .faq-a p { padding-right: 0; }
}

/* ---------- footer ---------- */
.footer { background: var(--surface-footer); border-top: 1px solid var(--line); color: var(--text-faint); font-size: var(--fs-sm); }
.f-top { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.3fr; }
.f-col { min-width: 0; padding: 56px 32px 48px; border-left: 1px solid var(--line); }
.f-col:first-child { border-left: 0; padding-left: 0; }
.f-col:last-child { padding-right: 0; }
.f-col .desc { margin-top: 20px; max-width: 300px; line-height: var(--lh-sm); }
.f-col h2 { margin: 0 0 14px; font-size: 13px; font-weight: 400; letter-spacing: 0; color: var(--text-faint); }
.f-links { list-style: none; display: grid; gap: 2px; }
.f-links a { display: inline-block; padding: 5px 0; color: var(--text-muted); }
.f-links a:hover { color: var(--text); }
.f-bottom { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 32px; align-items: baseline; padding: 20px 0 28px; border-top: 1px solid var(--line); font-family: var(--font-mono); font-size: 11px; line-height: 1.6; }
@media (max-width: 1023px) {
  .f-top { grid-template-columns: 1fr 1fr 1fr; }
  .f-col:first-child { grid-column: 1 / -1; padding: 48px 0 32px; border-bottom: 1px solid var(--line); }
  .f-col:nth-child(2) { border-left: 0; padding-left: 0; }
  .f-col { padding: 32px 24px 40px; }
}
@media (max-width: 767px) {
  .f-top { grid-template-columns: 1fr 1fr; }
  .f-col, .f-col:nth-child(2) { padding: 28px 0 8px; border-left: 0; }
  .f-col:first-child { padding: 40px 0 28px; }
  .f-col:last-child { grid-column: 1 / -1; padding-bottom: 32px; }
  .f-bottom { grid-template-columns: minmax(0, 1fr); gap: 8px; }
}

/* ---------- page hero (inner pages) ---------- */
.page-hero { padding: calc(var(--nav-h) + 88px) 0 64px; position: relative; isolation: isolate; }
.page-hero::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 56px 56px, linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / 56px 56px;
  -webkit-mask-image: linear-gradient(#000 20%, transparent); mask-image: linear-gradient(#000 20%, transparent); }
.page-hero h1 { font-size: var(--fs-h1); line-height: var(--lh-h1); max-width: 820px; }
.page-hero .lead { margin-top: 24px; max-width: 600px; color: var(--text-muted); font-size: var(--fs-lead); line-height: var(--lh-lead); }
.page-hero .meta { margin-bottom: 20px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
@media (max-width: 767px) { .page-hero { padding: calc(var(--nav-h) + 48px) 0 40px; } }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation: none !important; }
}
