/* === Base Variables === */
:root {
  --bg: #09090b;
  --surface: #18181b;
  --surface-2: #27272a;
  --text: #fafafa;
  --text-muted: #a1a1aa;
  --text-subtle: #71717a;
  --accent: #8b5cf6;
  --accent-glow: rgba(139, 92, 246, 0.15);
  --border: rgba(255,255,255,0.06);
  --gradient-start: #8b5cf6;
  --gradient-end: #7c3aed;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

/* === Navigation === */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 20px 0;
  background: rgba(9,9,11,0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}

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

/* === Hero Section === */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 120px 0 80px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
}

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

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.hero-badge-dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
}

.hero h1 {
  font-size: clamp(48px, 8vw, 80px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 24px;
}

.hero h1 .gradient {
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 20px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 48px;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
}

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

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 16px 32px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 10px;
  transition: all 0.2s;
}

.btn-primary:hover {
  background: #7c3aed;
  transform: translateY(-1px);
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 64px;
  margin-top: 80px;
  padding-top: 48px;
  border-top: 1px solid var(--border);
}

.stat {
  text-align: center;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.stat-label {
  font-size: 13px;
  color: var(--text-subtle);
  margin-top: 4px;
}

/* === Product Preview === */
.product-preview {
  margin-top: 80px;
  position: relative;
}

.preview-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 0 80px rgba(139,92,246,0.08);
}

.preview-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

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

.preview-dot.red { background: #ef4444; }
.preview-dot.yellow { background: #eab308; }
.preview-dot.green { background: #22c55e; }

.preview-content {
  padding: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

/* Tic-Tac-Toe Grid Demo */
.ttt-demo {
  display: grid;
  grid-template-columns: repeat(3, 72px);
  gap: 6px;
}

.ttt-cell {
  width: 72px;
  height: 72px;
  background: var(--surface-2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 700;
  color: var(--text);
  font-family: "SF Mono", "Menlo", monospace;
  position: relative;
}

.ttt-cell.x-mark {
  color: #22c55e;
}

.ttt-cell.o-mark {
  color: #3b82f6;
}

.ttt-cell.win {
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.1);
}

.ttt-cell.crown::after {
  content: '♔';
  position: absolute;
  top: -8px;
  right: -8px;
  font-size: 16px;
  color: #f59e0b;
}

.ttt-cell .win-ring {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  border: 3px solid #22c55e;
}

.preview-label {
  font-size: 14px;
  color: var(--text-subtle);
}

.heat-legend {
  display: flex;
  gap: 16px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.heat-legend span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.heat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.heat-win { background: #22c55e; }
.heat-draw { background: #06b6d4; }
.heat-loss { background: #ef4444; }

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

.section-header {
  text-align: center;
  margin-bottom: 64px;
}

.section-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
}

.section-title {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.section-desc {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 500px;
  margin: 0 auto;
}

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

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  transition: all 0.3s;
}

.feature-card:hover {
  border-color: rgba(139,92,246,0.3);
  transform: translateY(-2px);
}

.feature-icon {
  width: 48px;
  height: 48px;
  background: var(--accent-glow);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 20px;
}

.feature-card h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
}

.feature-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* === AI Levels Section === */
.ai-levels {
  padding: 120px 0;
  background: var(--surface);
}

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

.level-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  transition: all 0.3s;
}

.level-card:hover {
  border-color: rgba(139,92,246,0.3);
  transform: translateY(-2px);
}

.level-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  font-size: 28px;
  margin-bottom: 20px;
}

.level-badge.easy {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.level-badge.medium {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.level-badge.hard {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.level-card h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

.level-card .level-name {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.level-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* === How It Works === */
.how-it-works {
  padding: 120px 0;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
  position: relative;
}

.steps::before {
  content: '';
  position: absolute;
  top: 24px;
  left: calc(16.67% + 24px);
  right: calc(16.67% + 24px);
  height: 1px;
  background: var(--border);
}

.step {
  text-align: center;
  position: relative;
}

.step-number {
  width: 48px;
  height: 48px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  color: var(--accent);
  margin: 0 auto 24px;
}

.step h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
}

.step p {
  font-size: 14px;
  color: var(--text-muted);
}

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

.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-left {
  font-size: 14px;
  color: var(--text-subtle);
}

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

.footer-links a {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

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

/* === Responsive === */
@media (max-width: 768px) {
  .hero-stats {
    gap: 32px;
    flex-wrap: wrap;
  }

  .features-grid,
  .steps,
  .level-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .steps::before { display: none; }

  .nav-links { display: none; }

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

  .ttt-demo {
    grid-template-columns: repeat(3, 64px);
  }

  .ttt-cell {
    width: 64px;
    height: 64px;
    font-size: 30px;
  }
}

@media (max-width: 480px) {
  .level-cards {
    grid-template-columns: 1fr;
  }

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