/*
VOICE   quiet, cinematic, a little haunted — a gallery after closing time
IDEA    a projection room: photos glow like frames on a screen in a dark, dusty room
PICTURE the photographs themselves, full-bleed, under film grain and a soft vignette
COLOUR  smoke-black ground, bone-white type, faded wallpaper rose, visor teal for actions
TYPE    Instrument Serif for titles, Manrope for everything else
LAYOUT  full-bleed hero, then a justified photo wall with a chapter rail; lightbox for prints
*/
:root {
  color-scheme: dark;
  --bg: #11100f;
  --bg2: #1a1816;
  --ink: #ece4d6;
  --muted: #a69c8d;
  --line: #2c2824;
  --rose: #c99a8a;
  --visor: #8cc5bd;
  --visor-ink: #0d1615;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; min-width: 0; }
html { scroll-padding-top: 80px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.6 var(--sans); overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--visor); outline-offset: 3px; }

/* film grain over everything */
body::after {
  content: ""; position: fixed; inset: -50%; pointer-events: none; z-index: 50; 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='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -1%); } 80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}

/* header */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; gap: 8px 28px;
  align-items: center; justify-content: space-between;
  padding: 14px max(4vw, 16px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.brand { font: 26px/1 var(--serif); text-decoration: none; letter-spacing: .01em; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 14px; }
.nav a { text-decoration: none; color: var(--muted); padding: 10px 0; }
.nav a:hover, .nav a[aria-current] { color: var(--ink); }
.nav .shop { color: var(--visor); }

/* hero (home) */
.hero { position: relative; min-height: min(92vh, 900px); display: grid; align-items: end; isolation: isolate; overflow: hidden; }
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2;
  animation: drift 40s ease-in-out infinite alternate; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(120% 90% at 50% 40%, transparent 35%, rgba(8,7,6,.85) 100%),
              linear-gradient(to top, var(--bg) 0%, transparent 45%); }
@keyframes drift { from { transform: scale(1.04) translate(0, 0); } to { transform: scale(1.12) translate(-1.5%, -1%); } }
.hero .inner { padding: 0 max(5vw, 16px) clamp(40px, 8vh, 96px); max-width: 1240px; }
.hero h1 { font: 400 clamp(52px, 9vw, 128px)/.95 var(--serif); margin: 0 0 14px; text-wrap: balance; }
.hero p { font-size: clamp(17px, 2vw, 20px); max-width: 34em; color: #d9d0c1; margin: 0 0 26px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px;
  padding: 0 22px; border-radius: 999px; font: 600 15px/1 var(--sans); text-decoration: none;
  border: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer;
}
.btn:hover { border-color: var(--muted); }
.btn.buy { background: var(--visor); color: var(--visor-ink); border-color: var(--visor); }
.btn.buy:hover { background: #a5d6cf; }

/* bands */
.band { padding: clamp(36px, 5vw, 80px) max(5vw, 16px); }
.wrap { max-width: 1240px; margin: 0 auto; }
h2 { font: 400 clamp(34px, 4.5vw, 52px)/1.05 var(--serif); margin: 0 0 18px; text-wrap: balance; }
.lede { font-size: 18px; max-width: 40em; color: #d6cdbf; margin: 0; }
.lede em { font-family: var(--serif); font-size: 1.15em; color: var(--rose); }

/* portfolio index (home) */
.index { list-style: none; padding: 0; margin: 28px 0 0; border-top: 1px solid var(--line); }
.index li { border-bottom: 1px solid var(--line); }
.index a { display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 16px 0; text-decoration: none; font: 400 clamp(26px, 3.4vw, 40px)/1.1 var(--serif); }
.index a span { font: 14px/1.4 var(--sans); color: var(--muted); white-space: nowrap; }
.index a:hover { color: var(--rose); }

/* gallery page intro */
.intro { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 24px 56px; align-items: end; }
.intro h1 { font: 400 clamp(48px, 7vw, 96px)/.98 var(--serif); margin: 0; text-wrap: balance; }
.intro .meta { color: var(--muted); font-size: 15px; margin: 14px 0 0; }

/* chapter rail */
.rail { position: sticky; top: 61px; z-index: 10; background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(8px); border-block: 1px solid var(--line); }
.rail .scroll { display: flex; gap: 6px; overflow-x: auto; padding: 10px max(5vw, 16px); scrollbar-width: none; }
.rail .scroll::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; color: var(--muted); font: 500 14px/1 var(--sans); cursor: pointer; white-space: nowrap; }
.chip b { font-weight: 500; opacity: .6; margin-left: 6px; }
.chip:hover { color: var(--ink); border-color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* justified photo wall: each tile grows by its aspect ratio */
.wall { display: flex; flex-wrap: wrap; gap: 10px; padding: 18px max(2vw, 10px) 60px; }
.wall::after { content: ""; flex-grow: 999; }
.tile { position: relative; flex: var(--r) 1 calc(var(--r) * 240px); overflow: hidden; background: var(--bg2);
  border-radius: 2px; cursor: zoom-in; }
.tile i { display: block; padding-bottom: calc(100% / var(--r)); }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity .6s ease, transform 1.2s ease, filter .6s ease; filter: saturate(.92); }
.tile img.in { opacity: 1; }
.tile::after { /* CRT scanlines on hover */
  content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .4s; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,.18) 0 1px, transparent 1px 3px);
}
.tile:hover img { transform: scale(1.035); filter: saturate(1.05) brightness(1.05); }
.tile:hover::after { opacity: 1; }
.tile .cap { position: absolute; left: 12px; bottom: 10px; right: 12px; font: 400 20px/1.1 var(--serif);
  text-shadow: 0 1px 12px rgba(0,0,0,.8); opacity: 0; transition: opacity .3s; }
.tile:hover .cap, .tile:focus-visible .cap { opacity: 1; }
.empty { padding: 60px max(5vw, 16px); color: var(--muted); }

/* lightbox */
dialog.lb { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: rgba(9, 8, 7, .97); color: var(--ink); }
dialog.lb::backdrop { background: rgba(0,0,0,.8); }
.lb .stage { display: grid; grid-template-rows: minmax(0, 1fr) auto; height: 100%; }
.lb figure { margin: 0; display: grid; place-items: center; padding: clamp(12px, 3vw, 40px) clamp(12px, 6vw, 96px) 8px; min-height: 0; touch-action: pan-y; }
.lb figure img { max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: 0 30px 80px rgba(0,0,0,.6);
  transition: opacity .25s; }
.lb figure img.loading { opacity: .25; }
.lb .bar { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between;
  padding: 14px max(4vw, 16px) max(18px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.lb .what { min-width: 0; }
.lb .what strong { display: block; font: 400 24px/1.15 var(--serif); }
.lb .what span { color: var(--muted); font-size: 14px; }
.lb .acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.lb .nav-btn { position: absolute; top: 50%; translate: 0 -70%; width: 52px; height: 52px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(17,16,15,.6); color: var(--ink); font-size: 22px; cursor: pointer; }
.lb .prev { left: 14px; } .lb .next { right: 14px; }
.lb .close { position: absolute; top: 12px; right: 12px; width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(17,16,15,.6); color: var(--ink); font-size: 20px; cursor: pointer; }

/* footer */
.foot { border-top: 1px solid var(--line); padding: 36px max(5vw, 16px) 48px; color: var(--muted); font-size: 14px; }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 12px 32px; justify-content: space-between; }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.foot a { text-decoration: none; } .foot a:hover { color: var(--ink); }
.src { opacity: .7; }

@media (max-width: 760px) {
  .intro { grid-template-columns: minmax(0, 1fr); }
  .rail { top: 0; position: relative; }
  .top { position: relative; }
  .tile { flex-basis: calc(var(--r) * 150px); }
  .wall { gap: 6px; }
  .lb .nav-btn { display: none; }
  .tile .cap { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  body::after, .hero img { animation: none; }
  .tile img, .tile:hover img { transition: opacity .2s; transform: none; }
}

/* series cards (home) */
.series { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 28px 22px; margin-top: 32px; }
.card { display: block; text-decoration: none; }
.card .ph { position: relative; aspect-ratio: 3 / 2; overflow: hidden; background: var(--bg2); border-radius: 2px; }
.card img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.4s ease, filter .6s ease; filter: saturate(.9) brightness(.92); }
.card:hover img { transform: scale(1.05); filter: saturate(1.05) brightness(1); }
.card .ph::after { content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .4s;
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,.16) 0 1px, transparent 1px 3px); }
.card:hover .ph::after { opacity: 1; }
.card h3 { font: 400 30px/1.1 var(--serif); margin: 14px 0 2px; }
.card:hover h3 { color: var(--rose); }
.card p { margin: 0; color: var(--muted); font-size: 14px; }

/* next series link at the end of a gallery */
.next-series { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap;
  border-top: 1px solid var(--line); padding: 34px max(5vw, 16px); text-decoration: none; }
.next-series span { color: var(--muted); font-size: 14px; }
.next-series strong { font: 400 clamp(32px, 4vw, 52px)/1.05 var(--serif); }
.next-series:hover strong { color: var(--rose); }
@media (prefers-reduced-motion: reduce) { .card img, .card:hover img { transition: none; transform: none; } }
