/* Estilos de las páginas de proyecto (Petanca y las siguientes). */
@font-face {               /* Nunito Black Italic (Google Fonts, OFL) */
  font-family: "Nunito"; font-style: italic; font-weight: 900; font-display: block;
  src: url(fonts/nunito-black-italic.woff2) format("woff2");
}
html, body { overflow-x: clip; }
body { font-size: var(--fs); line-height: 1.4; }
:root { --gap: clamp(12px, 1.4vw, 24px); --side: max(var(--pad-x), 4vw); }

.label { font-size: var(--fs); opacity: .45; letter-spacing: -0.01em; }
.display { font: italic 900 1em/0.82 Nunito, "Helvetica Neue", sans-serif; letter-spacing: -0.08em; }
.ink-name { position: relative; }
.ink-name.is-ink { color: transparent; }

/* ---------- 01 Cabecera ----------
   Empieza a pantalla completa; al bajar se encoge hasta una franja (--band) con el título
   encima, el contenido sube pegado a su borde inferior y después todo se va junto. */
.p-hero { --band: 42svh; --shrink: calc(100svh - var(--band)); position: relative; height: calc(100svh + var(--shrink)); z-index: 0; }
.p-hero-pin { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.p-hero-media { position: absolute; inset: 0; overflow: hidden; clip-path: inset(0 0 var(--cut, 0px) 0); will-change: clip-path; }
.p-hero-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); transform-origin: 50% 30%; will-change: transform; }
.p-hero-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 50%, rgba(0,0,0,.5)); pointer-events: none; }
.p-hero-title {
  position: absolute; left: var(--side); right: var(--side); bottom: calc(var(--pad-y) * 1.6);
  z-index: 2; display: flex; align-items: flex-end; justify-content: space-between; gap: 2em; flex-wrap: wrap;
  transform: translate3d(0, calc(var(--cut, 0px) * -1), 0); will-change: transform;
}
.p-hero-title h1 { font-size: clamp(64px, 15vw, 280px); color: #fff; transform-origin: 0 100%; transform: scale(var(--ts, 1)); }
.p-hero-title h1.long { font-size: clamp(48px, 9.2vw, 180px); }
.p-hero-title .meta { padding-bottom: .6em; text-align: right; }
.p-hero-title .meta span { display: block; }

/* el contenido empieza justo debajo de la franja y sube pegado a ella */
.p-body { position: relative; z-index: 2; background: #000; margin-top: -58vh; margin-top: -58svh; }

/* ficha con líneas finas (como en la referencia) */
.ficha { margin: 0 0 2.6em; max-width: 620px; border-bottom: 1px solid rgba(255,255,255,.18); }
.ficha > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr); gap: 1em; padding: .55em 0; border-top: 1px solid rgba(255,255,255,.18); }
.ficha dt { opacity: .45; }
.ficha dd { margin: 0; }

.p-section { padding: clamp(64px, 9vw, 160px) var(--side); }
.p-section > .label { display: block; margin-bottom: clamp(20px, 2.4vw, 40px); }

/* ---------- Rejilla general: etiqueta a la izquierda, contenido a la derecha ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.65fr); gap: var(--gap) 4vw; align-items: start; }
.split > .label { margin: 0; }
.tight-top { padding-top: 0; }
.text-col { max-width: 760px; }

/* 02 Textos del principio: todo junto y compacto */
.p-texts { padding-top: clamp(56px, 6vw, 104px); padding-bottom: clamp(48px, 5vw, 88px); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, max-content)); gap: 1.1em 3em; }
.facts .wide { grid-column: 1 / -1; }
.facts > div > span { display: block; }
.facts .label { margin-bottom: .35em; }
.facts > div > span:last-child { max-width: 22ch; }
.facts .label, .credits dt { display: block; font-size: calc(var(--fs) * .78); letter-spacing: .08em; text-transform: uppercase; opacity: .45; }
p.big { font-size: clamp(18px, 1.5vw, 26px); line-height: 1.25; letter-spacing: -0.015em; text-wrap: pretty; max-width: 22ch; margin: 0; }
.p-texts .lines { font-size: clamp(15px, 1.05vw, 17px); line-height: 1.5; max-width: 44ch; }
.p-texts .lines p { margin: 0; }
.p-texts .claim { margin-top: 1.4em; }
.p-texts .claim span { display: block; font-size: clamp(17px, 1.3vw, 21px); font-weight: 500; letter-spacing: -0.01em; }
.p-texts .claim small { display: block; margin-top: .3em; opacity: .5; }
.reveal { opacity: 0; transform: translate3d(0, 70px, 0); transition: opacity 1.1s var(--ease), transform 1.3s var(--ease); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* dos columnas */
.cols2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap) 2vw; max-width: 720px; margin-top: 2.2em; font-size: calc(var(--fs) * .95); line-height: 1.5; opacity: .7; }

/* 06 Foto grande + pequeña · 07 Trío */
.pair { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: var(--gap); align-items: end; }
.pair img, .trio img { display: block; width: 100%; height: auto; background: #111; }
.pair .side { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); margin-top: var(--gap); }
.duo img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: #111; }
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); margin-top: var(--gap); }
.trio img { aspect-ratio: 2 / 3; object-fit: cover; }

/* 10 Ancho completo */
.full { padding-left: 0; padding-right: 0; }
.full > .label { padding: 0 var(--side); }

/* ---------- Vídeos ---------- */
.vid { position: relative; background: #0b0b0b; overflow: hidden; }
.vid video { display: block; width: 100%; height: 100%; object-fit: cover; }
.vid .snd {
  position: absolute; right: 10px; bottom: 10px; z-index: 2;
  font-size: calc(var(--fs) * .85); padding: 7px 11px; border-radius: 999px;
  background: rgba(0,0,0,.45); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: #fff; display: inline-flex; align-items: center; gap: 6px; transition: background .25s;
}
.vid .snd::before { content: ""; width: 7px; height: 7px; border-radius: 50%; border: 1px solid currentColor; }
.vid .snd[aria-pressed="true"]::before { background: currentColor; }
/* sin rótulos sobre las imágenes: el botón de sonido solo aparece al pasar el cursor */
@media (hover: hover) {
  .vid .snd { opacity: 0; transition: opacity .3s, background .25s; }
  .vid:hover .snd, .vid .snd[aria-pressed="true"], .vid .snd:focus-visible { opacity: 1; }
  .vid .snd:hover { background: rgba(0,0,0,.7); }
}
.vid-grid { display: grid; gap: var(--gap); grid-template-columns: repeat(4, minmax(0, 1fr)); }
.vid-grid .vid { aspect-ratio: 9 / 16; }
.vid-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 1100px; margin: 0 auto; }
.vid-caption { margin-top: 10px; opacity: .55; font-size: calc(var(--fs) * .9); }
.vid-wide { aspect-ratio: 16 / 9; }

/* ---------- Lookbook ---------- */
.look { columns: 3; column-gap: var(--gap); }
.look img { display: block; width: 100%; height: auto; margin-bottom: var(--gap); break-inside: avoid; background: #111; }

/* ---------- Identidad: logo que gira + fotos ---------- */
.p-identity { position: relative; min-height: 88vh; overflow: hidden; background: #0d0d0d; }
.p-identity > .label { position: relative; z-index: 3; }
.logo-stage {
  position: absolute; left: 50%; top: 55%; z-index: 3;
  width: clamp(180px, 22vw, 360px); aspect-ratio: 1; translate: -50% -50%;
  perspective: 900px; display: grid; place-items: center;
}
.logo-stage button { width: 100%; height: 100%; display: grid; place-items: center; }
.logo-stage img { width: 100%; height: 100%; object-fit: contain; filter: invert(1); will-change: transform; user-select: none; -webkit-user-drag: none; }
.logo-hint { position: absolute; left: 50%; top: calc(55% + clamp(110px, 13vw, 210px)); translate: -50% 0; z-index: 3; opacity: .45; font-size: calc(var(--fs) * .9); white-space: nowrap; }
.scatter img { position: absolute; z-index: 1; width: var(--w, 16vw); height: auto; will-change: transform; transition: filter .4s; }

/* ---------- Pósters ---------- */
.strip-h {
  display: flex; gap: var(--gap); overflow-x: auto; scroll-snap-type: x proximity;
  padding: 0 var(--side) 8px; margin: 0 calc(var(--side) * -1); scrollbar-width: none; cursor: grab;
}
.strip-h::-webkit-scrollbar { display: none; }
.strip-h.dragging { cursor: grabbing; scroll-snap-type: none; }
.strip-h > * { flex: none; height: min(72vh, 680px); aspect-ratio: 595 / 842; scroll-snap-align: start; }
.strip-h img, .strip-h video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.strip-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: clamp(20px, 2.4vw, 40px); }

/* ---------- 02 Galería horizontal ----------
   La sección se queda fija y la fila se desliza hacia la izquierda mientras bajas.
   La altura de la sección la calcula project.js según lo larga que sea la fila. */
.hg { position: relative; }
.hg-pin { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; display: flex; align-items: center; }
.hg-track { display: flex; gap: 16px; align-items: stretch; height: 74vh; height: 74svh; padding: 0 var(--side); width: max-content; will-change: transform; }
.hg-item { position: relative; flex: none; height: 100%; background: #111; }
.hg-item > img, .hg-item > video { display: block; width: 100%; height: 100%; object-fit: cover; }
.hg-item.small { height: 58%; align-self: center; }
.hg-item.fit { background: none; }
.hg-item.fit > img { object-fit: contain; }
.hg-item.v9 { aspect-ratio: 9 / 16; }
.hg-item.p23 { aspect-ratio: 2 / 3; }
.hg-item.pa4 { aspect-ratio: 1 / 1.414; }
.hg-intro, .hg-text { background: none; display: flex; flex-direction: column; }
.hg-intro { width: min(33vw, 470px); margin-right: 3vw; gap: 1.5em; justify-content: flex-start; font-size: clamp(12px, 1.55vh, 14px); }
.hg-intro p.big { font-size: clamp(16px, 2.3vh, 22px); line-height: 1.28; max-width: 26ch; margin: 0; }
.hg-intro .ficha { margin: 0; }
.hg-intro .lines p { margin: 0; line-height: 1.5; }
.hg-intro .claim span { display: block; font-size: 1.25em; font-weight: 500; letter-spacing: -0.01em; }
.hg-intro .claim small { display: block; margin-top: .3em; opacity: .5; }
.hg-text { width: min(25vw, 340px); margin: 0 3vw; justify-content: flex-end; gap: 1em; font-size: calc(var(--fs) * .95); line-height: 1.5; opacity: .75; }
.hg-text p { margin: 0; }
.hg-bar { position: absolute; left: var(--side); right: var(--side); bottom: 5vh; height: 1px; background: rgba(255,255,255,.18); }
.hg-bar span { display: block; height: 100%; background: #fff; transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }

/* tablet vertical y móvil: columna normal, sin fila horizontal */
@media (max-width: 900px), (max-aspect-ratio: 3/4) {
  .hg { height: auto !important; }
  .hg-pin { position: static; height: auto; display: block; overflow: visible; }
  .hg-track { flex-direction: column; height: auto; width: auto; transform: none !important; gap: 10px; padding: clamp(48px, 10vw, 96px) var(--side); }
  .hg-item { height: auto; width: 100%; }
  .hg-item.small { width: 100%; align-self: auto; }
  .hg-intro, .hg-text { width: auto; margin: 0 0 8vw; font-size: var(--fs); }
  .hg-intro p.big { font-size: clamp(18px, 5vw, 24px); }
  .hg-text { margin: 8vw 0; }
  .hg-bar { display: none; }
}

/* ---------- 11 Créditos ---------- */
.credits { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8em 2vw; max-width: 760px; font-size: calc(var(--fs) * .95); line-height: 1.3; }
.credits .row { min-width: 0; }
.credits dt { margin-bottom: .1em; }

/* ---------- Siguiente proyecto ---------- */
.p-next { position: relative; display: block; height: 70vh; overflow: hidden; }
.p-next img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(.55); transition: transform 1.2s var(--ease), filter .6s; }
@media (hover: hover) { .p-next:hover img { transform: scale(1.04); filter: brightness(.7); } }
.p-next .txt { position: absolute; left: var(--side); right: var(--side); bottom: calc(var(--pad-y) * 2 + 40px); }
.p-next .display { font-size: clamp(44px, 8vw, 150px); display: block; margin-top: .15em; }
.p-foot { height: calc(var(--pad-y) * 2 + var(--fs) * 2); }

/* ---------- Tablet ---------- */
@media (max-width: 1024px) {
  .vid-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .credits { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .look { columns: 2; }
}
/* ---------- Móvil ---------- */
@media (max-width: 640px) {
  .split, .cols2, .pair { grid-template-columns: minmax(0, 1fr); }
  .split > span:empty { display: none; }
  .p-texts p.big { margin-bottom: 1.6em; max-width: 26ch; }
  .p-hero { --band: 50svh; }
  .p-body { margin-top: -50svh; }
  .duo { gap: 8px; margin-top: 8px; }
  .credits { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trio { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
  .pair .side { height: auto; }
  .p-hero-title .meta { text-align: left; }
  .vid-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .look { columns: 2; column-gap: 8px; } .look img { margin-bottom: 8px; }
  .p-identity { min-height: 0; display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .p-identity > .label { grid-column: 1 / -1; }
  .logo-stage { position: relative; left: auto; top: auto; translate: none; grid-column: 1 / -1; width: 62vw; margin: 6vw auto; }
  .logo-hint { position: static; translate: none; grid-column: 1 / -1; text-align: center; margin-bottom: 6vw; }
  .scatter { display: contents; }
  .scatter img { position: static; width: 100% !important; transform: none !important; }
  .strip-h > * { height: 62vh; }
  .p-section { padding-bottom: calc(clamp(64px, 9vw, 160px) + 20px); }
}

/* ---------- Móvil: el menú va arriba y abajo ----------
   el título de la portada se sube para no pisar "About · Work", y un fundido negro
   detrás del menú de abajo evita que los textos se crucen con él al hacer scroll */
@media (max-width: 640px) {
  .p-hero-title { bottom: calc(var(--pad-y) * 2 + var(--fs) + 14px + env(safe-area-inset-bottom)); }
  body::after { content: ""; position: fixed; left: 0; right: 0; z-index: 9; pointer-events: none; }
  body::after { bottom: 0; height: calc(var(--pad-y) * 2.6 + var(--fs) + env(safe-area-inset-bottom)); background: linear-gradient(rgba(0,0,0,0), #000 55%); }
}
