/* =================== RESET & VARIABLES =================== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  /* Navy + Teal palette */
  --navy-950: #0a0f1e;
  --navy-900: #0f1629;
  --navy-800: #152038;
  --navy-700: #1c2d4a;
  --navy-600: #2a3f63;
  --navy-500: #3a5580;
  --navy-400: #5a7aa8;
  --navy-300: #8ba3c7;
  --navy-200: #b8cce2;
  --navy-100: #dce6f2;
  --navy-50:  #eef2f8;

  --teal-600: #0e8a7d;
  --teal-500: #14b8a6;
  --teal-400: #2dd4bf;
  --teal-300: #5eead4;
  --teal-200: #99f6e4;

  --white: #ffffff;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--navy-800);
  background: var(--white);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* =================== GLOBAL UTILITIES =================== */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

a { color: inherit; text-decoration: none; }

/* =================== NAV =================== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 16px 0;
  transition: background 0.3s ease, box-shadow 0.3s ease, padding 0.3s ease;
}

.nav.scrolled {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--gray-200);
  padding: 10px 0;
}

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

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-logo svg { height: 32px; width: auto; }

.nav-wordmark {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--navy-900);
  letter-spacing: -0.02em;
}

.nav-wordmark span { color: var(--teal-500); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--navy-600);
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--teal-600); }

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  background: var(--navy-900);
  color: var(--white) !important;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.2s, transform 0.2s;
}

.nav-cta:hover {
  background: var(--navy-700);
  transform: translateY(-1px);
}

.nav-cta svg {
  width: 16px;
  height: 16px;
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.mobile-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--navy-800);
  margin: 5px 0;
  transition: 0.3s;
  border-radius: 2px;
}

/* =================== HERO =================== */
.hero {
  position: relative;
  padding: 160px 0 40px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(20, 184, 166, 0.06) 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 80% 20%, rgba(15, 22, 41, 0.03) 0%, transparent 60%);
  pointer-events: none;
}

/* Subtle grid pattern */
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(15, 22, 41, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 22, 41, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black 20%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px 6px 8px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--navy-600);
  margin-bottom: 28px;
  animation: fadeUp 0.8s var(--ease-out-expo) both;
}

.hero-badge-dot {
  width: 8px;
  height: 8px;
  background: var(--teal-500);
  border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5.5vw, 3.75rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--navy-950);
  margin-bottom: 24px;
  animation: fadeUp 0.8s var(--ease-out-expo) 0.1s both;
}

.hero h1 em {
  font-style: normal;
  color: var(--teal-600);
}

.hero-sub {
  font-size: 1.2rem;
  line-height: 1.7;
  color: var(--navy-500);
  max-width: 560px;
  margin: 0 auto 40px;
  animation: fadeUp 0.8s var(--ease-out-expo) 0.2s both;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  animation: fadeUp 0.8s var(--ease-out-expo) 0.3s both;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: var(--navy-900);
  color: var(--white);
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.25s var(--ease-out-expo);
}

.btn-primary:hover {
  background: var(--navy-700);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15, 22, 41, 0.18);
}

.btn-primary svg { width: 18px; height: 18px; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: transparent;
  color: var(--navy-700);
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  border: 1.5px solid var(--gray-300);
  cursor: pointer;
  transition: all 0.25s var(--ease-out-expo);
}

.btn-secondary:hover {
  border-color: var(--teal-500);
  color: var(--teal-600);
  transform: translateY(-2px);
}

.btn-secondary svg { width: 18px; height: 18px; }

/* Confidence score demo beneath hero */
.hero-demo {
  margin-top: 72px;
  animation: fadeUp 0.8s var(--ease-out-expo) 0.45s both;
}

.demo-img {
  width: 100%;
  border-radius: 16px;
  box-shadow:
    0 1px 2px rgba(0,0,0,0.07),
    0 4px 16px rgba(0,0,0,0.08),
    0 24px 60px rgba(15, 22, 41, 0.14);
}

/* =================== JSON OUTPUT =================== */
.json-section {
  padding: 20px 0 0;
}

.json-card {
  max-width: 540px;
  margin: 0 auto;
  background: var(--navy-950);
  border-radius: 14px;
  overflow: hidden;
  box-shadow:
    0 1px 2px rgba(0,0,0,0.07),
    0 4px 16px rgba(0,0,0,0.08),
    0 20px 48px rgba(15, 22, 41, 0.12);
  animation: fadeUp 0.8s var(--ease-out-expo) 0.4s both;
}

.json-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.json-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.json-dot:nth-child(1) { background: #ff5f57; }
.json-dot:nth-child(2) { background: #ffbd2e; }
.json-dot:nth-child(3) { background: #28c840; }

.json-title {
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: rgba(255,255,255,0.35);
}

.json-body {
  padding: 20px 24px 24px;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.9;
  color: var(--navy-200);
}

.json-body .jk { color: var(--teal-400); }
.json-body .jn { color: #f0b866; }
.json-body .js { color: var(--navy-200); }
.json-body .jh { color: var(--teal-300); font-weight: 500; }
.json-body .jb { color: rgba(255,255,255,0.35); }

/* =================== SECTION: HOW IT WORKS =================== */
.section { padding: 80px 0; }

.section-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal-600);
  margin-bottom: 16px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--navy-950);
  margin-bottom: 16px;
  line-height: 1.2;
}

.section-desc {
  font-size: 1.1rem;
  color: var(--navy-500);
  max-width: 540px;
  line-height: 1.7;
}

.how-header {
  text-align: center;
  margin-bottom: 72px;
}

.how-header .section-desc {
  margin: 0 auto;
}

/* Pipeline steps */
.pipeline {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  position: relative;
  max-width: 840px;
  margin: 0 auto;
}

.pipe-step {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 24px;
  padding-bottom: 48px;
  position: relative;
}

.pipe-step:last-child { padding-bottom: 0; }

/* Vertical line */
.pipe-step:not(:last-child) .pipe-num::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 56px;
  bottom: -48px;
  width: 2px;
  background: linear-gradient(to bottom, var(--teal-400), var(--gray-200));
  transform: translateX(-50%);
}

.pipe-num {
  position: relative;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy-950);
  color: var(--teal-400);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 14px;
  flex-shrink: 0;
}

.pipe-content { padding-top: 4px; }

.pipe-content h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--navy-900);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.pipe-content p {
  font-size: 0.95rem;
  color: var(--navy-500);
  line-height: 1.7;
  max-width: 520px;
}

.pipe-tag {
  display: inline-block;
  margin-top: 12px;
  padding: 4px 12px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--navy-600);
}

/* =================== SECTION: WHO WATCHES THE WATCHERS =================== */
.watchers-section {
  text-align: center;
  padding: 60px 0 80px;
}

.watchers-content {
  max-width: 680px;
  margin: 0 auto;
}

.watchers-content .section-desc {
  margin: 0 auto 24px;
}

.watchers-json {
  margin: 32px auto 28px;
  text-align: left;
}

.watchers-tags {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* =================== SECTION: OPEN SOURCE =================== */
.oss-section {
  background: var(--gray-50);
  border-top: 1px solid var(--gray-200);
  border-bottom: 1px solid var(--gray-200);
}

.oss-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.oss-content .section-desc { margin-bottom: 32px; }

.oss-features {
  list-style: none;
  margin-bottom: 36px;
}

.oss-features li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  font-size: 0.95rem;
  color: var(--navy-700);
}

.oss-features li svg {
  width: 20px;
  height: 20px;
  color: var(--teal-500);
  flex-shrink: 0;
  margin-top: 2px;
}

.oss-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.oss-card {
  background: var(--white);
  border-radius: 16px;
  border: 1px solid var(--gray-200);
  padding: 32px;
  position: relative;
  overflow: hidden;
  max-height: 520px;
  display: flex;
  flex-direction: column;
}

.oss-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--teal-500), var(--navy-600));
}

.oss-card-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal-600);
  margin-bottom: 20px;
}

.oss-yaml {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.85;
  color: var(--navy-700);
  background: var(--gray-50);
  padding: 20px;
  border-radius: 10px;
  border: 1px solid var(--gray-200);
  overflow: auto;
  white-space: pre;
  flex: 1;
  min-height: 0;
}

.oss-yaml .yk { color: var(--teal-600); font-weight: 500; }
.oss-yaml .yv { color: var(--navy-600); }
.oss-yaml .yn { color: #c57b3a; }
.oss-yaml .yc { color: var(--gray-400); }

/* =================== SECTION: CONFIDENCE =================== */
.confidence-section { text-align: center; }

.conf-header { margin-bottom: 64px; }
.conf-header .section-desc { margin: 0 auto; }

.conf-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
}

.conf-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 16px;
  padding: 36px 28px;
  text-align: center;
  transition: transform 0.3s var(--ease-out-expo), box-shadow 0.3s var(--ease-out-expo);
}

.conf-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(15, 22, 41, 0.08);
}

.conf-icon {
  width: 48px;
  height: 48px;
  background: var(--navy-950);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.conf-icon svg {
  width: 22px;
  height: 22px;
  color: var(--teal-400);
}

.conf-card h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--navy-900);
  margin-bottom: 10px;
}

.conf-card p {
  font-size: 0.88rem;
  color: var(--navy-500);
  line-height: 1.65;
}

/* =================== CTA SECTION =================== */
.cta-section {
  padding: 80px 0 100px;
}

.cta-box {
  background: var(--navy-950);
  border-radius: 20px;
  padding: 64px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-box::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 80% at 30% 0%, rgba(20, 184, 166, 0.12) 0%, transparent 60%);
  pointer-events: none;
}

.cta-box .section-title {
  color: var(--white);
  position: relative;
}

.cta-box .section-desc {
  color: var(--navy-300);
  margin: 0 auto 36px;
  position: relative;
}

.cta-actions {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.btn-teal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: var(--teal-500);
  color: var(--navy-950);
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.25s var(--ease-out-expo);
}

.btn-teal:hover {
  background: var(--teal-400);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(20, 184, 166, 0.3);
}

.btn-teal svg { width: 18px; height: 18px; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: transparent;
  color: var(--navy-200);
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  border: 1.5px solid rgba(255,255,255,0.15);
  cursor: pointer;
  transition: all 0.25s var(--ease-out-expo);
}

.btn-ghost:hover {
  border-color: rgba(255,255,255,0.35);
  color: var(--white);
  transform: translateY(-2px);
}

/* =================== FOOTER =================== */
.footer {
  border-top: 1px solid var(--gray-200);
  padding: 48px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-left svg { height: 24px; width: auto; }

.footer-text {
  font-size: 0.82rem;
  color: var(--gray-500);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.footer-links a {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--gray-500);
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--teal-600); }

.footer-links a svg {
  width: 16px;
  height: 16px;
}

/* =================== ANIMATIONS =================== */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s var(--ease-out-expo), transform 0.7s var(--ease-out-expo);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease-out-expo), transform 0.6s var(--ease-out-expo);
}

.reveal-stagger.visible > *:nth-child(1) { transition-delay: 0s; }
.reveal-stagger.visible > *:nth-child(2) { transition-delay: 0.08s; }
.reveal-stagger.visible > *:nth-child(3) { transition-delay: 0.16s; }
.reveal-stagger.visible > *:nth-child(4) { transition-delay: 0.24s; }
.reveal-stagger.visible > *:nth-child(5) { transition-delay: 0.32s; }
.reveal-stagger.visible > *:nth-child(6) { transition-delay: 0.40s; }

.reveal-stagger.visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* =================== RESPONSIVE =================== */
@media (max-width: 900px) {
  .oss-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .conf-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
  }

  .cta-box { padding: 48px 28px; }
}

@media (max-width: 680px) {
  .nav-links { display: none; }
  .mobile-toggle { display: block; }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 20px 24px;
    gap: 16px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.08);
  }

  .hero { padding: 120px 0 60px; }

  .hero-actions { flex-direction: column; }
  .btn-primary, .btn-secondary { width: 100%; justify-content: center; }

  .demo-body { padding: 20px 16px 24px; }
  .demo-line { font-size: 0.7rem; }

  .pipe-step { grid-template-columns: 44px 1fr; gap: 16px; }
  .pipe-num { width: 44px; height: 44px; font-size: 0.75rem; border-radius: 12px; }

  .section { padding: 64px 0; }

  .oss-links { flex-direction: column; }
  .btn-primary, .btn-secondary, .btn-teal, .btn-ghost { width: 100%; justify-content: center; }

  .footer-inner { flex-direction: column; text-align: center; }
  .footer-links { flex-wrap: wrap; justify-content: center; }
}

@media (max-width: 420px) {
  .demo-line { font-size: 0.62rem; }
}
