/* ==========================================================================
   Shot By AGPRODS
   Estructura y comportamiento al estilo de una productora: portada a
   pantalla completa con vídeo, tira de miniaturas, páginas de proyecto con
   el reproductor arriba y fotogramas debajo, pie de cuatro columnas.
   ========================================================================== */

:root {
  --negro: #000000;
  --blanco: #ffffff;
  --gris: #8c8c8c;
  --sans: "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "DM Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --pad: 10px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 20px;
  background: var(--negro);
  color: var(--blanco);
  -webkit-font-smoothing: antialiased;
}
body.claro { background: var(--blanco); color: var(--negro); }
body.sin-scroll { overflow: hidden; }

img, video, iframe { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

/* --- Pastillas (botones redondeados con borde) ------------------------- */

.pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 144px; height: 30px; padding: 4px 20px;
  border: 1px solid currentColor; border-radius: 20px;
  font: 400 14px/20px var(--sans); white-space: nowrap;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.pill:hover, .pill[aria-current="page"] { background: var(--blanco); color: var(--negro); border-color: var(--blanco); }
body.claro .pill:hover, body.claro .pill[aria-current="page"] { background: var(--negro); color: var(--blanco); border-color: var(--negro); }
.pill--sm { min-width: 0; height: 24px; padding: 2px 12px; font-size: 12px; }

/* --- Cabecera ------------------------------------------------------------ */

.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 1000;
  display: grid; grid-template-columns: 100px repeat(var(--enlaces, 3), minmax(0, 1fr));
  align-items: start;
  padding: calc(var(--pad) + env(safe-area-inset-top, 0px)) max(var(--pad), env(safe-area-inset-right, 0px)) var(--pad) max(var(--pad), env(safe-area-inset-left, 0px));
  pointer-events: none;
}
.nav > * { pointer-events: auto; }
.nav__logo { display: block; width: max-content; }
.nav__logo img { height: 36px; width: auto; }
body.claro .nav__logo img, .claro-logo { filter: invert(1); }
.nav__links { display: contents; }
.nav__links .pill { justify-self: end; }
.nav__menu { display: none; justify-self: end; grid-column: -1; min-width: 0; }

/* Menú a pantalla completa (móvil) */
.menu {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; flex-direction: column;
  background: var(--negro); color: var(--blanco);
  padding: calc(var(--pad) + env(safe-area-inset-top, 0px)) max(var(--pad), env(safe-area-inset-right, 0px)) max(24px, env(safe-area-inset-bottom, 0px)) max(var(--pad), env(safe-area-inset-left, 0px));
  overflow-y: auto;
}
.menu__top { display: flex; justify-content: space-between; align-items: start; }
.menu__top img { height: 36px; width: auto; }
.menu__links { margin-top: auto; display: grid; gap: 4px; padding-top: 40px; }
.menu__links > a { font: 500 44px/1.05 var(--sans); }
.menu__sub { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 4px 0 12px; font: 300 14px/20px var(--mono); color: var(--gris); }
.menu__sub a:hover { color: var(--blanco); }

/* --- Intro con el logo --------------------------------------------------- */

/* Cortinilla de entrada: el logo se abre desde el centro sobre la web, sin fondo */
.intro {
  position: fixed; inset: 0; z-index: 3000;
  display: grid; place-items: center; background: transparent;
  transition: opacity .5s ease;
}
.intro.fuera { opacity: 0; pointer-events: none; }
.intro__logo {
  width: clamp(230px, 30vw, 430px); max-width: 100%;
  filter: drop-shadow(0 2px 16px rgba(0,0,0,.55));
}
.intro__logo img {
  width: 100%; height: auto;
  clip-path: inset(0 50% 0 50%); opacity: 0;
  animation: abre 1.1s cubic-bezier(.65, 0, .35, 1) .3s forwards;
}
@keyframes abre {
  0%   { clip-path: inset(0 50% 0 50%); opacity: 0; }
  35%  { opacity: 1; }
  100% { clip-path: inset(0 0 0 0); opacity: 1; }
}
/* mientras sale el logo, la cabecera y la tira esperan */
.nav, .strip, .home-m .info, .home-m .num, .home-m .desliza { transition: opacity .6s ease; }
body.intro-on .nav, body.intro-on .strip,
body.intro-on .home-m .info, body.intro-on .home-m .num, body.intro-on .home-m .desliza { opacity: 0; }

/* --- Inicio (escritorio) -------------------------------------------------- */

.home { position: fixed; inset: 0; overflow: hidden; background: var(--negro); }
.home__stage { position: absolute; inset: 0; }
.home::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 140px; z-index: 4; pointer-events: none;
  background: linear-gradient(rgba(0,0,0,.35), rgba(0,0,0,0));
}
.home__stage video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity .25s ease;
}
.home__stage video.on { opacity: 1; }
.home__stage video.sin-clip { transform-origin: 50% 45%; }
.home__stage video.sin-clip.on { animation: acercar 9s ease-out forwards; }
@keyframes acercar { from { transform: scale(1); } to { transform: scale(1.08); } }

.home__info {
  position: absolute; left: 0; right: 0; top: 50%; z-index: 5;
  transform: translateY(-62%);
  display: flex; flex-direction: column; align-items: center; gap: 22px;
  padding: 0 40px; text-align: center;
  pointer-events: none; opacity: 0; transition: opacity .2s ease;
}
.home__info.on { opacity: 1; }
.home__info.on a { pointer-events: auto; }
.home__title {
  font: 700 clamp(44px, 7vw, 100px)/1 var(--sans);
  text-transform: uppercase; opacity: .75; max-width: 1100px;
  text-wrap: balance;
}
.home__meta { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.home__meta .pill--sm { min-width: 0; }

.strip {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 6;
  display: flex;
}
.strip__item { position: relative; flex: 1 1 0; min-width: 0; display: block; }
.strip__num {
  position: absolute; left: 6px; top: -22px;
  font: 400 10px/12px var(--sans); color: var(--blanco);
  opacity: 0; transition: opacity .15s ease;
}
.strip__item:hover .strip__num, .strip__item:focus-visible .strip__num, .strip__item.on .strip__num { opacity: 1; }
.strip__img { display: block; width: 100%; height: 76px; object-fit: cover; }
.strip__item::after {
  content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.25);
  transition: background-color .15s ease; pointer-events: none;
}
.strip__item:hover::after, .strip__item.on::after { background: rgba(0,0,0,0); }

/* --- Inicio (móvil): una pantalla por trabajo ---------------------------- */

.home-m { display: none; }

/* --- Trabajos y Sobre mí --------------------------------------------------- */

.work-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px;
  padding: 200px 14px 30px;
}
.titulo-pagina { font: 500 clamp(56px, 6.7vw, 96px)/1.2 var(--sans); text-transform: uppercase; letter-spacing: -.01em; }
.vacio { padding: 40px 0 120px; font: 300 14px/20px var(--mono); text-transform: none; letter-spacing: 0; }

/* Índice: todos los títulos en grande; al pasar por uno, su clip de fondo */
.indice {
  --tinta: #f2efe9; --apagado: #b9b5ae; --margen: clamp(14px, 2.8vw, 40px);
  position: fixed; inset: 0; overflow: hidden; background: var(--negro); color: var(--tinta);
}
.indice__fondo { position: absolute; inset: 0; }
.indice__fondo > * {
  position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover;
  opacity: 0; transition: opacity .45s ease;
}
.indice__fondo > .on { opacity: 1; }
/* vídeos verticales: enteros, sobre una copia desenfocada en vez de barras negras */
.capa-vertical { overflow: hidden; background: var(--negro); }
.capa-vertical > * { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: contain; }
.capa-vertical > .relleno { object-fit: cover; filter: blur(36px) brightness(.6); transform: scale(1.15); }
.indice__fondo > .sin-clip { transform-origin: 50% 45%; }
.indice__fondo > .sin-clip.on { animation: acercar 9s ease-out forwards; }
.indice::after { content: ""; position: absolute; inset: 0; z-index: 1; background: rgba(0,0,0,.45); pointer-events: none; }

.indice__cuerpo {
  position: absolute; z-index: 2; left: var(--margen); right: var(--margen); top: 104px; bottom: 76px;
  display: flex; flex-direction: column; justify-content: center; gap: 20px;
}
.indice__cabeza, .indice__pie { font: 400 12px/16px var(--mono); letter-spacing: .07em; text-transform: uppercase; }
.indice__cabeza { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 24px; color: var(--apagado); }
.indice__cabeza h1 { font: inherit; }
.indice__filtros { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.indice__filtros a:hover, .indice__filtros a[aria-current="true"] { color: var(--tinta); }
.indice__filtros a[aria-current="true"] { text-decoration: underline; text-underline-offset: 4px; }

.indice__lista {
  flex: 0 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: none;
  font-family: "Archivo", var(--sans); font-weight: 700; font-stretch: 62%;
  font-size: clamp(32px, min(5.3vw, 8.6vh), 84px); line-height: .98; letter-spacing: -.005em;
  text-transform: uppercase;
}
.indice__lista::-webkit-scrollbar { display: none; }
.ix { transition: color .25s ease; }
.ix sup { font: 400 11px/1 var(--mono); letter-spacing: 0; vertical-align: top; margin-left: 4px; }
.ix-sep { color: rgba(242,239,233,.3); font-weight: 300; }
.indice__lista.activa .ix { color: rgba(242,239,233,.38); }
.indice__lista.activa .ix.on { color: var(--tinta); }

.indice__pie {
  position: absolute; z-index: 2; left: var(--margen); right: var(--margen); bottom: 0;
  padding-bottom: max(26px, env(safe-area-inset-bottom, 0px));
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 32px;
}
.indice__pie .gris { color: var(--apagado); }
.indice__pie .ver { margin-left: auto; }
.indice__pie a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* en escritorio el índice ocupa la pantalla entera */
.indice-m { display: none; }
@media (min-width: 768px) {
  body[data-page="trabajos"] { overflow: hidden; }
  body[data-page="trabajos"] .pie { display: none; }
}

/* --- Proyecto ------------------------------------------------------------ */

.player { display: grid; place-items: center; background: var(--negro); }
.player__box {
  position: relative; width: min(100vw, calc(100vh * var(--r, 1.7778)));
  aspect-ratio: var(--r, 1.7778); max-width: 100%;
  background: #0d0d0d;
}
.player__box iframe, .player__box video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.ficha {
  display: grid; justify-items: center; gap: 10px;
  padding: 44px 20px 48px; text-align: center;
  font: 300 12px/18px var(--mono); letter-spacing: .2em; text-transform: uppercase;
}
.ficha__datos { color: var(--gris); letter-spacing: .12em; }
.fotos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fotos img { width: 100%; height: auto; }
.fotos .ancha { grid-column: 1 / -1; }
.fotos.vertical { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.siguiente { display: grid; justify-items: center; gap: 10px; padding: 70px 20px 90px; text-align: center; }
.siguiente__label { font: 300 12px/18px var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--gris); }
.siguiente__titulo { font: 700 clamp(30px, 4.5vw, 64px)/1 var(--sans); text-transform: uppercase; opacity: .85; }
.siguiente a:hover .siguiente__titulo { opacity: 1; }

/* --- Sobre mí ------------------------------------------------------------ */

.sobre {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px;
  padding: 10px 20px 140px;
  font: 300 14px/20px var(--mono);
}
.sobre__bio { grid-column: span 2; display: grid; gap: 14px; font: 400 20px/1.45 var(--sans); max-width: 40em; }
.sobre__bio p + p { color: #555; }

/* --- Columnas (pie y contacto) ------------------------------------------- */

.cols {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px;
  font: 300 14px/25px var(--mono);
}
.col__label { display: block; border-bottom: 1px solid currentColor; padding-bottom: 1px; margin-bottom: 0; }
.col a { display: block; }
.col a:hover { text-decoration: underline; text-underline-offset: 3px; }
.col p { display: block; }
.col__texto { padding-top: 5px; line-height: 21px; }
.col + .col { min-width: 0; }

.pie { background: var(--blanco); color: var(--negro); padding: 40px 20px 10px; }
.pie__fin {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px;
  margin-top: 140px;
}
.pie__fin img { height: 40px; width: auto; filter: invert(1); }
.pie__grande { font: 300 clamp(20px, 3.4vw, 48px)/1 var(--mono); text-align: right; overflow-wrap: anywhere; }

/* --- Contacto ------------------------------------------------------------ */

.contacto { position: relative; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; background: var(--negro); color: var(--blanco); overflow: hidden; }
.contacto .cols { padding: 358px 10px 0; }
.contacto__fin { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 40px 10px 10px 0; }
.contacto__titulo { font: 500 clamp(64px, 12.5vw, 180px)/1 var(--sans); text-transform: uppercase; letter-spacing: -.02em; margin-left: -.03em; }
.contacto__logo { height: clamp(70px, 12vw, 170px); width: auto; }

/* --- Móvil --------------------------------------------------------------- */

@media (max-width: 767px) {
  .nav { grid-template-columns: 1fr auto; }
  .nav__links { display: none; }
  .nav__menu { display: inline-flex; grid-column: 2; }
  .nav__logo img { height: 32px; }

  .home { display: none; }
  /* una pantalla por trabajo, se pasa deslizando a izquierda y derecha */
  .home-m {
    display: flex; height: 100vh; height: 100svh;
    overflow-x: auto; overflow-y: hidden;
    scroll-snap-type: x mandatory; overscroll-behavior: contain;
    touch-action: pan-x; scrollbar-width: none;
  }
  .home-m::-webkit-scrollbar { display: none; }
  .home-m section::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 140px; z-index: 1; pointer-events: none; background: linear-gradient(rgba(0,0,0,.4), rgba(0,0,0,0)); }
  .home-m .info, .home-m .num, .home-m .desliza { z-index: 2; }
  .home-m section { position: relative; flex: 0 0 100%; width: 100%; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; overflow: hidden; background: #111; }
  .home-m .desliza { position: absolute; left: 0; right: 0; bottom: max(18px, env(safe-area-inset-bottom, 0px)); text-align: center; font: 300 12px/1 var(--mono); opacity: .85; }
  .home-m video, .home-m .poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
  .home-m .info {
    position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%);
    display: grid; justify-items: center; gap: 16px; padding: 0 20px; text-align: center;
  }
  .home-m .info h2 { font: 700 38px/1.02 var(--sans); text-transform: uppercase; opacity: .85; text-wrap: balance; }
  .home-m .num { position: absolute; left: 12px; bottom: max(14px, env(safe-area-inset-bottom, 0px)); font: 300 12px/1 var(--mono); }

  .work-head { padding-top: 130px; }

  /* Trabajos en móvil: lista; al tocar un título se abre con su clip y fotogramas */
  .indice { display: none; }
  body[data-page="trabajos"] .nav { background: linear-gradient(var(--negro) 45%, rgba(0,0,0,0)); padding-bottom: 22px; }
  .indice-m {
    display: block; min-height: 100vh; min-height: 100svh;
    padding: calc(84px + env(safe-area-inset-top, 0px)) 20px 56px;
    background: var(--negro); color: #f2efe9;
  }
  .indice-m__cabeza, .indice-m__filtros, .im__datos { font: 400 11px/16px var(--mono); letter-spacing: .07em; text-transform: uppercase; color: #b9b5ae; }
  .indice-m__cabeza { display: flex; justify-content: space-between; gap: 12px; }
  .indice-m__cabeza h1 { font: inherit; }
  .indice-m__filtros { display: flex; flex-wrap: wrap; gap: 0 18px; margin: 4px 0 10px; }
  .indice-m__filtros a { padding: 10px 0; }
  .indice-m__filtros a[aria-current="true"] { color: #f2efe9; text-decoration: underline; text-underline-offset: 4px; }
  .im { border-top: 1px solid rgba(242,239,233,.16); scroll-margin-top: 76px; }
  .im__fila { width: 100%; min-height: 44px; display: flex; align-items: baseline; gap: 12px; padding: 14px 0 12px; text-align: left; color: #f2efe9; }
  .im__num { flex: none; width: 22px; font: 400 11px/1 var(--mono); color: #b9b5ae; }
  .im__nombre {
    flex: 1; min-width: 0;
    font-family: "Archivo", var(--sans); font-weight: 700; font-stretch: 62%;
    font-size: 34px; line-height: .95; text-transform: uppercase; overflow-wrap: anywhere;
  }
  .im.abierta .im__nombre { color: var(--blanco); }
  .im__panel { padding: 2px 0 18px; }
  .im__fotos {
    display: flex; gap: 8px; margin: 0 -20px; padding: 0 20px 14px;
    overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none;
  }
  .im__fotos::-webkit-scrollbar { display: none; }
  .im__fotos > * {
    flex: 0 0 82%; width: 82%; max-width: none; aspect-ratio: 16 / 9; height: auto; object-fit: cover;
    scroll-snap-align: start; scroll-margin-left: 20px; background: #111;
  }
  .im__fotos.una > * { flex-basis: 100%; width: 100%; }
  .im__fotos.vertical > * { flex-basis: 46%; width: 46%; aspect-ratio: 9 / 16; }
  .im__datos { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 16px; }
  .im__datos a { margin-left: auto; padding: 10px 0; color: #f2efe9; }

  .fotos, .fotos.vertical { grid-template-columns: minmax(0, 1fr); }

  .sobre { grid-template-columns: minmax(0, 1fr); padding-bottom: 80px; }
  .sobre__bio { grid-column: auto; font-size: 18px; }

  .cols { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 28px; }
  .pie__fin { flex-direction: column-reverse; align-items: flex-start; margin-top: 70px; }
  .pie__grande { text-align: left; }
  .contacto .cols { padding-top: 120px; }
  .contacto__fin { flex-direction: column-reverse; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .intro { display: none; }
}
