/* ============================
   AdVidGen Landing Page
   Dark theme based on yt-downloader-app
   ============================ */

/* --- Design Tokens --- */
:root {
  --bg-body: #0f0f0f;
  --bg-panel: #161616;
  --bg-card: #1a1a1a;
  --bg-input: #111;
  --border: #2a2a2a;
  --border-hover: #3a3a3a;
  --accent: #ff4444;
  --accent-hover: #e03030;
  --accent-glow: rgba(255, 68, 68, 0.15);
  --accent-glow-strong: rgba(255, 68, 68, 0.35);
  --text-primary: #e8e8e8;
  --text-secondary: #ccc;
  --text-tertiary: #888;
  --text-dim: #555;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "Consolas", "Monaco", "Courier New", monospace;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --transition-fast: 0.15s ease;
  --transition-normal: 0.2s ease;
  --transition-slow: 0.3s ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg-body);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

img, svg {
  max-width: 100%;
  display: block;
}

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

/* --- Section Common --- */
.section {
  padding: 100px 0;
}

.section-title {
  font-size: 36px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.section-subtitle {
  font-size: 16px;
  color: var(--text-tertiary);
  text-align: center;
  max-width: 600px;
  margin: 0 auto 60px;
  line-height: 1.7;
}

/* ============================
   Navigation
   ============================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 0 24px;
  transition: background var(--transition-slow), box-shadow var(--transition-slow);
}

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

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

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

.logo-icon {
  width: 28px;
  height: 28px;
  color: var(--accent);
}

.logo span {
  color: var(--accent);
}

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

.nav-links a {
  color: var(--text-tertiary);
  font-size: 14px;
  font-weight: 500;
  transition: color var(--transition-fast);
}

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

.nav-cta {
  background: var(--accent);
  color: #fff !important;
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  transition: background var(--transition-fast), box-shadow var(--transition-fast);
}

.nav-cta:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 16px var(--accent-glow);
}

/* Mobile menu */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 8px;
}

.menu-toggle svg {
  width: 24px;
  height: 24px;
}

.mobile-menu {
  display: none;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  background: rgba(15, 15, 15, 0.96);
  backdrop-filter: blur(12px);
  padding: 16px 24px 24px;
  border-bottom: 1px solid var(--border);
  z-index: 999;
}

.mobile-menu.open {
  display: block;
}

.mobile-menu a {
  display: block;
  padding: 12px 0;
  color: var(--text-secondary);
  font-size: 16px;
  border-bottom: 1px solid var(--border);
}

.mobile-menu a:last-child {
  border-bottom: none;
}

/* ============================
   Hero
   ============================ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  padding-top: 64px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 20%, rgba(255, 68, 68, 0.08) 0%, transparent 60%);
  animation: hero-pulse 5s ease-in-out infinite alternate;
}

@keyframes hero-pulse {
  from { opacity: 0.4; }
  to { opacity: 1; }
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  padding: 0 24px;
}

.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  background: var(--accent-glow);
  border: 1px solid rgba(255, 68, 68, 0.3);
  border-radius: 20px;
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 32px;
}

.hero h1 {
  font-size: 56px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1.5px;
  margin-bottom: 24px;
}

.hero h1 .accent {
  color: var(--accent);
}

.hero-desc {
  font-size: 18px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 40px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

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

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

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

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

.hero-stat {
  text-align: center;
}

.hero-stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
}

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

/* ============================
   Features
   ============================ */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 32px 28px;
  transition: transform var(--transition-normal), border-color var(--transition-fast), box-shadow var(--transition-normal);
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.feature-icon {
  width: 44px;
  height: 44px;
  background: var(--accent-glow);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: var(--accent);
}

.feature-icon svg {
  width: 22px;
  height: 22px;
}

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

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

/* ============================
   Workflow
   ============================ */
.workflow-section {
  background: var(--bg-panel);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.workflow-diagram {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 60px;
  padding: 40px 0;
  overflow-x: auto;
}

.workflow-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 90px;
  flex-shrink: 0;
}

.workflow-node-box {
  width: 72px;
  height: 72px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.workflow-node-box:hover {
  border-color: var(--accent);
  box-shadow: 0 0 16px var(--accent-glow);
}

.workflow-node-box svg {
  width: 28px;
  height: 28px;
}

.workflow-node-label {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 500;
  text-align: center;
}

.workflow-arrow {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin: 0 -4px;
  margin-bottom: 22px;
}

.workflow-arrow svg {
  width: 40px;
  height: 16px;
}

.workflow-arrow .arrow-line {
  stroke: var(--border-hover);
  stroke-width: 2;
  stroke-dasharray: 6 4;
  animation: flow 1.2s linear infinite;
}

.workflow-arrow .arrow-head {
  fill: var(--border-hover);
}

@keyframes flow {
  to { stroke-dashoffset: -20; }
}

/* Preset cards */
.preset-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.preset-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px 20px;
  text-align: center;
  transition: border-color var(--transition-fast), transform var(--transition-normal);
}

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

.preset-card h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
}

.preset-card p {
  font-size: 13px;
  color: var(--text-tertiary);
  line-height: 1.5;
}

.preset-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  margin-top: 12px;
}

.preset-badge-free {
  background: rgba(74, 222, 128, 0.15);
  color: #4ade80;
}

.preset-badge-nodes {
  background: var(--accent-glow);
  color: var(--accent);
}

/* ============================
   Steps
   ============================ */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  position: relative;
}

.steps::before {
  content: '';
  position: absolute;
  top: 40px;
  left: calc(100% / 6);
  right: calc(100% / 6);
  height: 2px;
  background: var(--border);
}

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

.step-number {
  font-size: 48px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}

.step-number::after {
  content: '';
  position: absolute;
  width: 64px;
  height: 64px;
  background: var(--accent-glow);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: -1;
}

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

.step p {
  font-size: 14px;
  color: var(--text-tertiary);
  line-height: 1.7;
  max-width: 280px;
  margin: 0 auto;
}

/* ============================
   Tech Stack
   ============================ */
.tech-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.tech-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  font-family: var(--mono);
  transition: border-color var(--transition-fast), color var(--transition-fast);
}

.tech-pill:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.tech-pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* ============================
   Footer
   ============================ */
.footer {
  background: #0a0a0a;
  border-top: 1px solid var(--border);
  padding: 40px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.footer-left strong {
  color: var(--text-primary);
  font-weight: 600;
}

.footer-right {
  font-size: 13px;
  color: var(--text-dim);
}

/* ============================
   Scroll Reveal Animations
   ============================ */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

[data-reveal].revealed {
  opacity: 1;
  transform: none;
}

/* Staggered children */
[data-reveal-stagger] > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

[data-reveal-stagger].revealed > * {
  opacity: 1;
  transform: none;
}

[data-reveal-stagger].revealed > *:nth-child(1) { transition-delay: 0s; }
[data-reveal-stagger].revealed > *:nth-child(2) { transition-delay: 0.08s; }
[data-reveal-stagger].revealed > *:nth-child(3) { transition-delay: 0.16s; }
[data-reveal-stagger].revealed > *:nth-child(4) { transition-delay: 0.24s; }
[data-reveal-stagger].revealed > *:nth-child(5) { transition-delay: 0.32s; }
[data-reveal-stagger].revealed > *:nth-child(6) { transition-delay: 0.4s; }
[data-reveal-stagger].revealed > *:nth-child(7) { transition-delay: 0.48s; }
[data-reveal-stagger].revealed > *:nth-child(8) { transition-delay: 0.56s; }

/* ============================
   Responsive
   ============================ */
@media (max-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .preset-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero h1 {
    font-size: 44px;
  }

  .hero-stats {
    gap: 32px;
  }
}

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

  .section-title {
    font-size: 28px;
  }

  .nav-links {
    display: none;
  }

  .menu-toggle {
    display: block;
  }

  .hero {
    min-height: auto;
    padding: 120px 0 64px;
  }

  .hero h1 {
    font-size: 32px;
    letter-spacing: -0.5px;
  }

  .hero-desc {
    font-size: 15px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    max-width: 280px;
    justify-content: center;
  }

  .hero-stats {
    flex-direction: column;
    gap: 20px;
  }

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

  .workflow-diagram {
    flex-wrap: wrap;
    gap: 8px;
    padding: 24px 0;
  }

  .workflow-arrow {
    display: none;
  }

  .workflow-node {
    min-width: calc(33% - 8px);
  }

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

  .steps {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .steps::before {
    display: none;
  }

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

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .hero h1 {
    font-size: 28px;
  }
}
