/*
 * Styles for /photography/ (layout: photography). Deliberately separate from the theme: one dark look.
 *
 * A night map lies under the page like a desk. Collections sit on it as a grid of objects (a 35mm roll, an album,
 * a pile of prints); opening one flies the map to where it was shot and puts the object in your hands.
 */
:root {
  /* dark theme (default); the light theme below redefines the same tokens */
  color-scheme: dark;
  --bg: #0b0d12;
  --bg-rgb: 11 13 18;
  --ink: #ece6d8;
  --muted: #8f929d;
  --line: rgba(236, 230, 216, 0.16);
  --accent: #e9a43f;
  --accent-glow: rgba(233, 164, 63, 0.45);
  --land: #151a24;
  --land-on: #232c40;
  --coast: #2c3548;
  --grid-line: rgba(236, 230, 216, 0.055);
  --vf: rgba(236, 230, 216, 0.42);
  --cast: rgba(0, 0, 0, 0.8);
  --cast-soft: rgba(0, 0, 0, 0.65);
  /* film and the full-size viewer look the same in both themes */
  --amber: #e9a43f;
  --film: #1e1713;
  --film-hi: rgba(255, 222, 180, 0.14);
  --edge-glow: rgba(233, 164, 63, 0.4);
  --display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono: "DM Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --col: 1120px;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  --pad: max(var(--gutter-l), calc((100vw - var(--col)) / 2 + 16px));
  --fh: 216px;
  --gap: 12px;
  --pitch: calc((var(--fh) * 1.5 + var(--gap)) / 8); /* eight perforations per 36mm frame */
  --hole-h: calc(var(--pitch) * 0.4167);
  --rebate: calc(var(--hole-h) + 25px);
}
/* light theme: `data-theme` is set by the script in the layout from the site-wide setting; the media query covers no-script */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #eef1f4;
    --bg-rgb: 238 241 244;
    --ink: #161a21;
    --muted: #5d6570;
    --line: rgba(22, 26, 33, 0.2);
    --accent: #b4530a;
    --accent-glow: rgba(180, 83, 10, 0.3);
    --land: #dde3ea;
    --land-on: #c8d2df;
    --coast: #bac4d1;
    --grid-line: rgba(22, 26, 33, 0.07);
    --vf: rgba(22, 26, 33, 0.45);
    --cast: rgba(38, 48, 68, 0.42);
    --cast-soft: rgba(38, 48, 68, 0.32);
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eef1f4;
  --bg-rgb: 238 241 244;
  --ink: #161a21;
  --muted: #5d6570;
  --line: rgba(22, 26, 33, 0.2);
  --accent: #b4530a;
  --accent-glow: rgba(180, 83, 10, 0.3);
  --land: #dde3ea;
  --land-on: #c8d2df;
  --coast: #bac4d1;
  --grid-line: rgba(22, 26, 33, 0.07);
  --vf: rgba(22, 26, 33, 0.45);
  --cast: rgba(38, 48, 68, 0.42);
  --cast-soft: rgba(38, 48, 68, 0.32);
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html.lb-open,
html.v-open {
  overflow: hidden;
}
html,
body {
  margin: 0;
}
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  transition:
    background-color 0.4s,
    color 0.4s;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  font: inherit;
  color: inherit;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.wrap {
  max-width: var(--col);
  margin-inline: auto;
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
}
.kicker {
  margin: 0;
  color: var(--accent);
  font: 500 11.5px/1.4 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
/* photographs fade in once loaded */
.frame img,
.plate img,
.mount img,
.print img {
  display: block;
  object-fit: cover;
  opacity: 0;
  transition:
    opacity 0.45s,
    filter 0.15s;
  -webkit-user-drag: none;
}
.frame img.ready,
.plate img.ready,
.mount img.ready,
.print img.ready {
  opacity: 1;
}

/* ---------- the map under everything ---------- */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.bd-map {
  position: absolute;
  left: 0;
  top: 0;
  width: 2700px;
  height: 1322px;
  max-width: none;
  transform-origin: 0 0;
  will-change: transform;
}
.backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(120% 95% at 50% 42%, rgb(var(--bg-rgb) / 0) 38%, rgb(var(--bg-rgb) / 0.8) 100%);
}
.pin {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  width: 0;
  height: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: 500 12.5px/1 var(--sans);
  letter-spacing: 0.02em;
  cursor: pointer;
  pointer-events: auto;
  will-change: transform;
  transition: opacity 0.5s;
}
.pin::before {
  content: "";
  position: absolute;
  left: -20px;
  top: -20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
}
.pin i {
  position: absolute;
  left: -7px;
  top: -7px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow:
    0 0 0 3px rgb(var(--bg-rgb) / 0.85),
    0 0 20px 2px var(--accent-glow);
  transition: transform 0.25s;
}
.pin span {
  position: absolute;
  left: 17px;
  top: -10px;
  padding: 4px 0;
  white-space: nowrap;
  text-shadow:
    0 0 6px var(--bg),
    0 0 2px var(--bg),
    0 0 12px var(--bg);
}
.pin.left span {
  left: auto;
  right: 17px;
}
.pin.above span,
.pin.below span {
  left: 0;
  top: -31px;
  transform: translateX(-50%);
}
.pin.below span {
  top: 11px;
}
.pin:hover i,
.pin.hot i,
.pin:focus-visible i {
  transform: scale(1.4);
}
.pin:focus-visible {
  outline: none;
}
.pin:focus-visible i {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}
.pin b {
  position: absolute;
  left: -290px;
  top: -290px;
  width: 580px;
  height: 580px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}
.pin.hot b {
  animation: ring-s 2.4s cubic-bezier(0.2, 0.6, 0.3, 1) infinite;
}
.pin.active b {
  animation: ring 3.6s cubic-bezier(0.2, 0.6, 0.3, 1) infinite;
}
.pin b:nth-of-type(2) {
  animation-delay: 0.8s;
}
.pin b:nth-of-type(3) {
  animation-delay: 1.6s;
}
.pin.active b:nth-of-type(2) {
  animation-delay: 1.2s;
}
.pin.active b:nth-of-type(3) {
  animation-delay: 2.4s;
}
@keyframes ring {
  0% {
    transform: scale(0.03);
    opacity: 0.8;
  }
  100% {
    transform: scale(1);
    opacity: 0;
  }
}
@keyframes ring-s {
  0% {
    transform: scale(0.03);
    opacity: 0.8;
  }
  100% {
    transform: scale(0.17);
    opacity: 0;
  }
}
.backdrop[data-mode="wide"] .pin {
  opacity: 0.32;
  pointer-events: none;
}
.backdrop[data-mode="wide"] .pin span {
  display: none;
}
.backdrop[data-mode="wide"] .pin.hot {
  opacity: 1;
}
.backdrop[data-mode="wide"] .pin.hot span {
  display: block;
}
.backdrop[data-mode="open"] .pin {
  pointer-events: none;
}
.backdrop[data-mode="open"] .pin span {
  display: none;
}
.pin.dim {
  opacity: 0.25;
}

/* ---------- page chrome ---------- */
.page {
  position: relative;
  z-index: 1;
  pointer-events: none;
  transition: opacity 0.45s;
}
html.v-open .page {
  opacity: 0;
}
.nav,
.hero-copy,
.shelf,
.foot {
  pointer-events: auto;
}
.nav .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px 24px;
  padding-block: 16px;
}
.brand {
  font-family: var(--display);
  font-size: 19px;
}
.brand strong {
  font-weight: 600;
}
.nav nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  font: 500 11.5px var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.nav nav a {
  color: var(--muted);
}
.nav nav a:hover {
  color: var(--ink);
}
.nav nav a[aria-current] {
  color: var(--accent);
}
.theme {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}
.theme:hover {
  color: var(--ink);
}
.theme::before {
  content: "";
  width: 10px;
  height: 10px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  background: linear-gradient(90deg, currentColor 50%, rgba(0, 0, 0, 0) 50%);
}
.theme[data-setting="light"]::before {
  background: none;
}
.theme[data-setting="dark"]::before {
  background: currentColor;
}
.foot {
  margin-top: 64px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}
.foot .wrap {
  padding-block: 14px;
}

/* ---------- hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.3fr);
  gap: 8px 40px;
  align-items: center;
  padding-block: 40px 26px;
}
.hero-copy > * {
  animation: rise 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
}
.hero-copy > :nth-child(2) {
  animation-delay: 0.08s;
}
.hero-copy > :nth-child(3) {
  animation-delay: 0.16s;
}
.hero-copy > :nth-child(4) {
  animation-delay: 0.24s;
}
@keyframes rise {
  from {
    transform: translateY(22px);
  }
}
.hero h1 {
  margin: 14px 0 0;
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(3.1rem, 6.6vw, 5.2rem);
  line-height: 0.94;
  letter-spacing: -0.025em;
  font-variation-settings: "opsz" 144;
}
.hero h1 em {
  font-weight: 300;
}
.lede {
  margin: 20px 0 22px;
  max-width: 33ch;
  font-family: var(--display);
  font-size: 1.16rem;
  font-weight: 300;
  line-height: 1.45;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgb(var(--bg-rgb) / 0.55);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition:
    border-color 0.2s,
    background 0.2s,
    color 0.2s;
}
.chip:hover {
  border-color: var(--ink);
}
.chip[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}
.chip-n {
  font-family: var(--mono);
  font-size: 11px;
  opacity: 0.65;
}
.map-win {
  position: relative;
  height: 330px;
}
.vf {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--vf);
}
.vf:nth-child(1) {
  left: 0;
  top: 0;
  border-right: 0;
  border-bottom: 0;
}
.vf:nth-child(2) {
  right: 0;
  top: 0;
  border-left: 0;
  border-bottom: 0;
}
.vf:nth-child(3) {
  right: 0;
  bottom: 0;
  border-left: 0;
  border-top: 0;
}
.vf:nth-child(4) {
  left: 0;
  bottom: 0;
  border-right: 0;
  border-top: 0;
}
.map-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6px;
  margin: 0;
  color: var(--muted);
  font: 400 10.5px var(--mono);
  letter-spacing: 0.14em;
  text-align: center;
  text-transform: uppercase;
}

/* ---------- the grid of objects ---------- */
.shelf {
  padding-top: 6px;
}
.empty {
  margin: 30px 0 60px;
  color: var(--muted);
  font-family: var(--display);
  font-size: 1.2rem;
  font-style: italic;
  text-align: center;
}
.plain {
  margin: 0 0 40px;
  padding-left: 1.2em;
  line-height: 1.7;
}
.plain a {
  text-decoration: underline;
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 22px;
  --k: 0.85;
}
.cell {
  position: relative;
  min-width: 0;
  border-radius: 12px;
  animation: cell-in 1s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
  animation-delay: calc(var(--n) * 70ms + 150ms);
}
@keyframes cell-in {
  from {
    transform: translateY(34px) scale(0.95);
  }
}
.cell-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 400 / 368;
  perspective: 1100px;
}
.fit {
  position: absolute;
  left: 0;
  top: 0;
  width: 400px;
  height: 368px;
  transform-origin: 0 0;
  transform: scale(var(--k));
}
.fit,
.float,
.tilt,
.enter,
.pose {
  transform-style: preserve-3d;
}
.float {
  position: absolute;
  inset: 0;
  animation: float 7.5s ease-in-out infinite;
}
@keyframes float {
  0%,
  100% {
    transform: translateY(0) rotateZ(0deg);
  }
  50% {
    transform: translateY(-8px) rotateZ(0.7deg);
  }
}
/* --tx / --ty are set by the script from the pointer and the scroll position */
.tilt {
  transform: rotateX(calc(var(--rx0, 0deg) + var(--ty, 0) * 1deg)) rotateY(calc(var(--ry0, 0deg) + var(--tx, 0) * 1deg));
}
.cell .tilt {
  position: absolute;
  inset: 0;
}
.cell-text {
  position: relative;
  padding: 0 6px 14px;
  text-align: center;
}
.cell-text .kicker {
  font-size: 10.5px;
}
.cell h3 {
  margin: 6px 0 0;
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(1.15rem, 2.3vw, 1.7rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  text-wrap: balance;
  transition: color 0.25s;
}
.cell:hover h3,
.cell:focus-within h3 {
  color: var(--accent);
}
.cell-meta {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.35;
}
.cell-hit {
  position: absolute;
  inset: 0;
  z-index: 3;
  border: 0;
  border-radius: 12px;
  background: none;
  cursor: pointer;
}

/* ---------- 35mm film ---------- */
.film {
  position: relative;
  display: flex;
  gap: var(--gap);
  width: max-content;
  min-width: 100%;
  padding: var(--rebate) 34vw var(--rebate) var(--film-start, 0px);
  background: linear-gradient(var(--film), var(--film)) 0 var(--rebate) / 100% calc(100% - var(--rebate) * 2) no-repeat;
  -webkit-user-select: none;
  user-select: none;
}
/* the two perforated edges; where masks can be combined the holes are real, so the map shows through them */
.film::before,
.film::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: calc(var(--rebate) + 0.5px);
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0) 0 21%, var(--bg) 21% 79%, rgba(0, 0, 0, 0) 79%) 0 17px / var(--pitch) var(--hole-h) repeat-x,
    linear-gradient(180deg, var(--film-hi), rgba(255, 255, 255, 0) 70%),
    var(--film);
}
.film::before {
  top: 0;
}
.film::after {
  bottom: 0;
  transform: scaleY(-1);
}
@supports ((mask-composite: exclude) or (-webkit-mask-composite: xor)) {
  .film::before,
  .film::after {
    background: linear-gradient(180deg, var(--film-hi), rgba(255, 255, 255, 0) 70%), var(--film);
    -webkit-mask:
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 20' preserveAspectRatio='none'%3E%3Crect x='10' width='28' height='20' rx='4'/%3E%3C/svg%3E")
        0 17px / var(--pitch) var(--hole-h) repeat-x,
      linear-gradient(#000, #000);
    -webkit-mask-composite: xor;
    mask:
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 20' preserveAspectRatio='none'%3E%3Crect x='10' width='28' height='20' rx='4'/%3E%3C/svg%3E")
        0 17px / var(--pitch) var(--hole-h) repeat-x,
      linear-gradient(#000, #000);
    mask-composite: exclude;
  }
}
.frame {
  position: relative;
  flex: none;
  width: calc(var(--fh) * var(--ar, 1.5));
  height: var(--fh);
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: #14161c;
  scroll-snap-align: start;
}
button.frame {
  cursor: zoom-in;
}
.frame img {
  width: 100%;
  height: 100%;
  border-radius: 3px;
}
button.frame:hover img {
  filter: brightness(1.12);
}
.edge {
  position: absolute;
  color: var(--amber);
  font: 500 8.5px/9px var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  text-shadow: 0 0 5px var(--edge-glow);
  pointer-events: none;
}
.edge.t {
  bottom: calc(100% + var(--hole-h) + 12px);
}
.edge.b {
  top: calc(100% + var(--hole-h) + 12px);
}
.edge.l {
  left: 1px;
}
.edge.r {
  right: 1px;
}
.edge.c {
  left: 50%;
}
.frame.p .edge.r,
.frame.p .edge.c {
  display: none;
}

/* ---------- film canister: 24 facets around a cylinder, the label wrapped across them ---------- */
.can {
  position: absolute;
  width: 0;
  height: 0;
  transform-style: preserve-3d;
  pointer-events: none;
}
.can-3d {
  position: absolute;
  left: -92px;
  top: -156px;
  width: 184px;
  height: 312px;
  transform-style: preserve-3d;
  transform: scale3d(var(--can-k, 1), var(--can-k, 1), var(--can-k, 1)) rotateX(-10deg);
}
.can-body {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}
.can-body i,
.can-knob i {
  position: absolute;
  left: 50%;
  top: 0;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.can-body i {
  background-image: linear-gradient(var(--sh), var(--sh)), var(--label);
  background-size:
    auto,
    var(--lw) 100%;
  background-position:
    0 0,
    calc(var(--spin, 0px) + var(--o)) 0;
  background-repeat: no-repeat, repeat-x;
}
.can-top {
  position: absolute;
  left: 0;
  top: -92px;
  width: 184px;
  height: 184px;
  border-radius: 50%;
  transform: rotateX(90deg);
  background: radial-gradient(circle, #0e0e10 0 17%, rgba(0, 0, 0, 0) 18%),
    radial-gradient(circle, rgba(0, 0, 0, 0) 0 62%, rgba(0, 0, 0, 0.3) 63% 65%, rgba(0, 0, 0, 0) 66%),
    conic-gradient(from 30deg, #eceef1, #8b8e95, #f4f5f7, #7c7f86, #dcdee2, #8f9299, #eceef1);
}
.can-knob {
  position: absolute;
  left: 62px;
  top: -20px;
  width: 60px;
  height: 20px;
  transform-style: preserve-3d;
}
.can-knob i {
  background: linear-gradient(var(--sh), var(--sh)), linear-gradient(180deg, #d9dbe0, #9a9da4);
}
.can-knob b {
  position: absolute;
  left: 0;
  top: -30px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  transform: rotateX(90deg);
  background: radial-gradient(circle, #2a2a2d 0 22%, rgba(0, 0, 0, 0) 23%), conic-gradient(from 10deg, #f2f3f5, #9c9fa6, #f6f7f8, #8a8d94, #f2f3f5);
}
.can-lip {
  position: absolute;
  left: 168px;
  top: 12px;
  width: 34px;
  height: 288px;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(90deg, #050505, #1d1d1e 55%, #0a0a0a);
  transform: translateZ(3px);
}
.can-shadow {
  position: absolute;
  left: -40px;
  top: 276px;
  width: 264px;
  height: 76px;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--cast-soft), rgba(0, 0, 0, 0));
  transform: translateZ(-3px);
}

/* ---------- album: a cover and leaves that turn on the spine ---------- */
.book {
  position: relative;
  width: calc(var(--pw) * 2);
  height: var(--ph);
  transform-style: preserve-3d;
}
.book-back {
  position: absolute;
  left: 50%;
  top: -6px;
  width: calc(var(--pw) + 7px);
  height: calc(var(--ph) + 12px);
  border-radius: 3px 9px 9px 3px;
  background: var(--cover);
  transform: translateZ(calc(var(--bd) * -1));
  box-shadow: 0 34px 60px -8px var(--cast);
}
.book-edge {
  position: absolute;
}
.book-edge.r {
  left: calc(50% + var(--pw));
  top: 0;
  width: var(--bd);
  height: var(--ph);
  transform-origin: 0 50%;
  transform: rotateY(90deg);
  background: repeating-linear-gradient(90deg, var(--e1) 0 1.5px, var(--e2) 1.5px 3px);
}
.book-edge.b {
  left: 50%;
  top: var(--ph);
  width: var(--pw);
  height: var(--bd);
  transform-origin: 50% 0;
  transform: rotateX(-90deg);
  background: repeating-linear-gradient(0deg, var(--e1) 0 1.5px, var(--e2) 1.5px 3px);
}
/* --i is the leaf's place in the stack; the same offset keeps the order right on both sides of the spine */
.leaf {
  position: absolute;
  left: 50%;
  top: 0;
  width: var(--pw);
  height: var(--ph);
  transform-origin: 0 50%;
  transform-style: preserve-3d;
  transform: rotateY(0deg) translateZ(calc(var(--i) * -0.7px));
  transition: transform 1s cubic-bezier(0.36, 0.06, 0.24, 1);
}
.leaf.flipped {
  transform: rotateY(-180deg) translateZ(calc(var(--i) * -0.7px));
}
.leaf.cover {
  top: -6px;
  width: calc(var(--pw) + 7px);
  height: calc(var(--ph) + 12px);
  transition-duration: 1.25s;
}
.face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: var(--paper);
  color: var(--page-ink);
}
.face.back {
  transform: rotateY(180deg);
}
.leaf:not(.cover) .front {
  border-radius: 0 3px 3px 0;
  box-shadow: inset 20px 0 26px -20px rgba(0, 0, 0, 0.45);
}
.leaf:not(.cover) .back {
  border-radius: 3px 0 0 3px;
  box-shadow: inset -20px 0 26px -20px rgba(0, 0, 0, 0.45);
}
.cover .front {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: calc(var(--pw) * 0.045);
  padding: 8% 8% 8% 16%;
  border-radius: 3px 9px 9px 3px;
  color: var(--foil);
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.1), rgba(0, 0, 0, 0.24)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.045) 0 1px, rgba(0, 0, 0, 0) 1px 3px),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.08) 0 1px, rgba(0, 0, 0, 0) 1px 3px), var(--cover);
  box-shadow:
    inset calc(var(--pw) * 0.1) 0 0 rgba(0, 0, 0, 0.17),
    inset calc(var(--pw) * 0.1 + 1px) 0 0 rgba(255, 255, 255, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.cover .front::after {
  content: "";
  position: absolute;
  inset: 5.5% 5.5% 5.5% 15%;
  border: 1px solid var(--foil);
  border-radius: 2px;
  opacity: 0.5;
}
.foil {
  font-family: var(--display);
  font-style: italic;
  font-size: calc(var(--pw) * 0.118);
  line-height: 1.05;
  text-align: center;
  text-wrap: balance;
  color: var(--foil);
  background: linear-gradient(100deg, var(--foil2), var(--foil) 38%, var(--foil2) 62%, var(--foil));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.foil-sm {
  font: 500 calc(var(--pw) * 0.036) var(--mono);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  opacity: 0.9;
}
.plate {
  width: 68%;
  aspect-ratio: 3 / 2;
  background: rgba(0, 0, 0, 0.3);
  box-shadow:
    0 0 0 3px rgba(0, 0, 0, 0.28),
    0 0 0 4px rgba(255, 255, 255, 0.08);
}
.plate img,
.mount img {
  width: 100%;
  height: 100%;
}
.cover .back {
  display: grid;
  align-content: end;
  gap: calc(var(--pw) * 0.03);
  padding: 12%;
  background: linear-gradient(rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05)), var(--paper);
}
.cover .back p {
  margin: 0;
}
.end-title {
  font-family: var(--display);
  font-size: calc(var(--pw) * 0.1);
  line-height: 1.05;
}
.end-note {
  font-family: var(--display);
  font-style: italic;
  font-size: calc(var(--pw) * 0.056);
  line-height: 1.35;
}
.end-meta {
  font: 400 calc(var(--pw) * 0.034) var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.7;
}
/* a mounted photograph keeps its own shape (--ar = width / height) inside the page */
.mount {
  position: absolute;
  left: 50%;
  top: 44%;
  width: min(calc(var(--pw) * 0.84), calc(var(--ph) * 0.62 * var(--ar, 1.5)));
  aspect-ratio: var(--ar, 1.5);
  background: rgba(0, 0, 0, 0.25);
  transform: translate(-50%, -50%) rotate(var(--mr, 0deg));
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}
.mount i {
  position: absolute;
  width: 15px;
  height: 15px;
  background: linear-gradient(135deg, var(--corner) 50%, rgba(0, 0, 0, 0) 50%);
}
.mount i:nth-of-type(1) {
  left: -4px;
  top: -4px;
}
.mount i:nth-of-type(2) {
  right: -4px;
  top: -4px;
  transform: rotate(90deg);
}
.mount i:nth-of-type(3) {
  right: -4px;
  bottom: -4px;
  transform: rotate(180deg);
}
.mount i:nth-of-type(4) {
  left: -4px;
  bottom: -4px;
  transform: rotate(270deg);
}
.page-cap {
  position: absolute;
  left: 9%;
  right: 9%;
  bottom: 7%;
  margin: 0;
  font-family: var(--display);
  font-style: italic;
  font-size: calc(var(--pw) * 0.053);
  line-height: 1.3;
  text-align: center;
}
.page-no {
  position: absolute;
  right: 5%;
  bottom: 3.5%;
  font: 500 calc(var(--pw) * 0.034) var(--mono);
  letter-spacing: 0.14em;
  opacity: 0.6;
}
.back-no {
  position: absolute;
  left: 8%;
  top: 4%;
  font-family: var(--display);
  font-weight: 300;
  font-size: calc(var(--pw) * 0.3);
  line-height: 1;
  opacity: 0.16;
}
.back-cap {
  position: absolute;
  left: 9%;
  right: 11%;
  bottom: 9%;
  margin: 0;
  font-family: var(--display);
  font-style: italic;
  font-size: calc(var(--pw) * 0.066);
  line-height: 1.35;
}

/* ---------- loose prints; the long edge of every print is --prw ---------- */
.print {
  position: absolute;
  left: 50%;
  top: 50%;
  padding: calc(var(--prw) * 0.03);
  background: var(--border);
  box-shadow:
    0 1px 1px rgba(0, 0, 0, 0.35),
    0 14px 24px -12px var(--cast);
  transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
  -webkit-user-select: none;
  user-select: none;
}
.print img {
  width: calc(var(--prw) * min(1, var(--ar, 1.5)));
  aspect-ratio: var(--ar, 1.5);
  background: #d9d6cf;
}

/* ---------- objects as they sit in the grid ---------- */
.obj {
  position: absolute;
  left: 200px;
  top: 184px;
  width: 0;
  height: 0;
  transform-style: preserve-3d;
}
.mini-roll {
  --fh: 112px;
  --gap: 8px;
  --can-k: 0.6;
  transform: rotateX(6deg) rotateY(-16deg);
}
.mini-roll .can {
  left: -140px;
  top: 0;
}
.mini-roll .leader {
  position: absolute;
  left: -190px;
  top: calc((var(--fh) + var(--rebate) * 2) / -2);
  transform: translateZ(-1px);
}
.mini-roll .film {
  min-width: 0;
  padding-right: 44px;
  clip-path: inset(0 round 0 12px 12px 0);
  transition: transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
  animation: tug 8s ease-in-out infinite;
  animation-delay: var(--d, 0s);
}
.mini-roll .can-body i {
  transition: background-position 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.cell:hover .mini-roll .film,
.cell:focus-within .mini-roll .film {
  transform: translateX(50px);
  animation: none;
}
.cell:hover .mini-roll .can-body,
.cell:focus-within .mini-roll .can-body {
  --spin: -64px;
}
@keyframes tug {
  0%,
  68%,
  100% {
    transform: translateX(0);
  }
  80%,
  88% {
    transform: translateX(16px);
  }
}
.mini-book {
  --pw: 228px;
  --ph: 288px;
  --bd: 22px;
  transform: rotateX(15deg) rotateY(-27deg) rotateZ(-3deg);
}
.mini-book .book {
  position: absolute;
  left: calc(var(--pw) * -1.5);
  top: calc(var(--ph) * -0.5);
}
.mini-book .leaf.cover {
  animation: peek 9s ease-in-out infinite;
  animation-delay: var(--d, 0s);
}
.cell:hover .mini-book .leaf.cover,
.cell:focus-within .mini-book .leaf.cover {
  transform: rotateY(-52deg) translateZ(0.7px);
  animation: none;
}
@keyframes peek {
  0%,
  66%,
  100% {
    transform: rotateY(0deg) translateZ(0.7px);
  }
  78%,
  88% {
    transform: rotateY(-20deg) translateZ(0.7px);
  }
}
/* --f fans the pile out: 0 at rest, 1 on hover */
@property --f {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}
.mini-pile {
  --prw: 266px;
  transform: rotateX(22deg) rotateZ(-5deg);
  animation: fan 8.5s ease-in-out infinite;
  animation-delay: var(--d, 0s);
}
.mini-pile .print {
  transform: translate(-50%, -50%)
    translate3d(calc(var(--x) + var(--f, 0) * var(--p) * 24px), calc(var(--y) - var(--f, 0) * var(--p) * 6px), var(--z))
    rotateZ(calc(var(--r) + var(--f, 0) * var(--p) * 2.6deg));
}
.cell:hover .mini-pile,
.cell:focus-within .mini-pile {
  --f: 1;
  animation: none;
}
@keyframes fan {
  0%,
  70%,
  100% {
    --f: 0;
  }
  80%,
  90% {
    --f: 0.4;
  }
}

/* ---------- WebGL layer (photography-gl.js) ---------- */
/* one canvas over the page; each cell's object is drawn into the cell's own rectangle */
.gl-grid {
  position: absolute;
  left: 0;
  top: 0;
  z-index: -1;
  pointer-events: none;
}
/* a cell or canister whose WebGL version is running hides its CSS one */
.cell.gl-on .fit,
.can.gl-on .can-3d {
  visibility: hidden;
}
.gl-view {
  outline-offset: -6px;
}
.gl-view:focus:not(:focus-visible) {
  outline: none;
}

/* ---------- an opened collection ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgb(var(--bg-rgb) / 0.6);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s;
}
.btn:hover:not(:disabled) {
  border-color: var(--ink);
}
.btn:disabled {
  opacity: 0.3;
  cursor: default;
}
.btn.round {
  width: 38px;
  padding: 0;
  font-size: 19px;
  line-height: 1;
}
#viewer {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgb(var(--bg-rgb) / 0.3);
  color: var(--ink);
  overflow-x: hidden;
  overflow-y: auto;
}
#viewer::backdrop {
  background: rgb(var(--bg-rgb) / 0);
}
.v-kind {
  min-width: 0;
}
.v-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  min-height: 100%;
  padding-block: calc(58px + env(safe-area-inset-top, 0px)) calc(26px + env(safe-area-inset-bottom, 0px));
}
.v-close {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top, 0px));
  right: var(--gutter-r);
  z-index: 5;
}
.v-text h2 {
  margin: 10px 0 0;
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(2.1rem, 5vw, 3.6rem);
  line-height: 1;
  letter-spacing: -0.018em;
  text-wrap: balance;
  font-variation-settings: "opsz" 144;
}
.meta {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13.5px;
}
.meta span + span::before {
  content: "·";
  margin-inline: 0.55em;
}
.note {
  margin: 12px 0 0;
  max-width: 36ch;
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 300;
  font-style: italic;
  line-height: 1.45;
}
.ctl {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
}
.count {
  min-width: 8ch;
  color: var(--accent);
  font: 500 12.5px var(--mono);
  letter-spacing: 0.08em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.count b {
  font-weight: 500;
}
.cap {
  min-height: 1.5em;
  margin: 14px 0 0;
  max-width: 40ch;
  font-size: 14.5px;
}
.tip {
  margin: 8px 0 0;
  color: var(--muted);
  font: 400 10.5px var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.enter {
  transition: transform 1.1s cubic-bezier(0.16, 0.84, 0.24, 1);
}
.v-kind:not(.in) .enter {
  transform: translateY(50px) rotateX(18deg) rotateY(16deg) scale(0.9);
}
.duo {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.3fr);
  gap: 10px 40px;
  align-items: center;
}
.stage {
  position: relative;
  display: grid;
  place-items: center;
  height: min(560px, calc(100vh - 150px));
  min-height: 420px;
  perspective: 1500px;
}
.stage .float {
  position: static;
}
.v-album {
  --pw: 292px;
  --ph: 366px;
  --bd: 24px;
}
.book-pose {
  transition: transform 1.15s cubic-bezier(0.3, 0.1, 0.2, 1);
  transform: translateX(calc(var(--pw) * -0.5)) rotateX(17deg) rotateY(-27deg) rotateZ(-3deg);
}
.is-open .book-pose {
  transform: translateX(var(--open-shift, 0px)) rotateX(9deg) rotateY(0deg) rotateZ(0deg);
}
.stage .book {
  cursor: pointer;
  touch-action: pan-y;
}
.v-stack {
  --prw: 384px;
}
.pile-pose {
  transform: rotateX(21deg) rotateZ(-4deg);
}
.pile {
  position: relative;
  width: calc(var(--prw) * 1.06);
  height: calc(var(--prw) * 0.73);
  transform-style: preserve-3d;
  touch-action: pan-y;
}
.pile .print.top {
  cursor: grab;
}
.v-roll .v-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px 24px;
}
.v-roll {
  --can-k: 1;
  --can-x: calc(var(--pad) + 78px);
  --film-start: 128px;
}
.roll-stage {
  position: relative;
  overflow: hidden;
  margin-top: 4px;
  padding-block: 50px 56px;
  perspective: 1500px;
  perspective-origin: 28% 50%;
}
.roll-3d {
  position: relative;
  --rx0: 3deg;
  --ry0: -8deg;
}
.roll-3d .can {
  left: var(--can-x);
  top: 50%;
}
.strip {
  position: relative;
  margin-left: var(--can-x);
  width: calc(124% - var(--can-x));
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scroll-padding-left: var(--film-start);
  cursor: grab;
  transform: translateZ(-1px);
}
.strip::-webkit-scrollbar {
  display: none;
}
.strip.dragging {
  cursor: grabbing;
  scroll-snap-type: none;
}
.strip.dragging .frame {
  cursor: grabbing;
}
.strip .frame:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

/* ---------- one photograph at full size ---------- */
#lb {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  color-scheme: dark;
  --bg: #0b0d12;
  --bg-rgb: 11 13 18;
  --ink: #ece6d8;
  --muted: #8f929d;
  --line: rgba(236, 230, 216, 0.16);
  --accent: #e9a43f;
  background: #08090c;
  color: var(--ink);
}
#lb[open] {
  display: flex;
  flex-direction: column;
}
#lb::backdrop {
  background: #08090c;
}
.lb-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) var(--gutter-r) 10px var(--gutter-l);
}
.lb-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 12px;
  margin: 0;
  font-family: var(--display);
  font-size: 18px;
}
.lb-title span + span {
  color: var(--amber);
  font: 500 12px var(--mono);
  letter-spacing: 0.06em;
}
.lb-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  margin-left: var(--gutter-l);
  margin-right: var(--gutter-r);
}
#lb-img {
  position: absolute;
  inset: 0;
  margin: auto;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  border-radius: 2px;
}
.lb-arrow {
  position: absolute;
  top: 50%;
  z-index: 1;
  transform: translateY(-50%);
}
#lb-prev {
  left: 0;
}
#lb-next {
  right: 0;
}
.lb-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px 28px;
  padding: 12px var(--gutter-r) calc(14px + env(safe-area-inset-bottom, 0px)) var(--gutter-l);
}
.lb-cap {
  min-width: 0;
  flex: 1 1 260px;
}
.lb-cap p {
  margin: 0;
}
#lb-cap {
  font-family: var(--display);
  font-style: italic;
  font-size: 16px;
}
#lb-place {
  color: var(--muted);
  font-size: 12.5px;
}
.lb-link {
  display: grid;
  gap: 4px;
  flex: 0 1 480px;
  min-width: 0;
}
.lb-link label {
  color: var(--muted);
  font-size: 11.5px;
}
#lb-status {
  margin-left: 6px;
  color: var(--amber);
  font-family: var(--mono);
}
.lb-link-row {
  display: flex;
  gap: 6px;
  min-width: 0;
}
#lb-url {
  flex: 1;
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11.5px;
}
.lb-act {
  flex: none;
  padding: 7px 12px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  background: var(--ink);
  color: var(--bg);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
}
.lb-act.ghost {
  background: transparent;
  color: var(--ink);
}

@media (max-width: 860px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    padding-block: 30px 14px;
  }
  .map-win {
    height: 230px;
  }
  .duo {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .stage {
    height: 400px;
    min-height: 0;
  }
  .v-album {
    --pw: 236px;
    --ph: 298px;
    --bd: 18px;
    --open-shift: calc(var(--pw) * -0.5 + 6px);
  }
  .v-stack {
    --prw: 246px;
  }
  .note {
    font-size: 1rem;
  }
  .v-text h2 {
    font-size: clamp(1.9rem, 8vw, 2.6rem);
  }
}
@media (max-width: 640px) {
  :root {
    --fh: 150px;
    --gap: 9px;
  }
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 12px;
  }
  .v-roll {
    --can-k: 0.745;
    --can-x: 20px;
    --film-start: 96px;
  }
  .cell-meta {
    font-size: 11.5px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
