:root {
  --bg: #0a0a0b;
  --fg: #efeae2;
  --mute: rgba(239, 234, 226, .56);
  --accent: #ff4a1c;
  --pad: clamp(18px, 2vw, 30px);
  --info: 400px;
  --spring: cubic-bezier(.16, 1, .3, 1);
  --spring-dur: .9s;
  --display: "Anybody", "Arial Narrow", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img { display: block; -webkit-user-drag: none; user-select: none; }
:focus-visible { outline: 1px solid var(--fg); outline-offset: 4px; }

/* ───────── WebGL canvas (draws the photographs; DOM panels above carry labels + input) ───────── */
.gl { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; display: none; }
html.has-gl .gl { display: block; }
html.has-gl .panel { background: transparent; }
html.has-gl .info { background: transparent; }
html.has-gl .panel-img, html.has-gl .panel-dim, html.has-gl .panel-scrim { display: none; }

/* ───────── Stage: six panels stacked, moved only by transforms ───────── */
.stage {
  position: fixed; inset: 0;
  overflow: hidden;
  pointer-events: none;
  touch-action: none;
  z-index: 2;
}
.panel {
  position: absolute; inset: 0;
  display: block;
  overflow: hidden;
  color: var(--fg);
  text-decoration: none;
  background: var(--bg);
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  outline: none;
  will-change: transform;
}
.panel-img {
  position: absolute; inset: 0;
  will-change: transform;
}
.panel-img img { width: 100%; height: 100%; object-fit: cover; }
.panel-dim, .panel-scrim { position: absolute; inset: 0; pointer-events: none; opacity: 0; }
.panel-dim { background: #000; }
.panel-scrim { background: linear-gradient(to top, rgba(0,0,0,.92) 0%, rgba(0,0,0,.55) 38%, rgba(0,0,0,.12) 78%, transparent 100%); }

.panel-labelwrap { position: absolute; left: 0; top: 0; width: 0; height: 0; pointer-events: none; }
.panel-label {
  position: absolute;
  left: var(--pad); bottom: var(--pad);
  display: flex; align-items: center; gap: 16px;
  white-space: nowrap;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  text-shadow: 0 2px 24px rgba(0,0,0,.45);
}
.panel-label .idx { font: 500 11px/1 var(--mono); letter-spacing: .12em; color: var(--fg); opacity: .8; }
.panel-label .ttl {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(26px, 2.7vw, 46px);
  line-height: .9;
  text-transform: uppercase;
  letter-spacing: .01em;
  font-variation-settings: "wdth" 100;
}
.panel:focus-visible .panel-label .ttl { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }

html.rows .panel-label { writing-mode: horizontal-tb; transform: none; left: 16px; bottom: 14px; gap: 12px; align-items: baseline; }
html.rows .panel-label .ttl { font-size: clamp(22px, 6.4vw, 34px); }

/* ───────── Name mark / back ───────── */
.mark, .back {
  position: fixed; z-index: 20;
  top: var(--pad); left: var(--pad);
  display: flex; align-items: center; gap: 12px;
  font: 500 12px/1 var(--mono);
  letter-spacing: .14em; text-transform: uppercase;
  padding: 10px 0;
  text-shadow: 0 1px 18px rgba(0,0,0,.5);
  transition: opacity .35s ease, transform var(--spring-dur) var(--spring);
}
.mark { padding: 0; }
.mark-logo { width: 38px; height: 38px; filter: drop-shadow(0 1px 14px rgba(0,0,0,.45)); transition: transform var(--spring-dur) var(--spring); }
.mark:hover .mark-logo { transform: scale(1.08); }
.mark[aria-expanded="true"] .mark-logo { transform: rotate(90deg) scale(.92); }
.mark-hint { display: flex; align-items: center; gap: 10px; font: 500 10px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; opacity: .75; transition: opacity .4s ease, transform var(--spring-dur) var(--spring); }
.mark-hint::before { content: ""; width: 22px; height: 1px; background: currentColor; transform-origin: 0 50%; animation: hint 2.8s ease-in-out infinite; }
@keyframes hint { 0%, 100% { transform: scaleX(.35); opacity: .5; } 50% { transform: scaleX(1); opacity: 1; } }
.mark:hover .mark-hint { opacity: 1; }
.mark[aria-expanded="true"] .mark-hint { opacity: 0; transform: translateX(-10px); }
@media (prefers-reduced-motion: reduce) { .mark-hint::before { animation: none; } }

.back { opacity: 0; pointer-events: none; transform: translateX(-18px); }
.back { padding: 16px 12px 16px 0; }
.back i { width: 34px; height: 1px; background: currentColor; position: relative; transition: width var(--spring-dur) var(--spring); }
.back i::before { content: ""; position: absolute; left: 0; top: -3px; width: 7px; height: 7px; border-left: 1px solid; border-bottom: 1px solid; transform: rotate(45deg); }
.back:hover i { width: 52px; }
body.is-open .back { opacity: 1; pointer-events: auto; transform: none; }
body.is-open .mark { opacity: 0; pointer-events: none; transform: translateX(-18px); }
body.intro .mark { opacity: 0; }

/* ───────── Info: the seventh column that pushes the six ───────── */
.info {
  position: fixed; z-index: 1;
  left: 0; top: 0; bottom: 0; width: var(--info);
  background: var(--bg);
  --p: 0;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 22px;
  padding: 96px var(--pad) var(--pad);
  overflow: hidden;
  visibility: hidden;
}
.info.on { visibility: visible; }
.info > * {
  opacity: clamp(0, calc(var(--p) * 2.4 - .25), 1);
  transform: translate3d(calc(var(--off, 0px) * (1 + var(--i, 0) * .16)), 0, 0);
  will-change: transform;
}
.info .portrait { width: 100%; flex: 1 1 0; min-height: 0; max-height: 46vh; object-fit: cover; object-position: 50% 25%; filter: grayscale(1) contrast(1.05); }
.info .about { font-family: var(--display); font-variation-settings: "wdth" 88; font-weight: 500; font-size: clamp(17px, 1.45vw, 22px); line-height: 1.28; text-wrap: pretty; }
.info .role { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--mute); }
.info dl { display: grid; grid-template-columns: auto 1fr; gap: 9px 18px; font-size: 12px; letter-spacing: .04em; }
.info dt { color: var(--mute); text-transform: uppercase; letter-spacing: .14em; font-size: 10px; padding-top: 2px; }
.info dd a { color: var(--fg); text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .5s var(--spring); padding-bottom: 2px; overflow-wrap: anywhere; }
.info dd a:hover { background-size: 100% 1px; }
.info .clients { font-size: 11px; line-height: 1.7; letter-spacing: .06em; color: var(--mute); text-transform: uppercase; }
.info .clients b { display: block; font-weight: 500; color: var(--fg); letter-spacing: .14em; font-size: 10px; margin-bottom: 4px; }

html.rows .info { right: 0; bottom: auto; width: auto; height: var(--info); padding-top: 64px; gap: 14px; }
html.rows .info > * { transform: translate3d(0, calc(var(--off, 0px) * (1 + var(--i, 0) * .16)), 0); }
html.has-gl .info .portrait { display: none; }
html.rows .info .portrait { max-height: 22vh; }

/* ───────── Gallery ───────── */
.gallery {
  position: fixed; inset: 0; z-index: 5;
  overflow-y: auto; overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: none;
  opacity: 0; pointer-events: none;
  transform: translate3d(0, 26px, 0);
  transition: opacity .2s ease, transform .3s ease;
  --gutter: clamp(72px, 8.5vw, 136px);
  padding: 0 var(--gutter);
}
.gallery::-webkit-scrollbar { display: none; }
.gallery.on { opacity: 1; pointer-events: auto; transform: none; transition: opacity .5s ease, transform var(--spring-dur) var(--spring); }
html.rows .gallery { --gutter: 10px; }

.gal-spacer { height: 60vh; height: 60svh; }
.gal-meta { display: flex; justify-content: space-between; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--mute); padding-bottom: 14px; }
.grid { position: relative; }

.ph {
  position: absolute; display: block; overflow: hidden;
  background: rgba(255,255,255,.04);
  opacity: 0;
  transform: translate3d(0, 64px, 0) scale(.965);
  transition: opacity .7s ease var(--d, 0ms), transform var(--spring-dur) var(--spring) var(--d, 0ms);
}
.ph.in { opacity: 1; transform: none; }
.ph img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--spring), filter .5s ease; }
.ph.lifted { visibility: hidden; }
@media (hover: hover) {
  .grid:hover .ph img { filter: brightness(.55) saturate(.8); }
  .grid .ph:hover img { filter: none; transform: scale(1.04); }
}

.gal-next {
  display: flex; align-items: baseline; gap: 18px;
  margin: 12vh 0 14vh;
  text-align: left;
}
.gal-next small { font: 500 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--mute); }
.gal-next strong {
  font-family: var(--display); font-weight: 800; text-transform: uppercase;
  font-size: clamp(40px, 8vw, 132px); line-height: .9;
  font-variation-settings: "wdth" 70;
  transition: font-variation-settings 1s var(--spring);
}
.gal-next:hover strong, .gal-next:focus-visible strong { font-variation-settings: "wdth" 150; }

/* ───────── Lightbox ───────── */
.lb { position: fixed; inset: 0; z-index: 40; touch-action: none; }
.lb-bg { position: absolute; inset: 0; background: #060606; opacity: 0; }
.lb-img { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; max-width: none; }
.lb-count, .lb-close { position: absolute; font: 500 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.lb-count { left: 50%; bottom: var(--pad); transform: translateX(-50%); color: var(--mute); }
.lb-close { top: calc(var(--pad) - 8px); right: calc(var(--pad) - 8px); width: 44px; height: 44px; transition: transform var(--spring-dur) var(--spring); }
.lb-close::before, .lb-close::after { content: ""; position: absolute; left: 11px; top: 21.5px; width: 22px; height: 1px; background: currentColor; transform: rotate(45deg); }
.lb-close::after { transform: rotate(-45deg); }
.lb-close:hover { transform: rotate(90deg); }
.lb-nav { position: absolute; top: 50%; width: 72px; height: 96px; margin-top: -48px; display: grid; place-items: center; }
.lb-prev { left: calc(var(--pad) - 14px); }
.lb-next { right: calc(var(--pad) - 14px); }
.lb-nav i { width: 30px; height: 1px; background: currentColor; position: relative; opacity: .75; transition: width var(--spring-dur) var(--spring), opacity .3s ease; }
.lb-nav i::before { content: ""; position: absolute; top: -3px; width: 7px; height: 7px; border-left: 1px solid; border-bottom: 1px solid; }
.lb-prev i::before { left: 0; transform: rotate(45deg); }
.lb-next i::before { right: 0; transform: rotate(-135deg); }
.lb-nav:hover i { width: 48px; opacity: 1; }
.lb-nav[disabled] { pointer-events: none; }
.lb-nav[disabled] i { opacity: .18; }
html.rows .lb-nav { top: auto; bottom: calc(var(--pad) - 36px); margin: 0; }

@media (prefers-reduced-motion: reduce) {
  .ph { transform: none; transition: opacity .4s ease; }
  .gallery { transform: none; }
}

/* ───────── Loader: shown by plain HTML/CSS before any script runs ───────── */
.loader {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-content: center; justify-items: center; gap: 22px;
  background: var(--bg);
  transition: opacity .55s ease, visibility .55s;
  animation: loader-out .01s 8s forwards; /* never traps the visitor if scripts fail */
}
.loader img { width: 46px; height: 46px; animation: loader-pulse 1.6s ease-in-out infinite; }
.loader i { display: block; width: 120px; height: 1px; background: var(--fg); transform: scaleX(0); transform-origin: 0 50%; transition: transform .5s ease; }
body.loaded .loader { opacity: 0; visibility: hidden; }
@keyframes loader-pulse { 0%, 100% { opacity: .35; transform: scale(.94); } 50% { opacity: 1; transform: scale(1); } }
@keyframes loader-out { to { opacity: 0; visibility: hidden; } }

.mark-wrap { font: inherit; }

/* ───────── Text tile: a caption that takes one cell of the gallery grid ───────── */
.ph-text {
  background: none;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 16px 16px 14px 0;
  border-top: 1px solid rgba(239, 234, 226, .28);
}
.ph-text h2 {
  font-family: var(--display); font-weight: 800; text-transform: uppercase;
  font-size: clamp(26px, 3vw, 50px); line-height: .92;
  font-variation-settings: "wdth" 62;
  text-wrap: balance;
}
.ph-text p { margin-top: 12px; font: 500 10px/1.6 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--mute); max-width: 26ch; }
html.rows .ph-text { padding: 12px 0 10px; }
html.rows .ph-text p { max-width: none; }

/* ───────── Contact column on phones: description beside the portrait, details at the bottom ───────── */
html.rows .info { justify-content: flex-start; padding-top: 78px; }
html.rows .info .role { max-width: 46%; }
html.rows .info .about { max-width: 47%; font-size: clamp(15px, 4.3vw, 19px); line-height: 1.24; }
html.rows .info dl { margin-top: auto; }
