/* ============================================================
   Valeria Badiu — Photography Portfolio
   Warm, romantic aesthetic inspired by the client's reference:
   cream background, deep navy text, gold + blush accents,
   arched image crops.
   Fonts: Lora (serif headings) + Karla (body) + Allura (script).
   ============================================================ */

:root {
  --bg: #FBF7F3;          /* warm cream */
  --bg-soft: #ECE5E0;     /* deeper cream band */
  --blush: #FFD8CF;       /* blush pink band */
  --text: #022A48;        /* deep navy */
  --muted: #5A6B7A;       /* soft slate */
  --gold: #DBA948;        /* warm gold accent */
  --sage: #A1B7B8;        /* soft sage */
  --line: #E2D8CF;
  --font-serif: 'Lora', Georgia, serif;
  --font-body: 'Karla', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-script: 'Allura', cursive;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 16.5px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

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

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

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 500;
}

/* Arched "cathedral window" image crop — the signature shape */
.arch {
  border-radius: 999px 999px 0 0;
}

/* Script accent line above headings */
.script-accent {
  font-family: var(--font-script);
  font-size: 2.2rem;
  color: var(--gold);
  line-height: 1.2;
  margin-bottom: 0.25rem;
}

.center { text-align: center; }

.section-title {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  letter-spacing: 0.02em;
  margin-bottom: 2.5rem;
}

/* Shared button */
.btn {
  display: inline-block;
  background: var(--text);
  color: var(--bg);
  border: 1px solid var(--text);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  padding: 0.95rem 2.6rem;
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease;
}

.btn:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: #FFFFFF;
}

.btn-outline {
  background: transparent;
  color: var(--text);
}

/* ============================================================
   HEADER / NAVIGATION
   ============================================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4vw;
  height: 76px;
  background: rgba(251, 247, 243, 0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}

.logo {
  font-family: var(--font-script);
  font-size: 2.1rem;
  color: var(--text);
}

.main-nav {
  display: flex;
  gap: 2.4rem;
}

.main-nav .nav-link {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  position: relative;
  padding-bottom: 4px;
  transition: color 0.3s ease;
}

/* Gold underline slides in on hover / active */
.main-nav .nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--gold);
  transition: width 0.35s ease;
}

.main-nav .nav-link:hover::after,
.main-nav .nav-link.active::after {
  width: 100%;
}

/* Instagram icon link */
.ig-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  transition: color 0.3s ease;
}

.ig-link:hover {
  color: var(--gold);
}

.main-nav .ig-link svg {
  display: block;
}

/* Hamburger (mobile only) */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 30px;
  height: 22px;
  position: relative;
}

.nav-toggle span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--text);
  transition: transform 0.3s ease, opacity 0.3s ease, top 0.3s ease;
}

.nav-toggle span:nth-child(1) { top: 0; }
.nav-toggle span:nth-child(2) { top: 10px; }
.nav-toggle span:nth-child(3) { top: 20px; }

.nav-toggle.open span:nth-child(1) { top: 10px; transform: rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { top: 10px; transform: rotate(-45deg); }

/* ============================================================
   HERO — cinematic crossfading slideshow with Ken Burns drift
   ============================================================ */
.hero {
  position: relative;
  height: 100vh;
  overflow: hidden;
  background: var(--text); /* dark base behind the crossfade */
}

.hero-slides,
.hero-slide {
  position: absolute;
  inset: 0;
}

.hero-slide {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 2.4s ease-in-out;
  will-change: opacity, transform;
}

.hero-slide.active {
  opacity: 1;
  /* Slow premium drift — runs the length of each slide's stay */
  animation: kenburns 11s ease-out forwards;
}

@keyframes kenburns {
  from { transform: scale(1.0) translate(0, 0); }
  to   { transform: scale(1.09) translate(-0.6%, -0.8%); }
}

/* Soft dark wash so the caption stays readable */
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(2, 42, 72, 0.15) 0%,
    rgba(2, 42, 72, 0.05) 45%,
    rgba(2, 42, 72, 0.45) 100%
  );
}

.hero-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10%;
  margin: 0 auto; /* centered without transform — .fade-in animates transform */
  text-align: center;
  color: #FFFFFF;
  width: min(90%, 720px);
}

.hero-script {
  font-family: var(--font-script);
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  color: var(--gold);
}

.hero-caption h1 {
  font-size: clamp(2.2rem, 5.5vw, 4rem);
  line-height: 1.15;
  margin: 0.5rem 0;
  letter-spacing: -0.02em;
}

.hero-sub {
  font-size: 0.85rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  margin-bottom: 1.75rem;
}

.hero .btn {
  background: transparent;
  border-color: #FFFFFF;
  color: #FFFFFF;
}

.hero .btn:hover {
  background: #FFFFFF;
  color: var(--text);
}

/* ============================================================
   SECTIONS
   ============================================================ */
.section {
  padding: 6rem 6vw;
}

/* ---------- About ---------- */
.about {
  background: var(--bg);
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(240px, 380px) 1fr;
  gap: 4.5rem;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
}

.about-img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.about-text h2 {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  margin-bottom: 1.25rem;
}

.about-text p {
  margin-bottom: 1.15rem;
  max-width: 52ch;
  color: var(--muted);
}

.signature {
  font-family: var(--font-script);
  font-size: 2.6rem;
  color: var(--gold);
}

/* ---------- Session cards ---------- */
.sessions {
  background: var(--bg-soft);
  text-align: center;
}

.session-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.session-card {
  display: block;
}

.session-card img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  transition: transform 0.5s ease, box-shadow 0.5s ease;
}

.session-card:hover img {
  transform: translateY(-6px);
  box-shadow: 0 18px 36px rgba(2, 42, 72, 0.16);
}

.card-label {
  display: block;
  margin-top: 1.25rem;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  letter-spacing: 0.06em;
}

.card-label::after {
  content: '';
  display: block;
  width: 34px;
  height: 2px;
  background: var(--gold);
  margin: 0.6rem auto 0;
  transition: width 0.35s ease;
}

.session-card:hover .card-label::after {
  width: 60px;
}

/* ---------- Portfolio: per-session gallery blocks ---------- */
.portfolio {
  background: var(--bg);
}

/* Anchored jumps land below the fixed header */
section[id],
.session-gallery {
  scroll-margin-top: 90px;
}

.session-gallery {
  max-width: 1400px;
  margin: 0 auto;
}

/* Gold hairline divider between sessions */
.session-gallery + .session-gallery {
  margin-top: 4.5rem;
  padding-top: 4.5rem;
  position: relative;
}

.session-gallery + .session-gallery::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 64px;
  height: 2px;
  background: var(--gold);
}

.session-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.9rem;
}

.session-titles .script-accent {
  font-size: 1.7rem;
  margin-bottom: 0;
}

.session-heading {
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  letter-spacing: 0.02em;
}

/* Clean 3-column CSS Grid — keeps exactly 3 columns on desktop, ending at the same level */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
  max-width: 1400px;
  margin: 0 auto;
  align-items: start;
}

.gallery-item {
  overflow: hidden;
  border-radius: 4px;
  cursor: pointer;
}

.gallery-item img {
  width: 100%;
  transition: transform 0.6s ease;
}

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

.gallery-item.hidden {
  display: none;
}

/* Hide gallery items by default, shown dynamically via JS show-on-grid class */
.gallery-item {
  display: none;
}

.gallery-item.show-on-grid {
  display: block;
}

/* ---------- Steps band ---------- */
.steps-band {
  background: var(--bg-soft);
  text-align: center;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem;
  max-width: 1000px;
  margin: 0 auto;
}

.step-num {
  font-family: var(--font-serif);
  font-size: 1rem;
  letter-spacing: 0.3em;
  color: var(--gold);
}

.step h3 {
  font-size: 1.35rem;
  margin: 0.6rem 0 0.75rem;
}

.step p {
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---------- Contact ---------- */
.contact {
  background: var(--bg);
}

.contact-wrap {
  max-width: 640px;
  margin: 0 auto;
}

.contact-intro {
  margin-bottom: 2.75rem;
  color: var(--muted);
}

.email-link {
  color: var(--text);
  border-bottom: 1px solid var(--gold);
  transition: color 0.3s ease;
}

.email-link:hover {
  color: var(--gold);
}

.form-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.form-row {
  margin-bottom: 1.6rem;
}

.form-row label {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  color: var(--muted);
}

.form-row input,
.form-row textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #FFFFFF;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 300;
  color: var(--text);
  padding: 0.8rem 1rem;
  outline: none;
  resize: vertical;
  transition: border-color 0.3s ease;
}

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

.contact form {
  text-align: center;
}

.contact .form-row,
.contact .form-duo {
  text-align: left;
}

.form-note {
  margin-top: 1rem;
  font-size: 0.88rem;
  color: var(--muted);
  transition: color 0.3s ease;
}

.form-note.success {
  color: #2D6A4F;
  font-weight: 500;
}

.form-note.error {
  color: #A94442;
  font-weight: 500;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--bg-soft);
  color: var(--muted);
  text-align: center;
  padding: 3.5rem 6vw;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  border-top: 1px solid var(--line);
}

.footer-script {
  font-family: var(--font-script);
  font-size: 2.4rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.footer-areas {
  margin-bottom: 1.25rem;
}

.footer-ig {
  color: var(--text);
  margin-bottom: 1.5rem;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
}

.footer-ig:hover {
  color: var(--gold);
}

.footer-credit {
  margin-top: 0.75rem;
  font-size: 0.72rem;
  color: var(--muted);
}

.footer-credit a {
  color: var(--text);
  border-bottom: 1px solid var(--gold);
  transition: color 0.3s ease;
}

.footer-credit a:hover {
  color: var(--gold);
}

/* ============================================================
   GALLERY MODE (immersive viewer with premium controls)
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(251, 247, 243, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.45s ease;
}

.lightbox.open {
  opacity: 1;
}

/* The hidden attribute must beat the display:flex above, otherwise
   the closed (invisible) viewer keeps covering the page and blocks
   every click. */
.lightbox[hidden] {
  display: none;
}

/* --- Top bar: title + counter left, controls right --- */
.lb-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.75rem;
  flex: 0 0 auto;
}

.lb-title {
  font-family: var(--font-script);
  font-size: 2rem;
  line-height: 1.1;
  color: var(--gold);
}

.lb-counter {
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  color: var(--muted);
}

.lb-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.lb-btn {
  background: none;
  border: 1px solid transparent;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  transition: color 0.3s ease, border-color 0.3s ease;
}

.lb-btn:hover {
  color: var(--gold);
  border-color: var(--gold);
}

.lb-btn.playing {
  color: var(--gold);
}

/* --- Stage --- */
.lb-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5.5rem;
}

.lb-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: 0 12px 60px rgba(2, 42, 72, 0.18);
  transition: opacity 0.25s ease;
}

.lb-stage img.swapping {
  opacity: 0;
}

.lb-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 3.2rem;
  line-height: 1;
  padding: 1rem;
  transition: color 0.3s ease;
}

.lb-arrow:hover {
  color: var(--gold);
}

.lb-prev { left: 1rem; }
.lb-next { right: 1rem; }

/* --- Thumbnail filmstrip --- */
.lb-thumbs {
  flex: 0 0 auto;
  display: flex;
  gap: 0.5rem;
  padding: 1rem 1.75rem 1.25rem;
  overflow-x: auto;
  scrollbar-width: thin;
}

.lb-thumb {
  flex: 0 0 auto;
  width: 52px;
  height: 66px;
  padding: 0;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  cursor: pointer;
  opacity: 0.45;
  transition: opacity 0.3s ease, border-color 0.3s ease;
}

.lb-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 2px;
}

.lb-thumb:hover {
  opacity: 0.85;
}

.lb-thumb.current {
  opacity: 1;
  border-bottom-color: var(--gold);
}

/* ============================================================
   FADE-IN ON SCROLL (paired with IntersectionObserver in JS)
   ============================================================ */
.fade-in {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fade-in {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .hero-slide.active {
    animation: none; /* no Ken Burns drift */
  }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .session-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 820px) {
  .nav-toggle {
    display: block;
  }

  /* Nav collapses into a dropdown sheet under the header */
  .main-nav {
    position: fixed;
    top: 76px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: center;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
  }

  .main-nav.open {
    max-height: 320px;
  }

  .main-nav .nav-link {
    padding: 1.1rem 0;
  }

  .section {
    padding: 4rem 6vw;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    text-align: center;
  }

  .about-img {
    max-width: 300px;
    margin: 0 auto;
  }

  .about-text p {
    margin-left: auto;
    margin-right: auto;
  }

  .steps {
    grid-template-columns: 1fr;
    gap: 2.25rem;
  }

  .form-duo {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .session-head {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
  }

  .gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .gallery-item {
    margin-bottom: 0;
  }

  .lb-arrow { font-size: 2.4rem; padding: 0.75rem 0.5rem; }
  .lb-stage { padding: 0 3rem; }
  .lb-top { padding: 0.9rem 1rem; }
  .lb-title { font-size: 1.6rem; }
  .lb-thumbs { padding: 0.75rem 1rem 1rem; }
  .lb-thumb { width: 44px; height: 56px; }
}

@media (max-width: 520px) {
  .session-cards {
    grid-template-columns: 1fr;
    max-width: 320px;
  }
  .gallery {
    grid-template-columns: 1fr;
  }
}

/* ---------- Scroll Progress Floating Camera ---------- */
.scroll-progress-container {
  position: fixed;
  bottom: 2.5rem;
  right: 2.5rem;
  z-index: 200;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.9);
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
              visibility 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
              transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
              background 0.3s ease;
  background: var(--bg);
  border-radius: 50%;
  box-shadow: 0 8px 30px rgba(2, 42, 72, 0.08);
}

.scroll-progress-container.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.scroll-progress-container:hover {
  background: #FFFFFF;
  transform: scale(1.05);
  box-shadow: 0 12px 35px rgba(2, 42, 72, 0.14);
}

.scroll-progress-container:hover .camera-svg {
  color: var(--gold);
  transform: rotate(15deg);
}

.scroll-progress-container:hover .progress-tooltip {
  opacity: 1;
  transform: translate(-50%, -8px) scale(1);
}

.progress-ring {
  position: absolute;
  top: 0;
  left: 0;
  transform: rotate(-90deg);
}

.progress-ring__circle-bg {
  stroke: var(--line);
}

.progress-ring__circle {
  stroke: var(--gold);
  transition: stroke-dashoffset 0.1s linear;
  stroke-dasharray: 150.796; /* 2 * PI * r (r=24) */
  stroke-dashoffset: 150.796;
}

.camera-icon-wrap {
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: color 0.3s ease;
}

.camera-svg {
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.3s ease;
}

.progress-tooltip {
  position: absolute;
  top: -32px;
  left: 50%;
  transform: translate(-50%, 0) scale(0.8);
  background: var(--text);
  color: var(--bg);
  font-size: 0.68rem;
  font-family: var(--font-body);
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 3px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(2, 42, 72, 0.15);
}

.progress-tooltip::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 8px;
  height: 8px;
  background: var(--text);
}

@media (max-width: 768px) {
  .scroll-progress-container {
    bottom: 1.5rem;
    right: 1.5rem;
    width: 48px;
    height: 48px;
  }
  .progress-ring {
    width: 48px;
    height: 48px;
  }
  .progress-ring circle {
    r: 20px;
    cx: 24px;
    cy: 24px;
  }
  .progress-ring__circle {
    stroke-dasharray: 125.663; /* 2 * PI * 20 */
    stroke-dashoffset: 125.663;
  }
}
