/* ========== Design Tokens ========== */
:root {
  --color-surface: #121212;
  --color-surface-variant: #1e1e1e;
  --color-surface-container: #2b2b2b;
  --color-primary: #D0BCFF;
  --color-primary-dim: #9a82db;
  --color-on-surface: #E6E1E5;
  --color-on-surface-muted: #CAC4D0;
  --color-outline: #49454F;
  --max-width: 960px;
  --font: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--color-surface);
  color: var(--color-on-surface);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.3; margin-bottom: 0.5em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }
p { margin-bottom: 1em; }
ul, ol { margin-bottom: 1em; padding-left: 1.5em; }

/* ========== Layout ========== */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1rem; width: 100%; }

main { flex: 1; padding: 2rem 1rem; }
main.container { padding: 2rem 1rem; }

/* ========== Header ========== */
header {
  background: var(--color-surface-variant);
  border-bottom: 1px solid var(--color-outline);
  position: sticky;
  top: 0;
  z-index: 100;
}

header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: 0.1em;
}
.logo:hover { text-decoration: none; }

nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  padding: 0;
  margin: 0;
}

nav a {
  color: var(--color-on-surface-muted);
  font-size: 0.9rem;
  transition: color 0.2s;
}
nav a:hover, nav a.active {
  color: var(--color-primary);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--color-on-surface);
  font-size: 1.5rem;
  cursor: pointer;
}

/* ========== Hero ========== */
.hero {
  text-align: center;
  padding: 4rem 1rem;
}
.hero h1 { font-size: 2.5rem; margin-bottom: 0.3em; }
.hero .tagline {
  font-size: 1.15rem;
  color: var(--color-on-surface-muted);
  margin-bottom: 2rem;
}

/* ========== Feature Grid ========== */
.features {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin: 2rem 0;
}

.feature-card {
  background: var(--color-surface-variant);
  border: 1px solid var(--color-outline);
  border-radius: 12px;
  padding: 1.5rem;
}
.feature-card h3 { color: var(--color-primary); }

/* ========== Homepage ========== */

/* -- Homepage tokens -- */
:root {
  --color-primary-a10: rgba(208, 188, 255, 0.08);
  --color-primary-a15: rgba(208, 188, 255, 0.15);
  --color-primary-a25: rgba(208, 188, 255, 0.25);
  --gradient-primary: linear-gradient(135deg, #D0BCFF 0%, #9a82db 50%, #7B68AE 100%);
  --gradient-glow: radial-gradient(ellipse at 65% 20%, rgba(208, 188, 255, 0.07) 0%, transparent 55%);
  --radius-lg: 20px;
  --radius-xl: 28px;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --font-display: 'Outfit', var(--font);
}

/* -- Animations -- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 4px 24px rgba(208, 188, 255, 0.25); }
  50% { box-shadow: 0 4px 40px rgba(208, 188, 255, 0.45); }
}

@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

/* -- Homepage main override -- */
main.home-main {
  padding: 0;
}

/* -- Shared section styles -- */
.hp-section {
  padding: 6rem 1rem;
  position: relative;
}

.hp-section__title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 700;
  text-align: center;
  letter-spacing: -0.02em;
  margin-bottom: 0.4em;
}

.hp-section__subtitle {
  text-align: center;
  color: var(--color-on-surface-muted);
  max-width: 540px;
  margin: 0 auto 3.5rem;
  font-size: 1.05rem;
  line-height: 1.7;
}

/* ---- Section 1: Hero ---- */
.hero-home {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  padding: 3rem 1rem 4rem;
  background:
    var(--gradient-glow),
    radial-gradient(circle at 20% 80%, rgba(154, 130, 219, 0.04) 0%, transparent 40%),
    var(--color-surface);
  overflow: hidden;
  position: relative;
}

/* Decorative grid lines in background */
.hero-home::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(208, 188, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(208, 188, 255, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at 60% 40%, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 60% 40%, black 20%, transparent 70%);
  pointer-events: none;
}

.hero-home .container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-home__content {
  animation: fadeUp 0.8s var(--ease-out-expo) both;
}

.hero-home__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.4em 1.1em;
  border-radius: 999px;
  border: 1px solid rgba(208, 188, 255, 0.2);
  background: var(--color-primary-a10);
  color: var(--color-primary);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  animation: fadeUp 0.8s var(--ease-out-expo) 0.1s both;
}

.hero-home__badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-primary);
  animation: pulseGlow 2s ease-in-out infinite;
  box-shadow: 0 0 8px rgba(208, 188, 255, 0.6);
}

.hero-home h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 0.4em;
  animation: fadeUp 0.8s var(--ease-out-expo) 0.15s both;
}

.hero-home h1 .text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-home__subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--color-on-surface-muted);
  line-height: 1.7;
  max-width: 480px;
  margin-bottom: 2rem;
  animation: fadeUp 0.8s var(--ease-out-expo) 0.25s both;
}

.hero-home__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  animation: fadeUp 0.8s var(--ease-out-expo) 0.35s both;
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.85em 2em;
  background: var(--gradient-primary);
  color: #1a1625;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.3s var(--ease-out-expo), box-shadow 0.3s var(--ease-out-expo);
  box-shadow: 0 4px 24px rgba(208, 188, 255, 0.25);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 36px rgba(208, 188, 255, 0.4);
  text-decoration: none;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.85em 2em;
  background: transparent;
  color: var(--color-on-surface);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid var(--color-outline);
  border-radius: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.3s, color 0.3s, transform 0.3s var(--ease-out-expo);
}
.btn-secondary:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-2px);
  text-decoration: none;
}

/* Phone mockup */
.hero-home__mockup {
  display: flex;
  justify-content: center;
  animation: fadeUp 0.9s var(--ease-out-expo) 0.4s both;
}

.phone-frame {
  position: relative;
  width: 260px;
  height: 520px;
  border-radius: 36px;
  background: var(--color-surface-container);
  border: 2px solid var(--color-outline);
  overflow: hidden;
  animation: float 6s ease-in-out infinite;
  box-shadow:
    0 0 80px rgba(208, 188, 255, 0.12),
    0 0 160px rgba(208, 188, 255, 0.06),
    0 20px 60px rgba(0, 0, 0, 0.4);
}


.phone-frame img,
.screenshot-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

/* ---- Section 2: Features ---- */
.section-features {
  background:
    linear-gradient(180deg, var(--color-surface) 0%, var(--color-surface-variant) 50%, var(--color-surface) 100%);
  position: relative;
}

/* Diagonal top edge */
.section-features::before {
  content: '';
  position: absolute;
  top: -40px;
  left: 0;
  right: 0;
  height: 80px;
  background: inherit;
  clip-path: polygon(0 50%, 100% 0, 100% 100%, 0 100%);
}

.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.feature-card-v2 {
  background: rgba(30, 30, 30, 0.5);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--color-outline);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem;
  transition:
    transform 0.4s var(--ease-out-expo),
    border-color 0.4s,
    box-shadow 0.4s;
  position: relative;
  overflow: hidden;
}

.feature-card-v2:hover {
  transform: translateY(-6px);
  border-color: rgba(208, 188, 255, 0.3);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3), 0 0 40px var(--color-primary-a10);
}

/* Subtle gradient border glow on hover */
.feature-card-v2::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity 0.4s;
}
.feature-card-v2:hover::before {
  opacity: 1;
}

.feature-card-v2__icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--color-primary-a10);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 1.25rem;
  transition: background 0.3s;
}
.feature-card-v2:hover .feature-card-v2__icon {
  background: var(--color-primary-a15);
}

.feature-card-v2 h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-on-surface);
  margin-bottom: 0.5em;
}

.feature-card-v2 p {
  color: var(--color-on-surface-muted);
  font-size: 0.95rem;
  line-height: 1.65;
  margin-bottom: 0;
}

/* ---- Section 3: Screenshots ---- */
.section-screenshots {
  background: var(--color-surface);
  overflow: hidden;
}

.screenshots-row {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 2rem;
  padding: 0 1rem;
}

.screenshot-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

.screenshot-label {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-on-surface-muted);
  margin-bottom: 0.75rem;
  letter-spacing: 0.02em;
}

.screenshot-card {
  width: 220px;
  height: 440px;
  border-radius: 28px;
  background: var(--color-surface-container);
  border: 1px solid var(--color-outline);
  transition: transform 0.5s var(--ease-out-expo), box-shadow 0.5s;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  position: relative;
  overflow: hidden;
}


.screenshot-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

.screenshot-card--featured {
  transform: scale(1.08);
  border-color: rgba(208, 188, 255, 0.25);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.3),
    0 0 60px var(--color-primary-a10);
}
.screenshot-card--featured:hover {
  transform: scale(1.08) translateY(-8px);
}


/* ---- Section 4: Stats ---- */
.section-stats {
  background: var(--color-surface-variant);
  position: relative;
}

/* Diagonal top edge */
.section-stats::before {
  content: '';
  position: absolute;
  top: -40px;
  left: 0;
  right: 0;
  height: 80px;
  background: var(--color-surface-variant);
  clip-path: polygon(0 0, 100% 50%, 100% 100%, 0 100%);
}

.stats-grid {
  display: flex;
  justify-content: center;
  gap: 4rem;
  flex-wrap: wrap;
  max-width: var(--max-width);
  margin: 0 auto;
}

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

.stat-number {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
}

.stat-label {
  display: block;
  margin-top: 0.4em;
  font-size: 0.9rem;
  color: var(--color-on-surface-muted);
  font-weight: 500;
}

/* Divider between stats */
.stat-item + .stat-item {
  position: relative;
}
.stat-item + .stat-item::before {
  content: '';
  position: absolute;
  left: -2rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, transparent, var(--color-outline), transparent);
}

/* ---- Section 5: CTA ---- */
.section-cta {
  background:
    radial-gradient(ellipse at center, rgba(208, 188, 255, 0.06) 0%, transparent 60%),
    var(--color-surface);
  text-align: center;
  position: relative;
}

.section-cta h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.4em;
}

.section-cta p {
  color: var(--color-on-surface-muted);
  font-size: 1.1rem;
  max-width: 480px;
  margin: 0 auto 2rem;
  line-height: 1.7;
}

.btn-primary--lg {
  padding: 1em 2.8em;
  font-size: 1.05rem;
  border-radius: 16px;
  animation: pulseGlow 3s ease-in-out infinite;
}

.cta-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

/* ---- Scroll reveal (JS-driven) ---- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-out-expo), transform 0.7s var(--ease-out-expo);
}
.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.reveal-stagger > .reveal:nth-child(1) { transition-delay: 0s; }
.reveal-stagger > .reveal:nth-child(2) { transition-delay: 0.1s; }
.reveal-stagger > .reveal:nth-child(3) { transition-delay: 0.2s; }
.reveal-stagger > .reveal:nth-child(4) { transition-delay: 0.3s; }

/* ---- Homepage responsive ---- */
@media (min-width: 769px) {
  .hero-home .container {
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
  }

  .features-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .hero-home {
    min-height: auto;
    padding: 3rem 1rem;
    text-align: center;
  }

  .hero-home__subtitle {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-home__cta {
    justify-content: center;
  }

  .phone-frame {
    width: 220px;
    height: 440px;
    animation: float 6s ease-in-out infinite;
  }

  .screenshots-row {
    justify-content: flex-start;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 0 1rem 1.5rem;
    gap: 1rem;
  }

  .screenshot-item {
    scroll-snap-align: center;
  }

  .screenshot-card {
    width: 200px;
    height: 400px;
  }

  .screenshot-card--featured {
    transform: scale(1.04);
  }
  .screenshot-card--featured:hover {
    transform: scale(1.04) translateY(-4px);
  }

  .stats-grid {
    gap: 2.5rem;
  }

  .stat-item + .stat-item::before {
    display: none;
  }

  .hp-section {
    padding: 4rem 1rem;
  }
}

/* ========== Legal Pages ========== */
.legal h1 { margin-bottom: 0.25em; }
.legal .last-updated {
  color: var(--color-on-surface-muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}
.legal h2 { margin-top: 2rem; }
.legal p, .legal li { color: var(--color-on-surface-muted); }

/* ========== Contact ========== */
.contact-info {
  background: var(--color-surface-variant);
  border: 1px solid var(--color-outline);
  border-radius: 12px;
  padding: 2rem;
  margin: 1.5rem 0;
}
.contact-info p { margin-bottom: 0.5em; }

/* ========== Footer ========== */
footer {
  background: var(--color-surface-variant);
  border-top: 1px solid var(--color-outline);
  padding: 2rem 0;
  margin-top: auto;
}

footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

footer p {
  color: var(--color-on-surface-muted);
  font-size: 0.85rem;
  margin: 0;
}

footer ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  padding: 0;
  margin: 0;
}

footer a {
  color: var(--color-on-surface-muted);
  font-size: 0.85rem;
}
footer a:hover { color: var(--color-primary); }

/* ========== Responsive ========== */
@media (max-width: 768px) {
  nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--color-surface-variant);
    border-bottom: 1px solid var(--color-outline);
    padding: 1rem;
  }
  nav.open { display: block; }
  nav ul { flex-direction: column; gap: 0.75rem; }
  .nav-toggle { display: block; }

  .hero h1 { font-size: 1.8rem; }
  .hero .tagline { font-size: 1rem; }

  footer .container { flex-direction: column; text-align: center; }
  footer ul { justify-content: center; }
}

@media (min-width: 769px) {
  .features { grid-template-columns: repeat(3, 1fr); }
}
