/* Mike Jensen 3D — public site
   Red header (the name set huge, a treated photo spanning the measure) → near-black portfolio → red footer.
   Heavy grotesk (Archivo) for structure, Cormorant Garamond for the elegant voice.
   The tunable look (Admin ▸ Design) arrives as custom properties on :root and data-* on <html>. */

:root {
  --red: #b01e28;             /* header & footer — tunable */
  --poster-ink: #0d0a0a;      /* text on the red — tunable */
  --ink: #0d0a0a;
  --ink-2: #161111;
  --ink-3: #221b1b;
  --cream: #efe7da;
  --cream-2: rgba(239, 231, 218, .66);
  --cream-3: rgba(239, 231, 218, .4);
  --line: rgba(239, 231, 218, .13);
  --gutter: clamp(16px, 3vw, 48px);
  --gap: clamp(10px, 1.2vw, 18px);
  --gap: 14px;                /* between grid pieces — tunable */
  /* hero treatment — tunable */
  --hero-sat: 0; --hero-con: 1.18; --hero-bri: 1.12; --hero-grain: .55; --grain-size: 160px; --hero-ratio: 2.2; --hero-w: 1;
  /* hover outline on grid pieces — tunable (colour defaults to the header red) */
  --hover-c: var(--red); --hover-w: 2px;
  /* line around each grid piece — tunable, off by default */
  --tb-c: #2b2525; --tb-w: 1px;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --grot: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --serif: "Cormorant Garamond", "Cormorant", Garamond, "Times New Roman", serif;
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--cream);
  font: 400 17px/1.55 var(--grot);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* film grain over everything */
body::after {
  content: "";
  position: fixed; inset: -50%;
  pointer-events: none; z-index: 100;
  background-image: var(--noise);
  opacity: .09; mix-blend-mode: overlay;
  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); }
}
body.viewer-open { overflow: hidden; }
img, video { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--cream); outline-offset: 3px; }
[tabindex="-1"]:focus { outline: none; }   /* sections an in-page link moved focus to */
.skip { position: absolute; left: 12px; top: -60px; z-index: 200; background: var(--cream); color: var(--ink); padding: 8px 14px; text-decoration: none; }
.skip:focus { top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* the stamp: a single-tone mask that takes the current text colour */
.mk {
  display: inline-block; flex: none;
  background-color: currentColor;
  -webkit-mask: var(--mk-readable) center / contain no-repeat;
  mask: var(--mk-readable) center / contain no-repeat;
  aspect-ratio: 720 / 662;
}
.mk-grunge { -webkit-mask-image: var(--mk-grunge); mask-image: var(--mk-grunge); aspect-ratio: 1000 / 1274; }

/* ---------- Header ---------- */

.poster {
  position: relative;
  display: flex; flex-direction: column;
  min-height: 100vh; min-height: 100svh;
  padding: 0 var(--gutter) var(--gutter);
  background: var(--red);
  color: var(--poster-ink);
  isolation: isolate;
}
/* ink-on-paper texture on the red */
.poster::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: var(--noise); opacity: .35; mix-blend-mode: multiply;
}

.topbar {
  flex: none; display: flex; align-items: center; gap: 24px; height: 64px;
  border-bottom: 1px solid color-mix(in srgb, var(--poster-ink) 28%, transparent);
}
.lockup { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.lockup-mark { height: 32px; }
.lockup-word {
  font: 800 15px/1 var(--grot); font-stretch: 75%;
  letter-spacing: .06em; text-transform: uppercase;
}
.lockup-word i { font: italic 500 17px/1 var(--serif); letter-spacing: 0; text-transform: none; }
.topbar-links {
  display: flex; gap: clamp(16px, 2.2vw, 34px); margin: 0 0 0 auto; padding: 0; list-style: none;
}
.topbar-links a {
  font: 600 12px/1 var(--grot); letter-spacing: .16em; text-transform: uppercase; text-decoration: none;
  padding: 6px 0; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size .4s var(--ease);
}
.topbar-links a:hover { background-size: 100% 1px; }

/* The name: one line across the measure; site.js fits it to the exact width (the CSS size is the fallback). */
.name {
  flex: none;
  margin: clamp(18px, 2.8vw, 46px) 0 clamp(16px, 2.4vw, 38px);
  font: 900 var(--name-size, 15.4vw)/.8 var(--grot); font-stretch: 100%;
  text-transform: uppercase; letter-spacing: -.03em;
  white-space: nowrap; color: var(--poster-ink);
}
.name-fit { display: inline-block; margin-left: -.035em; } /* optical alignment of the M's stem to the margin */
.name-line { display: inline-block; overflow: hidden; vertical-align: top; padding: .08em .03em .03em 0; margin: -.08em -.03em -.03em 0; }
.name-line > span { display: inline-block; }

/* The photo spans the same measure as the name. Edges (clean / grunge / texture) are a mask drawn by site.js. */
.hero {
  /* --hero-w: 1 = the name's width; 1–1.2 spreads into the margins (1.2 = edge to edge) */
  --hero-wd: calc(100% * min(var(--hero-w), 1) + 2 * var(--gutter) * max(0, (var(--hero-w) - 1) * 5));
  position: relative; flex: 1 1 auto; display: flex; min-height: 240px;
  width: var(--hero-wd); margin-left: calc((100% - var(--hero-wd)) / 2);
}
/* a set height (Admin ▸ Design ▸ Height): site.js sizes the photo, and the red ends right under it */
.poster.hero-sized { min-height: 0; }
.poster.hero-sized .hero { flex: none; min-height: 0; height: var(--hero-h); }
[data-hero-fill="off"] .hero { flex: none; min-height: 0; aspect-ratio: var(--hero-ratio); }
.hero-frame {
  position: relative; flex: 1; display: block; overflow: hidden;
  background: #121010;
  -webkit-mask-size: 100% 100%; mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
}
.hero-frame img {
  position: absolute; left: 0; top: -4%; width: 100%; height: 108%;
  object-fit: cover;
  filter: saturate(var(--hero-sat)) contrast(var(--hero-con)) brightness(var(--hero-bri));
  transform: translate3d(0, var(--py, 0px), 0);
  will-change: transform;
}
/* film grain on the photo */
.hero-frame::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: var(--noise); background-size: var(--grain-size);
  opacity: var(--hero-grain); mix-blend-mode: overlay;
}

/* entrance: the name rises out of its masks, the photo settles in */
.js .name-line > span { transform: translate3d(0, 108%, 0); }
.js .topbar { opacity: 0; }
.js .hero { opacity: 0; }
.js .hero-frame img { scale: 1.08; }
.js.ready .name-line > span { transform: none; transition: transform 1.2s var(--ease); }
.js.ready .name-line + .name-line > span { transition-delay: .08s; }
.js.ready .topbar { opacity: 1; transition: opacity 1s .5s ease; }
.js.ready .hero { opacity: 1; transition: opacity .9s .25s ease; }
.js.ready .hero-frame img { scale: 1; transition: scale 2.2s .25s var(--ease); }

/* ---------- Work ---------- */

.work { position: relative; display: flow-root; padding: 0 0 clamp(80px, 10vw, 160px); background: var(--ink); }
.work-head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 24px;
  padding: clamp(48px, 7vw, 110px) var(--gutter) 0;
}
.work-head h2 {
  margin: 0;
  font: 900 clamp(54px, 10vw, 168px)/.84 var(--grot); font-stretch: 70%;
  text-transform: uppercase; letter-spacing: -.01em;
}
.work-head h2 em {
  font: italic 400 1.02em/.84 var(--serif); text-transform: none; letter-spacing: -.02em;
  color: var(--red); padding-left: .04em;
}
/* a long filter name (or two filters) */
.work-head h2.long { font-size: clamp(44px, 6.4vw, 108px); }
.work-count { margin: 0; font: italic 400 clamp(20px, 1.8vw, 26px)/1 var(--serif); color: var(--cream-2); }
.work-count span { font: 600 .62em/1 var(--grot); font-style: normal; letter-spacing: .12em; color: var(--cream); margin-right: .3em; }

.filters {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: flex-start;
  margin-top: clamp(22px, 3vw, 40px);
  background: color-mix(in srgb, var(--ink) 90%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  transition: transform .4s var(--ease);
}
/* unpinned: tucks away while scrolling down, comes back as soon as the visitor scrolls up */
.filters.tucked { transform: translateY(calc(-100% - 2px)); }
.filters.stuck { box-shadow: 0 18px 30px -24px #000; }
.filters-inner { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 0 40px; padding: 0 var(--gutter); }
/* pin: keep the bar at the top while scrolling, or let it scroll away (remembered per visitor) */
.fpin {
  flex: none; appearance: none; cursor: pointer; display: grid; place-items: center;
  width: 34px; height: 34px; margin: 6px calc(var(--gutter) - 8px) 0 -12px; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: var(--cream-3);
  transition: color .2s, background .2s;
}
.fpin svg { width: 16px; height: 16px; transition: transform .3s var(--ease); }
.fpin:hover { color: var(--cream); background: var(--ink-3); }
.fpin[aria-pressed="true"] { color: var(--red); }
.fpin[aria-pressed="false"] svg { transform: rotate(45deg); }
.frow { display: flex; align-items: center; min-width: 0; padding: 11px 0; }
.frow-label { flex: none; font: 600 10.5px/1 var(--grot); letter-spacing: .18em; text-transform: uppercase; color: var(--cream-3); margin-right: 14px; }
.frow-chips { display: flex; gap: 2px; flex-wrap: wrap; }
.chip {
  appearance: none; border: 0; cursor: pointer; background: transparent; color: var(--cream-2);
  padding: 7px 11px 6px; border-radius: 1px;
  font: 600 12.5px/1 var(--grot); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap;
  transition: background .2s, color .2s;
}
.chip:hover { color: var(--cream); background: var(--ink-3); }
.chip[aria-pressed="true"] { background: var(--cream); color: var(--ink); }
.frow.is-filtered .chip[aria-pressed="true"] { background: var(--red); color: var(--cream); }
/* nothing matches it with the other filters; clicking it drops those */
.chip.empty { opacity: .35; }
.chip.empty:hover, .chip.empty:focus-visible { opacity: 1; }
.chip-n { font: italic 400 13px/1 var(--serif); letter-spacing: 0; text-transform: none; opacity: .7; margin-left: 5px; }

.grid { position: relative; margin: clamp(22px, 3vw, 40px) var(--gutter) 0; min-height: 200px; transition: height .5s var(--ease); }
.grid-empty { text-align: center; color: var(--cream-3); padding: 60px 0; font: italic 22px var(--serif); }

.tile {
  position: absolute; top: 0; left: 0; display: block; text-decoration: none;
  will-change: transform; transition: transform .6s var(--ease), opacity .4s;
}
.tile.no-anim { transition: none; }
.tile.leaving { opacity: 0; pointer-events: none; }
.tile.entering { opacity: 0; }
.tile-frame, .tile-cap { transition: opacity .9s var(--ease), transform .9s var(--ease); }
.js .tile:not(.seen) .tile-frame, .js .tile:not(.seen) .tile-cap { opacity: 0; transform: translateY(26px); }
.tile-frame {
  position: relative; display: block; overflow: hidden;
  background: var(--ink-2);
  transform: translateZ(0);   /* its own layer: the zoom below is composited, not repainted */
}
/* optional line around every piece (Admin ▸ Design ▸ Grid) */
[data-tile-border="on"] .tile-frame { box-shadow: 0 0 0 var(--tb-w) var(--tb-c); }
/* tiny blurred preview shown until the real image arrives */
.tile-lqip { position: absolute; inset: -8%; background-size: cover; background-position: center; filter: blur(14px); transition: opacity .6s ease; }
.tile-frame .loaded ~ .tile-lqip, .tile-frame .loaded + .tile-lqip { opacity: 0; }
.tile-frame::after { content: ""; position: absolute; inset: 0; z-index: 2; box-shadow: inset 0 0 0 var(--hover-w) transparent; transition: box-shadow .35s; pointer-events: none; }
.tile-frame img, .tile-frame video {
  position: relative; z-index: 1;
  width: 100%; height: 100%; object-fit: cover; opacity: 0;
  transform: scale(1); backface-visibility: hidden; will-change: transform;
  transition: opacity .7s ease, transform 1.1s cubic-bezier(.22, .61, .36, 1);
}
.tile-frame .loaded { opacity: 1; }
/* hover outline (Admin ▸ Design): inside the image's edge, or a ring just outside it */
[data-hover="inside"] .tile:hover .tile-frame::after, .tile:focus-visible .tile-frame::after { box-shadow: inset 0 0 0 var(--hover-w) var(--hover-c); }
/* Titles laid over the image would cover the outline's bottom edge (and on phones, where the two are
   separate layers, leave a flickering 1px seam): there the outline is drawn on the tile, above them. */
[data-caption="overlay"] .tile-frame::after, [data-caption="hover"] .tile-frame::after { content: none; }
[data-caption="overlay"] .tile::after, [data-caption="hover"] .tile::after {
  content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  box-shadow: inset 0 0 0 var(--hover-w) transparent; transition: box-shadow .35s;
}
[data-hover="inside"][data-caption="overlay"] .tile:hover::after, [data-hover="inside"][data-caption="hover"] .tile:hover::after,
[data-caption="overlay"] .tile:focus-visible::after, [data-caption="hover"] .tile:focus-visible::after { box-shadow: inset 0 0 0 var(--hover-w) var(--hover-c); }
.tile-frame { outline: 0 solid transparent; transition: opacity .9s var(--ease), transform .9s var(--ease), outline-color .35s; }
[data-hover="outside"] .tile:hover .tile-frame { outline: var(--hover-w) solid var(--hover-c); }
[data-zoom="on"] .tile:hover .tile-frame img, [data-zoom="on"] .tile:hover .tile-frame video { transform: scale(1.035); }
.tile:focus-visible { outline: none; }
.tile-badge {
  position: absolute; top: 10px; right: 10px; z-index: 3;
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(13, 10, 10, .78); color: var(--cream);
  font: 600 11px/1 var(--grot); letter-spacing: .06em;
  padding: 6px 8px;
}
.tile-badge svg { width: 12px; height: 12px; }
.tile-cap {
  display: flex; align-items: baseline; gap: 10px;
  height: 46px; padding-top: 11px; white-space: nowrap; overflow: hidden;
}
.tile-no { font: 600 10.5px/1 var(--grot); letter-spacing: .1em; color: var(--red); flex: none; }
.tile-title { font: 500 21px/1.1 var(--serif); overflow: hidden; text-overflow: ellipsis; }
.tile-prod { font: 600 10px/1 var(--grot); letter-spacing: .16em; text-transform: uppercase; color: var(--cream-3); margin-left: auto; flex: none; padding-left: 8px; }
.tile:hover .tile-title { text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 1px; text-underline-offset: 4px; }

/* captions inside the image, on a gradient (always, or only on hover) — or no captions at all */
[data-caption="overlay"] .tile-cap, [data-caption="hover"] .tile-cap {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; height: auto;
  padding: 48px 14px 13px; pointer-events: none;
  background: linear-gradient(to top, rgba(8, 6, 6, .86), rgba(8, 6, 6, .5) 45%, transparent);
}
[data-caption="overlay"] .tile-prod, [data-caption="hover"] .tile-prod { color: var(--cream-2); }
[data-caption="overlay"] .tile:hover .tile-title, [data-caption="hover"] .tile:hover .tile-title { text-decoration: none; }
[data-caption="hover"] .tile.seen .tile-cap { opacity: 0; transform: translateY(8px); transition: opacity .35s ease, transform .5s var(--ease); }
[data-caption="hover"] .tile.seen:hover .tile-cap, [data-caption="hover"] .tile.seen:focus-visible .tile-cap { opacity: 1; transform: none; }
[data-caption="none"] .tile-cap { display: none; }

.noscript-list { padding: 0 var(--gutter); columns: 3 220px; }

/* ---------- Viewer ---------- */

.viewer {
  position: fixed; inset: 0; z-index: 50;
  background: var(--ink); color: var(--cream);
  overflow-y: auto; overscroll-behavior: contain;
  opacity: 0; transform: translateY(24px);
  transition: opacity .35s ease, transform .55s var(--ease);
}
.viewer.open { opacity: 1; transform: none; }
.viewer[hidden] { display: none; }
.viewer-bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 10px;
  padding: 12px var(--gutter);
  background: color-mix(in srgb, var(--ink) 88%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.viewer-bar .mk { height: 30px; color: var(--cream); }
.viewer-crumb { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font: 600 11px/1 var(--grot); letter-spacing: .16em; text-transform: uppercase; color: var(--cream-3); margin-left: 6px; }
.vbtn {
  appearance: none; cursor: pointer; flex: none;
  width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--line); background: transparent; color: var(--cream);
  transition: background .2s, border-color .2s, color .2s;
}
.vbtn:hover { border-color: var(--cream); }
.vbtn svg { width: 18px; height: 18px; }
.vbtn.close { background: var(--cream); color: var(--ink); border-color: var(--cream); }
.vbtn.close:hover { background: var(--red); border-color: var(--red); color: var(--cream); }
.vbtn[disabled] { opacity: .25; pointer-events: none; }

.viewer-body { display: grid; grid-template-columns: 1fr; gap: 30px; padding: 26px var(--gutter) 90px; }
.viewer-prod { margin: 0 0 12px; font: 600 11px/1 var(--grot); letter-spacing: .2em; text-transform: uppercase; color: var(--red); }
.viewer-info h1 { margin: 0; font: 500 clamp(40px, 4.4vw, 70px)/.98 var(--serif); letter-spacing: -.01em; }
.viewer-desc { margin-top: 20px; font: 400 20px/1.5 var(--serif); color: var(--cream-2); max-width: 46ch; }
.viewer-desc p { margin: 0 0 .7em; }
.viewer-desc a { color: var(--cream); text-decoration-color: var(--red); }
.viewer-credits { margin: 14px 0 0; font: 600 11px/1.6 var(--grot); letter-spacing: .12em; text-transform: uppercase; color: var(--cream-3); }
.viewer-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 22px 0 0; padding: 0; list-style: none; }
.viewer-tags button {
  appearance: none; cursor: pointer; background: transparent; color: var(--cream-2);
  border: 1px solid var(--line); padding: 7px 10px 6px;
  font: 600 11px/1 var(--grot); letter-spacing: .12em; text-transform: uppercase;
}
.viewer-tags button:hover { border-color: var(--red); color: var(--cream); }
.viewer-count { margin-top: 24px; font: italic 400 17px/1 var(--serif); color: var(--cream-3); }

.viewer-media { display: flex; flex-direction: column; gap: clamp(10px, 1.4vw, 22px); min-width: 0; }
.vm { --ar: 4 / 3; position: relative; margin: 0; width: 100%; display: flex; justify-content: center; }
.vm img, .vm video {
  width: min(100%, calc((100vh - 100px) * var(--ar)));
  width: min(100%, calc((100svh - 100px) * var(--ar)));
  height: auto; aspect-ratio: var(--ar); background: var(--ink-2);
}
.vm-video { width: min(100%, calc((100svh - 100px) * var(--ar))); margin: 0 auto; }
.vm-video video { width: 100%; cursor: pointer; }
.vm-sound {
  position: absolute; left: 12px; bottom: 12px;
  display: inline-flex; align-items: center; gap: 8px;
  appearance: none; border: 0; cursor: pointer;
  background: rgba(13, 10, 10, .82); color: var(--cream);
  padding: 9px 12px; font: 600 11px/1 var(--grot); letter-spacing: .14em; text-transform: uppercase;
}
.vm-sound:hover { background: var(--red); }
.vm-sound svg { width: 16px; height: 16px; }
.vm-state {
  position: absolute; right: 12px; bottom: 12px; width: 36px; height: 36px; border-radius: 50%;
  background: rgba(13, 10, 10, .75); display: grid; place-items: center; pointer-events: none;
  opacity: 0; transition: opacity .3s;
}
.vm.paused .vm-state { opacity: 1; }
.vm-state svg { width: 14px; height: 14px; }

.viewer-next { display: flex; justify-content: space-between; gap: 14px; margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--line); }
.viewer-next button { appearance: none; border: 0; background: none; cursor: pointer; padding: 0; text-align: left; max-width: 48%; color: var(--cream); }
.viewer-next button:last-child { text-align: right; margin-left: auto; }
.viewer-next small { display: block; font: 600 10.5px/1 var(--grot); letter-spacing: .18em; text-transform: uppercase; color: var(--red); margin-bottom: 8px; }
.viewer-next span { font: 500 clamp(20px, 2vw, 28px)/1.1 var(--serif); }
.viewer-next button:hover span { text-decoration: underline; text-decoration-color: var(--red); text-underline-offset: 4px; }

/* text beside the images: wide enough screens, unless Admin ▸ Design puts it always on top (site.js sets .side) */
.viewer.side .viewer-body { grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: clamp(36px, 4.5vw, 80px); padding-top: 40px; }
.viewer.side .viewer-body.no-text { grid-template-columns: minmax(0, 1fr); }
.viewer.side .viewer-info { position: sticky; top: 100px; align-self: start; max-height: calc(100vh - 120px); overflow-y: auto; scrollbar-width: none; }

/* piece-page pictures open full screen */
.vm-image img { cursor: zoom-in; }

/* ---------- Full screen (assets/js/lightbox.js) ---------- */

html.lb-open, html.lb-open body { overflow: hidden; }
html.lb-open body::after { opacity: 0; }   /* no film grain over the work itself */
.lb { position: fixed; inset: 0; z-index: 90; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.lb[hidden] { display: none; }
.lb-bg { position: absolute; inset: 0; background: #070505; opacity: 0; transition: opacity .32s ease; }
.lb.open .lb-bg { opacity: .97; }
.lb-stage { position: absolute; inset: 0; overflow: hidden; }
.lb-slide { position: absolute; inset: 0; transform-origin: 0 0; }
.lb-slide-anim { transition: transform .32s var(--ease), opacity .32s ease; }
.lb.closing .lb-ui { opacity: 0; }
.lb-item {
  position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0;
  background: center / 100% 100% no-repeat; cursor: zoom-in;
}
.lb.zoomed .lb-item { cursor: grab; }
.lb.grabbing .lb-item { cursor: grabbing; }
.lb-video { cursor: default; background-color: #000; }
.lb-glide { transition: transform .32s var(--ease), width .32s var(--ease), height .32s var(--ease); }

.lb-ui { position: absolute; inset: 0; pointer-events: none; transition: opacity .35s ease; }
.lb.idle .lb-ui { opacity: 0; }
.lb.idle .lb-ui .lb-btn { pointer-events: none; }
.lb-top {
  position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 16px;
  padding: 14px var(--gutter) 30px;
  background: linear-gradient(to bottom, rgba(7, 5, 5, .7), transparent);
}
.lb-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font: 500 clamp(18px, 1.6vw, 24px)/1.1 var(--serif); color: var(--cream); }
.lb-count { flex: none; font: 600 11px/1 var(--grot); letter-spacing: .16em; color: var(--cream-2); font-variant-numeric: tabular-nums; }
.lb-btn {
  pointer-events: auto; appearance: none; cursor: pointer; flex: none;
  width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; padding: 0;
  border: 1px solid rgba(239, 231, 218, .22); background: rgba(13, 10, 10, .55); color: var(--cream);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: background .2s, border-color .2s, color .2s, opacity .2s;
}
.lb-btn:hover { border-color: var(--cream); }
.lb-btn svg { width: 18px; height: 18px; }
.lb-close { background: var(--cream); color: var(--ink); border-color: var(--cream); }
.lb-close:hover { background: var(--red); border-color: var(--red); color: var(--cream); }
.lb-prev, .lb-next { position: absolute; top: 50%; margin-top: -23px; }
.lb-prev { left: var(--gutter); }
.lb-next { right: var(--gutter); }
.lb-btn[hidden] { display: none; }
/* a video's own controls sit at the bottom: keep the arrows clear of them */
.lb.is-video .lb-prev, .lb.is-video .lb-next { margin-top: -60px; }
.lb-zoom, .lb-flash {
  position: absolute; left: 50%; transform: translateX(-50%); pointer-events: none; opacity: 0; transition: opacity .3s;
  background: rgba(13, 10, 10, .8); color: var(--cream); padding: 8px 12px;
  font: 600 12px/1 var(--grot); letter-spacing: .1em; text-transform: uppercase; font-variant-numeric: tabular-nums;
}
.lb-zoom { bottom: 22px; }
.lb-zoom.on { opacity: 1; transition-duration: .1s; }
.lb-flash { top: 50%; }
.lb.idle .lb-flash, .lb.idle .lb-zoom { opacity: 0; }
.lb-flash.on { opacity: 1 !important; animation: tile-flash 1.3s ease forwards; }
@media (max-width: 720px) {
  .lb-prev, .lb-next { display: none; }   /* swipe instead */
  .lb-btn { width: 40px; height: 40px; }
  .lb-top { padding-top: max(10px, env(safe-area-inset-top)); }
}

/* ---------- Colophon ---------- */

.colophon { position: relative; display: flow-root; background: var(--red); color: var(--cream); isolation: isolate; }
.colophon::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: var(--noise); opacity: .35; mix-blend-mode: multiply; pointer-events: none; }
.colophon-grid {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(28px, 6vw, 110px); align-items: start;
  padding: clamp(50px, 7vw, 110px) var(--gutter) clamp(40px, 6vw, 90px);
}
.colophon-stamp { width: clamp(150px, 26vw, 400px); color: var(--ink); }
.colophon h2 { margin: 0 0 18px; font: 600 11px/1 var(--grot); letter-spacing: .2em; text-transform: uppercase; color: var(--ink); }
.about-text { font: 500 clamp(22px, 2.3vw, 34px)/1.3 var(--serif); max-width: 32ch; }
.about-text p { margin: 0 0 .6em; }
.about-text a { color: var(--cream); }
.about-photo { width: 120px; aspect-ratio: 4/5; object-fit: cover; filter: grayscale(1) contrast(1.2); mix-blend-mode: multiply; margin-bottom: 18px; }
.contact { margin-top: clamp(30px, 4vw, 56px); }
.contact-label { margin: 0 0 10px; font: 600 11px/1 var(--grot); letter-spacing: .2em; text-transform: uppercase; color: var(--ink); }
.contact-email {
  display: inline-block; text-decoration: none; overflow-wrap: anywhere;
  font: 900 clamp(30px, 5vw, 84px)/.95 var(--grot); font-stretch: 72%; letter-spacing: -.005em;
  background: linear-gradient(var(--ink), var(--ink)) 0 100% / 0 4px no-repeat;
  transition: background-size .5s var(--ease);
}
.contact-email:hover { background-size: 100% 4px; }
.contact-links { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 22px 0 0; padding: 0; }
.contact-links a {
  display: inline-block; text-decoration: none; border: 1px solid rgba(239, 231, 218, .5); padding: 10px 14px 9px;
  font: 600 11.5px/1 var(--grot); letter-spacing: .16em; text-transform: uppercase;
  transition: background .2s, color .2s, border-color .2s;
}
.contact-links a:hover { background: var(--ink); border-color: var(--ink); }
.colophon-foot {
  display: flex; align-items: center; gap: 16px;
  margin: 0 var(--gutter); padding: 18px 0 22px; border-top: 1px solid rgba(13, 10, 10, .35);
  font: 600 11px/1 var(--grot); letter-spacing: .16em; text-transform: uppercase; color: var(--ink);
}
.colophon-foot a { margin-left: auto; text-decoration: none; }

/* ---------- Phones & small tablets ---------- */

@media (max-width: 860px) {
  body { font-size: 16px; }
  .lockup-word { display: none; }
  .topbar { height: 58px; }
  .lockup-mark { height: 30px; }
  .topbar-links { gap: 16px; }
  .topbar-links a { font-size: 11px; letter-spacing: .12em; }

  .work-head h2 { font-size: clamp(50px, 15vw, 90px); }
  /* filter rows wrap instead of scrolling sideways */
  .filters-inner { display: block; padding: 4px var(--gutter); }
  .frow { padding: 6px 0; align-items: flex-start; }
  .frow-label { padding-top: 8px; }
  .tile-cap { height: 38px; padding-top: 8px; }
  .tile-title { font-size: 17px; }
  .tile-prod { display: none; }
  .tile-badge { top: 6px; right: 6px; padding: 5px 6px; font-size: 10px; }
  .vbtn { width: 38px; height: 38px; }
  .colophon-grid { grid-template-columns: 1fr; }
  .colophon-stamp { width: min(56vw, 260px); }
}

@media (max-width: 720px) {
  /* the name stacks into two fitted lines */
  .name-line { display: block; width: max-content; }
  .name { line-height: .82; }
  .hero { min-height: 52svh; }

  /* compact, multi-row chips; no row labels when space is tight */
  .filters-inner { padding: 6px var(--gutter) 7px; }
  .frow { padding: 0; }
  .frow + .frow { margin-top: 5px; padding-top: 5px; border-top: 1px solid var(--line); }
  .frow-label { display: none; }
  .frow-chips { gap: 3px; }
  .fpin { width: 30px; height: 30px; margin: 4px calc(var(--gutter) - 8px) 0 -10px; }
  .chip { padding: 6px 7px 5px; font-size: 10.5px; letter-spacing: .05em; }
  .chip-n { font-size: 11.5px; margin-left: 3px; }
  [data-caption="overlay"] .tile-cap, [data-caption="hover"] .tile-cap { padding: 36px 9px 8px; }
}

@media (max-height: 520px) and (orientation: landscape) {
  .name-line { display: inline-block; width: auto; }
}

@media (hover: none) {
  .tile:hover .tile-frame img, .tile:hover .tile-frame video { transform: none !important; }
  [data-caption="hover"] .tile.seen .tile-cap { opacity: 1; transform: none; }
}

/* ---------- Admin live preview: chips can be dragged to reorder ---------- */

[data-preview] .chip[data-sort] { cursor: grab; touch-action: none; }
[data-preview] .chip.sort-dragging { opacity: .35; }
.chip-ghost { position: fixed; z-index: 300; pointer-events: none; box-shadow: 0 10px 24px -8px #000; }
/* …and pieces can be dragged, resized and reframed (assets/js/tile-edit.js) */
[data-preview] .tile { cursor: grab; user-select: none; -webkit-user-select: none; -webkit-user-drag: none; }
[data-preview] .tile.sort-dragging { opacity: .3; }
.tile-ghost { position: fixed; z-index: 300; pointer-events: none; opacity: .85; box-shadow: 0 18px 40px -12px #000; }
.tile.te-active { z-index: 5; }
.te-dragging, .te-dragging * { cursor: move !important; user-select: none; }
.te-zoom, .te-zoom *, .te-shape, .te-shape * { cursor: ns-resize !important; }
.te-ghost { position: fixed; inset: 0; z-index: 400; pointer-events: none; }
.te-ghost .te-pic { position: fixed; background-size: 100% 100%; opacity: .42; }
.te-ghost .te-box { position: fixed; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .9); }
.tile-flash {
  position: absolute; left: 50%; top: 50%; z-index: 6; transform: translate(-50%, -50%);
  background: var(--ink); color: var(--cream); padding: 8px 12px; white-space: nowrap; pointer-events: none;
  font: 600 13px/1 var(--grot); letter-spacing: .08em; text-transform: uppercase;
  animation: tile-flash 1.3s ease forwards;
}
/* …and on a piece page, Shift+C picks the cover and its pictures can be dragged into a new order */
.viewer-flash { position: fixed; }
.tile-direct {
  position: absolute; left: 10px; top: 10px; z-index: 3; width: 26px; height: 26px; display: grid; place-items: center;
  background: rgba(13, 10, 10, .78); color: var(--cream);
}
.tile-direct svg { width: 13px; height: 13px; }
/* when every piece opens full screen, the preview marks the ones that open their page instead */
.tile-direct.page { width: auto; padding: 0 8px; font: 600 10.5px/1 var(--grot); letter-spacing: .14em; text-transform: uppercase; }
.vm-cover {
  position: absolute; left: 12px; top: 12px; z-index: 2; background: var(--red); color: var(--cream); pointer-events: none;
  padding: 6px 9px; font: 600 10.5px/1 var(--grot); letter-spacing: .14em; text-transform: uppercase;
}
[data-preview] .viewer-media .vm { cursor: grab; }
[data-preview] .viewer-media .vm img { cursor: grab; }
.viewer-media.sorting { flex-direction: row; flex-wrap: wrap; align-items: flex-start; gap: 10px; }
.viewer-media.sorting .vm { width: auto; }
.viewer-media.sorting .vm img, .viewer-media.sorting .vm video { width: auto; height: 150px; }
.viewer-media.sorting .vm-sound, .viewer-media.sorting .vm-state { display: none; }
.viewer-media .vm.sort-dragging { opacity: .25; }
.vm-ghost { position: fixed; z-index: 300; pointer-events: none; transform: translate(-50%, -50%); box-shadow: 0 18px 40px -12px #000; }
.vm-ghost img { height: 120px; width: auto; opacity: .9; }
@keyframes tile-flash { 0% { opacity: 0; } 12%, 70% { opacity: 1; } 100% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body::after { animation: none; }
  *, *::before, *::after { transition-duration: 0s !important; transition-delay: 0s !important; animation-duration: .01ms !important; }
  .js .name-line > span, .js .topbar, .js .hero { opacity: 1; transform: none; }
  .js .hero-frame img { scale: none; transform: none; }
  .js .tile:not(.seen) .tile-frame, .js .tile:not(.seen) .tile-cap { opacity: 1; transform: none; }
}
