/* ============================================================
   Nick — Bird Photography Portfolio
   Editorial dark · cinematic · minimal
   ============================================================ */

:root {
  /* tone — overridden by Tweaks */
  --bg:        #15110d;
  --bg-elev:   #1d1814;
  --ink:       #f3ede1;
  --muted:     #9d9384;
  --faint:     #6b6358;
  --line:      rgba(243, 237, 225, 0.12);
  --line-soft: rgba(243, 237, 225, 0.06);
  --accent:    #c8a368;

  /* type */
  --display: "Space Grotesk", "Hanken Grotesk", -apple-system, sans-serif;
  --sans:  "Hanken Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;

  /* gallery density — overridden by Tweaks */
  --col-min: 250px;
  --gap: 18px;

  --maxw: 1320px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: #15110d; }

img { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

/* shared eyebrow / label style */
.eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--muted);
}

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 64px);
}

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px clamp(20px, 5vw, 64px);
  transition: background .5s var(--ease), padding .5s var(--ease), border-color .5s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: color-mix(in oklab, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  padding-top: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}

.brand {
  font-family: var(--display);
  font-size: 23px;
  font-weight: 600;
  letter-spacing: 0.01em;
  display: flex;
  align-items: baseline;
  gap: 9px;
}
.brand .dot { color: var(--accent); font-size: 26px; line-height: 0; }
.brand small {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav-right { display: flex; align-items: center; gap: clamp(18px, 3vw, 38px); }
.nav-links { display: flex; gap: clamp(16px, 2.4vw, 30px); }
.nav-links a {
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  position: relative;
  padding: 4px 0;
  transition: color .35s var(--ease);
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px; background: var(--accent);
  transform: scaleX(0); transform-origin: left; transition: transform .4s var(--ease);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { transform: scaleX(1); }

.socials { display: flex; align-items: center; gap: 14px; }
.socials a {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  transition: color .35s var(--ease), border-color .35s var(--ease), background .35s var(--ease), transform .35s var(--ease);
}
.socials a:hover {
  color: var(--bg); background: var(--accent); border-color: var(--accent);
  transform: translateY(-2px);
}
.socials svg { width: 15px; height: 15px; }

.menu-btn { display: none; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  height: 100svh;
  min-height: 620px;
  width: 100%;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.hero image-slot {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(to top, var(--bg) 2%, color-mix(in oklab, var(--bg) 40%, transparent) 32%, transparent 62%),
    linear-gradient(to right, color-mix(in oklab, var(--bg) 55%, transparent), transparent 55%);
  pointer-events: none;
}
.hero-inner {
  position: relative; z-index: 2;
  width: 100%;
  padding-bottom: clamp(48px, 8vh, 96px);
}
.hero .eyebrow { margin-bottom: 22px; display: flex; align-items: center; gap: 14px; }
.hero .eyebrow::before { content: ""; width: 42px; height: 1px; background: var(--accent); }
.hero h1 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(44px, 8.5vw, 132px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  max-width: 14ch;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lede {
  margin-top: 30px;
  max-width: 52ch;
  font-size: clamp(15px, 1.5vw, 19px);
  line-height: 1.65;
  color: var(--muted);
}
.scroll-cue {
  position: absolute; right: clamp(20px, 5vw, 64px); bottom: clamp(40px, 7vh, 80px);
  z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  color: var(--muted); font-size: 10px; letter-spacing: 0.3em; text-transform: uppercase;
}
.scroll-cue .line { width: 1px; height: 54px; background: linear-gradient(var(--accent), transparent); position: relative; overflow: hidden; }
.scroll-cue .line::after {
  content: ""; position: absolute; top: -50%; left: 0; width: 100%; height: 50%;
  background: var(--ink); animation: drop 2.4s var(--ease) infinite;
}
@keyframes drop { 0% { top: -50%; } 60%,100% { top: 100%; } }

/* ============================================================
   SECTION HEADER
   ============================================================ */
.section { padding: clamp(70px, 11vh, 140px) 0; }
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 30px; flex-wrap: wrap;
  margin-bottom: clamp(34px, 5vh, 60px);
}
.section-head h2 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(32px, 5vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.025em;
}
.section-head .sub { color: var(--muted); max-width: 40ch; font-size: 15px; }
.section-head .eyebrow { margin-bottom: 16px; }

/* ============================================================
   FILTER BAR
   ============================================================ */
.filters {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-bottom: clamp(28px, 4vh, 44px);
}
.filter {
  font-family: var(--sans);
  font-size: 12.5px; font-weight: 500; letter-spacing: 0.06em;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 9px 19px;
  cursor: pointer;
  transition: color .3s var(--ease), border-color .3s var(--ease), background .3s var(--ease);
}
.filter:hover { color: var(--ink); border-color: var(--muted); }
.filter.active {
  color: var(--bg); background: var(--ink); border-color: var(--ink); font-weight: 600;
}
.filter .count { opacity: .55; margin-left: 6px; font-variant-numeric: tabular-nums; }

/* ============================================================
   GALLERY
   ============================================================ */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--col-min), 1fr));
  grid-auto-rows: 6px;
  gap: var(--gap);
}
.shot {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-elev);
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
.shot.in { opacity: 1; transform: none; }
/* leaving the grid on filter */
.shot.hide { display: none; }

.shot image-slot { width: 100%; height: 100%; }
.shot .ph-fill { position: absolute; inset: 0; }

.shot .meta {
  position: absolute; inset: auto 0 0 0; z-index: 3;
  padding: 20px 20px 18px;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
  background: linear-gradient(to top, color-mix(in oklab, var(--bg) 88%, transparent), transparent);
  opacity: 0; transform: translateY(8px);
  transition: opacity .45s var(--ease), transform .45s var(--ease);
  pointer-events: none;
}
.shot:hover .meta { opacity: 1; transform: none; }
.shot .meta .name { font-family: var(--display); font-size: 19px; font-weight: 500; line-height: 1.1; }
.shot .meta .loc  { font-size: 11.5px; color: var(--muted); letter-spacing: 0.04em; margin-top: 3px; }
.shot .meta .idx  {
  font-size: 11px; color: var(--accent); letter-spacing: 0.14em;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.shot .tag {
  position: absolute; top: 14px; left: 14px; z-index: 3;
  font-size: 10px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink);
  background: color-mix(in oklab, var(--bg) 55%, transparent);
  backdrop-filter: blur(6px);
  padding: 6px 11px; border-radius: 100px;
  opacity: 0; transform: translateY(-6px);
  transition: opacity .45s var(--ease), transform .45s var(--ease);
}
.shot:hover .tag { opacity: 1; transform: none; }

.shot::after {
  content: ""; position: absolute; inset: 0; z-index: 2;
  box-shadow: inset 0 0 0 1px var(--line-soft);
  background: color-mix(in oklab, var(--accent) 0%, transparent);
  transition: background .5s var(--ease);
  pointer-events: none;
}
.shot:hover::after { background: color-mix(in oklab, var(--bg) 8%, transparent); }

/* span variants — JS computes grid-row-end from each image's aspect ratio.
   These provide a sensible pre-JS fallback before layoutGrid() runs. */
.shot { grid-row: span 40; }
.shot[data-cols="2"] { grid-column: span 2; }

.empty-note {
  color: var(--faint); font-size: 14px; padding: 40px 0; text-align: center;
  grid-column: 1 / -1; display: none;
}

/* ============================================================
   COLLECTIONS INDEX
   ============================================================ */
.collections { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); }
.collection {
  background: var(--bg);
  padding: clamp(28px, 4vw, 46px);
  cursor: pointer;
  position: relative;
  transition: background .45s var(--ease);
  min-height: 220px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.collection:hover { background: var(--bg-elev); }
.collection .num { font-family: var(--display); font-size: 13px; color: var(--accent); letter-spacing: 0.1em; }
.collection h3 { font-family: var(--display); font-weight: 500; font-size: clamp(26px, 3vw, 38px); line-height: 1.04; margin-top: auto; }
.collection p { color: var(--muted); font-size: 13.5px; margin-top: 10px; }
.collection .go {
  margin-top: 18px; display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted);
  transition: gap .35s var(--ease), color .35s var(--ease);
}
.collection:hover .go { gap: 14px; color: var(--ink); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { border-top: 1px solid var(--line-soft); padding: clamp(60px, 9vh, 110px) 0 44px; }
.footer-grid { display: flex; justify-content: space-between; align-items: flex-end; gap: 40px; flex-wrap: wrap; }
.footer h2 { font-family: var(--display); font-weight: 500; font-size: clamp(30px, 5vw, 58px); line-height: 1.02; letter-spacing: -0.025em; max-width: 16ch; }
.footer h2 em { font-style: normal; color: var(--accent); }
.footer .contact { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.footer .contact a.mail { font-family: var(--display); font-size: clamp(18px, 2vw, 24px); border-bottom: 1px solid var(--line); padding-bottom: 4px; transition: border-color .35s var(--ease); }
.footer .contact a.mail:hover { border-color: var(--accent); }
.foot-socials { display: flex; gap: 12px; margin-top: 6px; }
.footer-base {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px;
  margin-top: clamp(50px, 8vh, 90px); padding-top: 26px; border-top: 1px solid var(--line-soft);
  font-size: 12px; color: var(--faint); letter-spacing: 0.04em;
}
.footer-base a:hover { color: var(--ink); }

/* ============================================================
   LIGHTBOX
   ============================================================ */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: color-mix(in oklab, #000 88%, var(--bg));
  backdrop-filter: blur(10px);
  display: grid; place-items: center;
  padding: clamp(20px, 5vw, 70px);
  opacity: 0; visibility: hidden; transition: opacity .45s var(--ease), visibility .45s var(--ease);
}
.lightbox.open { opacity: 1; visibility: visible; }
.lb-stage { position: relative; max-width: 1100px; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.lb-frame {
  width: 100%; aspect-ratio: 3 / 2; background: var(--bg-elev);
  position: relative; overflow: hidden;
  transform: scale(.96); transition: transform .5s var(--ease);
}
.lightbox.open .lb-frame { transform: scale(1); }
.lb-frame .ph-fill { position: absolute; inset: 0; width: 100%; height: 100%; }
.lb-cap { display: flex; align-items: baseline; justify-content: space-between; width: 100%; gap: 20px; flex-wrap: wrap; }
.lb-cap .name { font-family: var(--display); font-size: clamp(22px, 3vw, 34px); font-weight: 500; }
.lb-cap .name em { font-style: normal; color: var(--accent); font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; margin-left: 12px; vertical-align: middle; }
.lb-cap .loc { color: var(--muted); font-size: 13px; letter-spacing: 0.05em; }
.lb-close {
  position: fixed; top: 26px; right: 30px; z-index: 210;
  width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid var(--line); background: transparent; color: var(--ink);
  cursor: pointer; display: grid; place-items: center;
  transition: background .3s var(--ease), transform .3s var(--ease);
}
.lb-close:hover { background: var(--bg-elev); transform: rotate(90deg); }
.lb-nav {
  position: fixed; top: 50%; transform: translateY(-50%); z-index: 210;
  width: 52px; height: 52px; border-radius: 50%;
  border: 1px solid var(--line); background: color-mix(in oklab, var(--bg) 60%, transparent);
  color: var(--ink); cursor: pointer; display: grid; place-items: center;
  transition: background .3s var(--ease), border-color .3s var(--ease);
}
.lb-nav:hover { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.lb-nav.prev { left: clamp(12px, 3vw, 36px); }
.lb-nav.next { right: clamp(12px, 3vw, 36px); }
.lb-count { font-size: 12px; color: var(--faint); letter-spacing: 0.2em; font-variant-numeric: tabular-nums; }

/* ============================================================
   image-slot — dark-theme placeholder styling
   ============================================================ */
image-slot::part(frame) {
  background:
    radial-gradient(120% 90% at 50% 0%, color-mix(in oklab, var(--accent) 7%, var(--bg-elev)), var(--bg-elev) 70%);
}
image-slot::part(empty) { color: var(--muted); }
image-slot::part(ring)  { border-color: var(--line); }
.shot image-slot::part(empty) { letter-spacing: 0.02em; }

/* placeholder padding tiles — quieter than real frames */
.shot.is-ph image-slot { opacity: 0.5; filter: saturate(0.7); transition: opacity .5s var(--ease), filter .5s var(--ease); }
.shot.is-ph:hover image-slot { opacity: 0.78; filter: saturate(0.9); }
.shot.is-ph .meta .name { color: var(--muted); font-style: normal; }
.shot.is-ph .tag { background: color-mix(in oklab, var(--bg) 70%, transparent); color: var(--muted); }

/* reveal util */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 820px) {
  .nav-links { display: none; }
  .hero h1 { font-size: clamp(40px, 13vw, 88px); }
}
@media (max-width: 540px) {
  :root { --col-min: 100%; --gap: 14px; }
  .socials a { width: 30px; height: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  .shot, .reveal { opacity: 1 !important; transform: none !important; }
  .scroll-cue .line::after { animation: none; }
  html { scroll-behavior: auto; }
}
