/* Pursuit2Shoot — Liam Ferrari */

@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter/inter-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --paper: #0a0a0a;
  --ink: #f3f1ec;
  --soft: #cdc9c1;
  --mute: #8f8c86;
  --line: rgba(243, 241, 236, 0.16);
  --sans: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --edge: clamp(20px, 3.2vw, 48px);
  --gap: clamp(16px, 2.8vw, 44px);
  --ease: cubic-bezier(0.22, 0.7, 0.12, 1);
  --bar-h: 58px;
  color-scheme: dark;
}

@view-transition { navigation: auto; }
::view-transition-old(root) { animation: 0.45s ease both fade-out; }
::view-transition-new(root) { animation: 0.7s ease 0.1s both fade-in; }
@keyframes fade-out { to { opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } }

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--paper); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, p, ul { margin: 0; padding: 0; }
ul { list-style: none; }
::selection { background: var(--ink); color: var(--paper); }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 5px; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; top: 12px; left: 12px; z-index: 100; padding: 10px 16px; background: var(--ink); color: var(--paper); font-size: 13px; transform: translateY(-200%); }
.skip:focus { transform: none; }

/* The small tracked capitals used for every label and link. */
.bar__nav a, .foot, .tile__cap, .back, .head__note, .end__links a,
.next__label, .viewer__close, .viewer__count, .field label, .send, .direct span, .link, .missing__code, .cover__enter {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  line-height: 1.4;
}

/* Titles are the same capitals a size up and set wider. One typeface throughout. */
.intro__name, .head__title, .next__title, .inquire__title, .missing__title {
  font-size: clamp(15px, 1.5vw, 21px);
  font-weight: 500;
  letter-spacing: 0.42em;
  line-height: 1.7;
  text-transform: uppercase;
  text-wrap: balance;
}
/* Centred titles are nudged by one letter-space so they sit optically centred. */
.intro__name, .head__title, .next__title, .missing__title { padding-left: 0.42em; }

.signature { display: block; height: 100%; width: auto; }

/* ---------- cover ---------- */

.is-cover { overflow: hidden; }
.cover { position: fixed; inset: 0; background: var(--bg, var(--paper)); overflow: hidden; }
.cover picture { position: absolute; inset: 0; }
.cover__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--fx) var(--fy);
  animation: settle 2.8s var(--ease) both;
}
.cover::after { content: ''; position: absolute; inset: 0; background: rgba(0, 0, 0, var(--dim, 0.18)); pointer-events: none; }
@keyframes settle { from { opacity: 0; transform: scale(1.045); } }

.cover__enter {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 44px 60px;
  color: #fff;
  font-size: clamp(12px, 1.05vw, 15px);
  letter-spacing: 0.56em;
  animation: rise 1.4s var(--ease) 0.9s both;
}
/* A soft pool of shade behind the word keeps it readable on any photograph. */
.cover__enter::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: -40px -70px;
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.22) 55%, rgba(0, 0, 0, 0));
  pointer-events: none;
}
.cover__enter span { position: relative; display: block; padding: 0 0 14px 0.56em; }
.cover__enter span::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 28px;
  height: 1px;
  background: currentColor;
  transform: translateX(-50%);
  transition: width 0.6s var(--ease);
}
.cover__enter:hover span::after, .cover__enter:focus-visible span::after { width: 100%; }
/* Keyboard focus draws a fine frame around the word itself, not the large hit area. */
.cover__enter:focus-visible { outline: none; }
.cover__enter:focus-visible span { outline: 1px solid #fff; outline-offset: 16px; }
@keyframes rise { from { opacity: 0; transform: translate(-50%, calc(-50% + 10px)); } }

.cover__mark {
  position: absolute;
  z-index: 2;
  right: calc(var(--edge) + env(safe-area-inset-right));
  bottom: calc(var(--edge) + env(safe-area-inset-bottom));
  height: clamp(46px, 5.4vw, 68px);
  color: #fff;
  pointer-events: none;
  animation: fade-in 1.6s ease 1.3s both;
}

@media (max-width: 760px) and (orientation: portrait) {
  .cover__img { object-position: var(--mfx) var(--mfy); }
  .cover__mark { right: 50%; transform: translateX(50%); bottom: calc(28px + env(safe-area-inset-bottom)); height: 50px; }
}

/* ---------- top bar ---------- */

.bar {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px var(--edge);
  color: #fff;
  pointer-events: none;
}
/* A soft shade behind the bar keeps the logo and links readable over any
   photograph that scrolls beneath; it is invisible against the black page. */
.bar::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0 0 auto;
  height: 150px;
  background: linear-gradient(rgba(10, 10, 10, 0.9), rgba(10, 10, 10, 0.74) 42%, rgba(10, 10, 10, 0));
  pointer-events: none;
}
.bar a { pointer-events: auto; }
.bar__logo { display: block; height: 44px; }
.bar__nav { display: flex; gap: clamp(24px, 3vw, 44px); }
.bar__nav a, .end__links a, .link, .back { position: relative; padding: 14px 0; }
.bar__nav a::after, .end__links a::after, .link::after, .back::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0.26em;
  bottom: 8px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.5s var(--ease);
}
.bar__nav a:hover::after, .end__links a:hover::after, .link:hover::after, .back:hover::after { transform: scaleX(1); transform-origin: left; }

/* ---------- portfolio ---------- */

.portfolio { padding: 132px var(--edge) 0; }
.intro { max-width: 46ch; margin: 0 auto clamp(48px, 6vw, 84px); text-align: center; color: var(--soft); font-size: 17px; line-height: 1.75; text-wrap: pretty; }
.intro p + p { margin-top: 0.8em; }
.intro--mast { max-width: none; color: var(--ink); }
.intro__meta { display: flex; flex-wrap: wrap; justify-content: center; margin-top: 14px; color: var(--mute); font: 500 11px/1.4 var(--sans); letter-spacing: 0.26em; text-transform: uppercase; }
.intro__meta span + span::before { content: '·'; margin: 0 1.1em; letter-spacing: 0; }

.grid { display: block; }
.grid:not(.is-ready) { columns: 3; column-gap: var(--gap); animation: fade-in 0.6s ease 1.2s both; }
.grid:not(.is-ready) .tile { margin-bottom: var(--gap); break-inside: avoid; }
.grid.is-ready { display: flex; align-items: flex-start; gap: var(--gap); animation: fade-in 0.9s ease both; }
.grid__col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: var(--gap); }

.tile { position: relative; display: block; transition: opacity 0.6s ease; }
.tile__img { display: block; overflow: hidden; aspect-ratio: var(--ar); background: var(--bg); }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.4s var(--ease), opacity 0.8s ease; }
img.is-pending { opacity: 0; }
.tile__cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  padding: 48px 18px 16px;
  color: #fff;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));
  opacity: 0;
  transition: opacity 0.5s ease;
}
.tile:focus-visible { outline-offset: 3px; }
.tile:focus-visible .tile__cap { opacity: 1; }
@media (hover: hover) {
  .tile:hover img { transform: scale(1.025); }
  .tile:hover .tile__cap { opacity: 1; }
  .grid:has(.tile:hover) .tile:not(:hover) { opacity: 0.42; }
}

/* Without a pointer there is no hover, so the caption sits beneath the photograph
   like a gallery label: the shoot it belongs to, and how many frames are inside. */
@media (hover: none), (max-width: 760px) {
  .tile__cap { position: static; align-items: baseline; gap: 20px; padding: 12px 1px 0; background: none; color: var(--mute); opacity: 1; }
  .tile__cap span:last-child { flex: none; }
}

/* ---------- collection ---------- */

.collection { padding-top: 132px; }
.head { padding: 0 var(--edge); text-align: center; margin-bottom: clamp(56px, 6vw, 84px); }
.back { display: inline-block; color: var(--mute); transition: color 0.3s ease; }
.back:hover { color: var(--ink); }
.head__title { max-width: 30ch; margin: 44px auto 18px; }
.head__note { color: var(--mute); }
.head__text { max-width: 54ch; margin: 36px auto 0; color: var(--soft); font-size: 16px; line-height: 1.75; text-wrap: pretty; }
.head__text p + p { margin-top: 1em; }

.seq { display: flex; flex-direction: column; align-items: center; gap: clamp(28px, 6vw, 110px); padding: 0 clamp(20px, 6vw, 96px); }
.row { width: 100%; display: flex; justify-content: center; gap: var(--gap); }
.frame { display: block; flex: var(--arn) 1 0; min-width: 0; aspect-ratio: var(--ar); background: var(--bg); cursor: zoom-in; overflow: hidden; }
.frame img { width: 100%; height: 100%; object-fit: cover; transition: opacity 0.8s ease; }
/* Nothing is ever taller than the screen: widths are capped from the height. */
.row--wide .frame { flex: none; width: min(100%, calc(86vh * var(--arn))); }
.row--solo .frame { flex: none; width: min(52%, calc(86vh * var(--arn))); }
.row--pair { max-width: calc(86vh * var(--sum) + var(--gap)); }

.end { margin-top: clamp(90px, 13vw, 190px); padding: 0 var(--edge) clamp(70px, 9vw, 130px); text-align: center; }
.end__links { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px clamp(28px, 5vw, 64px); }
.next { display: inline-block; margin-top: clamp(70px, 9vw, 130px); padding: 10px 24px; }
.next__label { display: block; color: var(--mute); }
.next__title { display: block; max-width: 30ch; margin-top: 16px; transition: opacity 0.3s ease; }
.next:hover .next__title { opacity: 0.6; }

/* ---------- full-screen viewer ---------- */

.viewer { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: #050505; animation: fade-in 0.35s ease both; }
.viewer[hidden] { display: none; }
.viewer__img { max-width: calc(100vw - 2 * clamp(12px, 6vw, 96px)); max-height: calc(100dvh - 132px); width: auto; height: auto; object-fit: contain; user-select: none; -webkit-user-drag: none; transition: opacity 0.3s ease; }
.viewer__img.is-pending { opacity: 0; }
.viewer__close { position: absolute; z-index: 3; top: 12px; right: calc(var(--edge) - 12px); padding: 16px 12px; }
.viewer__count { position: absolute; left: 0; right: 0; bottom: calc(22px + env(safe-area-inset-bottom)); text-align: center; color: var(--mute); pointer-events: none; }
.viewer__nav { position: absolute; z-index: 2; top: 0; bottom: 0; width: 50%; }
.viewer__nav--prev { left: 0; cursor: w-resize; }
.viewer__nav--next { right: 0; cursor: e-resize; }
.viewer__nav::after { content: ''; position: absolute; top: 50%; width: 9px; height: 9px; border-top: 1px solid var(--ink); opacity: 0.55; transition: opacity 0.3s ease; }
.viewer__nav--prev::after { left: var(--edge); border-left: 1px solid var(--ink); transform: rotate(-45deg); }
.viewer__nav--next::after { right: var(--edge); border-right: 1px solid var(--ink); transform: rotate(45deg); }
.viewer__nav:hover::after { opacity: 1; }
.viewer__nav:focus-visible { outline-offset: -8px; }
.is-locked { overflow: hidden; }

/* ---------- inquire ---------- */

.inquire { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; min-height: 100dvh; }
.inquire--plain { grid-template-columns: 1fr; }
.inquire__photo { position: sticky; top: 0; height: 100vh; height: 100dvh; background: var(--bg); overflow: hidden; }
.inquire__photo img { width: 100%; height: 100%; object-fit: cover; animation: settle 2.4s var(--ease) both; }
.inquire__panel { display: flex; align-items: center; justify-content: center; padding: 130px var(--edge) 80px; }
.inquire__inner { width: 100%; max-width: 440px; }
.inquire__text { margin-top: 20px; color: var(--soft); line-height: 1.75; text-wrap: pretty; }

.form { margin-top: 52px; }
.field { margin-bottom: 30px; }
.field label { display: block; color: var(--mute); transition: color 0.3s ease; }
.field:focus-within label { color: var(--ink); }
.field input, .field textarea {
  display: block;
  width: 100%;
  padding: 10px 0 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: 400 17px/1.5 var(--sans);
  transition: border-color 0.3s ease;
  -webkit-appearance: none;
  appearance: none;
}
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus, .field textarea:focus { outline: none; border-bottom-color: var(--ink); }
.field input:-webkit-autofill { -webkit-text-fill-color: var(--ink); box-shadow: 0 0 0 100px var(--paper) inset; caret-color: var(--ink); }
.field.is-invalid input, .field.is-invalid textarea { border-bottom-color: #e0a295; }
.field--trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form__error { margin: -6px 0 22px; color: #e9b1a5; font-size: 14px; }
.send { display: block; width: 100%; height: 58px; border: 1px solid var(--ink); transition: background 0.4s ease, color 0.4s ease, opacity 0.3s ease; }
.send:hover, .send:focus-visible { background: var(--ink); color: var(--paper); }
.send[disabled] { opacity: 0.5; cursor: default; }
.thanks { margin-top: 36px; }
.thanks:focus { outline: none; }
.thanks p { margin-bottom: 26px; color: var(--soft); font-size: 17px; line-height: 1.7; }
.link { display: inline-block; }

.direct { margin-top: 56px; border-top: 1px solid var(--line); }
.direct li { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.direct span { color: var(--mute); }
.direct a { padding: 12px 0 12px 20px; font-size: 15px; transition: opacity 0.3s ease; }
.direct a:hover { opacity: 0.6; }

/* ---------- footer, 404 ---------- */

.foot { display: flex; justify-content: space-between; gap: 20px; margin-top: clamp(90px, 12vw, 170px); padding: 30px var(--edge); color: var(--mute); }
.is-collection .foot { margin-top: 0; border-top: 1px solid var(--line); }
.is-collection .foot a { display: none; } /* Instagram already sits just above */
.foot a { padding: 15px 0; margin: -15px 0; transition: color 0.3s ease; }
.foot a:hover { color: var(--ink); }

.missing { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; text-align: center; padding: var(--edge); }
.missing__code { color: var(--mute); }
.missing__title { margin-bottom: 14px; }

/* ---------- tablet ---------- */

@media (max-width: 1099px) {
  .grid:not(.is-ready) { columns: 2; }
}

/* ---------- phone: its own layout ---------- */

@media (max-width: 760px) {
  :root { --edge: 14px; --gap: 14px; }
  body:not(.is-cover) { padding-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom)); }

  /* Signature sits centred at the top and scrolls away with the page;
     Message / Inquire become a fixed bar within thumb's reach. */
  .bar { position: absolute; justify-content: center; padding: 26px var(--edge); }
  .bar__logo { height: 46px; }
  .bar__nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    gap: 0;
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(10, 10, 10, 0.82);
    -webkit-backdrop-filter: blur(18px) saturate(1.2);
    backdrop-filter: blur(18px) saturate(1.2);
    border-top: 1px solid var(--line);
    pointer-events: auto;
  }
  .bar__nav a { flex: 1; display: flex; align-items: center; justify-content: center; height: var(--bar-h); padding: 0 0 0 0.26em; }
  .bar__nav a + a { border-left: 1px solid var(--line); }
  .bar__nav a::after { display: none; }
  .bar__nav a:active { background: rgba(243, 241, 236, 0.08); }

  .portfolio { padding-top: 124px; }
  .intro--mast { margin-bottom: 44px; }
  .intro__meta { flex-direction: column; align-items: center; gap: 9px; text-align: center; }
  .intro__meta span + span::before { display: none; }
  .grid:not(.is-ready) { columns: 1; }
  .grid__col { gap: 30px; }
  .grid:not(.is-ready) .tile { margin-bottom: 30px; }

  .collection { padding-top: 112px; }
  .seq { padding: 0 var(--edge); gap: var(--gap); }
  .row { flex-direction: column; }
  .row .frame, .row--wide .frame, .row--solo .frame { flex: none; width: 100%; }
  .row--pair { max-width: none; }
  .end__links { flex-direction: column; align-items: center; gap: 2px; }

  .viewer__img { max-width: 100vw; max-height: calc(100dvh - 150px); }
  .viewer__nav::after { top: auto; bottom: calc(26px + env(safe-area-inset-bottom)); opacity: 0.8; }
  .viewer__nav--prev::after { left: auto; right: 62px; }
  .viewer__nav--next::after { right: auto; left: 62px; }

  .inquire { display: block; }
  .inquire__photo { position: relative; height: 56vh; height: 56svh; }
  .inquire__panel { padding: 48px 22px 64px; }
  .inquire--plain .inquire__panel { padding-top: 130px; }
  .field input, .field textarea { font-size: 16px; } /* stops iOS zooming on focus */

  .foot { flex-direction: column; align-items: center; gap: 8px; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0s !important; transition-duration: 0.01ms !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
