/* ===================================================================
   QuantaFlare V2 — Custom Styles
   Tailwind CDN handles utilities; this file covers:
   - CSS custom properties (design tokens)
   - Base resets & typography overrides
   - Component styles that Tailwind can't do inline
   - Animations & transitions
   =================================================================== */

/* --- Design Tokens --- */
:root {
  --bg-primary:   #0F0F0F;
  --bg-surface:   #1A1A1A;
  --bg-elevated:  #242424;
  --accent:       #FF5722;
  --accent-hover: #E64A19;
  --accent-subtle: rgba(255, 87, 34, 0.08);
  --accent-glow:  rgba(255, 87, 34, 0.15);
  --text-primary:   #F5F5F5;
  --text-secondary: #9CA3AF;
  --text-muted:     #6B7280;
  --border:         #2A2A2A;
  --border-light:   #333333;
}

/* --- Base --- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.font-mono {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

/* --- Links --- */
a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover { color: var(--accent-hover); }

/* --- Container --- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

@media (min-width: 768px) {
  .container { padding: 0 40px; }
}

/* --- Section Spacing --- */
.section {
  padding: 96px 0;
}

@media (max-width: 768px) {
  .section { padding: 64px 0; }
}

/* --- Navbar --- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 16px 0;
  transition: background 0.3s ease, padding 0.3s ease, box-shadow 0.3s ease;
}

.navbar.scrolled {
  background: rgba(15, 15, 15, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 10px 0;
  box-shadow: 0 1px 0 var(--border);
}

.navbar .nav-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s ease;
}
.navbar .nav-links a:hover,
.navbar .nav-links a.active {
  color: var(--text-primary);
}

/* Dropdown */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.nav-dropdown-menu a {
  display: block;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}
.nav-dropdown-menu a:hover {
  background: var(--accent-subtle);
  color: var(--text-primary);
}

/* Mobile Nav */
.mobile-nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px;
}

.mobile-nav {
  position: fixed;
  top: 0;
  right: -100%;
  width: 280px;
  height: 100vh;
  background: var(--bg-surface);
  z-index: 1001;
  padding: 80px 32px 32px;
  transition: right 0.3s ease;
  border-left: 1px solid var(--border);
}

.mobile-nav.open { right: 0; }

.mobile-nav a {
  display: block;
  padding: 14px 0;
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 500;
  border-bottom: 1px solid var(--border);
}
.mobile-nav a:hover { color: var(--text-primary); }

.mobile-nav-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
}

.mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.mobile-overlay.open { opacity: 1; visibility: visible; }

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

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: #E64A19;
  color: #fff;
}
.btn-primary:hover {
  background: #D84315;
  color: #fff;
  transform: translateY(-1px);
}

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

.btn-ghost {
  background: transparent;
  color: var(--accent);
  padding: 8px 0;
}
.btn-ghost:hover { color: var(--accent-hover); }

.btn-sm {
  padding: 8px 20px;
  font-size: 0.825rem;
}

/* --- Cards --- */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  transition: border-color 0.3s ease, transform 0.3s ease;
}

.card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
}

.card-elevated {
  background: var(--bg-elevated);
}

/* --- Hero Glow Effect --- */
.hero-glow {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}

/* --- Gradient Text --- */
.gradient-text {
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- Section Divider --- */
.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

/* --- Badge / Tag --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-accent {
  background: var(--accent-subtle);
  color: var(--accent);
  border: 1px solid rgba(255, 87, 34, 0.2);
}

/* --- Agent Dots --- */
.agent-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.agent-dot-red    { background: #EF4444; box-shadow: 0 0 8px rgba(239, 68, 68, 0.4); }
.agent-dot-blue   { background: #3B82F6; box-shadow: 0 0 8px rgba(59, 130, 246, 0.4); }
.agent-dot-green  { background: #22C55E; box-shadow: 0 0 8px rgba(34, 197, 94, 0.4); }

/* --- Code Block --- */
.code-block {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

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

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

.code-block pre {
  margin: 0;
  padding: 20px;
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.code-block .accent { color: var(--accent); }
.code-block .string { color: #A5D6A7; }
.code-block .comment { color: var(--text-muted); }
.code-block .keyword { color: #CE93D8; }

/* --- Phone Mockup --- */
.phone-mockup {
  width: 280px;
  height: 560px;
  background: var(--bg-surface);
  border: 3px solid var(--border-light);
  border-radius: 40px;
  padding: 12px;
  position: relative;
  margin: 0 auto;
}

.phone-mockup-notch {
  width: 120px;
  height: 28px;
  background: var(--bg-primary);
  border-radius: 0 0 20px 20px;
  margin: 0 auto;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
}

.phone-mockup-screen {
  width: 100%;
  height: 100%;
  background: var(--bg-elevated);
  border-radius: 28px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* --- Steps / Flow --- */
.flow-connector {
  width: 48px;
  height: 2px;
  background: linear-gradient(90deg, var(--border), var(--accent), var(--border));
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .flow-connector {
    width: 2px;
    height: 32px;
  }
}

/* --- Form --- */
.form-input {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  transition: border-color 0.2s ease;
  outline: none;
}

.form-input:focus {
  border-color: var(--accent);
}

.form-input::placeholder {
  color: var(--text-muted);
}

textarea.form-input {
  resize: vertical;
  min-height: 120px;
}

/* Honeypot — visually hidden, catches bots */
.hp-field {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  width: 0;
  overflow: hidden;
}

/* --- Scroll Animations --- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* --- Footer --- */
.footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 48px 0 32px;
}

.footer a {
  color: var(--text-muted);
  font-size: 0.875rem;
}
.footer a:hover { color: var(--text-primary); }

/* --- App Store Badges --- */
.store-badge {
  height: 48px;
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 8px 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.8rem;
  transition: border-color 0.2s ease;
}
.store-badge:hover {
  border-color: var(--border-light);
  color: var(--text-primary);
}

/* --- Misc Utilities --- */
.text-accent { color: var(--accent); }
.bg-surface { background: var(--bg-surface); }
.border-b { border-bottom: 1px solid var(--border); }

/* --- Responsive Grid Helpers --- */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

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

@media (max-width: 768px) {
  .grid-3, .grid-2 {
    grid-template-columns: 1fr;
  }
}

/* --- Case Study Card --- */
.case-study-card {
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  transition: border-color 0.3s ease, transform 0.3s ease;
}
.case-study-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
}

.case-study-card-img {
  width: 100%;
  height: 200px;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* --- Breadcrumb (for inner pages) --- */
.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { margin: 0 8px; }
