:root {
  --bg: #ffffff; --bg-alt: #f4f6fa; --text: #16213a; --text-muted: #5a6b8a;
  --accent: #2456e6; --accent-contrast: #ffffff; --border: #dde4ef;
  --ok: #1a7f4e; --warn: #9a6700;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fs-base: clamp(1rem, 0.95rem + 0.3vw, 1.125rem);
  --space: 1rem; --radius: 10px; --maxw: 68rem;
  --shadow: 0 1px 3px rgba(22,33,58,.08);
}
@media (prefers-color-scheme: dark) {
  :root { --bg:#0e1526; --bg-alt:#151f36; --text:#e8edf7; --text-muted:#93a3c0;
          --accent:#6a92ff; --border:#263352; --ok:#4cc38a; --warn:#e2b23a;
          --shadow: 0 1px 3px rgba(0,0,0,.4); }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: var(--fs-base); line-height: 1.6;
}

/* ---- nav ---- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--border);
}
.nav nav {
  max-width: var(--maxw); margin: 0 auto; padding: .7rem var(--space);
  display: flex; align-items: center; justify-content: space-between; gap: var(--space);
}
.brand { font-weight: 700; color: var(--text); text-decoration: none; white-space: nowrap; }
.links { display: flex; gap: .2rem; flex-wrap: wrap; }
.links a {
  color: var(--text-muted); text-decoration: none; font-size: .9rem;
  padding: .3rem .6rem; border-radius: 6px;
}
.links a:hover, .links a.active { color: var(--accent); background: var(--bg-alt); }

/* ---- sections ---- */
section { padding: calc(var(--space) * 4) var(--space); }
section > * { max-width: var(--maxw); margin-left: auto; margin-right: auto; }
.alt { background: var(--bg-alt); }
h1 {
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3.4rem);
  line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 var(--space);
}
h2 {
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem);
  line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 var(--space);
}
h3 { font-size: 1.05rem; line-height: 1.2; margin: 0 0 .5rem; }
.lead { color: var(--text-muted); max-width: 46rem; margin-bottom: calc(var(--space) * 2); }
.lead.center { text-align: center; margin: calc(var(--space) * 2) auto 0; }
.kicker {
  color: var(--accent); font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; font-size: .8rem; margin: 0 0 var(--space);
}
code {
  background: var(--bg-alt); border: 1px solid var(--border);
  border-radius: 4px; padding: .08em .35em; font-size: .88em;
}
.alt code { background: var(--bg); }

/* ---- hero ---- */
.hero { text-align: center; padding-top: calc(var(--space) * 5); }
.hero .sub { color: var(--text-muted); max-width: 44rem; margin: 0 auto; }
.hero-proof {
  display: inline-block; margin-top: calc(var(--space) * 2);
  padding: .5rem 1rem; border: 1px solid var(--border); border-radius: 99px;
  font-size: .9rem; color: var(--text-muted); background: var(--bg-alt);
}

/* ---- cards / steps ---- */
.steps, .connectors {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: var(--space);
}
.card {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: calc(var(--space) * 1.4); box-shadow: var(--shadow);
}
.alt .card { background: var(--bg); }
.card span {
  display: inline-grid; place-items: center; width: 2rem; height: 2rem;
  border-radius: 50%; background: var(--accent); color: var(--accent-contrast);
  font-weight: 700; margin-bottom: .6rem;
}
.card p { margin: 0; color: var(--text-muted); font-size: .95rem; }
.card h3 b {
  float: right; font-size: .7rem; font-weight: 600; letter-spacing: .05em;
  text-transform: uppercase; padding: .15em .6em; border-radius: 99px;
}
.card.ok h3 b    { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.card.ready h3 b { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); }
.card.stub h3 b  { background: var(--bg-alt); color: var(--text-muted); }
.card.accent { border-color: var(--accent); }
.card.wide { margin-top: var(--space); }
.duo { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: var(--space); }

/* ---- terminal ---- */
.terminal {
  margin-top: calc(var(--space) * 2); border-radius: var(--radius); overflow: hidden;
  border: 1px solid #263352; background: #0b1220; box-shadow: var(--shadow);
}
.tbar { display: flex; align-items: center; gap: .4rem; padding: .55rem .8rem; background: #111a2e; }
.tbar i { width: .7rem; height: .7rem; border-radius: 50%; background: #2c3e5f; }
.tbar em { margin-left: auto; color: #5a6b8a; font-style: normal; font-size: .75rem; }
.terminal pre { margin: 0; padding: 1rem 1.2rem; overflow-x: auto; }
.terminal code {
  background: none; border: none; padding: 0;
  color: #c8d6f0; font-size: .82rem; line-height: 1.7;
}

/* ---- architecture ---- */
.arch { display: grid; grid-template-columns: 1fr 1fr; gap: calc(var(--space) * 1.5); align-items: start; }
@media (max-width: 52rem) { .arch { grid-template-columns: 1fr; } }
.tree {
  background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius);
  padding: var(--space); overflow-x: auto;
}
.tree pre { margin: 0; }
.tree code { background: none; border: none; font-size: .82rem; line-height: 1.75; }
.tree i { color: var(--text-muted); font-style: normal; }
.connectors { grid-template-columns: 1fr; }

/* ---- table ---- */
table { width: 100%; border-collapse: collapse; background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); font-size: .95rem; }
th, td { padding: .75rem .9rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
thead th { background: var(--bg-alt); font-size: .8rem; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-muted); }
tbody tr:last-child td { border-bottom: none; }
td.ok { color: var(--ok); white-space: nowrap; }
td.part { color: var(--warn); white-space: nowrap; }
td:last-child { color: var(--text-muted); }
@media (max-width: 40rem) {
  table, thead, tbody, tr { display: block; }
  thead { display: none; }
  td { border: none; padding: .25rem .9rem; }
  td:first-child { font-weight: 600; padding-top: .9rem; }
  tr { border-bottom: 1px solid var(--border); padding-bottom: .65rem; }
}

/* ---- preuve ---- */
.proof { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: var(--space); margin-bottom: var(--space); }
.stat { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: calc(var(--space) * 1.4); text-align: center; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 2rem; letter-spacing: -0.01em; color: var(--accent); }
.stat span { color: var(--text-muted); font-size: .88rem; }

footer { border-top: 1px solid var(--border); padding: calc(var(--space) * 2) var(--space);
  text-align: center; color: var(--text-muted); font-size: .85rem; }
footer p { margin: 0; }

/* ---- reveal ---- */
.reveal { opacity: 0; transform: translateY(10px);
  transition: opacity .5s ease, transform .5s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
