/* =============================================================
   Brandyn Vandal — Photography
   A quiet, image-first gallery. Near-monochrome UI so all the
   colour lives in the photographs. Light theme matched to the
   source Darkroom portfolio (#f5f6f8 ground, near-black ink).
   ============================================================= */

:root {
  --bg:        #f5f6f8;   /* page ground, matched to source */
  --bg-2:      #eef0f3;   /* faint panels / hovers          */
  --ink:       #17181c;   /* primary text                   */
  --ink-soft:  #52565e;   /* secondary text                 */
  --ink-faint: #8b9098;   /* labels, meta                   */
  --line:      rgba(20, 22, 26, 0.10);
  --line-2:    rgba(20, 22, 26, 0.16);
  --shadow:    0 18px 50px -22px rgba(17, 18, 22, 0.45);

  --maxw: 1560px;
  --gutter: clamp(16px, 4vw, 56px);

  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI",
          Roboto, Helvetica, Arial, sans-serif;

  --track: 0.18em;   /* wide tracking for small caps labels */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* accessible focus ring */
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* skip link */
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--ink); color: var(--bg);
  padding: 10px 16px; border-radius: 4px;
  transition: top 0.2s var(--ease);
}
.skip:focus { top: 12px; }

/* small-caps label helper */
.label {
  font-size: 11px;
  letter-spacing: var(--track);
  text-transform: uppercase;
  font-weight: 500;
  color: var(--ink-faint);
}

/* ---------- header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--gutter);
  height: 66px;
  color: #fff;                      /* white over the hero image */
  transition: background 0.4s var(--ease), color 0.4s var(--ease),
              border-color 0.4s var(--ease), height 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.solid {
  background: rgba(245, 246, 248, 0.86);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  color: var(--ink);
  border-bottom-color: var(--line);
  height: 60px;
}
.brand {
  display: inline-flex; align-items: baseline; gap: 10px;
  font-size: 14px; letter-spacing: 0.14em; text-transform: uppercase;
  font-weight: 600;
}
.brand .mark {
  font-size: 17px; letter-spacing: -0.06em; font-weight: 700;
  transform: translateY(1px);
}
.nav { display: flex; align-items: center; gap: clamp(16px, 3vw, 34px); }
.nav a {
  font-size: 12px; letter-spacing: var(--track);
  text-transform: uppercase; font-weight: 500;
  opacity: 0.9; transition: opacity 0.25s var(--ease);
  padding: 6px 0; position: relative;
}
.nav a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -1px;
  height: 1px; background: currentColor; transition: right 0.3s var(--ease);
}
.nav a:hover { opacity: 1; }
.nav a:hover::after, .nav a[aria-current="page"]::after { right: 0; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: min(78vh, 760px);
  display: grid; place-items: end center;
  background: var(--ink);
  overflow: hidden;
}
.hero__img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  object-position: center 42%;
  filter: saturate(1.02);
}
/* fade the banner down into the page ground */
.hero__scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(17,18,22,0.28) 0%, rgba(17,18,22,0) 26%),
    linear-gradient(0deg, var(--bg) 1%, rgba(245,246,248,0) 40%);
}
.hero__mast {
  position: relative; z-index: 2;
  text-align: center;
  padding: 0 var(--gutter) clamp(30px, 7vh, 74px);
}
.hero__name {
  margin: 0;
  font-size: clamp(30px, 6.4vw, 68px);
  line-height: 1.0;
  letter-spacing: -0.02em;
  font-weight: 600;
  color: var(--ink);
}
.hero__tag {
  margin: 14px 0 0;
  font-size: clamp(12px, 1.6vw, 15px);
  letter-spacing: var(--track);
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 500;
}

/* ---------- filter bar ---------- */
.filter {
  position: sticky; top: 60px; z-index: 40;
  display: flex; flex-wrap: wrap; gap: 6px 4px;
  justify-content: center; align-items: center;
  padding: 20px var(--gutter);
  background: linear-gradient(var(--bg), var(--bg) 70%, rgba(245,246,248,0));
}
.filter__btn {
  border: 0; background: transparent; cursor: pointer;
  color: var(--ink-faint);
  font-size: 11px; letter-spacing: var(--track); text-transform: uppercase;
  font-weight: 500;
  padding: 8px 14px; border-radius: 999px;
  transition: color 0.25s var(--ease), background 0.25s var(--ease);
  white-space: nowrap;
}
.filter__btn:hover { color: var(--ink); }
.filter__btn[aria-pressed="true"] {
  color: var(--ink); background: var(--bg-2);
}

/* ---------- gallery (masonry via CSS columns) ---------- */
.gallery {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 6px var(--gutter) clamp(60px, 10vh, 120px);
  column-count: 3;
  column-gap: clamp(12px, 1.6vw, 22px);
}
@media (max-width: 1040px) { .gallery { column-count: 2; } }
@media (max-width: 620px)  { .gallery { column-count: 1; } }

.tile {
  position: relative;
  display: block; width: 100%;
  margin: 0 0 clamp(12px, 1.6vw, 22px);
  break-inside: avoid;
  background: var(--bg-2);
  cursor: zoom-in;
  overflow: hidden;
  transform: translateZ(0);
}
.tile img {
  width: 100%; height: auto;
  transition: transform 0.9s var(--ease), filter 0.6s var(--ease);
  will-change: transform;
}
.tile::after {  /* location gradient, hidden until hover */
  content: "";
  position: absolute; inset: auto 0 0 0; height: 45%;
  background: linear-gradient(0deg, rgba(10,11,14,0.72), rgba(10,11,14,0));
  opacity: 0; transition: opacity 0.4s var(--ease);
  pointer-events: none;
}
.tile__meta {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  display: flex; align-items: center; gap: 8px;
  padding: 16px 18px;
  color: #fff;
  transform: translateY(6px);
  opacity: 0; transition: opacity 0.4s var(--ease), transform 0.5s var(--ease);
  pointer-events: none;
}
.tile__meta .pin { width: 12px; height: 12px; flex: none; opacity: 0.9; }
.tile__meta span {
  font-size: 12px; letter-spacing: 0.06em; font-weight: 500;
}
.tile:hover img,
.tile:focus-visible img { transform: scale(1.045); }
.tile:hover::after,
.tile:focus-visible::after { opacity: 1; }
.tile:hover .tile__meta,
.tile:focus-visible .tile__meta { opacity: 1; transform: translateY(0); }

/* keep a fixed box while the image streams in (no layout shift) */
.tile__ph { display: block; width: 100%; }

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 300;
  width: 100%; height: 100%; overflow: hidden;
  display: flex; flex-direction: column;
  background: rgba(12, 13, 16, 0.96);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  opacity: 0; visibility: hidden;
  transition: opacity 0.35s var(--ease), visibility 0.35s var(--ease);
}
.lightbox.open { opacity: 1; visibility: visible; }
.lightbox__stage {
  flex: 1 1 auto; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(58px, 8vh, 92px) clamp(16px, 6vw, 92px) 6px;
}
/* Constrain by the viewport, not by the parent track: an image's intrinsic
   min-height would otherwise override max-height:100% and overflow the screen. */
.lightbox__img {
  display: block;
  width: auto; height: auto;
  max-width: min(94vw, 1500px);
  max-height: 82vh;
  min-width: 0; min-height: 0;
  object-fit: contain;
  box-shadow: var(--shadow);
  opacity: 0; transition: opacity 0.4s var(--ease);
}
@supports (height: 100dvh) { .lightbox__img { max-height: 82dvh; } }
.lightbox__img.ready { opacity: 1; }

.lightbox__bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding: 14px clamp(16px, 6vw, 44px) clamp(20px, 4vh, 34px);
  color: #f3f4f6;
}
.lightbox__loc { display: flex; align-items: center; gap: 9px; min-width: 0; }
.lightbox__loc .pin { width: 14px; height: 14px; opacity: 0.75; flex: none; }
.lightbox__loc b { font-weight: 500; font-size: 15px; letter-spacing: 0.01em; }
.lightbox__loc small {
  display: block; margin-top: 1px;
  font-size: 10.5px; letter-spacing: var(--track); text-transform: uppercase;
  color: #9aa0a8;
}
.buy {
  display: inline-flex; align-items: center; gap: 9px;
  background: #fff; color: #16171b;
  padding: 12px 20px; border-radius: 999px;
  font-size: 12px; letter-spacing: var(--track); text-transform: uppercase;
  font-weight: 600; white-space: nowrap;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease);
}
.buy:hover { transform: translateY(-1px); background: #e9eaed; }
.buy svg { width: 13px; height: 13px; }

/* lightbox controls */
.lb-btn {
  position: absolute; z-index: 4;
  display: grid; place-items: center;
  width: 46px; height: 46px;
  border: 0; border-radius: 999px;
  background: rgba(255,255,255,0.08); color: #fff;
  cursor: pointer;
  transition: background 0.25s var(--ease), transform 0.25s var(--ease);
}
.lb-btn:hover { background: rgba(255,255,255,0.18); }
.lb-btn svg { width: 20px; height: 20px; }
.lb-close { top: 16px; right: clamp(12px, 4vw, 28px); }
.lb-prev { left: clamp(8px, 2vw, 24px); top: 50%; transform: translateY(-50%); }
.lb-next { right: clamp(8px, 2vw, 24px); top: 50%; transform: translateY(-50%); }
.lb-prev:hover { transform: translateY(-50%) scale(1.06); }
.lb-next:hover { transform: translateY(-50%) scale(1.06); }
.lb-count {
  position: absolute; top: 24px; left: clamp(12px, 4vw, 28px); z-index: 4;
  font-size: 11px; letter-spacing: var(--track); color: #b9bec5;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 620px) {
  .lb-prev, .lb-next { display: none; }   /* swipe on mobile */
}

/* ---------- contact ---------- */
.page {
  max-width: 760px; margin: 0 auto;
  padding: clamp(120px, 20vh, 220px) var(--gutter) clamp(80px, 14vh, 160px);
  min-height: 70vh;
}
.page__eyebrow { margin: 0 0 18px; }
.page h1 {
  margin: 0 0 22px;
  font-size: clamp(28px, 5vw, 46px); line-height: 1.08;
  letter-spacing: -0.02em; font-weight: 600;
}
.page p { margin: 0 0 20px; color: var(--ink-soft); font-size: 17px; max-width: 56ch; }
.contact-links {
  margin-top: 40px; padding-top: 30px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 14px;
}
.pill {
  display: inline-flex; align-items: center; gap: 10px;
  border: 1px solid var(--line-2); border-radius: 999px;
  padding: 13px 22px;
  font-size: 13px; letter-spacing: 0.04em; font-weight: 500;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease),
              transform 0.25s var(--ease);
}
.pill:hover { background: var(--bg-2); border-color: var(--ink); transform: translateY(-1px); }
.pill svg { width: 15px; height: 15px; opacity: 0.7; }
.pill--solid { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pill--solid:hover { background: #000; }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: clamp(44px, 8vh, 80px) var(--gutter);
  text-align: center;
  color: var(--ink-faint);
}
.site-footer .fname {
  font-size: 15px; letter-spacing: 0.14em; text-transform: uppercase;
  font-weight: 600; color: var(--ink);
}
.site-footer .ftag { margin: 8px 0 22px; font-size: 13px; letter-spacing: 0.06em; }
.site-footer nav { display: inline-flex; gap: 22px; margin-bottom: 22px; }
.site-footer nav a {
  font-size: 11px; letter-spacing: var(--track); text-transform: uppercase; font-weight: 500;
  color: var(--ink-soft); transition: color 0.2s var(--ease);
}
.site-footer nav a:hover { color: var(--ink); }
.site-footer .copy { font-size: 11px; letter-spacing: 0.08em; }

/* ---------- utilities / motion ---------- */
.reveal { opacity: 0; transform: translateY(14px); }
.reveal.in { opacity: 1; transform: none; transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
body.lb-lock { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* noscript fallback keeps the grid usable without JS */
.gallery.nojs .tile { cursor: default; }

/* ---------- contact form ---------- */
.cform { display: grid; gap: 10px; margin-top: 28px; }
.cfield {
  width: 100%; font: inherit; font-size: 15px; color: var(--ink);
  background: #fff; border: 1px solid var(--line-2); border-radius: 9px;
  padding: 13px 15px;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.cfield::placeholder { color: var(--ink-faint); }
.cfield:focus {
  outline: none; border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(20, 22, 26, 0.06);
}
textarea.cfield { resize: vertical; min-height: 118px; line-height: 1.5; }
.cselect { position: relative; display: block; }
.cselect select { appearance: none; -webkit-appearance: none; padding-right: 42px; cursor: pointer; }
.cselect select:required:invalid { color: var(--ink-faint); }
.cselect__chev {
  position: absolute; right: 15px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--ink-faint); pointer-events: none;
}
.cform__honey { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.cform__send {
  margin-top: 6px; justify-self: start;
  border: 0; cursor: pointer; background: var(--ink); color: var(--bg);
  font-size: 12px; letter-spacing: var(--track); text-transform: uppercase; font-weight: 600;
  padding: 14px 36px; border-radius: 999px;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease);
}
.cform__send:hover { background: #000; transform: translateY(-1px); }
.cform__send:disabled { opacity: 0.55; cursor: default; transform: none; }
.cform__status { margin: 2px 0 0; font-size: 13px; color: var(--ink-soft); min-height: 1px; }
.cform__status.is-error { color: #b4433a; }
.cform__status a { border-bottom: 1px solid currentColor; }
.cform__done {
  display: flex; gap: 13px; align-items: flex-start; margin-top: 28px;
  padding: 22px 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2);
}
.cform__done svg { width: 22px; height: 22px; color: #2f7d5b; flex: none; margin-top: 1px; }
.cform__done p { margin: 0; color: var(--ink-soft); font-size: 15px; line-height: 1.5; }
.cform__done b { color: var(--ink); font-weight: 600; }
.contact-alt { margin-top: 28px; font-size: 13px; color: var(--ink-faint); }
.contact-alt a { color: var(--ink-soft); border-bottom: 1px solid var(--line-2); }
.contact-alt a:hover { color: var(--ink); }

/* ---------- contact overlay (slide-down panel, echoes Darkroom) ---------- */
.cmodal {
  position: fixed; inset: 0; z-index: 320;
  display: flex; justify-content: center; align-items: flex-start;
  padding: clamp(64px, 12vh, 132px) 20px 24px;
  background: rgba(12, 13, 16, 0.5);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  overflow-y: auto;
  opacity: 0; transition: opacity 0.3s var(--ease);
}
.cmodal.open { opacity: 1; }
.cmodal[hidden] { display: none; }
.cmodal__panel {
  position: relative; width: 100%; max-width: 480px;
  background: var(--bg); border-radius: 16px;
  padding: clamp(28px, 4vw, 42px);
  box-shadow: 0 44px 100px -34px rgba(10, 11, 14, 0.62);
  transform: translateY(-18px); opacity: 0.4;
  transition: transform 0.36s var(--ease), opacity 0.36s var(--ease);
}
.cmodal.open .cmodal__panel { transform: translateY(0); opacity: 1; }
.cmodal .cform { margin-top: 22px; }
.cmodal__title { margin: 8px 0 0; font-size: clamp(21px, 3vw, 27px); letter-spacing: -0.01em; font-weight: 600; }
.cmodal__close {
  position: absolute; top: 15px; right: 15px;
  width: 38px; height: 38px; display: grid; place-items: center;
  border: 0; border-radius: 999px; background: transparent; color: var(--ink-soft); cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.cmodal__close:hover { background: var(--bg-2); color: var(--ink); }
.cmodal__close svg { width: 18px; height: 18px; }
