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

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --bg: #0f172a;
  --bg-light: #1e293b;
  --bg-card: #1e293b;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --text-heading: #f8fafc;
  --border: #334155;
  --green: #22c55e;
  --green-bg: rgba(34, 197, 94, 0.1);
  --yellow: #eab308;
  --yellow-bg: rgba(234, 179, 8, 0.1);
  --red: #ef4444;
  --red-bg: rgba(239, 68, 68, 0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.3), 0 2px 4px -2px rgba(0,0,0,0.2);
  --shadow-lg: 0 10px 25px -3px rgba(0,0,0,0.4), 0 4px 10px -4px rgba(0,0,0,0.3);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3, h4 { color: var(--text-heading); line-height: 1.2; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 3vw, 2.5rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 600; }
h4 { font-size: 1.1rem; font-weight: 600; }

a { color: var(--primary-light); text-decoration: none; }
a:hover { color: var(--primary); }

code {
  font-family: 'Fira Code', 'Cascadia Code', 'JetBrains Mono', monospace;
  font-size: 0.85em;
  background: rgba(99, 102, 241, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--primary-light);
}

.mt-1 { margin-top: 1rem; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: all 0.2s;
  border: 2px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary-light);
  transform: translateY(-1px);
}

.btn-lg {
  padding: 14px 32px;
  font-size: 1.05rem;
}

/* ===== Navbar ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 16px 0;
  transition: all 0.3s;
  background: transparent;
}
.navbar.scrolled {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  padding: 10px 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

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

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-heading);
  font-weight: 700;
  font-size: 1.15rem;
}
.nav-brand:hover { color: var(--text-heading); }
.nav-logo { width: 32px; height: 32px; }

.nav-links {
  display: flex;
  gap: 32px;
  align-items: center;
}
.nav-links a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.9rem;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text-heading); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: all 0.3s;
}
.nav-toggle.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ===== Hero ===== */
.hero {
  padding: 160px 0 100px;
  text-align: center;
  background: radial-gradient(ellipse at 50% 0%, rgba(99, 102, 241, 0.15) 0%, transparent 60%);
}

.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--primary-light);
  margin-bottom: 24px;
}

.hero h1 {
  max-width: 800px;
  margin: 0 auto 24px;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 60px;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 60px;
  flex-wrap: wrap;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary-light);
}
.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ===== Value Props ===== */
.value-props {
  padding: 80px 0;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: all 0.3s;
}
.card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(99, 102, 241, 0.15);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  color: var(--primary-light);
}

.card h3 { margin-bottom: 8px; }
.card p { color: var(--text-muted); font-size: 0.95rem; }

/* ===== Section Headers ===== */
.section-header {
  text-align: center;
  margin-bottom: 60px;
}
.section-header p {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-top: 12px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== Features ===== */
.features {
  padding: 100px 0;
}

.feature-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  margin-bottom: 100px;
}
.feature-block:last-child { margin-bottom: 0; }
.feature-block.reverse { direction: rtl; }
.feature-block.reverse > * { direction: ltr; }

.feature-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--primary-light);
  margin-bottom: 12px;
}

.feature-text h3 {
  font-size: 1.5rem;
  margin-bottom: 16px;
}
.feature-text p {
  color: var(--text-muted);
  margin-bottom: 20px;
}

.feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.feature-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.feature-list li::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--green);
  border-radius: 50%;
  flex-shrink: 0;
}

/* Code Preview */
.code-preview {
  background: #0d1117;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.code-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
}
.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.dot.red { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green { background: #28c840; }
.code-title {
  margin-left: 8px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-family: monospace;
}

.code-body { padding: 16px; }

.xpath-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 6px;
  font-size: 0.85rem;
}
.xpath-row:last-child { margin-bottom: 0; }
.xpath-row.stable { background: var(--green-bg); }
.xpath-row.moderate { background: var(--yellow-bg); }
.xpath-row.fragile { background: var(--red-bg); }

.score {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}
.score.high { background: var(--green); color: #052e16; }
.score.medium { background: var(--yellow); color: #422006; }
.score.low { background: var(--red); color: white; }

.xpath-row code {
  background: none;
  padding: 0;
  color: var(--text);
  font-size: 0.85rem;
}

/* Category Grid */
.category-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.category-tag {
  padding: 6px 14px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--primary-light);
}

/* Categories Showcase */
.categories-showcase {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.cat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.cat-item:last-child { border-bottom: none; }
.cat-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(99, 102, 241, 0.15);
  border-radius: 6px;
  color: var(--primary-light);
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.cat-item strong { min-width: 80px; color: var(--text-heading); }
.cat-item code { font-size: 0.8rem; }

/* Framework Badges */
.framework-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}
.fw-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
}
.fw-badge.blocked {
  background: var(--red-bg);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}
.fw-badge.blocked code {
  background: none;
  padding: 0;
  color: #fca5a5;
  font-size: 0.75rem;
}

/* Detection Demo */
.detection-demo {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.detect-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 6px;
  margin-bottom: 8px;
}
.detect-row:last-child { margin-bottom: 0; }
.detect-row.rejected { background: var(--red-bg); }
.detect-row.accepted { background: var(--green-bg); }
.detect-row code {
  flex: 1;
  background: none;
  padding: 0;
  color: var(--text);
  font-size: 0.85rem;
}
.detect-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ===== How It Works ===== */
.how-it-works {
  padding: 100px 0;
  background: var(--bg-light);
}

.steps-grid {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 20px;
}

.step {
  flex: 1;
  max-width: 300px;
  text-align: center;
  padding: 32px 24px;
}

.step-number {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: white;
  font-size: 1.5rem;
  font-weight: 800;
  border-radius: 50%;
  margin: 0 auto 20px;
}

.step h3 { margin-bottom: 8px; }
.step p { color: var(--text-muted); font-size: 0.95rem; }

.step-arrow {
  font-size: 2rem;
  color: var(--border);
  padding-top: 40px;
  flex-shrink: 0;
}

/* ===== Scoring ===== */
.scoring {
  padding: 100px 0;
}

.scoring-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 48px;
}

.score-card {
  border-radius: var(--radius);
  padding: 32px;
  border: 1px solid;
  text-align: center;
}
.stable-card {
  background: var(--green-bg);
  border-color: rgba(34, 197, 94, 0.25);
}
.moderate-card {
  background: var(--yellow-bg);
  border-color: rgba(234, 179, 8, 0.25);
}
.fragile-card {
  background: var(--red-bg);
  border-color: rgba(239, 68, 68, 0.25);
}

.score-range {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 4px;
}
.stable-card .score-range { color: var(--green); }
.moderate-card .score-range { color: var(--yellow); }
.fragile-card .score-range { color: var(--red); }

.score-card h3 { margin-bottom: 8px; }
.score-card p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 16px; }

.score-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}
.score-examples code {
  font-size: 0.75rem;
  background: rgba(255,255,255,0.05);
}

/* Scoring Detail */
.scoring-detail {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}
.scoring-detail h4 { margin-bottom: 20px; }

.scoring-checks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.check-item {
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 0.9rem;
}
.check-item.penalty {
  background: var(--red-bg);
  color: #fca5a5;
}
.check-item.reward {
  background: var(--green-bg);
  color: #86efac;
}

/* ===== POM Section ===== */
.pom-section {
  padding: 100px 0;
  background: var(--bg-light);
}

.pom-demo {
  max-width: 700px;
  margin: 0 auto 48px;
  background: #0d1117;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.pom-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.pom-tab {
  padding: 12px 20px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  font-family: inherit;
}
.pom-tab:hover { color: var(--text); }
.pom-tab.active {
  color: var(--primary-light);
  border-bottom-color: var(--primary);
}

.pom-code-container { padding: 24px; }
.pom-code {
  font-family: 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text);
  margin: 0;
  white-space: pre;
  overflow-x: auto;
}

.code-comment { color: #6a737d; }
.code-keyword { color: #ff7b72; }
.code-string { color: #a5d6ff; }
.code-annotation { color: #d2a8ff; }

.frameworks-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 600px;
  margin: 0 auto;
}
.framework-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
}
.framework-card h4 { margin-bottom: 12px; }
.lang-tags {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.lang-tags span {
  padding: 4px 12px;
  background: rgba(99, 102, 241, 0.1);
  border-radius: 100px;
  font-size: 0.8rem;
  color: var(--primary-light);
  font-weight: 500;
}

/* ===== CTA ===== */
.cta {
  padding: 100px 0;
  text-align: center;
  background: radial-gradient(ellipse at 50% 100%, rgba(99, 102, 241, 0.15) 0%, transparent 60%);
}
.cta h2 { margin-bottom: 16px; }
.cta > .container > p {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 32px;
}
.cta-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===== Footer ===== */
.footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
}
.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.footer-logo { width: 32px; height: 32px; }
.footer-brand strong { color: var(--text-heading); }
.footer-brand p { color: var(--text-muted); font-size: 0.85rem; }
.footer-links {
  display: flex;
  gap: 24px;
}
.footer-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
}
.footer-links a:hover { color: var(--text-heading); }
.footer-bottom {
  text-align: center;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.footer-bottom p {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ===== Animations ===== */
.animate-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.animate-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .cards-grid { grid-template-columns: 1fr; max-width: 500px; margin: 0 auto; }
  .feature-block { grid-template-columns: 1fr; gap: 40px; }
  .feature-block.reverse { direction: ltr; }
  .scoring-grid { grid-template-columns: 1fr; max-width: 400px; margin: 0 auto 48px; }
  .scoring-checks { grid-template-columns: 1fr; }
  .steps-grid { flex-direction: column; align-items: center; }
  .step-arrow { transform: rotate(90deg); padding: 0; }
  .frameworks-grid { grid-template-columns: 1fr; max-width: 350px; }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(12px);
    padding: 20px 24px;
    gap: 16px;
    border-bottom: 1px solid var(--border);
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: flex; }

  .hero { padding: 120px 0 60px; }
  .hero-stats { gap: 30px; }
  .hero-actions { flex-direction: column; align-items: center; }

  .footer-content { flex-direction: column; gap: 20px; text-align: center; }
  .footer-links { flex-direction: column; gap: 12px; align-items: center; }

  .pom-tabs { gap: 0; }
  .pom-tab { padding: 10px 14px; font-size: 0.8rem; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  h1 { font-size: 1.75rem; }
  .btn-lg { padding: 12px 24px; font-size: 0.95rem; }
}
