/* ═══════════════════════════════════════════════════════════════════════════
   Astro Vedic Kundali — Cosmic Night Sky Design System
   Colors matched to the Flutter app's CosmicTheme
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Google Fonts ─────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

/* ── CSS Custom Properties ────────────────────────────────────────────────── */
:root {
  /* Core palette — exact match to CosmicTheme */
  --background:             #0C0C1E;
  --cosmic-indigo-start:    #0E0E2C;
  --cosmic-indigo-end:      #1B1442;
  --starlight-gold:         #F6BE34;
  --starlight-white:        #F2F2F2;
  --space-grey:             #BDBDC7;

  /* Semantic */
  --success-green:          #4CAF50;
  --error-red:              #FFB4AB;
  --warning-amber:          #FFB74D;
  --info-blue:              #64B5F6;

  /* Glass tokens */
  --glass-fill:             rgba(255,255,255,0.08);
  --glass-elevated:         rgba(255,255,255,0.13);
  --glass-subtle:           rgba(255,255,255,0.04);
  --border-gold-translucent:rgba(246,190,52,0.20);
  --border-gold-strong:     rgba(246,190,52,0.40);

  /* Extended palette */
  --gold-glow:              rgba(246,190,52,0.15);
  --gold-gradient-start:    #F6BE34;
  --gold-gradient-end:      #E8A317;
  --purple-accent:          #6C63FF;
  --nebula-purple:          #2A1E6E;

  /* Typography */
  --font-primary:           'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Spacing */
  --space-xs:   4px;
  --space-sm:   8px;
  --space-md:   16px;
  --space-lg:   24px;
  --space-xl:   32px;
  --space-2xl:  48px;
  --space-3xl:  64px;
  --space-4xl:  96px;

  /* Borders */
  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  16px;
  --radius-xl:  20px;
  --radius-2xl: 24px;
  --radius-pill: 9999px;

  /* Transitions */
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --transition-fast: 200ms var(--ease-out-quart);
  --transition-normal: 350ms var(--ease-out-quart);
  --transition-slow: 600ms var(--ease-out-quart);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

a:hover {
  color: var(--gold-gradient-end);
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ── Star Canvas (background) ─────────────────────────────────────────────── */
#star-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ── Layout ───────────────────────────────────────────────────────────────── */
.page-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container--narrow {
  max-width: 800px;
}

/* ── Navigation ───────────────────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: var(--space-md) 0;
  transition: background var(--transition-normal), backdrop-filter var(--transition-normal);
}

.nav.scrolled {
  background: rgba(12, 12, 30, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-gold-translucent);
}

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

.nav__brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
  color: var(--starlight-white);
}

.nav__brand:hover {
  text-decoration: none;
  color: var(--starlight-white);
}

.nav__logo {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
}

.nav__title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.nav__title span {
  color: var(--starlight-gold);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  list-style: none;
}

.nav__links a {
  color: var(--space-grey);
  font-size: 14px;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.nav__links a:hover {
  color: var(--starlight-gold);
  text-decoration: none;
}

.nav__cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 8px 20px;
  background: linear-gradient(135deg, var(--gold-gradient-start), var(--gold-gradient-end));
  color: var(--background) !important;
  font-weight: 700;
  font-size: 13px;
  border-radius: var(--radius-pill);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.nav__cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--gold-glow);
  text-decoration: none;
  color: var(--background) !important;
}

/* Mobile menu */
.nav__toggle {
  display: none;
  background: none;
  border: none;
  color: var(--starlight-white);
  font-size: 24px;
  cursor: pointer;
  padding: var(--space-xs);
}

/* ── Hero Section ─────────────────────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 0 var(--space-xl);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--nebula-purple) 0%, transparent 70%);
  opacity: 0.5;
  pointer-events: none;
  animation: nebulaPulse 8s ease-in-out infinite;
}

@keyframes nebulaPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
  50%      { transform: translate(-50%, -50%) scale(1.15); opacity: 0.7; }
}

.hero__content {
  position: relative;
  z-index: 2;
  max-width: 700px;
  margin: 0 auto;
}

.hero__icon {
  width: 100px;
  height: 100px;
  border-radius: var(--radius-xl);
  margin: 0 auto var(--space-lg);
  box-shadow:
    0 0 40px var(--gold-glow),
    0 0 80px rgba(246,190,52,0.08);
  animation: iconFloat 4s ease-in-out infinite;
}

@keyframes iconFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 6px 16px;
  background: var(--glass-fill);
  border: 1px solid var(--border-gold-translucent);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  color: var(--starlight-gold);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: var(--space-lg);
  backdrop-filter: blur(10px);
}

.hero__title {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: var(--space-md);
}

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

.hero__subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--space-grey);
  max-width: 540px;
  margin: 0 auto var(--space-xl);
  line-height: 1.7;
}

.hero__actions {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 14px 28px;
  font-family: var(--font-primary);
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-2px);
  text-decoration: none;
}

.btn--primary {
  background: linear-gradient(135deg, var(--gold-gradient-start), var(--gold-gradient-end));
  color: var(--background);
  box-shadow: 0 4px 24px var(--gold-glow);
}

.btn--primary:hover {
  box-shadow: 0 8px 32px rgba(246,190,52,0.3);
  color: var(--background);
}

.btn--glass {
  background: var(--glass-fill);
  color: var(--starlight-white);
  border: 1px solid var(--border-gold-translucent);
  backdrop-filter: blur(10px);
}

.btn--glass:hover {
  background: var(--glass-elevated);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  color: var(--starlight-white);
}

.btn__icon {
  width: 20px;
  height: 20px;
}

/* Store buttons */
.store-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 12px 24px;
  background: var(--glass-fill);
  border: 1px solid var(--border-gold-translucent);
  border-radius: var(--radius-md);
  color: var(--starlight-white);
  font-size: 14px;
  font-weight: 600;
  transition: all var(--transition-fast);
  backdrop-filter: blur(10px);
  text-decoration: none;
}

.store-btn:hover {
  background: var(--glass-elevated);
  border-color: var(--border-gold-strong);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  text-decoration: none;
  color: var(--starlight-white);
}

.store-btn__label-small {
  font-size: 10px;
  font-weight: 400;
  color: var(--space-grey);
  display: block;
  text-align: left;
}

.store-btn__label-big {
  font-size: 16px;
  font-weight: 700;
  display: block;
  text-align: left;
}

.store-btn svg {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

/* ── Section Commons ──────────────────────────────────────────────────────── */
section {
  padding: var(--space-4xl) 0;
  position: relative;
}

.section-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--starlight-gold);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: var(--space-md);
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: var(--space-md);
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--space-grey);
  max-width: 560px;
  line-height: 1.7;
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.section-header .section-subtitle {
  margin: 0 auto;
}

/* ── Glass Card ───────────────────────────────────────────────────────────── */
.glass-card {
  background: var(--glass-fill);
  border: 1px solid var(--border-gold-translucent);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: all var(--transition-normal);
}

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

.glass-card--elevated {
  background: var(--glass-elevated);
  border-color: var(--border-gold-strong);
  box-shadow: 0 4px 24px var(--gold-glow);
}

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

.feature-card {
  position: relative;
  overflow: hidden;
}

.feature-card__icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--gold-gradient-start), var(--gold-gradient-end));
  border-radius: var(--radius-md);
  font-size: 24px;
  margin-bottom: var(--space-md);
  box-shadow: 0 4px 16px var(--gold-glow);
}

.feature-card__title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: var(--space-sm);
  letter-spacing: -0.01em;
}

.feature-card__desc {
  font-size: 14px;
  color: var(--space-grey);
  line-height: 1.6;
}

/* ── Languages Section ────────────────────────────────────────────────────── */
.languages-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: center;
}

.lang-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 8px 18px;
  background: var(--glass-fill);
  border: 1px solid var(--border-gold-translucent);
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 500;
  color: var(--starlight-white);
  transition: all var(--transition-fast);
  backdrop-filter: blur(8px);
}

.lang-tag:hover {
  background: var(--glass-elevated);
  border-color: var(--starlight-gold);
  color: var(--starlight-gold);
  transform: scale(1.05);
}

/* ── Stats Section ────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
  text-align: center;
}

.stat-item__number {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  background: linear-gradient(135deg, var(--gold-gradient-start), var(--gold-gradient-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.stat-item__label {
  font-size: 14px;
  color: var(--space-grey);
  margin-top: var(--space-xs);
}

/* ── CTA Section ──────────────────────────────────────────────────────────── */
.cta-section {
  text-align: center;
  padding: var(--space-4xl) 0;
}

.cta-card {
  background: linear-gradient(135deg,
    rgba(246,190,52,0.08) 0%,
    rgba(42,30,110,0.4) 50%,
    rgba(246,190,52,0.05) 100%);
  border: 1px solid var(--border-gold-strong);
  border-radius: var(--radius-2xl);
  padding: var(--space-3xl) var(--space-xl);
  position: relative;
  overflow: hidden;
}

.cta-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 70%, var(--gold-glow), transparent 50%);
  animation: ctaGlow 6s ease-in-out infinite;
}

@keyframes ctaGlow {
  0%, 100% { opacity: 0.5; transform: rotate(0deg); }
  50%      { opacity: 1; transform: rotate(180deg); }
}

.cta-card > * {
  position: relative;
  z-index: 1;
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border-gold-translucent);
  padding: var(--space-3xl) 0 var(--space-xl);
  margin-top: auto;
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.footer__brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  text-decoration: none;
  color: var(--starlight-white);
}

.footer__brand:hover {
  text-decoration: none;
  color: var(--starlight-white);
}

.footer__brand-name {
  font-size: 18px;
  font-weight: 700;
}

.footer__desc {
  font-size: 14px;
  color: var(--space-grey);
  line-height: 1.6;
  max-width: 340px;
}

.footer__heading {
  font-size: 13px;
  font-weight: 700;
  color: var(--starlight-gold);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: var(--space-md);
}

.footer__links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.footer__links a {
  font-size: 14px;
  color: var(--space-grey);
  transition: color var(--transition-fast);
}

.footer__links a:hover {
  color: var(--starlight-gold);
  text-decoration: none;
}

.footer__bottom {
  border-top: 1px solid var(--border-gold-translucent);
  padding-top: var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.footer__copy {
  font-size: 13px;
  color: var(--space-grey);
}

.footer__company {
  font-size: 13px;
  color: var(--space-grey);
}

.footer__company a {
  color: var(--starlight-gold);
}

/* ── Legal Pages ──────────────────────────────────────────────────────────── */
.legal-page {
  padding-top: 120px;
  padding-bottom: var(--space-3xl);
}

.legal-page h1 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 800;
  margin-bottom: var(--space-sm);
  letter-spacing: -0.02em;
}

.legal-page .effective-date {
  font-size: 14px;
  color: var(--space-grey);
  margin-bottom: var(--space-2xl);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border-gold-translucent);
}

.legal-page h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--starlight-gold);
  margin-top: var(--space-xl);
  margin-bottom: var(--space-md);
}

.legal-page h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
}

.legal-page p {
  font-size: 15px;
  color: var(--space-grey);
  line-height: 1.8;
  margin-bottom: var(--space-md);
}

.legal-page ul, .legal-page ol {
  padding-left: var(--space-lg);
  margin-bottom: var(--space-md);
}

.legal-page li {
  font-size: 15px;
  color: var(--space-grey);
  line-height: 1.8;
  margin-bottom: var(--space-xs);
}

.legal-page strong {
  color: var(--starlight-white);
  font-weight: 600;
}

.legal-page a {
  color: var(--starlight-gold);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── 404 Page ─────────────────────────────────────────────────────────────── */
.error-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.error-page__code {
  font-size: clamp(6rem, 15vw, 10rem);
  font-weight: 800;
  background: linear-gradient(135deg, var(--gold-gradient-start), var(--gold-gradient-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: var(--space-md);
}

.error-page__title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--space-md);
}

.error-page__desc {
  color: var(--space-grey);
  margin-bottom: var(--space-xl);
}

/* ── Cosmic Divider ───────────────────────────────────────────────────────── */
.cosmic-divider {
  height: 1px;
  margin: var(--space-xl) 0;
  background: linear-gradient(90deg,
    transparent,
    var(--border-gold-translucent),
    transparent);
}

/* ── Scroll Animations ────────────────────────────────────────────────────── */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s var(--ease-out-quart), transform 0.6s var(--ease-out-quart);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* stagger children */
.stagger > .fade-in:nth-child(1) { transition-delay: 0ms; }
.stagger > .fade-in:nth-child(2) { transition-delay: 100ms; }
.stagger > .fade-in:nth-child(3) { transition-delay: 200ms; }
.stagger > .fade-in:nth-child(4) { transition-delay: 300ms; }
.stagger > .fade-in:nth-child(5) { transition-delay: 400ms; }
.stagger > .fade-in:nth-child(6) { transition-delay: 500ms; }
.stagger > .fade-in:nth-child(7) { transition-delay: 600ms; }
.stagger > .fade-in:nth-child(8) { transition-delay: 700ms; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav__links {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(12, 12, 30, 0.97);
    backdrop-filter: blur(20px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-xl);
    z-index: 999;
  }

  .nav__links.open {
    display: flex;
  }

  .nav__links a {
    font-size: 20px;
  }

  .nav__toggle {
    display: block;
    z-index: 1000;
  }

  .hero {
    min-height: auto;
    padding: 100px 0 var(--space-xl);
  }

  .hero__icon {
    width: 80px;
    height: 80px;
  }

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

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

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

  .footer__grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

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

  section {
    padding: var(--space-3xl) 0;
  }
}

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

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

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