/* lazarus-xbt.xyz — the hub. Shares the pool site's palette and type so the ecosystem reads as
   one thing: warm ink, brass, Newsreader for display, IBM Plex for text and figures. */

:root {
  color-scheme: dark;
  --bg: oklch(13.5% 0.011 78);
  --bg-raised: oklch(17% 0.013 78);
  --bg-inset: oklch(11.5% 0.011 78);
  --bg-card: oklch(16% 0.013 78);
  --ink: oklch(94% 0.014 86);
  --muted: oklch(71% 0.02 80);
  --faint: oklch(54% 0.018 80);
  --line: oklch(26% 0.015 78);
  --line-strong: oklch(38% 0.02 78);
  --brass: oklch(80% 0.11 84);
  --brass-dim: oklch(63% 0.08 84);
  --brass-ink: oklch(20% 0.04 75);
  --good: oklch(76% 0.13 155);
  --warn: oklch(80% 0.12 85);
  --bad: oklch(68% 0.145 28);
  --sans: "IBM Plex Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: "Newsreader", "Iowan Old Style", Palatino, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --measure: 74rem;
  --gutter: clamp(1.1rem, 4vw, 2.5rem);
  --r: 14px;
  --r-sm: 9px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --header-h: 4rem;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 1rem); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 clamp(1rem, 0.97rem + 0.15vw, 1.075rem)/1.65 var(--sans);
  font-feature-settings: "kern", "liga", "cv05";
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* The page sits on a very slow brass glow, so flat sections never look like a slab. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(60rem 40rem at 78% -10%, oklch(80% 0.11 84 / 0.07), transparent 60%),
    radial-gradient(45rem 30rem at 5% 8%, oklch(70% 0.09 250 / 0.05), transparent 65%);
}

main, header, footer { position: relative; z-index: 1; }

a { color: var(--brass); text-decoration: none; }
a:hover { color: oklch(88% 0.1 84); }
main a:not(.btn):not(.card):not(.tile):not(.plain) { text-decoration: underline; text-decoration-color: oklch(63% 0.08 84 / 0.5); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 0.6rem; }
h1 { font-size: clamp(2.4rem, 1.6rem + 3.6vw, 4.1rem); }
h2 { font-size: clamp(1.8rem, 1.3rem + 2vw, 2.6rem); }
h3 { font-size: clamp(1.15rem, 1.05rem + 0.5vw, 1.4rem); }
p { margin: 0 0 1rem; }
ul, ol { margin: 0 0 1rem; padding-left: 1.2rem; }
li { margin: 0.35rem 0; }
strong { font-weight: 600; color: oklch(97% 0.012 86); }
code, kbd, samp { font-family: var(--mono); font-size: 0.88em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 3rem 0; }

.wrap { width: min(100% - 2 * var(--gutter), var(--measure)); margin-inline: auto; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; z-index: 99; background: var(--brass); color: var(--brass-ink); padding: 0.6rem 1rem; border-radius: 0 0 var(--r-sm) 0; font-weight: 600; }
.skip:focus { left: 0; color: var(--brass-ink); }

.kicker { font: 600 0.72rem/1 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--brass-dim); margin: 0 0 0.9rem; }
.lede { font-size: clamp(1.08rem, 1rem + 0.4vw, 1.3rem); color: var(--muted); max-width: 46rem; }
.note { color: var(--muted); font-size: 0.95rem; }
.faint { color: var(--faint); }
.mono { font-family: var(--mono); }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: oklch(13.5% 0.011 78 / 0.82);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.topbar { display: flex; align-items: center; gap: clamp(0.8rem, 2vw, 2rem); height: var(--header-h); }
.wordmark { display: inline-flex; align-items: baseline; gap: 0.45rem; font-family: var(--serif); font-size: 1.3rem; letter-spacing: 0.01em; color: var(--ink); white-space: nowrap; }
.wordmark:hover { color: var(--ink); }
.wordmark em { font-style: italic; color: var(--brass); }
.wordmark .chi { width: 0.78em; height: 1.05em; fill: var(--brass); align-self: center; }
.site-nav { display: flex; align-items: center; gap: clamp(0.5rem, 1.4vw, 1.4rem); margin-left: auto; }
.site-nav a { color: var(--muted); font-size: 0.95rem; padding: 0.35rem 0; border-bottom: 1px solid transparent; }
.site-nav a:hover { color: var(--ink); border-bottom-color: var(--brass-dim); }
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--brass); }
.nav-toggle { display: none; }

@media (max-width: 62rem) {
  .nav-toggle {
    display: inline-flex; align-items: center; gap: 0.5rem; margin-left: auto;
    background: none; border: 1px solid var(--line-strong); color: var(--ink);
    border-radius: var(--r-sm); padding: 0.45rem 0.7rem; font: 500 0.9rem var(--sans); cursor: pointer;
  }
  .site-nav {
    position: fixed; inset: var(--header-h) 0 auto; flex-direction: column; align-items: stretch;
    gap: 0; padding: 0.6rem var(--gutter) 1.2rem; margin: 0;
    background: var(--bg-inset); border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 40px oklch(0% 0 0 / 0.55);
    transform: translateY(-120%); transition: transform 0.28s var(--ease); max-height: calc(100dvh - var(--header-h)); overflow: auto;
  }
  .site-nav[data-open="true"] { transform: none; }
  .site-nav a { padding: 0.7rem 0; border-bottom: 1px solid var(--line); font-size: 1.02rem; }
  .site-nav .btn { margin-top: 0.8rem; text-align: center; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.62rem 1.15rem; border-radius: 999px; border: 1px solid var(--brass);
  background: var(--brass); color: var(--brass-ink); font: 600 0.95rem var(--sans);
  cursor: pointer; transition: transform 0.15s var(--ease), background 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}
.btn:hover { color: var(--brass-ink); background: oklch(85% 0.11 84); transform: translateY(-1px); box-shadow: 0 8px 24px oklch(80% 0.11 84 / 0.18); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn.ghost:hover { border-color: var(--brass); color: var(--brass); background: oklch(80% 0.11 84 / 0.07); box-shadow: none; }
.btn.small { padding: 0.42rem 0.85rem; font-size: 0.86rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.7rem; margin: 1.6rem 0 0; }

/* ---------- hero ---------- */
.hero { padding: clamp(3.5rem, 6vw, 6.5rem) 0 clamp(2.5rem, 4vw, 4rem); }
.hero-grid { display: grid; gap: clamp(2rem, 4vw, 3.5rem); align-items: start; }
@media (min-width: 64rem) { .hero-grid { grid-template-columns: minmax(0, 1.25fr) minmax(19rem, 0.75fr); } }
.hero-side { position: relative; }
.blocks-card h3 { justify-content: space-between; font-size: 1.05rem; }
.blocklist { list-style: none; margin: 0.4rem 0 0; padding: 0; }
.blocklist li { display: grid; grid-template-columns: auto 1fr auto; gap: 0.6rem; align-items: baseline; padding: 0.5rem 0; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.blocklist li:last-child { border-bottom: 0; }
.blocklist .h { font-family: var(--mono); color: var(--brass); font-variant-numeric: tabular-nums; }
.blocklist .who { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.blocklist .t { color: var(--faint); font-size: 0.82rem; white-space: nowrap; }
.hero h1 { max-width: 20ch; }
.hero h1 em { font-style: italic; color: var(--brass); }
.hero .lede { margin-top: 1.2rem; }

.statstrip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 1px; margin-top: clamp(2.5rem, 5vw, 4rem);
  background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
}
.statstrip div { background: var(--bg-card); padding: 1.05rem 1.1rem; }
.statstrip dt { font: 600 0.68rem/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); margin-bottom: 0.45rem; }
.statstrip dd { margin: 0; font-family: var(--mono); font-size: clamp(1.1rem, 1rem + 0.5vw, 1.4rem); color: var(--ink); font-variant-numeric: tabular-nums; }
.statstrip dd small { display: block; font-family: var(--sans); font-size: 0.78rem; color: var(--faint); margin-top: 0.2rem; letter-spacing: 0; }

/* ---------- sections ---------- */
.section { padding: clamp(3rem, 6vw, 5.5rem) 0; border-top: 1px solid var(--line); }
.section-head { max-width: 48rem; margin-bottom: clamp(2rem, 3vw, 3rem); }
.section.inset { background: linear-gradient(180deg, oklch(11.5% 0.011 78), transparent 70%); }

.grid { display: grid; gap: clamp(1rem, 2vw, 1.5rem); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(min(100%, 17.5rem), 1fr)); }

.card {
  display: block; background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--r); padding: clamp(1.2rem, 2vw, 1.6rem);
  transition: border-color 0.2s, transform 0.2s var(--ease), background 0.2s;
}
a.card:hover { border-color: var(--brass-dim); transform: translateY(-2px); background: oklch(17.5% 0.014 78); }
.card { display: flex; flex-direction: column; }
.card h3 { display: flex; align-items: center; gap: 0.55rem; margin-bottom: 0.5rem; color: var(--ink); flex-wrap: wrap; }
.card > .endpoint, .card > .more { margin-top: auto; }
.card > .endpoint + .more { margin-top: 0.9rem; }
.card p { color: var(--muted); font-size: 0.97rem; margin-bottom: 0; }
.card .tag { white-space: nowrap; font: 600 0.65rem/1 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--brass-dim); border: 1px solid var(--line-strong); border-radius: 999px; padding: 0.25rem 0.5rem; }
.card .more { display: inline-block; margin-top: 0.9rem; font-weight: 600; font-size: 0.92rem; color: var(--brass); }
.card .icon { width: 1.35rem; height: 1.35rem; flex: none; stroke: var(--brass); fill: none; stroke-width: 1.5; }

/* numbered steps */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 1.1rem; }
.steps li { counter-increment: step; padding-left: 3rem; position: relative; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: -0.1rem;
  width: 2rem; height: 2rem; border-radius: 50%; border: 1px solid var(--brass-dim);
  color: var(--brass); font: 600 0.9rem/2rem var(--mono); text-align: center;
}
.steps li h3 { margin-bottom: 0.25rem; }
.steps li p { color: var(--muted); margin-bottom: 0; }

/* endpoint / copy */
.endpoint { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; background: var(--bg-inset); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0.55rem 0.7rem; margin: 0.8rem 0 0; }
.endpoint code { font-size: 0.9rem; color: var(--ink); overflow-wrap: anywhere; }
.endpoint button { margin-left: auto; }
.copied { color: var(--good); font-size: 0.85rem; }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg-card); }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { text-align: left; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font: 600 0.7rem/1 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); background: var(--bg-inset); position: sticky; top: 0; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: oklch(18% 0.013 78); }
td.num { font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: right; }
.pill { display: inline-block; font: 600 0.68rem/1 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; padding: 0.28rem 0.55rem; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); }
.pill.rebel { color: var(--brass); border-color: var(--brass-dim); }
.pill.empire { color: var(--bad); border-color: oklch(68% 0.145 28 / 0.5); }
.pill.rim { color: var(--good); border-color: oklch(76% 0.13 155 / 0.45); }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line-strong); }
.timeline li { position: relative; padding: 0 0 1.6rem 1.6rem; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 0.55rem; width: 9px; height: 9px; border-radius: 50%; background: var(--brass-dim); }
.timeline li.now::before { background: var(--brass); box-shadow: 0 0 0 4px oklch(80% 0.11 84 / 0.18); }
.timeline .when { font: 600 0.72rem/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--brass-dim); }
.timeline h3 { margin: 0.35rem 0 0.25rem; font-size: 1.1rem; }
.timeline p { color: var(--muted); margin: 0; font-size: 0.95rem; }

/* callout */
.callout { border: 1px solid var(--line-strong); border-left: 3px solid var(--brass); border-radius: var(--r-sm); background: oklch(80% 0.11 84 / 0.05); padding: 1rem 1.1rem; margin: 1.5rem 0; }
.callout.warn { border-left-color: var(--warn); background: oklch(80% 0.12 85 / 0.06); }
.callout p:last-child { margin-bottom: 0; }

/* faq */
details.faq { border-bottom: 1px solid var(--line); padding: 0.2rem 0; }
details.faq summary { cursor: pointer; list-style: none; padding: 1rem 2rem 1rem 0; position: relative; font-family: var(--serif); font-size: 1.15rem; color: var(--ink); }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; position: absolute; right: 0.2rem; top: 0.95rem; font: 400 1.4rem/1 var(--mono); color: var(--brass); transition: transform 0.2s var(--ease); }
details.faq[open] summary::after { transform: rotate(45deg); }
details.faq .answer { padding: 0 0 1.1rem; color: var(--muted); max-width: 52rem; }
details.faq .answer p:last-child { margin-bottom: 0; }

/* footer */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-inset); padding: clamp(2.5rem, 4vw, 4rem) 0 2rem; margin-top: clamp(3rem, 6vw, 5rem); }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: minmax(min(100%, 16rem), 1.4fr) repeat(auto-fit, minmax(9rem, 1fr)); }
.footer-col p.category { font: 600 0.7rem/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); margin: 0 0 0.9rem; }
.footer-col a { display: block; color: var(--muted); font-size: 0.93rem; padding: 0.28rem 0; }
.footer-col a:hover { color: var(--brass); }
.footer-bottom { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); margin-top: 2.5rem; padding-top: 1.2rem; color: var(--faint); font-size: 0.87rem; }

/* misc */
.live { display: inline-flex; align-items: center; gap: 0.4rem; font: 600 0.7rem/1 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px oklch(76% 0.13 155 / 0.18); }
.live.stale::before { background: var(--faint); box-shadow: none; }
.prose { max-width: 48rem; }
/* a figure with its explanation under it, outside the stat strip */
p.mono small, .card p.mono small { display: block; margin-top: 0.3rem; font-family: var(--sans); font-size: 0.85rem; color: var(--faint); }
.prose h2 { margin-top: 2.8rem; }
.prose h3 { margin-top: 1.8rem; }
.prose dl { margin: 1rem 0; }
.prose dt { font-weight: 600; margin-top: 1rem; }
.prose dd { margin: 0.2rem 0 0; color: var(--muted); }

[data-reveal] { opacity: 0; transform: translateY(12px); }
[data-reveal].in { opacity: 1; transform: none; transition: opacity 0.5s var(--ease), transform 0.5s var(--ease); }
@media (prefers-reduced-motion: reduce) { [data-reveal] { opacity: 1; transform: none; } .btn:hover, a.card:hover { transform: none; } }
