/* Dark modern theme tailored for Studio XVI */
:root {
  --bg: #0a0a0a;
  --surface: #111214;
  --muted: #a1a1aa;
  --text: #eaeaea;
  --accent: #c7a972; /* tasteful warm gold */
  --accent-contrast: #0b0b0c;
  --divider: #1e1f22;
  --maxw: 1200px;
  --transition: all 0.3s ease;
  --shadow: 0 8px 25px rgba(199, 169, 114, 0.15);
}

* { 
  box-sizing: border-box; 
}

html, body { 
  height: 100%; 
}

body {
  margin: 0;
  background: linear-gradient(135deg, #0a0a0a 0%, #0f0f0f 30%, #0c0b07 40%, #0d0c08 50%, #0e0d0a 60%, #0f0f0f 70%, #0a0a0a 100%);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: 0.2px;
  /* Performance optimizations */
  will-change: auto;
  transform: translateZ(0);
  backface-visibility: hidden;
}

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

/* Layout */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 72px 0; border-top: 1px solid var(--divider); }

/* Full-page scroll snapping */
.snap-container {
  height: 100vh;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  /* Mobile touch optimizations */
  touch-action: pan-y;
  overscroll-behavior: contain;
  /* Performance optimizations */
  will-change: scroll-position;
  transform: translateZ(0);
  backface-visibility: hidden;
  /* Smooth scrolling on mobile */
  scroll-padding-top: 0;
  scroll-padding-bottom: 0;
  /* Slower section transitions for better user experience */
  scroll-snap-duration: 600ms;
}
.snap-section {
  min-height: 100vh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: block;
  /* Mobile scroll optimizations */
  position: relative;
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* Reveal animations per section */
.snap-section [data-animate] {
  opacity: 0;
  transform: translateY(14px) scale(0.995);
  filter: blur(2px);
  transition: opacity 400ms ease, transform 450ms ease, filter 450ms ease;
  will-change: opacity, transform, filter;
  /* Ensure immediate animation start */
  transition-delay: 0ms;
}
.snap-section.is-active [data-animate] {
  opacity: 1;
  transform: none;
  filter: none;
}
/* Optional stagger via inline style: --delay: 0ms, 80ms, ... */
[data-animate] { 
  transition-delay: var(--delay, 0ms); 
  /* Ensure smooth transitions on mobile */
  -webkit-transition: opacity 400ms ease, transform 450ms ease, filter 450ms ease;
}

/* Header / Hero */
.hero {
  position: relative;
  min-height: 100vh;
  display: grid;
  align-items: end;
  background: radial-gradient(1200px 600px at 80% 10%, rgba(199,169,114,0.12), transparent 60%),
              linear-gradient(180deg, rgba(0,0,0,0.0), rgba(0,0,0,0.55) 60%, rgba(0,0,0,0.9)),
              image-set(
                url('/public/images/hero.webp') type('image/webp') 1x,
                url('/public/images/hero.jpg') type('image/jpeg') 1x
              ) center/cover no-repeat;
}

.hero__content { padding: 56px 0 40px; }
.brand {
  display: flex; align-items: center; gap: 14px; opacity: 0.95;
}
.brand__logo { width: 40px; height: 40px; object-fit: contain; filter: grayscale(0.1) contrast(1.1) brightness(1.1); }
.brand__name { font-weight: 600; text-transform: uppercase; letter-spacing: 3px; font-size: 14px; color: var(--muted); }

.hero__header { margin: 14px 0 16px; }
.hero__title { font-size: clamp(28px, 4vw, 36px); line-height: 1.05; margin: 0 0 16px; font-weight: 700; }
.hero__description { font-size: clamp(16px, 2vw, 20px); color: #cfcfd6; max-width: 760px; margin: 0; }

.hero__cta { margin-top: 24px; display: flex; gap: 14px; flex-wrap: wrap; }
.button {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 18px; border-radius: 999px; border: 1px solid var(--divider);
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0));
  color: var(--text);
}
.button--accent { border-color: rgba(199,169,114,0.35); background: linear-gradient(180deg, rgba(199,169,114,0.2), rgba(199,169,114,0.08)); color: #f3efe6; }
.pill { display: inline-flex; align-items: center; padding: 6px 10px; border: 1px solid var(--divider); border-radius: 999px; color: var(--muted); font-size: 12px; width: max-content; white-space: nowrap; }

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(12, 1fr); gap: 12px; }
.gallery__item { position: relative; border-radius: 14px; overflow: hidden; background: #0c0d0f; border: 1px solid var(--divider); }
.gallery__item img { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(0.98) contrast(1.05); }
.gallery__item--wide { grid-column: span 7; min-height: 340px; }
.gallery__item--tall { grid-column: span 5; min-height: 340px; }
.gallery__item--square { grid-column: span 4; min-height: 260px; }

@media (max-width: 960px) {
  .gallery { grid-template-columns: repeat(6, 1fr); }
  .gallery__item--wide { grid-column: span 6; }
  .gallery__item--tall { grid-column: span 6; }
  .gallery__item--square { grid-column: span 3; }
}
@media (max-width: 640px) {
  .gallery { grid-template-columns: repeat(4, 1fr); }
  .gallery__item--square { grid-column: span 4; }
}

/* Mobile-specific optimizations */
@media (max-width: 768px) {
  /* Mobile scroll optimizations */
  .snap-container {
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    /* Slower mobile section transitions */
    scroll-snap-duration: 800ms;
  }
  
  .snap-section {
    scroll-snap-align: start;
    scroll-snap-stop: always;
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height for mobile */
  }
  
  /* Mobile transition optimizations - polished but snappy */
  .snap-section [data-animate] {
    transition: opacity 300ms ease, transform 350ms ease, filter 350ms ease;
    -webkit-transition: opacity 300ms ease, transform 350ms ease, filter 350ms ease;
    /* Immediate animation start on mobile */
    transition-delay: 0ms;
  }
  
  /* Ensure smooth scroll behavior on mobile */
  .snap-container {
    scroll-snap-type: y mandatory;
    scroll-padding: 0;
    scroll-margin: 0;
    /* Enhanced smooth scrolling */
    scroll-behavior: smooth;
    transition: scroll-behavior 0.3s ease;
  }
  
  .snap-section {
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }
  
  /* Typography adjustments for mobile */
  .hero__title { 
    font-size: clamp(24px, 6vw, 32px); 
    line-height: 1.1;
    margin: 0 0 14px;
  }
  
  .hero__sub { 
    font-size: clamp(14px, 4vw, 18px); 
    line-height: 1.4;
  }
  
  .hero__cta { 
    flex-direction: column; 
    gap: 12px;
    margin-top: 20px;
    margin-bottom: 20px;
  }
  
  .button { 
    width: 100%; 
    justify-content: center;
    padding: 14px 20px;
    font-size: 16px;
  }
  
  /* Container padding for mobile */
  .container { 
    padding: 0 16px; 
  }
  
  /* Services grid mobile layout */
  .services__grid {
    grid-template-columns: 1fr;
    gap: 16px;
    margin: 32px 0;
  }
  
  .service__card {
    padding: 20px 16px;
  }
  
  /* Membership steps mobile layout */
  .membership__process {
    gap: 20px;
    margin: 32px 0;
  }
  
  .membership__step {
    flex-direction: column;
    text-align: center;
    padding: 20px 16px;
  }
  
  .membership__step-number {
    margin-bottom: 12px;
  }
  
  /* Contact details mobile layout */
  .contact__card {
    flex-direction: column;
    gap: 16px;
    padding: 16px;
  }
  
  .contact__group {
    text-align: center;
  }
  
  /* Map mobile sizing */
  .contact__map #map {
    height: 250px;
  }
  
  /* Breadcrumb mobile adjustments */
  .breadcrumb {
    position: fixed;
    top: 10px;
    left: 10px;
    right: 10px;
    padding: 6px 12px;
    font-size: 12px;
  }
  
  .breadcrumb ol {
    flex-wrap: wrap;
    gap: 4px;
  }
  
  /* Section padding mobile */
  .section {
    padding: 48px 0;
  }
  
  /* Intro content mobile */
  .intro__content {
    padding: 32px 0;
    /* Ensure content has enough space on mobile */
    min-height: 60vh;
  }
  
  .intro__overlay .container {
    padding: 16px;
  }
  
  /* Move CTA to content area on mobile */
  .overlay__cta { display: none; }
  .membership--mobile { display: block; margin: 4px 0 0px 0; }
  
  /* Pill mobile styling */
  .pill {
    font-size: 11px;
    padding: 4px 8px;
  }
}

@media (max-width: 480px) {
  /* Extra small mobile devices */
  .hero__title { 
    font-size: clamp(24px, 6vw, 32px); 
  }
  
  .hero__description { 
    font-size: clamp(13px, 5vw, 16px); 
  }
  
  .services__title {
    font-size: clamp(24px, 6vw, 32px);
  }
  
  .membership__title {
    font-size: clamp(24px, 6vw, 32px);
  }
  
  .container {
    padding: 0 12px;
  }
  
  .section {
    padding: 32px 0;
  }
  
  .contact__map #map {
    height: 200px;
  }
}

/* Contact */
.contact { display: grid; gap: 48px; margin-top: 40px; }

/* Membership Section */
.membership {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

/* Hide mobile-only CTA on desktop */
.membership--mobile { display: none; }

.membership__title {
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 700;
  color: var(--text);
  margin: 0 0 16px 0;
}

.membership__description {
  font-size: 18px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0 0 40px 0;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.membership__process {
  display: grid;
  gap: 32px;
  margin: 40px 0;
  position: relative;
}

.membership__process::before {
  content: '';
  position: absolute;
  left: 24px;
  top: 24px;
  bottom: 24px;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  z-index: 0;
}

.membership__step {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  text-align: left;
  padding: 32px;
  background: var(--surface);
  border: 2px solid var(--divider);
  border-radius: 16px;
  position: relative;
  z-index: 1;
  transition: all 0.3s ease;
}

.membership__step:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(199, 169, 114, 0.15);
}

.membership__step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--accent), #b8945a);
  color: var(--accent-contrast);
  border-radius: 50%;
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(199, 169, 114, 0.3);
}

.membership__step-content {
  flex: 1;
}

.membership__step-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 12px 0;
}

.membership__step-text {
  font-size: 16px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
}

.membership__cta {
  margin-top: 8px;
}

/* Contact Details */
.contact__details { 
  display: grid; 
  gap: 24px; 
  font-style: normal; /* Remove default italic styling from address element */
}

.contact__card { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between; padding: 18px; border: 1px solid var(--divider); border-radius: 14px; background: var(--surface); }
.contact__group { display: grid; gap: 2px; }
.label { color: var(--muted); font-size: 12px; letter-spacing: 0.6px; text-transform: uppercase; }
.value { font-size: 16px; }
.socials { display: flex; gap: 12px; }

.contact__map { 
  border-radius: 14px; 
  overflow: hidden; 
  border: 1px solid var(--divider);
  background: var(--surface);
}
.contact__map #map { 
  display: block; 
  width: 100%; 
  height: 300px; 
  border: none; 
  filter: brightness(1.75) contrast(0.8) saturate(1.0);
}

/* Leaflet map dark mode customization */
.contact__map .leaflet-container {
  background: var(--bg) !important;
  color: var(--text) !important;
}

.contact__map .leaflet-tile {
  filter: brightness(1.1) contrast(1.2) !important;
}

.contact__map .leaflet-popup-content-wrapper {
  background: var(--surface) !important;
  color: var(--text) !important;
  border: 1px solid var(--divider) !important;
  border-radius: 8px !important;
}

.contact__map .leaflet-popup-tip {
  background: var(--surface) !important;
  border: 1px solid var(--divider) !important;
}

.contact__map .leaflet-control-zoom a {
  background: var(--surface) !important;
  color: var(--text) !important;
  border: 1px solid var(--divider) !important;
}

.contact__map .leaflet-control-zoom a:hover {
  background: var(--accent) !important;
  color: var(--accent-contrast) !important;
}

/* Footer */
footer { padding: 40px 0; border-top: 1px solid var(--divider); color: var(--muted); font-size: 13px; }

/* Intro section with slideshow */
.intro { 
  min-height: 100vh; 
  display: grid; 
  grid-template-rows: 50vh 1fr; 
  /* Ensure content fits exactly in viewport */
}
.intro__media { position: relative; overflow: hidden; border-bottom: 1px solid var(--divider); }
.intro__overlay { position: absolute; inset: 0; display: grid; align-content: end; background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,0.55) 75%, rgba(0,0,0,0.85)); }
.intro__overlay .container { padding: 24px; }
/* Overlay row: text left, CTA right */
.intro__overlay .overlay { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.overlay__left { max-width: 760px; }
.overlay__cta .button { white-space: nowrap; }

.intro__content { 
  padding: 48px 0; 
  background: linear-gradient(135deg, #0a0a0a 0%, #0f0f0f 30%, #0c0b07 40%, #0d0c08 50%, #0e0d0a 60%, #0f0f0f 70%, #0a0a0a 100%);
  border-bottom: 1px solid var(--divider);
}

/* Center membership CTA between slideshow (above) and contact details (below) */
.intro__content .container {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
.intro__spacer { flex: 0 0 16px; }
.intro__content .container > .intro__spacer:first-of-type { flex: 0 0 12px; }
.intro__content .container > .intro__spacer:last-of-type { flex: 1 1 auto; min-height: 24px; }
.intro__content .membership { margin-top: 0; margin-bottom: 0; }

/* Services Section */
.services {
  max-width: 1000px;
  margin: 0 auto;
  text-align: center;
  padding: 32px 0;
}

.services__title {
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 700;
  color: var(--text);
  margin: 0 0 16px 0;
}

.services__description {
  font-size: 18px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0 0 48px 0;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.services__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin: 48px 0;
}

.service__card {
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: 16px;
  padding: 24px 20px;
  text-align: center;
  transition: all 0.3s ease;
}

.service__card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(199, 169, 114, 0.15);
}

.service__title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 12px 0;
}

.service__description {
  font-size: 16px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
}

@media (max-width: 1024px) {
  .services__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
}

@media (max-width: 640px) {
  .services__grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* Testimonial */
.testimonial {
  max-width: 800px;
  margin: 48px auto 0;
  text-align: center;
  padding: 32px 0;
}

.testimonial__quote {
  font-size: clamp(18px, 3vw, 24px);
  line-height: 1.6;
  color: var(--text);
  font-style: italic;
  margin: 0 0 24px 0;
  position: relative;
}

.testimonial__quote::before {
  content: '"';
  font-size: 4rem;
  color: var(--accent);
  position: absolute;
  top: -20px;
  left: -20px;
  opacity: 0.3;
}

.testimonial__author {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 32px;
}

.testimonial__name {
  font-weight: 600;
  color: var(--text);
  font-size: 16px;
}

.testimonial__role {
  color: var(--muted);
  font-size: 14px;
}

.testimonial__social {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(199,169,114,0.08), rgba(199,169,114,0.02));
  border: 1px solid rgba(199,169,114,0.2);
  border-radius: 8px;
  max-width: fit-content;
  margin: 0 auto;
}

.testimonial__social-text {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}

.testimonial__instagram {
  display: inline-block;
  padding: 8px 16px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--divider);
  border-radius: 6px;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s ease;
}

.testimonial__instagram:hover {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.slideshow { position: relative; width: 100%; height: 100%; }
.slideshow__slide { 
  position: absolute; 
  inset: 0; 
  width: 100%; 
  height: 100%; 
  object-fit: cover; 
  opacity: 0; 
  transition: opacity 800ms ease; 
  display: block; 
}
.slideshow__slide.is-active { opacity: 1; }

.slideshow::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.3) 50%, rgba(0,0,0,0.7) 100%);
  pointer-events: none;
  z-index: 1;
}

.intro__overlay {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: end;
  background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,0.55) 75%, rgba(0,0,0,0.85));
  z-index: 2;
}


/* Mobile CTA override (placed at end to win cascade) */
@media (max-width: 768px) {
  .membership--mobile { display: block !important; margin: 12px 0 16px 0; }
  .overlay__cta { display: none !important; }
  /* Remove large spacer above CTA on mobile */
  .intro__content .container > .intro__spacer { flex: 0 0 0 !important; height: 0; min-height: 0; }
  /* Tighten top padding and fully remove the spacer element */
  .intro__content { padding-top: 4px !important; }
  .intro__content .container > .intro__spacer { display: none !important; }
  .membership--mobile { margin-top: 0 !important; }
  /* Add small space below mobile CTA button */
  .membership--mobile .membership__cta { margin-bottom: 12px; }
}

