/* =====================================================================
   PIENSA EN PIXEL — hoja de estilos
   Blanco y negro. Geist (negrita, mayúsculas) para títulos y
   Geist Mono (mayúsculas) para todo lo demás. Sin adornos.
   ===================================================================== */

:root {
  --bg: #ffffff;
  --ink: #000000;
  --muted: #8a8a8a;
  --line: #d4d4d4;
  --fill: #e4e4e4;
  --stage: #f1f1f1;
  --shadow: none;
  color-scheme: light;

  --sans: "Geist", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "Geist Mono", "JetBrains Mono", "SFMono-Regular", Menlo, monospace;

  --gutter: clamp(20px, 2.6vw, 40px);
  --bar-h: 56px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}
:root[data-theme="dark"] {
  /* Dark mode: dark grey instead of pure black, off-white text (less contrast fatigue). */
  --bg: #121212;
  --ink: #e8e8e8;
  --muted: #8f8f8f;
  --line: #2c2c2c;
  --fill: #1f1f1f;
  --stage: #1a1a1a;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); -webkit-text-size-adjust: 100%; }
html.theme-switching, html.theme-switching * { transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease !important; }

body {
  margin: 0;
  font-family: var(--mono);
  font-weight: 400;
  font-size: 14px;
  line-height: 1.5;
  text-transform: uppercase;
  letter-spacing: 0;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  padding-bottom: var(--bar-h);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body.menu-open { overflow: hidden; }

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-transform: inherit; }
h1, h2, h3, p, dl, dd, dt { margin: 0; }
::selection { background: var(--ink); color: var(--bg); }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }

/* ------------------------------------------------------------ tipografía */
.t-display {
  font-family: var(--sans);
  font-weight: 700;
  font-size: clamp(52px, 9.5vw, 150px);
  line-height: 0.92;
  letter-spacing: -0.035em;
  text-transform: uppercase;
}
.t-section {
  font-family: var(--sans);
  font-weight: 700;
  font-size: clamp(22px, 2.4vw, 34px);
  line-height: 1;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.t-hero {
  font-family: var(--sans);
  font-weight: 700;
  font-size: clamp(22px, 2.8vw, 40px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.t-muted { color: var(--muted); }
.link {
  position: relative;
  display: inline-block;
}
.link::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -1px;
  height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right;
  transition: transform 0.45s var(--ease);
}
.link:hover::after { transform: scaleX(1); transform-origin: left; }

/* --------------------------------------------------------------- layout */
.wrap { padding-inline: var(--gutter); }
.app { min-height: 100vh; }

.section { padding: clamp(56px, 9vh, 110px) var(--gutter) 0; }
.section__head {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.section__body { padding-top: 24px; }
.section__body:has(> .series), .section__body:has(> .works) { padding-top: 0; }
.section__body > .series, .section__body > .works { border-top: 0; }

/* Tabla de datos etiqueta / valor */
.meta { display: grid; grid-template-columns: max-content 1fr; column-gap: 24px; row-gap: 2px; }
.meta dt { color: var(--ink); }
.meta dd { text-align: right; }
.meta--muted dt { color: var(--muted); }
.meta a { position: relative; }
.meta a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform 0.45s var(--ease); }
.meta a:hover::after { transform: scaleX(1); transform-origin: left; }

/* Fila etiqueta / valor (una línea) */
.row { display: flex; justify-content: space-between; gap: 24px; }

/* Ficha en dos columnas (solo en pantallas grandes) */
.meta-cols { display: grid; gap: 0; }
@media (min-width: 901px) {
  .meta-cols { grid-template-columns: repeat(2, max-content); gap: 0 clamp(96px, 14vw, 260px); align-items: start; }
}

/* En pantallas grandes el valor va justo después de la etiqueta, no al otro extremo */
@media (min-width: 901px) {
  .meta { grid-template-columns: minmax(13ch, max-content) max-content; column-gap: 20px; }
  .meta dd { text-align: left; }
  .row--kv { justify-content: flex-start; gap: 20px; }
  .row--kv > :first-child { min-width: 13ch; }
}

/* Párrafo grande en mono */
.copy { max-width: 78ch; line-height: 1.55; }
.copy p + p { margin-top: 1.4em; }

/* ---------------------------------------------------------------- media */
.media { position: relative; overflow: hidden; background: var(--fill); }
.media img { width: 100%; height: auto; opacity: 0; transition: opacity 0.9s ease; }
.media img.is-loaded { opacity: 1; }
.media--cover { aspect-ratio: 4 / 5; }
.media--cover img { height: 100%; object-fit: cover; }
.media--circle { border-radius: 50%; aspect-ratio: 1; width: min(70vw, 560px); margin-inline: auto; }
.media--circle img { height: 100%; object-fit: cover; }

/* -------------------------------------------------------------- portada */
.hero {
  position: relative;
  height: 100svh;
  min-height: 520px;
  overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: calc(var(--gutter) * 0.9) var(--gutter) calc(var(--bar-h) + 24px);
  color: #fff;
  isolation: isolate;
}
.hero__img {
  position: absolute; inset: 0; z-index: -1;
  width: 100%; height: 100%; object-fit: cover;
  transform: scale(1.06);
  animation: hero-zoom 6s var(--ease) forwards;
}
@keyframes hero-zoom { to { transform: scale(1); } }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to bottom, rgba(0,0,0,0.18), rgba(0,0,0,0) 30%, rgba(0,0,0,0) 65%, rgba(0,0,0,0.35)); }
.hero .t-hero { max-width: 22ch; }
.hero__foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.hero__caption { text-align: right; font-size: 12px; opacity: 0.85; }

.info {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 18px var(--gutter) clamp(60px, 12vh, 140px);
}
.info__block { display: grid; grid-template-columns: max-content 1fr; column-gap: 18px; }
.info__block--right { text-align: right; grid-template-columns: 1fr max-content; }
.info__block--right > span:first-child { text-align: left; }
.info a { position: relative; display: inline-block; }
.info a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform 0.45s var(--ease); }
.info a:hover::after { transform: scaleX(1); transform-origin: left; }

/* Lista de series */
.series { border-top: 1px solid var(--line); }
.series a {
  display: grid; grid-template-columns: 56px 1fr auto;
  align-items: baseline; gap: 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  transition: padding-left 0.5s var(--ease);
}
.series a:hover { padding-left: 12px; }
.series .t-section { transition: color 0.3s; }
.series a:hover .t-section { color: var(--muted); }

/* Lista de trabajos (fotos a todo el ancho) */
.works { border-top: 1px solid var(--line); }
.work { display: block; padding: 14px 0 28px; border-bottom: 1px solid var(--line); }
.work .row { margin-bottom: 14px; }
.work .media { margin-bottom: 14px; }
.work .media img { transform: translate3d(0, var(--py, 0px), 0) scale(1.1); will-change: transform; }
.work__caption { display: grid; gap: 2px; }
.work__caption strong { font-weight: 500; }
.work:hover .work__caption strong { text-decoration: underline; text-underline-offset: 3px; }
.work--portrait .media { max-width: min(560px, 70%); }

/* Rejilla (opción en galería) */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px 20px; padding-top: 24px; }
.grid .work { padding: 0; border: 0; }
.grid .work .media img { transform: scale(1.1); transition: opacity 0.9s ease, transform 1.2s var(--ease); }
.grid .work.is-in .media img { transform: scale(1); }
.grid .work:hover .media img { transform: scale(1.04); }
.grid .work--portrait .media { max-width: none; }
.grid .work .row { display: none; }

.filters { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.filters a { color: var(--muted); transition: color 0.3s; }
.filters a:hover, .filters a.is-active { color: var(--ink); }
.filters a.is-active { text-decoration: underline; text-underline-offset: 4px; }
.view { display: flex; gap: 16px; }
.view button { color: var(--muted); transition: color 0.3s; }
.view button.is-active, .view button:hover { color: var(--ink); }

/* -------------------------------------------------------------- páginas */
.page { padding: calc(var(--gutter) * 1.2) var(--gutter) 0; }
.page .t-display { margin-bottom: clamp(60px, 22vh, 260px); }
/* En la foto, la descripción va bajo el título y el gran espacio queda entre ella y la ficha */
.page .t-display + .photo__desc { margin-top: calc(clamp(60px, 22vh, 260px) * -1 + 32px); margin-bottom: 96px; }
.page .t-display + .meta { margin-top: 0; }
.page__meta { display: grid; gap: 18px; margin-bottom: 24px; }

/* Foto: centrada sobre un bloque gris muy claro */
.photo__stage { margin: 0 0 18px; background: var(--stage); padding: clamp(16px, 4vw, 64px); display: grid; place-items: center; }
.photo__stage img { display: block; width: auto; max-width: 100%; height: auto; max-height: 82vh; opacity: 0; transition: opacity 1s ease; }
.photo__stage img.is-loaded { opacity: 1; }
/* Carrusel foto / montaje en pared */
.carousel { position: relative; display: grid; background: var(--stage); }
.carousel__slide { grid-area: 1 / 1; transition: opacity 0.5s ease; }
.carousel__slide:not(.is-active) { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.carousel__slide img { display: block; width: auto; max-width: 100%; height: auto; max-height: 82vh; margin-inline: auto; }
.carousel__slide:not(.is-active) { padding: 0; }
.carousel .carousel__zone { top: 0; bottom: 0; }
.carousel__zone { position: absolute; top: 0; bottom: 0; width: 50%; z-index: 2; background: none; border: 0; padding: 0; }
.carousel__zone--prev { left: 0; cursor: w-resize; }
.carousel__zone--next { right: 0; cursor: e-resize; }
.carousel__zone[hidden] { display: none; }
.carousel__zone:focus-visible { outline: 1px solid var(--ink); outline-offset: -4px; }
.carousel__meta { padding-top: 12px; color: var(--muted); }
.photo__nav { display: flex; justify-content: space-between; gap: 24px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: 48px; }
.map { margin-top: 48px; }
.map__canvas { aspect-ratio: 16 / 9; background: var(--fill); border: 1px solid var(--line); position: relative; overflow: hidden; filter: grayscale(1) contrast(1.05); }
.map__canvas.leaflet-container { background: var(--fill); font-family: var(--mono); }
.map__pin { width: 12px; height: 12px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 4px var(--bg), 0 0 0 5px var(--ink); }
.leaflet-control-attribution { background: var(--bg) !important; color: var(--muted) !important; font-size: 10px !important; text-transform: none; }
.leaflet-control-attribution a { color: var(--ink) !important; }
.leaflet-bar a { background: var(--bg) !important; color: var(--ink) !important; border-color: var(--line) !important; }
.map__fallback { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); text-align: center; padding: 20px; }

/* Botón */
.btn {
  display: inline-block;
  padding: 14px 22px;
  border: 1px solid var(--ink);
  background: var(--ink); color: var(--bg);
  transition: background 0.3s, color 0.3s;
}
.btn:hover { background: var(--bg); color: var(--ink); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--bg); }

/* Formulario */
.form { display: grid; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; }
.form__row[hidden], .field[hidden] { display: none; }
.field { display: grid; gap: 8px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.field label { color: var(--muted); }
.field input, .field textarea, .field select {
  width: 100%; background: none; border: 0; border-radius: 0;
  color: var(--ink); font: inherit; text-transform: uppercase; padding: 0; outline: none;
}
.field select { appearance: none; -webkit-appearance: none; cursor: pointer; }
.field select option { background: var(--bg); color: var(--ink); }
.field textarea { resize: vertical; min-height: 140px; }
.field input::placeholder, .field textarea::placeholder { color: var(--line); }
.field:focus-within label { color: var(--ink); }
.form__foot { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 28px; flex-wrap: wrap; }
.form__note { color: var(--muted); max-width: 48ch; font-size: 12px; }
.form__status { padding-top: 18px; min-height: 1.5em; }
.form__status.is-error { text-decoration: underline; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.empty { padding: 40px 0; color: var(--muted); }

/* ---------------------------------------------------------- barra fija */
.bar {
  position: fixed; left: 0; right: 0; bottom: 0;
  height: var(--bar-h);
  display: flex; justify-content: space-between; align-items: center;
  padding-inline: var(--gutter);
  z-index: 60;
  mix-blend-mode: difference;
  color: #fff;
}
.bar__brand, .bar__menu { position: relative; }
:root[data-env="staging"] .bar__brand::before { content: "Staging · "; }
.bar__menu::after, .bar__brand::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform 0.45s var(--ease); }
.bar__menu:hover::after, .bar__brand:hover::after { transform: scaleX(1); transform-origin: left; }

/* Menú a pantalla completa */
.menu {
  position: fixed; inset: 0; z-index: 50;
  background: var(--bg); color: var(--ink);
  display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
  padding: calc(var(--gutter) * 1.2) var(--gutter) calc(var(--bar-h) + 16px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.menu[hidden] { display: none; }
.menu__nav { display: grid; gap: 2px; }
.menu__nav a {
  font-family: var(--sans); font-weight: 700; text-transform: uppercase; letter-spacing: -0.03em;
  font-size: clamp(38px, min(7.5vw, 8.2vh), 96px); line-height: 1;
  display: flex; align-items: baseline; gap: 18px;
  opacity: 0; transform: translateY(24px);
  animation: menu-in 0.7s var(--ease) forwards;
  transition: color 0.3s;
}
.menu__nav a:hover { color: var(--muted); }
.menu__nav a small { font-family: var(--mono); font-weight: 400; letter-spacing: 0; font-size: 13px; color: var(--muted); min-width: 40px; }
.menu__nav a:nth-child(1) { animation-delay: 0.04s; }
.menu__nav a:nth-child(2) { animation-delay: 0.08s; }
.menu__nav a:nth-child(3) { animation-delay: 0.12s; }
.menu__nav a:nth-child(4) { animation-delay: 0.16s; }
.menu__nav a:nth-child(5) { animation-delay: 0.20s; }
.menu__nav a:nth-child(6) { animation-delay: 0.26s; }
.menu__nav a:nth-child(7) { animation-delay: 0.30s; }
@keyframes menu-in { to { opacity: 1; transform: none; } }
.menu__foot { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 24px; }
.menu__row { display: grid; grid-template-columns: max-content 1fr; column-gap: 18px; }
.menu__row:last-child { text-align: right; grid-template-columns: 1fr max-content; }
.menu__row:last-child > span:first-child { text-align: left; }
.menu__row a, .menu__theme { text-decoration: underline; text-underline-offset: 3px; }
/* Theme selector hidden for now (kept in the markup and JS while we decide whether it stays). */
.menu__row.menu__row--theme { display: none; }

/* ------------------------------------------------------ apariciones */
.sr { opacity: 0; transform: translateY(26px); transition: opacity 0.9s var(--ease), transform 1.1s var(--ease); transition-delay: calc(var(--i, 0) * 80ms); }
.sr.is-in { opacity: 1; transform: none; }
.sr-img .media { clip-path: inset(0 0 100% 0); transition: clip-path 1.2s var(--ease); transition-delay: calc(var(--i, 0) * 80ms); }
.sr-img.is-in .media { clip-path: inset(0 0 0 0); }

.split .w { display: inline-block; overflow: hidden; vertical-align: bottom; padding: 0.04em 0.04em 0.1em 0.02em; margin: -0.04em -0.04em -0.1em -0.02em; }
.split .w__i { display: inline-block; transform: translateY(110%); transition: transform 1s var(--ease); transition-delay: calc(var(--d, 0) * 1ms); will-change: transform; }
.split.is-in .w__i { transform: none; }

/* Pantalla de carga */
.loader {
  position: fixed; inset: 0; z-index: 300;
  background: var(--bg); color: var(--ink);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: calc(var(--gutter) * 1.2) var(--gutter);
  transition: transform 0.9s var(--ease-in-out);
}
.loader.is-done { transform: translateY(-101%); }
.loader[hidden] { display: none; }
.loader__name { font-family: var(--sans); font-weight: 700; text-transform: uppercase; letter-spacing: -0.035em; font-size: clamp(44px, 9vw, 150px); line-height: 0.92; overflow: hidden; padding-bottom: 0.08em; }
.loader__name span, .loader__sub span { display: block; transform: translateY(110%); transition: transform 1s var(--ease); }
.loader__sub { overflow: hidden; color: var(--muted); }
.loader__sub span { transition-delay: 0.12s; }
.loader.is-loading .loader__name span, .loader.is-loading .loader__sub span { transform: none; }
.loader__bar { position: absolute; left: var(--gutter); right: var(--gutter); bottom: calc(var(--bar-h) + 8px); height: 1px; background: var(--line); }
.loader__bar i { position: absolute; inset: 0; background: var(--ink); transform-origin: left; transform: scaleX(0); transition: transform 1.3s var(--ease-in-out); }
.loader.is-loading .loader__bar i { transform: scaleX(1); }

/* Transición entre páginas: fundido suave */
.app { transition: opacity 0.22s ease, transform 0.22s ease; }
.app.is-leaving { opacity: 0; transform: translateY(6px); }
.app.is-entering { animation: page-in 0.55s var(--ease); }
@keyframes page-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Cursor */
.cursor {
  position: fixed; top: 0; left: 0; z-index: 400;
  width: 10px; height: 10px; border-radius: 50%;
  background: #fff; mix-blend-mode: difference;
  pointer-events: none; visibility: hidden;
  display: grid; place-items: center;
  transform: translate(-50%, -50%);
  transition: width 0.45s var(--ease), height 0.45s var(--ease), opacity 0.3s ease;
}
.cursor.is-link { width: 32px; height: 32px; }
.cursor.is-view { width: 84px; height: 84px; }
.cursor.is-hidden { opacity: 0; }
.cursor__label { font-family: var(--mono); font-size: 11px; color: #000; opacity: 0; transition: opacity 0.3s ease; text-transform: uppercase; }
.cursor.is-view .cursor__label { opacity: 1; }
@media (hover: hover) and (pointer: fine) {
  body, a, button, input, textarea, select, label, .leaflet-container { cursor: none !important; }
  .cursor { visibility: visible; }
}

.noscript { padding: 80px var(--gutter); }

/* ------------------------------------------------------------ responsive */
@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .map .row--kv { flex-direction: column; gap: 4px; }
  .info { grid-template-columns: 1fr; }
  .info__block--right { text-align: left; grid-template-columns: max-content 1fr; }
  .form__row { grid-template-columns: 1fr; }
  .work--portrait .media, .photo__stage--portrait { max-width: 100%; }
  .menu__foot { grid-template-columns: 1fr; gap: 14px; }
  .menu__row:last-child { text-align: left; grid-template-columns: max-content 1fr; }
}
@media (max-width: 560px) {
  body { font-size: 13px; }
  .grid { grid-template-columns: 1fr 1fr; gap: 24px 12px; }
  .grid .work__caption span { display: none; }
  .series a { grid-template-columns: 40px 1fr auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .sr, .split .w__i { opacity: 1; transform: none; }
  .sr-img .media { clip-path: none; }
  .loader { display: none !important; }
  .app.is-entering { animation: none; }
  .work .media img { transform: none; }
}
