/* ============================================================
   CardGen Landing Page — Full Styles
   Dark theme, responsive, CSS-only visuals, scroll animations
   ============================================================ */

/* === RESET & VARIABLES === */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0d1117;
  --bg-alt: #161b22;
  --bg-card: #1c2128;
  --bg-card-hover: #21262d;
  --border: #30363d;
  --text: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #6e7681;
  --accent: #4f8ff7;
  --accent-hover: #3a7ce0;
  --accent-glow: rgba(79, 143, 247, 0.15);
  --secondary: #e94560;
  --secondary-hover: #d63851;
  --gradient-primary: linear-gradient(135deg, #4f8ff7, #6366f1);
  --gradient-accent: linear-gradient(135deg, #4f8ff7, #e94560);
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.4);
  --transition: 0.3s ease;
  --max-width: 1200px;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, system-ui, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

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

/* === ANIMATIONS === */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.animate-on-scroll:nth-child(2) { transition-delay: 0.1s; }
.animate-on-scroll:nth-child(3) { transition-delay: 0.2s; }
.animate-on-scroll:nth-child(4) { transition-delay: 0.3s; }
.animate-on-scroll:nth-child(5) { transition-delay: 0.4s; }
.animate-on-scroll:nth-child(6) { transition-delay: 0.5s; }

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  line-height: 1.4;
}

.btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 4px 16px rgba(79, 143, 247, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(79, 143, 247, 0.45);
}

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

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

.btn-outline:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  border-color: var(--border);
  color: var(--text-muted);
}

.btn-outline:disabled:hover {
  transform: none;
  border-color: var(--border);
  color: var(--text-muted);
}

.btn-lg {
  font-size: 18px;
  padding: 16px 40px;
  border-radius: 14px;
}

.btn-block {
  width: 100%;
  justify-content: center;
}

.btn-nav {
  padding: 10px 22px;
  font-size: 14px;
}

.btn-arrow {
  transition: transform var(--transition);
}

.btn:hover .btn-arrow {
  transform: translateX(4px);
}

/* === HEADER === */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(48, 54, 61, 0.5);
  transition: background var(--transition);
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  padding-bottom: 16px;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
}

.logo-icon {
  font-size: 24px;
  color: var(--accent);
  line-height: 1;
}

.logo-text {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

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

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: color var(--transition);
  position: relative;
}

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

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width var(--transition);
  border-radius: 1px;
}

.nav-link:hover::after {
  width: 100%;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 110;
}

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

.hamburger.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.hamburger.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--bg-alt);
    flex-direction: column;
    padding: 80px 32px 32px;
    gap: 24px;
    transition: right 0.4s ease;
    border-left: 1px solid var(--border);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.5);
    align-items: stretch;
  }

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

  .nav-link {
    font-size: 18px;
    padding: 8px 0;
  }

  .nav-link::after {
    display: none;
  }

  .btn-nav {
    text-align: center;
    justify-content: center;
    margin-top: 16px;
  }
}

/* === HERO === */
.hero {
  position: relative;
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 0 100px;
  overflow: hidden;
}

.hero-inner {
  position: relative;
  z-index: 2;
}

.hero-badge {
  display: inline-block;
  padding: 8px 20px;
  background: var(--accent-glow);
  border: 1px solid rgba(79, 143, 247, 0.25);
  border-radius: 100px;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 32px;
  letter-spacing: 0.02em;
}

.hero-title {
  font-size: 52px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1.5px;
  margin-bottom: 24px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 36px;
    letter-spacing: -1px;
  }
}

@media (min-width: 768px) {
  .hero-title {
    font-size: 72px;
    letter-spacing: -2px;
  }
}

.gradient-text {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

@media (min-width: 768px) {
  .hero-subtitle {
    font-size: 20px;
  }
}

.hero-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-bottom: 72px;
}

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

/* Hero glow effect */
.hero-glow {
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 500px;
  background: radial-gradient(ellipse, rgba(79, 143, 247, 0.12) 0%, rgba(233, 69, 96, 0.06) 40%, transparent 70%);
  pointer-events: none;
  z-index: 1;
}

/* Hero animated cards */
.hero-cards {
  display: flex;
  justify-content: center;
  gap: 24px;
  perspective: 1000px;
}

.hero-card {
  width: 180px;
  height: 240px;
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-lg);
  animation: cardFloat 6s ease-in-out infinite;
  transition: transform 0.4s ease;
}

.hero-card:hover {
  transform: scale(1.05) rotateY(5deg) !important;
}

.hero-card-1 {
  background: linear-gradient(145deg, #1a1a2e, #16213e);
  border: 1px solid rgba(79, 143, 247, 0.2);
  animation-delay: 0s;
  transform: rotate(-5deg) translateY(10px);
}

.hero-card-2 {
  background: linear-gradient(145deg, #4f8ff7, #6366f1);
  animation-delay: -2s;
  transform: rotate(0deg) translateY(-10px);
  z-index: 2;
}

.hero-card-3 {
  background: linear-gradient(145deg, #e94560, #c62a71);
  animation-delay: -4s;
  transform: rotate(5deg) translateY(10px);
}

@keyframes cardFloat {
  0%, 100% { transform: translateY(0) rotate(var(--rot, 0deg)); }
  50% { transform: translateY(-15px) rotate(var(--rot, 0deg)); }
}

.hero-card-1 { --rot: -5deg; }
.hero-card-2 { --rot: 0deg; }
.hero-card-3 { --rot: 5deg; }

.hero-card-header {
  width: 100%;
  height: 60px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
}

.hero-card-line {
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.15);
}

.w80 { width: 80%; }
.w70 { width: 70%; }
.w60 { width: 60%; }
.w50 { width: 50%; }
.w45 { width: 45%; }
.w40 { width: 40%; }
.w90 { width: 90%; }

@media (max-width: 600px) {
  .hero-cards {
    gap: 12px;
  }

  .hero-card {
    width: 120px;
    height: 160px;
    padding: 14px;
    gap: 8px;
    border-radius: var(--radius);
  }

  .hero-card-header {
    height: 40px;
  }

  .hero-card-line {
    height: 6px;
  }
}

/* === SECTION COMMON === */
section {
  padding: 100px 0;
}

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

.section-title {
  font-size: 36px;
  font-weight: 800;
  text-align: center;
  letter-spacing: -1px;
  margin-bottom: 12px;
}

@media (min-width: 768px) {
  .section-title {
    font-size: 48px;
    letter-spacing: -1.5px;
  }
}

.section-subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 56px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* === FEATURES === */
.features {
  background: var(--bg);
}

.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 640px) {
  .features-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity var(--transition);
}

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

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

.feature-icon {
  font-size: 40px;
  margin-bottom: 20px;
  display: block;
  line-height: 1;
}

.feature-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.3px;
}

.feature-desc {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* === GALLERY === */
.gallery {
  background: var(--bg-alt);
}

.gallery-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 640px) {
  .gallery-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 960px) {
  .gallery-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.gallery-card {
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: default;
}

.gallery-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: var(--shadow-lg);
}

.gallery-card-badge {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 6px 14px;
  border-radius: 100px;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
  display: inline-block;
  align-self: flex-start;
  margin-bottom: 24px;
}

.gallery-card-mock {
  margin-top: auto;
}

.gallery-mock-title {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 12px;
}

.gallery-mock-line {
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.2);
  margin-bottom: 8px;
  width: 80%;
}

.gallery-mock-line.short {
  width: 50%;
}

/* Gallery card themes */
.gallery-dark-premium {
  background: linear-gradient(145deg, #0f0f23, #1a1a3e);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #c8cee0;
}

.gallery-dark-premium .gallery-card-badge {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
}

.gallery-light-clean {
  background: linear-gradient(145deg, #f0f4f8, #e2e8f0);
  color: #1a202c;
}

.gallery-light-clean .gallery-card-badge {
  background: rgba(0, 0, 0, 0.08);
  color: #4a5568;
}

.gallery-light-clean .gallery-mock-line {
  background: rgba(0, 0, 0, 0.12);
}

.gallery-gradient-bold {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
}

.gallery-gradient-bold .gallery-card-badge {
  background: rgba(255, 255, 255, 0.2);
}

.gallery-coral-pop {
  background: linear-gradient(145deg, #ff6b6b, #ee5a24);
  color: #fff;
}

.gallery-coral-pop .gallery-card-badge {
  background: rgba(255, 255, 255, 0.2);
}

.gallery-neon-night {
  background: linear-gradient(145deg, #0a0a0a, #1a0533);
  border: 1px solid rgba(0, 255, 136, 0.3);
  color: #00ff88;
}

.gallery-neon-night .gallery-card-badge {
  background: rgba(0, 255, 136, 0.15);
  color: #00ff88;
}

.gallery-neon-night .gallery-mock-line {
  background: rgba(0, 255, 136, 0.2);
}

.gallery-cherry-blossom {
  background: linear-gradient(145deg, #ffeef8, #fdd6e8);
  color: #8b2252;
}

.gallery-cherry-blossom .gallery-card-badge {
  background: rgba(139, 34, 82, 0.1);
  color: #8b2252;
}

.gallery-cherry-blossom .gallery-mock-line {
  background: rgba(139, 34, 82, 0.15);
}

/* === HOW IT WORKS === */
.how-it-works {
  background: var(--bg);
}

.steps {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  max-width: 600px;
  margin: 0 auto;
}

.step {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  padding: 32px 0;
  width: 100%;
}

.step-number {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 4px 16px rgba(79, 143, 247, 0.3);
}

.step-content {
  flex: 1;
  padding-top: 4px;
}

.step-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}

.step-desc {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.step-connector {
  width: 2px;
  height: 40px;
  background: linear-gradient(to bottom, var(--accent), rgba(79, 143, 247, 0.2));
  margin-left: 27px;
  border-radius: 1px;
}

/* === PRICING === */
.pricing {
  background: var(--bg-alt);
}

.pricing-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  max-width: 800px;
  margin: 0 auto;
}

@media (min-width: 640px) {
  .pricing-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all var(--transition);
}

.pricing-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.pricing-card-pro {
  border-color: var(--accent);
  background: linear-gradient(165deg, var(--bg-card) 0%, rgba(79, 143, 247, 0.05) 100%);
  box-shadow: 0 0 40px rgba(79, 143, 247, 0.1);
}

.pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gradient-primary);
  color: #fff;
  padding: 6px 20px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.pricing-header {
  margin-bottom: 32px;
}

.pricing-plan {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.pricing-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.pricing-amount {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--text);
}

.pricing-period {
  font-size: 16px;
  color: var(--text-muted);
}

.pricing-features {
  list-style: none;
  margin-bottom: 32px;
  flex: 1;
}

.pricing-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  font-size: 15px;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(48, 54, 61, 0.4);
}

.pricing-feature:last-child {
  border-bottom: none;
}

.pricing-feature.muted {
  color: var(--text-muted);
}

.check {
  color: #3fb950;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}

.cross {
  color: var(--text-muted);
  font-size: 16px;
  flex-shrink: 0;
}

/* === FAQ === */
.faq {
  background: var(--bg);
}

.faq-list {
  max-width: 720px;
  margin: 0 auto;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color var(--transition);
}

.faq-item:hover {
  border-color: rgba(79, 143, 247, 0.3);
}

.faq-item.active {
  border-color: var(--accent);
}

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 20px 24px;
  background: var(--bg-card);
  border: none;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  gap: 16px;
  transition: background var(--transition);
  font-family: inherit;
}

.faq-question:hover {
  background: var(--bg-card-hover);
}

.faq-icon {
  font-size: 24px;
  font-weight: 300;
  color: var(--accent);
  transition: transform var(--transition);
  flex-shrink: 0;
  line-height: 1;
}

.faq-item.active .faq-icon {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
  background: var(--bg-card);
}

.faq-item.active .faq-answer {
  max-height: 300px;
}

.faq-answer p {
  padding: 0 24px 20px;
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* === FOOTER === */
.footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 64px 0 32px;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

@media (min-width: 768px) {
  .footer-inner {
    grid-template-columns: 2fr 3fr;
  }
}

.footer-brand {
  max-width: 300px;
}

.footer-desc {
  margin-top: 16px;
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
}

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

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

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-col-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 15px;
  transition: color var(--transition);
}

.footer-link:hover {
  color: var(--accent);
}

.footer-bottom {
  padding-top: 32px;
  border-top: 1px solid var(--border);
  text-align: center;
}

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

/* === OVERLAY for mobile menu === */
.nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
}

.nav-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* === SCROLLBAR CUSTOM === */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* === SELECTION === */
::selection {
  background: rgba(79, 143, 247, 0.3);
  color: var(--text);
}

/* === FOCUS VISIBLE for keyboard navigation === */
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* === PRINT === */
@media print {
  .header, .hero-glow, .hero-cards {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }
}
