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

:root {
  --color-bg: #ffffff;
  --color-text: #111111;
  --color-muted: #5c5c5c;
  --color-gallery: #ffffff;
  --color-quote-bar: rgba(0, 0, 0, 0.9);
  --color-photo-frame: rgba(0, 0, 0, 0.06);
  --color-footer-bg: #f6f6f6;
  --color-footer-border: #e2e2e2;
  --color-input-bg: #ffffff;
  --color-input-border: #c8c8c8;
  --color-input-text: #111111;
  /* Match reference portfolio: clear white gutters between collage cells (~12–17px at typical widths) */
  --gallery-gap: clamp(12px, 1.45vw, 17px);
}

html[data-theme='dark'] {
  color-scheme: dark;
  --color-bg: #121212;
  --color-text: #ececec;
  --color-muted: #a3a3a3;
  --color-gallery: #141414;
  --color-quote-bar: rgba(255, 255, 255, 0.88);
  --color-photo-frame: rgba(255, 255, 255, 0.08);
  --color-footer-bg: #0d0d0d;
  --color-footer-border: #2a2a2a;
  --color-input-bg: #1e1e1e;
  --color-input-border: #3d3d3d;
  --color-input-text: #f0f0f0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Montserrat', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  overflow-x: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

/* ===== HERO (dark full-bleed — matches Adobe title-section) ===== */
.hero {
  position: relative;
  width: 100%;
  min-height: 500px;
  /* svh tracks the *visible* mobile viewport when the URL bar is expanded (unlike 100vh) */
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: #484848;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.55) 0%,
    rgba(0, 0, 0, 0.22) 45%,
    rgba(0, 0, 0, 0.08) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 5% max(5rem, env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: heroFadeIn 1.2s ease-out;
}

/* Proxima Nova on original: weight 100, ~94px desktop */
.hero-content h1 {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(2.75rem, 7vw, 5.875rem);
  font-weight: 100;
  font-style: normal;
  letter-spacing: normal;
  line-height: 1.05;
  margin-bottom: 0.35rem;
  color: #fff;
  text-shadow: 0 2px 2px rgba(0, 0, 0, 0.25);
}

/* Original subtitle: 24px, weight 300, uppercase */
.hero-content .subtitle {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(0.95rem, 1.8vw, 1.5rem);
  font-weight: 300;
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: normal;
  line-height: 1.6;
  color: #fff;
  text-shadow: 0 2px 2px rgba(0, 0, 0, 0.25);
}

.scroll-hint {
  position: relative;
  z-index: 2;
  margin-top: 0.85rem;
  flex-shrink: 0;
}

.scroll-hint span {
  display: block;
  width: 24px;
  height: 24px;
  border-right: 2px solid rgba(255, 255, 255, 0.6);
  border-bottom: 2px solid rgba(255, 255, 255, 0.6);
  transform: translateY(0) rotate(45deg);
  animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
  0%, 100% { transform: translateY(0) rotate(45deg); opacity: 0.6; }
  50% { transform: translateY(8px) rotate(45deg); opacity: 1; }
}

/* Mobile Chrome / Safari: keep title, subtitle, and chevron in first paint */
@media (max-width: 767px) {
  .hero {
    min-height: 100vh;
    min-height: 100dvh;
    min-height: 100svh;
  }

  .hero-content {
    padding: 0 5% max(0.35rem, env(safe-area-inset-bottom, 0px));
    /* Lift entire cluster above bottom browser UI */
    margin-bottom: max(3rem, 12vh);
    margin-bottom: max(3rem, 14svh);
  }

  .hero-content h1 {
    font-size: clamp(2.2rem, 8vw, 3.35rem);
  }

  .hero-content .subtitle {
    font-size: clamp(0.78rem, 3.5vw, 1.05rem);
    line-height: 1.45;
  }

  .scroll-hint {
    margin-top: 0.5rem;
  }

  .scroll-hint span {
    width: 20px;
    height: 20px;
  }
}

@keyframes heroFadeIn {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== GALLERY (white “collage” like Adobe crisp theme) ===== */
.gallery-section {
  background: var(--color-gallery);
  color: var(--color-text);
  transition: background-color 0.25s ease, color 0.25s ease;
}

.content-shell {
  padding-left: 20%;
  padding-right: 20%;
  max-width: 100%;
}

.gallery-section--first .section-heading {
  padding-top: 3.5rem;
}

.section-heading {
  padding: 2.5rem 0 1.75rem;
  text-align: left;
}

/* proxima-nova-condensed italic + left rule (5px) */
.section-heading blockquote {
  position: relative;
  z-index: 0;
  font-family: 'Roboto Condensed', 'Arial Narrow', sans-serif;
  font-size: 36px;
  font-style: italic;
  font-weight: 300;
  line-height: 1.245;
  letter-spacing: normal;
  color: var(--color-text);
  text-align: left;
  margin: 0;
  padding: 0.25em 1em 0.25em 1em;
  border: none;
  quotes: none;
}

.section-heading blockquote::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 5px;
  background-color: var(--color-quote-bar);
  z-index: -1;
  transition: background-color 0.25s ease;
}

.photo-grid {
  display: flex;
  flex-direction: column;
  gap: var(--gallery-gap);
  padding-bottom: var(--gallery-gap);
  background: var(--color-gallery);
  transition: background-color 0.25s ease;
}

.grid-row {
  display: flex;
  gap: var(--gallery-gap);
  width: 100%;
}

.photo {
  overflow: hidden;
  position: relative;
  cursor: pointer;
  background: var(--color-gallery);
  box-shadow: 0 0 0 1px var(--color-photo-frame);
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.photo:hover img {
  transform: scale(1.02);
}

/* Row layouts */
.grid-row.single .photo { flex: 1; aspect-ratio: 3 / 2; }

.grid-row.single-portrait { justify-content: center; }
.grid-row.single-portrait .photo { flex: 0 0 40%; aspect-ratio: 2 / 3; }

.grid-row.duo .photo.landscape { flex: 1; aspect-ratio: 3 / 2; }

.grid-row.duo-portrait { justify-content: center; }
.grid-row.duo-portrait .photo.portrait { flex: 1; aspect-ratio: 2 / 3; }

.grid-row.duo-lp .photo.landscape { flex: 1.5; aspect-ratio: 3 / 2; }
.grid-row.duo-lp .photo.portrait { flex: 1; aspect-ratio: 2 / 3; }

.grid-row.duo-pl .photo.portrait { flex: 1; aspect-ratio: 2 / 3; }
.grid-row.duo-pl .photo.landscape { flex: 1.5; aspect-ratio: 3 / 2; }

.grid-row.trio-llp .photo.landscape { flex: 1; aspect-ratio: 3 / 2; }
.grid-row.trio-llp .photo.portrait { flex: 0.667; aspect-ratio: 2 / 3; }

.grid-row.trio-pll .photo.portrait { flex: 0.667; aspect-ratio: 2 / 3; }
.grid-row.trio-pll .photo.landscape { flex: 1; aspect-ratio: 3 / 2; }

.grid-row.trio-ppp .photo.portrait { flex: 1; aspect-ratio: 2 / 3; }

.grid-row.trio-lll .photo.landscape { flex: 1; aspect-ratio: 3 / 2; }

/* One row: 3 portrait + 1 landscape (Adobe t4-layout-pppl) */
.grid-row.quad-pppl {
  flex-wrap: nowrap;
  align-items: stretch;
  min-height: min(52vw, 540px);
}
.grid-row.quad-pppl .photo {
  flex: 1;
  aspect-ratio: unset;
  min-height: 240px;
}
.grid-row.quad-pppl .photo.portrait {
  flex: 0.92;
}
.grid-row.quad-pppl .photo.landscape {
  flex: 1.25;
}
.grid-row.quad-pppl .photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===== FADE-IN ===== */
.fade-in {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s ease-out, transform 0.65s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== LIGHTBOX ===== */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.94);
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}

.lightbox.active {
  display: flex;
}

.lightbox-content {
  max-width: 96vw;
  max-height: 94vh;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}

.lightbox-content img {
  max-width: 96vw;
  max-height: 94vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 2px;
  animation: lightboxIn 0.28s ease-out;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

@keyframes lightboxIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.5rem;
  cursor: pointer;
  z-index: 1001;
  opacity: 0.75;
  transition: opacity 0.2s;
  line-height: 1;
}

.lightbox-close:hover { opacity: 1; }

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #fff;
  font-size: 3rem;
  cursor: pointer;
  z-index: 1001;
  opacity: 0.65;
  transition: opacity 0.2s;
  padding: 16px;
  line-height: 1;
}

.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }
.lightbox-prev:hover,
.lightbox-next:hover { opacity: 1; }

/* ===== SITE FOOTER ===== */
.site-footer {
  margin-top: 0;
  padding: 1.25rem 5% 1rem;
  background: var(--color-footer-bg);
  border-top: 1px solid var(--color-footer-border);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.site-footer__inner {
  max-width: 72rem;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 1.5rem;
}

.site-footer__brand {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 10rem;
}

.site-footer__name {
  font-family: 'Montserrat', sans-serif;
  font-weight: 300;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: var(--color-text);
}

.site-footer__tag {
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.site-footer__tools {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.85rem 1.25rem;
}

.site-footer__field {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  min-width: 11rem;
}

.site-footer__label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.site-footer__select {
  font-family: 'Montserrat', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.8125rem;
  padding: 0.4rem 2rem 0.4rem 0.55rem;
  border-radius: 4px;
  border: 1px solid var(--color-input-border);
  background: var(--color-input-bg);
  color: var(--color-input-text);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

html[data-theme='dark'] .site-footer__select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23bbb' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
}

.site-footer__select:hover {
  border-color: var(--color-muted);
}

.site-footer__select:focus {
  outline: 2px solid rgba(100, 100, 100, 0.35);
  outline-offset: 2px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--color-input-border);
  background: var(--color-input-bg);
  color: var(--color-input-text);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.theme-toggle:hover {
  border-color: var(--color-muted);
}

.theme-toggle:focus-visible {
  outline: 2px solid rgba(100, 100, 100, 0.45);
  outline-offset: 2px;
}

.theme-toggle__icons {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  font-size: 0.95rem;
  line-height: 1;
  opacity: 0.85;
}

.theme-toggle__sun,
.theme-toggle__moon {
  display: inline-block;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

html[data-theme='light'] .theme-toggle__sun {
  opacity: 0.35;
  transform: scale(0.92);
}

html[data-theme='dark'] .theme-toggle__moon {
  opacity: 0.35;
  transform: scale(0.92);
}

.theme-toggle[aria-pressed='true'] {
  border-color: rgba(180, 180, 200, 0.35);
}

.site-footer__copy {
  max-width: 72rem;
  margin: 0.85rem auto 0;
  padding-top: 0.65rem;
  border-top: 1px solid var(--color-footer-border);
  font-size: 0.68rem;
  line-height: 1.45;
  color: var(--color-muted);
  text-align: center;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
  .content-shell {
    padding-left: 12%;
    padding-right: 12%;
  }
}

@media (max-width: 900px) {
  .content-shell {
    padding-left: 8%;
    padding-right: 8%;
  }
}

@media (max-width: 767px) {
  :root {
    --gallery-gap: clamp(10px, 2.8vw, 14px);
  }

  .site-footer__inner {
    flex-direction: column;
    align-items: stretch;
  }

  .site-footer__tools {
    flex-direction: column;
    align-items: stretch;
  }

  .site-footer__field {
    min-width: 0;
  }

  .theme-toggle {
    align-self: flex-start;
  }

  .section-heading blockquote {
    font-size: 27px;
  }

  .gallery-section--first .section-heading {
    padding-top: 2.25rem;
  }

  .section-heading {
    padding: 1.75rem 0 1.25rem;
  }

  .content-shell {
    padding-left: 5%;
    padding-right: 5%;
  }

  .grid-row.trio-llp,
  .grid-row.trio-pll,
  .grid-row.trio-ppp,
  .grid-row.trio-lll {
    flex-wrap: wrap;
  }

  .grid-row.trio-llp .photo,
  .grid-row.trio-pll .photo {
    flex: 1 1 48%;
  }

  .grid-row.quad-pppl {
    flex-wrap: wrap;
  }

  .grid-row.quad-pppl .photo.portrait {
    flex: 1 1 30%;
    min-width: 28%;
  }

  .grid-row.quad-pppl .photo.landscape {
    flex: 1 1 100%;
  }

  .grid-row.single-portrait .photo {
    flex: 0 0 60%;
  }

  .lightbox-prev,
  .lightbox-next {
    font-size: 2rem;
    padding: 10px;
  }
}

@media (max-width: 480px) {
  .grid-row.duo,
  .grid-row.duo-portrait,
  .grid-row.duo-lp,
  .grid-row.duo-pl {
    flex-direction: column;
  }

  .grid-row.duo-lp .photo.landscape,
  .grid-row.duo-lp .photo.portrait,
  .grid-row.duo-pl .photo.portrait,
  .grid-row.duo-pl .photo.landscape {
    flex: none;
    width: 100%;
    aspect-ratio: auto;
    min-height: 220px;
  }

  .grid-row.single-portrait .photo {
    flex: 0 0 85%;
  }
}
