:root {
  --ink: rgba(0, 0, 0, 0.86);
  --muted: rgba(0, 0, 0, 0.5);
  --bg: #fff;
  --pad: 14px;
  --nav: 15px;
  --small: 11.5px;
  --font: "Inter Tight", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--nav);
  line-height: 1.2;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* ---------- Header / footer fijos ---------- */
.top {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: baseline;
  padding: var(--pad);
  pointer-events: none;
}
.top a { pointer-events: auto; }
.top nav { display: flex; gap: 0.8em; }
.top a:hover, .bottom a:hover { opacity: 0.5; }
.bottom {
  position: fixed; left: var(--pad); bottom: var(--pad); z-index: 20;
  font-size: var(--small); font-weight: 450;
}

/* ---------- Feed ---------- */
.feed { padding: 50vh var(--pad) 30vh; }
.project + .project { margin-top: 15vh; }

.slides {
  position: relative;
  width: min(60vw, 1100px);
  aspect-ratio: 2048 / 1080;
  margin: 0 auto;
  display: block;
  cursor: pointer;
  user-select: none;
}
.slides img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.slides img.on { opacity: 1; }
.slides.empty { background: #ececec; cursor: default; }
.slides.empty::after {
  content: "Project images";
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: var(--small); color: var(--muted);
}
.count {
  text-align: center; margin-top: 10px;
  font-size: var(--small); font-weight: 450; color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.row {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--pad);
  margin-top: 14px;
}
.row h2 { font-size: var(--nav); font-weight: 500; }
.row h2 .n { display: inline-block; width: 1.6em; font-variant-numeric: tabular-nums; }
.row p { font-size: var(--small); font-weight: 450; line-height: 1.3; max-width: 46em; }
.row .see { text-decoration: underline; text-underline-offset: 2px; }
.row .see:hover { opacity: 0.5; }

.row h2 a:hover { opacity: 0.5; }
body[data-page="project"] .bottom { display: none; }

/* ---------- Página de proyecto ---------- */
.project-page { padding: 70px var(--pad) 18vh; }
.player {
  position: relative; width: min(100%, calc((100vh - 140px) * 2048 / 1080));
  aspect-ratio: 2048 / 1080; margin: 0 auto; background: #000;
}
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player.poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.player.poster span {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  font-size: var(--small); color: #fff; background: rgba(0,0,0,0.45);
  padding: 6px 10px; border-radius: 99px; backdrop-filter: blur(4px);
}
.player.empty { background: #ececec; }
.caption {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--pad);
  margin-top: 14px; font-size: var(--small); font-weight: 450; line-height: 1.3;
}
.caption h1 { font-size: var(--nav); font-weight: 500; line-height: 1.2; }
.caption .meta { color: var(--muted); margin-top: 2px; }
.legend p { max-width: 36em; }
.legend p + p { text-indent: 3em; }
.ficha { display: grid; grid-template-columns: auto 1fr; gap: 0.15em 1.2em; align-content: start; }
.ficha dt { color: var(--muted); }
.stills {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--pad);
  margin-top: 15vh;
}
.stills img { width: 100%; display: block; }
.pager {
  display: flex; justify-content: space-between; margin-top: 10vh;
  font-size: var(--nav);
}
.pager a:hover { opacity: 0.5; }

.top nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Información ---------- */
.info {
  display: grid; grid-template-columns: 2fr 1fr; gap: calc(var(--pad) * 3);
  padding: 30vh var(--pad) 20vh;
}
.bio { font-size: clamp(20px, 2.3vw, 34px); line-height: 1.18; font-weight: 450; max-width: 30em; }
.bio p + p { margin-top: 0.8em; }
.contact h3 { font-size: var(--small); font-weight: 500; margin-bottom: 1em; }
.contact dl { display: grid; grid-template-columns: auto 1fr; gap: 0.35em 1.2em; font-size: var(--nav); }
.contact dt { color: var(--muted); }
.contact a:hover { opacity: 0.5; }

/* ---------- Archivo ---------- */
.archive { padding: 30vh var(--pad) 20vh; }
.list { list-style: none; }
.list li a, .list .head {
  display: grid; grid-template-columns: 90px 2fr 1fr 1fr; gap: var(--pad);
  padding: 0.45em 0; border-top: 1px solid rgba(0,0,0,0.12);
}
.list .head { font-size: var(--small); color: var(--muted); border-top: 0; }
.list li:last-child a { border-bottom: 1px solid rgba(0,0,0,0.12); }
.list li a:hover { opacity: 0.45; }
.peek {
  position: fixed; left: 0; top: 0; z-index: 25; width: 300px; pointer-events: none;
  opacity: 0; transition: opacity 0.15s ease;
}
.peek.on { opacity: 1; }

/* ---------- Panel lateral ---------- */
.scrim {
  position: fixed; inset: 0; z-index: 30;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none; transition: opacity 0.35s ease;
}
.panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 40;
  width: 50vw; background: var(--bg);
  overflow-y: auto; overscroll-behavior: contain;
  transform: translateX(100%); transition: transform 0.45s cubic-bezier(.2,.7,.1,1);
  padding: var(--pad);
}
body.open .scrim { opacity: 1; pointer-events: auto; }
body.open .panel { transform: none; }
body.open { overflow: hidden; }
.panel-close {
  position: sticky; top: 0; float: right; z-index: 2;
  font-size: var(--nav); font-weight: 500; padding: 0 0 8px 8px; background: var(--bg);
}
.panel-close:hover { opacity: 0.5; }
.panel-body { clear: both; padding-top: 28px; }
.panel-body img, .panel-body .video { display: block; width: 100%; margin-bottom: var(--pad); }
.panel-body .video { aspect-ratio: 16 / 9; border: 0; background: #000; }
.panel-body h2 { font-size: var(--nav); font-weight: 500; margin-bottom: 4px; }
.cols {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--pad);
  font-size: var(--small); font-weight: 450; line-height: 1.3;
  margin: 6px 0 40px;
}
.cols h3 { font-size: var(--small); font-weight: 500; margin-bottom: 1.1em; }
.cols dl { display: grid; grid-template-columns: auto 1fr; gap: 0 1em; }
.cols dt { color: var(--muted); }
.cols p + p { text-indent: 3em; }
.cols a { text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Celular ---------- */
@media (max-width: 760px) {
  :root { --nav: 14px; --small: 12px; }
  .feed { padding-top: 30vh; }
  .slides { width: 100%; }
  .row { grid-template-columns: 1fr; gap: 6px; }
  .panel { width: 100vw; }
  .cols { grid-template-columns: 1fr; gap: 24px; }
  .bottom { display: none; }
  .info { grid-template-columns: 1fr; padding-top: 18vh; }
  .archive { padding-top: 18vh; }
  .project-page { padding-top: 56px; }
  .caption { grid-template-columns: 1fr; gap: 18px; }
  .stills { grid-template-columns: 1fr; margin-top: 10vh; }
  .list li a, .list .head { grid-template-columns: 52px 1fr; }
  .list li a span:nth-child(n+3), .list .head span:nth-child(n+3) { display: none; }
}

/* ---------- Inicio: fotos sueltas sobre blanco ---------- */
.home { padding: 0 var(--pad); overflow-x: clip; }
.scatter { position: relative; }
.scatter .ph { position: absolute; margin: 0; }
body[data-page="home"] .top {
  inset: 50% 0 auto 0; transform: translateY(-50%);
  color: #fff; mix-blend-mode: difference;
}
body[data-page="home"] .bottom { display: none; }

.ph { opacity: 0; transform: translateY(24px); transition: opacity 0.9s ease, transform 0.9s ease; }
.ph.in { opacity: 1; transform: none; }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Photography: filas parejas ---------- */
.photography { padding: 70px var(--pad) 20vh; }
.jrow { display: flex; gap: var(--jgap, 14px); margin-bottom: var(--jgap, 14px); }
.jrow .ph { flex: none; margin: 0; }
.soon { font-size: var(--small); color: var(--muted); padding-top: 30vh; }
