/* ═══════════════════════════════════════════════════════════
   WORDLOOM — Landing Page Styles
   Design: Refined calm editorial, matching "Calm Exploration"
   Colors extracted from app_icon (blue-teal) + Nature theme
   ═══════════════════════════════════════════════════════════ */

/* ─── RESET & CUSTOM PROPERTIES ─────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Brand — from app icon gradient */
  --brand-deep: #1a2744;
  --brand-blue: #2d4a7a;
  --brand-teal: #1a6b78;
  --brand-light-teal: #2a9d8f;

  /* Nature theme palette */
  --nature-green: #4A7C59;
  --nature-sage: #7BA38C;
  --nature-gold: #C9A96E;
  --nature-cream: #F5F1EB;
  --nature-text: #2C3E2D;

  /* Neutrals */
  --white: #FFFFFF;
  --off-white: #FAFAF8;
  --gray-100: #F3F2EF;
  --gray-200: #E5E3DE;
  --gray-300: #C4C1BA;
  --gray-500: #8A8680;
  --gray-700: #4A4744;
  --gray-900: #1C1B19;

  /* Typography */
  --font-display: 'Cormorant Garamond', serif;
  --font-body: 'DM Sans', sans-serif;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;
  --space-3xl: 10rem;

  /* Layout */
  --max-width: 1120px;
  --radius: 16px;
  --radius-sm: 8px;
}

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

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--gray-700);
  background: var(--off-white);
  overflow-x: hidden;
}

a {
  color: var(--nature-green);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover { color: var(--brand-teal); }

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

/* ─── TYPOGRAPHY ────────────────────────────────────────── */
h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--gray-900);
  line-height: 1.15;
  font-weight: 600;
}

h1 { font-size: clamp(2.8rem, 6vw, 4.5rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -0.01em; }
h3 { font-size: 1.4rem; }

p { max-width: 62ch; }

.section-label {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--nature-green);
  margin-bottom: var(--space-sm);
}

/* ─── LAYOUT ────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

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

/* ─── NAVIGATION ────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: var(--space-sm) 0;
  transition: all 0.3s ease;
  background: transparent;
}

.nav.scrolled {
  background: rgba(250, 250, 248, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--gray-200);
}

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

.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  text-decoration: none;
}

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

.nav-brand span {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--gray-900);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  list-style: none;
}

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray-500);
  transition: color 0.2s ease;
}

.nav-links a:hover { color: var(--gray-900); }

/* Nav Button */
.btn-nav {
  padding: 0.6rem 1.25rem !important;
  font-size: 0.85rem !important;
  background: var(--brand-deep) !important;
  color: var(--white) !important;
  box-shadow: 0 2px 12px rgba(26, 39, 68, 0.25) !important;
  border-radius: 8px;
}

.btn-nav:hover {
  background: var(--brand-blue) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(26, 39, 68, 0.35) !important;
}

/* ─── MOBILE HAMBURGER ──────────────────────────────────── */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 110;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--gray-900);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ─── HERO ──────────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  padding-top: var(--space-3xl);
  padding-bottom: var(--space-2xl);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -20%;
  width: 70%;
  height: 100%;
  background: radial-gradient(
    ellipse at center,
    rgba(42, 157, 143, 0.06) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -20%;
  left: -10%;
  width: 50%;
  height: 60%;
  background: radial-gradient(
    ellipse at center,
    rgba(74, 124, 89, 0.05) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.hero .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: center;
}

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

.hero-content h1 {
  margin-bottom: var(--space-md);
}

.hero-content h1 em {
  font-style: italic;
  color: var(--nature-green);
}

.hero-tagline {
  font-size: 1.15rem;
  color: var(--gray-500);
  margin-bottom: var(--space-lg);
  line-height: 1.8;
}

.hero-cta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

/* ─── STORE BADGES ──────────────────────────────────────── */
.store-badges {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.store-badge {
  display: inline-flex;
  align-items: center;
  transition: transform 0.3s ease, opacity 0.2s ease;
  border-radius: 8px;
  overflow: hidden;
}

.store-badge:hover {
  transform: translateY(-3px);
  opacity: 0.85;
}

.store-badge img {
  display: block;
  object-fit: contain;
}

.store-badges-cta {
  justify-content: center;
  margin-top: var(--space-md);
}

/* ─── BUTTONS ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  border-radius: 50px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--nature-green);
  color: var(--white);
  box-shadow: 0 4px 20px rgba(74, 124, 89, 0.3);
}

.btn-primary:hover {
  background: #3d6a4b;
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(74, 124, 89, 0.4);
}

.btn-ghost {
  background: transparent;
  color: var(--gray-700);
  border: 1.5px solid var(--gray-200);
}

.btn-ghost:hover {
  background: var(--gray-100);
  color: var(--gray-900);
  border-color: var(--gray-300);
}

.hero-visual {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-phone {
  width: 320px;
  border-radius: 32px;
  box-shadow:
    0 30px 80px rgba(26, 39, 68, 0.12),
    0 10px 30px rgba(26, 39, 68, 0.08);
  animation: float 6s ease-in-out infinite;
}

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

/* ─── FEATURES ──────────────────────────────────────────── */
.features {
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  border-bottom: 1px solid var(--gray-200);
}

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

.features-header p {
  margin: var(--space-sm) auto 0;
  color: var(--gray-500);
  font-size: 1.1rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

.feature-card {
  padding: var(--space-lg);
  border-radius: var(--radius);
  background: var(--off-white);
  border: 1px solid var(--gray-200);
  transition: all 0.3s ease;
}

.feature-card:hover {
  border-color: var(--nature-sage);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(74, 124, 89, 0.08);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: var(--space-sm);
  background: linear-gradient(135deg, var(--nature-green), var(--brand-teal));
  color: var(--white);
}

.feature-card h3 {
  margin-bottom: var(--space-xs);
}

.feature-card p {
  font-size: 0.95rem;
  color: var(--gray-500);
  line-height: 1.7;
}

/* ─── HOW IT WORKS ──────────────────────────────────────── */
.how-it-works {
  padding: var(--space-2xl) 0;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  counter-reset: step;
}

.step-card {
  text-align: center;
  padding: var(--space-lg);
  position: relative;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--nature-green), var(--brand-teal));
  color: var(--white);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--space-md);
  box-shadow: 0 8px 24px rgba(74, 124, 89, 0.2);
}

.step-card h3 {
  margin-bottom: var(--space-xs);
}

.step-card p {
  font-size: 0.95rem;
  color: var(--gray-500);
  line-height: 1.7;
  margin: 0 auto;
}

/* ─── PUZZLE TYPES ──────────────────────────────────────── */
.puzzle-types {
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  border-bottom: 1px solid var(--gray-200);
}

/* ─── CTA SECTION ───────────────────────────────────────── */
.cta-section {
  text-align: center;
  background: linear-gradient(
    160deg,
    var(--brand-deep) 0%,
    var(--brand-blue) 40%,
    var(--brand-teal) 100%
  );
  color: var(--white);
  padding: var(--space-3xl) 0;
  position: relative;
  overflow: hidden;
}

.cta-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(42, 157, 143, 0.2) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 50%, rgba(199, 169, 110, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

.cta-section h2 {
  color: var(--white);
  margin-bottom: var(--space-sm);
  position: relative;
}

.cta-section p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.1rem;
  margin: 0 auto var(--space-sm);
}

.cta-section .section-label {
  position: relative;
}

/* ─── FOOTER ────────────────────────────────────────────── */
.footer {
  padding: var(--space-xl) 0 var(--space-lg);
  border-top: 1px solid var(--gray-200);
}

.footer-top {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-xs);
  margin-bottom: var(--space-lg);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.footer-brand img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

.footer-brand span {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gray-900);
}

.footer-desc {
  font-size: 0.9rem;
  color: var(--gray-500);
  max-width: 40ch;
}

.footer-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--gray-200);
}

.footer-col h4 {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray-900);
  margin-bottom: var(--space-sm);
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: var(--space-xs);
}

.footer-col a {
  font-size: 0.9rem;
  color: var(--gray-500);
}

.footer-col a:hover { color: var(--gray-900); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-md);
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--gray-500);
}

.footer-platforms {
  font-size: 0.8rem;
  color: var(--gray-500);
}

.footer-platforms a {
  color: var(--gray-500);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-platforms a:hover {
  color: var(--gray-900);
}

/* ─── LEGAL PAGES ───────────────────────────────────────── */
.legal-page {
  padding-top: calc(80px + var(--space-xl));
}

.legal-page .container {
  max-width: 760px;
}

.legal-page h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: var(--space-xs);
}

.legal-meta {
  font-size: 0.9rem;
  color: var(--gray-500);
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--gray-200);
}

.legal-content h2 {
  font-size: 1.5rem;
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
}

.legal-content h3 {
  font-size: 1.15rem;
  margin-top: var(--space-md);
  margin-bottom: var(--space-xs);
}

.legal-content p {
  margin-bottom: var(--space-sm);
  color: var(--gray-700);
}

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

.legal-content li {
  margin-bottom: var(--space-xs);
}

.legal-content a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ─── ANIMATE ON SCROLL ─────────────────────────────────── */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* Stagger feature cards */
.feature-card:nth-child(2) { transition-delay: 0.1s; }
.feature-card:nth-child(3) { transition-delay: 0.2s; }
.feature-card:nth-child(4) { transition-delay: 0.05s; }
.feature-card:nth-child(5) { transition-delay: 0.15s; }
.feature-card:nth-child(6) { transition-delay: 0.25s; }

/* Stagger step cards */
.step-card:nth-child(2) { transition-delay: 0.15s; }
.step-card:nth-child(3) { transition-delay: 0.3s; }

/* ─── RESPONSIVE ────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(250, 250, 248, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-lg);
    z-index: 105;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    font-size: 1.2rem;
  }

  .hero .container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-content { order: 1; }
  .hero-visual { order: 0; }

  .hero-phone { width: 240px; }

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

  .store-badges { justify-content: center; }

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

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

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

  .footer-top {
    align-items: center;
    text-align: center;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: var(--space-xs);
  }
}
