/* Layout: one white table. Small quiet UI type at the edges, large light display type for names, images do the talking. */
:root {
  --bg: #ffffff;
  --fg: #111110;
  --muted: #72716d; /* 4.9:1 on the table white, so small grey text passes WCAG AA */
  --faint: #c4c3bf;
  --line: #e7e6e2;
  --tile: #f1f0ee;
  --font: "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --pad: clamp(16px, 1.6vw, 22px);
  --ui: 13px;
  --display: clamp(40px, 8.4vw, 132px);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font: 400 var(--ui)/1.4 var(--font);
  letter-spacing: .01em;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
p, h1, h2, ol, ul, dl, dd, figure { margin: 0; padding: 0; }
ol, ul { list-style: none; }
img { display: block; max-width: 100%; }
sup { font-size: .62em; line-height: 0; vertical-align: super; margin-left: 1px; }
.muted { color: var(--muted); }
:focus-visible { outline: 1px solid var(--fg); outline-offset: 3px; }

.eyebrow { font-size: var(--ui); font-weight: 400; }
.display {
  font-size: var(--display); font-weight: 400;
  line-height: .95; letter-spacing: -.035em;
  text-wrap: balance;
}
.link, .nav__link { position: relative; }
.link::after, .nav__link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: right;
  transition: transform .4s var(--ease);
}
.link:hover::after, .nav__link:hover::after, .nav__link[aria-current="page"]::after {
  transform: scaleX(1); transform-origin: left;
}

/* ---------- bars ---------- */
.bar {
  position: fixed; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--pad);
  pointer-events: none;
}
.bar > * { pointer-events: auto; }
.bar--top { top: 0; padding-top: calc(var(--pad) + var(--safe-t)); }
.bar--bottom { bottom: 0; justify-content: center; padding-bottom: calc(var(--pad) + var(--safe-b)); clip-path: inset(-80px 0 0 0); transition: clip-path .5s var(--ease); }
.bar--bottom.is-off { clip-path: inset(100% 0 0 0); } /* wiped away downwards; nothing on this site fades */
.bar--bottom.is-off > * { pointer-events: none; }
.nav { display: flex; gap: 18px; }

/* lens: a focus scale that slides under a fixed index mark, plus the aperture */
.lens {
  position: relative;
  display: flex; align-items: center; gap: 14px;
  padding: 6px 16px;
  background: rgba(255, 255, 255, .94);
  border-radius: 14px;
  touch-action: none;
  user-select: none; -webkit-user-select: none;
}
/* the cue for the focus gesture: shown once, gone after the first use */
.cue {
  position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%);
  padding-bottom: 4px;
  font-size: 12px; color: var(--muted); white-space: nowrap;
  pointer-events: none;
  clip-path: inset(100% 0 0 0);
  transition: clip-path .7s var(--ease);
}
.cue.is-on { clip-path: inset(0); }
.ring {
  position: relative;
  width: min(360px, calc(100vw - 124px)); height: 52px;
  overflow: hidden;
  cursor: ew-resize;
  touch-action: none;
  user-select: none; -webkit-user-select: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.ring__readout {
  position: absolute; left: 50%; top: 0; transform: translateX(-50%);
  font-size: 12px; color: var(--fg); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.ring__index { position: absolute; left: 50%; top: 17px; width: 1.5px; height: 12px; margin-left: -.75px; background: var(--fg); }
.ring__strip {
  position: absolute; left: 0; top: 22px; height: 28px;
  background: repeating-linear-gradient(90deg, var(--muted) 0 1px, transparent 1px 11px) 0 0 / 100% 6px no-repeat;
  will-change: transform;
}
.ring__label {
  position: absolute; top: 8px; transform: translateX(-50%);
  white-space: nowrap; font-size: 14px;
  color: var(--muted);
  transition: color .3s var(--ease);
  cursor: pointer;
}
.ring__label.is-active, .ring__label:hover { color: var(--fg); }
.aperture { font-variant-numeric: tabular-nums; min-width: 38px; text-align: right; font-size: 14px; }

/* ---------- field ---------- */
.stage {
  position: fixed; inset: 0; z-index: 0; /* own stacking layer, so prints never cover the bars */
  overflow: hidden;
  touch-action: none;
}
.world { position: absolute; left: 0; top: 0; will-change: transform; }
/* WebGPU draws the prints; the DOM tiles stay for keyboard and screen readers */
.field-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.stage.is-gpu .world { opacity: 0; pointer-events: none; }
.stage.is-point { cursor: pointer; }
.tile {
  position: absolute; left: 0; top: 0;
  background: var(--tile);
  transform-origin: 50% 50%;
  will-change: transform;
  cursor: pointer;
  user-select: none; -webkit-user-select: none;
}
.tile { background-size: cover; background-position: center; }
.tile img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; -webkit-user-drag: none; }

/* autofocus brackets shown when you tap or click a soft print */
.reticle { position: fixed; left: 0; top: 0; z-index: 41; pointer-events: none; visibility: hidden; }
.reticle i { position: absolute; width: 12px; height: 12px; border: 0 solid var(--fg); }
.reticle i:nth-child(1) { left: 0; top: 0; border-width: 1px 0 0 1px; }
.reticle i:nth-child(2) { right: 0; top: 0; border-width: 1px 1px 0 0; }
.reticle i:nth-child(3) { left: 0; bottom: 0; border-width: 0 0 1px 1px; }
.reticle i:nth-child(4) { right: 0; bottom: 0; border-width: 0 1px 1px 0; }
.reticle.is-on { animation: af .9s var(--ease) both; }
@keyframes af {
  0% { visibility: visible; scale: 1.35; }
  25% { scale: 1; }
  42% { visibility: visible; }
  43%, 55% { visibility: hidden; }
  56%, 99% { visibility: visible; }
  100% { visibility: hidden; scale: 1; }
}
.stage.is-over, .stage.is-over .tile { cursor: none; }

.cursor {
  position: fixed; left: 0; top: 0; z-index: 40;
  pointer-events: none;
  color: #fff;
  visibility: hidden;
  text-shadow: 0 0 10px rgba(0, 0, 0, .4);
}
.cursor.is-on { visibility: visible; }
.cursor__cross { position: absolute; width: 17px; height: 17px; left: -8px; top: -8px; filter: drop-shadow(0 0 3px rgba(0, 0, 0, .4)); }
.cursor__cross::before, .cursor__cross::after { content: ""; position: absolute; background: currentColor; }
.cursor__cross::before { left: 8px; top: 0; width: 1px; height: 17px; }
.cursor__cross::after { top: 8px; left: 0; height: 1px; width: 17px; }
.cursor__label { position: absolute; left: 0; top: 14px; transform: translateX(-50%); white-space: nowrap; }

/* ---------- pages ---------- */
.page {
  position: fixed; inset: 0; z-index: 20;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  clip-path: inset(0 0 100% 0);
  transition: clip-path .42s var(--ease);
}
.page.is-on { clip-path: inset(0); }
/* a section that only adds labels over the table: the prints underneath stay interactive */
.page--over { overflow: hidden; pointer-events: none; }
.page--over a, .page--over button { pointer-events: auto; }
.over__head { position: absolute; left: var(--pad); top: calc(var(--pad) * 3.6 + var(--safe-t)); }
.page__inner {
  min-height: 100%;
  display: flex; flex-direction: column;
  padding-block: calc(var(--pad) * 5 + var(--safe-t)) calc(var(--pad) + var(--safe-b));
  padding-left: max(var(--pad), env(safe-area-inset-left, 0px));
  padding-right: max(var(--pad), env(safe-area-inset-right, 0px));
}
.colophon {
  margin-top: auto; padding-top: calc(var(--pad) * 5);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.colophon--pad { padding-bottom: 56px; }

.meta { display: grid; gap: 6px; }
.meta div { display: grid; grid-template-columns: 72px 1fr; gap: 12px; }
.meta--wide div { grid-template-columns: 104px 1fr; }
.meta dt { color: var(--muted); }

/* ---------- series: piles ---------- */
.pile-label {
  position: absolute; transform: translateX(-50%);
  display: grid; gap: 2px; justify-items: center; text-align: center;
  white-space: nowrap;
}
.pile-label__title { font-size: clamp(17px, 1.7vw, 24px); letter-spacing: -.02em; line-height: 1.1; }
.pile-label__title sup { font-size: .5em; margin-left: 2px; }

/* ---------- series detail: a sequence you scroll sideways ---------- */
.seq { position: absolute; inset: 0; will-change: transform; }
.seq--ghost [data-rise] { animation: none !important; }
.seq__head > *, .seq__next > * { transform-origin: 0 100%; } /* the copy that leaves with the last series */
.seq__head {
  position: absolute; top: 52%; transform: translateY(-50%);
  display: grid; gap: clamp(14px, 1.8vw, 24px);
}
.seq__title { font-size: clamp(38px, 5.4vw, 88px); font-weight: 400; line-height: .95; letter-spacing: -.035em; text-wrap: balance; }
.seq__text { font-size: clamp(15px, 1.3vw, 18px); line-height: 1.4; letter-spacing: -.005em; max-width: 44ch; }
.seq__next {
  position: absolute; top: 52%; transform: translateY(-50%);
  display: grid; gap: 10px; white-space: nowrap;
}
.seq__next .seq__title { transition: transform .6s var(--ease); }
@media (hover: hover) { .seq__next:hover .seq__title { transform: translateX(1.2vw); } }
.seq__foot {
  position: absolute; left: var(--pad); right: var(--pad); bottom: calc(var(--pad) + var(--safe-b));
  display: flex; justify-content: space-between; font-variant-numeric: tabular-nums;
}

/* ---------- catalogue: histogram ---------- */
.hist__head { right: var(--pad); display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.toggle { display: flex; gap: .4em; }
.toggle__btn { color: var(--muted); transition: color .3s var(--ease); }
.toggle__btn.is-active, .toggle__btn:hover { color: var(--fg); }
.hist__readout {
  position: absolute; left: var(--pad); right: var(--pad); top: calc(var(--pad) * 5.2 + var(--safe-t));
  text-align: center; white-space: pre-wrap; min-height: 1.4em;
  font-variant-numeric: tabular-nums;
}
.hist__axis { position: absolute; height: 28px; border-top: 1px solid var(--fg); }
.hist__axis span { position: absolute; top: 8px; transform: translateX(-50%); white-space: nowrap; color: var(--muted); }
.hist__axis span.is-start { transform: none; }
.hist__axis span.is-end { transform: translateX(-100%); }

/* ---------- info ---------- */
.statement {
  margin-top: calc(var(--pad) * 2);
  max-width: 24em;
  font-size: clamp(24px, 3.6vw, 54px); line-height: 1.08; letter-spacing: -.025em;
  text-wrap: balance;
}
.info-grid {
  margin-top: clamp(48px, 8vw, 120px);
  display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(28px, 5vw, 80px);
  align-items: start;
}
.info-portrait { display: grid; gap: 8px; }
.info-portrait img { width: 100%; height: auto; background: var(--tile); }
.info-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(32px, 4vw, 56px) var(--pad); }
.info-cols > div { display: grid; gap: 12px; align-content: start; }
.info-cols .eyebrow { color: var(--muted); }
.info-cols p { max-width: 40ch; }
.plain { display: grid; gap: 6px; }
.plain--rows li { display: flex; justify-content: space-between; gap: 12px; max-width: 320px; }

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 70;
  /* no backdrop: the viewer is the table itself, cleared of every print but one */
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
}
/* its own lines of text are wiped in, and the site's menu, lens and section text step aside */
.lightbox__bar, .lightbox__caption { clip-path: inset(0 0 100% 0); transition: clip-path .42s var(--ease); }
.lightbox.is-on .lightbox__bar, .lightbox.is-on .lightbox__caption { clip-path: inset(0); transition-delay: .25s; }
body.is-viewing .bar--top { clip-path: inset(0 0 100% 0); }
body.is-viewing .bar--bottom { clip-path: inset(100% 0 0 0); }
body.is-viewing .page { clip-path: inset(0 0 100% 0); }
.bar--top { transition: clip-path .42s var(--ease); clip-path: inset(0 0 -80px 0); }
.lightbox:focus, .lightbox__nav:focus { outline: none; }
.lightbox__bar, .lightbox__caption {
  display: flex; justify-content: space-between; align-items: baseline; gap: 14px;
  padding: var(--pad);
  font-variant-numeric: tabular-nums;
}
/* above the two halves that step back and forward, so Close and the series link can be clicked */
.lightbox__bar, .lightbox__caption { position: relative; z-index: 2; }
.lightbox__bar { padding-top: calc(var(--pad) + var(--safe-t)); }
.lightbox__close, .lightbox__caption a { position: relative; z-index: 2; }
.lightbox__caption { justify-content: center; flex-wrap: wrap; padding-bottom: calc(var(--pad) + var(--safe-b)); }
.lightbox__figure { min-height: 0; display: grid; place-items: center; padding: 0 var(--pad); }
.lightbox__figure img { max-width: none; object-fit: cover; visibility: hidden; }
.lightbox__nav { position: absolute; top: 0; bottom: 0; width: 50%; z-index: 1; }
.lightbox__nav--prev { left: 0; cursor: w-resize; }
.lightbox__nav--next { right: 0; cursor: e-resize; }

/* ---------- tuning panel (press T) ---------- */
.tune {
  position: fixed; right: var(--pad); top: calc(var(--pad) * 3 + var(--safe-t)); z-index: 80;
  width: min(280px, calc(100vw - var(--pad) * 2));
  max-height: calc(100% - var(--pad) * 5); overflow-y: auto;
  padding: 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  display: grid; gap: 10px;
  font-size: 12px;
}
.tune__head, .tune__foot { display: flex; justify-content: space-between; gap: 12px; }
.tune__row { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; }
.tune__row output { color: var(--muted); font-variant-numeric: tabular-nums; }
.tune__row input { grid-column: 1 / -1; width: 100%; accent-color: var(--fg); }
.tune button { text-decoration: underline; text-underline-offset: 3px; }
.tune__text { width: 100%; height: 64px; font: 11px/1.3 ui-monospace, monospace; border: 1px solid var(--line); color: var(--fg); background: var(--bg); }

/* ---------- entrances: each block of text is wiped in from its top edge, one after another ---------- */
.page.is-on [data-rise] { animation: rise .9s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 70ms + 120ms); }
@keyframes rise { from { clip-path: inset(0 0 100% 0); transform: translateY(12px); } to { clip-path: inset(0 0 -10% 0); } }

/* ---------- small screens ---------- */
@media (max-width: 720px) {
  .nav { gap: 14px; }
  .lens { padding: 14px 16px 12px; } /* a taller target for a thumb */
  .seq__head { top: 50%; }
  .hist__head { flex-wrap: wrap; }
  .hist__readout { top: calc(var(--pad) * 6.6 + var(--safe-t)); font-size: 12px; }
  .info-grid, .info-cols { grid-template-columns: minmax(0, 1fr); }
  .info-portrait { max-width: 70%; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .01ms !important; animation: none !important; }
}
