:root {
  --paper: oklch(96% 0.018 82);
  --paper-deep: oklch(90% 0.026 78);
  --ink: oklch(22% 0.024 62);
  --ink-soft: oklch(42% 0.026 63);
  --red: oklch(41% 0.12 28);
  --blue: oklch(43% 0.07 244);
  --line: oklch(72% 0.035 75);
  --display: "Iowan Old Style", "Baskerville", "Times New Roman", serif;
  --sans: "Avenir Next", "Gill Sans", "Trebuchet MS", sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--display);
  line-height: 1.5;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-underline-offset: .2em; }
img { display: block; max-width: 100%; }
.skip { position: fixed; top: .5rem; left: .5rem; z-index: 20; padding: .6rem 1rem; background: var(--ink); color: var(--paper); transform: translateY(-150%); }
.skip:focus { transform: none; }

.site-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 2rem;
  min-height: 5.5rem;
  padding: 1rem clamp(1.1rem, 4vw, 4.5rem);
  border-bottom: 1px solid var(--ink);
  font-family: var(--sans);
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.wordmark { display: flex; align-items: baseline; gap: .8rem; text-decoration: none; }
.wordmark span { color: var(--red); }
.wordmark strong { font-family: var(--display); font-size: 1.7rem; letter-spacing: .02em; }
.site-head nav { display: flex; gap: 1.6rem; }
.site-head nav a { text-decoration: none; }
.site-head nav a:hover, .site-head nav a:focus-visible { color: var(--red); }
.edition { justify-self: end; color: var(--ink-soft); }

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(18rem, .78fr) minmax(0, 1.6fr);
  gap: clamp(2rem, 6vw, 7rem);
  min-height: calc(100svh - 5.5rem);
  padding: clamp(4rem, 8vw, 8rem) clamp(1.1rem, 4vw, 4.5rem) 4rem;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0 68% 0 auto;
  width: 1px;
  background: color-mix(in oklch, var(--line), transparent 35%);
}
.kicker {
  margin: 0 0 1.1rem;
  color: var(--red);
  font-family: var(--sans);
  font-size: .72rem;
  font-weight: 650;
  letter-spacing: .16em;
  text-transform: uppercase;
}
h1, h2 { font-family: var(--display); font-weight: 500; text-wrap: balance; }
h1 {
  margin: 0;
  font-size: clamp(4.4rem, 8.6vw, 9.4rem);
  line-height: .77;
  letter-spacing: -.065em;
}
.standfirst { max-width: 32rem; margin: 3rem 0 0; font-size: clamp(1.15rem, 1.8vw, 1.55rem); line-height: 1.45; }
.hero-cue { max-width: 29rem; margin: 1.35rem 0 0; padding-top: 1rem; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: .92rem; }
.hero-cue b { color: var(--red); font-weight: 600; }
.hero-index { display: grid; gap: .55rem; margin-top: 3rem; font-family: var(--sans); font-size: .76rem; }
.hero-index span { display: grid; grid-template-columns: 5.2rem 1fr; align-items: baseline; border-top: 1px solid var(--line); padding-top: .45rem; }
.hero-index b { font-family: var(--display); font-size: 1.25rem; font-weight: 500; }
.hero-pair { position: relative; min-height: 44rem; align-self: center; }
.hero-photo { position: absolute; margin: 0; overflow: hidden; background: var(--paper-deep); }
.hero-photo:nth-child(1) { inset: 0 12% 35% 0; }
.hero-photo:nth-child(2) { inset: 55% 0 7% 62%; z-index: 3; box-shadow: -1.2rem 1.2rem 0 var(--paper); }
.hero-photo.factory-memory { inset: 28% 12% 25% 4%; z-index: 2; overflow: visible; border: .55rem solid var(--paper); box-shadow: 0 1.5rem 3rem oklch(20% 0.02 60 / .2); }
.hero-photo.factory-memory::before {
  content: "LO QUE OCUPABA EL VACÍO";
  position: absolute;
  right: calc(100% + .75rem);
  bottom: -.55rem;
  color: var(--red);
  font-family: var(--sans);
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}
.hero-photo button { width: 100%; height: 100%; padding: 0; border: 0; cursor: zoom-in; background: none; }
.hero-photo .open-mark, .sequence-card .open-mark { display: none; }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.78) contrast(1.05); transition: transform 900ms var(--ease), filter 400ms ease; }
.hero-photo.factory-memory .image-button, .hero-photo.factory-memory .image-frame { display: block; width: 100%; height: 100%; }
.hero-photo.factory-memory img { object-position: center; filter: grayscale(1) contrast(1.08); }
.hero-photo button:hover img { transform: scale(1.025); filter: saturate(1) contrast(1.03); }
.hero-photo figcaption { position: absolute; inset: auto .7rem .55rem; padding: .45rem .55rem; background: color-mix(in oklch, var(--paper) 90%, transparent); font-family: var(--sans); font-size: .68rem; }
.hero-photo:nth-child(1) figcaption { inset: .55rem auto auto .7rem; }
.hero-photo.factory-memory figcaption { inset: .55rem .7rem auto auto; }
.margin-note { position: absolute; right: .8rem; top: 50%; margin: 0; color: var(--ink-soft); font-family: var(--sans); font-size: .65rem; letter-spacing: .14em; text-transform: uppercase; writing-mode: vertical-rl; }

.section-head h2, .archive h2, .method h2 { margin: 0; font-size: clamp(2.8rem, 5vw, 6rem); line-height: .92; letter-spacing: -.045em; }

.sequence { padding: clamp(5rem, 10vw, 10rem) 0; }
.section-head { display: grid; grid-template-columns: 1.1fr 1fr; gap: 3rem; padding: 0 clamp(1.1rem, 7vw, 8rem) 4rem; }
.section-head .kicker { grid-column: 1 / -1; }
.section-head p:last-child { max-width: 33rem; margin: 0; align-self: end; font-size: 1.1rem; }
.sequence-list { display: flex; gap: clamp(.8rem, 1.5vw, 1.5rem); overflow-x: auto; padding: 0 clamp(1.1rem, 7vw, 8rem) 2rem; scroll-snap-type: x mandatory; scrollbar-color: var(--red) var(--paper-deep); }
.sequence-card { flex: 0 0 clamp(17rem, 30vw, 31rem); scroll-snap-align: start; }
.sequence-card:nth-child(3n+2) { margin-top: 5rem; }
.sequence-card:nth-child(4n) { flex-basis: clamp(14rem, 23vw, 24rem); }
.image-button { position: relative; width: 100%; padding: 0; border: 0; color: inherit; background: none; cursor: zoom-in; text-align: left; }
.sequence-card .image-frame { height: clamp(20rem, 42vw, 37rem); overflow: hidden; background: var(--paper-deep); }
.sequence-card:nth-child(4n) .image-frame { height: clamp(16rem, 32vw, 29rem); }
.image-frame img { width: 100%; height: 100%; object-fit: cover; transition: transform 700ms var(--ease), filter 300ms ease; }
.image-button:hover img, .image-button:focus-visible img { transform: scale(1.025); filter: contrast(1.05); }
.sequence-card time { display: block; margin-top: .8rem; color: var(--red); font-family: var(--sans); font-size: .67rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.sequence-card h3 { margin: .2rem 0 0; font-size: 1.35rem; font-weight: 500; }
.sequence-card p { margin: .45rem 0 0; color: var(--ink-soft); font-size: .9rem; }

.archive { padding: clamp(5rem, 9vw, 9rem) clamp(1.1rem, 4vw, 4.5rem); border-top: 1px solid var(--ink); }
.archive-head { display: grid; grid-template-columns: 1.5fr .7fr; gap: 4rem; align-items: end; }
.archive-head p:last-child { max-width: 30rem; margin: 0; color: var(--ink-soft); font-size: .9rem; }
.controls { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; gap: 2rem; margin: 3rem -1rem 2rem; padding: .8rem 1rem; border-block: 1px solid var(--line); background: color-mix(in oklch, var(--paper) 94%, transparent); backdrop-filter: blur(12px); font-family: var(--sans); }
.filter-row { display: flex; flex-wrap: wrap; gap: .25rem; }
.filter { padding: .45rem .7rem; border: 0; border-radius: 0; color: var(--ink-soft); background: transparent; cursor: pointer; font-size: .76rem; }
.filter:hover, .filter:focus-visible { color: var(--red); }
.filter.is-active { color: var(--paper); background: var(--ink); }
.search { display: flex; align-items: center; gap: .7rem; color: var(--ink-soft); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }
.search input { width: min(18rem, 30vw); padding: .35rem .2rem; border: 0; border-bottom: 1px solid var(--ink); border-radius: 0; outline: 0; color: var(--ink); background: transparent; font-family: var(--sans); font-size: .82rem; }
.search input:focus { border-color: var(--red); }
.gallery { columns: 4 17rem; column-gap: 1rem; }
.gallery-item { display: inline-block; width: 100%; margin: 0 0 1.5rem; break-inside: avoid; }
.gallery-item[hidden] { display: none; }
.gallery-item .image-frame { overflow: hidden; background: var(--paper-deep); }
.gallery-item img { width: 100%; height: auto; }
.gallery-item .open-mark { position: absolute; right: .5rem; bottom: .5rem; width: 1.8rem; height: 1.8rem; display: grid; place-items: center; color: var(--paper); background: color-mix(in oklch, var(--ink) 80%, transparent); font-family: var(--sans); font-size: .9rem; opacity: 0; transform: translateY(.4rem); transition: opacity 220ms ease, transform 350ms var(--ease); }
.gallery-item .image-button:hover .open-mark, .gallery-item .image-button:focus-visible .open-mark { opacity: 1; transform: none; }
.gallery-meta { display: grid; grid-template-columns: 3.6rem 1fr; gap: .6rem; margin-top: .55rem; }
.gallery-meta time { color: var(--red); font-family: var(--sans); font-size: .65rem; font-weight: 700; text-transform: uppercase; }
.gallery-meta h3 { margin: 0; font-size: .92rem; font-weight: 500; line-height: 1.25; }
.empty { padding: 5rem 0; color: var(--ink-soft); text-align: center; }

.method { display: grid; grid-template-columns: .8fr 1.5fr; gap: clamp(3rem, 8vw, 9rem); padding: clamp(5rem, 9vw, 9rem) clamp(1.1rem, 7vw, 8rem); color: var(--paper); background: var(--blue); }
.method-columns { columns: 3 13rem; column-gap: 2rem; }
.method-columns p { margin: 0 0 1.5rem; break-inside: avoid; color: color-mix(in oklch, var(--paper), var(--blue) 14%); }
.method-columns b { color: var(--paper); }
footer { display: flex; justify-content: space-between; gap: 2rem; padding: 2rem clamp(1.1rem, 4vw, 4.5rem); color: var(--paper-deep); background: var(--ink); font-family: var(--sans); font-size: .72rem; }
footer p { margin: 0; }

.viewer { width: min(94vw, 88rem); max-width: none; height: min(92vh, 58rem); padding: 0; border: 0; color: var(--ink); background: var(--paper); box-shadow: 0 2rem 8rem oklch(10% 0.01 60 / .55); }
.viewer::backdrop { background: oklch(12% 0.018 60 / .82); }
.viewer-close { position: absolute; top: 1rem; right: 1rem; z-index: 2; padding: .55rem .75rem; border: 1px solid var(--ink); color: var(--ink); background: var(--paper); cursor: pointer; font-family: var(--sans); font-size: .72rem; text-transform: uppercase; }
.viewer-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(18rem, .7fr); height: 100%; }
.viewer figure { display: grid; place-items: center; min-width: 0; margin: 0; padding: 2rem; background: var(--ink); }
.viewer figure img { max-width: 100%; max-height: calc(92vh - 4rem); object-fit: contain; }
.viewer article { align-self: end; max-height: 100%; overflow-y: auto; padding: 5rem 2.2rem 2.5rem; }
.viewer-date { color: var(--red); font-family: var(--sans); font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.viewer article h2 { margin: .4rem 0 1.2rem; font-size: clamp(2.2rem, 4vw, 4.5rem); line-height: .9; }
.viewer-caption { color: var(--ink-soft); }
.viewer dl { margin: 2rem 0; border-top: 1px solid var(--line); font-family: var(--sans); font-size: .75rem; }
.viewer dl div { display: grid; grid-template-columns: 5rem 1fr; gap: .8rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.viewer dt { color: var(--ink-soft); }
.viewer dd { margin: 0; overflow-wrap: anywhere; }
.viewer-source { font-family: var(--sans); font-size: .78rem; color: var(--red); }

@media (max-width: 850px) {
  .site-head { grid-template-columns: 1fr auto; }
  .site-head nav { display: none; }
  .edition { display: none; }
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .hero::before, .margin-note { display: none; }
  .hero-pair { min-height: 44rem; }
  .section-head, .archive-head, .method { grid-template-columns: 1fr; }
  .controls { align-items: flex-start; flex-direction: column; }
  .search { width: 100%; }
  .search input { width: 100%; }
  .viewer { width: 100vw; height: 100dvh; }
  .viewer-layout { grid-template-columns: 1fr; grid-template-rows: minmax(40vh, 1fr) auto; overflow-y: auto; }
  .viewer figure { min-height: 45vh; }
  .viewer figure img { max-height: 48vh; }
  .viewer article { overflow: visible; padding-top: 2rem; }
}

@media (max-width: 540px) {
  .wordmark span { display: none; }
  .hero { padding-top: 3rem; }
  .hero-pair { min-height: 48rem; }
  .hero-photo:nth-child(1) { inset: 0 5% 68% 0; }
  .hero-photo.factory-memory { inset: 30% 0 45% 5%; }
  .hero-photo:nth-child(2) { inset: 62% 0 5% 28%; }
  .section-head { grid-template-columns: 1fr; }
  .section-head .kicker { grid-column: auto; }
  .sequence-card:nth-child(3n+2) { margin-top: 2.5rem; }
  .method-columns { columns: 1; }
  footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
