@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans:ital,wght@0,400;0,500;0,600;1,400&family=Newsreader:ital,opsz,wght@0,6..72,500;0,6..72,600;1,6..72,500&display=swap");

:root {
  --bg: #0b0c0e;
  --bg-elevated: #121317;
  --bg-subtle: #181a1f;
  --fg: #ecece8;
  --fg-muted: #9a9b97;
  --fg-subtle: #8a8b86;
  --border: color-mix(in oklab, var(--fg) 12%, transparent);
  --border-strong: color-mix(in oklab, var(--fg) 22%, transparent);
  --accent: #3d9b8f;
  --accent-fg: #0b0c0e;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --font-display: "Newsreader", "Times New Roman", serif;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --max: 1200px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--fg); overflow-x: hidden; }
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  text-wrap: pretty;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button:not(:disabled), [role="button"]:not(:disabled) { cursor: pointer; }
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: 12px;
  top: 8px;
  z-index: 40;
  padding: 8px 14px;
  background: var(--fg);
  color: var(--bg);
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transform: translateY(-220%);
}
.skip:focus-visible { transform: none; }

.wrap { width: min(var(--max), calc(100% - 40px)); margin: 0 auto; }
.wrap.narrow { max-width: 46rem; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
}
h1, h2, h3 { text-wrap: balance; letter-spacing: -0.03em; margin: 0; }
h1 {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 6vw, 5rem);
  line-height: 1.05;
  font-weight: 500;
}
h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1.15;
  font-weight: 500;
}
h3 { font-size: 1.1rem; font-weight: 600; }
p { color: var(--fg-muted); margin: 0; }
.lead { font-size: clamp(1.05rem, 1.4vw, 1.25rem); max-width: 42rem; }

header.nav {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(16px);
  background: color-mix(in oklab, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; min-width: 0; }
.brand img { width: 28px; height: 28px; border-radius: 7px; flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-name { font-weight: 600; }
.brand-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
}
.nav-links { display: flex; align-items: center; gap: 22px; font-size: 14px; color: var(--fg-muted); }
.nav-links a { text-decoration: none; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--fg); }
.nav-links a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 6px;
}
.nav-cta {
  display: inline-flex; align-items: center; height: 36px; padding: 0 14px;
  border-radius: 999px; background: var(--fg); color: var(--bg); text-decoration: none;
  font-size: 13px; font-weight: 600;
}
.menu-btn {
  display: none; background: none; border: 1px solid var(--border);
  color: var(--fg); border-radius: 8px; padding: 8px 10px;
}

.hero { padding: 72px 0 40px; }
.hero-grid {
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center;
}
.hero h1 { margin: 14px 0 18px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 44px; padding: 0 18px; border-radius: 999px; text-decoration: none;
  font-weight: 600; font-size: 14px; border: 1px solid transparent;
  transition: transform 150ms var(--ease), opacity 150ms var(--ease);
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--fg); color: var(--bg); }
.btn-ghost { background: transparent; color: var(--fg); border-color: var(--border-strong); }
.hero-frame {
  border: 1px solid var(--border); border-radius: var(--radius-xl);
  overflow: hidden; background: var(--bg-elevated);
  box-shadow: 0 30px 80px rgba(0,0,0,0.35);
}
.hero-code {
  border: 1px solid var(--border); border-radius: var(--radius-xl);
  overflow: hidden; background: #08090b;
  box-shadow: 0 30px 80px rgba(0,0,0,0.35);
  position: relative;
}
.hero-code-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--fg-subtle);
}
.hero-code pre { border: 0; border-radius: 0; margin: 0; padding: 18px 20px 22px; }

.meta-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--border); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; margin: 48px 0 8px;
}
.meta-row div { background: var(--bg-elevated); padding: 18px 20px; }
.meta-row span { display: block; font-family: var(--font-mono); font-size: 11px; color: var(--fg-subtle); letter-spacing: 0.08em; text-transform: uppercase; }
.meta-row strong { display: block; margin-top: 6px; font-size: 15px; font-weight: 500; }

section { padding: 72px 0; }
section.alt { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--bg-elevated); }
.sec-head { max-width: 40rem; margin-bottom: 36px; }
.sec-head h1 {
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  margin: 10px 0 12px;
}
.sec-head h2 { margin: 10px 0 12px; }

.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.cards.stack { grid-template-columns: 1fr; }
.card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 22px;
  display: flex; flex-direction: column;
}
.alt .card { background: var(--bg-subtle); }
.card > header {
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
  margin-bottom: 8px;
}
.card h3 { margin-bottom: 8px; }
.card > header h3 { margin-bottom: 0; }
.card .ver { font-family: var(--font-mono); font-size: 12px; color: var(--fg-subtle); }
.card p { font-size: 14.5px; flex: 1; }
.card .meta {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-top: 16px; font-size: 13px;
}
.card .meta span { font-family: var(--font-mono); color: var(--fg-subtle); }
.card .meta a { color: var(--accent); text-decoration: none; }
.card .meta a:hover { text-decoration: underline; }

.roles { display: grid; gap: 12px; }
.role {
  display: grid; grid-template-columns: 160px 1fr; gap: 16px; align-items: start;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 18px 20px; background: var(--bg-elevated);
}
.role code { font-family: var(--font-mono); font-size: 13px; color: var(--accent); }
.role p { font-size: 14px; }
.role a { color: var(--accent); text-decoration: none; }
.role a:hover { text-decoration: underline; }

.code-block { position: relative; }
.copy-btn {
  position: absolute; top: 8px; right: 8px; z-index: 1;
  height: 28px; padding: 0 10px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--bg-elevated);
  color: var(--fg); font-family: var(--font-body); font-size: 12px; font-weight: 600;
}
.hero-code .copy-btn { position: static; }
.prose .code-block { margin: 0 0 18px; }
.prose .code-block pre { margin: 0; }

pre {
  font-family: var(--font-mono); font-size: 13px; line-height: 1.55;
  background: #08090b; color: #d7d8d3; border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 16px 18px; overflow-x: auto;
  margin: 0;
}
.terminal:before {
  content: "lab · ephemeral";
  display: block; font-family: var(--font-mono); font-size: 11px;
  color: var(--fg-subtle); letter-spacing: 0.08em; text-transform: uppercase;
  margin-bottom: 10px;
}

.ports { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.ports th, .ports td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--border); }
.ports th { color: var(--fg-subtle); font-weight: 500; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.ports td:first-child { font-family: var(--font-mono); font-size: 13px; color: var(--fg); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.list { list-style: none; padding: 0; margin: 16px 0 0; }
.list li { padding: 10px 0; border-top: 1px solid var(--border); color: var(--fg-muted); font-size: 15px; }
.list li strong { color: var(--fg); font-weight: 500; }

.doc { padding: 56px 0 96px; }
.doc-grid { display: grid; grid-template-columns: 220px 1fr; gap: 48px; }
.toc { position: sticky; top: 88px; font-size: 13px; color: var(--fg-muted); }
.toc a { display: block; text-decoration: none; padding: 6px 0; }
.toc a:hover { color: var(--fg); }
.prose h1 { font-size: clamp(2.2rem, 4vw, 3.2rem); margin-bottom: 12px; }
.prose h2 { margin: 40px 0 12px; }
.prose h3 { margin: 28px 0 8px; }
.prose p { margin: 0 0 14px; }
.prose ul, .prose ol { color: var(--fg-muted); padding-left: 1.2rem; }
.prose li { margin: 6px 0; }
.prose a { color: var(--fg); text-underline-offset: 3px; }
.prose table { width: 100%; border-collapse: collapse; margin: 16px 0 22px; font-size: 14px; }
.prose th, .prose td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose th { color: var(--fg); font-weight: 500; }
.prose td { color: var(--fg-muted); }
.prose .note {
  border-left: 2px solid var(--accent); padding: 10px 14px; margin: 18px 0;
  color: var(--fg-muted); background: var(--bg-elevated); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.prose strong { color: var(--fg); font-weight: 500; }
.prose pre { margin: 0 0 18px; }
.prose code { font-family: var(--font-mono); font-size: 0.9em; }

.topo {
  display: grid; gap: 14px;
}
.topo.inset { margin: 24px 0 32px; }
.topo-flow {
  display: grid; grid-template-columns: 1fr auto 1.2fr auto 1fr;
  gap: 10px; align-items: center;
}
.topo-node {
  border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 16px 18px; background: var(--bg-elevated);
}
.topo-node.hub {
  background: color-mix(in oklab, var(--accent) 14%, var(--bg-elevated));
  border-color: color-mix(in oklab, var(--accent) 40%, var(--border));
}
.topo-node span {
  display: block; font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-subtle);
  margin-bottom: 4px;
}
.topo-node strong { font-weight: 500; }
.topo-edge {
  font-family: var(--font-mono); font-size: 11px; color: var(--fg-subtle);
  text-align: center; letter-spacing: 0.04em;
}
.proto-badges {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.proto-badges span {
  font-family: var(--font-mono); font-size: 12px; color: var(--fg);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 6px 12px; background: var(--bg-elevated);
}

.topo-projects {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}
.topo-project {
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 16px; background: var(--bg);
}
.topo-project header {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 10px;
}
.topo-project ul { list-style: none; padding: 0; margin: 0; }
.topo-project li {
  padding: 7px 0; border-top: 1px solid var(--border);
  font-size: 14px; color: var(--fg-muted);
}
.topo-project li:first-child { border-top: 0; padding-top: 0; }
.topo-project li strong { color: var(--fg); font-weight: 500; }

footer {
  border-top: 1px solid var(--border); padding: 36px 0 48px; color: var(--fg-subtle); font-size: 13px;
}
.foot { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.foot a { color: var(--fg-muted); text-decoration: none; }
.foot a:hover { color: var(--fg); }

@media (max-width: 1100px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .cards.stack { grid-template-columns: 1fr; }
  .hero-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column; position: absolute; left: 0; right: 0; top: 64px;
    background: var(--bg); border-bottom: 1px solid var(--border); padding: 16px 20px 20px; align-items: flex-start;
  }
  .menu-btn { display: inline-flex; }
}

@media (max-width: 860px) {
  .hero-grid, .cards, .cards.stack, .split, .doc-grid, .meta-row, .topo-flow, .topo-projects { grid-template-columns: 1fr; }
  .role { grid-template-columns: 1fr; }
  .toc { position: static; }
  section, .hero { padding: 48px 0; }
  .topo-edge { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
