:root {
  --paper: #ffffff;
  --mist: #f9fafb;
  --ink: #111827;
  --slate: #4b5563;
  --faint: #9ca3af;
  --line: #e5e7eb;
  --pulse: #2563eb;
  --deep: #1d4ed8;
  --wash: #eff6ff;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.wide { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

code { font-family: var(--mono); }

/* ---- nav ---- */

.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 17px; letter-spacing: -0.01em;
  color: var(--ink); text-decoration: none;
}

.mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 7px;
  background: var(--pulse); color: #fff;
}
.mark svg { width: 16px; height: 16px; }

.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links > a {
  color: var(--slate); text-decoration: none; font-size: 14.5px; font-weight: 500;
}
.nav-links > a:hover { color: var(--ink); }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px; border-radius: 8px;
  font-size: 14.5px; font-weight: 600; text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn-primary { background: var(--pulse); color: #fff; }
.btn-primary:hover { background: var(--deep); }
.btn-ghost { border: 1px solid var(--line); color: var(--ink) !important; }
.btn-ghost:hover { border-color: var(--faint); background: var(--mist); }
.btn-light { background: #fff; color: var(--ink); }
.btn-light:hover { background: var(--wash); }

/* ---- tokens (NATS-subject section labels) ---- */

.token {
  font-family: var(--mono);
  font-size: 12.5px; font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--slate);
  margin-bottom: 14px;
}
.token b { color: var(--pulse); font-weight: 700; }
.token::before { content: "▸ "; color: var(--pulse); }
.token-light { color: rgba(255, 255, 255, 0.65); }

/* ---- hero ---- */

.hero {
  position: relative;
  padding: 88px 0 104px;
  overflow: hidden;
  background:
    radial-gradient(1100px 520px at 85% -10%, var(--wash) 0%, rgba(239, 246, 255, 0) 65%),
    radial-gradient(var(--line) 1px, transparent 1.5px) 0 0 / 26px 26px;
}

.hero-copy { max-width: 780px; margin-bottom: 48px; }

h1 {
  font-size: clamp(34px, 4.4vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 800;
  margin-bottom: 20px;
}

.lede { font-size: 18px; color: var(--slate); max-width: 46ch; margin-bottom: 22px; }

.decode {
  position: relative;
  font-family: var(--mono);
  font-size: 13px;
  height: 24px;
  margin-bottom: 26px;
  white-space: nowrap;
  overflow: hidden;
}
.decode span {
  position: absolute; inset: 0;
  transition: opacity 0.9s ease, filter 0.9s ease;
}
.decode-hex { color: var(--faint); }
.decode-json { color: var(--deep); opacity: 0; filter: blur(4px); }
.decode.decoded .decode-hex { opacity: 0; filter: blur(4px); }
.decode.decoded .decode-json { opacity: 1; filter: blur(0); }

.hero-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }

.install-line {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--ink); color: #e5e7eb;
  border-radius: 10px;
  padding: 10px 8px 10px 18px;
  max-width: 100%;
}
.install-line code { font-size: 14px; white-space: nowrap; overflow-x: auto; }
.install-line code::before { content: "$ "; color: #6b7280; }

.copy {
  flex: none;
  font-family: var(--sans); font-size: 12.5px; font-weight: 600;
  color: #d1d5db; background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px; padding: 5px 11px;
  cursor: pointer;
  transition: background 0.15s;
}
.copy:hover { background: rgba(255, 255, 255, 0.16); }
.copy.done { color: #6ee7b7; }

.fine { font-size: 13px; color: var(--faint); }

/* ---- shots (browser-framed clips) ---- */

.shot {
  position: relative;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 24px 60px -18px rgba(17, 24, 39, 0.22), 0 6px 18px -8px rgba(37, 99, 235, 0.12);
  overflow: hidden;
}

.chrome {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 12px;
  background: var(--mist);
  border-bottom: 1px solid var(--line);
}
.chrome i { width: 10px; height: 10px; border-radius: 50%; background: #d1d5db; }
.chrome .url {
  margin-left: 10px;
  font-family: var(--mono); font-size: 11px; color: var(--faint);
  background: #fff; border: 1px solid var(--line); border-radius: 6px;
  padding: 2px 10px;
}

.shot video { display: block; width: 100%; height: auto; }

.expand {
  position: absolute; right: 10px; bottom: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 8px;
  background: rgba(17, 24, 39, 0.65); color: #fff;
  border: none; cursor: pointer;
  opacity: 0; transition: opacity 0.2s;
}
.expand svg { width: 16px; height: 16px; }
.shot:hover .expand, .expand:focus-visible { opacity: 1; }

/* ---- feature rows ---- */

.features { padding: 40px 0 0; }

.row {
  max-width: 1280px;
  margin: 0 auto;
  padding: 76px 24px 88px;
}

.row-head {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 20px 72px;
  align-items: end;
  margin-bottom: 36px;
}
.row.flip .row-title { order: 2; }
.row.flip .row-body { order: 1; }

.features > .row:nth-of-type(even) {
  position: relative;
}
.features > .row:nth-of-type(even)::before {
  content: "";
  position: absolute; inset: 0 -100vw;
  background: var(--mist);
  z-index: -1;
}

h2 {
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: -0.02em;
  line-height: 1.15;
  font-weight: 750;
  margin-bottom: 0;
}

.row-body p { color: var(--slate); font-size: 16px; }
.row-body p code, .ticks code {
  background: var(--wash); color: var(--deep);
  border-radius: 4px; padding: 1px 5px; font-size: 0.9em;
}

.ticks { list-style: none; margin-top: 18px; display: grid; gap: 9px; }
.ticks li {
  position: relative; padding-left: 26px;
  color: var(--ink); font-size: 15px;
}
.ticks li::before {
  content: "";
  position: absolute; left: 0; top: 4px;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--wash);
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%232563eb" stroke-width="3.2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6 9 17l-5-5"/></svg>');
  background-size: 9px; background-position: center; background-repeat: no-repeat;
}

/* ---- reveal ---- */

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .decode span { transition: none; }
  .decode-hex { opacity: 0; }
  .decode-json { opacity: 1; filter: none; }
}

/* ---- install ---- */

.install {
  margin-top: 72px;
  padding: 88px 0 96px;
  background: var(--ink);
  color: #fff;
}
.install h2 { color: #fff; margin-bottom: 36px; }

.install-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.card {
  position: relative;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 24px;
  display: flex; flex-direction: column; gap: 16px;
}
.card h3 { font-size: 16px; font-weight: 700; color: #fff; display: flex; align-items: baseline; gap: 10px; }
.card h3 span { font-size: 12px; font-weight: 500; color: rgba(255, 255, 255, 0.55); }
.card pre {
  background: rgba(0, 0, 0, 0.35);
  border-radius: 10px;
  padding: 14px 16px;
  overflow-x: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}
.card pre::-webkit-scrollbar { height: 6px; }
.card pre::-webkit-scrollbar-track { background: transparent; }
.card pre::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.22); border-radius: 3px; }
.card pre code { font-size: 12.5px; line-height: 1.7; color: #e5e7eb; }
.card .copy { align-self: flex-start; }
.card-note { font-size: 14px; color: rgba(255, 255, 255, 0.75); flex: 1; }
.card-note code { color: #bfdbfe; }
.card .btn-light { align-self: flex-start; }

/* ---- footer ---- */

.footer { border-top: 1px solid var(--line); padding: 44px 0; }
.footer-inner { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.brand-footer { font-size: 15px; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { color: var(--slate); font-size: 14px; text-decoration: none; }
.footer-links a:hover { color: var(--ink); }
.footer-note { margin-left: auto; font-size: 12.5px; color: var(--faint); max-width: 44ch; }

/* ---- lightbox ---- */

#lightbox {
  margin: auto;
  border: none; border-radius: 12px; padding: 0;
  width: min(94vw, 1400px);
  max-height: 94vh;
  background: #000;
}
#lightbox::backdrop { background: rgba(17, 24, 39, 0.82); }
#lightbox video { display: block; width: 100%; height: auto; }
.lightbox-close {
  position: absolute; top: 10px; right: 10px; z-index: 1;
  width: 34px; height: 34px; border-radius: 8px;
  background: rgba(255, 255, 255, 0.15); color: #fff;
  border: none; font-size: 15px; cursor: pointer;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.3); }

/* ---- focus ---- */

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--pulse);
  outline-offset: 2px;
}

/* ---- responsive ---- */

@media (max-width: 920px) {
  .hero { padding: 56px 0 64px; }
  .hero-copy { margin-bottom: 32px; }
  .row { padding: 52px 24px 60px; }
  .row-head { grid-template-columns: 1fr; gap: 14px; margin-bottom: 24px; }
  .row.flip .row-title { order: 1; }
  .row.flip .row-body { order: 2; }
  .install-grid { grid-template-columns: 1fr; }
  .footer-note { margin-left: 0; }
  .nav-links > a:not(.btn) { display: none; }
}
