:root {
  color-scheme: dark;
  --ink: #f4f7ef;
  --muted: #b9c7c0;
  --subtle: #7f9188;
  --paper: #08110d;
  --surface: #0e1b16;
  --surface-raised: #15261f;
  --line: rgba(184, 220, 199, 0.18);
  --line-strong: rgba(143, 242, 195, 0.52);
  --cyan: #8ff2c5;
  --blue: #76b9ff;
  --violet: #d4c0ff;
  --amber: #ffd69c;
  --success: #a8f48b;
  --danger: #ff9da5;
  --font-sans: "Segoe UI Variable Text", "Aptos", "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Aptos Display", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  --radius: 14px;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.2);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 82% -10%, rgba(92, 147, 218, 0.35), transparent 32rem),
    radial-gradient(circle at 10% 42%, rgba(70, 173, 125, 0.16), transparent 28rem),
    var(--paper);
  font: 16px/1.6 var(--font-sans);
}

a { color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }
::selection { background: var(--cyan); color: #06120d; }

.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 10; padding: 0.65rem 0.9rem; border-radius: 9px; background: var(--cyan); color: #06120d; font-weight: 800; }
.skip-link:focus { top: 1rem; }
.shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.site-header { position: sticky; top: 0; z-index: 5; background: rgba(8, 17, 13, 0.82); backdrop-filter: blur(18px); border-bottom: 1px solid var(--line); }
.site-header .shell { display: flex; min-height: 92px; align-items: center; justify-content: space-between; gap: 1.25rem; }
.brand { display: inline-flex; align-items: center; color: var(--ink); text-decoration: none; }
.brand-logo { display: block; width: 280px; height: 88px; object-fit: contain; object-position: left center; }
.site-nav { display: flex; align-items: center; gap: 1.2rem; color: var(--muted); font-size: 0.88rem; }
.site-nav a { text-decoration: none; }
.site-nav a:hover, .site-nav a:focus-visible, .site-nav a[aria-current="page"] { color: var(--cyan); }
.site-nav .nav-source { padding: 0.45rem 0.76rem; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--ink); }

.eyebrow { margin: 0 0 1rem; color: var(--cyan); font-size: 0.73rem; font-weight: 850; letter-spacing: 0.15em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { color: var(--ink); font-family: var(--font-display); font-weight: 650; }
h1 { margin-bottom: 0; max-width: 760px; font-size: clamp(2.8rem, 6vw, 5.7rem); line-height: 0.98; letter-spacing: -0.06em; }
h2 { margin-bottom: 0; font-size: clamp(1.9rem, 3.6vw, 3rem); line-height: 1.06; letter-spacing: -0.045em; }
h3 { margin-bottom: 0.6rem; font-size: 1.16rem; line-height: 1.2; }
.lede { max-width: 670px; margin: 1.55rem 0 0; color: var(--muted); font-size: clamp(1.08rem, 1.8vw, 1.28rem); }
.copy { color: var(--muted); }

.button-row { display: flex; flex-wrap: wrap; gap: 0.72rem; margin-top: 1.6rem; align-items: center; }
.button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 999px; padding: 0.64rem 1rem; color: var(--ink); font-size: 0.9rem; font-weight: 800; text-decoration: none; transition: border-color 140ms ease, background 140ms ease, color 140ms ease, transform 140ms ease; }
.button:hover, .button:focus-visible { border-color: var(--cyan); color: var(--cyan); transform: translateY(-1px); }
.button.primary { border-color: var(--cyan); background: var(--cyan); color: #06120d; }
.button.primary:hover, .button.primary:focus-visible { background: #c2ffe0; color: #06120d; }
.button.quiet { background: transparent; }
.button.demo-cta { border-color: var(--blue); color: var(--ink); background: rgba(118, 185, 255, 0.12); }
.button.demo-cta:hover, .button.demo-cta:focus-visible { border-color: var(--blue); background: rgba(118, 185, 255, 0.24); color: #d4e7ff; }

.hero-badges { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.5rem; align-items: center; }
.hero-badges img { display: block; height: 20px; border-radius: 4px; }
.hero-install { display: flex; align-items: center; gap: 0.8rem; margin-top: 1.4rem; padding: 0.6rem 0.95rem; border: 1px solid var(--line-strong); border-radius: 10px; background: #06120d; width: fit-content; max-width: 100%; }
.hero-install code { color: #8ff2c5; font: 0.88rem/1.2 var(--font-mono); user-select: all; }
.hero-install-label { color: var(--subtle); font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; }

.hero { display: grid; grid-template-columns: minmax(0, 1.04fr) minmax(330px, 0.82fr); min-height: min(680px, calc(100vh - 73px)); align-items: center; gap: clamp(2.5rem, 6vw, 6rem); padding: clamp(4rem, 7vw, 6.8rem) 0 clamp(3.5rem, 7vw, 5.8rem); }
.hero-visual { position: relative; }
.hero-visual::before { display: none; }
.evidence-card { overflow: hidden; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.evidence-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.2rem; border-bottom: 1px solid var(--line); }
.evidence-label { display: flex; align-items: center; gap: 0.55rem; color: var(--muted); font-size: 0.76rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.status-dot { width: 0.58rem; height: 0.58rem; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 5px rgba(168, 244, 139, 0.11); }
.evidence-id { overflow: hidden; max-width: 10rem; color: var(--subtle); font: 0.74rem/1.4 var(--font-mono); text-overflow: ellipsis; white-space: nowrap; }
.trace-stack { display: grid; gap: 0; padding: 0.6rem; }
.trace-row { display: grid; grid-template-columns: 2.25rem 1fr auto; align-items: center; gap: 0.75rem; min-height: 69px; padding: 0.85rem 0.72rem; border-bottom: 1px solid rgba(184, 220, 199, 0.11); }
.trace-row:last-child { border-bottom: 0; }
.trace-step { color: var(--violet); font: 0.72rem/1 var(--font-mono); }
.trace-row strong, .trace-row span { display: block; }
.trace-row strong { font-size: 0.92rem; }
.trace-row span { margin-top: 0.15rem; color: var(--muted); font-size: 0.76rem; }
.trace-state { border: 1px solid rgba(168, 244, 139, 0.42); border-radius: 999px; padding: 0.28rem 0.45rem; color: var(--success); font-size: 0.66rem; font-weight: 850; letter-spacing: 0.07em; }
.evidence-footer { padding: 1rem 1.2rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.78rem; }
.evidence-footer code { color: #d9ffe9; font-family: var(--font-mono); }

section { border-top: 1px solid var(--line); padding: clamp(4.4rem, 8vw, 7.4rem) 0; }
.section-heading { display: grid; grid-template-columns: minmax(0, 0.84fr) minmax(0, 1.16fr); gap: 2rem; align-items: end; }
.section-heading .copy { max-width: 610px; margin: 0; font-size: 1.04rem; }
.flow-grid { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 3.15rem; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); }
.flow-step { min-height: 245px; padding: 1.35rem; background: rgba(14, 27, 22, 0.76); }
.flow-step + .flow-step { border-left: 1px solid var(--line); }
.flow-index { color: var(--violet); font-size: 0.73rem; font-weight: 850; letter-spacing: 0.1em; }
.flow-step h3 { margin-top: 3rem; }
.flow-step p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.pillar-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 3.1rem; }
.pillar { min-height: 232px; padding: 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.pillar-label { color: var(--cyan); font-size: 0.72rem; font-weight: 850; letter-spacing: 0.12em; text-transform: uppercase; }
.pillar h3 { margin-top: 1.5rem; font-size: 1.34rem; }
.pillar p { color: var(--muted); }
.pillar ul { margin: 1rem 0 0; padding: 0; color: #d3dfd8; font-size: 0.88rem; list-style: none; }
.pillar li { margin: 0.35rem 0; }
.pillar li::before { color: var(--cyan); content: "— "; }
.boundary { display: grid; grid-template-columns: minmax(0, 1fr) minmax(270px, 0.72fr); gap: 2rem; padding: clamp(1.55rem, 4vw, 2.7rem); border: 1px solid rgba(255, 214, 156, 0.58); border-radius: var(--radius); background: rgba(93, 65, 22, 0.13); }
.boundary h2 { font-size: clamp(1.9rem, 3vw, 2.65rem); }
.boundary p { max-width: 650px; margin: 1rem 0 0; color: var(--muted); }
.boundary-note { align-self: center; padding-left: 1.2rem; border-left: 2px solid var(--amber); color: var(--muted); }
.boundary-note strong { display: block; color: var(--amber); font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; }
.boundary-note span { display: block; margin-top: 0.5rem; }
.page-hero { max-width: 820px; padding: clamp(4rem, 8vw, 7.25rem) 0 clamp(3rem, 6vw, 5.25rem); }
.page-hero h1 { font-size: clamp(3rem, 6.1vw, 5.7rem); }
.doc-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(250px, 0.6fr); gap: clamp(2rem, 7vw, 6.4rem); align-items: start; }
.doc-layout > div { min-width: 0; display: grid; gap: 2rem; }
.doc-card, .trace-panel { min-width: 0; padding: clamp(1.25rem, 3vw, 2rem); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.doc-card h2, .trace-panel h2 { font-size: clamp(1.55rem, 2.7vw, 2.2rem); }
.doc-card p, .doc-card li { color: var(--muted); }
.doc-card code, .install-code { overflow-x: auto; display: block; max-width: 100%; margin: 1rem 0 0; padding: 1rem; border-radius: 11px; background: #06120d; color: #d8ffe9; font: 0.84rem/1.55 var(--font-mono); white-space: pre; }
.doc-card ul { padding-left: 1.1rem; }
.doc-card a { color: var(--cyan); text-underline-offset: 0.18em; }
.doc-aside { position: sticky; top: 102px; padding: 1rem 1.1rem; border-left: 1px solid var(--line); }
.doc-aside strong { display: block; margin-bottom: 0.5rem; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; }
.doc-aside a { display: block; margin: 0.45rem 0; color: var(--muted); font-size: 0.9rem; text-decoration: none; }
.doc-aside a:hover, .doc-aside a:focus-visible { color: var(--cyan); }
.contract-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.contract-table th, .contract-table td { padding: 0.7rem 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.contract-table th { color: var(--subtle); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; }
.contract-table code { display: inline; margin: 0; padding: 0; background: transparent; color: #d8ffe9; white-space: normal; }

.trace-intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 0.65fr); gap: 1rem; margin-top: 2.4rem; }
.trace-intro > * { min-width: 0; }
.trace-summary { display: grid; gap: 0.65rem; }
.trace-summary .metric { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.75rem 0; border-bottom: 1px solid var(--line); }
.trace-summary .metric:last-child { border-bottom: 0; }
.metric span { color: var(--muted); }
.metric strong { min-width: 0; overflow-wrap: anywhere; font-size: 0.88rem; text-align: right; }
.trace-controls { display: flex; flex-wrap: wrap; gap: 0.65rem; margin-top: 1.1rem; }
.trace-controls .button { background: transparent; }
.trace-results { display: grid; gap: 0.7rem; margin-top: 1.35rem; }
.check { display: grid; grid-template-columns: 1.1rem 1fr; gap: 0.7rem; align-items: start; padding: 0.85rem 0; border-bottom: 1px solid var(--line); }
.check:last-child { border-bottom: 0; }
.check-icon { width: 1.1rem; height: 1.1rem; margin-top: 0.18rem; border: 1px solid var(--line-strong); border-radius: 50%; }
.check.pass .check-icon { border-color: var(--success); background: var(--success); box-shadow: inset 0 0 0 3px var(--surface); }
.check.fail .check-icon { border-color: var(--danger); background: var(--danger); box-shadow: inset 0 0 0 3px var(--surface); }
.check.warn .check-icon { border-color: var(--amber); background: var(--amber); box-shadow: inset 0 0 0 3px var(--surface); }
.check strong, .check span { display: block; }
.check span { margin-top: 0.15rem; color: var(--muted); font-size: 0.88rem; }
.trace-json { margin-top: 1.15rem; }
.trace-json summary { color: var(--muted); cursor: pointer; }
.trace-json pre { overflow: auto; max-height: 35rem; margin: 0.9rem 0 0; padding: 1rem; border: 1px solid var(--line); border-radius: 12px; background: #06120d; color: #c9ded2; font: 0.74rem/1.5 var(--font-mono); }
.notice { padding: 1rem 1.1rem; border: 1px solid rgba(255, 214, 156, 0.48); border-radius: 12px; color: var(--muted); background: rgba(93, 65, 22, 0.18); }
.notice strong { color: var(--amber); }

.site-footer { display: flex; justify-content: space-between; gap: 1.5rem; padding: 1.65rem 0 2.6rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.84rem; }
.site-footer a { color: var(--muted); text-underline-offset: 0.18em; }
.site-footer a:hover, .site-footer a:focus-visible { color: var(--cyan); }

@media (max-width: 900px) {
  .hero, .section-heading, .boundary, .doc-layout, .trace-intro { grid-template-columns: 1fr; }
  .hero { min-height: 0; gap: 3rem; }
  .hero-visual { max-width: 670px; }
  .flow-grid { grid-template-columns: repeat(2, 1fr); }
  .flow-step:nth-child(3), .flow-step:nth-child(4) { border-top: 1px solid var(--line); }
  .flow-step:nth-child(3) { border-left: 0; }
  .pillar-grid { grid-template-columns: 1fr; }
  .boundary-note { padding: 1rem 0 0; border-top: 2px solid var(--amber); border-left: 0; }
  .doc-aside { position: static; display: flex; flex-wrap: wrap; gap: 0.35rem 1rem; padding: 0; border-left: 0; }
  .doc-aside strong { width: 100%; }
}

@media (max-width: 650px) {
  .shell { width: min(100% - 28px, 1180px); }
  .site-header .shell { flex-wrap: wrap; min-height: 68px; padding: 0.2rem 0 0.65rem; }
  .brand-logo { width: 198px; height: 62px; }
  .site-nav { width: 100%; justify-content: space-between; gap: 0.4rem; font-size: 0.78rem; }
  .site-nav .nav-source { padding: 0.35rem 0.6rem; }
  h1 { font-size: clamp(3rem, 16vw, 4.5rem); }
  .hero { padding-top: 3.8rem; }
  .flow-grid { grid-template-columns: 1fr; }
  .flow-step + .flow-step, .flow-step:nth-child(3) { border-top: 1px solid var(--line); border-left: 0; }
  .flow-step { min-height: 0; }
  .flow-step h3 { margin-top: 1.65rem; }
  .site-footer { flex-direction: column; }
}
