/* Yachay: hero de la home. Texto + imagen rotativa 4:5 (fundido cruzado en CSS puro, 4 diapositivas de 6 s). */

.hero { padding-block: clamp(2rem, 4vw, 4rem); }
.hero__grid {
  --cta-size: clamp(12px, .8vw, 13px);
  display: grid;
  /* La columna de imagen crece hasta 39 rem y se reduce sola en pantallas de poca altura */
  grid-template-columns: minmax(0, 1fr) minmax(0, min(39rem, max(20rem, calc((100svh - 10rem) * .8))));
  gap: clamp(2rem, 6vw, 6rem);
  align-items: stretch;
}

/* Columna de texto: eyebrow arriba, cuerpo al centro, cuadro técnico abajo */
.hero__text { display: flex; flex-direction: column; justify-content: space-between; gap: 2.5rem; min-width: 0; }
.hero__eyebrow { margin: 0 0 1.5rem; line-height: 1.9; }
.hero__eyebrow span { display: block; }
.hero__body { margin-block: auto; }
.hero__title { max-width: 16ch; margin-bottom: .4em; }
.hero__lead {
  max-width: 28rem;
  margin-bottom: 1.75rem;
  color: var(--fg-muted);
  font-size: .9375rem;
  font-weight: 300;
  line-height: var(--lh-body);
}
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 2rem; }

/* Cuadro técnico: regla superior y divisores verticales */
.hero__materials {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
  list-style: none;
  font-family: var(--font-mono);
}
.hero__materials li { display: grid; gap: .4rem; padding: 1rem 0 .25rem 1.25rem; border-left: 1px solid var(--rule); }
.hero__materials li:first-child { padding-left: 0; border-left: 0; }
.hero__n { font-size: 12px; letter-spacing: .08em; color: var(--fg-muted); }
.hero__mat { font-size: .875rem; letter-spacing: .04em; color: var(--fg); }

/* Columna de imagen: marco 4:5 con esquinas redondeadas y diapositivas apiladas */
.hero__figure { margin: 0; min-width: 0; }
.hero__media {
  position: relative;
  isolation: isolate;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: var(--radius-media);
  background: var(--placeholder);
}
.hero__slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  animation: hero-fade 24s linear infinite both;
  animation-delay: calc(var(--i) * 6s - 1.08s);
}
.hero__slide img { width: 100%; height: 100%; object-fit: cover; }

/* Cápsula de referencia (misma del sitio en construcción) */
.hero__pill {
  position: absolute;
  left: clamp(.75rem, 2vw, 1.25rem);
  bottom: clamp(.75rem, 2vw, 1.25rem);
  max-width: calc(100% - 2 * clamp(.75rem, 2vw, 1.25rem));
  padding: 7px 12px 8px;
  border: 1px solid rgb(241 238 230 / 32%);
  border-radius: 999px;
  background: var(--scrim);
  color: #f1eee6;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .015em;
  line-height: 1.35;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

/* Cada diapositiva dura 6 s (25 % del ciclo); la entrante queda por encima de la saliente */
@keyframes hero-fade {
  0%      { opacity: 0; z-index: 2; }
  4.5%    { opacity: 1; z-index: 2; }
  7%      { opacity: 1; z-index: 2; }
  7.01%   { opacity: 1; z-index: 1; }
  29.5%   { opacity: 1; z-index: 1; }
  30.5%   { opacity: 0; z-index: 1; }
  100%    { opacity: 0; z-index: 1; }
}
.hero__media:hover .hero__slide,
.hero__media:focus-within .hero__slide { animation-play-state: paused; }

@media (prefers-reduced-motion: reduce) {
  .hero__slide { animation: none; }
  .hero__slide:first-child { opacity: 1; }
}

/* Tableta y móvil: la pieza va primero */
@media (max-width: 56rem) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__figure { order: -1; }
  .hero__media { aspect-ratio: 4 / 3; }
  .hero__slide img { object-position: center 40%; }
  .hero__text { gap: 2rem; }
}

/* Móvil: imagen de punta a punta (como en el sitio en construcción), sin esquinas, cápsula arriba */
@media (max-width: 37.4375rem) {
  .hero { padding-top: 0; }
  .hero__grid { gap: 1.5rem; }
  .hero__figure { max-width: none; margin-inline: calc(-1 * var(--gutter)); }
  .hero__media { aspect-ratio: auto; height: clamp(15rem, 42svh, 24rem); border-radius: 0; }
  .hero__slide img { object-position: center 40%; }
  .hero__pill { top: 1.125rem; bottom: auto; left: 1.125rem; }
  .hero__eyebrow { margin-bottom: 1rem; }
  .hero__lead { max-width: none; line-height: var(--lh-body); margin-bottom: 1.5rem; }
}

/* Cápsula con su propio tiempo: aparece cuando la imagen ya está completa y se apaga
   ~0.6 s antes de que entre la siguiente, para que nunca se superpongan dos cápsulas */
.hero__pill {
  opacity: 0;
  animation: hero-pill 24s linear infinite both;
  animation-delay: calc(var(--i) * 6s - 1.08s);
}
@keyframes hero-pill {
  0%    { opacity: 0; }
  5.5%  { opacity: 0; }
  7%    { opacity: 1; }
  21%   { opacity: 1; }
  22.5% { opacity: 0; }
  100%  { opacity: 0; }
}
.hero__media:hover .hero__pill,
.hero__media:focus-within .hero__pill { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .hero__pill { animation: none; opacity: 1; } }

/* Tableta (600 a 896 px): sube el colgante de agata roja (diapositiva 3) para que la piedra quede completa */
@media (min-width: 37.5rem) and (max-width: 56rem) {
  .hero__slide:nth-child(3) img { object-position: center 58%; }
}
