:root {
  --ink: #0b0b0b;
  --paper: #f5f1ea;
  --muted: rgba(245, 241, 234, 0.7);
  --line: rgba(245, 241, 234, 0.25);
  --font: "sofia-pro", "Jost", "Helvetica Neue", Arial, sans-serif;
  --logo-font: "quincy-cf", "Cormorant Garamond", Georgia, serif;
  --serif: "Cormorant Garamond", "Cormorant", Georgia, "Times New Roman", serif;
  --gutter: clamp(16px, 5vw, 80px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-film: cubic-bezier(0.76, 0, 0.24, 1);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
svg { width: 18px; height: 18px; flex: none; }

/* ── Header: centred floating nav ───────────────────────── */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: 140px;
  background: linear-gradient(rgba(0, 0, 0, 0.35), transparent);
  pointer-events: none;
}
.site-header > * { pointer-events: auto; }

.main-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(1.5rem, 3.4vw, 3.4rem);
  padding: 40px var(--gutter) 0;
  animation: nav-drop 0.9s var(--ease) 0.3s both;
}
.nav-link {
  position: relative;
  padding: 6px 0;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(245, 241, 234, 0.85);
  transition: color 0.3s;
}
.nav-link:hover,
.nav-link[aria-current] { color: var(--paper); }
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; right: 0.16em; bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}
.nav-link:hover::after,
.nav-link[aria-current]::after { transform: scaleX(1); }
.logo {
  margin: 0 clamp(0.5rem, 2vw, 2rem);
  font-family: var(--logo-font);
  font-size: 19px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}
@keyframes nav-drop { from { opacity: 0; transform: translateY(-12px); } }

.menu-btn { display: none; position: absolute; right: var(--gutter); top: 42px; width: 26px; height: 16px; }
.menu-btn span { position: absolute; left: 0; right: 0; height: 1px; background: currentColor; transition: transform 0.4s var(--ease), top 0.4s var(--ease); }
.menu-btn span:first-child { top: 3px; }
.menu-btn span:last-child { top: 12px; }
.menu-btn[aria-expanded="true"] span { top: 8px; transform: rotate(45deg); }
.menu-btn[aria-expanded="true"] span:last-child { transform: rotate(-45deg); }

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 45; /* under the header (50), so the name and close button stay on top */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.8rem;
  background: #080808;
}
.mobile-menu[hidden] { display: none; }
.mobile-menu .nav-link { font-size: 15px; letter-spacing: 0.24em; }

/* ── Full-screen slides ─────────────────────────────────── */
.slide {
  position: relative;
  display: flex;
  align-items: center;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  isolation: isolate;
}
.slide-media {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-size: cover, cover;
  background-position: center, center;
  transform: scale(1.14);
  filter: brightness(0.45) saturate(0.7) blur(3px);
  transition: transform 9s cubic-bezier(0.2, 0.6, 0.2, 1), filter 1.6s var(--ease);
}
/* Colour grade: teal shadows, warm highlights. */
.scene-media { background-image: var(--bg); }
@media (max-width: 860px) { .scene-media { background-image: var(--bg-mobile, var(--bg)); } }
.slide-media::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(0, 70, 80, 0.35), rgba(150, 80, 20, 0.22));
  mix-blend-mode: soft-light;
}
.slide-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0.1) 45%, transparent 70%),
    linear-gradient(transparent 70%, rgba(0, 0, 0, 0.35));
}
.is-open .slide.is-active .slide-media { transform: scale(1); filter: contrast(1.08) saturate(0.88); }
.panel .slide-media { transform: scale(1.06); }
.is-open .panel .slide-media { transform: scale(1); filter: contrast(1.08) saturate(0.88); }

.slide-text { padding: 0 var(--gutter); margin-top: 4vh; }
.slide-text > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1.2s var(--ease), transform 1.2s var(--ease);
}
.is-open .slide.is-active .slide-text > * { opacity: 1; transform: none; }
.is-open .slide.is-active .slide-text > .slide-index { transition-delay: 0.2s; }
.is-open .slide.is-active .slide-text > h2 { transition-delay: 0s; }
.is-open .slide.is-active .slide-text > .view-link { transition-delay: 0.9s; }

.slide-index { display: block; font-size: 11px; letter-spacing: 0.4em; text-transform: uppercase; color: var(--muted); margin-bottom: 1rem; }
.slide h2,
.work-tile h2 {
  margin: 0 0 1rem;
  font-family: var(--serif);
  font-size: clamp(3.2rem, 8vw, 7.5rem);
  font-weight: 300;
  letter-spacing: 0.01em;
  line-height: 0.95;
}

/* Title-card letters: each resolves out of a soft blur. */
.w { display: inline-block; white-space: nowrap; }
.ch {
  display: inline-block;
  opacity: 0;
  filter: blur(14px);
  transform: translateY(0.25em) scale(1.08);
  transition: opacity 1.4s var(--ease), filter 1.4s var(--ease), transform 1.6s var(--ease);
}
.is-open .is-active .ch,
.is-open .in-view .ch {
  opacity: 1;
  filter: blur(0);
  transform: none;
  transition-delay: calc(0.25s + var(--i) * 0.05s);
}

.view-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 14px;
  color: var(--paper);
}
.view-link svg { width: 16px; transition: transform 0.4s var(--ease); }
.view-link:hover svg,
.work-tile:hover .view-link svg,
.next-cat:hover .view-link svg { transform: translateX(6px); }

.dots {
  position: fixed;
  right: var(--gutter);
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  gap: 14px;
  z-index: 30;
}
.dots a { width: 7px; height: 7px; border-radius: 50%; border: 1px solid var(--paper); opacity: 0.6; transition: all 0.4s var(--ease); }
.dots a.is-active { background: var(--paper); opacity: 1; transform: scale(1.3); }

/* ── Work grid ──────────────────────────────────────────── */
.work-grid { display: grid; grid-template-columns: repeat(2, 1fr); }
.work-tile {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 70vh;
  padding: var(--gutter);
  overflow: hidden;
  isolation: isolate;
}
.work-tile:first-child { grid-column: 1 / -1; min-height: 100vh; min-height: 100svh; }
.work-tile-media {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-size: cover, cover;
  background-position: center, center;
}
.work-tile-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 40%, rgba(0, 0, 0, 0.55)); }
.work-tile:hover .work-tile-media { transform: scale(1.05); }
.work-tile .slide-index,
.work-tile .view-link { opacity: 0; transition: opacity 1s var(--ease) 0.8s; }
.is-open .work-tile.in-view .slide-index,
.is-open .work-tile.in-view .view-link { opacity: 1; }

/* The clip sits on an inner layer: a fully clipped element never registers as visible. */
.reveal-media { clip-path: inset(100% 0 0 0); transition: clip-path 1.6s var(--ease-film), transform 1.2s var(--ease); }
.is-open .reveal.in-view .reveal-media { clip-path: inset(0 0 0 0); }
.gallery-item:nth-child(3n + 2) .reveal-media { transition-delay: 0.12s; }
.gallery-item:nth-child(3n) .reveal-media { transition-delay: 0.24s; }

/* ── Gallery ────────────────────────────────────────────── */
/* Gallery pages open straight onto the grid under a slim title. */
.gallery-head { padding: 130px var(--gutter) 28px; animation: rise 1s var(--ease) both; }
.gallery-head h1 { margin: 0; font-family: var(--serif); font-size: clamp(2.6rem, 6vw, 5rem); font-weight: 300; line-height: 1; }
.back-link { display: inline-block; font-size: 13px; color: var(--muted); margin-bottom: 1rem; }
.back-link:hover { color: var(--paper); }

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 38vw;
  gap: 6px;
  padding: 6px;
}
.gallery-item { position: relative; overflow: hidden; transition: filter 0.4s; }
.gallery-item .reveal-media {
  position: absolute;
  inset: 0;
  background-size: cover, cover;
  background-position: center, center;
}
.gallery-item:nth-child(6n + 1),
.gallery-item:nth-child(6n + 5) { grid-row: span 2; }
.gallery-item:hover { filter: brightness(1.1); }

.next-cat { display: flex; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(5, 5, 5, 0.97);
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  align-items: center;
}
.lightbox[hidden] { display: none; }
.lb-img { height: 86vh; background-size: contain, cover; background-position: center; background-repeat: no-repeat; }
.lb-prev,
.lb-next { font-size: 42px; font-weight: 200; height: 100%; opacity: 0.7; }
.lb-prev:hover,
.lb-next:hover { opacity: 1; }
.lb-close { position: absolute; top: 24px; right: 24px; }
.lb-close svg { width: 28px; height: 28px; }
.lb-count { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); font-size: 12px; letter-spacing: 0.2em; color: var(--muted); }

/* ── About / Contact panels ─────────────────────────────── */
.panel { min-height: 100vh; min-height: 100svh; height: auto; }
.panel-text { max-width: 560px; padding: 140px var(--gutter) 120px; }
.panel-text > * { opacity: 0; }
.is-open .panel-text > * { opacity: 1; animation: rise 1.2s var(--ease) both; }
.is-open .panel-text > h1 { animation: none; opacity: 1; }
.is-open .panel-text > :nth-child(n + 3) { animation-delay: 1s; }
.panel h1 { margin: 0 0 1.5rem; font-family: var(--serif); font-size: clamp(2.8rem, 5.5vw, 5rem); font-weight: 300; line-height: 1; }
.panel p { font-size: 17px; line-height: 1.7; color: var(--muted); margin: 0 0 1.2rem; }
.panel .slide-media::after { background: linear-gradient(90deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.45) 50%, rgba(0, 0, 0, 0.1) 100%); }
.panel .view-link { margin-top: 1rem; }

.contact-list { list-style: none; padding: 0; margin: 0 0 2rem; display: grid; gap: 0.9rem; font-size: 16px; }
.contact-list a { display: inline-flex; align-items: center; gap: 0.8rem; color: var(--muted); }
.contact-list a:hover { color: var(--paper); }

.contact-form { display: grid; gap: 1rem; }
.contact-form input,
.contact-form textarea {
  font: inherit;
  font-size: 15px;
  color: var(--paper);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 0.8rem 0;
  resize: vertical;
  transition: border-color 0.3s;
}
.contact-form input::placeholder,
.contact-form textarea::placeholder { color: rgba(245, 241, 234, 0.45); }
.contact-form input:focus,
.contact-form textarea:focus { outline: none; border-color: var(--paper); }
.contact-form button { justify-self: start; margin-top: 0.5rem; }

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

/* ── Cinematic layer ────────────────────────────────────── */
/* Film grain */
.grain {
  position: fixed;
  inset: -50%;
  z-index: 90;
  pointer-events: none;
  opacity: 0.09;
  background-image: 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='0.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 0.9s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-6%, 4%); }
  40% { transform: translate(5%, -7%); }
  60% { transform: translate(-3%, 8%); }
  80% { transform: translate(7%, 2%); }
  100% { transform: translate(-4%, -5%); }
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 89;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}

/* Letterbox bars: closed on load, part to open, close again between pages. */
.letterbox span {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 95;
  height: 50.5vh;
  background: #000;
  pointer-events: none;
  transition: height 1.5s var(--ease-film);
}
.letterbox span:first-child { top: 0; }
.letterbox span:last-child { bottom: 0; }
.is-open .letterbox span { height: 0; }
.is-open.is-leaving .letterbox span { height: 50.5vh; transition-duration: 0.65s; }

/* Opening title card */
.intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 1.4rem;
  background: #000;
  text-align: center;
  cursor: pointer;
  transition: opacity 1.2s var(--ease);
}
.intro.is-done { opacity: 0; pointer-events: none; }
.intro-pre,
.intro-tag { font-size: 11px; letter-spacing: 0.5em; text-transform: uppercase; color: var(--muted); animation: fade-in 1.4s var(--ease) both; }
.intro-pre { animation-delay: 0.3s; }
.intro-tag { animation-delay: 2s; }
.intro-name { text-transform: uppercase; display: flex; font-family: var(--logo-font) !important; flex-wrap: wrap; justify-content: center; font-family: var(--serif); font-size: clamp(2rem, 6vw, 4.5rem); font-weight: 300; letter-spacing: 0.35em; padding-left: 0.35em; }
.intro-name span { display: inline-block; min-width: 0.3em; animation: resolve 1.6s var(--ease) both; }
.intro-name span:nth-child(odd) { animation-delay: 0.7s; }
.intro-name span:nth-child(even) { animation-delay: 0.95s; }
.intro-name span:nth-child(3n) { animation-delay: 1.15s; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes resolve { from { opacity: 0; filter: blur(16px); transform: scale(1.15); } }

/* Viewfinder HUD (home) */
.hud {
  position: fixed;
  left: var(--gutter);
  right: var(--gutter);
  bottom: 28px;
  z-index: 30;
  display: flex;
  justify-content: flex-end;
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s var(--ease) 1.2s;
}
.is-open .hud { opacity: 1; }
.hud b { font-weight: 400; color: var(--paper); }
.hud-tc { display: inline-flex; align-items: center; gap: 0.8em; }
.hud-tc i { width: 7px; height: 7px; border-radius: 50%; background: #d23b2a; animation: rec 1.6s steps(2) infinite; }
@keyframes rec { 50% { opacity: 0.15; } }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 760px) {
  .main-nav { padding-top: 34px; }
  .main-nav > .nav-link { display: none; }
  .menu-btn { display: block; top: 37px; }
  .logo { font-size: 17px; }
}

@media (max-width: 860px) {
  .gallery-head { padding-top: 100px; }
  .gallery { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 60vw; }
  /* Titles sit low on phones so they don't cover faces in the photos. */
  .slide:not(.panel) { align-items: flex-end; }
  .slide:not(.panel) .slide-text { margin: 0 0 96px; }
  .slide:not(.panel) .slide-media::after {
    background: linear-gradient(transparent 45%, rgba(0, 0, 0, 0.7));
  }
  .dots { display: none; }
  .work-grid { grid-template-columns: 1fr; }
  .work-tile { min-height: 80vh; }
  .lightbox { grid-template-columns: 44px 1fr 44px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .slide-media { transition: none; transform: none !important; }
  .slide-text > *,
  .panel-text > *,
  .ch,
  .reveal-media,
  .work-tile .slide-index,
  .work-tile .view-link { transition: none !important; animation: none !important; transform: none !important; opacity: 1 !important; filter: none !important; clip-path: none !important; }
  .main-nav,
  .grain,
  .hud-tc i { animation: none; }
  .letterbox { display: none; }
}
