/* =========================================================
   Puppy Lovers | Landing temporal
   La fotografía es la protagonista; el resto solo la acompaña.
   ========================================================= */

@font-face {
  font-family: "Matcha Style";
  src: url("assets/fonts/matcha-style.woff2") format("woff2"),
       url("assets/fonts/matcha-style.woff") format("woff"),
       url("assets/fonts/matcha-style.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --plum: #5a2f52;                /* ciruela tomada de los accesorios de la foto */
  --cream: #fff8f3;
  --halo: 255 246 241;
  --bg: #f1e6e1;                  /* tono de la pared, visible solo mientras carga */

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

*,
*::before,
*::after { box-sizing: border-box; }

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;               /* sin barras de desplazamiento */
  background: var(--bg);
}

body {
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* ---------- Escenario a pantalla completa ---------- */

.hero {
  position: relative;
  width: 100vw;
  height: 100vh;                  /* respaldo para navegadores antiguos */
  height: 100dvh;
  overflow: hidden;
  isolation: isolate;
}

.hero__media,
.hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero__img {
  display: block;
  object-fit: cover;              /* sin deformar ni dejar bordes vacíos */
  object-position: 60% 25%;       /* 4:3 recorta pared libre, no perros; ultrawide conserva las orejas */
  z-index: -1;
  user-select: none;
  -webkit-user-drag: none;
}

/* =========================================================
   ESCRITORIO: frase arriba a la izquierda, Instagram debajo
   ========================================================= */

.hero__copy {
  position: absolute;
  top: calc(var(--safe-top) + clamp(1.75rem, 8vh, 6rem));
  left: calc(var(--safe-left) + clamp(1.5rem, 5.5vw, 7rem));
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(1rem, 2.6vh, 1.75rem);
}

.hero__title {
  margin: 0;
  font-family: "Matcha Style", "Baloo 2", "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif;
  font-weight: 400;
  font-size: clamp(1.75rem, 3.05vw, 4.25rem);
  line-height: 1.08;
  letter-spacing: 0.01em;
  color: var(--plum);
  text-shadow:
    0 1px 1px rgb(var(--halo) / 0.55),
    0 0 18px rgb(var(--halo) / 0.55),
    0 2px 30px rgb(var(--halo) / 0.35);
}

/* Tres líneas equilibradas y fijas */
.hero__line { display: block; white-space: nowrap; }

.social__list {
  display: flex;
  gap: 0.875rem;                  /* listo para más redes */
  margin: 0;
  padding: 0;
  list-style: none;
}

.social__link {
  display: block;
  width: clamp(2.5rem, 2.9vw, 3.1rem);
  aspect-ratio: 1;
  border-radius: 28%;
  -webkit-tap-highlight-color: transparent;
  filter: drop-shadow(0 6px 14px rgb(90 47 82 / 0.28));
  transform-origin: center;
  transition: transform 200ms var(--ease-out);
}

.social__icon {
  display: block;
  width: 100%;
  height: 100%;
}

.social__link:focus-visible {
  outline: 2px solid var(--plum);
  outline-offset: 4px;
}

.social__link:active { transform: scale(0.96); }

@media (hover: hover) and (pointer: fine) {
  .social__link:hover { transform: scale(1.08); }
  .social__link:hover:active { transform: scale(1.02); }
}

/* Pantallas de poca altura (portátiles pequeños, móviles en horizontal) */
@media (max-height: 560px) and (orientation: landscape) {
  .hero__copy {
    top: calc(var(--safe-top) + 1.25rem);
    gap: 0.75rem;
  }
  .hero__title { font-size: clamp(1.4rem, 3.1vw, 2.4rem); }
}

/* =========================================================
   MÓVIL y tablets en vertical
   Debe coincidir con el atributo media de <source> en index.html
   ========================================================= */
@media (max-width: 767px), (orientation: portrait) and (max-width: 1024px) {
  .hero__img { object-position: 50% 50%; }

  /* El contenedor desaparece: frase arriba, Instagram abajo */
  .hero__copy { display: contents; }

  .hero__title {
    position: absolute;
    top: calc(var(--safe-top) + clamp(1rem, 3.2vh, 2rem));
    left: 50%;
    width: calc(100% - 2.5rem - var(--safe-left) - var(--safe-right));
    max-width: 17ch;
    transform: translateX(-50%);
    text-align: center;
    font-size: clamp(1.6rem, 7.8vw, 3.4rem);
    line-height: 1.06;

    /* Estilo "sticker": crema con contorno ciruela, legible sobre cualquier zona de la foto */
    color: var(--cream);
    text-shadow:
       2px  0    0 var(--plum),
      -2px  0    0 var(--plum),
       0    2px  0 var(--plum),
       0   -2px  0 var(--plum),
       1.5px  1.5px 0 var(--plum),
      -1.5px  1.5px 0 var(--plum),
       1.5px -1.5px 0 var(--plum),
      -1.5px -1.5px 0 var(--plum),
       0 4px 0 var(--plum),
       0 8px 18px rgb(58 24 52 / 0.45);
  }

  .hero__line { white-space: normal; text-wrap: balance; }

  .social {
    position: absolute;
    left: 50%;
    bottom: calc(var(--safe-bottom) + clamp(1rem, 3.5vh, 2rem));
    transform: translateX(-50%);
  }

  .social__link { width: clamp(2.6rem, 11vw, 3rem); }
}

/* =========================================================
   INTRO (3 s): huellita Lottie sobre crema, luego el sitio
   ========================================================= */

.intro { display: none; }

.js .intro {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 46%, #fbf4f0 0%, var(--bg) 72%);
  transition: opacity 450ms var(--ease-out), visibility 0s linear 450ms;
  /* Red de seguridad: si el JS falla, la intro se retira sola */
  animation: intro-failsafe 0s linear 6s forwards;
}

/* Rastro de huellitas difuminadas (generado en assets/js/intro.js) */
.intro__trail {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  color: var(--plum);
}

.intro__print {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--s);
  height: var(--s);
  transform: translate(var(--x), var(--y)) rotate(var(--r));
  filter: blur(0.8px);                   /* difuminada, estática: no se anima */
}

.intro__print svg {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  animation: paw-step 1150ms var(--ease-out) var(--d) both;
}

/* Cada huella "se apoya": aparece rápido, se queda un instante y se desvanece */
@keyframes paw-step {
  0%   { opacity: 0;    transform: scale(0.8); }
  14%  { opacity: 0.17; transform: scale(1); }
  45%  { opacity: 0.14; transform: scale(1); }
  100% { opacity: 0;    transform: scale(1); }
}

.intro__paw {
  position: relative;                    /* por encima del rastro */
  width: clamp(8.5rem, 34vmin, 15rem);
  aspect-ratio: 1;
  opacity: 0;
  transform: scale(0.92) translateY(6px);
  transition:
    opacity 500ms var(--ease-out),
    transform 600ms var(--ease-out);
}

.intro.is-in .intro__paw {
  opacity: 1;
  transform: none;
}

/* Salida: más corta que la entrada; la huella "se acerca" y se desvanece */
.intro.is-out { opacity: 0; visibility: hidden; }

.intro.is-out .intro__paw {
  opacity: 0;
  transform: scale(1.06);
  transition-duration: 350ms;
}

@keyframes intro-failsafe {
  to { opacity: 0; visibility: hidden; }
}

/* ---------- Entrada del sitio, una sola vez (tras la intro) ---------- */

@media (prefers-reduced-motion: reduce) {
  .intro__paw,
  .intro.is-out .intro__paw { transform: none; }
}

@media (prefers-reduced-motion: no-preference) {
  /* La foto se asienta suavemente al descubrirse */
  .js .hero__img {
    transform: scale(1.03);
    transition: transform 1400ms var(--ease-out);
  }
  .js.is-ready .hero__img { transform: none; }

  html:not(.js) .hero__title,
  .is-ready .hero__title { animation: rise 900ms var(--ease-out) 150ms both; }

  html:not(.js) .social,
  .is-ready .social      { animation: fade 700ms var(--ease-out) 450ms both; }

  @keyframes rise {
    from { opacity: 0; translate: 0 10px; }
    to   { opacity: 1; translate: 0 0; }
  }

  @keyframes fade {
    from { opacity: 0; }
    to   { opacity: 1; }
  }
}
