/* ---------- Design tokens ---------- */
:root {
  --bg: #07080f;
  --bg-alt: #0b0d1b;
  --panel: #12142a;
  --panel-border: #262a52;
  --ink: #f1f3fa;
  --ink-dim: #b7bbd6;
  --ink-faint: #767ba2;
  --sky: #45a7de;
  --sky-bright: #7cc7ee;
  --sky-dim: #1f4f70;
  --indigo: #8489e8;
  --indigo-dim: #2f3380;
  --trail: #c98a4b;
  --trail-bright: #e0a868;
  --focus: #7cc7ee;
  --radius: 10px;
  --wrap: 1180px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

/* ---------- Reset-ish ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
code { font-family: var(--font-mono); }
h1, h2, h3, h4 { font-weight: 650; line-height: 1.15; margin: 0 0 0.5em; }
p { margin: 0 0 1em; color: var(--ink-dim); }
ul { margin: 0; padding: 0; list-style: none; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--sky);
  color: #071021;
  padding: 0.75em 1em;
  z-index: 200;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.7em 1.3em;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(180deg, var(--sky-bright), var(--sky));
  color: #071021;
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--panel-border);
}
.btn-ghost:hover { border-color: var(--indigo-dim); background: rgba(69, 167, 222, 0.06); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 8, 15, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--panel-border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 68px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.55em;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}
.brand-mark { display: block; flex-shrink: 0; }
.site-nav {
  display: flex;
  gap: 28px;
  flex: 1;
  justify-content: center;
}
.site-nav a {
  position: relative;
  text-decoration: none;
  color: var(--ink-dim);
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.15s ease;
}
.site-nav a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -4px;
  height: 2px;
  background: var(--sky-bright);
  transition: right 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
.site-nav a:hover { color: var(--sky-bright); }
.site-nav a:hover::after { right: 0; }

/* Scroll progress */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--sky), var(--indigo));
  z-index: 300;
  pointer-events: none;
}
.header-actions { display: flex; align-items: center; gap: 12px; }
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  background: transparent;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  margin: 0 8px;
  background: var(--ink);
  border-radius: 2px;
}

/* ---------- Hero ---------- */
.hero {
  padding: 88px 0 72px;
  background-color: var(--bg);
  background-repeat: no-repeat, no-repeat, no-repeat;
  background-position: 82% -10%, 10% 0%, center;
  background-size: auto, auto, cover;
  background-image:
    radial-gradient(680px 420px at 82% -10%, rgba(69, 167, 222, 0.16), transparent 60%),
    radial-gradient(500px 320px at 10% 0%, rgba(132, 137, 232, 0.08), transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1400 700'%3E%3Cg fill='none' stroke='%23c98a4b' stroke-opacity='0.16' stroke-width='1.4'%3E%3Cellipse cx='200' cy='580' rx='260' ry='92'/%3E%3Cellipse cx='200' cy='580' rx='188' ry='64'/%3E%3Cellipse cx='200' cy='580' rx='118' ry='38'/%3E%3Cellipse cx='1220' cy='90' rx='320' ry='128'/%3E%3Cellipse cx='1220' cy='90' rx='230' ry='90'/%3E%3Cellipse cx='1220' cy='90' rx='140' ry='52'/%3E%3C/g%3E%3Cpath d='M -20 470 C 160 410, 340 500, 520 428 S 860 300, 1040 340 S 1320 258, 1440 296' fill='none' stroke='%23e0a868' stroke-opacity='0.32' stroke-width='2' stroke-dasharray='2 14' stroke-linecap='round'/%3E%3Cg fill='%23e0a868' fill-opacity='0.55'%3E%3Ccircle cx='170' cy='420' r='3.5'/%3E%3Ccircle cx='520' cy='428' r='3.5'/%3E%3Ccircle cx='860' cy='300' r='3.5'/%3E%3Ccircle cx='1210' cy='318' r='3.5'/%3E%3C/g%3E%3C/svg%3E");
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}
.hero-copy, .hero-panel { min-width: 0; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--sky);
  margin: 0 0 0.9em;
}
.hero-copy .eyebrow { margin-left: 158px; }
h1 {
  font-size: clamp(2.1rem, 4.2vw, 3.4rem);
  letter-spacing: -0.02em;
  margin-bottom: 0.45em;
  text-align: center;
}
h1 .hl { color: var(--sky-bright); }
.tagline {
  font-size: calc(1.28rem + 4px);
  font-weight: 550;
  color: var(--ink);
  max-width: none;
  text-align: center;
  margin: 0 0 0.6em;
}
.lede {
  font-size: 1.1rem;
  color: var(--ink-dim);
  max-width: 46ch;
  margin-left: 158px;
}
.lede-lg { font-size: calc(1.28rem + 4px); font-weight: 700; text-align: center; color: var(--ink); margin-left: 0; max-width: none; }
.lede-align-hw { margin-left: 83px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; margin-left: 158px; }

/* ---------- Code window ---------- */
.code-window {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.6);
}
.code-window-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.02);
}
.code-window-bar span {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--panel-border);
}
.code-window-bar span:nth-child(1) { background: #d95a4a; }
.code-window-bar span:nth-child(2) { background: #d9a44a; }
.code-window-bar span:nth-child(3) { background: #4ac97a; }
.code-window-bar p {
  margin: 0 0 0 10px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-faint);
}
.code-window pre {
  margin: 0;
  padding: 20px 22px;
  overflow-x: auto;
}
.code-window code {
  font-size: 0.86rem;
  line-height: 1.65;
  color: var(--ink);
  white-space: pre;
}
.c-com { color: var(--ink-faint); font-style: italic; }
.c-kw { color: var(--indigo); }
.c-num { color: var(--sky-bright); }
.c-fn { color: #d8b4fe; }
.c-out { color: var(--ink-faint); }

/* ---------- Stack diagram ---------- */
.stack-diagram {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.6);
}
.stack-layer {
  padding: 22px 24px;
  border-left: 3px solid var(--panel-border);
}
.stack-layer + .stack-layer { border-top: 1px solid var(--panel-border); }
.stack-kicker {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  margin: 0 0 0.6em;
}
.stack-layer h3 { font-size: 1.05rem; margin-bottom: 0.35em; }
.stack-layer p { font-size: 0.86rem; margin: 0; }
.stack-layer-hll,
.stack-layer-hotstate,
.stack-layer-rtl {
  border-left-color: var(--sky);
}
.stack-layer-hll .stack-kicker,
.stack-layer-hotstate .stack-kicker,
.stack-layer-rtl .stack-kicker {
  color: var(--sky);
}
.stack-connector {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 24px;
  background: var(--bg-alt);
  border-top: 1px solid var(--panel-border);
  border-bottom: 1px solid var(--panel-border);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-faint);
}

/* ---------- Stats ---------- */
.stats {
  border-top: 1px solid var(--panel-border);
  border-bottom: 1px solid var(--panel-border);
  background: var(--bg-alt);
  padding: 40px 0;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
}
.stat-num {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--sky-bright);
  margin: 0 0 0.25em;
  letter-spacing: -0.01em;
}
.stat-label {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ink-dim);
}
.stat-label code {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  font-size: 0.85em;
}

/* ---------- Sections ---------- */
.section { padding: 96px 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--panel-border); border-bottom: 1px solid var(--panel-border); }
.section-head { max-width: 680px; margin-bottom: 48px; }
#getting-started .section-head { max-width: none; margin-left: auto; margin-right: auto; text-align: center; }
.section-head h2 { font-size: clamp(1.6rem, 2.6vw, 2.15rem); letter-spacing: -0.01em; }
.section-sub { font-size: 1.02rem; }
.gs-note { margin-top: 24px; }

/* What section */
.what-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 48px;
  align-items: start;
}
.what-lead { font-size: 1.08rem; color: var(--ink-dim); }
.what-list li {
  padding: 18px 0;
  border-top: 1px solid var(--panel-border);
  color: var(--ink-dim);
}
.what-list li:last-child { border-bottom: 1px solid var(--panel-border); }
.what-list strong { color: var(--ink); }
.what-statement {
  margin: 0 0 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--panel-border);
  font-size: clamp(1.6rem, 2.6vw, 2.15rem);
  font-weight: 700;
  color: var(--ink);
}
.what-list code {
  color: var(--sky-bright);
  background: rgba(69, 167, 222, 0.1);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
}

/* Card grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 26px 24px;
  perspective: 500px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.card:hover { border-color: var(--indigo-dim); transform: translateY(-2px); }
.card-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--indigo);
  margin: 0 0 0.8em;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.card:hover .card-tag { transform: rotateY(360deg); }
.card h3 { font-size: 1.08rem; margin-bottom: 0.5em; }
.card p { font-size: 0.92rem; margin: 0; }
.card-muted { background: transparent; border-style: dashed; }

/* Pipeline */
.pipeline {
  display: grid;
  grid-template-columns: repeat(5, 1fr) 0;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr auto 1fr;
  gap: 14px;
  align-items: stretch;
  margin-bottom: 56px;
}
.pipe-step {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 20px 18px;
}
.pipe-step-accent {
  border-color: var(--indigo-dim);
  background: linear-gradient(180deg, rgba(69, 167, 222, 0.09), rgba(69, 167, 222, 0.02));
}
.pipe-kicker {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--sky);
  margin: 0 0 0.6em;
}
.pipe-step h3 { font-size: 0.98rem; margin-bottom: 0.4em; }
.pipe-step p { font-size: 0.84rem; margin: 0; }
.pipe-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-faint);
  font-size: 1.2rem;
}

.arch-notes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.arch-note {
  border-top: 2px solid var(--indigo-dim);
  padding-top: 16px;
}
.arch-note h4 { font-size: 1rem; margin-bottom: 0.5em; }
.arch-note p { font-size: 0.9rem; margin: 0; }

/* Feature grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  background: var(--panel-border);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.feature {
  background: var(--bg-alt);
  padding: 28px 26px;
}
.feature h3 { font-size: 1.02rem; margin-bottom: 0.5em; color: var(--sky-bright); }
.feature p { font-size: 0.9rem; margin: 0; }

/* Targets */
.targets-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.target {
  padding: 24px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  border-left: 3px solid var(--indigo);
}
.target h3 { font-size: 1rem; margin-bottom: 0.4em; }
.target p { font-size: 0.9rem; margin: 0; }

/* Get started */
.section-cta { padding-bottom: 110px; }
.get-started-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 48px;
  align-items: center;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--panel-border);
  padding: 36px 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-brand { font-size: 1rem; }
.footer-note {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-faint);
  max-width: 52ch;
}
.footer-note a { color: var(--ink-dim); text-decoration: underline; text-underline-offset: 2px; }
.footer-note a:hover { color: var(--sky-bright); }

/* ---------- Showmanship: on-load hero + stack cascade ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hero-copy > * {
    opacity: 0;
    transform: translateY(16px);
    animation: showman-in 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }
  .hero-copy .eyebrow { animation-delay: 0.05s; }
  .hero-copy h1 { animation-delay: 0.12s; }
  .hero-copy .tagline { animation-delay: 0.2s; }
  .hero-copy .lede { animation-delay: 0.28s; }
  .hero-copy .hero-actions { animation-delay: 0.36s; }

  .stack-diagram > div {
    opacity: 0;
    transform: translateX(28px);
    animation: showman-in-x 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }
  .stack-diagram > div:nth-child(1) { animation-delay: 0.3s; }
  .stack-diagram > div:nth-child(2) { animation-delay: 0.44s; }
  .stack-diagram > div:nth-child(3) { animation-delay: 0.6s; }
  .stack-diagram > div:nth-child(4) { animation-delay: 0.72s; }
  .stack-diagram > div:nth-child(5) { animation-delay: 0.88s; }
  .stack-diagram > div:nth-child(6) { animation-delay: 1s; }

  @keyframes showman-in {
    to { opacity: 1; transform: none; }
  }
  @keyframes showman-in-x {
    to { opacity: 1; transform: none; }
  }
}

/* ---------- Showmanship: scroll-triggered reveals ---------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform, opacity;
  }
  .reveal.slide-up { transform: translateY(30px); }
  .reveal.slide-left { transform: translateX(-40px); }
  .reveal.slide-right { transform: translateX(40px); }
  .reveal.is-visible {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .lede { max-width: none; margin-left: 0; }
  .hero-copy .eyebrow { margin-left: 0; }
  .hero-actions { margin-left: 0; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .what-grid { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .pipeline { grid-template-columns: 1fr; }
  .pipe-arrow { transform: rotate(90deg); padding: 2px 0; }
  .arch-notes { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .targets-grid { grid-template-columns: 1fr; }
  .get-started-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .site-nav {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--panel-border);
    flex-direction: column;
    align-items: flex-start;
    padding: 8px 24px 20px;
    gap: 4px;
    display: none;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 10px 0; width: 100%; }
  .nav-toggle { display: flex; }
  .header-actions .btn-ghost { display: none; }
  .stats-grid { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }
  .section { padding: 64px 0; }
  .hero { padding: 56px 0 48px; }
}
