/* SamFotoArt — mirrored structure, refined skin */
:root {
  --bg: #f4f1ec;
  --ink: #1d1c1a;
  --muted: #6f6a62;
  --line: #dcd6cc;
  --accent: #9a6b3f;
  --gutter: clamp(16px, 4vw, 48px);
  --grid-gap: 14px;
  --sans: "Archivo", system-ui, sans-serif;
  --serif: "Cormorant Garamond", Georgia, serif;
}

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

/* ---------- Header ---------- */
.site-header {
  /* not sticky — the bar sits at the top of the document and scrolls away,
     so nothing overlaps the photography */
  position: relative;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 28px var(--gutter) 18px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.logo {
  font-family: var(--serif);
  font-size: 30px;
  letter-spacing: 0.06em;
}
.logo span { font-style: italic; color: var(--accent); }
.logo-img { display: flex; align-items: center; }
.logo-img img { height: var(--logo-h, 28px); width: auto; }
.site-nav {
  display: flex;
  gap: 26px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 11px;
}
.site-nav a {
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s, color 0.25s;
  color: var(--muted);
}
.site-nav a:hover { color: var(--ink); }
.site-nav a.active { color: var(--ink); border-bottom-color: var(--accent); }
.nav-toggle { display: none; }

/* ---------- Layout ---------- */
.site-main { padding: 0 var(--gutter); max-width: 1500px; margin: 0 auto; }

.portfolio-first { padding-top: clamp(20px, 4vh, 44px); }

.page-head { text-align: center; padding: clamp(40px, 7vh, 80px) 0 clamp(24px, 4vh, 44px); }
.page-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(34px, 5vw, 58px);
  letter-spacing: 0.02em;
}
.page-tag {
  margin-top: 10px;
  text-transform: uppercase;
  letter-spacing: 0.26em;
  font-size: 10.5px;
  color: var(--muted);
}

/* ---------- Grid (3-col, 3:4 like the original) ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 3), 1fr);
  gap: var(--gap, var(--grid-gap));
  padding-bottom: 60px;
}
.cell {
  position: relative;
  overflow: hidden;
  background: #e6e1d8 var(--lqip) center / cover no-repeat;
}
.cell-link { display: block; aspect-ratio: var(--ratio, 3 / 4); }
/* <picture> is inline by default, which would collapse the img's height:100% */
.cell picture { display: block; width: 100%; height: 100%; }
.cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* hidden until loaded so the blurred stand-in shows through instead of a
     half-painted image; site.js adds .is-loaded */
  opacity: 0;
  transition: transform 0.9s cubic-bezier(0.2, 0.6, 0.2, 1), filter 0.5s, opacity 0.5s ease;
}
.cell img.is-loaded { opacity: 1; }
.cell:hover img { transform: scale(1.045); }
.cell::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(20, 18, 15, 0.28), transparent 45%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}
.cell:hover::after { opacity: 1; }
.cell-num {
  position: absolute;
  left: 14px;
  bottom: 10px;
  color: #f4f1ec;
  font-size: 10px;
  letter-spacing: 0.25em;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.35s, transform 0.35s;
  pointer-events: none;
}
.cell:hover .cell-num { opacity: 0.9; transform: none; }

/* ---------- Sections ---------- */
.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(26px, 3.4vw, 40px);
  text-align: center;
  letter-spacing: 0.04em;
  margin-bottom: 30px;
}
.section-title a:hover { color: var(--accent); }

.clientele { padding: 30px 0 70px; border-top: 1px solid var(--line); }
.client-strip {
  overflow: hidden;
  /* explicit backdrop so the logos' multiply blend has something to blend
     against inside the mask's stacking context */
  background: var(--bg);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.client-track {
  display: flex;
  width: max-content;
  animation: marquee var(--marquee, 20s) linear infinite;
  will-change: transform;
  backface-visibility: hidden;
}
/* Each set is one full loop unit: gap between logos + same gap trailing,
   so translateX(-50%) lands exactly on the seam with no jump. */
.client-set {
  display: flex;
  align-items: center;
  gap: clamp(34px, 5vw, 80px);
  padding-right: clamp(34px, 5vw, 80px);
  /* must live INSIDE .client-track's stacking context (created by will-change /
     the animated transform) or the logos' multiply blend has no backdrop */
  background: var(--bg);
}
.client-set img {
  /* --s: per-logo optical compensation (stacked marks run larger), set inline */
  height: calc(clamp(30px, 3.6vw, 52px) * var(--s, 1));
  width: auto;
  object-fit: contain;
  filter: grayscale(1) opacity(0.65);
  /* some source logos ship as JPEGs with a solid white box — multiply drops
     that box into the cream background instead of showing a white rectangle */
  mix-blend-mode: multiply;
  transition: filter 0.3s;
}
/* hover-only devices: touch taps must never pause/freeze the marquee */
@media (hover: hover) {
  .client-strip:hover .client-track { animation-play-state: paused; }
  .client-set img:hover { filter: none; }
}
/* translate3d keeps the strip on its own GPU layer — smoother than translateX
   and avoids the subpixel shimmer that shows up at faster durations */
@keyframes marquee {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-50%, 0, 0); }
}

.cta { text-align: center; padding: 40px 0 100px; border-top: 1px solid var(--line); }
.cta p { color: var(--muted); margin-bottom: 26px; }
.btn {
  display: inline-block;
  padding: 13px 38px;
  border: 1px solid var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 11px;
  transition: background 0.3s, color 0.3s;
  background: none;
  cursor: pointer;
  font-family: var(--sans);
}
.btn:hover { background: var(--ink); color: var(--bg); }

.text-block { padding: clamp(30px, 5vh, 60px) 0; }
.text-body { max-width: 62ch; margin: 0 auto; color: #3c3933; }
.text-body p + p { margin-top: 14px; }

/* ---------- About ---------- */
.about {
  display: grid;
  grid-template-columns: minmax(280px, 5fr) 7fr;
  gap: clamp(30px, 5vw, 70px);
  align-items: center;
  padding: clamp(40px, 8vh, 90px) 0;
}
.about-hero picture { display: block; }
.about-hero img { width: 100%; height: auto; }
.about-text .kicker {
  font-family: var(--serif);
  font-size: clamp(28px, 3.5vw, 44px);
  margin-bottom: 22px;
}
.about-text p + p { margin-top: 14px; }
.about-text p { color: #3c3933; max-width: 58ch; }

/* ---------- Contact ---------- */
.contact { max-width: 640px; margin: 0 auto; padding: clamp(40px, 8vh, 90px) 0 80px; text-align: center; }
.contact-actions { margin-top: 44px; display: grid; justify-items: center; gap: 22px; }
.contact-mail {
  font-family: var(--serif);
  font-size: clamp(20px, 3vw, 27px);
  letter-spacing: 0.01em;
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
}
.contact-mail:hover { color: var(--accent); border-bottom-color: var(--accent); }
.form-note { text-align: center; color: var(--muted); font-size: 13px; }
.form-note a { border-bottom: 1px solid var(--line); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 40px var(--gutter) 50px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
}
.foot-ig {
  display: inline-block;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 11px;
  color: var(--ink);
}
.foot-ig:hover { color: var(--accent); }
.foot-links { display: flex; justify-content: center; gap: 22px; flex-wrap: wrap; margin-bottom: 12px; }
.foot-links a { color: var(--muted); }
.foot-links a:hover { color: var(--ink); }

/* off-screen but readable by screen readers and crawlers */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(18, 16, 14, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox[hidden] { display: none; }
.lb-stage { max-width: min(92vw, 1400px); max-height: 88vh; }
.lb-stage img { max-width: 100%; max-height: 88vh; object-fit: contain; box-shadow: 0 30px 80px rgba(0,0,0,0.5); }
.lightbox button {
  position: absolute;
  background: none;
  border: none;
  color: #f4f1ec;
  font-size: 26px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
  padding: 18px;
  font-family: var(--sans);
}
.lightbox button:hover { opacity: 1; }
.lb-close { top: 12px; right: 16px; font-size: 34px; }
.lb-prev { left: 8px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 8px; top: 50%; transform: translateY(-50%); }
.lb-count {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  color: #f4f1ec;
  font-size: 11px;
  letter-spacing: 0.3em;
  opacity: 0.7;
}

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.8s ease var(--d, 0ms), transform 0.8s ease var(--d, 0ms); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(var(--cols-sm, 2), 1fr); }
  .about { grid-template-columns: 1fr; }
  .about-hero { max-width: 420px; margin: 0 auto; }
}
@media (max-width: 640px) {
  .site-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
  }
  .logo { font-size: 23px; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    padding: 20px 0 26px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    font-size: 12px;
  }
  .site-nav.open { display: flex; }
  .nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    background: none;
    border: none;
    padding: 10px;
    cursor: pointer;
  }
  .nav-toggle span {
    display: block;
    width: 22px;
    height: 1.5px;
    background: var(--ink);
    transition: transform 0.3s;
  }
  .nav-toggle.open span:nth-child(1) { transform: translateY(3.75px) rotate(45deg); }
  .nav-toggle.open span:nth-child(2) { transform: translateY(-3.75px) rotate(-45deg); }
  .grid { grid-template-columns: repeat(var(--cols-sm, 2), 1fr); gap: 8px; }
  .client-track { animation-duration: calc(var(--marquee, 20s) * 0.3); }
}
