/* ============================================================
   ESTILOS. Secciones: 1 Variables · 2 Base · 3 Efectos
   4 Portada · 5 Proyecto · 6 Pie y visor · 7 Móvil
   ============================================================ */

/* 1. VARIABLES: cambiá colores y ancho acá */
:root {
  --fondo: #0f1012;
  --texto: #ece6da;          /* blanco cálido, como luz de tungsteno */
  --tenue: #8f8b84;
  --linea: #2a2b2f;
  --acento: #d7f268;
  --luz: 255, 232, 190;      /* color del foco que sigue al cursor (RGB) */
  --fuente: 'Bricolage Grotesque', system-ui, sans-serif;
  --ancho: 1180px;
}

/* 2. BASE */
* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; }
body { background: var(--fondo); color: var(--texto); font: 300 1.05rem/1.65 var(--fuente); }
a { color: inherit; text-decoration: none; }
a:focus-visible, video:focus-visible { outline: 2px solid var(--texto); outline-offset: 4px; }
main { max-width: var(--ancho); margin: 0 auto; padding: 0 clamp(1.2rem, 4vw, 3rem); }
h1, h2, h3 { font-weight: 500; line-height: 1.05; letter-spacing: -0.02em; }
img, video { display: block; width: 100%; }
.error { padding: 4rem 0; color: var(--tenue); }

/* 3. EFECTOS */
#progreso { position: fixed; inset: 0 0 auto 0; height: 2px; background: var(--texto);
  transform: scaleX(0); transform-origin: left; z-index: 10; }

#luz { position: fixed; inset: 0; pointer-events: none; z-index: 5; opacity: 0; transition: opacity .6s; }
#luz.activa { opacity: 1;
  background: radial-gradient(circle 320px at var(--x, 50%) var(--y, 30%), rgba(var(--luz), .09), transparent 70%); }

/* Las imágenes siempre son visibles, incluso si falla el observador. */
.js .medio.on { animation: revelar .65s ease both; }
@keyframes revelar { from { opacity: .7; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .js .medio.on { animation: none; } html { scroll-behavior: auto; } }

/* 4. PORTADA */
.cabecera { padding: 1.5rem 0; }
.navegacion { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; width: 100%; font-size: .95rem; }
.enlaces-contacto { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: clamp(1rem, 3vw, 2rem); }
.navegacion a { display: inline-block; padding: .5rem 0; text-underline-offset: .3em; }
.navegacion > a { flex-shrink: 0; font-size: 1.1rem; font-weight: 500; text-decoration: underline; text-decoration-color: var(--acento); text-decoration-thickness: 2px; text-underline-offset: .4em; }
.navegacion a:hover { color: var(--acento); text-decoration: underline; }
.hero { padding: 1.5rem 0 2rem; }
.hero { position: relative; isolation: isolate; }
.trama { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.hero h1 { font-size: clamp(2.6rem, 6.7vw, 5.2rem); font-weight: 400; }
.hero > p:last-child { max-width: 58ch; margin-top: 1rem; color: var(--tenue); font-size: 1.1rem; }
.seccion-titulo { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; padding: 1rem 0 1.5rem; }
.seccion-titulo h2 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); font-weight: 400; line-height: 1.15; }
.filas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.5rem 1.5rem; padding-bottom: 4rem; }
.fila { min-width: 0; }
.fila-texto { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding-top: .9rem; }
.fila h2 { font-size: clamp(1.05rem, 1.8vw, 1.4rem); line-height: 1.25; transition: color .2s; }
.fila .anio { color: var(--tenue); font-size: .85rem; }
.fila:hover h2, .fila:focus-visible h2 { color: var(--acento); }
.fila-img { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #1b1d20; }
.fila-img img { height: 100%; object-fit: cover; transition: transform .5s; }
.preview-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; pointer-events: none; transition: opacity .35s ease; }
.preview-video.reproduciendo { opacity: 1; }
.fila:hover img, .fila:focus-visible img { transform: scale(1.035); }
.sin-portada { display: flex; align-items: flex-end; height: 100%; padding: 1.5rem; background: radial-gradient(ellipse at bottom right, #38402a, transparent 75%); }
.sin-portada > span { max-width: 14ch; font-size: clamp(1.5rem, 3vw, 2.5rem); line-height: 1.1; }
.info { min-height: 65vh; }
.info-retrato { position: relative; display: grid; margin: 2rem 0; max-width: 720px; overflow: hidden; background: #17181b; }
.info-retrato img { grid-area: 1 / 1; align-self: start; width: 100%; height: auto; transition: filter .6s ease; }
.info-retrato figcaption { grid-area: 1 / 1; z-index: 1; display: flex; align-items: flex-end; padding: clamp(1.25rem, 4vw, 2.5rem); background: linear-gradient(transparent 15%, rgba(0,0,0,.85)); transition: background-color .6s; }
.info-retrato figcaption p { max-width: 25ch; font-size: clamp(1.35rem, 3vw, 2.4rem); line-height: 1.25; color: #fff; text-wrap: balance; }
.info-retrato:hover img, .info-retrato:focus img { filter: blur(7px) brightness(.6); }
.info-retrato:focus-visible { outline: 2px solid var(--acento); outline-offset: 4px; }
.info-retrato:hover figcaption, .info-retrato:focus figcaption { background-color: rgba(0,0,0,.2); }
.info-texto { max-width: 62ch; color: var(--tenue); font-size: 1rem; }
.info-texto p + p { margin-top: 1.4em; }
.info-areas { margin-top: 4rem; padding-top: 2rem; }
.areas-cabecera { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 1.5rem; }
.info-areas h2 { font-size: clamp(1.6rem, 3vw, 2.5rem); font-weight: 400; }
.areas-carrusel:focus-visible { outline: 2px solid var(--acento); outline-offset: 4px; }
.areas-carrusel { display: grid; grid-auto-flow: column; grid-auto-columns: clamp(240px, 28vw, 300px); gap: 24px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: var(--tenue) transparent; padding-bottom: 1rem; }
.areas-carrusel.desplazando { scroll-snap-type: none; }
.area-card { position: relative; display: grid; aspect-ratio: 1; scroll-snap-align: start; background: #1b1d20; overflow: hidden; }
.area-card > img { grid-area: 1 / 1; height: 100%; object-fit: cover; transition: transform .6s; }
.area-card:hover > img, .area-card:focus-within > img { transform: scale(1.05) translateX(5px); }
.area-card-texto { grid-area: 1 / 1; z-index: 1; display: flex; flex-direction: column; justify-content: flex-end; padding: 1.1rem; background: linear-gradient(transparent, rgba(0,0,0,.92) 85%); color: #fff; }
.area-card h3 { font-size: 1.4rem; line-height: 1.1; margin-bottom: .6rem; }
.area-card p { font-size: .95rem; line-height: 1.45; }

/* 5. PROYECTO */
.proyecto { padding: 8vh 0 6vh; }
.volver { color: var(--tenue); }
.volver:hover { color: var(--texto); }
.proyecto h1 { font-size: clamp(2.1rem, 6vw, 4.6rem); margin: 3rem 0 1rem; font-weight: 400; }
.meta { color: var(--tenue); font-size: .9rem; }
.lead { max-width: 56ch; margin: 2.5rem 0 4rem; font-size: 1.15rem; line-height: 1.55; }
.galeria { column-count: var(--cols); column-gap: 1rem; }
.galeria .medio { break-inside: avoid; margin-bottom: 1rem; overflow: hidden; }
.galeria img { cursor: zoom-in; }
.embed { aspect-ratio: 16 / 9; margin-top: 1rem; }
.embed iframe { width: 100%; height: 100%; border: 0; }
.texto { max-width: 62ch; margin: 5rem 0 4rem; font-size: 1rem; }
.texto p + p { margin-top: 1.4em; }
.listas { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; padding-top: 3rem; }
.listas h3 { font-size: 1rem; margin-bottom: 1rem; }
.listas ul { padding: 0; list-style: none; color: var(--tenue); font-size: .95rem; }
.listas li { padding: .55rem 0; }
.siguiente { display: block; margin-top: 7rem; font-size: clamp(1.4rem, 3.5vw, 2.4rem); color: var(--tenue); transition: color .4s; }
.siguiente:hover { color: var(--texto); }

/* 6. PIE Y VISOR */
.pie { padding: 3rem 0 4rem; }
#visor { position: fixed; inset: 0; margin: auto; width: fit-content; height: fit-content; max-width: 94vw; max-height: 94vh; padding: 0; border: 0; background: none; }
#visor::backdrop { background: rgba(8, 8, 9, .92); }
#visor img { max-height: 94vh; object-fit: contain; cursor: zoom-out; }

/* 7. MÓVIL */
@media (max-width: 760px) {
  .filas, .listas { grid-template-columns: 1fr; gap: 1.5rem; }
  .areas-carrusel { grid-auto-columns: min(80%, 280px); }
  .galeria { column-count: 1; }
}
@media (prefers-reduced-motion: reduce) { .fila-img img { transition: none; } .fila:hover img, .fila:focus-visible img { transform: none; } }
.hero > p:last-child {
  white-space: pre-line;
}

::view-transition-group(*) { animation-duration: .4s; animation-timing-function: ease-in-out; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .2s; }
@media (prefers-reduced-motion: reduce) {
  .info-retrato img, .info-retrato figcaption, .area-card > img { transition: none; }
  .info-retrato:hover img, .info-retrato:focus img, .area-card:hover > img, .area-card:focus-within > img { transform: none; }
  .preview-video, .trama { display: none; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* Controles del visor: accesibles también desde teclado y pantallas táctiles. */
#visor { width: 94vw; padding: 3.5rem 3rem 2.5rem; background: #0f1012; color: var(--texto); }
#visor img { max-height: 77vh; cursor: default; }
#visor button { position: absolute; border: 1px solid var(--linea); border-radius: 50%; background: var(--fondo); color: var(--texto); width: 44px; height: 44px; cursor: pointer; font-size: 1.5rem; }
.visor-cerrar { top: .5rem; right: .5rem; }
.visor-anterior { left: 0; top: 50%; }
.visor-siguiente { right: 0; top: 50%; }
.visor-contador { display: block; text-align: center; font-size: .85rem; }
button:focus-visible, [data-zoom]:focus-visible { outline: 2px solid var(--acento); outline-offset: 2px; }
.texto:empty, .listas:empty { display: none; }

.contacto { min-height: 70vh; }
.contacto-links { display: flex; flex-wrap: wrap; gap: 1.5rem; font-size: clamp(1.5rem, 4vw, 2.5rem); }
.contacto-links a { text-decoration: underline; text-underline-offset: .3em; text-decoration-color: var(--acento); }
.contacto-links a:hover { color: var(--acento); }
