/* ─────────────────────────────────────────────────────────────
   Glenn Dulay Photography — main.css  (editorial redesign)
   Inspiration: story-driven, airy, serif-italic editorial
   Palette: warm paper white, soft ink, no loud accent
   Type:    Cormorant Garamond (display) · Jost (utility/body)
   ───────────────────────────────────────────────────────────── */
:root {
  --bg: #fdfcfa;
  --tint: #f7f5f1;
  --ink: #1f1d1a;
  --soft: #4b4741;
  --muted: #8b857c;
  --hairline: #e7e3dc;
  --display: "Cormorant Garamond", Georgia, serif;
  --sans: "Jost", -apple-system, "Segoe UI", sans-serif;
  --wrap: 1180px;
  --ease: cubic-bezier(.22,.7,.3,1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 16.5px;
  line-height: 1.8;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; background: none; border: 0; cursor: pointer; color: inherit; }
em { font-style: italic; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 28px; }
.wrap-narrow { max-width: 720px; margin: 0 auto; padding: 0 28px; text-align: center; }
.section { padding: 128px 0; }
.section--tint { background: var(--tint); }

/* ── shared type ────────────────────────────────────────── */
.eyebrow {
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .38em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 18px;
}
.eyebrow--center { text-align: center; }
.sec-head { margin-bottom: 60px; }
.sec-head--center { text-align: center; }
.sec-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(38px, 5vw, 58px);
  line-height: 1.08;
  letter-spacing: .005em;
}
.sec-title em { font-weight: 400; }
.text-link {
  display: inline-block;
  margin-top: 26px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .3em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 5px;
  transition: opacity .2s, letter-spacing .3s var(--ease);
}
.text-link:hover { opacity: .6; letter-spacing: .36em; }

/* ── nav ────────────────────────────────────────────────── */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 34px;
  transition: background .35s var(--ease), box-shadow .35s var(--ease), padding .35s var(--ease), color .35s;
  color: #fff;
}
.nav.is-solid {
  background: rgba(253,252,250,.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--ink);
  box-shadow: 0 1px 0 var(--hairline);
  padding: 14px 34px;
}
.nav-brand {
  font-family: var(--display);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: .32em;
  text-transform: uppercase;
  line-height: 1;
}
.nav-links { display: flex; gap: 38px; }
.nav-links a {
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: .28em;
  text-transform: uppercase;
  opacity: .85;
  padding-bottom: 4px;
  border-bottom: 1px solid transparent;
  transition: opacity .2s, border-color .2s;
}
.nav-links a:hover { opacity: 1; border-color: currentColor; }
.nav-burger { display: none; width: 30px; height: 22px; position: relative; }
.nav-burger span {
  position: absolute; left: 0; width: 100%; height: 1.5px;
  background: currentColor; transition: transform .3s var(--ease), top .3s var(--ease);
}
.nav-burger span:first-child { top: 5px; }
.nav-burger span:last-child { top: 15px; }
.nav-burger.is-open span:first-child { top: 10px; transform: rotate(45deg); }
.nav-burger.is-open span:last-child { top: 10px; transform: rotate(-45deg); }

/* ── 1 · hero ───────────────────────────────────────────── */
.hero { position: relative; height: 100svh; min-height: 580px; overflow: hidden; background: #17150f; }
.hero-slides, .hero-slide { position: absolute; inset: 0; }
.hero-slide {
  background-size: cover;
  background-position: center;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 1.6s var(--ease), transform 8s linear;
}
.hero-slide.is-active { opacity: 1; transform: scale(1); }
.hero-empty { background: linear-gradient(140deg, #2b2620, #14110c); }
.hero-shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.3) 0%, rgba(0,0,0,0) 32%, rgba(0,0,0,0) 58%, rgba(0,0,0,.44) 100%);
}
.hero-text {
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  text-align: center;
  padding: 0 28px;
}
.hero-name {
  margin: 0 0 22px;
  line-height: 0;
}
.hero-name img {
  display: inline-block;
  height: clamp(120px, 18vw, 260px);
  width: auto;
  /* logo is black; force pure white over hero */
  filter: brightness(0) invert(1) drop-shadow(0 2px 40px rgba(0,0,0,.35));
}
.hero-eyebrow {
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: .44em;
  text-transform: uppercase;
  opacity: .92;
  margin: 0;
}
.hero-meta {
  position: absolute;
  left: 34px; right: 34px; bottom: 30px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  color: #fff;
}
.hero-caption {
  font-family: var(--display);
  font-style: italic;
  font-size: 18px;
  opacity: .88;
  min-height: 1.4em;
  transition: opacity .5s;
}
.hero-caption.is-fading { opacity: 0; }
.hero-count {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  letter-spacing: .22em;
}
.hero-count-rule { width: 56px; height: 1px; background: rgba(255,255,255,.55); }
.hero-arrows { display: flex; gap: 8px; }
.hero-arrow {
  width: 46px; height: 46px;
  border: 1px solid rgba(255,255,255,.4);
  border-radius: 50%;
  font-size: 17px;
  transition: background .25s, border-color .25s;
}
.hero-arrow:hover { background: rgba(255,255,255,.14); border-color: #fff; }

/* ── statement band ─────────────────────────────────────── */
.statement { padding: 130px 28px; }
.statement-text {
  max-width: 880px;
  margin: 0 auto;
  text-align: center;
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.35;
  color: var(--soft);
}

/* ── 2 · achievements ───────────────────────────────────── */
.stats {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 84px;
  padding-bottom: 60px;
  border-bottom: 1px solid var(--hairline);
}
.stats--flush { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
.stat { text-align: center; flex: 1; }
.stat-num {
  display: block;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(52px, 6vw, 76px);
  line-height: 1;
}
.stat-label {
  display: block;
  margin-top: 12px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── 3 · portfolio ──────────────────────────────────────── */
.filters {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 8px 36px;
  margin-bottom: 56px;
}
.filter {
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 6px 0;
  position: relative;
  transition: color .2s;
}
.filter::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px; background: var(--ink);
  transform: scaleX(0); transform-origin: center;
  transition: transform .3s var(--ease);
}
.filter:hover { color: var(--ink); }
.filter.is-active { color: var(--ink); }
.filter.is-active::after { transform: scaleX(1); }

.tile-frame { overflow: hidden; background: var(--hairline); }

/* 4-column masonry. JS packs each image into the currently-shortest column
   (deterministic balance — columns end within ~one image of each other, no
   big voids). Each image keeps its full aspect ratio (never cropped) and
   autoscales to the column width. No gaps — images sit flush, edge to edge. */
.section--flush { padding-bottom: 0; }
.gallery {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin-top: 56px;
  background: #fff;
}
.gallery-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.tile {
  position: relative;
  display: block;
  width: 100%;
  margin: 0;
  overflow: hidden;
  cursor: zoom-in;
  background: var(--hairline);
}
.tile img {
  display: block;
  width: 100%;
  height: auto;              /* autoscale to width — show the whole frame */
  opacity: 0;
  transform: scale(1.03);
  transition: opacity .55s var(--ease), transform .85s var(--ease);
  will-change: opacity, transform;
}
/* In-viewport tiles fade in once the image has loaded */
.tile.is-inview img.is-loaded {
  opacity: 1;
  transform: none;
}
.tile:hover.is-inview img.is-loaded { transform: scale(1.035); }
.tile-cap {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  padding: 46px 20px 18px;
  background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,.62));
  color: #fff;
  opacity: 1;
  transform: translateY(10px);
  transition: opacity .4s var(--ease), transform .4s var(--ease);
}
.tile:hover .tile-cap,
.tile:focus-within .tile-cap { opacity: 1; transform: none; }
.tile-title {
  font-family: var(--display);
  font-weight: 500;
  font-style: italic;
  font-size: 22px;
  line-height: 1.15;
}
.tile-cat {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .26em;
  text-transform: uppercase;
  opacity: .82;
  white-space: nowrap;
  padding-bottom: 4px;
}
.tile.is-hidden { display: none; }

.gallery-more {
  display: flex;
  justify-content: center;
  padding: 48px 28px 72px;
  background: var(--tint);
}
.gallery-more[hidden] { display: none; }
.gallery-more-btn {
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--ink);
  border: 1px solid var(--ink);
  padding: 16px 34px;
  transition: color .2s, background .2s, opacity .2s;
}
.gallery-more-btn:hover {
  background: var(--ink);
  color: #fff;
}

/* ── 4 · credentials ────────────────────────────────────── */
.section--dark {
  background: #000000;
  color: #fff;
}
.section--dark .eyebrow { color: rgba(255,255,255,.6); }
.section--dark .sec-title { color: #fff; }
.section--dark .sec-title em { color: rgba(255,255,255,.72); }
.section--flush-x { overflow: hidden; }

.cred-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, 180px);
  justify-content: center;
  margin-top: 8px;
}
.cred {
  display: grid;
  place-items: center;
  padding: 0;
}
.cred img {
  display: block;
  width: 180px;
  height: 100px;
  object-fit: contain;
  /* logos are supplied as black-and-white PNGs on their own dark ground,
     so they tile seamlessly with no visible cell edges */
  opacity: .72;
  transition: opacity .35s, transform .35s var(--ease);
}
.cred:hover img { opacity: 1; transform: scale(1.05); }

/* ── 5 · about ──────────────────────────────────────────── */
.about-wrap {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 90px;
  align-items: center;
}
.about-media img { width: 100%; }
.about-placeholder {
  aspect-ratio: 4 / 5;
  display: grid; place-items: center;
  background: var(--bg);
  border: 1px solid var(--hairline);
  font-family: var(--display);
  font-size: 130px;
  color: var(--hairline);
}
.about-p { color: var(--soft); margin-bottom: 20px; max-width: 56ch; }
.about-p:last-of-type { margin-bottom: 0; }

/* ── 6 · footer ─────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--hairline);
  padding: 92px 0 64px;
  text-align: center;
  background: var(--tint);
}
.footer-insta { display: block; margin-bottom: 36px; }
.footer-insta-label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.footer-insta-handle {
  font-family: var(--display);
  font-style: italic;
  font-size: 26px;
  transition: opacity .2s;
}
.footer-insta:hover .footer-insta-handle { opacity: .6; }
.socials { display: flex; justify-content: center; gap: 12px; margin-bottom: 36px; }
.social {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  color: var(--soft);
  transition: border-color .25s, color .25s, transform .25s var(--ease);
}
.social svg { width: 16px; height: 16px; }
.social:hover { border-color: var(--ink); color: var(--ink); transform: translateY(-2px); }
.footer-copy { font-size: 13px; color: var(--soft); }
.footer-note { font-size: 11.5px; color: var(--muted); margin-top: 8px; letter-spacing: .04em; }

/* ── lightbox ───────────────────────────────────────────── */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(11,10,9,.985);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 40px 72px;
  opacity: 0; visibility: hidden;
  transition: opacity .35s var(--ease), visibility .35s;
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox-frame {
  margin: 0;
  max-width: calc(100vw - 180px);
  max-height: calc(100vh - 108px);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.lightbox-frame img {
  max-width: 100%;
  max-height: calc(100vh - 150px);
  object-fit: contain;
  /* clean, immersive — image sits on the dark field, no mat */
  box-shadow: 0 24px 80px rgba(0,0,0,.55);
  opacity: 1;
  transform: none;
  transition: opacity .4s var(--ease), transform .5s var(--ease);
}
.lightbox-frame img.is-swapping { opacity: 0; transform: scale(1.015); }
.lightbox-cap {
  margin-top: 20px;
  text-align: center;
  color: rgba(255,255,255,.82);
  font-family: var(--display);
  font-style: italic;
  font-size: 19px;
  letter-spacing: .01em;
}
.lightbox-nav {
  flex: 0 0 auto;
  width: 56px; height: 56px;
  display: grid; place-items: center;
  color: #fff;
  font-size: 20px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 50%;
  background: rgba(255,255,255,.04);
  transition: background .25s, border-color .25s, transform .25s var(--ease);
  z-index: 2;
}
.lightbox-nav:hover { background: rgba(255,255,255,.16); border-color: #fff; }
.lightbox-prev:hover { transform: translateX(-3px); }
.lightbox-next:hover { transform: translateX(3px); }
.lightbox-close {
  position: absolute; top: 22px; right: 32px;
  color: #fff; font-size: 40px; line-height: 1; font-weight: 300;
  z-index: 3;
  transition: opacity .2s;
}
.lightbox-close:hover { opacity: .6; }
.lightbox-count {
  position: absolute;
  bottom: 26px; left: 0; right: 0;
  text-align: center;
  color: rgba(255,255,255,.55);
  font-size: 12px;
  letter-spacing: .3em;
}

/* ── reveal on scroll ───────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-slide { transition: opacity .4s; transform: none; }
  .tile img,
  .tile.is-inview img.is-loaded {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* ── responsive ─────────────────────────────────────────── */
@media (max-width: 960px) {
  .section { padding: 88px 0; }
  .statement { padding: 96px 28px; }
  .gallery { margin-top: 44px; }
  .about-wrap { grid-template-columns: 1fr; gap: 52px; }
  .about-media { max-width: 440px; }
  .stats { flex-wrap: wrap; gap: 36px 12px; }
  .stat { flex: 1 1 40%; }
}
@media (max-width: 640px) {
  .section { padding: 68px 0; }
  .nav { padding: 18px 22px; }
  .nav.is-solid { padding: 12px 22px; }
  /* keep the solid bar from trapping the fixed overlay in its own
     backdrop-filter stacking context while the menu is open */
  .nav.menu-open,
  .nav.menu-open.is-solid {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
    color: var(--ink);
  }
  .nav-links {
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100svh;
    height: 100dvh;
    z-index: 65;
    background: rgba(253,252,250,.98);
    color: var(--ink);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
    transform: translateY(-100%);
    transition: transform .4s var(--ease);
    pointer-events: none;
  }
  .nav-links.is-open {
    transform: none;
    pointer-events: auto;
  }
  .nav-links a { font-size: 15px; opacity: .9; }
  .nav-burger { display: block; position: relative; z-index: 70; }
  .hero-name img { height: clamp(64px, 20vw, 108px); }
  .hero-meta { left: 22px; right: 22px; }
  .hero-caption { display: none; }
  .gallery { margin-top: 36px; }
  .filters { gap: 6px 24px; }
  .cred-grid { grid-template-columns: repeat(2, minmax(0, 160px)); }
  .cred img { width: 100%; height: 90px; }
  .lightbox { padding: 16px 8px; gap: 6px; }
  .lightbox-frame { max-width: calc(100vw - 20px); max-height: calc(100vh - 96px); }
  .lightbox-frame img { max-height: calc(100vh - 150px); }
  .lightbox-nav { width: 44px; height: 44px; font-size: 17px; }
  .lightbox-cap { font-size: 16px; margin-top: 14px; }
}

/* ── category cards layout ──────────────────────────────── */
.cat-cards {
  max-width: var(--wrap);
  margin: 44px auto 0;
  padding: 0 28px 72px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
}
.cat-card-wrap { margin: 0; }
.cat-card {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  background: var(--tint);
  aspect-ratio: 4 / 5;
  box-shadow: 0 1px 2px rgba(31,29,26,.06);
}
.cat-card-img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .8s var(--ease), filter .5s var(--ease);
}
.cat-card:hover .cat-card-img,
.cat-card:focus-visible .cat-card-img { transform: scale(1.05); }
.cat-card::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(20,18,15,.72) 0%, rgba(20,18,15,.18) 42%, rgba(20,18,15,0) 70%);
  transition: background .5s var(--ease);
}
.cat-card:hover::after { background: linear-gradient(to top, rgba(20,18,15,.82) 0%, rgba(20,18,15,.28) 50%, rgba(20,18,15,.06) 78%); }
.cat-card-meta {
  position: absolute; left: 0; right: 0; bottom: 0;
  z-index: 1;
  padding: 20px 22px;
  text-align: left;
  color: #fff;
  display: flex; flex-direction: column; gap: 3px;
}
.cat-card-name {
  font-family: var(--display);
  font-size: 27px;
  line-height: 1.1;
  font-weight: 500;
}
.cat-card-count {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  opacity: .85;
}
.cat-card:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* ── category ticker overlay ────────────────────────────── */
.ticker {
  position: fixed; inset: 0; z-index: 95;
  display: flex; flex-direction: column;
  background: rgba(16,15,13,.96);
  opacity: 0; visibility: hidden;
  transition: opacity .35s var(--ease), visibility .35s var(--ease);
}
.ticker.is-open { opacity: 1; visibility: visible; }
.ticker-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 28px 6px;
  color: #fff; flex: 0 0 auto;
}
.ticker-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: 26px;
}
.ticker-close {
  background: none; border: 0; color: #fff;
  font-size: 34px; line-height: 1; cursor: pointer;
  opacity: .85; transition: opacity .3s var(--ease);
}
.ticker-close:hover { opacity: .5; }
.ticker-track {
  flex: 1 1 auto;
  display: flex; align-items: center; gap: 14px;
  padding: 0 28px;
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none;
  cursor: grab;
  -webkit-overflow-scrolling: touch;
}
.ticker-track::-webkit-scrollbar { display: none; }
.ticker-track.is-dragging { cursor: grabbing; }
.ticker-item {
  margin: 0; flex: 0 0 auto;
  height: min(72vh, 78vw);
  border-radius: 3px; overflow: hidden;
  background: rgba(255,255,255,.04);
}
.ticker-item img {
  height: 100%; width: auto; display: block;
  object-fit: cover;
  pointer-events: none;      /* let drag logic own pointer events */
  user-select: none;
}
.ticker-hint {
  flex: 0 0 auto;
  margin: 0; padding: 8px 28px 18px;
  text-align: center;
  color: rgba(255,255,255,.5);
  font-family: var(--sans);
  font-size: 12px; letter-spacing: .08em;
}
@media (max-width: 640px) {
  .cat-cards { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; padding: 0 18px 48px; }
  .cat-card-name { font-size: 21px; }
  .cat-card-meta { padding: 14px 15px; }
  .ticker-item { height: min(64vh, 86vw); }
  .ticker-title { font-size: 21px; }
  .ticker-track { gap: 10px; padding: 0 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .cat-card-img { transition: none; }
}
