/* ============================================
   Math Basics Promotional Website Styles
   Color palette from the app's Light theme
   ============================================ */

:root {
  /* App operation colors */
  --color-add: #FF9B71;
  --color-sub: #A78BFA;
  --color-mul: #60D5D5;
  --color-div: #FFD966;

  /* Lighter variants */
  --color-add-light: #FFB894;
  --color-sub-light: #C4B5FD;
  --color-mul-light: #8FEBE5;
  --color-div-light: #FFE699;

  /* UI colors */
  --color-bg: #FFF9F0;
  --color-bg-white: #FFFFFF;
  --color-text: #2D3748;
  --color-text-secondary: #5A6270;
  --color-green: #4CAF50;
  --color-blue: #2196F3;

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

  /* Layout */
  --max-width: 1120px;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
}

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

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

body {
  font-family: 'Fredoka', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 {
  line-height: 1.2;
  font-weight: 600;
}

h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); }
h3 { font-size: 1.15rem; }

a {
  color: inherit;
  text-decoration: none;
}

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

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.75rem;
  border-radius: 50px;
  font-family: inherit;
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--color-text);
  color: var(--color-bg);
}

.btn-primary:hover {
  background: #1a202c;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(45, 55, 72, 0.25);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text);
  border: 2px solid var(--color-text);
}

.btn-ghost:hover {
  background: var(--color-text);
  color: var(--color-bg);
}

.btn-sm {
  padding: 0.5rem 1.25rem;
  font-size: 0.9rem;
}

.btn-lg {
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
}

/* ---- Navigation ---- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1rem 0;
  transition: all 0.3s ease;
}

.nav.scrolled {
  background: rgba(255, 249, 240, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 0.6rem 0;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
}

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

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  font-size: 1.3rem;
}

.logo-math {
  color: var(--color-text);
}

.logo-symbols {
  display: flex;
  gap: 0.15rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.sym-add { color: var(--color-add); }
.sym-sub { color: var(--color-sub); }
.sym-mul { color: var(--color-mul); }
.sym-div { color: var(--color-div); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  font-size: 0.95rem;
  font-weight: 400;
}

.nav-links a:not(.btn):hover {
  color: var(--color-add);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--color-text);
  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);
}

/* ---- Language Picker ---- */
.lang-picker {
  position: relative;
}

.lang-picker-mobile {
  display: none;
}

.nav-right-mobile {
  display: none;
  align-items: center;
  gap: 0.5rem;
}

.lang-toggle {
  background: none;
  border: 1px solid rgba(45, 55, 72, 0.15);
  border-radius: 8px;
  cursor: pointer;
  padding: 4px 8px;
  font-size: 1.3rem;
  line-height: 1;
  transition: background 0.2s ease;
  display: flex;
  align-items: center;
}

.lang-toggle:hover {
  background: rgba(45, 55, 72, 0.06);
}

.lang-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--color-bg-white);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  padding: 0.5rem;
  z-index: 200;
  max-height: 360px;
  overflow-y: auto;
  min-width: 180px;
}

.lang-picker.open .lang-dropdown {
  display: block;
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.45rem 0.75rem;
  border: none;
  background: none;
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--color-text);
  transition: background 0.15s ease;
  text-align: left;
}

.lang-option:hover {
  background: rgba(45, 55, 72, 0.06);
}

.lang-option.active {
  background: rgba(45, 55, 72, 0.1);
  font-weight: 500;
}

.lang-flag {
  font-size: 1.15rem;
}

.lang-name {
  white-space: nowrap;
}

/* ---- Hero ---- */
.hero {
  padding: calc(var(--space-2xl) + 3rem) 0 var(--space-2xl);
  min-height: 90vh;
  display: flex;
  align-items: center;
}

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

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

.hero-sub {
  font-size: 1.15rem;
  color: var(--color-text-secondary);
  max-width: 480px;
  margin-bottom: var(--space-lg);
  font-weight: 300;
}

.hero-actions {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.hero-note {
  margin-top: var(--space-sm);
  font-size: 1.1rem;
  color: var(--color-text-secondary);
  font-weight: 600;
}

/* Device frame */
.device-frame {
  position: relative;
  max-width: 300px;
  margin: 0 auto;
}

.device-screen {
  aspect-ratio: 9 / 19.5;
  border-radius: 36px;
  overflow: hidden;
}

.hero-phone-placeholder {
  aspect-ratio: 1170 / 2416;
  max-width: 300px;
  margin: 0 auto;
  border-radius: 24px;
  border: 3px solid rgba(45, 55, 72, 0.12);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* ---- Hero Video ---- */
.hero-video {
  width: 100%;
  max-width: 360px;
  border-radius: var(--radius);
  border: 3px solid rgba(45, 55, 72, 0.12);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* ---- Operations Bar ---- */
.operations-bar {
  padding: var(--space-lg) 0;
  background: var(--color-bg-white);
}

.ops-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
}

.op-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: var(--space-md) var(--space-sm);
  border-radius: var(--radius-sm);
  transition: transform 0.2s ease;
}

.op-item:hover {
  transform: translateY(-2px);
}

.op-symbol {
  font-size: 2rem;
  font-weight: 700;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  line-height: 1;
  text-align: center;
  padding-bottom: 0.1em;
}

.op-name {
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--color-text-secondary);
}

.op-add .op-symbol { background: var(--color-add-light); color: #c46a3a; }
.op-sub .op-symbol { background: var(--color-sub-light); color: #6d5bbf; }
.op-mul .op-symbol { background: var(--color-mul-light); color: #3a9e9e; }
.op-div .op-symbol { background: var(--color-div-light); color: #b89a2e; }

/* ---- Features ---- */
.features {
  padding: var(--space-2xl) 0;
}

.section-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto var(--space-xl);
}

.section-header p {
  margin-top: var(--space-sm);
  color: var(--color-text-secondary);
  font-weight: 300;
  font-size: 1.05rem;
}

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

.feature-card {
  background: var(--color-bg-white);
  padding: var(--space-lg);
  border-radius: var(--radius);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}

.feature-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-md);
  font-size: 1.1rem;
  font-weight: 700;
}

.icon-operations { background: var(--color-add-light); color: #c46a3a; }
.icon-tables { background: var(--color-sub-light); color: #6d5bbf; }
.icon-focus { background: var(--color-mul-light); color: #3a9e9e; }
.icon-goals { background: var(--color-div-light); color: #b89a2e; }
.icon-stats { background: #FFD1DC; color: #c46a6a; }
.icon-privacy { background: #C8E6C9; color: #2E7D32; }

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

.feature-card p {
  color: var(--color-text-secondary);
  font-size: 0.92rem;
  font-weight: 300;
  line-height: 1.5;
}

/* ---- App Preview ---- */
.app-preview {
  padding: var(--space-2xl) 0;
  background: var(--color-bg-white);
}

.preview-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 var(--space-md);
}

.preview-item {
  aspect-ratio: 1170 / 2416;
  border-radius: 24px;
  overflow: hidden;
  position: relative;
  border: 3px solid rgba(45, 55, 72, 0.12);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.preview-item:not(.screenshot-placeholder)[data-label]::after {
  content: attr(data-label);
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  font-weight: 400;
}

.preview-screenshot {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: var(--radius);
}


/* ---- How It Works ---- */
.how-it-works {
  padding: var(--space-2xl) 0;
}

.steps-grid {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  max-width: 900px;
  margin: 0 auto;
}

.step {
  flex: 1;
  text-align: center;
  padding: 0 var(--space-md);
}

.step-number {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-text);
  color: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 auto var(--space-md);
}

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

.step p {
  color: var(--color-text-secondary);
  font-size: 0.92rem;
  font-weight: 300;
}

.step-connector {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, var(--color-add), var(--color-sub));
  margin-top: 23px;
  flex-shrink: 0;
  border-radius: 1px;
}

/* ---- Parents ---- */
.parents {
  padding: var(--space-2xl) 0;
  background: var(--color-bg-white);
}

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

.parents-content h2 {
  margin-bottom: var(--space-lg);
}

.parents-features {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.parent-feature {
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
}

.pf-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 12px;
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
}

.parent-feature h4 {
  margin-bottom: 0.2rem;
  font-size: 1rem;
}

.parent-feature p {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  font-weight: 300;
}

.parents-visual .screenshot-placeholder {
  aspect-ratio: 9 / 16;
  max-width: 300px;
  margin: 0 auto;
  border-radius: 28px;
}

/* ---- Pricing ---- */
.pricing {
  padding: var(--space-2xl) 0;
}

.pricing-badge {
  display: inline-block;
  padding: 0.35rem 1rem;
  background: linear-gradient(135deg, var(--color-add), var(--color-div));
  color: var(--color-text);
  border-radius: 50px;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-bottom: var(--space-md);
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem var(--space-md);
  max-width: 900px;
  margin: 0 auto;
}

.pricing-item {
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.check {
  color: var(--color-green);
  font-weight: 700;
  font-size: 1rem;
}

.pricing-cta {
  text-align: center;
  margin-top: var(--space-lg);
}

.pricing-note {
  margin-top: var(--space-sm);
  font-size: 1.05rem;
  color: #3a9e9e;
  font-weight: 600;
}

/* ---- Download CTA ---- */
.download {
  padding: var(--space-lg) 0 var(--space-2xl);
  text-align: center;
  background: linear-gradient(180deg, var(--color-bg) 0%, #f5ece0 100%);
}

.download-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

.download p {
  color: var(--color-text-secondary);
  font-weight: 300;
}

.app-store-badge {
  transition: transform 0.2s ease;
}

.app-store-badge:hover {
  transform: scale(1.05);
}

/* ---- Footer ---- */
.footer {
  padding: var(--space-xl) 0 var(--space-lg);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  font-size: 1.1rem;
}

.footer-company {
  font-size: 0.85rem;
  font-weight: 300;
  color: var(--color-text-secondary);
  margin-left: 0.5rem;
}

.footer-links {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  justify-content: center;
  font-size: 0.9rem;
  color: var(--color-text-secondary);
}

.footer-links a:hover {
  color: var(--color-text);
}

.footer-legal {
  text-align: center;
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  font-weight: 300;
  line-height: 1.6;
}

/* ---- Animations ---- */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

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

/* Stagger feature cards */
.features-grid .fade-in:nth-child(2) { transition-delay: 0.08s; }
.features-grid .fade-in:nth-child(3) { transition-delay: 0.16s; }
.features-grid .fade-in:nth-child(4) { transition-delay: 0.24s; }
.features-grid .fade-in:nth-child(5) { transition-delay: 0.32s; }
.features-grid .fade-in:nth-child(6) { transition-delay: 0.4s; }

/* Stagger preview items */
.preview-gallery .fade-in:nth-child(2) { transition-delay: 0.1s; }
.preview-gallery .fade-in:nth-child(3) { transition-delay: 0.2s; }
.preview-gallery .fade-in:nth-child(4) { transition-delay: 0.3s; }
.preview-gallery .fade-in:nth-child(5) { transition-delay: 0.4s; }
.preview-gallery .fade-in:nth-child(6) { transition-delay: 0.5s; }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

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

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

  .hero-visual {
    order: -1;
  }

  .hero-phone-placeholder {
    max-width: 220px;
  }

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

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

  .parents-inner {
    grid-template-columns: 1fr;
  }

  .parents-visual {
    order: -1;
  }

  .parents-visual .screenshot-placeholder {
    max-width: 200px;
    aspect-ratio: 9 / 14;
  }

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

  .step-connector {
    width: 2px;
    height: 30px;
    background: linear-gradient(180deg, var(--color-add), var(--color-sub));
  }

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

@media (max-width: 600px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255, 249, 240, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    padding: var(--space-md);
    gap: var(--space-sm);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  }

  .nav-links .lang-picker {
    display: none;
  }

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

  .nav-right-mobile {
    display: flex;
  }

  .lang-picker-mobile {
    display: block;
  }

  .nav-toggle {
    display: flex;
  }

  .hero {
    min-height: auto;
    padding-top: calc(var(--space-xl) + 3rem);
  }

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

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

  .preview-gallery {
    grid-template-columns: 1fr 1fr;
  }

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