/* ==========================================================================
   1. Design System & Base Styles
   ========================================================================== */
:root {
  --primary: #14b8a6; /* A modern, vibrant teal */
  --primary-dark: #0d9488;
  --secondary: #3b82f6; /* A friendly blue */
  --dark-blue: #2c3e50; /* A softer, more modern dark blue */
  --bg-light: #f8fafc;
  --bg-dark: #111827;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --white: #ffffff;
  --border-light: #e5e7eb;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  --font-brand: "Manrope", var(--font-sans);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  font-family: var(--font-sans);
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--white);
  overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
  line-height: 1.2;
  font-weight: 700;
}
a {
  text-decoration: none;
  color: var(--primary);
  transition: var(--transition);
}
a:hover {
  color: var(--primary-dark);
}
img {
  max-width: 100%;
  display: block;
}
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.section {
  padding: 6rem 0;
}
.section-title {
  text-align: center;
  font-size: 2.25rem;
  margin-bottom: 3rem;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  border-radius: 8px;
  font-weight: 600;
  transition: var(--transition);
  border: 1px solid transparent;
  cursor: pointer;
  text-align: center;
}
.btn-primary {
  background-color: var(--primary);
  color: var(--white);
}
.btn-primary:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
  color: var(--white);
}
.btn-secondary {
  background-color: transparent;
  color: var(--text-primary);
  border-color: var(--border-light);
}
.btn-secondary:hover {
  background-color: var(--bg-light);
}
.btn-lg {
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
}
.btn-block {
  width: 100%;
}

/* ==========================================================================
   2. Header & Navigation
   ========================================================================== */
.header {
  background-color: transparent; /* Transparent at top */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 1rem 0;
  transition: background-color 0.3s, box-shadow 0.3s;
}
.header.is-scrolled {
  background-color: var(--white);
  box-shadow: var(--shadow-md);
}

/* --- THE KEY FIX: Only apply hero styles when NOT scrolled AND NOT mobile-active --- */
.header:not(.is-scrolled):not(.mobile-nav-active) .app-brand-name .fluent-part,
.header:not(.is-scrolled):not(.mobile-nav-active) .app-brand-name .speak-part {
  color: var(--white);
}
.header:not(.is-scrolled):not(.mobile-nav-active) .logo-image {
  background-color: var(--white);
  border-radius: 50%;
  padding: 5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.header:not(.is-scrolled):not(.mobile-nav-active) .app-brand-name span {
  color: var(--white);
}
.header:not(.is-scrolled):not(.mobile-nav-active) .main-nav a {
  color: var(--white);
}
.header:not(.is-scrolled):not(.mobile-nav-active)
  .header-actions
  .btn-secondary {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.5);
}
.header:not(.is-scrolled):not(.mobile-nav-active)
  .header-actions
  .btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.1);
}
/* --- End of Key Fix --- */

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

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

.logo-image {
  height: 60px;
  width: 60px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  object-fit: contain;
}

.app-brand-name {
  font-family: var(--font-brand);
  font-weight: 600;
  font-size: 1.5rem;
}
.app-brand-name .fluent-part {
  color: #4a4f74;
}
.app-brand-name .speak-part {
  color: var(--primary);
}

.app-brand-name.on-dark .fluent-part,
.app-brand-name.on-dark .speak-part {
  color: var(--white);
}

.main-nav ul {
  display: flex;
  list-style: none;
  align-items: center;
  gap: 2rem;
}
.main-nav a {
  color: var(--text-secondary);
  font-weight: 500;
}

.main-nav a:hover {
  color: var(--primary);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.mobile-menu-toggle {
  display: none;
}

/* ==========================================================================
   3. Hero Section
   ========================================================================== */
.hero {
  color: var(--white);
  padding: 12rem 0;
  position: relative;
  overflow: hidden;
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  background-color: #2d3748;
}
.hero-background img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-overlay {
  background: rgba(17, 24, 39, 0.7);
  position: absolute;
  inset: 0;
  z-index: -1;
}
.hero-content {
  text-align: center;
}
.hero h1 {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}
.hero p {
  font-size: 1.25rem;
  margin-bottom: 2.5rem;
  max-width: 650px;
  margin-left: auto;
  margin-right: auto;
  color: #e5e7eb;
}
.hero-subtext {
  display: block;
  margin-top: 1rem;
  color: #d1d5db;
  font-size: 0.9rem;
}
.hero-subtext strong {
  color: var(--white);
}

/* ==========================================================================
   4. How It Works Section
   ========================================================================== */
.how-it-works {
  background-color: var(--bg-light);
}
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  text-align: center;
}
.step-card {
  padding: 1.5rem;
}
.step-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}
.step-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}
.step-card p {
  color: var(--text-secondary);
}

/* ==========================================================================
   5. Features Section
   ========================================================================== */
.features {
  padding: 6rem 0 3rem;
}
.feature-showcase {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  margin-bottom: 6rem;
}
.feature-showcase.reverse .feature-image {
  order: 2;
}
.feature-image img {
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
}
.feature-content h3 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
}
.feature-content p {
  color: var(--text-secondary);
  line-height: 1.8;
}
.feature-downloads {
  margin-top: 1.5rem;
  display: flex;
  gap: 1rem;
}
.feature-downloads a {
  font-weight: 500;
}

/* ==========================================================================
   6. Philosophy / "Human-Made" Section
   ========================================================================== */
.philosophy {
  background-color: var(--bg-light);
  text-align: center;
}
.philosophy-content {
  max-width: 750px;
  margin: 0 auto;
}
.philosophy p {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

/* ==========================================================================
   7. Pricing Section
   ========================================================================== */
.pricing-card {
  max-width: 450px;
  margin: 0 auto;
  background-color: var(--white);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
}
.pricing-header {
  text-align: center;
  padding: 2.5rem;
  background-color: var(--bg-light);
}
.pricing-header h3 {
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-secondary);
}
.plan-price {
  font-size: 3.25rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-top: 0.5rem;
}
.plan-price span {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
}
.pricing-features {
  list-style: none;
  padding: 2rem;
}
.pricing-features li {
  display: flex;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-light);
}
.pricing-features li:last-child {
  border-bottom: none;
}
.pricing-features li::before {
  content: "✓";
  color: var(--primary);
  margin-right: 1rem;
  font-size: 1.25rem;
}
.pricing-footer {
  padding: 0 2rem 2rem;
  text-align: center;
}
.pricing-subtext {
  display: block;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 1rem;
}

/* ==========================================================================
   NEW: FAQ Section
   ========================================================================== */
.faq {
  background-color: var(--bg-light);
}
.faq-grid {
  max-width: 800px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
.faq-item h4 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}
.faq-item p {
  color: var(--text-secondary);
}

/* ==========================================================================
   8. Final CTA Section
   ========================================================================== */
.final-cta {
  background-color: var(--dark-blue);
  color: var(--white);
  text-align: center;
}
.final-cta h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}
.final-cta p {
  color: #d1d5db;
  margin-bottom: 2.5rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ==========================================================================
   9. Footer
   ========================================================================== */
.footer {
  background-color: var(--dark-blue);
  color: #a0aec0;
  padding: 5rem 0 2rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 4rem;
}
.footer-brand p {
  margin: 1rem 0;
  line-height: 1.8;
  max-width: 300px;
}

.footer-brand .logo {
  margin-bottom: 1rem; /* Add space below the main brand line */
}
.footer-brand .logo-image {
  height: 48px; /* BIGGER */
  width: 48px; /* BIGGER */
}
.footer-brand .app-brand-name {
  font-size: 1.8rem; /* BIGGER */
}
.social-links {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  transition: var(--transition);
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.social-links a:hover {
  background-color: var(--primary);
  transform: translateY(-2px);
  border-color: var(--primary);
}

.social-links a svg {
  width: 20px;
  height: 20px;
  fill: #a0aec0;
  transition: fill 0.2s ease-in-out;
}

.social-links a:hover svg {
  fill: var(--white);
}

.footer-links h4 {
  font-size: 1rem;
  margin-bottom: 1.5rem;
  color: var(--white);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.footer-links ul {
  list-style: none;
}
.footer-links li {
  margin-bottom: 1rem;
}
.footer-links a {
  color: #a0aec0;
}
.footer-links a:hover {
  color: var(--white);
}
.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.9rem;
}

/* ==========================================================================
   10. Animations & Mobile Nav
   ========================================================================== */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.fade-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.mobile-nav-header,
.mobile-nav-footer {
  display: none;
}

@media (max-width: 992px) {
  .mobile-nav-header .logo {
    display: flex;
  }

  /* --- MOBILE HEADER / FOOTER STRUCTURE --- */
  .mobile-nav-header,
  .mobile-nav-footer {
    display: block;
    width: 100%;
  }
  .mobile-nav-header {
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--border-light);
  }
  .mobile-nav-footer {
    padding: 1.5rem 1.5rem calc(1.5rem + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: auto; /* Pushes footer to the bottom */
    border-top: 1px solid var(--border-light);
  }

  /* --- HIDE DESKTOP ELEMENTS --- */
  .header .main-nav,
  .header .header-actions {
    display: none;
  }

  /* --- HAMBURGER ICON STYLING --- */
  .mobile-menu-toggle {
    display: block;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001;
  }
  .mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    margin: 5px 0;
    background-color: var(--text-primary); /* Default to dark color */
    transition: var(--transition);
  }
  /* THE KEY FIX: Only make icon white when NOT scrolled AND NOT mobile-active */
  .header:not(.is-scrolled):not(.mobile-nav-active) .mobile-menu-toggle span {
    background-color: var(--white);
  }

  /* --- HAMBURGER "X" (ACTIVE) STATE --- */
  /* Ensure the X is always dark */
  .header.mobile-nav-active .mobile-menu-toggle span {
    background-color: var(--text-primary);
  }
  .header.mobile-nav-active .mobile-menu-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .header.mobile-nav-active .mobile-menu-toggle span:nth-child(2) {
    opacity: 0;
  }
  .header.mobile-nav-active .mobile-menu-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  body:has(.header.mobile-nav-active) {
    background-color: var(--white);
    /* You could even put the overflow: hidden here, but it's less reliable on body */
  }

  /* --- MOBILE NAVIGATION PANEL --- */
  .main-nav {
    display: flex; /* Has to be flex to allow for header/footer layout */
    flex-direction: column;
    justify-content: flex-start;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100dvh;
    background-color: var(--white);
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .header.mobile-nav-active .main-nav {
    transform: translateX(0);
    display: flex; /* VISIBILITY FIX: This makes it show up */
  }

  /* When mobile nav is active, force main header bar to be transparent */
  .header.mobile-nav-active {
    background-color: transparent;
    box-shadow: none;
  }

  /* --- MOBILE NAVIGATION LINKS --- */
  .main-nav ul {
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding-top: 1rem;
  }
  .main-nav li {
    width: 100%;
    text-align: center;
  }
  .main-nav a {
    display: block;
    padding: 1rem 0;
    font-size: 1.25rem;
    color: var(--text-primary); /* Ensure links are always dark */
  }

  /* --- RESPONSIVE GRID ADJUSTMENTS --- */
  .steps-grid {
    grid-template-columns: 1fr;
  }
  .feature-showcase,
  .feature-showcase.reverse {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .feature-showcase.reverse .feature-image {
    order: 0;
  }
  .feature-image {
    margin-bottom: 2rem;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.5rem;
  }
  .hero p {
    font-size: 1.1rem;
  }
  .section-title,
  .final-cta h2 {
    font-size: 2rem;
  }
}

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