/* ============================================
   Leonhart.XYZ — Photography Portfolio
   Dark, cinematic, minimal
   ============================================ */

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

:root {
  --black: #000000;
  --white: #ffffff;
  --gray: #888888;
  --gray-dark: #1a1a1a;
  --font: 'Space Grotesk', -apple-system, sans-serif;
  --gap: 4px;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--black);
  color: var(--white);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: var(--white);
  text-decoration: none;
}

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

/* ---- Navigation ---- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  pointer-events: none;
}

.nav-inner {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 32px 48px;
  pointer-events: auto;
}

.nav-logo {
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: opacity 0.3s;
}

.nav-logo:hover {
  opacity: 0.7;
}

.nav-name {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}

.nav-dot {
  font-weight: 500;
  opacity: 0.5;
}

.nav-subtitle {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.6;
}

.nav-links {
  display: flex;
  gap: 40px;
}

.nav-links a {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transition: opacity 0.3s;
}

.nav-links a:hover {
  opacity: 0.5;
}

.nav-gradient {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 180px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0) 100%);
  pointer-events: none;
  z-index: 1;
}

/* ---- Hero ---- */

.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.hero-image {
  position: absolute;
  inset: 0;
}

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

.hero-gradient-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 30%;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.5) 0%, transparent 100%);
  pointer-events: none;
}

.hero-gradient-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
  pointer-events: none;
}

.hero-scroll {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
}

.scroll-line {
  width: 1px;
  height: 60px;
  background: var(--white);
  opacity: 0.5;
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.2; transform: scaleY(1); }
  50% { opacity: 0.6; transform: scaleY(1.2); }
}

/* ---- Gallery ---- */

.gallery {
  padding: 2px 0;
}

.gallery-masonry {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

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

/* 3 portrait images in a row — natural 2:3 ratio */
.gallery-row--portrait-3 .gallery-item {
  flex: 1;
}

.gallery-row--portrait-3 .gallery-item img {
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

/* 2 portrait images in a row — natural 2:3 ratio */
.gallery-row--portrait-2 .gallery-item {
  flex: 1;
}

.gallery-row--portrait-2 .gallery-item img {
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

/* 1 landscape image full width — natural 3:2 ratio */
.gallery-row--landscape-1 .gallery-item {
  flex: 1;
}

.gallery-row--landscape-1 .gallery-item img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

/* Mixed row: portrait + landscape side by side, same height */
.gallery-row--mixed-pl,
.gallery-row--mixed-lp {
  align-items: stretch;
}

.gallery-row--mixed-pl .gallery-item--portrait,
.gallery-row--mixed-lp .gallery-item--portrait {
  flex: 2;
}

.gallery-row--mixed-pl .gallery-item--landscape,
.gallery-row--mixed-lp .gallery-item--landscape {
  flex: 3;
}

.gallery-row--mixed-pl .gallery-item img,
.gallery-row--mixed-lp .gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* General gallery item styling */
.gallery-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: var(--gray-dark);
  display: block;
}

.gallery-item img {
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s;
}

.gallery-item:hover img {
  transform: scale(1.03);
  opacity: 0.85;
}

/* ---- Filmstrip ---- */

.filmstrip {
  position: relative;
  padding: 48px 0 24px;
  overflow: hidden;
}

.filmstrip-track {
  display: flex;
  gap: 3px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding: 0 48px;
  cursor: grab;
}

.filmstrip-track::-webkit-scrollbar {
  display: none;
}

.filmstrip-track:active {
  cursor: grabbing;
}

.filmstrip-thumb {
  flex-shrink: 0;
  width: 120px;
  height: 180px;
  border-radius: 2px;
  overflow: hidden;
  opacity: 0.6;
  transition: opacity 0.3s;
}

.filmstrip-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.filmstrip-thumb:hover {
  opacity: 1;
}

.filmstrip-indicator {
  position: absolute;
  bottom: 24px;
  left: 48px;
  right: 48px;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 1px;
}

.filmstrip-indicator::after {
  content: '';
  display: block;
  width: 40%;
  height: 100%;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 1px;
  transition: transform 0.2s;
}

/* ---- Contact ---- */

.contact {
  padding: 160px 48px;
  text-align: center;
}

.contact-inner {
  max-width: 600px;
  margin: 0 auto;
}

.contact-heading {
  font-size: 48px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 32px;
}

.contact-email {
  display: inline-block;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.02em;
  opacity: 0.8;
  transition: opacity 0.3s;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 4px;
}

.contact-email:hover {
  opacity: 1;
  border-bottom-color: var(--white);
}

.contact-links {
  display: flex;
  gap: 32px;
  justify-content: center;
  margin-top: 40px;
}

.contact-links a {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.5;
  transition: opacity 0.3s;
}

.contact-links a:hover {
  opacity: 1;
}

/* ---- Profile ---- */

.profile {
  padding: 80px 48px;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.profile-inner {
  max-width: 300px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
  justify-content: center;
}

.profile-image {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.profile-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-name {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ---- Footer ---- */

.footer {
  padding: 24px 48px;
  text-align: center;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.1em;
  opacity: 0.3;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* ---- Lightbox ---- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-content {
  max-width: 90vw;
  max-height: 90vh;
}

.lightbox-content img {
  max-width: 90vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: none;
  border: none;
  color: var(--white);
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.3s;
  font-family: var(--font);
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  opacity: 1;
}

.lightbox-close {
  top: 24px;
  right: 32px;
  font-size: 40px;
  line-height: 1;
}

.lightbox-prev,
.lightbox-next {
  top: 50%;
  transform: translateY(-50%);
  font-size: 48px;
  padding: 16px;
}

.lightbox-prev {
  left: 16px;
}

.lightbox-next {
  right: 16px;
}

/* ---- Leica Badge ---- */

.leica-badge {
  position: absolute;
  bottom: 14px;
  right: 14px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px 5px 7px;
  background: rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 2px;
  pointer-events: none;
}

.leica-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e2001a;
  flex-shrink: 0;
}

.leica-badge span {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1;
}

/* ---- Scroll Reveal ---- */

.gallery-item {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.gallery-item.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Responsive ---- */

@media (max-width: 1024px) {
  .nav-inner {
    padding: 24px 32px;
  }

  .nav-name {
    font-size: 24px;
  }

  .contact {
    padding: 120px 32px;
  }

  .contact-heading {
    font-size: 36px;
  }

  .profile {
    padding: 60px 32px;
  }

  .filmstrip-track {
    padding: 0 32px;
  }
}

@media (max-width: 768px) {
  .nav-inner {
    padding: 20px 20px;
  }

  .nav-name {
    font-size: 20px;
  }

  .nav-links {
    gap: 24px;
  }

  .nav-links a {
    font-size: 14px;
  }

  /* Portrait 3 → 2 columns on tablet */
  .gallery-row--portrait-3 {
    flex-wrap: wrap;
  }

  .gallery-row--portrait-3 .gallery-item {
    flex: 1 1 calc(50% - var(--gap));
  }

  .gallery-row--portrait-3 .gallery-item:last-child {
    flex: 1 1 100%;
  }

  /* Mixed rows stack */
  .gallery-row--mixed-pl,
  .gallery-row--mixed-lp {
    flex-direction: column;
  }

  .gallery-row--mixed-pl .gallery-item--portrait,
  .gallery-row--mixed-lp .gallery-item--portrait,
  .gallery-row--mixed-pl .gallery-item--landscape,
  .gallery-row--mixed-lp .gallery-item--landscape {
    flex: none;
  }

  .gallery-row--mixed-pl .gallery-item img,
  .gallery-row--mixed-lp .gallery-item img {
    height: auto;
  }

  .contact {
    padding: 80px 20px;
  }

  .contact-heading {
    font-size: 28px;
  }

  .contact-email {
    font-size: 18px;
  }

  .profile {
    padding: 40px 20px;
  }

  .profile-inner {
    gap: 16px;
  }

  .profile-image {
    width: 80px;
    height: 80px;
  }

  .profile-name {
    font-size: 18px;
  }

  .filmstrip-thumb {
    width: 90px;
    height: 135px;
  }

  .filmstrip-track {
    padding: 0 20px;
  }

  .footer {
    padding: 20px;
  }
}

@media (max-width: 480px) {
  /* Portrait 2 → 1 column on phone */
  .gallery-row--portrait-2 {
    flex-direction: column;
  }

  .gallery-row--portrait-3 .gallery-item {
    flex: 1 1 100%;
  }

  .gallery-row--portrait-3 .gallery-item:last-child {
    flex: 1 1 100%;
  }

  .nav-links {
    gap: 16px;
  }

  .nav-links a {
    font-size: 13px;
  }
}
