/* =========================================================================
   PRUEBA HOME · hero con rejilla inclinada + recorte con flash/glitch
   Se carga DESPUÉS de lahmp.css y de tipo-*.css. No toca el resto de páginas.
   La inclinación de la rejilla sale de --angulo (8° = cursiva de Procerus).
   ========================================================================= */

:root { --angulo: 8deg; }

/* ---------- HERO ---------- */
.hr { position: relative; overflow: clip; padding-top: clamp(16px, 2.4vw, 32px); }
.hr__lienzo {
  position: relative; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: auto 1fr auto; column-gap: 16px;
  min-height: min(calc(100dvh - var(--nav-h) - 32px), 940px);
}
.hr__titulo {
  grid-column: 1 / -1; grid-row: 1 / 3; align-self: start; position: relative;
  margin: clamp(12px, 4vh, 56px) 0 0; pointer-events: none; font-size: var(--fs);
}
.hr__titulo > span { display: block; position: relative; z-index: 2; font-size: 1em; white-space: nowrap; width: max-content; }
.hr__l1 { color: var(--hueso); }
.hr__l2 { color: var(--coral); }
.hr__l3 { color: transparent; -webkit-text-stroke: max(1.5px, .012em) var(--hueso); margin-top: .02em; }
.hr__titulo > .hr__firma {
  position: absolute; z-index: 6; left: var(--firma-x, 14%); top: calc(var(--fs) * var(--firma-k, 1.1));
  font-size: calc(var(--fs) * var(--firma-fs, .34)); color: var(--hueso); white-space: nowrap; line-height: 1; width: auto;
  transform: rotate(var(--firma-rot, -6deg)); transform-origin: left center;
  text-shadow: 0 0 1px var(--burdeos-900), 2px 2px 0 var(--burdeos-900), -2px -2px 0 var(--burdeos-900), 2px -2px 0 var(--burdeos-900), -2px 2px 0 var(--burdeos-900), 0 3px 0 var(--burdeos-900), 3px 0 0 var(--burdeos-900);
}

.hr__foto { grid-column: 6 / 13; grid-row: 1 / 4; align-self: start; justify-self: end; margin-top: clamp(8px, 3vh, 40px);
  width: min(100%, 860px, calc(100dvh - var(--nav-h) - 72px)); margin-right: calc(var(--gutter) * -.4); }
.hr__pie { grid-column: 1 / 6; grid-row: 3; position: relative; z-index: 6; display: grid; gap: 20px; padding-block: 24px clamp(28px, 5vw, 56px); align-self: end; }
.hr__pie .lead { color: var(--hueso); font-weight: 500; max-width: 40ch; }
.hr__ctas { display: flex; flex-wrap: wrap; gap: 12px; align-items: stretch; }
.hr .hero__dato { grid-column: auto; grid-row: auto; align-self: start; margin: 0; min-width: 0; justify-self: start; }

@media (max-width: 900px) {
  .hr__lienzo { display: flex; flex-direction: column; min-height: 0; }
  .hr__titulo { margin-top: 8px; }
  .hr__titulo > .hr__l3 { white-space: normal; width: auto; }
  .hr__titulo > .hr__firma { --firma-x: 20%; font-size: calc(var(--fs) * .26); }
  .hr__foto { width: 100%; margin: calc(var(--fs) * -.55) 0 0; }
  .hr__pie { padding-top: 8px; }
}

/* ---------- Componente REJILLA ---------- */
.rejilla { position: relative; }
.rejilla__marco { position: relative; aspect-ratio: 1 / 1; width: 100%; }
.rejilla__tira { position: absolute; inset: 0; z-index: 1; overflow: hidden; isolation: isolate; clip-path: polygon(0 0, 0 0, 0 0, 0 0); }
.rejilla__tira img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.18) brightness(1.06); will-change: transform; }
.rejilla__tira::after { content: ""; position: absolute; inset: 0; background: var(--tono, var(--coral)); mix-blend-mode: multiply; }
.rejilla[data-tono="gris"] .rejilla__tira img { filter: grayscale(1) contrast(1.25) brightness(.92); }
.rejilla[data-tono="gris"] .rejilla__tira::after { background: #C9B3AD; }
.rejilla[data-tono="burdeos"] .rejilla__tira::after { background: #B4243C; }

.rejilla__persona, .rejilla__fx { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.rejilla__persona { z-index: 3; opacity: 0; filter: drop-shadow(0 24px 28px rgb(0 0 0 / .45)); }
.rejilla.is-lista .rejilla__persona { opacity: 1; }
.rejilla__fx { z-index: 4; opacity: 0; mix-blend-mode: screen; }
.rejilla__fx--a { filter: url(#fx-coral); }
.rejilla__fx--b { filter: url(#fx-hueso); }
.rejilla__flash {
  position: absolute; inset: -2%; z-index: 4; opacity: 0; pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgb(239 233 225 / .22) 0 1px, transparent 1px 4px),
    linear-gradient(rgb(255 248 240 / .5), rgb(255 248 240 / .5));
  mix-blend-mode: screen;
  -webkit-mask-image: radial-gradient(closest-side, #000 55%, transparent); mask-image: radial-gradient(closest-side, #000 55%, transparent);
}
/* sin JS: se ve la foto completa en monocromo */
.rejilla:not(.is-js) .rejilla__tira:first-child { clip-path: none; }

/* en la home el recorte se sitúa por encima del titular (stacking compartido) */
.hr .rejilla, .hr .rejilla__marco, .hr__foto { position: relative; }
.hr .rejilla__tira { z-index: 1; }
.hr .rejilla__persona { z-index: 4; }
.hr .rejilla__fx, .hr .rejilla__flash { z-index: 5; }

/* ---------- Animación del titular ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .hr__titulo > span { animation: hr-linea 820ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 90ms + 60ms); }
  .js .hr__titulo > .hr__firma { animation: hr-firma 900ms var(--ease-out) both; animation-delay: 1500ms; }
}
@keyframes hr-linea {
  from { clip-path: inset(-10% 100% -10% 0); translate: -.25em 0; }
  to { clip-path: inset(-10% -8% -10% 0); translate: 0 0; }
}
@keyframes hr-firma {
  from { clip-path: inset(-120% 100% -120% -20%); }
  to { clip-path: inset(-120% -20% -120% -20%); }
}

/* ---------- Sección palmarés con rejilla ---------- */
.pal-grid .rejilla { width: min(100%, 620px); margin-inline: auto; }

/* ---------- Panel de pruebas (solo maqueta) ---------- */
.pp {
  position: fixed; left: 12px; bottom: 12px; z-index: 85; width: min(340px, calc(100vw - 24px));
  background: var(--ink); color: var(--hueso); border: 2px solid var(--coral);
  font-family: "Archivo", system-ui, sans-serif; font-size: .82rem; line-height: 1.3;
  box-shadow: 0 18px 40px rgb(0 0 0 / .5);
}
.pp summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; font-weight: 800; font-stretch: 75%; text-transform: uppercase; letter-spacing: .04em; min-height: 44px; }
.pp summary::-webkit-details-marker { display: none; }
.pp summary span:last-child { color: var(--coral); }
.pp[open] summary span:last-child { transform: rotate(45deg); }
.pp__cuerpo { padding: 0 12px 12px; display: grid; gap: 10px; }
.pp__fila { display: grid; gap: 6px; }
.pp__fila > b { font-weight: 800; font-stretch: 75%; text-transform: uppercase; font-size: .72rem; letter-spacing: .06em; color: var(--texto-2); }
.pp__ops { display: flex; flex-wrap: wrap; gap: 6px; }
.pp button, .pp a.pp__btn {
  min-height: 36px; min-width: 36px; padding: 6px 10px; background: transparent; color: var(--hueso);
  border: 1.5px solid var(--linea-fuerte); font: inherit; font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
  transition: background-color 140ms ease, border-color 140ms ease, transform 140ms var(--ease-out);
}
.pp button:active { transform: scale(.96); }
.pp button[aria-pressed="true"] { background: var(--coral); border-color: var(--coral); color: var(--ink); }
.pp__nota { color: var(--texto-3); font-size: .74rem; }
@media (hover: hover) and (pointer: fine) { .pp button:hover, .pp a.pp__btn:hover { border-color: var(--hueso); } }
.rejilla:not(.is-js) .rejilla__marco > .rejilla__persona { opacity: 1; }

/* recorte con más intensidad, contraste y viveza (mismos valores que rejilla.js) */
.rejilla__persona { filter: brightness(1.04) contrast(1.14) saturate(1.32) drop-shadow(0 24px 28px rgb(0 0 0 / .45)); }
