/* ==========================================================================
   CROWNZ BARBER SHOP - CORE FOUNDATION STYLES
   ========================================================================== */

:root {
  /* Core Colors - Monochrome Luxury */
  --bg-base: #030303;
  --bg-surface: #0a0a0a;
  --text-main: #ffffff;
  --text-muted: #a3a3a3;
  --accent: #ffffff;
  
  /* Borders & Overlays */
  --border-light: rgba(255, 255, 255, 0.15);
  --border-subtle: rgba(255, 255, 255, 0.05);
  --glass-bg: rgba(15, 15, 15, 0.5);
  
  /* Typography */
  --font-heading: 'Bebas Neue', sans-serif;
  --font-subheading: 'Montserrat', sans-serif;
  --font-sans: 'Raleway', sans-serif;
  
  /* Layout */
  --container-w: 1400px;
  --section-pad: clamp(80px, 12vh, 150px);
  
  /* Easing */
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --- RESET & BASE --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  background-color: var(--bg-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: auto !important; /* Managed by Lenis */
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-sans);
  color: var(--text-main);
  background: var(--bg-base);
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  font-weight: 400;
  line-height: 1.6;
}

body.loading {
  overflow: hidden;
}

a, button, .hover-target {
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

::-webkit-scrollbar {
  width: 8px;
  background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.2);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.4);
}

/* --- TYPOGRAPHY --- */
h1, h2, h3, h4, h5, h6, .font-heading {
  font-family: var(--font-heading);
  text-transform: uppercase;
  font-weight: 400;
  letter-spacing: 2px;
  line-height: 1.1;
}

.sub-heading {
  font-family: var(--font-subheading);
  color: var(--text-muted);
  letter-spacing: 4px;
  font-size: 0.9rem;
  text-transform: uppercase;
  margin-bottom: 20px;
  display: block;
}

.text-center { text-align: center; }
.accent-text { color: var(--accent); }

/* --- LAYOUT & UTILITIES --- */
.container {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 5%;
  width: 100%;
}

section {
  padding: var(--section-pad) 0;
  position: relative;
  background: transparent;
}

.glass-panel {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(15px);
  backdrop-filter: blur(15px);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
}

/* --- BUTTONS --- */
.primary-btn {
  display: inline-flex;
  padding: 16px 35px;
  border: 1px solid var(--border-light);
  color: var(--text-main);
  font-family: var(--font-subheading);
  letter-spacing: 2px;
  font-size: 0.9rem;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.4s var(--ease-smooth);
  background: transparent;
  border-radius: 4px;
  font-weight: 500;
}

.primary-btn .btn-text {
  position: relative;
  z-index: 2;
  transition: color 0.4s ease;
}

.primary-btn .btn-bg {
  position: absolute;
  inset: 0;
  background: var(--text-main);
  z-index: 1;
  transform: translateY(100%);
  transition: transform 0.5s var(--ease-bounce);
}

.primary-btn:hover {
  border-color: var(--text-main);
}

.primary-btn:hover .btn-bg {
  transform: translateY(0);
}

.primary-btn:hover .btn-text {
  color: var(--bg-base);
  font-weight: 600;
}

/* --- HEADER & NAVIGATION --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 25px 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  transition: padding 0.6s var(--ease-smooth), background-color 0.6s var(--ease-smooth), border-color 0.6s var(--ease-smooth);
}

.site-header.scrolled {
  padding: 15px 5%;
  background: rgba(3, 3, 3, 0.95);
  border-bottom: 1px solid var(--border-subtle);
  -webkit-backdrop-filter: blur(15px);
  backdrop-filter: blur(15px);
}

.brand-logo-img {
  display: block;
  max-width: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.logo-header { height: clamp(40px, 5vw, 60px); }

.main-nav { display: none; }

@media (min-width: 1024px) {
  .main-nav { display: block; }
}

.nav-list {
  display: flex;
  gap: clamp(15px, 2.5vw, 40px);
}

.nav-link {
  font-family: var(--font-subheading);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color 0.4s ease;
  position: relative;
  padding-bottom: 4px;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0%;
  height: 1px;
  background-color: var(--accent);
  transition: width 0.4s var(--ease-bounce);
}

.nav-link:hover { color: var(--text-main); }
.nav-link:hover::after { width: 100%; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 30px;
}

.shop-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  border-radius: 50px;
  border: 1px solid var(--border-light);
}

.status-txt {
  font-family: var(--font-subheading);
  font-size: 0.75rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 600;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: background 0.4s ease, box-shadow 0.4s ease;
}

.status-dot.open {
  background: #fff;
  box-shadow: 0 0 10px rgba(255,255,255,0.8);
}

.menu-toggle {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  z-index: 10001;
}

@media (min-width: 1024px) {
  .menu-toggle { display: none; }
}

.menu-toggle .line {
  width: 30px;
  height: 2px;
  background: var(--text-main);
  transition: transform 0.4s var(--ease-smooth);
}

/* --- MOBILE DRAWER OVERLAY --- */
.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  height: 100dvh; /* EXPLICIT HEIGHT: Forces WebKit to resolve flex constraints for children */
  background: rgba(3, 3, 3, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  /* Updated padding: respects safe-areas and reserves top space for the close button */
  padding: max(90px, env(safe-area-inset-top, 90px)) 10% max(40px, env(safe-area-inset-bottom, 40px));
  transform: translateX(100%);
  transition: transform 0.8s var(--ease-smooth);
}

.mobile-menu-overlay.active {
  transform: translateX(0);
}

.mobile-nav-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
  width: 100%;
  flex: 0 1 auto; /* CRITICAL: Forces list to shrink to parent height */
  min-height: 0;
  margin: auto 0; /* Safely centers the list on tall screens, anchors top on short screens */
  padding-right: 15px; /* Breathing room for touch scrolling */
  -webkit-overflow-scrolling: touch; /* Smooth iOS scrolling */
}

/* Hide scrollbar for premium touch experience */
.mobile-nav-list::-webkit-scrollbar {
  display: none;
}

.mobile-nav-link {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 7vw, 3.5rem);
  color: var(--text-muted);
  transition: color 0.4s ease, transform 0.4s ease;
  display: block;
}

.mobile-nav-link:hover {
  color: var(--text-main);
  transform: translateX(15px);
}

/* Viewport Height Responsive Adjustments */
@media (max-height: 800px) {
  .mobile-nav-list {
    gap: 14px;
  }
  .mobile-nav-link {
    font-size: clamp(1.8rem, 6vw, 3rem);
  }
}

@media (max-height: 600px) {
  .mobile-nav-list {
    gap: 10px;
  }
  .mobile-nav-link {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
  }
}

.mobile-close-btn {
  position: absolute;
  /* Updated top: dynamically avoids notch/safe areas */
  top: max(30px, env(safe-area-inset-top, 30px));
  right: 5%;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 2.5rem;
  transition: transform 0.4s ease;
  z-index: 10000;
}

.mobile-close-btn:hover {
  transform: rotate(90deg) scale(1.1);
}

/* --- HERO SECTION RE-ADDITION --- */
.hero-section {
    position: relative;
    height: 100vh;
    height: 100dvh;
    min-height: 600px;
    display: flex;
    align-items: flex-end;
    padding-bottom: clamp(60px, 15vh, 140px);
    justify-content: flex-start;
    overflow: hidden;
    z-index: 1;
    width: 100%;
}

.hero-image-wrapper {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    z-index: -2;
    background: var(--bg-base);
}

.hero-bg-img {
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: 75% top;
    -webkit-user-drag: none;
}

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

.hero-container-smart {
    z-index: 5;
    display: flex;
    justify-content: flex-start;
    align-items: flex-end;
    width: 100%;
    max-width: 2000px;
    padding-left: clamp(20px, 4vw, 80px);
}

.hero-text-box {
    position: relative;
    z-index: 2;
    max-width: clamp(400px, 45vw, 750px);
    padding: 0;
    text-align: left;
}

.title-line {
    overflow: hidden;
    display: block;
    padding-bottom: 5px; /* prevent font clipping on bottom */
}

.title-line span {
    display: inline-block;
    transform-origin: left top;
}

@media (max-width: 1024px) {
    .hero-section {
        min-height: 100svh;
        padding-bottom: 40px;
        align-items: center;
        padding-top: 75px;
    }
}

/* --- MARQUEE --- */
.marquee-section {
    overflow: hidden;
    position: relative;
    width: 100%;
}

.marquee-inner {
    display: flex;
    width: max-content;
    white-space: nowrap;
    align-items: center;
}

/* --- BEFORE & AFTER SLIDER --- */
.slider-container {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    border-radius: 8px;
}

.ba-wrapper {
    touch-action: none; /* Critical for mobile drag */
    position: relative;
    width: 100%;
    aspect-ratio: 4/5;
    max-height: 80vh;
    overflow: hidden;
    border-radius: inherit;
    cursor: ew-resize;
}

.ba-image {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    height: 100%;
}

.ba-over {
    width: 100%;
    clip-path: polygon(0 0, 50% 0, 50% 100%, 0 100%);
}

.ba-handle {
    position: absolute;
    top: 0;
    left: 50%;
    height: 100%;
    width: 40px;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    z-index: 10;
}

.handle-line {
    width: 2px;
    height: 100%;
    background: var(--accent);
}

.handle-btn {
    position: absolute;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 2px solid var(--accent);
    color: var(--accent);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    box-shadow: 0 0 20px rgba(0,0,0,0.8);
}

/* --- PARTICLES --- */
#particles-js {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* --- GLOBAL MOBILE OPTIMIZATION & PERFORMANCE --- */
html, body {
    overflow-x: hidden !important;
    position: relative;
    width: 100%;
}
.gs-reveal-up, .gs-reveal-down, .gs-reveal-left, .gs-reveal-right, .gs-reveal-scale, .cinematic-image-wrapper {
    will-change: transform, opacity;
    transform: translateZ(0);
}
