/* samuelbravo.com */
:root {
  --paper: #f1f1ee;
  --ink: #1d201e;
  --mute: #767b73;
  --rule: #cfd2cb;
  --plate: #ffffff;
  --gut: clamp(1rem, 3vw, 2.5rem);
  --step-0: 1.0625rem;
  --step-1: 1.3125rem;
  --step-big: clamp(1.75rem, 3.6vw, 3.25rem);
  --step-huge: clamp(2.25rem, 5.5vw, 4.75rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Familjen Grotesk", "Helvetica Neue", Arial, sans-serif;
  font-size: var(--step-0);
  line-height: 1.5;
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--mute); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
h1, h2 { font-weight: 500; margin: 0; }
p { margin: 0 0 1em; }

.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: var(--gut); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- cabecera ---------- */
.site-head {
  position: sticky; top: 0; z-index: 5;
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: 1rem var(--gut);
  background: var(--paper);
}
.site-head .name { font-weight: 600; text-decoration: none; }
.site-head nav { display: flex; gap: 1.5rem; }
.site-head nav a { text-decoration: none; }
.site-head nav a[aria-current="page"] { text-decoration: underline; }

main { padding: 0 var(--gut); }

/* ---------- home ---------- */
.intro { padding: clamp(2rem, 8vh, 6rem) 0 clamp(2rem, 6vh, 4rem); }
.intro p { font-size: var(--step-1); max-width: 34ch; margin: 0; line-height: 1.35; }
.intro p.es, .page-head p.es { color: var(--mute); margin-top: .6em; }
.prose p.es, .bio p.es, .links .es { color: var(--mute); }
.prose p.es:first-of-type, .bio p.es:first-of-type { margin-top: 1.75em; }

.index { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--gut); align-items: start; }
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.rows li { border-bottom: 1px solid var(--rule); }
.row {
  display: grid; grid-template-columns: 5.5rem minmax(0, 1fr);
  column-gap: 1rem; row-gap: .1rem;
  padding: .7rem 0 .8rem;
  text-decoration: none;
  transition: color .2s ease;
}
.row-thumb { display: none; }
.row-year { grid-row: 1 / span 2; padding-top: .9em; color: var(--mute); font-variant-numeric: tabular-nums; font-size: .95rem; }
.row-title { font-size: var(--step-big); line-height: 1.05; letter-spacing: -0.02em; font-weight: 500; }
.row-place { color: var(--mute); font-size: .95rem; }
.status { margin-left: .75em; padding: 0 .45em; border: 1px solid var(--rule); border-radius: 2px; font-size: .85rem; white-space: nowrap; }

/* al pasar por la lista, el resto de los proyectos se aclara */
@media (hover: hover) {
  .rows:hover .row, .rows:focus-within .row { color: #b9bcb5; }
  .rows:hover .row .row-place, .rows:focus-within .row .row-place { color: #c4c7c0; }
  .rows .row:hover, .rows .row:focus-visible { color: var(--ink); }
  .rows .row:hover .row-place, .rows .row:focus-visible .row-place { color: var(--mute); }
}

.preview { position: sticky; top: 4.5rem; margin: 0; aspect-ratio: 4 / 5; max-height: calc(100vh - 6rem); background: var(--rule); overflow: hidden; }
.preview img { width: 100%; height: 100%; object-fit: cover; transition: opacity .25s ease; }
.preview img.is-loading { opacity: 0; }

/* ---------- proyecto ---------- */
.project { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: var(--gut); padding-top: clamp(1.5rem, 5vh, 3.5rem); align-items: start; }
.project h1 { font-size: var(--step-huge); line-height: 1; letter-spacing: -0.025em; margin-bottom: 1.75rem; }
.project-text { max-width: 38rem; }
.facts { margin: 0 0 2rem; font-size: .95rem; border-top: 1px solid var(--rule); }
.facts div { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: 1rem; padding: .45rem 0; border-bottom: 1px solid var(--rule); }
.facts dt { color: var(--mute); }
.facts dd { margin: 0; }
.prose p { max-width: 62ch; hyphens: auto; }

.plates { display: flex; flex-direction: column; gap: clamp(.75rem, 1.5vw, 1.25rem); }
.plate { margin: 0; }
.mobile-cover { display: none; margin: 0 0 1.5rem; }
.plate.is-drawing { background: var(--plate); padding: clamp(.75rem, 3vw, 2.5rem); }
.zoom { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.plate.video { position: relative; aspect-ratio: 16 / 9; background: var(--ink); }
.plate.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.next { margin: clamp(3rem, 10vh, 7rem) 0 0; border-top: 1px solid var(--rule); }
.next a { display: block; padding: 1.25rem 0 2rem; text-decoration: none; font-size: var(--step-big); letter-spacing: -0.02em; line-height: 1.05; }
.next span { display: block; font-size: .95rem; letter-spacing: 0; color: var(--mute); margin-bottom: .35rem; }

/* visor de imágenes */
.lightbox { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: var(--paper); color: var(--ink); }
.lightbox::backdrop { background: var(--paper); }
.lightbox img { position: absolute; inset: 3.5rem var(--gut) 3.5rem; width: calc(100% - 2 * var(--gut)); height: calc(100% - 7rem); object-fit: contain; }
.lightbox button { position: absolute; background: none; border: 0; padding: .5rem; font: inherit; color: inherit; cursor: pointer; }
.lightbox button:hover { color: var(--mute); }
.lb-close { top: .6rem; right: calc(var(--gut) - .5rem); }
.lb-prev { bottom: .6rem; left: calc(var(--gut) - .5rem); }
.lb-next { bottom: .6rem; right: calc(var(--gut) - .5rem); }
.lb-count { position: absolute; bottom: 1.1rem; left: 50%; transform: translateX(-50%); color: var(--mute); font-variant-numeric: tabular-nums; }

/* ---------- películas ---------- */
.page-head { padding: clamp(1.5rem, 5vh, 3.5rem) 0 clamp(2rem, 5vh, 3rem); }
.page-head h1 { font-size: var(--step-huge); line-height: 1; letter-spacing: -0.025em; margin-bottom: 1rem; }
.page-head p { font-size: var(--step-1); max-width: 36ch; line-height: 1.35; }
.film { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: var(--gut); padding: clamp(1.5rem, 4vh, 2.5rem) 0; border-top: 1px solid var(--rule); align-items: start; }
.film figure { margin: 0; max-width: 30rem; }
.film h2 { font-size: var(--step-big); line-height: 1.05; letter-spacing: -0.02em; margin-bottom: 1.25rem; }
.film-text { max-width: 40rem; }
.film .es { color: var(--mute); }

/* ---------- about ---------- */
.about { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: calc(var(--gut) * 2); padding-top: clamp(2rem, 8vh, 6rem); align-items: start; }
.bio p { font-size: var(--step-1); line-height: 1.42; max-width: 36em; }
.bio p:first-child::first-line { font-weight: 500; }
.about-side h2 { font-size: .95rem; color: var(--mute); font-weight: 400; margin: 0 0 .5rem; }
.about-side h2 ~ h2 { margin-top: 2.5rem; }
.links { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.links li { border-bottom: 1px solid var(--rule); }
.links a { display: block; padding: .7rem 0; text-decoration: none; }
.links .pub { display: block; font-weight: 500; }
.links .headline { display: block; }
.links .by { display: block; color: var(--mute); font-size: .95rem; }

/* ---------- pie ---------- */
.site-foot { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 3rem var(--gut) 1.5rem; color: var(--mute); font-size: .95rem; }
.site-foot a { color: inherit; }

/* ---------- móvil ---------- */
@media (max-width: 900px) {
  .index { grid-template-columns: 1fr; }
  .preview { display: none; }
  .rows { border-top: 0; }
  .rows li { border-bottom: 0; margin-bottom: 2rem; }
  .row { grid-template-columns: 1fr auto; padding: 0; }
  .row-thumb { display: block; grid-column: 1 / -1; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; margin-bottom: .6rem; background: var(--rule); }
  .row-thumb--video { display: grid; place-items: center; color: var(--paper); background: var(--ink); }
  .row-title { grid-column: 1; grid-row: 2; font-size: 1.6rem; }
  .row-year { grid-column: 2; grid-row: 2; padding-top: .35rem; }
  .row-place { grid-column: 1 / -1; grid-row: 3; }
  .project, .film, .about { grid-template-columns: 1fr; }
  .mobile-cover { display: block; }
  .plates .plate:first-child:not(.video) { display: none; }
  .facts div { grid-template-columns: 8rem minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .site-head nav { gap: 1rem; }
  .facts div { grid-template-columns: 1fr; gap: 0; }
  .facts dt { font-size: .85rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
