/* ── Tokens ───────────────────────────────────────────── */
:root {
  --bg: #0a0908;          /* warm near-black, like a cinema before the lights go down */
  --bg-2: #14110f;
  --ink: #ece6dc;         /* paper white */
  --ink-dim: #8f877c;
  --line: #2a2520;
  --accent: #ff8a3d;      /* sodium streetlamp amber — the only colour */
  --display: "Bebas Neue", "Oswald", Impact, "Arial Narrow", sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: 16px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
@media (min-width: 700px)  { :root { --gutter: 40px; } }
@media (min-width: 1200px) { :root { --gutter: 72px; } }

/* ── Base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* film grain — barely there */
.grain {
  position: fixed; inset: 0; z-index: 50; pointer-events: none; opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── Header / footer ──────────────────────────────────── */
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(18px + env(safe-area-inset-top)) var(--gutter) 18px;
}
.brand {
  font: 400 26px/1 var(--display); letter-spacing: .12em; text-decoration: none;
}
.social { display: flex; gap: 18px; flex-wrap: wrap; }
.social a {
  font-size: 12px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
  text-decoration: none; color: var(--ink-dim); padding: 6px 0;
  transition: color .3s var(--ease);
}
.social a:hover { color: var(--accent); }

.bottom {
  margin-top: 96px; padding: 48px var(--gutter) calc(40px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  display: grid; gap: 18px;
}
.credit { margin: 0; font: 400 30px/1 var(--display); letter-spacing: .04em; }
.credit a { color: var(--accent); text-decoration: none; }
.fine { margin: 0; font-size: 12px; color: var(--ink-dim); }
@media (min-width: 700px) {
  .bottom { grid-template-columns: 1fr auto; align-items: end; }
  .fine { grid-column: 1 / -1; }
}

/* ── Hero: a poster title card ────────────────────────── */
.hero { padding: 48px var(--gutter) 40px; overflow: hidden; }
.eyebrow {
  margin: 0 0 18px; font-size: 11px; font-weight: 600;
  letter-spacing: .28em; text-transform: uppercase; color: var(--accent);
}
.hero h1 {
  margin: 0; font: 400 clamp(64px, 22vw, 220px)/.86 var(--display);
  letter-spacing: .01em; text-transform: uppercase;
}
.hero h1 span { color: transparent; -webkit-text-stroke: 1px var(--ink); }
.lede { max-width: 34ch; margin: 24px 0 0; color: var(--ink-dim); }

/* ── Filters ──────────────────────────────────────────── */
.filters {
  position: sticky; top: 0; z-index: 10;
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  padding: 14px var(--gutter);
  background: linear-gradient(var(--bg) 70%, transparent);
}
.filters::-webkit-scrollbar { display: none; }
.chip {
  flex: none; cursor: pointer;
  padding: 10px 18px; border: 1px solid var(--line); border-radius: 999px; background: transparent;
  font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-dim);
  transition: color .3s var(--ease), border-color .3s var(--ease), background .3s var(--ease);
}
.chip:hover { color: var(--ink); border-color: var(--ink-dim); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--bg); }

/* ── Grid: exhibition wall ────────────────────────────── */
.grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 28px 12px; padding: 16px var(--gutter) 0; grid-auto-flow: dense;
}
@media (min-width: 700px)  { .grid { grid-template-columns: repeat(4, 1fr); gap: 48px 24px; } }
@media (min-width: 1200px) { .grid { gap: 64px 32px; } }
/* Wide (PC-only) pieces span two columns in a cinematic 16:9 frame */
.card.wide { grid-column: span 2; }
.card.wide .frame { aspect-ratio: 16 / 9; }

.card {
  display: block; align-self: start; width: 100%; padding: 0; border: 0; background: none; text-align: left; cursor: pointer;
  animation: rise .8s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 60ms);
}
.frame {
  position: relative; overflow: hidden; aspect-ratio: 4 / 5; background: var(--bg-2);
}
.frame img {
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transform: scale(1.06);
  transition: opacity 1s var(--ease), transform 1.4s var(--ease);
}
.frame img.loaded { opacity: 1; transform: scale(1); }
@media (hover: hover) {
  .card:hover .frame img.loaded { transform: scale(1.04); }
  .card:hover .plate h3 { color: var(--accent); }
}
.frame .missing {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 12px;
  font-size: 11px; text-align: center; color: var(--ink-dim);
}

.plate { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; padding-top: 12px; }
.plate .no { grid-row: span 2; font: 400 13px/1.2 var(--display); letter-spacing: .1em; color: var(--accent); padding-top: 3px; }
.plate h3 {
  margin: 0; font: 400 clamp(20px, 5.4vw, 28px)/1 var(--display); letter-spacing: .03em;
  transition: color .3s var(--ease);
}
.plate .meta { font-size: 10px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-dim); }

.empty { padding: 40px var(--gutter); color: var(--ink-dim); }

@keyframes rise { from { opacity: 0; transform: translateY(16px); } }

/* ── Viewer: full-screen ──────────────────────────────── */
.viewer {
  position: fixed; inset: 0; z-index: 100;
  display: grid; grid-template-rows: 1fr auto;
  background: #060504;
  animation: fade .4s var(--ease);
}
.viewer[hidden] { display: none; }
.v-stage {
  margin: 0; min-height: 0; overflow: hidden;
  padding: calc(64px + env(safe-area-inset-top)) 12px 8px;
}
.v-stage img {
  width: 100%; height: 100%; object-fit: contain;
  opacity: 0; transform: scale(.98);
  transition: opacity .6s var(--ease), transform .8s var(--ease);
  -webkit-touch-callout: default;
}
.v-stage img.loaded { opacity: 1; transform: none; }

.v-panel {
  padding: 16px var(--gutter) calc(20px + env(safe-area-inset-bottom));
  display: grid; gap: 14px;
}
.v-meta h2 { margin: 0; font: 400 34px/1 var(--display); letter-spacing: .03em; }
.v-cat { margin: 0 0 4px; font-size: 11px; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; color: var(--accent); }
.v-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  flex: 1 1 140px; display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 13px 18px; min-height: 52px; text-decoration: none; text-align: center;
  border: 1px solid var(--accent); color: var(--accent);
  font-size: 13px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  transition: background .3s var(--ease), color .3s var(--ease);
}
.btn small { font-size: 10px; font-weight: 500; letter-spacing: .1em; opacity: .7; margin-top: 2px; }
.btn.primary, .btn:hover { background: var(--accent); color: var(--bg); }
.v-hint { margin: 0; font-size: 12px; color: var(--ink-dim); }

.v-close {
  position: absolute; z-index: 2; top: calc(14px + env(safe-area-inset-top)); right: var(--gutter);
  padding: 10px 0; background: none; border: 0; cursor: pointer;
  font-size: 12px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-dim);
}
.v-close:hover { color: var(--accent); }
.v-nav {
  position: absolute; z-index: 2; top: 45%; display: none;
  width: 52px; height: 52px; border: 1px solid var(--line); border-radius: 50%; background: rgba(10, 9, 8, .6);
  font-size: 26px; line-height: 1; cursor: pointer; color: var(--ink);
  transition: border-color .3s var(--ease), color .3s var(--ease);
}
.v-nav:hover { border-color: var(--accent); color: var(--accent); }
.v-prev { left: 20px; }
.v-next { right: 20px; }

@media (min-width: 900px) {
  .viewer { grid-template-rows: 1fr; grid-template-columns: 1fr 360px; }
  .v-stage { padding: 48px 88px; }
  .v-panel { align-content: end; padding: 48px 40px; border-left: 1px solid var(--line); }
  .v-meta h2 { font-size: 52px; }
  .v-actions { flex-direction: column; }
  .btn { flex: none; }
  .v-nav { display: block; }
  .v-next { right: 380px; }
}

@keyframes fade { from { opacity: 0; } }

body.locked { overflow: hidden; }
.viewer:focus { outline: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .frame img, .v-stage img { opacity: 1; transform: none; }
}
