:root {
  color-scheme: dark;
  --bg: #0D0F14;
  --panel: rgba(22, 27, 38, 0.74);
  --panel-strong: rgba(28, 34, 48, 0.9);
  --text: #F4F7FB;
  --muted: #AAB4C3;
  --line: #2A303B;
  --violet: #7842FF;
  --blue: #4671FF;
  --cyan: #02ECFF;
  --yellow: #FFD166;
  --shadow: 0 24px 80px rgba(2, 236, 255, 0.13);
  --radius: 28px;
  font-family: 'Space Grotesk', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 20% -10%, rgba(120, 66, 255, 0.34), transparent 30rem),
    radial-gradient(circle at 85% 8%, rgba(2, 236, 255, 0.18), transparent 24rem),
    linear-gradient(180deg, #0D0F14 0%, #0b0d12 100%);
  color: var(--text);
  font: 400 16px/1.65 'Space Grotesk', system-ui, sans-serif;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--cyan); }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 4px; border-radius: 10px; }
::selection { background: rgba(2, 236, 255, 0.28); }

.sr-only, .skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.skip-link:focus {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 10;
  width: auto;
  height: auto;
  clip: auto;
  padding: .75rem 1rem;
  background: var(--text);
  color: var(--bg);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(13, 15, 20, 0.76);
  border-bottom: 1px solid rgba(42, 48, 59, .9);
  backdrop-filter: blur(18px);
}
.nav {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 72px;
}
.brand { display: inline-flex; align-items: center; gap: .7rem; font-weight: 700; letter-spacing: -.03em; }
.brand-mark { width: 42px; height: 42px; filter: drop-shadow(0 0 18px rgba(120, 66, 255, .35)); }
.brand-mark.small { width: 34px; height: 34px; }
.nav-links { display: none; color: var(--muted); gap: 1.1rem; font-size: .95rem; }
.nav-cta { padding: .62rem .9rem; border: 1px solid rgba(42,48,59,.95); border-radius: 999px; background: rgba(255,255,255,.04); }

.section {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 68px 0;
}
.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.2rem;
  min-height: calc(100vh - 72px);
  align-items: center;
  padding-top: 42px;
}
.hero > *, .hero-copy, .terminal-card, .splash-panel { min-width: 0; }
.eyebrow {
  margin: 0 0 .9rem;
  color: var(--cyan);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: .78rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}
h1, h2, h3 { margin: 0; line-height: 1.08; letter-spacing: -.045em; text-wrap: balance; }
h2 { font-size: clamp(2rem, 4.2vw + .8rem, 4.2rem); }
h3 { font-size: 1.22rem; letter-spacing: -.035em; }
p { color: var(--muted); margin: 0; }
.hero-kicker { max-width: 840px; color: var(--text); font-size: clamp(1.5rem, 3.6vw + .7rem, 3.4rem); line-height: 1.1; letter-spacing: -.045em; font-weight: 700; text-wrap: balance; }
.hero-text { max-width: 62ch; text-wrap: pretty; margin-top: 1rem; font-size: clamp(1.02rem, 2vw, 1.24rem); }
.cta-row { display: flex; flex-wrap: wrap; gap: .9rem; margin-top: 1.5rem; }
.cta-row.center { justify-content: center; }
.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: .84rem 1.15rem;
  font-weight: 700;
  border: 1px solid rgba(42,48,59,.95);
}
.button-primary {
  color: #071014;
  background: linear-gradient(100deg, var(--violet), var(--cyan));
  box-shadow: 0 0 34px rgba(2, 236, 255, .22), 0 0 44px rgba(120, 66, 255, .18);
}
.button-primary:hover { color: #071014; transform: translateY(-1px); }
.button-secondary { background: rgba(255, 255, 255, .055); color: var(--text); }
.install-command {
  display: block;
  width: 100%;
  margin-top: 1rem;
  padding: 1rem;
  overflow-x: auto;
  border: 1px solid rgba(42,48,59,.95);
  border-radius: 16px;
  background: rgba(0,0,0,.28);
  color: #DDE7F0;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: .82rem;
}

.splash-panel, .terminal-card, .feature-panel, .proof-grid article, .steps li, .skills-grid article, .gateway-diagram {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}
.splash-panel {
  overflow: hidden;
  border-radius: var(--radius);
  background: #0D0F14;
}
.splash-stage {
  padding: 1.1rem .85rem 1.25rem;
  overflow: hidden;
}
.splash-full { display: none; }
.splash-compact { display: block; }
.splash-full, .splash-compact {
  margin: 0;
  width: 100%;
  max-width: 100%;
  white-space: pre;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: clamp(.345rem, 1.58vw, .78rem);
  line-height: 1.05;
  letter-spacing: -.045em;
  font-weight: 700;
  color: transparent;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  animation: splash-reveal 1s cubic-bezier(.4, 0, .2, 1) both;
}
.splash-full {
  grid-template-columns: max-content max-content;
  gap: 4ch;
  align-items: start;
}
.splash-full pre, .splash-word, .splash-k {
  margin: 0;
  font: inherit;
  line-height: inherit;
  white-space: pre;
}
.splash-k {
  color: transparent;
  background: linear-gradient(90deg, var(--violet), var(--blue));
  -webkit-background-clip: text;
  background-clip: text;
}
.splash-word {
  color: transparent;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
}

.terminal-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  min-height: 360px;
}
.terminal-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(120,66,255,.34), transparent 35%, rgba(2,236,255,.22));
  opacity: .7;
}
.terminal-top {
  position: relative;
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: 1rem;
  border-bottom: 1px solid rgba(42,48,59,.95);
  background: rgba(7, 9, 13, .62);
}
.terminal-top span { width: 10px; height: 10px; border-radius: 50%; background: #ff6b6b; }
.terminal-top span:nth-child(2) { background: var(--yellow); }
.terminal-top span:nth-child(3) { background: #40e09b; }
.terminal-top strong { margin-left: auto; color: var(--muted); font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: .78rem; }
.route-strip {
  position: relative;
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .85rem 1rem;
  color: var(--cyan);
  border-bottom: 1px solid rgba(42,48,59,.95);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: .74rem;
}
.route-dot { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 22px var(--cyan); }
#routing-label { min-width: 0; overflow-wrap: anywhere; }
.terminal-screen {
  position: relative;
  margin: 0;
  min-height: 250px;
  padding: 1rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #DCE6EF;
  font: 400 .78rem/1.7 'JetBrains Mono', ui-monospace, monospace;
}
.terminal-screen .prompt { color: var(--cyan); }
.terminal-screen .tool { color: #B99AFF; }
.terminal-screen .ok { color: #73F5B5; }
.data-flow { position: absolute; right: 1rem; bottom: 1rem; display: flex; gap: .35rem; }
.data-flow i { width: 26px; height: 4px; border-radius: 99px; background: linear-gradient(90deg, transparent, var(--cyan)); animation: pulse 1.4s infinite ease-in-out; }
.data-flow i:nth-child(2) { animation-delay: .18s; }
.data-flow i:nth-child(3) { animation-delay: .36s; }

.proof h2 { max-width: 760px; }
.proof-grid, .skills-grid { display: grid; gap: 1rem; margin-top: 1.5rem; }
.proof-grid article, .skills-grid article { border-radius: 22px; padding: 1.2rem; }
.proof-grid strong { display: block; font-size: 1.55rem; letter-spacing: -.04em; }
.proof-grid span { color: var(--muted); }

/* Feature stage: a compact selectable list drives one live terminal demo —
   the features run instead of posing in a wall of identical cards. */
.feature-stage { display: grid; gap: 1.1rem; margin-top: 1.7rem; }
.feature-tabs { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .4rem; scrollbar-width: thin; }
.feature-tabs [role="tab"] {
  position: relative;
  overflow: hidden;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .03);
  color: var(--muted);
  font: 600 .92rem/1.3 'Space Grotesk', system-ui, sans-serif;
  letter-spacing: -.01em;
  padding: .62rem .95rem;
  text-align: left;
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.feature-tabs [role="tab"]:hover { color: var(--text); border-color: rgba(120, 66, 255, .55); }
.feature-tabs [role="tab"][aria-selected="true"] {
  color: var(--text);
  border-color: rgba(120, 66, 255, .7);
  background: linear-gradient(120deg, rgba(120, 66, 255, .24), rgba(2, 236, 255, .1));
}
/* Auto-advance dwell made visible: a thin gradient fuse burning along the
   active tab. Pausing the stage pauses the fuse. */
.feature-tabs [role="tab"][aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  transform-origin: left;
  background: linear-gradient(90deg, var(--violet), var(--cyan));
  animation: stage-fuse var(--stage-dwell, 7.6s) linear forwards;
}
.feature-stage.is-paused [role="tab"][aria-selected="true"]::after { animation-play-state: paused; }
.feature-panel { border-radius: var(--radius); padding: 1.35rem; display: grid; gap: .95rem; align-content: start; }
.feature-panel[hidden] { display: none; }
.feature-panel h3 { font-size: 1.25rem; }
.feature-panel > p { max-width: 58ch; margin: 0; }
.skills-grid p, .steps p { margin-top: .75rem; }
.stage-terminal { border-radius: 18px; border: 1px solid var(--line); background: rgba(0, 0, 0, .34); overflow: hidden; }
.stage-bar { display: flex; align-items: center; gap: .45rem; padding: .55rem .85rem; border-bottom: 1px solid var(--line); }
.stage-bar span { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.stage-bar em { margin-left: .4rem; font-style: normal; color: var(--muted); font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: .72rem; }
.stage-screen {
  margin: 0;
  padding: .95rem 1.05rem 1.1rem;
  min-height: 10rem;
  color: #DDE7F0;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: .8rem;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.stage-screen span { display: block; }
.stage-screen span.is-hidden { visibility: hidden; }
.stage-screen .prompt { color: var(--cyan); }
.stage-screen .tool { color: var(--muted); }
.stage-screen .ok { color: #73F5B5; }

.steps { list-style: none; padding: 0; margin: 1.7rem 0 0; display: grid; gap: 1rem; }
.steps li { border-radius: 24px; padding: 1.25rem; }
.steps span { display: inline-block; margin-bottom: 1.8rem; color: var(--yellow); font-family: 'JetBrains Mono', ui-monospace, monospace; }

.resilience { display: grid; gap: 1.5rem; }
.resilience p:not(.eyebrow) { margin-top: 1rem; font-size: 1.06rem; }
.gateway-diagram { border-radius: var(--radius); padding: 1.25rem; display: grid; gap: .9rem; text-align: center; }
.node, .provider, .fallback, .edge { border-radius: 18px; padding: .9rem; font-family: 'JetBrains Mono', ui-monospace, monospace; }
.node { background: rgba(255,255,255,.07); }
.node-gateway { background: linear-gradient(100deg, rgba(120,66,255,.35), rgba(2,236,255,.2)); }
.edge, .fallback { color: var(--muted); border: 1px dashed rgba(42,48,59,.95); }
.providers { display: grid; gap: .7rem; }
.provider { border: 1px solid rgba(42,48,59,.95); }
.provider.good { color: #92ffd0; background: rgba(64,224,155,.08); }
.provider.failed { color: #ffb8b8; background: rgba(255,91,91,.09); text-decoration: line-through; }

.final-cta { text-align: center; }
.final-cta p { margin-top: 1rem; }
.footer {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 2rem 0 3rem;
  display: grid;
  gap: .8rem;
  color: var(--muted);
  border-top: 1px solid rgba(42,48,59,.95);
}

@keyframes pulse { 0%, 100% { opacity: .28; transform: translateX(-5px); } 50% { opacity: 1; transform: translateX(5px); } }
@keyframes stage-fuse { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes splash-reveal { 0% { clip-path: inset(0 100% 0 0); } 100% { clip-path: inset(0 0 0 0); } }

@media (min-width: 720px) {
  .nav-links { display: flex; }
  .section { padding: 88px 0; }
  .hero { gap: 1.4rem; }
  .splash-stage { padding: 1.4rem; }
  .splash-full { display: grid; }
  .splash-compact { display: none; }
  .splash-full { font-size: clamp(.47rem, 1.12vw, .78rem); letter-spacing: -.04em; }
  .proof-grid, .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .providers { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1024px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .terminal-card { max-width: 920px; width: 100%; justify-self: center; }
  .hero-copy { max-width: 920px; justify-self: center; text-align: center; }
  .hero-copy .cta-row { justify-content: center; }
  .proof-grid { grid-template-columns: repeat(3, 1fr); }
  .feature-stage { grid-template-columns: minmax(0, 320px) minmax(0, 1fr); align-items: start; }
  .feature-tabs { flex-direction: column; overflow: visible; padding-bottom: 0; }
  .feature-tabs [role="tab"] { width: 100%; }
  .feature-panel { min-height: 428px; grid-template-rows: auto auto 1fr; }
  .stage-terminal { display: grid; grid-template-rows: auto 1fr; }
  .stage-screen { font-size: .84rem; }
  .resilience { grid-template-columns: .9fr 1.1fr; align-items: center; }
  .footer { grid-template-columns: 1fr auto auto; align-items: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
  .splash-full, .splash-compact { clip-path: none !important; }
}

/* Typographic polish: balanced headings handled above; body text avoids widows. */
p, .feature-panel p, .step p, footer p { text-wrap: pretty; }
