/* Layout: proyección de galería — campo negro continuo, nav de 4 grupos, módulos de imagen a sangre separados 72px, rótulos blancos sobre la foto */
:root {
  --gallery-black: #000000;
  --projection-white: #ffffff;
  --index-gray: #999999;
  --scrim: rgba(0,0,0,0.0);
  --font-label: 'Inter', ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Bodoni Moda', 'Didot', 'Bodoni 72', Georgia, serif;
  --font-mark: 'Inter Tight', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --label-size: 14px;
  --label-lh: 1.3;
  --label-track: 0.84px;
  --s15: 15px; --s20: 20px; --s25: 25px; --s72: 72px; --s144: 144px;
  --radius-media: 15px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { background: var(--gallery-black); color: var(--projection-white); }
body {
  margin: 0;
  font-family: var(--font-label);
  font-size: var(--label-size);
  line-height: var(--label-lh);
  letter-spacing: var(--label-track);
  -webkit-font-smoothing: antialiased;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--gallery-black); }
.label { text-transform: uppercase; font-weight: 400; font-size: var(--label-size); letter-spacing: var(--label-track); line-height: var(--label-lh); }
.muted { color: var(--index-gray); }
a { color: inherit; text-decoration: none; }
button { font: inherit; letter-spacing: inherit; color: inherit; background: transparent; border: 0; padding: 0; cursor: pointer; text-transform: uppercase; }
:focus-visible { outline: 1px solid var(--projection-white); outline-offset: 4px; }

/* Nav */
.nav {
  position: fixed; top: env(safe-area-inset-top, 0px); left: 0; right: 0; z-index: 7;
  background: transparent;
  min-height: 48px;
  display: grid; grid-template-columns: repeat(4, 1fr); align-items: center;
  padding-block: var(--s15);
  padding-left: max(var(--s25), env(safe-area-inset-left, 0px));
  padding-right: max(var(--s25), env(safe-area-inset-right, 0px));
}
.nav > :nth-child(2) { text-align: left; }
.nav > :nth-child(3) { text-align: right; }
.nav > :last-child { text-align: right; }
.nav a, .filters button { position: relative; padding-bottom: 2px; }
.nav a.active::after, .filters button[aria-pressed="true"]::after,
.nav a:hover::after, .filters button:hover::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px; background: var(--projection-white);
}

.gutter {
  padding-left: max(var(--s25), env(safe-area-inset-left, 0px));
  padding-right: max(var(--s25), env(safe-area-inset-right, 0px));
}

/* Apertura */
/* Foto de apertura fija detrás de todo: al scrollear hace zoom 1 → 1.2 y se funde a negro */
.intro { height: 100vh; height: 100svh; }
.hero-bg { position: fixed; inset: 0; z-index: 0; will-change: transform, opacity; transform-origin: 50% 50%; }
.hero-bg canvas { position: absolute; inset: 0; width: 100%; height: 100%; filter: grayscale(1) contrast(1.1); }
.hero-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0) 45%, rgba(0,0,0,.85) 100%); }

/* Marca que se achica y queda fija al scrollear */
.stage { position: relative; z-index: 1; }
.set { display: grid; gap: 20px; }
.set .single .tile { border-radius: var(--radius-media); }
footer { position: relative; z-index: 1; background: var(--gallery-black); }
.mark {
  position: sticky; top: calc(env(safe-area-inset-top, 0px) + 6px); z-index: 6;
  height: 0; overflow: visible; display: flex; justify-content: center; pointer-events: none;
}
.mark-inner { display: grid; justify-items: center; gap: 10px; transform-origin: 50% 0; will-change: transform; }
.mark-word {
  font-family: var(--font-mark); font-weight: 400; text-transform: lowercase;
  font-size: clamp(64px, 12.5vw, 200px); line-height: .8; letter-spacing: -0.075em;
  margin: 0; white-space: nowrap; pointer-events: auto; text-align: center;
}
.mark-word a { display: grid; justify-items: center; }
.tile-num { position: absolute; inset: 0; display: grid; place-items: center; z-index: 1; pointer-events: none; font-family: var(--font-mark); font-size: clamp(40px, 7vw, 96px); letter-spacing: -0.04em; color: rgba(255,255,255,.85); }
.wordmark {
  font-family: var(--font-display); font-weight: 400; margin: 0;
  font-size: clamp(64px, 17vw, 240px); line-height: .82; letter-spacing: -0.02em;
  font-optical-sizing: auto;
}
.wordmark span { display: block; }
.wordmark span:last-child { font-style: italic; padding-left: .5em; }

/* Filtros */
.filters { display: flex; flex-wrap: wrap; gap: var(--s15) var(--s25); padding-block: var(--s72) 0; }

/* Módulos */
main { display: grid; gap: var(--s72); padding-block: var(--s72) var(--s144); }
.module { display: grid; gap: var(--s20); }
.module-head { display: flex; justify-content: space-between; gap: var(--s20); flex-wrap: wrap; }
.pair {
  position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  border-radius: var(--radius-media); overflow: hidden;
}
.pair .tile { aspect-ratio: 4 / 5; }
.single .tile { aspect-ratio: 16 / 9; }
.trio { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 6px; }
.trio .tile { aspect-ratio: 3 / 4; }
.tile { position: relative; width: 100%; max-width: 100%; overflow: hidden; background: #111; }
.tile canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; transition: transform .9s cubic-bezier(.2,.7,.2,1); }
.tile:hover canvas { transform: scale(1.025); }
.caption { position: absolute; left: var(--s20); bottom: var(--s20); right: var(--s20); display: flex; justify-content: space-between; gap: var(--s15); z-index: 1; }
.caption .ph { color: var(--index-gray); }
.pair .tile:first-child .caption { top: 50%; bottom: auto; right: auto; transform: translateY(-50%); flex-direction: column; gap: 4px; }
.pair .tile:nth-child(2) .caption { top: 50%; bottom: auto; left: auto; transform: translateY(-50%); flex-direction: column; gap: 4px; text-align: right; }
.overlay-lockup { position: absolute; z-index: 2; top: var(--s72); left: 0; right: 0; display: grid; gap: var(--s15); justify-items: center; text-align: center; pointer-events: none; }
.overlay-lockup .wordmark { font-size: clamp(48px, 10vw, 140px); }

/* Sobre / contacto */
.about { display: grid; grid-template-columns: 1fr 2fr; gap: var(--s25); padding-top: var(--s72); }
.about p { margin: 0; max-width: 62ch; text-transform: none; letter-spacing: .2px; font-size: 16px; line-height: 1.6; }
.about dl { margin: var(--s25) 0 0; display: grid; grid-template-columns: max-content 1fr; gap: 8px var(--s25); }
.about dt { color: var(--index-gray); }
.about dd { margin: 0; }
.contact-line { display: flex; flex-wrap: wrap; gap: var(--s15) var(--s25); align-items: baseline; margin-top: var(--s25); }
.contact-line .mail { font-family: var(--font-display); font-size: clamp(28px, 5vw, 56px); text-transform: none; letter-spacing: -0.01em; user-select: all; }
footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--s15); padding-block: var(--s25); border-top: 1px solid #1f1f1f; }

@media (max-width: 760px) {
  .nav { grid-template-columns: 1fr 1fr; row-gap: 8px; }
  .nav > :nth-child(3) { text-align: left; }
  .nav > :nth-child(2) { text-align: right; }
  .nav > :last-child { text-align: right; }
  .mark { top: calc(env(safe-area-inset-top, 0px) + 84px); }
  .pair { grid-template-columns: 1fr 1fr; }
  .trio { grid-template-columns: 1fr 1fr; }
  .trio .tile:first-child { grid-column: 1 / -1; aspect-ratio: 4 / 3; }
  .about { grid-template-columns: 1fr; }
  .overlay-lockup { top: var(--s25); }
}
@media (max-width: 460px) {
  .pair .caption .ph { display: none; }
}
@media (prefers-reduced-motion: reduce) { .tile canvas { transition: none; } }

/* Desplegable de categorías */
.cats { position: relative; display: inline-block; }
.cats summary { list-style: none; cursor: pointer; position: relative; padding-bottom: 2px; display: inline-block; }
.cats summary::-webkit-details-marker { display: none; }
.cats summary:hover::after, .cats[open] summary::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px; background: var(--projection-white); }
.cats ul { list-style: none; margin: 0; padding: 12px 0 0; display: grid; gap: 8px; position: absolute; left: 0; top: 100%; }
.cats ul a { white-space: nowrap; }
.nav a.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px; background: var(--projection-white); }

/* Páginas internas */
.mark-small { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 6px); left: 0; right: 0; z-index: 6; display: flex; justify-content: center; pointer-events: none; }
.mark-small .mark-word { font-size: 72px; }
@media (max-width: 760px) { .mark-small { top: calc(env(safe-area-inset-top, 0px) + 84px); } .mark-small .mark-word { font-size: 48px; } }
.page { position: relative; padding-top: 200px; padding-bottom: var(--s72); min-height: 100vh; }
.portrait { position: relative; width: min(520px, 100%); aspect-ratio: 4 / 5; margin: 0 auto; overflow: hidden; background: #111; }
.portrait canvas { position: absolute; inset: 0; width: 100%; height: 100%; filter: grayscale(1) contrast(1.1); }
.big-mail { position: absolute; left: 0; right: 0; top: calc(200px + min(520px, 100vw) * 0.22); text-align: center; z-index: 2;
  font-family: var(--font-mark); font-size: clamp(36px, 8.4vw, 150px); line-height: 1; letter-spacing: -0.06em; text-transform: none; white-space: nowrap; }
.big-mail:hover { opacity: .85; }
.studio { text-align: center; margin-top: var(--s25); display: grid; gap: 4px; }
.info { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) 2fr; gap: var(--s25); margin-top: var(--s144); align-items: start; }
.info h2 { font: inherit; margin: 0 0 var(--s15); }
.info p { margin: 0; }
.info a { text-decoration: underline; text-underline-offset: 3px; }
.bio p { text-transform: none; letter-spacing: .2px; font-size: 15px; line-height: 1.55; margin: 0 0 1em; max-width: 62ch; }
.about-page { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s72); align-items: start; }
.about-page .portrait { margin: 0; width: 100%; }
.about-page h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(36px, 5vw, 72px); line-height: 1; letter-spacing: -0.01em; margin: 0 0 var(--s25); text-transform: none; }
.about-page dl { margin: var(--s25) 0 0; display: grid; grid-template-columns: max-content 1fr; gap: 8px var(--s25); }
.about-page dt { color: var(--index-gray); }
.about-page dd { margin: 0; }
@media (max-width: 760px) {
  .page { padding-top: 160px; }
  .big-mail { top: calc(160px + 100vw * 0.3); }
  .info { grid-template-columns: 1fr 1fr; margin-top: var(--s72); }
  .info .bio { grid-column: 1 / -1; }
  .about-page { grid-template-columns: 1fr; gap: var(--s25); }
}

/* Subrayado solo del ancho del texto */
.nav > :nth-child(1), .nav > :nth-child(2) { justify-self: start; }
.nav > :nth-child(3), .nav > :nth-child(4) { justify-self: end; }
@media (max-width: 760px) {
  .nav > :nth-child(3) { justify-self: start; }
  .nav > :nth-child(2) { justify-self: end; }
  .cats ul { left: auto; right: 0; text-align: right; }
}

/* Fotos reales */
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .9s cubic-bezier(.2,.7,.2,1); }
@media (prefers-reduced-motion: reduce) { .tile img { transition: none; } }

/* Menú y marca legibles sobre fotos claras */

/* Zoom al scrollear */
.set > .pair, .set > .single { transform-origin: 50% 50%; will-change: transform; }
.single .tile .caption { top: 50%; bottom: auto; right: auto; transform: translateY(-50%); }
.tile img { transition: none; will-change: transform; }

/* Fotos con link a su sesión */
a.tile { display: block; cursor: pointer; }

/* Página de sesión */
.session { padding-bottom: var(--s144); }
.session-head { display: flex; justify-content: space-between; gap: var(--s20); margin-bottom: var(--s25); }
.session .set { gap: 20px; }
.session .single.hero.portrait { width: min(720px, 100%); margin: 0 auto var(--s72); }
.session .single.hero.portrait .tile { aspect-ratio: 4 / 5; }
.session .single.hero:not(.portrait) { margin-bottom: var(--s72); }
.session-nav { display: flex; justify-content: space-between; margin-top: var(--s72); }
.session-nav a:hover, .session-head a:hover { color: var(--projection-white); text-decoration: underline; text-underline-offset: 3px; }

/* Foto de inicio a pantalla completa */
.hero-bg img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; max-width: none; }
.hero-bg::after { background: linear-gradient(180deg, rgba(0,0,0,.25) 0%, rgba(0,0,0,0) 30%, rgba(0,0,0,0) 55%, rgba(0,0,0,.6) 100%); }
.mark-word { font-size: clamp(64px, min(12.5vw, 24vh), 200px); }

/* Marca y menú siempre blancos; sombra suave para leerse sobre fotos claras */
.nav, .mark-word { text-shadow: 0 0 18px rgba(0,0,0,.28); }

@media (max-width: 760px) {
  /* Fotos casi a sangre, como la referencia */
  main.gutter, .session.gutter { padding-left: 0; padding-right: 0; }
  .module-head, .session-head, .session-nav { padding-left: max(var(--s25), env(safe-area-inset-left, 0px)); padding-right: max(var(--s25), env(safe-area-inset-right, 0px)); }
  .pair { gap: 10px; border-radius: 0; overflow: visible; }
  .pair .tile, .single .tile { border-radius: 12px; }
  .set { gap: 10px; }
  .session .single.hero.portrait { width: 100%; }

  /* Categorías: panel debajo del menú, sin pisar "Contacto" */
  .cats ul { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 70px); left: 0; right: 0; padding: 40px max(var(--s25), env(safe-area-inset-right, 0px)) 22px; background: var(--gallery-black); text-align: right; gap: 14px; border-bottom: 1px solid #1f1f1f; z-index: 20; }
}

/* Sesión: fotos en su proporción original */
.session .single.vert { width: min(720px, 100%); margin: 0 auto; }

/* Ampliar fotos en las sesiones */
.tile.zoomable { cursor: zoom-in; }
.lb { position: fixed; inset: 0; z-index: 100; background: #000; display: grid; place-items: center; padding: 56px 16px; }
.lb[hidden] { display: none; }
.lb-img { max-width: 100%; max-height: calc(100vh - 112px); max-height: calc(100svh - 112px); width: auto; height: auto; object-fit: contain; display: block; user-select: none; }
.lb-btn { position: absolute; color: var(--projection-white); padding: 10px; text-shadow: 0 0 12px rgba(0,0,0,.5); }
.lb-close { top: 12px; right: max(var(--s25), env(safe-area-inset-right, 0px)); }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); font-size: 28px; padding: 16px; }
.lb-prev { left: 8px; } .lb-next { right: 8px; }
.lb-count { position: absolute; top: 22px; left: max(var(--s25), env(safe-area-inset-left, 0px)); color: var(--index-gray); }
.lb-btn:hover { opacity: .7; }
@media (max-width: 760px) { .lb-prev, .lb-next { top: auto; bottom: 8px; transform: none; } }

/* Selección / popurrí: mosaico en columnas */
.session .set.mosaic { display: block; columns: 3; column-gap: 20px; }
.session .set.mosaic .tile { aspect-ratio: auto; margin: 0 0 20px; break-inside: avoid; border-radius: var(--radius-media); }
.session .set.mosaic .tile img { position: static; width: 100%; height: auto; display: block; }
.module-head a:hover { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 760px) { .session .set.mosaic { columns: 2; column-gap: 10px; padding: 0 10px; } .session .set.mosaic .tile { margin-bottom: 10px; border-radius: 10px; } }
