/* ==========================================================================
   KoaPet — Landing Page
   Escala tipográfica proporcional al viewport (basada en la referencia).
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --cream: #faf7f0;
  --cream-strong: rgba(250, 247, 240, 0.86);
  --ink: #2e2a24;
  --body: #4e4e4a;
  --gold: #92764a;
  --line: rgba(46, 42, 36, 0.08);
  --shadow-phone: 0 40px 70px -20px rgba(35, 24, 12, 0.45);

  /* Padding lateral: 7.8vw como la referencia */
  --pad-x: clamp(24px, 7.8vw, 190px);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--body);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

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

/* ---------- Hero ---------- */

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: hidden;
  isolation: isolate;
}

.hero__bg {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 0;
  background-image: url('../assets/hero-mockup.png');
  background-size: cover;
  background-position: 40% 45%;
  background-repeat: no-repeat;
}

/* Velo crema a la izquierda para que el texto dorado se lea */
.hero__bg::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background:
    linear-gradient(
      180deg,
      rgba(250, 247, 240, 0.72) 0%,
      rgba(250, 247, 240, 0.34) 9%,
      rgba(250, 247, 240, 0) 17%
    ),
    linear-gradient(
      100deg,
      rgba(250, 247, 240, 0.97) 0%,
      rgba(250, 247, 240, 0.93) 30%,
      rgba(250, 247, 240, 0.6) 48%,
      rgba(250, 247, 240, 0.15) 66%,
      rgba(250, 247, 240, 0) 78%
    );
}

/* ---------- Navbar ---------- */

.navbar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(14px, 1.4vw, 30px) var(--pad-x);
  background: transparent;
}

.brand {
  display: flex;
  align-items: center;
  gap: clamp(8px, 0.8vw, 18px);
  text-decoration: none;
  flex-shrink: 0;
}

.brand__logo {
  width: clamp(50px, 4.4vw, 100px);
  height: clamp(50px, 4.4vw, 100px);
  border-radius: 30%;
  object-fit: cover;
}

.brand__name {
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: clamp(1.2rem, 2vw, 2.9rem);
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1;
}

.menu-toggle {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  cursor: pointer;
  z-index: 25;
}

.menu-btn span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.6vw, 62px);
}

.nav-links a {
  text-decoration: none;
  font-size: clamp(0.95rem, 1.55vw, 2.1rem);
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a.is-active {
  color: #947438;
}

.nav-links a:focus-visible,
.brand:focus-visible,
.app-store-badge:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
  border-radius: 4px;
}

/* ---------- Contenido ---------- */

.hero__content {
  position: relative;
  z-index: 10;
  flex: 1;
  display: flex;
  align-items: center;
  padding: clamp(24px, 3vw, 70px) var(--pad-x);
}

.hero__text {
  max-width: min(52%, 1000px);
  animation: rise-in 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.hero__title {
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  /* 4.05vw = proporción exacta de la referencia */
  font-size: clamp(2rem, 3.9vw, 5.4rem);
  line-height: 1.12;
  color: #947438;
  margin: 0 0 clamp(14px, 1.5vw, 34px);
  letter-spacing: -0.01em;
}

.hero__subtitle {
  font-size: clamp(1rem, 1.6vw, 2.2rem);
  line-height: 1.5;
  color: var(--ink);
  max-width: 30ch;
  margin: 0 0 clamp(22px, 2.4vw, 54px);
}

.app-store-badge {
  display: inline-block;
  line-height: 0;
  margin-bottom: clamp(20px, 2.2vw, 50px);
  transition: transform 0.2s ease;
}

.app-store-badge img {
  height: clamp(50px, 5.5vw, 106px);
  width: auto;
}

/* El botón crece un poco, no se desplaza */
.app-store-badge:hover,
.app-store-badge:focus-visible {
  transform: scale(1.045);
}

.hero__caption {
  font-size: clamp(0.9rem, 1.3vw, 1.75rem);
  color: var(--ink);
  opacity: 0.85;
  margin: 0;
}

/* ---------- iPhone flotante ---------- */

.hero__mockup {
  position: absolute;
  right: clamp(120px, 22vw, 350px);
  bottom: 7vh;
  z-index: 5;
  height: min(78vh, 54vw);
  width: auto;
  pointer-events: none;
  animation: rise-in 0.9s 0.1s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.hero__mockup img {
  height: 100%;
  width: auto;
  max-width: none;
  filter: drop-shadow(var(--shadow-phone));
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__text,
  .hero__mockup {
    animation: none;
  }
  .app-store-badge {
    transition: none;
  }
}

/* ---------- Responsive ---------- */

/* Ventanas poco anchas (casi cuadradas): el titular se modera para que
   nunca alcance al telefono. */
@media (min-width: 901px) and (max-aspect-ratio: 16 / 10) {
  .hero__title {
    font-size: clamp(2rem, 3.4vw, 4.6rem);
  }

  .hero__subtitle {
    font-size: clamp(1rem, 1.4vw, 1.9rem);
  }

  /* Agregamos las reglas del iPhone aquí dentro */
  .hero__mockup {
    height: min(74vh, 58vw);
    bottom: 10vh;
    right: clamp(80px, 18vw, 250px);
  }
}

@media (max-width: 1180px) {
  .hero__text {
    max-width: 62%;
  }

  .hero__mockup {
    height: min(74vh, 58vw);
    right: clamp(80px, 18vw, 250px);
  }
}

@media (max-width: 900px) {
  :root {
    --pad-x: clamp(22px, 6vw, 48px);
  }

  .hero {
    overflow-y: visible;
  }

  .menu-btn {
    display: flex;
  }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    background: var(--cream);
    padding: 10px var(--pad-x) 22px;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 16px 30px -18px rgba(0, 0, 0, 0.25);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.25s ease;
  }

  .nav-links a {
    padding: 10px 0;
    width: 100%;
    font-size: 1.05rem;
  }

  .menu-toggle:checked ~ .nav-links {
    max-height: 320px;
    opacity: 1;
  }

  .menu-toggle:checked ~ .menu-btn span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .menu-toggle:checked ~ .menu-btn span:nth-child(2) {
    opacity: 0;
  }
  .menu-toggle:checked ~ .menu-btn span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .hero__content {
    flex-direction: column;
    justify-content: center;
    padding-top: 40px;
    padding-bottom: 40px;
  }

  .hero__text {
    max-width: 100%;
  }

  .hero__title {
    font-size: clamp(2rem, 6.4vw, 3rem);
  }

  .hero__subtitle {
    font-size: clamp(1rem, 2.6vw, 1.3rem);
    max-width: 34ch;
  }

  .hero__caption {
    font-size: clamp(0.9rem, 2.2vw, 1.1rem);
  }

  .app-store-badge img {
    height: clamp(50px, 11vw, 70px);
  }

  .brand__name {
    font-size: 1.3rem;
  }

  .brand__logo {
    width: 54px;
    height: 54px;
  }

  /* Salto de línea del titular solo en escritorio */
  .hero__break {
    display: none;
  }

  .hero__mockup {
    position: static;
    width: min(58vw, 290px);
    height: auto;
    margin: 30px auto 0;
    right: auto;
    bottom: auto;
    animation: rise-in 0.9s 0.1s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }

  .hero__mockup img {
    width: 100%;
    height: auto;
  }

  .hero__bg {
    background-position: 62% center;
  }

  .hero__bg::after {
    background: linear-gradient(
      180deg,
      rgba(250, 247, 240, 0.93) 0%,
      rgba(250, 247, 240, 0.78) 45%,
      rgba(250, 247, 240, 0.58) 100%
    );
  }
}
