:root {
  color-scheme: dark;
  --bg: #0a0c0f;
  --surface: #111519;
  --fg: #e9eef4;
  --muted: #9aa7b4;
  --line: rgba(233, 238, 244, 0.12);
  --accent: #7af0c4;
  --accent-ink: #06120d;
  --code: #0d1116;
  --grid: rgba(122, 240, 196, 0.045);
  --shadow: 0 30px 80px -40px rgba(122, 240, 196, 0.35);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f5f7f9;
    --surface: #ffffff;
    --fg: #0c1217;
    --muted: #4f5b66;
    --line: rgba(12, 18, 23, 0.14);
    --accent: #0a7d5c;
    --accent-ink: #ffffff;
    --code: #e8edf2;
    --grid: rgba(10, 125, 92, 0.07);
    --shadow: 0 30px 80px -40px rgba(10, 125, 92, 0.25);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 56px 56px;
  color: var(--fg);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

code, pre { font-family: var(--mono); font-size: 0.92em; }

a { color: var(--accent); text-underline-offset: 0.2em; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(1100px, calc(100% - 32px)); margin-inline: auto; }

.skip {
  position: absolute; left: -9999px; top: 8px; z-index: 10;
  background: var(--accent); color: var(--accent-ink);
  padding: 0.5rem 1rem; border-radius: 8px; text-decoration: none;
}
.skip:focus { left: 16px; }

.topbar {
  position: sticky; top: 0; z-index: 5;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 56px; }
.brand { font-weight: 700; color: var(--fg); text-decoration: none; letter-spacing: -0.01em; }
nav { display: flex; flex-wrap: wrap; gap: 1.2rem; }
nav a { color: var(--muted); text-decoration: none; }
nav a:hover { color: var(--fg); }

.hero {
  position: relative; overflow: hidden;
  padding: clamp(4rem, 12vw, 9rem) 0 clamp(3rem, 7vw, 5rem);
}
.hero::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  left: 50%; top: -10%; width: min(900px, 140%); height: 70%;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 22%, transparent), transparent);
}

.eyebrow {
  margin: 0 0 1.2rem; color: var(--accent);
  font: 600 0.8rem/1.4 var(--mono); text-transform: uppercase; letter-spacing: 0.14em;
}

h1 {
  margin: 0 0 1.5rem; color: var(--fg);
  font-size: clamp(3.2rem, 11vw, 8.5rem); line-height: 0.92;
  letter-spacing: -0.045em; font-weight: 800;
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  h1 {
    color: transparent;
    background: linear-gradient(120deg, var(--fg) 30%, var(--accent));
    -webkit-background-clip: text; background-clip: text;
  }
}

.thesis { max-width: 34ch; margin: 0 0 0.8rem; font-size: clamp(1.25rem, 2.6vw, 1.6rem); line-height: 1.35; }
.thesis strong { color: var(--accent); }
.sub { max-width: 60ch; margin: 0 0 2rem; color: var(--muted); }

.install {
  display: flex; align-items: center; gap: 0.75rem;
  max-width: 100%; padding: 0.6rem 0.6rem 0.6rem 1rem;
  background: var(--code); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow);
}
.prompt { color: var(--accent); font-family: var(--mono); user-select: none; }
.install code {
  flex: 1; min-width: 0; padding: 0.35rem 0;
  overflow-x: auto; white-space: nowrap;
  font-size: clamp(0.95rem, 2.4vw, 1.1rem); font-weight: 500;
}
.copy {
  flex: none; padding: 0.6rem 1rem; border: 0; border-radius: 10px; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); font: 600 0.9rem system-ui, sans-serif;
}
.copy:hover { filter: brightness(1.08); }
.note { min-height: 1.4em; margin: 0.5rem 0 0; color: var(--muted); font-size: 0.85rem; }

.cta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.25rem 0 0; }
.btn {
  display: inline-flex; align-items: center; padding: 0.75rem 1.2rem;
  border: 1px solid var(--line); border-radius: 999px;
  color: var(--fg); font-weight: 600; text-decoration: none;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: transparent; color: var(--accent-ink); }

.stats {
  display: grid; grid-template-columns: 1fr; margin: 3rem 0 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
}
.stats > div { padding: 1.2rem 1.4rem; border-top: 1px solid var(--line); }
.stats > div:first-child { border-top: 0; }
.stats dt { color: var(--fg); font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 700; line-height: 1.1; }
.stats dd { margin: 0.25rem 0 0; color: var(--muted); font-size: 0.92rem; }
@media (min-width: 760px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
  .stats > div { border-top: 0; border-left: 1px solid var(--line); }
  .stats > div:first-child { border-left: 0; }
}

section { padding: clamp(3.5rem, 8vw, 6rem) 0; border-top: 1px solid var(--line); }
.kicker { margin: 0 0 0.9rem; color: var(--accent); font: 600 0.8rem/1 var(--mono); text-transform: uppercase; letter-spacing: 0.12em; }
h2 { margin: 0 0 1.2rem; max-width: 22ch; font-size: clamp(2rem, 5vw, 3.25rem); line-height: 1.05; letter-spacing: -0.03em; }
h3 { margin: 0 0 0.5rem; font-size: 1.2rem; letter-spacing: -0.01em; }
.lead { max-width: 62ch; margin: 0 0 0.5rem; color: var(--muted); font-size: 1.1rem; }

.contrast { display: grid; gap: 1.25rem; margin-top: 2.5rem; }
.col { min-width: 0; padding: 1.6rem; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; }
.col ul { margin: 0; padding-left: 1.2rem; }
.col li { margin: 0.5rem 0; }
.col.harness { opacity: 0.85; }
.col.harness h3 { color: var(--muted); }
.col.kernel { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: var(--shadow); }
.col.kernel h3 { color: var(--accent); }
@media (min-width: 760px) { .contrast { grid-template-columns: 1fr 1fr; } }

.steps { display: grid; gap: 1rem; margin: 2.5rem 0 0; padding: 0; list-style: none; counter-reset: s; }
.steps li {
  counter-increment: s; min-width: 0; padding: 1.3rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
}
.steps li::before {
  content: counter(s, decimal-leading-zero); display: block; margin-bottom: 0.6rem;
  color: var(--accent); font: 700 0.85rem var(--mono);
}
.steps strong { display: block; margin-bottom: 0.35rem; font-size: 1.1rem; }
.steps p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.steps code { overflow-wrap: anywhere; }
@media (min-width: 900px) { .steps { grid-template-columns: repeat(4, 1fr); } }
.caption { margin: 1.5rem 0 0; color: var(--muted); font-size: 0.9rem; }

.cards { display: grid; gap: 1rem; margin-top: 2.5rem; grid-template-columns: 1fr; }
.card {
  display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; padding: 1.3rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  transition: border-color 0.2s, transform 0.2s;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.card code { display: block; margin-top: auto; padding-top: 0.6rem; color: var(--accent); font-size: 0.8rem; overflow-wrap: anywhere; }
@media (min-width: 600px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .cards { grid-template-columns: repeat(4, 1fr); } }

.quote {
  margin: 2rem 0 1.5rem; padding: 1.4rem 1.6rem;
  background: var(--surface); border-left: 3px solid var(--accent); border-radius: 0 14px 14px 0;
  font-size: 1.08rem; color: var(--fg);
}
.quote cite { display: block; margin-top: 0.7rem; color: var(--muted); font-size: 0.85rem; font-style: normal; }

pre {
  max-width: 100%; margin: 1rem 0; padding: 1rem 1.1rem; overflow-x: auto;
  background: var(--code); border: 1px solid var(--line); border-radius: 14px;
  font-size: 0.88rem; line-height: 1.5;
}
pre code { white-space: pre; }
.links { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }

footer { padding: 2.5rem 0 3rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.92rem; }
footer .row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; }
footer p { margin: 0.4rem 0; }
footer nav { gap: 1rem; }

.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.7s ease, transform 0.7s ease; }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before { transition: none !important; animation: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
