/* El Parque Macetas — hero de la home (feria, collage y capas).
   Solo lo carga index.html, después de sitio.css. Todo el movimiento vive en
   animaciones CSS cuyo estado final es el de reposo: sin JS o con
   prefers-reduced-motion la sección se ve entera y quieta. */

/* ——— Capas de fondo ——— */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  overflow: clip;
  padding-block: clamp(2.25rem, 6vw, 4.75rem) clamp(4.75rem, 10vw, 8rem);
  background:
    radial-gradient(55% 60% at 92% 4%, rgba(122, 193, 66, 0.2), rgba(122, 193, 66, 0) 70%),
    radial-gradient(60% 70% at 0% 100%, rgba(122, 193, 66, 0.1), rgba(20, 56, 67, 0.9) 45%, rgba(13, 42, 51, 0) 80%),
    var(--verde-noche);
}

/* Grano: ruido SVG muy suave por encima del degradado */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1.1 -.3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}

.hero-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.hero-fondo {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.hero-hoja {
  position: absolute;
  display: block;
  height: auto;
  color: var(--verde-hoja);
  transform: rotate(var(--r, 0deg));
  /* Dos vueltas y quietas: el ciclo empieza y termina en reposo. */
  animation: hero-flotar 5s ease-in-out 1;
}

.hero-hoja--1 { width: clamp(130px, 17vw, 250px); left: -3%; top: 4%; opacity: 0.08; --r: -28deg; --dur: 26s; --dx: 10px; --dy: 14px; }
.hero-hoja--2 { width: clamp(170px, 23vw, 330px); right: -7%; bottom: 2%; opacity: 0.07; --r: 148deg; --dur: 30s; --dx: -12px; --dy: -10px; }
.hero-hoja--3 { width: clamp(56px, 6.5vw, 100px); left: 47%; top: 7%; opacity: 0.1; --r: 22deg; --dur: 22s; --dx: 8px; --dy: 12px; }
.hero-hoja--4 { width: clamp(64px, 8.5vw, 124px); left: 34%; bottom: 10%; opacity: 0.06; --r: -118deg; --dur: 24s; --dx: -10px; --dy: -8px; }

@keyframes hero-flotar {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(var(--r, 0deg)); }
  50% { transform: translate3d(var(--dx, 10px), var(--dy, -12px), 0) rotate(calc(var(--r, 0deg) + 8deg)); }
}

/* Divisor curvo hacia la sección crema */
.hero-curva {
  position: absolute;
  left: 0;
  bottom: -1px;
  z-index: 1;
  display: block;
  width: 100%;
  height: clamp(28px, 5vw, 72px);
  color: var(--crema);
  pointer-events: none;
}

/* ——— Rejilla ——— */
.hero .hero-grid {
  position: relative;
  z-index: 2;
  gap: clamp(2.25rem, 5vw, 4rem);
}

@media (min-width: 800px) {
  .hero .hero-grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  }
}

/* ——— Columna de texto ——— */
.hero-texto {
  container-type: inline-size;
  min-width: 0;
}

@keyframes hero-entra {
  from { opacity: 0; transform: translate3d(0, 14px, 0); }
  to { opacity: 1; transform: none; }
}

.hero-texto > :not(.hero-feria) {
  animation: hero-entra 0.65s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.hero-texto > h1 { animation-delay: 0.05s; }
.hero-texto > .hero-bajada { animation-delay: 0.15s; }
.hero-texto > .hero-chips { animation-delay: 0.25s; }
.hero-texto > .hero-acciones { animation-delay: 0.35s; }

/* Chip de feria (lo pinta hero.js; el hueco reserva su alto, que es el
   del chip: 44 px mínimo para el dedo, WCAG 2.5.5 / eje 10 de metodo/00) */
.hero-feria {
  min-height: 2.75rem;
  margin-bottom: 1.25rem;
}

.hero-feria__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  max-width: 100%;
  min-height: 44px;
  padding: 0.4rem 0.85rem 0.4rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 1.25rem;
  background: rgba(255, 255, 255, 0.07);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--hueso);
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.25rem;
  text-decoration: none;
  transition: background var(--transicion), border-color var(--transicion);
  animation: hero-entra 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.hero-feria__chip:hover {
  color: var(--hueso);
  background: rgba(122, 193, 66, 0.14);
  border-color: rgba(122, 193, 66, 0.55);
}

.hero-feria__chip strong {
  font-weight: 700;
  color: var(--verde-hoja);
}

.hero-feria__punto {
  position: relative;
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--verde-hoja);
}

.hero-feria__punto::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: inherit;
  opacity: 0;
  /* Tres latidos y quieto, como el punto de la barra de feria: un parpadeo
     sin fin pegado al texto no cumple 2.2.2 de WCAG. */
  animation: hero-latido 1.5s ease-out 3;
}

@keyframes hero-latido {
  from { transform: scale(1); opacity: 0.75; }
  to { transform: scale(2.8); opacity: 0; }
}

.hero-feria__flecha {
  flex: none;
  width: 0.9rem;
  height: 0.9rem;
  transition: transform 0.25s ease;
}

.hero-feria__chip:hover .hero-feria__flecha,
.hero-feria__chip:focus-visible .hero-feria__flecha {
  transform: translateX(3px);
}

/* Hoy: el chip se enciende */
.hero-feria__chip--hoy,
.hero-feria__chip--hoy:hover {
  background: var(--verde-hoja);
  border-color: var(--verde-hoja);
  color: var(--verde-noche);
}

.hero-feria__chip--hoy strong { color: inherit; }
.hero-feria__chip--hoy .hero-feria__punto { background: var(--verde-noche); }

@container (max-width: 27rem) {
  .hero-feria { min-height: 3.45rem; }
  .hero-feria__texto strong { display: block; }
  .hero-feria__sep { display: none; }
}

/* Título con subrayado a mano */
/* «macetas de tela» va sin cortar (por el trazo): mide ~8 veces el cuerpo de
   letra, así que el tamaño también se limita al ancho de la columna (cqi). */
.hero h1 {
  font-size: clamp(2rem, 1.15rem + 3.7vw, 3.45rem);
  font-size: clamp(2rem, min(1.15rem + 3.7vw, 11.6cqi), 3.45rem);
  line-height: 1.07;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.hero-trazo {
  position: relative;
  display: inline-block;
  white-space: nowrap;
}

.hero-trazo svg {
  position: absolute;
  left: -3%;
  bottom: -0.2em;
  width: 106%;
  height: auto;
  overflow: visible;
  pointer-events: none;
}

.hero-trazo path {
  fill: none;
  stroke: var(--verde-hoja);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: hero-trazar 0.9s 0.55s cubic-bezier(0.65, 0, 0.35, 1) both;
}

@keyframes hero-trazar {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

.hero .hero-bajada {
  margin-bottom: 1.25rem;
}

/* Chips de la bajada */
.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.85rem;
  padding: 0;
  list-style: none;
}

.hero-chips li {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.8rem 0.4rem 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.2;
}

.hero-chips svg {
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
  color: var(--verde-hoja);
}

/* Botones */
.hero .hero-acciones .btn {
  min-height: 52px;
  padding-inline: 1.45rem;
}

.hero .btn svg {
  flex: none;
  width: 1.15rem;
  height: 1.15rem;
}

.hero-btn-principal {
  transition: background var(--transicion), border-color var(--transicion), box-shadow 0.3s ease, transform var(--transicion);
}

.hero-btn-principal:hover {
  box-shadow: 0 12px 30px -12px rgba(122, 193, 66, 0.7);
}

.hero-btn-principal svg {
  transition: transform 0.25s ease;
}

.hero-btn-principal:hover svg,
.hero-btn-principal:focus-visible svg {
  transform: translateX(4px);
}

.hero-btn-wa svg {
  color: var(--verde-hoja);
}

@media (max-width: 479px) {
  .hero .hero-acciones .btn {
    flex: 1 1 100%;
    padding-inline: 1rem;
  }
}

/* ——— Collage de la feria ——— */
.hero-collage {
  position: relative;
  width: 100%;
  max-width: 370px;
  margin-inline: auto;
  aspect-ratio: 100 / 80;
}

.hero-collage__foto {
  position: absolute;
  margin: 0;
  transform: rotate(var(--rot, 0deg));
  animation: hero-foto-entra 0.85s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: var(--retardo, 0s);
}

@keyframes hero-foto-entra {
  from { opacity: 0; transform: rotate(var(--rot, 0deg)) translate3d(0, 18px, 0) scale(0.9); }
  to { opacity: 1; transform: rotate(var(--rot, 0deg)); }
}

/* El marco es lo que sigue al ratón (--mx/--my los pone hero.js) */
.hero-collage__marco {
  position: relative;
  border-radius: var(--radio);
  background: var(--verde-noche-suave);
  box-shadow: 0 26px 50px -20px rgba(0, 0, 0, 0.6), 0 8px 18px -8px rgba(0, 0, 0, 0.35);
  transform: translate3d(calc(var(--mx, 0) * var(--prof, 0) * 1px), calc(var(--my, 0) * var(--prof, 0) * 1px), 0);
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.hero-collage__marco img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: inherit;
}

.hero-collage__marco::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.3);
  pointer-events: none;
}

/* Móvil: abanico (los laterales asoman al margen; la sección recorta) */
.hero-collage__foto--1 { left: 21%; top: 0; width: 58%; z-index: 3; --rot: -2deg; --prof: 4; --retardo: 0s; }
.hero-collage__foto--2 { left: -7%; top: 17%; width: 44%; z-index: 1; --rot: -6deg; --prof: -6; --retardo: 0.15s; }
.hero-collage__foto--3 { right: -7%; top: 17%; width: 44%; z-index: 2; --rot: 5deg; --prof: 5; --retardo: 0.3s; }

/* Etiqueta de cristal sobre la foto grande */
.hero-etiqueta {
  position: absolute;
  left: 0.6rem;
  bottom: 0.6rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.65rem 0.3rem 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(13, 42, 51, 0.72);
  -webkit-backdrop-filter: blur(10px) saturate(1.3);
  backdrop-filter: blur(10px) saturate(1.3);
  color: var(--hueso);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
}

.hero-etiqueta svg {
  width: 0.95rem;
  height: 0.95rem;
  color: var(--verde-hoja);
}

/* Sticker con texto en anillo */
.hero-sticker {
  position: absolute;
  right: -6%;
  top: -5%;
  z-index: 4;
  width: 22%;
  min-width: 72px;
  aspect-ratio: 1;
  --prof: 6;
  --rot: 0deg;
  --retardo: 0.45s;
  animation: hero-foto-entra 0.85s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: var(--retardo);
}

.hero-sticker__disco {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--verde-noche);
  box-shadow: 0 0 0 1.5px rgba(122, 193, 66, 0.55), 0 16px 30px -12px rgba(0, 0, 0, 0.6);
  transform: translate3d(calc(var(--mx, 0) * var(--prof) * 1px), calc(var(--my, 0) * var(--prof) * 1px), 0);
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.hero-sticker__anillo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  /* Una vuelta al entrar (menos de 5 s) y quieto: un texto girando sin fin
     no se puede pausar (WCAG 2.2.2). */
  animation: hero-girar 4s cubic-bezier(0.2, 0.7, 0.2, 1) calc(var(--retardo) + 0.4s) 1 both;
}

.hero-sticker__anillo text {
  fill: var(--hueso);
  font-family: var(--fuente);
  font-size: 9.6px;
  font-weight: 700;
  letter-spacing: 1.2px;
}

.hero-sticker__anillo circle {
  fill: none;
  stroke: var(--verde-hoja);
  stroke-width: 1;
}

.hero-sticker__iso {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 44%;
  height: auto;
  transform: translate(-50%, -50%);
}

@keyframes hero-girar {
  to { transform: rotate(360deg); }
}

/* Escritorio: collage escalonado */
@media (min-width: 800px) {
  .hero-collage {
    max-width: 540px;
    margin-right: 0;
    aspect-ratio: 100 / 104;
  }

  .hero-collage__marco { border-radius: var(--radio-lg); }

  .hero-collage__foto--1 { left: 0; top: 7%; width: 56%; z-index: 2; --rot: -2deg; --prof: 4; }
  .hero-collage__foto--2 { left: auto; right: 0; top: 0; width: 40%; z-index: 1; --rot: 3deg; --prof: -5; }
  .hero-collage__foto--3 { right: 7%; top: auto; bottom: 0; width: 40%; z-index: 3; --rot: -1.5deg; --prof: 6; }

  .hero-etiqueta {
    left: 1rem;
    bottom: 1rem;
    padding: 0.4rem 0.85rem 0.4rem 0.6rem;
    font-size: 0.8rem;
  }

  .hero-sticker {
    right: auto;
    left: 38%;
    top: 74%;
    width: 25%;
  }
}

/* Movimiento reducido: todo quieto y en su sitio */
@media (prefers-reduced-motion: reduce) {
  .hero *,
  .hero *::before,
  .hero *::after {
    animation: none !important;
    transition: none !important;
  }

  .hero-feria__punto::after { display: none; }
}
