/* ───── Reset + Variables ───── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #09090b;
  --bg-subtle: #111114;
  --bg-card: #16161a;
  --border: #27272a;
  --text: #fafafa;
  --text-muted: #a1a1aa;
  --text-dim: #71717a;
  --accent: oklch(0.75 0.18 226);
  --accent-bright: oklch(0.82 0.14 226);
  --accent-dim: oklch(0.55 0.22 226);
  --accent-glow: oklch(0.75 0.18 226 / 0.12);
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'DM Sans', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --max-w: 1120px;
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
::selection { background: var(--accent-dim); color: #fff; }

a { color: inherit; }
img, svg { display: block; max-width: 100%; }

/* ───── Layout ───── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
.section { max-width: var(--max-w); margin: 0 auto; padding: 80px 24px; }
.section-narrow { max-width: 720px; }
.section-center { text-align: center; }

.label {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

/* ───── Nav ───── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 9, 11, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-brand { display: flex; align-items: center; }
.nav-logo {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 22px;
  color: var(--accent);
  letter-spacing: -0.02em;
  text-decoration: none;
}
.nav-beta {
  font-size: 9px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 99px;
  background: var(--accent);
  color: #09090b;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  font-size: 14px;
  color: var(--text-muted);
}
.nav-links a { text-decoration: none; transition: color 0.2s; }
.nav-links a:hover { color: var(--text); }
.nav-burger {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 4px;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
}
.nav-mobile {
  display: none;
  flex-direction: column;
  border-top: 1px solid var(--border);
  padding: 12px 24px 20px;
  gap: 4px;
}
.nav-mobile a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 15px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--border);
}
.nav-mobile.open { display: flex; }

/* ───── Hero ───── */
.hero { padding-top: 100px; padding-bottom: 40px; text-align: center; }
.hero h1 {
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.2;
  margin-bottom: 20px;
  text-wrap: balance;
}
.hero-sub {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 540px;
  margin: 0 auto 36px;
  line-height: 1.7;
  text-wrap: pretty;
}
.hero-ctas {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.hero-visual { margin-top: 48px; }
.hero-curl { margin-top: 24px; font-family: var(--mono); font-size: 13px; color: var(--text-dim); }
.hero-curl code {
  padding: 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.rotating-code {
  font-family: var(--mono);
  background: var(--bg-card);
  padding: 2px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  display: inline-block;
  font-size: 0.78em;
  width: 15ch;
  text-align: left;
  max-width: 100%;
  white-space: nowrap;
}
.rotating-code .caret {
  display: inline-block;
  width: 0.5ch;
  background: currentColor;
  margin-left: 2px;
  height: 1em;
  vertical-align: -0.15em;
  opacity: 0.6;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ───── Buttons ───── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 8px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  transition: opacity 0.2s, border-color 0.2s, background 0.2s;
}
.btn-primary { background: var(--accent); color: #09090b; border: none; }
.btn-primary:hover { opacity: 0.85; }
.btn-ghost { border-color: var(--border); color: var(--text-muted); font-weight: 400; }
.btn-ghost:hover { border-color: var(--accent); color: var(--text); }
.btn-lg { padding: 14px 32px; }

/* ───── Flow Diagram ───── */
.flow-diagram {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 40px 0;
  max-width: 750px;
  margin: 0 auto;
  flex-wrap: nowrap;
  overflow-x: auto;
}
.flow-box {
  padding: 14px 20px;
  border-radius: 10px;
  font-size: 13px;
  font-family: var(--mono);
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: all 0.3s ease;
  white-space: nowrap;
}
.flow-box.active {
  border-color: var(--accent);
  background: var(--accent-glow);
  box-shadow: 0 0 24px var(--accent-glow);
}
.flow-label {
  color: var(--text-dim);
  font-size: 10px;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.flow-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  position: relative;
  min-width: 60px;
}
.flow-dot {
  position: absolute;
  top: -4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  opacity: 0;
  transition: opacity 0.15s;
  left: 0;
}
.flow-hub {
  padding: 14px 20px;
  border-radius: 10px;
  font-size: 13px;
  font-family: var(--mono);
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: all 0.3s ease;
  white-space: nowrap;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 118px;
  align-self: stretch;
}
.flow-hub.active {
  border-color: var(--accent);
  background: var(--accent-glow);
  box-shadow: 0 0 24px var(--accent-glow);
}
.flow-hub .hub-value { color: var(--accent); }
.flow-targets { display: flex; flex-direction: column; gap: 6px; }
.flow-target-row { display: flex; align-items: center; gap: 0; }
.flow-target-line {
  width: 48px;
  height: 2px;
  position: relative;
  background: transparent;
}
.flow-target {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-family: var(--mono);
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: all 0.3s ease;
  white-space: nowrap;
  opacity: 0.35;
  display: flex;
  align-items: center;
  gap: 10px;
}
.flow-target.targeted { opacity: 0.7; }
.flow-target.active {
  opacity: 1;
  border-color: var(--accent);
  background: var(--accent-glow);
  box-shadow: 0 0 24px var(--accent-glow);
}
.flow-target-env {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  font-weight: 600;
  min-width: 42px;
}
.flow-target.active .flow-target-env { color: var(--accent); }

/* ───── How-it-works ───── */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
}
.step { display: flex; gap: 16px; align-items: flex-start; }
.step-num {
  font-family: var(--mono);
  font-size: 32px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  flex-shrink: 0;
}
.step-title { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.step-desc { font-size: 14px; color: var(--text-muted); line-height: 1.7; }

/* ───── Features ───── */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}
.feature {
  padding: 28px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: border-color 0.2s;
}
.feature:hover { border-color: var(--accent); }
.feature-icon {
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  color: var(--accent);
}
.feature-title { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.feature-desc { font-size: 14px; color: var(--text-muted); line-height: 1.65; }

/* ───── Pricing ───── */
.pricing {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}
.price-card {
  padding: 32px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  flex: 1 1 340px;
  max-width: 400px;
  text-align: left;
}
.price-card.highlight {
  border-color: var(--accent);
  background: linear-gradient(160deg, oklch(0.75 0.18 226 / 0.06), transparent);
}
.price-name { font-size: 14px; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; }
.price-card.highlight .price-name { color: var(--accent); }
.price-amount {
  font-size: 40px;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: -0.03em;
}
.price-period { font-size: 16px; font-weight: 400; color: var(--text-muted); }
.price-list {
  border-top: 1px solid var(--border);
  margin-top: 20px;
  padding-top: 20px;
  list-style: none;
}
.price-list li {
  font-size: 14px;
  color: var(--text-muted);
  padding: 6px 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.price-list li::before {
  content: "✓";
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 2px;
}
.pricing-cta {
  color: var(--text-dim);
  font-size: 14px;
  margin-top: 32px;
  font-family: var(--mono);
}
.pricing-cta a { color: var(--accent); text-decoration: underline; }

/* ───── FAQ ───── */
.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
}
.faq-item summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  color: var(--text-dim);
  font-size: 18px;
  transition: transform 0.2s;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-answer {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 12px;
  line-height: 1.7;
}

/* ───── Headings ───── */
h2.section-title {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 48px;
}
h2.section-title-tight { margin-bottom: 12px; }
.section-sub { color: var(--text-muted); font-size: 15px; margin-bottom: 48px; }
.footer-cta h2 { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 16px; }
.footer-cta p { color: var(--text-muted); font-size: 15px; margin-bottom: 32px; }

/* ───── Footer ───── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px;
  text-align: center;
}
.site-footer small {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-dim);
}

/* ───── Modal ───── */
.modal {
  border: none;
  background: transparent;
  padding: 0;
  margin: auto;
  max-width: 100%;
  max-height: 100vh;
  color: var(--text);
}
.modal::backdrop {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
}
.modal-inner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: min(480px, 90vw);
  position: relative;
  overflow: hidden;
  padding: 20px;
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  z-index: 1;
}
.modal iframe {
  border: none;
  display: block;
  width: 100%;
  height: 500px;
}

/* ───── Responsive ───── */
@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-burger { display: flex; }
  .flow-diagram { transform: scale(0.7); transform-origin: center top; }
  .mobile-br { display: inline; }
  .section { padding: 60px 20px; }
  .hero { padding-top: 60px; }
  .rotating-code { font-size: 0.6em; padding: 2px 6px; }
  h2.section-title { font-size: 26px; margin-bottom: 32px; }
}
@media (min-width: 641px) {
  .mobile-br { display: none; }
}

/* ───── Reduced motion ───── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
