/* ==========================================================================
   Multiplication Bug — Landing Page Styles
   ========================================================================== */

/* --- Design Tokens --- */
:root {
  --color-primary: #7C4DFF;
  --color-primary-dark: #6200EA;
  --color-primary-light: #B388FF;
  --color-bg: #FAF8FF;
  --color-surface: #FFFFFF;
  --color-text: #2D2D2D;
  --color-text-muted: #616161;
  --color-coral: #FF6B6B;
  --color-success: #4CAF50;
  --color-footer-bg: #7C4DFF;
  --font-display: 'Baloo 2', 'Arial Rounded MT Bold', sans-serif;
  --font-body: 'Nunito', sans-serif;
  --radius: 16px;
  --radius-lg: 24px;
  --max-width: 960px;
  --max-width-wide: 1120px;
}

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

/* --- Base --- */
html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: opacity 0.15s;
}
a:hover {
  opacity: 0.7;
}

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

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection {
  background: rgba(124, 77, 255, 0.15);
  color: var(--color-text);
}

/* ==========================================================================
   HERO
   ========================================================================== */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(40px, 6vh, 72px) 24px clamp(32px, 4vh, 48px);
}

.hero-mascot {
  width: clamp(120px, 20vw, 160px);
  margin-bottom: clamp(16px, 2vh, 24px);
  animation: fadeSlideUp 0.6s ease-out both;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.2rem, 6vw, 3.5rem);
  line-height: 1.1;
  color: var(--color-text);
  margin-bottom: 4px;
  animation: fadeSlideUp 0.6s ease-out 0.1s both;
}

.hero-tagline {
  font-family: var(--font-body);
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  color: var(--color-primary);
  font-weight: 700;
  margin-bottom: 12px;
  animation: fadeSlideUp 0.6s ease-out 0.15s both;
}

.hero-subtitle {
  font-family: var(--font-body);
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  color: var(--color-text-muted);
  font-weight: 400;
  line-height: 1.6;
  max-width: 480px;
  margin-bottom: clamp(24px, 3vh, 32px);
  animation: fadeSlideUp 0.6s ease-out 0.2s both;
}

.badge-row {
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
  animation: fadeSlideUp 0.6s ease-out 0.3s both;
}

.badge-link {
  display: inline-block;
  height: 54px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.badge-link:hover {
  transform: scale(1.05);
  opacity: 1;
}
.badge-link img {
  height: 54px;
  width: auto;
}

.footer__store-badges {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.hero-availability {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  animation: fadeSlideUp 0.6s ease-out 0.35s both;
}
.hero-availability__live {
  color: var(--color-primary);
  font-weight: 700;
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   APP PREVIEW
   ========================================================================== */

.app-preview {
  padding: clamp(40px, 6vh, 80px) 24px;
  max-width: var(--max-width-wide);
  margin: 0 auto;
}

.app-preview__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(32px, 4vh, 48px);
}

@media (min-width: 768px) {
  .app-preview__inner {
    flex-direction: row;
    align-items: center;
    gap: clamp(48px, 6vw, 80px);
  }
}

.app-preview__device {
  flex-shrink: 0;
}

/* CSS-only iPhone frame */
.phone-frame {
  position: relative;
  width: clamp(220px, 30vw, 280px);
  aspect-ratio: 1 / 2.17;
  background: #1a1a1a;
  border-radius: clamp(28px, 4vw, 40px);
  padding: 8px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.1),
    0 20px 60px rgba(0, 0, 0, 0.15),
    0 8px 24px rgba(124, 77, 255, 0.1);
  animation: gentleFloat 6s ease-in-out infinite;
}

.phone-frame__notch {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 24px;
  background: #1a1a1a;
  border-radius: 0 0 16px 16px;
  z-index: 2;
}

.phone-frame__screen {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: clamp(20px, 3vw, 32px);
  display: block;
}

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

.app-preview__text {
  max-width: 440px;
}

.section-heading {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  color: var(--color-text);
  margin-bottom: 16px;
  line-height: 1.2;
}

.app-preview__desc {
  font-size: clamp(0.95rem, 2vw, 1.05rem);
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-bottom: 24px;
}

.app-preview__highlights {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.app-preview__highlights li {
  font-size: 0.95rem;
  color: var(--color-text);
  font-weight: 600;
  display: flex;
  align-items: baseline;
  gap: 10px;
  line-height: 1.5;
}

.highlight-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

@media (max-width: 767px) {
  .app-preview__text { text-align: center; }
  .app-preview__highlights li { justify-content: center; }
}

/* ==========================================================================
   FEATURES
   ========================================================================== */

.features {
  padding: clamp(32px, 5vh, 64px) 24px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

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

.feature-card {
  text-align: center;
  padding: clamp(24px, 3vw, 32px) clamp(16px, 2vw, 24px);
  background: var(--color-surface);
  border-radius: var(--radius);
  border: 1px solid rgba(124, 77, 255, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(124, 77, 255, 0.1);
}

.feature-card__icon-wrap {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(124, 77, 255, 0.08), rgba(255, 107, 107, 0.08));
  border-radius: 16px;
}

.feature-card__icon {
  width: 36px;
  height: 36px;
  color: var(--color-primary);
}

.feature-card__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.05rem, 2vw, 1.15rem);
  margin-bottom: 8px;
  color: var(--color-text);
}

.feature-card__text {
  font-size: 0.92rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  max-width: 280px;
  margin: 0 auto;
}

/* Touch devices: disable hover lift to avoid sticky hover on mobile */
@media (hover: none) {
  .feature-card:hover {
    transform: none;
    box-shadow: none;
  }
}

/* ==========================================================================
   SCIENCE
   ========================================================================== */

.science {
  background: linear-gradient(180deg, var(--color-bg) 0%, rgba(124, 77, 255, 0.04) 50%, var(--color-bg) 100%);
  padding: clamp(48px, 7vh, 80px) 24px;
}

.science__inner {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}

.science__lead {
  font-size: clamp(1rem, 2vw, 1.1rem);
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-bottom: clamp(32px, 4vh, 48px);
}
.science__lead strong {
  color: var(--color-text);
  font-weight: 700;
}

.science__intervals {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  margin-bottom: clamp(24px, 3vh, 36px);
  padding: 0 8px;
}

.interval-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.interval-step__dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(124, 77, 255, 0.15);
  border: 2px solid rgba(124, 77, 255, 0.3);
}

.interval-step__dot--active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(124, 77, 255, 0.15);
}

.interval-step__dot--mastered {
  background: var(--color-success);
  border-color: var(--color-success);
  box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.15);
}

.interval-step__label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.interval-step__badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--color-success);
  background: rgba(76, 175, 80, 0.1);
  padding: 2px 8px;
  border-radius: 10px;
}

.interval-step__line {
  width: clamp(16px, 3vw, 32px);
  height: 2px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light));
  margin-top: 7px;
  border-radius: 1px;
}
.interval-step__line--grow { width: clamp(20px, 4vw, 40px); }
.interval-step__line--grow2 { width: clamp(24px, 5vw, 48px); }
.interval-step__line--grow3 { width: clamp(28px, 6vw, 56px); }

.science__note {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  max-width: 520px;
  margin: 0 auto;
}

@media (max-width: 374px) {
  .science__intervals { display: none; }
}

/* ==========================================================================
   TRUST STRIP
   ========================================================================== */

.trust-strip {
  padding: clamp(24px, 4vh, 40px) 24px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.trust-strip__inner {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(24px, 5vw, 56px);
  flex-wrap: wrap;
}

.trust-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.trust-item__icon {
  width: 28px;
  height: 28px;
}

.trust-item__label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-text);
  white-space: nowrap;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.footer {
  background: var(--color-footer-bg);
  color: rgba(255, 255, 255, 0.9);
  padding: clamp(28px, 4vh, 40px) 24px;
  text-align: center;
}

.footer__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.footer__brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
}

.footer__links {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
}

.footer__links a {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
  transition: color 0.15s ease;
}
.footer__links a:hover {
  color: #fff;
  opacity: 1;
}

.footer__store-badge {
  display: inline-block;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.footer__store-badge:hover {
  transform: scale(1.05);
  opacity: 1;
}
.footer__store-badge img {
  height: 36px;
  width: auto;
  filter: brightness(1.1);
}

.footer__copy {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.55);
}

.footer :focus-visible {
  outline-color: #fff;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

/* Very small phones (320px) */
@media (max-width: 374px) {
  body {
    overflow-x: hidden;
  }

  .hero {
    padding-left: 16px;
    padding-right: 16px;
  }

  .hero-subtitle br {
    display: none;
  }

  .badge-link img, .badge-link {
    height: 44px;
  }

  .features, .app-preview, .science, .trust-strip {
    padding-left: 16px;
    padding-right: 16px;
  }

  .phone-frame {
    width: 200px;
  }
}

/* Tablet portrait (768-1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
  .phone-frame {
    width: 240px;
  }
}

/* Large tablet / desktop (1024px+) */
@media (min-width: 1024px) {
  .hero {
    padding-top: 72px;
    padding-bottom: 48px;
  }

  .phone-frame {
    width: 280px;
  }
}

/* Phone landscape: short viewport, wide screen */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    padding: 16px 24px 12px;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0 24px;
  }

  .hero-mascot {
    width: 80px;
    margin-bottom: 0;
  }

  .hero-title {
    font-size: 1.8rem;
    margin-bottom: 2px;
  }

  .hero-tagline {
    font-size: 1rem;
    margin-bottom: 4px;
  }

  .hero-subtitle {
    flex-basis: 100%;
    font-size: 0.85rem;
    margin-bottom: 12px;
  }

  .badge-row {
    flex-basis: 100%;
    margin-bottom: 8px;
  }

  .badge-link img, .badge-link {
    height: 44px;
  }

  .hero-availability {
    flex-basis: 100%;
    font-size: 0.8rem;
  }

  .app-preview {
    padding: 24px;
  }

  .app-preview__inner {
    flex-direction: row;
    align-items: center;
    gap: 24px;
  }

  .phone-frame {
    width: 140px;
    animation: none;
  }

  .app-preview__text {
    text-align: left;
  }

  .app-preview__highlights li {
    justify-content: flex-start;
  }

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

  .feature-card {
    padding: 16px 12px;
  }

  .science {
    padding: 24px;
  }

  .trust-strip {
    padding: 16px 24px;
  }
}

/* Notch / Dynamic Island safe areas */
@supports (padding: env(safe-area-inset-top)) {
  .hero {
    padding-top: max(clamp(40px, 6vh, 72px), env(safe-area-inset-top));
  }

  .footer {
    padding-bottom: max(clamp(28px, 4vh, 40px), env(safe-area-inset-bottom));
  }
}

/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
