:root {
  --ink-950: #0a1120;
  --ink-900: #111a2c;
  --ink-800: #1a2438;
  --ink-700: #27324a;
  --ink-400: #8390a9;
  --ink-300: #aab4c8;
  --ink-200: #c9d0de;
  --brass-200: #ecd49b;
  --brass-300: #e1bc6c;
  --brass-400: #d4a24a;
  --brass-500: #c08a2b;
  --brass-700: #83561c;
  --ivory: #f7f6f3;
  --paper: #ffffff;
  --line: #e3e0d9;
  --text: #1b1a17;
  --muted: #5d584f;
  --lapis: #2c5396;
  --radius: 14px;
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background: var(--ivory);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
code { font-family: var(--mono); font-size: .88em; background: rgb(17 26 44 / .06); padding: .1em .35em; border-radius: 5px; }
h1, h2, h3 { margin: 0; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--brass-500); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: #fff; padding: 8px 14px; border-radius: 8px; font-weight: 600; }
.skip:focus { left: 16px; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgb(17 26 44 / .86);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid rgb(255 255 255 / .06);
}
.topbar-inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; }
.brand span { font-family: var(--serif); font-weight: 600; font-size: 1.3rem; letter-spacing: -.01em; }
.brand.small span { font-size: 1.05rem; color: var(--text); }
.topnav { display: flex; gap: 4px; margin-left: auto; }
.topnav a { color: var(--ink-300); text-decoration: none; font-size: .9rem; font-weight: 500; padding: 6px 10px; border-radius: 8px; transition: color .15s, background .15s; }
.topnav a:hover { color: #fff; background: rgb(255 255 255 / .06); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 10px; font-weight: 600; font-size: .95rem;
  text-decoration: none; border: 1px solid transparent; transition: transform .15s ease, background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-sm { padding: 7px 12px; font-size: .85rem; }
.btn-brass { background: linear-gradient(180deg, var(--brass-400), var(--brass-500)); color: var(--ink-950); box-shadow: 0 8px 24px -10px rgb(192 138 43 / .7); }
.btn-brass:hover { box-shadow: 0 12px 30px -10px rgb(192 138 43 / .8); }
.btn-ghost { color: #fff; border-color: rgb(255 255 255 / .18); background: rgb(255 255 255 / .04); }
.btn-ghost:hover { border-color: rgb(255 255 255 / .35); background: rgb(255 255 255 / .08); }

/* Hero */
.hero { position: relative; overflow: hidden; background: var(--ink-900); color: var(--ink-200); padding: 72px 0 40px; }
.hero-glow { position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(600px 380px at 85% 0%, rgb(192 138 43 / .28), transparent 70%),
    radial-gradient(520px 420px at 10% 100%, rgb(44 83 150 / .45), transparent 70%);
}
.hero-glow::after { content: ''; position: absolute; inset: 0; opacity: .06;
  background-image: linear-gradient(#fff 1px, transparent 1px), linear-gradient(90deg, #fff 1px, transparent 1px);
  background-size: 40px 40px; mask-image: linear-gradient(to bottom, #000, transparent 85%); -webkit-mask-image: linear-gradient(to bottom, #000, transparent 85%);
}
.hero-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 48px; align-items: center; }
@media (min-width: 1000px) { .hero-grid { grid-template-columns: minmax(0, .9fr) minmax(0, 1.25fr); } }
.eyebrow { font-size: .74rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--brass-300); margin-bottom: 14px; }
.eyebrow.dark { color: var(--brass-700); }
.hero h1 { font-family: var(--serif); font-weight: 600; color: #fff; font-size: clamp(2.3rem, 5.2vw, 3.6rem); line-height: 1.05; letter-spacing: -.02em; }
.lede { margin-top: 20px; font-size: 1.08rem; color: var(--ink-300); max-width: 34rem; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-facts { list-style: none; padding: 0; margin: 36px 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; max-width: 30rem; }
.hero-facts li { font-size: .78rem; color: var(--ink-400); line-height: 1.3; }
.hero-facts strong { display: block; font-family: var(--serif); font-size: 1.8rem; font-weight: 600; color: #fff; line-height: 1.1; }
.note { position: relative; margin-top: 28px; font-size: .8rem; color: var(--ink-400); text-align: center; }

/* Browser frame */
.browser { margin: 0; border-radius: 14px; overflow: hidden; background: #fff; border: 1px solid rgb(255 255 255 / .12);
  box-shadow: 0 30px 80px -30px rgb(0 0 0 / .6), 0 0 0 1px rgb(17 26 44 / .06); }
.browser-bar { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; background: #eceae5; border-bottom: 1px solid #dedad2; }
.browser-bar i { width: 10px; height: 10px; border-radius: 50%; background: #d6d1c7; }
.browser-bar i:nth-child(1) { background: #ec6a5e; } .browser-bar i:nth-child(2) { background: #f4bf4f; } .browser-bar i:nth-child(3) { background: #61c554; }
.browser-bar span { margin-left: 10px; font-size: .72rem; color: #6c665c; font-family: var(--mono); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.hero-shot { transform: perspective(1800px) rotateY(-4deg) rotateX(2deg); transform-origin: left center; transition: transform .6s ease; }
.hero-shot:hover { transform: none; }
@media (max-width: 999px) { .hero-shot { transform: none; } }

/* Sections */
.section { padding: 96px 0; }
.section.alt { background: #efede8; }
.section h2 { font-family: var(--serif); font-weight: 600; font-size: clamp(1.8rem, 3.6vw, 2.6rem); line-height: 1.12; letter-spacing: -.015em; max-width: 40rem; }
.section-lede { margin-top: 16px; max-width: 44rem; color: var(--muted); font-size: 1.02rem; }
.section-lede.small { font-size: .9rem; }
.section-lede.light { color: var(--ink-300); }

/* Live */
.live-grid { display: grid; gap: 28px; margin-top: 44px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .live-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.live-card { margin: 0; }
.browser.small { border-color: var(--line); box-shadow: 0 24px 60px -32px rgb(17 26 44 / .45); }
.live-card figcaption { margin-top: 18px; }
.live-card h3 { font-size: 1.05rem; font-weight: 600; }
.live-card p { margin-top: 6px; color: var(--muted); font-size: .95rem; }

.flow { list-style: none; padding: 0; margin: 48px 0 0; display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); counter-reset: s; }
@media (min-width: 900px) { .flow { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.flow li { display: flex; gap: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 16px; font-size: .88rem; color: var(--muted); }
.flow li strong { color: var(--text); display: block; }
.flow li > span { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--ink-900); color: var(--brass-300); font-weight: 700; font-size: .78rem; }

/* Tabs */
.tabs { display: flex; gap: 6px; margin-top: 32px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
@media (max-width: 640px) { .tabs { flex-wrap: wrap; overflow: visible; } }
.tabs button { flex: none; font: inherit; font-size: .88rem; font-weight: 600; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.tabs button:hover { color: var(--text); border-color: #cdc8be; }
.tabs button[aria-selected='true'] { background: var(--ink-900); color: #fff; border-color: var(--ink-900); }
.panels { margin-top: 24px; }
.panel .browser { border-color: var(--line); box-shadow: 0 30px 70px -36px rgb(17 26 44 / .5); }
.panel:not([hidden]) { animation: fade .3s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.caption { margin-top: 16px; color: var(--muted); font-size: .95rem; max-width: 46rem; }
.phones { display: flex; gap: 24px; justify-content: center; flex-wrap: wrap; }
.phone { margin: 0; width: min(260px, 100%); border-radius: 34px; padding: 10px; background: var(--ink-900); box-shadow: 0 30px 60px -30px rgb(17 26 44 / .6); }
.phone img { border-radius: 26px; }

/* Features */
.features { display: grid; gap: 16px; margin-top: 44px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .features { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .features { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.feature { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; transition: transform .18s ease, box-shadow .18s ease; }
.feature:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -24px rgb(17 26 44 / .35); }
.ficon { width: 40px; height: 40px; border-radius: 10px; background: var(--ink-900); display: grid; place-items: center; }
.ficon svg { width: 20px; height: 20px; fill: none; stroke: var(--brass-300); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.feature h3 { margin-top: 16px; font-size: 1.05rem; font-weight: 600; }
.feature p { margin-top: 6px; color: var(--muted); font-size: .93rem; }

.roles { margin-top: 40px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.roles-title { font-size: .74rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.roles ol { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 800px) { .roles ol { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.roles li { position: relative; padding: 12px 14px; border-radius: 10px; background: #f7f6f3; border-left: 3px solid var(--brass-500); }
.roles li:nth-child(2) { border-left-color: #cfa052; } .roles li:nth-child(3) { border-left-color: #b4b0a6; }
.roles li:nth-child(4) { border-left-color: #8fb0de; } .roles li:nth-child(5) { border-left-color: #cdc8be; }
.roles strong { display: block; font-size: .92rem; }
.roles span { font-size: .8rem; color: var(--muted); }

/* Architecture */
.dark-sec { background: var(--ink-900); color: var(--ink-200); }
.dark-sec h2 { color: #fff; }
.diagram { margin-top: 40px; overflow-x: auto; border-radius: var(--radius); border: 1px solid rgb(255 255 255 / .08); background: var(--ink-950); padding: 20px; }
.diagram:focus-visible, .code pre:focus-visible { outline: 2px solid var(--brass-400); outline-offset: 2px; }
.scroll-hint { display: none; margin: 32px 0 -28px; font-size: .8rem; color: var(--brass-200); }
@media (max-width: 720px) { .scroll-hint { display: block; } }
.diagram svg { display: block; width: 100%; min-width: 720px; height: auto; font-family: var(--sans); }
.diagram .box rect { fill: var(--ink-800); stroke: rgb(255 255 255 / .12); }
.diagram .box.accent rect { stroke: rgb(212 162 74 / .6); }
.diagram .box.hub rect { fill: #1d2a45; stroke: rgb(143 176 222 / .5); }
.diagram .bt { fill: #fff; font-size: 17px; font-weight: 600; }
.diagram .bs { fill: var(--ink-300); font-size: 13.5px; }
.diagram .ln { fill: none; stroke: var(--brass-400); stroke-width: 2; }
.diagram .ln.dash { stroke-dasharray: 6 6; }
.diagram .lb { fill: var(--brass-200); font-size: 12.5px; font-weight: 500; }

/* Stack */
.chips { list-style: none; padding: 0; margin: 32px 0 0; display: flex; flex-wrap: wrap; gap: 10px; }
.chips li { padding: 8px 14px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); font-size: .9rem; font-weight: 500; }

/* Run */
.run-grid { display: grid; gap: 36px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 960px) { .run-grid { grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); } }
.code { border-radius: var(--radius); overflow: hidden; background: var(--ink-950); border: 1px solid var(--ink-700); box-shadow: 0 30px 60px -34px rgb(17 26 44 / .6); }
.code-bar { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--ink-700); color: var(--ink-400); font-size: .78rem; }
.copy { font: inherit; font-weight: 600; color: var(--brass-200); background: rgb(255 255 255 / .06); border: 1px solid rgb(255 255 255 / .1); border-radius: 7px; padding: 4px 10px; cursor: pointer; }
.copy:hover { background: rgb(255 255 255 / .12); }
.code pre { margin: 0; padding: 18px 20px; overflow-x: auto; }
@media (max-width: 480px) { .code pre { white-space: pre-wrap; word-break: break-all; } }
.code code { background: none; padding: 0; color: #e6e9ef; font-size: .86rem; line-height: 1.75; }
.code .c { color: var(--ink-400); }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 32px 0 44px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; justify-content: space-between; }
.footer p { color: var(--muted); font-size: .88rem; max-width: 40rem; }
.footer a { color: var(--text); font-weight: 600; text-underline-offset: 3px; }

/* Small screens */
@media (max-width: 720px) {
  .topnav { display: none; }
  .topbar-inner { justify-content: space-between; }
  .hero { padding: 48px 0 32px; }
  .section { padding: 64px 0; }
  .hero-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .hero-shot { transform: none; }
}
