/* ============================================
   SPECK.JS - The AI-Native Web Framework
   ============================================ */

:root {
  /* Colors */
  --bg-dark: #0a0a0f;
  --bg-card: #12121a;
  --bg-elevated: #1a1a24;
  --border: #2a2a3a;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #606070;
  
  /* Brand gradient */
  --gradient-start: #667eea;
  --gradient-mid: #7c3aed;
  --gradient-end: #a855f7;
  --accent: #7c3aed;
  --accent-glow: rgba(124, 58, 237, 0.4);
  
  /* Code colors */
  --code-bg: #0d0d14;
  --code-tag: #7dd3fc;
  --code-attr: #c4b5fd;
  --code-value: #86efac;
  --code-string: #fcd34d;
  --code-keyword: #f472b6;
  
  /* Spacing */
  --nav-height: 72px;
  --section-gap: 120px;
  --container: 1200px;
  
  /* Typography */
  --font-display: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

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

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

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-elevated);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

/* Animated Background */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image: 
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

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

.bg-glow-1 {
  background: var(--gradient-start);
  top: -200px;
  right: -200px;
  animation: float 20s ease-in-out infinite;
}

.bg-glow-2 {
  background: var(--gradient-end);
  bottom: -200px;
  left: -200px;
  animation: float 25s ease-in-out infinite reverse;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(50px, 50px); }
}

/* Navigation */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  backdrop-filter: blur(20px);
  background: rgba(10, 10, 15, 0.8);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.25rem;
}

.logo-icon {
  font-size: 1.5rem;
}

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

.nav-links a {
  color: var(--text-secondary);
  font-weight: 500;
  transition: color 0.2s;
}

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

.nav-github {
  display: flex;
  align-items: center;
  padding: 8px;
  border-radius: 8px;
  background: var(--bg-elevated);
  transition: background 0.2s;
}

.nav-github:hover {
  background: var(--border);
}

/* Hero Section */
.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(var(--nav-height) + 40px) 24px 60px;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 32px;
  animation: fadeInUp 0.6s var(--ease-out);
}

.badge-dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.hero-title {
  font-size: clamp(3rem, 10vw, 5.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
  animation: fadeInUp 0.6s var(--ease-out) 0.1s both;
}

.title-line {
  display: block;
}

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

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 500px;
  margin-bottom: 40px;
  animation: fadeInUp 0.6s var(--ease-out) 0.2s both;
}

/* Hero Code Block */
.hero-code {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  text-align: left;
  max-width: 500px;
  width: 100%;
  margin-bottom: 40px;
  animation: fadeInUp 0.6s var(--ease-out) 0.3s both;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.code-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}

.code-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--border);
}

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

.code-filename {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.code-content {
  padding: 20px;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.7;
  overflow-x: auto;
}

.code-tag { color: var(--code-tag); }
.code-attr { color: var(--code-attr); }
.code-value { color: var(--code-value); }
.code-string { color: var(--code-string); }
.code-keyword { color: var(--code-keyword); }

/* Buttons */
.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 60px;
  animation: fadeInUp 0.6s var(--ease-out) 0.4s both;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-mid));
  color: white;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--accent-glow);
}

.btn-secondary {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--border);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-primary);
}

.btn-ghost:hover {
  background: var(--bg-elevated);
}

.btn-large {
  padding: 18px 36px;
  font-size: 1.1rem;
}

/* Hero Stats */
.hero-stats {
  display: flex;
  align-items: center;
  gap: 32px;
  animation: fadeInUp 0.6s var(--ease-out) 0.5s both;
}

.stat {
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.stat-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
}

/* Section Styles */
section {
  position: relative;
  z-index: 1;
  padding: var(--section-gap) 24px;
  max-width: var(--container);
  margin: 0 auto;
}

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

.section-tag {
  display: inline-block;
  padding: 6px 14px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(124, 58, 237, 0.1));
  border: 1px solid rgba(124, 58, 237, 0.3);
  border-radius: 100px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

.section-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.2;
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  transition: all 0.3s var(--ease-out);
}

.feature-card:hover {
  border-color: rgba(124, 58, 237, 0.5);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.feature-highlight {
  grid-column: span 2;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(124, 58, 237, 0.05));
  border-color: rgba(124, 58, 237, 0.3);
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.feature-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.feature-card p {
  color: var(--text-secondary);
  line-height: 1.7;
}

.feature-code {
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--code-bg);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--code-value);
}

/* Get Started Steps */
.steps {
  display: flex;
  flex-direction: column;
  gap: 32px;
  max-width: 700px;
  margin: 0 auto;
}

.step {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.step-number {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-mid));
  border-radius: 12px;
  font-size: 1.25rem;
  font-weight: 700;
}

.step-content {
  flex: 1;
}

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

/* Terminal */
.terminal {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.terminal-header {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
}

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

.terminal-content {
  padding: 16px;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.8;
}

.terminal-prompt {
  color: var(--accent);
}

.terminal-comment {
  color: var(--text-muted);
}

.terminal-success {
  color: #28c840;
}

/* Examples Tabs */
.examples-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 32px;
}

.tab-btn {
  padding: 10px 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-mid));
  border-color: transparent;
  color: white;
}

/* Example Panels */
.examples-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
}

.example-panel {
  display: none;
  grid-template-columns: 1fr 1fr;
}

.example-panel.active {
  display: grid;
}

.example-code {
  background: var(--code-bg);
  padding: 24px;
  border-right: 1px solid var(--border);
  overflow-x: auto;
}

.example-code pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.7;
}

.example-desc {
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.example-desc h4 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.example-desc p {
  color: var(--text-secondary);
  line-height: 1.7;
}

/* Comparison */
.comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 24px;
}

.comparison-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.comparison-header {
  padding: 16px 20px;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

.comparison-other {
  background: var(--bg-elevated);
  color: var(--text-secondary);
}

.comparison-speck {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(124, 58, 237, 0.1));
  color: var(--accent);
}

.comparison-code {
  padding: 20px;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.7;
  overflow-x: auto;
  color: var(--text-secondary);
}

/* CTA Section */
.cta {
  text-align: center;
  padding: var(--section-gap) 24px;
  background: linear-gradient(180deg, transparent, rgba(124, 58, 237, 0.05));
}

.cta-content h2 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  margin-bottom: 16px;
}

.cta-content p {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

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

/* Footer */
.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 40px 24px;
}

.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

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

.footer-links a {
  color: var(--text-secondary);
  transition: color 0.2s;
}

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

.footer-copy {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive */
@media (max-width: 900px) {
  .feature-highlight {
    grid-column: span 1;
  }
  
  .example-panel.active {
    grid-template-columns: 1fr;
  }
  
  .example-code {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  
  .comparison-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  :root {
    --section-gap: 80px;
  }
  
  .nav-links a:not(.nav-github) {
    display: none;
  }
  
  .hero-stats {
    flex-direction: column;
    gap: 24px;
  }
  
  .stat-divider {
    width: 40px;
    height: 1px;
  }
  
  .hero-actions {
    flex-direction: column;
    width: 100%;
    max-width: 300px;
  }
  
  .btn {
    width: 100%;
    justify-content: center;
  }
}
