/* ============================================
   PHOTOGRAPHY PORTFOLIO — CORE STYLES
   ============================================ */

/* --- Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&family=Libre+Franklin:wght@200;300;400;500;600&display=swap');

/* --- CSS Variables --- */
:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --bg-card: #161616;
  --bg-hover: #1c1c1c;
  --text-primary: #e8e4df;
  --text-secondary: #9a958e;
  --text-muted: #5a5650;
  --accent: #c8a87c;
  --accent-hover: #dbbf98;
  --border: #222222;
  --border-light: #2a2a2a;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Libre Franklin', 'Segoe UI', sans-serif;
  --transition: 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --max-width: 1400px;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font-body);
  font-weight: 300;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }

img {
  max-width: 100%;
  display: block;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  pointer-events: none;
}

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

/* --- Image Protection --- */
.no-save {
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* ============================================
   NAVIGATION
   ============================================ */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 0 40px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), background var(--transition);
}

.site-nav.scrolled {
  border-bottom-color: var(--border);
  background: rgba(10, 10, 10, 0.95);
}

.nav-brand {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--text-primary);
}

.nav-brand span { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 36px;
  list-style: none;
}

.nav-links a {
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-secondary);
  position: relative;
  padding-bottom: 2px;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

/* Mobile hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 1.5px;
  background: var(--text-primary);
  transition: var(--transition);
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: brightness(0.5);
  transform: scale(1.05);
  transition: transform 8s ease-out;
}

.hero.loaded .hero-bg { transform: scale(1); }

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(10,10,10,0.3) 0%,
    rgba(10,10,10,0.1) 40%,
    rgba(10,10,10,0.6) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 20px;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp 1.2s 0.5s forwards;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  font-weight: 300;
  letter-spacing: 0.06em;
  line-height: 1.15;
  margin-bottom: 16px;
}

.hero-subtitle {
  font-size: 0.85rem;
  font-weight: 200;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 40px;
}

.hero-cta {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-primary);
  border: 1px solid var(--accent);
  padding: 14px 40px;
  transition: all var(--transition);
}

.hero-cta:hover {
  background: var(--accent);
  color: var(--bg-primary);
}

.scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: fadeUp 1.2s 1.2s forwards;
  opacity: 0;
}

.scroll-indicator span {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

/* ============================================
   PAGE HEADER (for sub-pages)
   ============================================ */
.page-header {
  padding: 140px 40px 60px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 300;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

.page-header p {
  font-size: 0.82rem;
  font-weight: 200;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* ============================================
   GALLERY SECTIONS (Homepage previews)
   ============================================ */
.gallery-preview {
  padding: 100px 40px;
}

.gallery-preview + .gallery-preview {
  border-top: 1px solid var(--border);
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 50px;
  flex-wrap: wrap;
  gap: 16px;
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 300;
  letter-spacing: 0.04em;
}

.section-header .view-all {
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-header .view-all::after {
  content: '→';
  transition: transform var(--transition);
}

.section-header .view-all:hover::after {
  transform: translateX(4px);
}

/* --- Carousel (Homepage previews) --- */
.carousel {
  position: relative;
}

.carousel-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;

  /* Hide scrollbar */
  scrollbar-width: none;          /* Firefox */
  -ms-overflow-style: none;       /* IE/Edge */
}

.carousel-track::-webkit-scrollbar {
  display: none;                  /* Chrome/Safari */
}

.carousel-track .gallery-item {
  flex: 0 0 calc((100% - 32px) / 3);  /* 3 visible items */
  scroll-snap-align: start;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(10, 10, 10, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  font-size: 1.6rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  opacity: 0;
}

.carousel:hover .carousel-btn {
  opacity: 1;
}

.carousel-btn:hover {
  color: var(--text-primary);
  border-color: var(--accent);
  background: rgba(10, 10, 10, 0.9);
}

.carousel-btn.hidden {
  opacity: 0 !important;
  pointer-events: none;
}

.carousel-prev { left: -22px; }
.carousel-next { right: -22px; }

/* ============================================
   GALLERY PAGE — MASONRY GRID
   ============================================ */
.gallery-container {
  padding: 50px 40px 100px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.gallery-filter {
  display: flex;
  gap: 24px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.filter-btn {
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px 0;
  border-bottom: 1px solid transparent;
  transition: all var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}

.masonry-grid {
  columns: 3;
  column-gap: 16px;
}

.masonry-grid .gallery-item {
  break-inside: avoid;
  margin-bottom: 16px;
}

/* ============================================
   GALLERY ITEM (shared)
   ============================================ */
.gallery-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-card);
}

.gallery-item .image-wrapper {
  position: relative;
  overflow: hidden;
}

/* The actual image is a background to hinder saving */
.gallery-item .image-display {
  width: 100%;
  padding-bottom: 66.67%; /* 3:2 aspect ratio default */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.masonry-grid .gallery-item .image-display {
  padding-bottom: 0;
  height: auto;
  aspect-ratio: auto;
}

.masonry-grid .gallery-item .image-display img {
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
}

/* Transparent protective overlay */
.gallery-item .image-wrapper::after {
  content: '';
  position: absolute;
  inset: 0;
  background: transparent;
  z-index: 2;
}

.gallery-item:hover .image-display {
  transform: scale(1.04);
}

.gallery-item .item-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: linear-gradient(
    180deg,
    transparent 40%,
    rgba(10,10,10,0.8) 100%
  );
  opacity: 0;
  transition: opacity var(--transition);
  display: flex;
  align-items: flex-end;
  padding: 24px;
}

.gallery-item:hover .item-overlay {
  opacity: 1;
}

.item-info h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 400;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}

.item-info span {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* ============================================
   LIGHTBOX
   ============================================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(5, 5, 5, 0.97);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s, visibility 0.4s;
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-content .image-display {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  -webkit-user-select: none;
  user-select: none;
  pointer-events: none;
  -webkit-user-drag: none;
}

/* Protective overlay on lightbox image */
.lightbox-content::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
}

.lightbox-caption {
  position: absolute;
  bottom: -48px;
  left: 0;
  right: 0;
  text-align: center;
}

.lightbox-caption h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--text-primary);
}

.lightbox-caption span {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 32px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.8rem;
  cursor: pointer;
  z-index: 10;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition);
}

.lightbox-close:hover { color: var(--text-primary); }

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 2rem;
  cursor: pointer;
  z-index: 10;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition);
}

.lightbox-nav:hover { color: var(--text-primary); }
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }

.lightbox-counter {
  position: absolute;
  top: 28px;
  left: 32px;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

/* ============================================
   ABOUT PAGE
   ============================================ */
.about-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 80px 40px 120px;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 60px;
  align-items: start;
}

.about-portrait {
  width: 100%;
  aspect-ratio: 3/4;
  background-size: cover;
  background-position: center;
  position: relative;
}

.about-portrait::after {
  content: '';
  position: absolute;
  inset: 0;
}

.about-text h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 300;
  margin-bottom: 24px;
  letter-spacing: 0.03em;
}

.about-text p {
  color: var(--text-secondary);
  margin-bottom: 20px;
  font-size: 0.92rem;
  line-height: 1.8;
}

.about-text p:last-child { margin-bottom: 0; }

/* ============================================
   CONTACT PAGE
   ============================================ */
.contact-content {
  max-width: 700px;
  margin: 0 auto;
  padding: 80px 40px 120px;
}

.contact-intro {
  text-align: center;
  margin-bottom: 60px;
}

.contact-intro p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.8;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.form-group input,
.form-group textarea {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 300;
  padding: 14px 18px;
  transition: border-color var(--transition);
  outline: none;
  resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
}

.form-group textarea { min-height: 160px; }

.form-submit {
  align-self: flex-start;
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 14px 44px;
  cursor: pointer;
  transition: all var(--transition);
}

.form-submit:hover {
  background: var(--accent);
  color: var(--bg-primary);
}

.form-status {
  font-size: 0.85rem;
  padding: 12px;
  display: none;
}

.form-status.success {
  display: block;
  color: #7cb87c;
  border: 1px solid #3a5a3a;
  background: rgba(124,184,124,0.05);
}

.form-status.error {
  display: block;
  color: #c87c7c;
  border: 1px solid #5a3a3a;
  background: rgba(200,124,124,0.05);
}

/* ============================================
   SOCIAL LINKS
   ============================================ */
.social-links {
  display: flex;
  gap: 20px;
  margin-top: 30px;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.85rem;
  transition: all var(--transition);
}

.social-links a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-copy {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.footer-social {
  display: flex;
  gap: 20px;
}

.footer-social a {
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color var(--transition);
}

.footer-social a:hover { color: var(--accent); }

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(25px);
  transition: opacity 0.8s, transform 0.8s;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
  .masonry-grid { columns: 2; }

  .carousel-track .gallery-item {
    flex: 0 0 calc((100% - 16px) / 2);  /* 2 visible items */
  }

  .about-content {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .about-portrait {
    max-width: 260px;
    margin: 0 auto;
  }
}

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

  .nav-toggle { display: flex; }

  .nav-links {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s;
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .hero-title { font-size: clamp(2rem, 8vw, 3.5rem); }

  .gallery-preview,
  .gallery-container { padding-left: 20px; padding-right: 20px; }

  .carousel-btn {
    opacity: 1;  /* Always visible on mobile (no hover) */
  }

  .carousel-prev { left: -10px; }
  .carousel-next { right: -10px; }

  .page-header { padding: 120px 20px 40px; }

  .contact-content,
  .about-content { padding-left: 20px; padding-right: 20px; }

  .site-footer { padding: 30px 20px; }
}

@media (max-width: 520px) {
  .masonry-grid { columns: 1; }

  .carousel-track .gallery-item {
    flex: 0 0 100%;  /* 1 visible item */
  }

  .lightbox-prev { left: 4px; }
  .lightbox-next { right: 4px; }
}
