/* ═══════════════════════════════════════════════
   AMARPREET NAGRA — PHOTOGRAPHY
   Dark editorial · warm gold · filmic grain
   ═══════════════════════════════════════════════ */

:root {
  --bg: #0e0d0b;
  --bg-soft: #16140f;
  --ink: #ece7df;
  --ink-dim: #9b948a;
  --gold: #c9a36a;
  --gold-soft: rgba(201, 163, 106, 0.35);
  --line: rgba(236, 231, 223, 0.12);
  --serif: "Fraunces", Georgia, serif;
  --sans: "Outfit", -apple-system, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--gold); color: var(--bg); }

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

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

/* ═══════════ PRELOADER ═══════════ */
.preloader {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.8s var(--ease), visibility 0.8s;
}
.preloader.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
.preloader.is-gone { display: none; }

/* Pause looping animations while offscreen (battery + smoothness).
   NOTE: deliberately not applied to the marquee — toggling play-state on its
   transform layer triggers a WebKit repaint bug (blank strip on iOS Safari). */
.hero-scroll.is-paused .hero-scroll-line::after { animation-play-state: paused; }
.preloader-inner { text-align: center; }
.preloader-word {
  font-family: var(--serif); font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 300; letter-spacing: 0.1em; color: var(--gold);
}
.preloader-letter { display: inline-block; animation: breathe 1.6s ease-in-out infinite alternate; }
.preloader-letter:nth-child(2) { animation-delay: 0.3s; }
@keyframes breathe { from { opacity: 0.35; } to { opacity: 1; } }
.preloader-count {
  font-size: 0.8rem; letter-spacing: 0.4em; color: var(--ink-dim);
  margin: 1.2rem 0 0.8rem; font-variant-numeric: tabular-nums;
}
.preloader-bar {
  width: 160px; height: 1px; background: var(--line); margin: 0 auto;
  overflow: hidden;
}
.preloader-bar-fill {
  height: 100%; width: 0%; background: var(--gold);
  transition: width 0.3s ease;
}

/* ═══════════ CURSOR ═══════════ */
.cursor-dot, .cursor-ring {
  position: fixed; top: 0; left: 0; pointer-events: none; z-index: 999;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.cursor-dot {
  width: 6px; height: 6px; background: var(--gold);
}
.cursor-ring {
  width: 36px; height: 36px;
  border: 1px solid var(--gold-soft);
  display: flex; align-items: center; justify-content: center;
  transition: width 0.3s var(--ease), height 0.3s var(--ease),
              background 0.3s, border-color 0.3s;
  font-size: 0.55rem; letter-spacing: 0.15em; color: var(--bg);
}
.cursor-ring.is-hover { width: 56px; height: 56px; border-color: var(--gold); }
.cursor-ring.is-view, .cursor-ring.is-email {
  width: 76px; height: 76px;
  background: var(--gold); border-color: var(--gold);
}
#cursorLabel { opacity: 0; transition: opacity 0.2s; font-family: var(--sans); font-weight: 500; }
.cursor-ring.is-view #cursorLabel, .cursor-ring.is-email #cursorLabel { opacity: 1; }
@media (hover: none), (max-width: 768px) {
  .cursor-dot, .cursor-ring { display: none; }
}

/* ═══════════ GRAIN ═══════════ */
.grain {
  position: fixed; inset: 0; z-index: 998; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.055;
}

/* ═══════════ NAV ═══════════ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.4rem clamp(1.2rem, 4vw, 3rem);
  transition: background 0.4s, backdrop-filter 0.4s, padding 0.4s;
}
.nav.is-scrolled {
  background: rgba(14, 13, 11, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding-top: 0.9rem; padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--line);
}
.nav-logo {
  font-size: 0.78rem; letter-spacing: 0.28em; font-weight: 500;
}
.nav-logo-mark { color: var(--gold); margin-right: 0.35rem; }
.nav-links { display: flex; gap: 2rem; }
.nav-links a {
  font-size: 0.72rem; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--ink-dim); position: relative; transition: color 0.3s;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -4px;
  width: 100%; height: 1px; background: var(--gold);
  transform: scaleX(0); transform-origin: right;
  transition: transform 0.4s var(--ease);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { transform: scaleX(1); transform-origin: left; }
.nav-cta {
  font-size: 0.7rem; letter-spacing: 0.2em; text-transform: uppercase;
  border: 1px solid var(--gold-soft); color: var(--gold);
  padding: 0.6rem 1.2rem; border-radius: 999px;
  transition: background 0.35s, color 0.35s, border-color 0.35s;
}
.nav-cta:hover { background: var(--gold); color: var(--bg); border-color: var(--gold); }
@media (max-width: 768px) {
  .nav-links { display: none; }
}

/* ═══════════ HERO ═══════════ */
.hero {
  min-height: min(100svh, 1050px);
  height: min(100svh, 1050px);
  position: relative;
  display: flex; flex-direction: column; justify-content: center;
  padding: 7rem clamp(1.2rem, 5vw, 4rem) 4rem;
  overflow: hidden;
}
.hero-images { position: absolute; inset: 0; z-index: 1; }
.hero-img {
  position: absolute;
  overflow: hidden;
  border-radius: 2px;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1.2s var(--ease), transform 1.2s var(--ease);
  will-change: transform;
}
body.is-loaded .hero-img { opacity: 1; transform: translateY(0); }
.hero-img img {
  width: 100%; height: 100%; object-fit: cover;
  filter: saturate(1.04) contrast(1.02);
}
.hero-img--center {
  width: min(34vw, 420px); aspect-ratio: 2/3;
  left: 50%; top: 50%;
  margin-left: min(-17vw, -210px);
  margin-top: max(-32vh, -336px);
  height: min(64vh, 672px);
  transition-delay: 0.1s;
}
.hero-img--left {
  width: min(17vw, 220px); aspect-ratio: 2/3;
  left: 7vw; bottom: min(12vh, 126px);
  opacity: 0;
  transition-delay: 0.35s;
}
body.is-loaded .hero-img--left { opacity: 0.85; }
.hero-img--right {
  width: min(15vw, 200px); aspect-ratio: 2/3;
  right: 6vw; top: min(14vh, 147px);
  transition-delay: 0.5s;
}
body.is-loaded .hero-img--right { opacity: 0.85; }

.hero-title {
  position: relative; z-index: 2;
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(3.2rem, 11vw, 9.5rem);
  line-height: 1.02; letter-spacing: -0.01em;
  text-shadow: 0 2px 40px rgba(14, 13, 11, 0.55);
}
.hero-title em { font-style: italic; color: var(--gold); }
.hero-dot { color: var(--gold); }
.hero-line { display: block; overflow: hidden; }
.hero-line--indent { padding-left: clamp(2rem, 12vw, 12rem); }
.hero-line-inner {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 1.1s var(--ease);
}
body.is-loaded .hero-line:nth-child(1) .hero-line-inner { transition-delay: 0.25s; transform: translateY(0); }
body.is-loaded .hero-line:nth-child(2) .hero-line-inner { transition-delay: 0.4s; transform: translateY(0); }
body.is-loaded .hero-line:nth-child(3) .hero-line-inner { transition-delay: 0.55s; transform: translateY(0); }

.hero-meta {
  position: relative; z-index: 2;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem;
  margin-top: 3rem;
  opacity: 0; transition: opacity 1s ease 1.1s;
}
body.is-loaded .hero-meta { opacity: 1; }
.hero-meta-item {
  font-size: 0.72rem; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--ink-dim);
}
.hero-scroll {
  position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
  z-index: 2;
  font-size: 0.6rem; letter-spacing: 0.4em; color: var(--ink-dim);
  display: flex; flex-direction: column; align-items: center; gap: 0.7rem;
  opacity: 0; transition: opacity 1s ease 1.4s;
}
body.is-loaded .hero-scroll { opacity: 1; }
.hero-scroll-line {
  width: 1px; height: 48px; background: var(--line);
  position: relative; overflow: hidden;
}
.hero-scroll-line::after {
  content: ""; position: absolute; top: -50%; left: 0;
  width: 100%; height: 50%; background: var(--gold);
  animation: scroll-drip 1.8s var(--ease) infinite;
}
@keyframes scroll-drip {
  to { top: 100%; }
}
@media (max-width: 768px) {
  .hero-img--center {
    width: 62vw; height: 93vw;
    margin-left: -31vw; margin-top: -46.5vw;
  }
  .hero-img--left { width: 26vw; left: 4vw; bottom: min(8vh, 68px); }
  .hero-img--right { width: 24vw; right: 4vw; top: min(12vh, 102px); }
  .hero-title { padding-top: min(18vh, 152px); }
  .hero-img--left { display: none; }
  .nav { padding-left: 1.1rem; padding-right: 1.1rem; }
  .nav-logo { font-size: 0.64rem; letter-spacing: 0.18em; }
  .nav-cta { padding: 0.5rem 0.8rem; font-size: 0.58rem; letter-spacing: 0.12em; }
}

/* ═══════════ MARQUEE ═══════════ */
.marquee {
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 1.1rem 0; overflow: hidden; white-space: nowrap;
  background: var(--bg-soft);
}
.marquee-track {
  display: inline-flex;
  width: max-content;
  will-change: transform;
  animation: marquee-move 36s linear infinite;
}
/* translate3d keeps iOS Safari compositing the layer (plain % translateX can blank out).
   -1/6 = exactly one of the six identical copies, so the loop restart is invisible. */
@keyframes marquee-move {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-16.6667%, 0, 0); }
}
.marquee-track span {
  font-family: var(--serif); font-style: italic; font-weight: 300;
  font-size: 1.15rem; letter-spacing: 0.12em; color: var(--ink-dim);
  padding-right: 1ch;
}

/* ═══════════ ABOUT ═══════════ */
.about { padding: clamp(5rem, 12vw, 10rem) clamp(1.2rem, 5vw, 4rem); }
.about-kicker, .contact-kicker {
  font-size: 0.72rem; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 2rem;
}
.about-statement {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(1.6rem, 3.6vw, 3rem); line-height: 1.35;
  max-width: min(20em, 100%);
}
.about-statement em { color: var(--gold); }
.about-cols {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 2.5rem; margin-top: clamp(3rem, 7vw, 6rem);
}
.about-col { border-top: 1px solid var(--line); padding-top: 1.4rem; }
.about-col h3 {
  font-size: 0.75rem; letter-spacing: 0.26em; text-transform: uppercase;
  font-weight: 500; color: var(--ink); margin-bottom: 0.8rem;
}
.about-col p { color: var(--ink-dim); font-size: 0.95rem; max-width: 32ch; }

/* ═══════════ WORK / GALLERY ═══════════ */
.work { padding: 0 clamp(1.2rem, 5vw, 4rem) clamp(4rem, 8vw, 8rem); }
.work-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  flex-wrap: wrap; gap: 1.5rem;
  margin-bottom: clamp(2rem, 5vw, 4rem);
}
.work-title {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(2.8rem, 7vw, 5.5rem); line-height: 0.95;
}
.work-title em { font-style: italic; color: var(--gold); }
.work-filters { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.filter {
  font-family: var(--sans); font-size: 0.7rem; letter-spacing: 0.18em;
  text-transform: uppercase; font-weight: 400;
  background: none; border: 1px solid var(--line); color: var(--ink-dim);
  padding: 0.55rem 1.1rem; border-radius: 999px; cursor: pointer;
  transition: all 0.35s var(--ease);
}
.filter:hover { border-color: var(--gold-soft); color: var(--ink); }
.filter.is-active { background: var(--gold); border-color: var(--gold); color: var(--bg); }

.gallery {
  columns: 3; column-gap: 1.2rem;
}
@media (max-width: 1000px) { .gallery { columns: 2; } }
@media (max-width: 600px) { .gallery { columns: 1; } }

.gallery-item {
  break-inside: avoid; margin-bottom: 1.2rem;
  position: relative; overflow: hidden; border-radius: 2px;
  cursor: pointer;
  opacity: 0; transform: translateY(30px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.gallery-item.is-visible { opacity: 1; transform: translateY(0); }
.gallery-item.is-hidden { display: none; }
.gallery-item img {
  width: 100%;
  transform: scale(1.02);
  transition: transform 0.9s var(--ease), filter 0.9s var(--ease);
  filter: saturate(1.02);
}
.gallery-item:hover img { transform: scale(1.07); }
.gallery-item::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(14,13,11,0.75) 0%, transparent 42%);
  opacity: 0; transition: opacity 0.5s;
}
.gallery-item:hover::after { opacity: 1; }
.gallery-caption {
  position: absolute; left: 1.1rem; right: 1.1rem; bottom: 1rem; z-index: 2;
  display: flex; justify-content: space-between; align-items: baseline;
  transform: translateY(12px); opacity: 0;
  transition: transform 0.5s var(--ease), opacity 0.5s;
}
.gallery-item:hover .gallery-caption { transform: translateY(0); opacity: 1; }
/* No hover on touch screens — keep the titles visible there */
@media (hover: none) {
  .gallery-item::after { opacity: 1; }
  .gallery-caption { transform: translateY(0); opacity: 1; }
}
.gallery-caption-title {
  font-family: var(--serif); font-style: italic; font-size: 1.1rem;
}
.gallery-caption-cat {
  font-size: 0.6rem; letter-spacing: 0.26em; text-transform: uppercase;
  color: var(--gold);
}

/* ═══════════ CONTACT ═══════════ */
.contact {
  padding: clamp(6rem, 14vw, 12rem) clamp(1.2rem, 5vw, 4rem);
  text-align: center;
  border-top: 1px solid var(--line);
  background:
    radial-gradient(ellipse 60% 50% at 50% 110%, rgba(201,163,106,0.13), transparent);
}
.contact-kicker { margin-bottom: 2.5rem; }
.contact-email {
  display: inline-block;
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(1.5rem, 5.4vw, 4.6rem);
  letter-spacing: -0.01em;
  position: relative;
  transition: color 0.4s;
}
.contact-email::after {
  content: ""; position: absolute; left: 0; bottom: 0.05em;
  width: 100%; height: 1px; background: var(--gold);
  transform: scaleX(0); transform-origin: right;
  transition: transform 0.6s var(--ease);
}
.contact-email:hover { color: var(--gold); }
.contact-email:hover::after { transform: scaleX(1); transform-origin: left; }
.contact-note {
  margin-top: 2.5rem; color: var(--ink-dim);
  font-size: 0.9rem; letter-spacing: 0.05em;
}

/* ═══════════ FOOTER ═══════════ */
.footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.6rem clamp(1.2rem, 4vw, 3rem);
  border-top: 1px solid var(--line);
  font-size: 0.68rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ink-dim);
}
.footer-mark { color: var(--gold); }

/* ═══════════ REVEALS ═══════════ */
.reveal {
  opacity: 0; transform: translateY(36px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ═══════════ LIGHTBOX ═══════════ */
.lightbox {
  position: fixed; inset: 0; z-index: 900;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: opacity 0.45s var(--ease), visibility 0.45s;
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox-backdrop {
  position: absolute; inset: 0;
  background: rgba(10, 9, 8, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.lightbox-figure {
  position: relative; z-index: 2;
  max-width: min(88vw, 900px); max-height: 86vh;
  display: flex; flex-direction: column;
  transform: scale(0.96);
  transition: transform 0.45s var(--ease);
}
.lightbox.is-open .lightbox-figure { transform: scale(1); }
.lightbox-img {
  max-height: 78vh; max-width: 100%;
  object-fit: contain; margin: 0 auto;
  border-radius: 2px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
}
.lightbox-caption {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-top: 1rem;
}
.lightbox-caption span:first-child {
  font-family: var(--serif); font-style: italic; font-size: 1.15rem;
}
.lightbox-index {
  font-size: 0.7rem; letter-spacing: 0.3em; color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
}
.lightbox-btn {
  position: absolute; z-index: 3;
  background: none; border: 1px solid var(--line); color: var(--ink);
  width: 52px; height: 52px; border-radius: 50%;
  font-size: 1.1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.3s, border-color 0.3s, color 0.3s;
}
.lightbox-btn:hover { background: var(--gold); border-color: var(--gold); color: var(--bg); }
.lightbox-btn--prev { left: clamp(0.8rem, 3vw, 2.5rem); top: 50%; transform: translateY(-50%); }
.lightbox-btn--next { right: clamp(0.8rem, 3vw, 2.5rem); top: 50%; transform: translateY(-50%); }
.lightbox-btn--close { top: clamp(0.8rem, 3vw, 2rem); right: clamp(0.8rem, 3vw, 2.5rem); }
@media (max-width: 600px) {
  .lightbox-btn--prev { left: 0.6rem; bottom: 1rem; top: auto; transform: none; }
  .lightbox-btn--next { right: 0.6rem; bottom: 1rem; top: auto; transform: none; }
}

/* ═══════════ MOTION SAFETY ═══════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    transition-duration: 0.001s !important;
  }
  html { scroll-behavior: auto; }
  .grain { animation: none; }
}
