/* ==========================================================================
   BoardFood Landing — styles.css
   Design tokens idénticos a la app Flutter (lib/core/theme/app_theme.dart).
   Stack: HTML/CSS/JS estático. Sin framework. Sin GSAP (IntersectionObserver nativo).
   ========================================================================== */

/* ---------- 1. Design tokens ---------- */
:root {
  /* Marca */
  --primary: #044b2a;
  --primary-hover: #02381f;
  --primary-disabled: #a1c4b2;

  /* Neutros */
  --grey950: #121815;
  --grey700: #5a655f;
  --grey400: #a2b0a8;
  --grey100: #f0f3f1;
  --white: #ffffff;

  /* Radios */
  --radius-btn: 20px;
  --radius-pill: 50px;

  /* Tipografía */
  --font-head: 'Quera', sans-serif;
  --font-body: 'Popins', sans-serif;

  /* Layout */
  --container: 1140px;
  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 32px;
  --space-lg: 64px;
  --space-xl: 96px;

  /* Elevación */
  --shadow-card: 0 1px 2px rgba(18, 24, 21, 0.05), 0 8px 24px rgba(18, 24, 21, 0.08);
  --shadow-hero: 0 24px 60px rgba(4, 75, 42, 0.22);

  /* Motion (suave, reducido) */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.7;
  color: var(--grey950);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  /* overflow-x: hidden rompe position:fixed en iOS Safari (el menú móvil
     se iba "abajo de todo"). overflow-x: clip recorta sin crear scroll container. */
  overflow-x: hidden;
}

@supports (overflow-x: clip) {
  body {
    overflow-x: clip;
  }
}

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

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

ul,
ol {
  list-style: none;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-head);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--grey950);
}

h1 {
  font-size: clamp(2.6rem, 6vw, 4.4rem);
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

h3 {
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
}

.container {
  width: min(100% - 48px, var(--container));
  margin-inline: auto;
}

.section {
  padding-block: var(--space-lg);
}

@media (min-width: 768px) {
  .section {
    padding-block: var(--space-xl);
  }
}

/* Kicker (etiqueta de sección) */
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--primary);
  margin-bottom: 16px;
}

.kicker::before {
  content: '';
  width: 24px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
}

.section-head {
  max-width: 640px;
  margin-bottom: var(--space-lg);
}

.section-head p {
  margin-top: 16px;
  color: var(--grey700);
  font-size: 1.05rem;
}

/* ---------- 3. Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-head);
  font-size: 1rem;
  line-height: 1;
  padding: 18px 32px;
  border-radius: var(--radius-btn);
  transition: background-color 0.25s var(--ease-out), transform 0.2s var(--ease-out),
    box-shadow 0.25s var(--ease-out);
  white-space: nowrap;
}

.btn--primary {
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 8px 24px rgba(4, 75, 42, 0.28);
}

.btn--primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(4, 75, 42, 0.34);
}

.btn--primary:focus-visible {
  outline: 3px solid var(--primary-disabled);
  outline-offset: 3px;
}

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

.btn--ghost:hover {
  background: var(--grey100);
  transform: translateY(-2px);
}

.btn--white {
  background: var(--white);
  color: var(--primary);
  box-shadow: 0 8px 24px rgba(18, 24, 21, 0.18);
}

.btn--white:hover {
  background: var(--grey100);
  transform: translateY(-2px);
}

/* Badges de tiendas */
.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-radius: var(--radius-btn);
  background: var(--grey950);
  color: var(--white);
  font-family: var(--font-body);
  transition: transform 0.2s var(--ease-out), background-color 0.2s var(--ease-out);
}

.store-badge:hover {
  transform: translateY(-2px);
  background: #222b26;
}

.store-badge .store-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.store-badge .store-label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
  font-size: 0.7rem;
  color: var(--grey400);
}

.store-badge .store-label strong {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--white);
}

/* ---------- 4. Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(162, 176, 168, 0.25);
}

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

.nav__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-head);
  font-size: 1.4rem;
  color: var(--primary);
}

.nav__brand img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.nav__links {
  display: none;
  align-items: center;
  gap: 32px;
}

.nav__links a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--grey700);
  transition: color 0.2s var(--ease-out);
}

.nav__links a:hover {
  color: var(--primary);
}

.nav__cta {
  display: none;
}

.nav__toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
}

.nav__toggle span {
  width: 24px;
  height: 2px;
  background: var(--grey950);
  border-radius: 2px;
  transition: transform 0.3s var(--ease-out), opacity 0.3s var(--ease-out);
}

.nav__toggle.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav__toggle.is-open span:nth-child(2) {
  opacity: 0;
}

.nav__toggle.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Menú móvil */
.mobile-menu {
  position: fixed;
  inset: 76px 0 auto 0;
  z-index: 101;
  background: var(--white);
  border-bottom: 1px solid var(--grey100);
  padding: 24px 24px 32px;
  display: none;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 24px 40px rgba(18, 24, 21, 0.12);
}

.mobile-menu.is-open {
  display: flex;
}

.mobile-menu a {
  padding: 14px 8px;
  font-family: var(--font-head);
  font-size: 1.15rem;
  border-radius: 12px;
  transition: background-color 0.2s var(--ease-out);
}

.mobile-menu a:hover {
  background: var(--grey100);
}

.mobile-menu .btn {
  margin-top: 16px;
}

@media (min-width: 900px) {
  .nav__links,
  .nav__cta {
    display: flex;
  }

  .nav__toggle,
  .mobile-menu {
    display: none;
  }
}

/* ---------- 5. Hero ---------- */
.hero {
  position: relative;
  background: linear-gradient(160deg, var(--grey100) 0%, var(--white) 100%);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -180px;
  right: -160px;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(4, 75, 42, 0.12) 0%, rgba(4, 75, 42, 0) 70%);
  pointer-events: none;
}

.hero__grid {
  display: grid;
  gap: var(--space-lg);
  align-items: center;
  padding-block: var(--space-lg);
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  background: rgba(4, 75, 42, 0.08);
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  margin-bottom: 24px;
}

.hero__badge::before {
  content: '✓';
  font-weight: 900;
}

.hero h1 {
  margin-bottom: 24px;
}

.hero h1 em {
  font-style: normal;
  color: var(--primary);
}

.hero__sub {
  max-width: 520px;
  font-size: 1.15rem;
  color: var(--grey700);
  margin-bottom: 36px;
}

.hero__sub strong {
  color: var(--primary);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 36px;
}

.hero__stores {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero__visual {
  position: relative;
}

/* Marco de teléfono (para screenshots de la app) */
.phone-frame {
  position: relative;
  max-width: 330px;
  margin-inline: auto;
  border-radius: 38px;
  padding: 12px;
  background: var(--grey950);
  box-shadow: var(--shadow-hero);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.phone-frame img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 28px;
  background: var(--white);
}

@media (min-width: 900px) {
  .hero__grid {
    grid-template-columns: 1.05fr 0.95fr;
    gap: 64px;
    padding-block: var(--space-xl);
  }
}

/* ---------- 6. Cómo funciona ---------- */
.steps {
  display: grid;
  gap: 24px;
}

.step {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid rgba(162, 176, 168, 0.35);
  border-radius: 24px;
  padding: 0 32px 36px;
  overflow: hidden;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}

.step:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
}

.step__media {
  display: flex;
  justify-content: center;
  padding: 28px 0 4px;
}

.phone-frame--mini {
  max-width: 168px;
  border-radius: 24px;
  padding: 8px;
  box-shadow: 0 18px 44px rgba(18, 24, 21, 0.22);
}

.phone-frame--mini img {
  border-radius: 17px;
}

.step__num {
  font-family: var(--font-head);
  font-size: 3rem;
  color: var(--primary-disabled);
  line-height: 1;
  margin: 20px 0 16px;
  display: block;
}

.step h3 {
  margin-bottom: 12px;
}

.step p {
  color: var(--grey700);
}

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

/* ---------- 7. Features ---------- */
.features {
  background: var(--grey950);
  color: var(--white);
}

.features .kicker {
  color: var(--primary-disabled);
}

.features .section-head p {
  color: var(--grey400);
}

.features h2 {
  color: var(--white);
}

.features-layout {
  display: grid;
  gap: var(--space-lg);
  align-items: center;
}

.features-grid {
  display: grid;
  gap: 24px;
}

.features-media {
  text-align: center;
}

.features-media .phone-frame {
  max-width: 300px;
}

.features-media figcaption {
  margin-top: 16px;
  font-size: 0.9rem;
  color: var(--grey400);
}

.feature {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 32px;
  transition: background-color 0.3s var(--ease-out), transform 0.3s var(--ease-out);
}

.feature:hover {
  background: rgba(255, 255, 255, 0.07);
  transform: translateY(-4px);
}

.feature__icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(4, 75, 42, 0.9);
  color: var(--white);
  font-size: 1.4rem;
  margin-bottom: 20px;
}

.feature h3 {
  color: var(--white);
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.feature p {
  color: var(--grey400);
  font-size: 0.95rem;
}

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

@media (min-width: 1024px) {
  .features-layout {
    grid-template-columns: 1.15fr 0.85fr;
  }
}

/* ---------- 8. Demo generador ---------- */
.demo {
  background: var(--grey100);
}

.demo__wrap {
  display: grid;
  gap: var(--space-lg);
  align-items: center;
}

.demo__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 20px;
  margin-top: 28px;
}

.demo__field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--grey700);
  margin-bottom: 8px;
}

.demo__field select {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 14px 20px;
  border-radius: var(--radius-btn);
  border: 1.5px solid var(--grey400);
  background: var(--white);
  color: var(--grey950);
  min-width: 180px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath fill='%23044b2a' d='M7 9L0 2h14z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
}

.demo__result {
  background: var(--white);
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(162, 176, 168, 0.3);
  min-height: 320px;
  display: flex;
  flex-direction: column;
}

.demo__result.is-empty {
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--grey400);
}

.demo__result.is-empty .demo__emoji {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.6;
}

.demo__result.is-empty p {
  max-width: 320px;
}

.demo__meal {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px dashed rgba(162, 176, 168, 0.4);
}

.demo__meal:last-child {
  border-bottom: none;
}

.demo__meal-day {
  font-family: var(--font-head);
  font-size: 0.95rem;
  color: var(--primary);
  min-width: 64px;
}

.demo__meal-info {
  flex: 1;
}

.demo__meal-name {
  font-weight: 700;
}

.demo__meal-cat {
  font-size: 0.8rem;
  color: var(--grey700);
}

.demo__meal-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--white);
  background: var(--primary);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
}

@media (min-width: 900px) {
  .demo__wrap {
    grid-template-columns: 0.9fr 1.1fr;
  }
}

/* ---------- 9. Gratis (trust) ---------- */
.gratis {
  text-align: center;
  background: linear-gradient(170deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: var(--white);
}

.gratis .kicker {
  color: var(--primary-disabled);
}

.gratis .section-head {
  margin-inline: auto;
}

.gratis h2,
.gratis .section-head p {
  color: var(--white);
}

.gratis-list {
  display: grid;
  gap: 14px;
  max-width: 480px;
  margin: 0 auto var(--space-lg);
  text-align: left;
}

.gratis-list li {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-pill);
  padding: 14px 22px;
  font-weight: 600;
}

.gratis-list .check {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--white);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.gratis .btn {
  font-size: 1.1rem;
  padding: 20px 44px;
}

/* ---------- 10. Testimonios ---------- */
.testimonios {
  background: var(--grey100);
}

.testimonios-grid {
  display: grid;
  gap: 24px;
}

.testimonio {
  background: var(--white);
  border-radius: 24px;
  padding: 32px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 20px;
  border-top: 4px solid var(--primary);
}

.testimonio blockquote {
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--grey950);
}

.testimonio blockquote::before {
  content: '“';
  display: block;
  font-family: var(--font-head);
  font-size: 3rem;
  color: var(--primary-disabled);
  line-height: 1;
  margin-bottom: 8px;
}

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

/* ---------- 11. FAQ ---------- */
.faq {
  background: var(--white);
}

.faq-list {
  max-width: 760px;
  margin-inline: auto;
}

.faq-item {
  border-bottom: 1px solid rgba(162, 176, 168, 0.4);
}

.faq-item__q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  padding: 24px 8px;
  font-family: var(--font-head);
  font-size: 1.1rem;
  text-align: left;
  color: var(--grey950);
}

.faq-item__q .faq-item__icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--grey100);
  display: grid;
  place-items: center;
  font-size: 1rem;
  color: var(--primary);
  transition: transform 0.3s var(--ease-out), background-color 0.3s var(--ease-out);
}

.faq-item.is-open .faq-item__icon {
  transform: rotate(45deg);
  background: var(--primary);
  color: var(--white);
}

.faq-item__a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s var(--ease-out);
}

.faq-item__a p {
  padding: 0 8px 24px;
  color: var(--grey700);
}

/* ---------- 12. CTA final ---------- */
.cta-final {
  position: relative;
  background: var(--grey950);
  color: var(--white);
  text-align: center;
  overflow: hidden;
}

.cta-final::after {
  content: '';
  position: absolute;
  bottom: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 640px;
  height: 640px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(4, 75, 42, 0.5) 0%, rgba(4, 75, 42, 0) 70%);
  pointer-events: none;
}

.cta-final .container {
  position: relative;
  z-index: 1;
}

.cta-final h2 {
  color: var(--white);
  margin-bottom: 20px;
}

.cta-final p {
  color: var(--grey400);
  font-size: 1.1rem;
  margin-bottom: 36px;
  max-width: 480px;
  margin-inline: auto;
}

.cta-final .btn {
  font-size: 1.1rem;
  padding: 20px 44px;
}

.cta-final .cta-note {
  margin-top: 20px;
  font-size: 0.85rem;
  color: var(--grey400);
}

/* ---------- 13. Footer ---------- */
.site-footer {
  background: var(--grey950);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--grey400);
  padding: 48px 0 32px;
}

.footer-grid {
  display: grid;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand img {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  margin-bottom: 16px;
}

.footer-brand p {
  font-size: 0.9rem;
  max-width: 260px;
}

.footer-col h4 {
  color: var(--white);
  font-size: 1rem;
  margin-bottom: 16px;
}

.footer-col ul {
  display: grid;
  gap: 10px;
}

.footer-col a {
  font-size: 0.92rem;
  transition: color 0.2s var(--ease-out);
}

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

.footer-mini-cta {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding-top: 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-mini-cta .stores-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-mini-cta .store-badge {
  background: rgba(255, 255, 255, 0.08);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
}

.footer-social {
  display: flex;
  gap: 20px;
}

.footer-social a {
  font-weight: 600;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr;
  }
}

/* ---------- 14. Reveal on scroll (IntersectionObserver, nativo) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .btn,
  .step,
  .feature,
  .store-badge {
    transition: none;
  }
}
