/* =========================================================
   ESTILOS COMPARTIDOS DE LAS PÁGINAS DE PROYECTO
   Lo que cambies acá se aplica a todos los proyectos.
   ========================================================= */
:root {
  --ink: #FFFFFF;        /* fondo */
  --paper: #000000;      /* texto */
  --soft: #6B6B6B;       /* textos secundarios */
  --line: #E3E3E3;       /* líneas divisorias */
  --panel: #F2F2F2;      /* caja del encabezado */
  --font: "Manrope", system-ui, sans-serif;
  --pad: clamp(1rem, 2vw, 1.5rem);
  --gap: clamp(.5rem, 1vw, .75rem);
  --radius: 8px;           /* redondeado de todas las imágenes */
  --side: clamp(220px, 18vw, 300px);
  --accent: #22CE83;     /* color de acento: cada proyecto lo cambia con "acento" */
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--ink);
  color: var(--paper);
  font-size: 0.86rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { display: block; width: 100%; height: 100%; object-fit: cover; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* ---------- Estructura: columna fija + contenido ---------- */
.page {
  display: grid;
  grid-template-columns: var(--side) 1fr;
  gap: var(--pad);
  padding: 0 var(--pad);
}

/* ---------- Columna izquierda ---------- */
.side {
  position: sticky; top: 0;
  height: 100svh;
  display: flex; flex-direction: column;
  padding: var(--pad) 0;
  overflow-y: auto;
}
.crumbs {
  display: flex; gap: .45rem; align-items: baseline; flex-wrap: nowrap; white-space: nowrap; overflow: hidden;
  padding: 1rem 1.1rem;
}
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; text-underline-offset: 4px; }
/* Logo A—R con la raya más larga y un poco de aire */
.crumbs .home {
  font-weight: 800; color: var(--paper);
  display: inline-flex; align-items: center; gap: .3em;
  transition: opacity .2s ease;
}
.crumbs .home:hover { text-decoration: none; opacity: .7; }
.crumbs .home .raya { display: block; width: 1.5em; height: .13em; background: currentColor; border-radius: 1px; }
.crumbs .sep, .crumbs .here { color: var(--soft); }
/* El nombre del proyecto ya está debajo, así que en la ruta no se repite */
.crumbs .here, .crumbs .sep-last { display: none; }

.side-title { padding: clamp(2.5rem, 8vh, 5rem) 1.1rem 0; }
.side-title h1 { font-weight: 600; font-size: clamp(1.2rem, 1.5vw, 1.55rem);  line-height: 1.05; letter-spacing: -0.025em; }
.side-title .subtitle { font-size: clamp(0.9rem, 1.15vw, 1.15rem); color: var(--soft); line-height: 1.2; margin-top: .35rem; letter-spacing: -0.015em; }
.side-title .meta { margin-top: 1.25rem; color: var(--soft); font-size: 0.728rem; }

.toc { list-style: none; padding: clamp(2rem, 6vh, 4rem) 0 2rem; }
.toc a {
  display: block; position: relative;
  padding: .45rem 1.1rem;
  text-decoration: none; color: var(--soft);
  font-size: 0.89rem;
  transition: color .2s ease;
}
.toc a:hover { color: var(--paper); }
.toc a[aria-current="true"] { color: var(--paper); }
.toc a[aria-current="true"]::before {
  content: ""; position: absolute; left: .1rem; top: 50%;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); transform: translateY(-50%);
}
.side-foot { margin-top: auto; padding: 0 1.1rem; display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; }
.side-foot a { white-space: nowrap; }
.side-foot { transition: opacity .3s ease, visibility .3s; }
.side-foot.oculto { opacity: 0; visibility: hidden; }
.side-foot a { text-decoration: none; color: var(--soft); }
.side-foot a:hover { color: var(--paper); text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Contenido ---------- */
main { padding: var(--pad) 0 clamp(4rem, 8vw, 6rem); min-width: 0; }

.media { border-radius: var(--radius); overflow: hidden; position: relative; }
.media.has-img { aspect-ratio: auto !important; max-height: none !important; }
.media.has-img img { height: auto; }
.ph { width: 100%; height: 100%; display: grid; place-items: center; padding: 2rem; text-align: center; }
.ph .sample { font-weight: 800; line-height: .85; letter-spacing: -0.045em; font-size: clamp(2.023rem, 5.664vw, 6.473rem); }
.ph .note { position: absolute; left: 1rem; bottom: .9rem; right: 1rem; text-align: left; font-size: 0.687rem; font-weight: 500; opacity: .85; }

.row { display: grid; gap: var(--gap); margin-top: var(--gap); }
.row.full .media  { aspect-ratio: 16 / 9; }
.row.pair         { grid-template-columns: 1fr 1fr; }
.row.pair .media  { aspect-ratio: 4 / 5; }
.row.split        { grid-template-columns: 2fr 1fr; }
.row.split .media:first-child { aspect-ratio: 4 / 3; }
.row.trio         { grid-template-columns: repeat(3, 1fr); }
.row.trio .media  { aspect-ratio: 3 / 4; }

.hero .media { aspect-ratio: 16 / 9; max-height: calc(100svh - 2 * var(--pad)); width: 100%; }
.hero .ph .sample { font-size: clamp(2.427rem, 8.091vw, 8.9rem); }

/* Bloques de texto: título a la izquierda, párrafos a la derecha, con línea divisoria arriba */
.text-block {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem clamp(2rem, 5vw, 5rem);
  border-top: 1px solid var(--line);
  padding: clamp(1.75rem, 3vw, 2.5rem) 1.1rem clamp(3rem, 6vw, 5rem);
  scroll-margin-top: var(--pad);
}
/* Aire entre una fila de imágenes y el bloque de texto que la sigue */
.board > :not(.text-block) + .text-block { margin-top: clamp(1.5rem, 3vw, 2.5rem); }
.text-block .label { font-size: 0.696rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--soft); }
.text-block .phrase { font-size: clamp(1.305rem, 2.001vw, 1.914rem); line-height: 1.15; font-weight: 400; letter-spacing: -0.02em; max-width: 24ch; }
.text-block .label:not(.sr-only) + .phrase { margin-top: .9rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.text-block .body p { font-size: clamp(0.913rem, 1.218vw, 1.131rem); line-height: 1.5; color: var(--soft); max-width: 52ch; }
.text-block .body p + p { margin-top: 1rem; }

/* ---------- Galería ---------- */
.board { display: flex; flex-direction: column; gap: var(--gap); }
.board .row { margin: 0; align-items: stretch; }
.tile { margin: 0; aspect-ratio: var(--r); border-radius: var(--radius); overflow: hidden; }
.tile img { width: 100%; height: 100%; display: block; object-fit: cover; }
/* Carrusel con puntitos */
.carrusel .pista { display: flex; height: 100%; transition: transform .8s cubic-bezier(.65, 0, .35, 1); }
.carrusel .pista img { flex: 0 0 100%; }
.carrusel .puntos { display: flex; justify-content: center; gap: 8px; margin-top: 14px; }
.carrusel .puntos button {
  width: 8px; height: 8px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  background: currentColor; opacity: .2; transition: opacity .3s ease, transform .3s ease;
}
.carrusel .puntos button:hover { opacity: .5; }
.carrusel .puntos button[aria-current="true"] { opacity: .8; transform: scale(1.15); }
.stack .pila { display: flex; flex-direction: column; gap: var(--gap); min-height: 0; }
.stack .pila .tile { aspect-ratio: auto; flex-basis: 0; min-height: 0; }
/* La última imagen de la columna apilada ocupa todo el alto que sobre.
   El espacio que sobra se rellena con el color de fondo indicado en IMAGENES (tercer valor). */
.stack .pila .tile:last-child img { object-fit: contain; }
[hidden] { display: none !important; }

/* ---------- Ficha técnica ---------- */
.credits {
  margin-top: clamp(4rem, 9vw, 7rem);
  border-top: 1px solid var(--line);
  padding: 1.75rem 1.1rem 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem clamp(2rem, 5vw, 5rem);
}
.credits h2 { letter-spacing: -0.02em; font-size: clamp(1.214rem, 1.942vw, 1.821rem); font-weight: 500; line-height: 1.15; }
.credits dl { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem 2rem; }
.credits dt { color: var(--soft); font-size: 0.728rem; }
.credits dd { font-weight: 500; }

/* ---------- Siguiente proyecto ---------- */
.next { margin-top: clamp(4rem, 9vw, 7rem); }
.next-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; border-top: 1px solid var(--line); padding: 1.75rem 1.1rem 1.25rem; }
.next-head h2 { letter-spacing: -0.02em; font-size: clamp(1.214rem, 1.942vw, 1.821rem); font-weight: 500; line-height: 1.15; }
.next-head a { color: var(--soft); text-decoration: none; }
.next-head a:hover { color: var(--paper); text-decoration: underline; text-underline-offset: 4px; }
.next-card { display: block; text-decoration: none; }
.next-card .media { aspect-ratio: 21 / 9; }
.next-card .ph .sample { transition: letter-spacing .5s ease; }
.next-card:hover .ph .sample, .next-card:focus-visible .ph .sample { letter-spacing: -0.06em; }
.next-card .caption { display: flex; justify-content: space-between; gap: 1rem; padding: .9rem 1.1rem 0; }
.next-card .caption strong { letter-spacing: -0.015em; font-size: 1.093rem; font-weight: 800; }
.next-card .caption span { color: var(--soft); }

/* ---------- Contacto (igual que en la home, en blanco y negro) ---------- */
.contacto {
  padding: 1.75rem var(--pad) 24px; border-top: 1px solid var(--line);
  font-size: 12px; line-height: 1.2; letter-spacing: .02em; text-transform: uppercase;
}
.contacto a { text-decoration: none; }
.contacto .foot { display: grid; grid-template-columns: 226px 1fr auto; gap: 24px; align-items: start; margin-bottom: 56px; }
.contacto .foot ul { list-style: none; }
.contacto .foot a:hover { opacity: .6; }
.contacto .question { text-align: right; text-transform: none; font-size: clamp(1.25rem, 1.95vw, 1.75rem); line-height: 1; letter-spacing: -.03em; font-weight: 500; }
.contacto .bottom { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.contacto .pill { display: inline-block; background: var(--paper); color: var(--ink); border-radius: 999px; padding: 8px 14px; transition: transform .2s ease; }
.contacto .pill:hover { transform: scale(1.05); }
@media (max-width: 900px) {
  .contacto { padding-bottom: 6rem; }
  .contacto .foot { grid-template-columns: 1fr 1fr; }
  .contacto .question { grid-column: 1 / -1; text-align: left; margin-top: 1rem; }
}

/* ---------- Barra de secciones (solo celulares) ---------- */
.bar { display: none; }

/* ---------- Pantallas medianas y celulares ---------- */
@media (max-width: 900px) {
  .board .row { grid-template-columns: 1fr !important; }
  .stack .pila .tile { aspect-ratio: var(--r); flex-basis: auto; }
  .page { grid-template-columns: 1fr; gap: 0; }
  .side { position: static; height: auto; overflow: visible; padding-bottom: 0; }
  .side-title { padding: 2rem .25rem 1.5rem; }
  .toc, .side-foot { display: none; }
  main { padding-top: 0; padding-bottom: 7rem; }
  .text-block, .credits { grid-template-columns: 1fr; padding-left: .25rem; padding-right: .25rem; }
  .row, .row.pair, .row.split, .row.trio { grid-template-columns: 1fr !important; }
  .row.split .media, .row.split .media:first-child { aspect-ratio: 4 / 3; }
  .hero .media { aspect-ratio: 4 / 5; }
  .next-card .media { aspect-ratio: 4 / 3; }
  .crumbs .here, .crumbs .sep-last { display: none; }

  .bar { display: block; position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); z-index: 20; width: min(560px, calc(100% - 2rem)); }
  .bar-inner { display: flex; align-items: stretch; background: #F2F2F2; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; box-shadow: 0 10px 30px rgba(0, 0, 0, .12); }
  .bar-name { padding: .8rem 1.2rem; color: var(--soft); white-space: nowrap; font-size: 0.768rem; }
  .bar-toggle { flex: 1; font: inherit; font-weight: 700; font-size: 0.768rem; color: var(--paper); background: #E6E6E6; border: 0; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .8rem 1.2rem; text-align: left; }
  .bar-toggle svg { transition: transform .25s ease; flex-shrink: 0; }
  .bar.open .bar-toggle svg { transform: rotate(180deg); }
  .bar-menu { list-style: none; background: #F2F2F2; border: 1px solid var(--line); border-radius: 18px; padding: .5rem; margin-bottom: .5rem; display: none; }
  .bar.open .bar-menu { display: block; animation: pop .2s ease; }
  .bar-menu a { display: block; padding: .6rem .9rem; border-radius: 12px; text-decoration: none; }
  .bar-menu a[aria-current="true"] { background: var(--paper); color: var(--ink); font-weight: 700; }
}
@keyframes pop { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}

/* Mientras se arma la galería (ver js/proyecto.js), lo de abajo espera oculto para no saltar */
.armando .credits, .armando .next, .armando .contacto { display: none; }
