*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  --bg-primary: #06080d;
  --bg-secondary: #0c1018;
  --bg-card: #111827;
  --bg-card-hover: #1a2236;
  --nav-bg: rgba(6, 8, 13, 0.75);
  --mobile-nav-bg: rgba(6, 8, 13, 0.95);
  --grid-line: rgba(59, 130, 246, 0.03);
  --accent: #3b82f6;
  --accent-glow: rgba(59, 130, 246, 0.35);
  --accent-light: #60a5fa;
  --accent-dark: #2563eb;
  --green: #22c55e;
  --green-glow: rgba(34, 197, 94, 0.25);
  --amber: #f59e0b;
  --red: #ef4444;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: #1e293b;
  --border-light: #334155;
  --radius: 12px;
  --radius-lg: 20px;
  --radius-sm: 8px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --particle-opacity: 0.75;
  --particle-colors: 96, 165, 250|59, 130, 246|34, 197, 94|139, 92, 246;
  --particle-link-color: 96, 165, 250;
  --particle-link-opacity: 0.075;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg-primary: #f8fbff;
  --bg-secondary: #eef6ff;
  --bg-card: rgba(255, 255, 255, 0.82);
  --bg-card-hover: #ffffff;
  --nav-bg: rgba(248, 251, 255, 0.78);
  --mobile-nav-bg: rgba(248, 251, 255, 0.96);
  --grid-line: rgba(37, 99, 235, 0.06);
  --accent: #2563eb;
  --accent-glow: rgba(37, 99, 235, 0.22);
  --accent-light: #1d4ed8;
  --accent-dark: #1e40af;
  --green: #059669;
  --green-glow: rgba(5, 150, 105, 0.18);
  --amber: #d97706;
  --red: #dc2626;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --border: rgba(148, 163, 184, 0.32);
  --border-light: rgba(37, 99, 235, 0.28);
  --particle-opacity: 0.62;
  --particle-colors: 37, 99, 235|14, 165, 233|5, 150, 105|124, 58, 237;
  --particle-link-color: 37, 99, 235;
  --particle-link-opacity: 0.055;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-light);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--accent);
}

img {
  max-width: 100%;
}

/* ── NOISE / GRID BACKGROUND ── */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 60px 60px;
}

.particle-canvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: var(--particle-opacity);
  transition: opacity 0.3s ease;
}

.bg-glow {
  position: fixed;
  z-index: -1;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(150px);
  opacity: 0.4;
  pointer-events: none;
}

.bg-glow--blue {
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  opacity: 0.15;
}

.bg-glow--green {
  bottom: 20%;
  right: -100px;
  background: var(--green);
  opacity: 0.07;
  width: 400px;
  height: 400px;
}

/* ── NAV ── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 0 2rem;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
}

.nav__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
}

.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  object-fit: cover;
  box-shadow: 0 0 18px rgba(96, 165, 250, 0.25);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav__links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav__links a:hover {
  color: var(--text-primary);
}

.nav__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #fff !important;
  padding: 8px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.2s, box-shadow 0.2s;
}

.nav__cta:hover {
  background: var(--accent-dark);
  box-shadow: 0 0 24px var(--accent-glow);
}

.nav__built-by {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border: 1px solid rgba(96, 165, 250, 0.3);
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.06);
  color: var(--accent-light) !important;
  font-weight: 600;
  font-size: 0.9rem;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s, transform 0.2s;
}

.nav__built-by:hover {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.08);
  color: var(--text-primary) !important;
  box-shadow: 0 0 24px rgba(34, 197, 94, 0.12);
  transform: translateY(-1px);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px 7px 8px;
  border: 1px solid var(--border-light);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-card) 78%, transparent);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--text-primary);
  box-shadow: 0 0 24px var(--accent-glow);
}

.theme-toggle__track {
  position: relative;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.25);
  transition: background 0.25s;
}

.theme-toggle__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 65% 35%, transparent 0 4px, #dbeafe 4.5px),
    linear-gradient(135deg, #93c5fd, #60a5fa);
  box-shadow: 0 0 12px rgba(96, 165, 250, 0.45);
  transition: transform 0.25s, background 0.25s, box-shadow 0.25s;
}

html[data-theme="light"] .theme-toggle__track {
  background: linear-gradient(135deg, #bfdbfe, #ecfeff);
}

html[data-theme="light"] .theme-toggle__thumb {
  transform: translateX(16px);
  background: radial-gradient(circle, #f59e0b 0 55%, #fde68a 56%);
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.35);
}

@media (max-width: 1100px) {
  .nav__links {
    gap: 1rem;
  }

  .nav__built-by,
  .nav__cta {
    padding-inline: 14px;
  }
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: all 0.3s;
}

/* ── HERO ── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 2rem 80px;
}

.hero__inner {
  max-width: 800px;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.25);
  color: var(--green);
  padding: 6px 16px;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 2rem;
  letter-spacing: 0.02em;
}

.hero__badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse-dot 2s ease-in-out infinite;
}

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

.hero__title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  letter-spacing: -0.03em;
}

.hero__title .gradient {
  background: linear-gradient(135deg, var(--accent-light), var(--green));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__subtitle {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
}

.hero__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: all 0.25s;
  font-family: var(--font);
}

.btn--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 32px var(--accent-glow);
}

.btn--primary:hover {
  background: var(--accent-dark);
  box-shadow: 0 0 48px var(--accent-glow);
  transform: translateY(-2px);
  color: #fff;
}

.btn--outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}

.btn--outline:hover {
  border-color: var(--accent);
  color: var(--accent-light);
  background: rgba(59, 130, 246, 0.05);
  transform: translateY(-2px);
}

.hero__stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 1px solid var(--border);
}

.hero__stat {
  text-align: center;
}

.hero__stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
}

.hero__stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── DEMO ── */
.demo {
  padding: 0 2rem 6rem;
}

.demo__window {
  max-width: 800px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

.demo__titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid var(--border);
}

.demo__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.demo__dot--red { background: #ef4444; }
.demo__dot--yellow { background: #f59e0b; }
.demo__dot--green { background: #22c55e; }

.demo__titlebar-text {
  flex: 1;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.demo__body {
  padding: 1.5rem;
}

.demo__line {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 2;
  display: flex;
  gap: 1rem;
  white-space: pre;
}

.demo__line-num {
  color: var(--text-muted);
  user-select: none;
  min-width: 20px;
  text-align: right;
}

.demo__key {
  color: var(--accent-light);
}

.demo__val {
  color: var(--text-secondary);
}

.demo__masked {
  color: var(--green);
  position: relative;
}

.demo__masked::after {
  content: '← masked by PromptGod';
  position: absolute;
  right: -200px;
  color: var(--green);
  opacity: 0.5;
  font-size: 0.75rem;
  font-family: var(--font);
  white-space: nowrap;
}

/* ── SECTION COMMON ── */
.section {
  padding: 6rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.section__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.15);
  color: var(--accent-light);
  padding: 5px 14px;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 1rem;
}

.section__title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.section__desc {
  color: var(--text-secondary);
  max-width: 600px;
  font-size: 1.05rem;
  margin-bottom: 3rem;
}

.section--center {
  text-align: center;
}

.section--center .section__desc {
  margin-left: auto;
  margin-right: auto;
}

/* ── FEATURES ── */
.features__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.feature-card:hover {
  border-color: var(--border-light);
  background: var(--bg-card-hover);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.feature-card:hover::before {
  opacity: 1;
}

.feature-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 1.25rem;
}

.feature-card__icon--blue {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.feature-card__icon--green {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.feature-card__icon--amber {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.feature-card__icon--red {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.feature-card__icon--purple {
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.2);
}

.feature-card__title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.feature-card__desc {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.6;
}

/* ── HOW IT WORKS ── */
.pipeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  max-width: 700px;
  margin: 0 auto;
}

.pipeline::before {
  content: '';
  position: absolute;
  left: 28px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--green));
  opacity: 0.3;
}

.pipeline__step {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  padding: 1.5rem 0;
  position: relative;
}

.pipeline__num {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--accent-light);
  z-index: 1;
}

.pipeline__content h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.pipeline__content p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ── SITES ── */
.sites__grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.site-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.25s;
}

.site-chip:hover {
  border-color: var(--accent);
  color: var(--text-primary);
  background: rgba(59, 130, 246, 0.05);
  transform: translateY(-2px);
}

/* ── DETECTION TABLE ── */
.detection-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 2rem;
  max-width: 800px;
}

.detection-table th,
.detection-table td {
  text-align: left;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.detection-table th {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.detection-table td {
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.detection-table td:first-child {
  color: var(--text-primary);
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.detection-table tr:hover td {
  background: rgba(59, 130, 246, 0.03);
}

/* ── CTA ── */
.cta-section {
  padding: 6rem 2rem;
  text-align: center;
}

.cta-box {
  max-width: 700px;
  margin: 0 auto;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(34, 197, 94, 0.05));
  border: 1px solid rgba(59, 130, 246, 0.15);
  border-radius: var(--radius-lg);
  padding: 4rem 2rem;
}

.cta-box h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  margin-bottom: 1rem;
}

.cta-box p {
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto 2rem;
  font-size: 1.05rem;
}

/* ── FOOTER ── */
.footer {
  border-top: 1px solid var(--border);
  padding: 3rem 2rem;
}

.footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--text-primary);
}

.footer__brand .brand-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.footer__links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.footer__links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: color 0.2s;
}

.footer__links a:hover {
  color: var(--text-secondary);
}

.footer__github {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.footer__copy {
  width: 100%;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

/* ── LEGAL PAGES ── */
.legal {
  max-width: 780px;
  margin: 0 auto;
  padding: 120px 2rem 6rem;
}

.legal__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
  transition: color 0.2s;
}

.legal__back:hover {
  color: var(--accent-light);
}

.legal__title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.legal__updated {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 3rem;
}

.legal h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.legal p,
.legal li {
  color: var(--text-secondary);
  font-size: 0.98rem;
  line-height: 1.8;
  margin-bottom: 1rem;
}

.legal ul {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.legal li {
  margin-bottom: 0.5rem;
}

.legal__highlight {
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.15);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  color: var(--green);
  font-weight: 500;
  font-size: 0.95rem;
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .nav__links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--mobile-nav-bg);
    backdrop-filter: blur(20px);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
    gap: 1rem;
  }

  .nav__links.active {
    display: flex;
  }

  .hamburger {
    display: flex;
  }

  .hero__stats {
    gap: 1.5rem;
  }

  .hero__stat-value {
    font-size: 1.5rem;
  }

  .demo__masked::after {
    display: none;
  }

  .demo__line {
    font-size: 0.72rem;
  }

  .features__grid {
    grid-template-columns: 1fr;
  }

  .pipeline::before {
    left: 18px;
  }

  .pipeline__num {
    width: 40px;
    height: 40px;
    font-size: 0.9rem;
  }

  .footer__inner {
    flex-direction: column;
    text-align: center;
  }

  .footer__links {
    justify-content: center;
  }

  .detection-table {
    font-size: 0.85rem;
  }

  .detection-table th,
  .detection-table td {
    padding: 0.75rem;
  }
}
