/* ==========================================================================
   Empire Estate & Mahesh Bhatt (@thatrealestateguy.co)
   Design System: Deep Midnight Navy, Warm Ivory & Restrained Bronze
   Inspired by The Modern House (Editorial Restraint) & SERHANT (Confident Presentation)
   ========================================================================== */

:root {
  /* Color System */
  --navy-dark: #080e21;
  --navy-mid: #0c142e;
  --navy-surface: #101a3b;
  --navy-border: rgba(255, 255, 255, 0.09);
  --navy-border-hover: rgba(255, 255, 255, 0.22);

  --ivory-light: #faf8f5;
  --ivory-mid: #f3efe6;
  --ivory-surface: #eae5d9;
  --ivory-border: rgba(24, 28, 43, 0.08);
  --ivory-border-hover: rgba(24, 28, 43, 0.2);

  --bronze: #b38a56;
  --bronze-light: #cfa66e;
  --bronze-dark: #8c6738;
  --bronze-subtle: rgba(179, 138, 86, 0.12);

  --text-dark: #141824;
  --text-dark-muted: #565d70;
  --text-light: #ffffff;
  --text-light-muted: rgba(255, 255, 255, 0.72);
  --text-light-subtle: rgba(255, 255, 255, 0.45);

  /* Typography */
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Layout & Radii */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  /* Header Height */
  --header-height: 80px;
}

/* Base Reset & Smooth Scroll */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
  color-scheme: dark light;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--navy-dark);
  color: var(--text-light);
  font-family: var(--font-sans);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--navy-dark);
}
::-webkit-scrollbar-thumb {
  background: rgba(179, 138, 86, 0.35);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--bronze);
}

/* Typography Hierarchy */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  letter-spacing: -0.02em;
  font-weight: 600;
  line-height: 1.2;
}

.font-editorial {
  font-family: var(--font-serif);
}

.font-sans-ui {
  font-family: var(--font-sans);
}

/* =========================================================================
   HEADER & NAVIGATION
   ========================================================================= */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  z-index: 50;
  background: transparent;
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  border-bottom: 1px solid transparent;
  transition: background 0.35s ease, border-color 0.35s ease, backdrop-filter 0.35s ease, box-shadow 0.35s ease;
}

.site-header.scrolled {
  background: rgba(8, 14, 33, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--navy-border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-light-muted);
  transition: color 0.2s ease;
  position: relative;
  padding: 6px 0;
  text-decoration: none;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-light);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--bronze);
  transition: width 0.25s ease;
}

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

/* =========================================================================
   BUTTON STYLES
   ========================================================================= */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: var(--radius-full);
  background: #ffffff;
  color: var(--navy-dark);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  border: 1px solid #ffffff;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
  background: var(--ivory-light);
  transform: translateY(-1.5px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-light);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-1.5px);
}

.btn-bronze {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: var(--radius-full);
  background: var(--bronze);
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  border: 1px solid var(--bronze);
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-bronze:hover {
  background: var(--bronze-light);
  transform: translateY(-1.5px);
  box-shadow: 0 6px 20px rgba(179, 138, 86, 0.3);
}

.btn-dark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: var(--radius-full);
  background: var(--navy-dark);
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  border: 1px solid var(--navy-dark);
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-dark:hover {
  background: var(--navy-mid);
  transform: translateY(-1.5px);
  box-shadow: 0 6px 20px rgba(8, 14, 33, 0.25);
}

/* =========================================================================
   HERO VIDEO BACKGROUND & ACCESSIBILITY CONTROLS
   ========================================================================= */
.hero-video-section {
  position: relative;
  background-color: var(--navy-dark);
}

.hero-media-wrapper {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 1;
}

.hero-bg-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.hero-bg-poster {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-video-overlay {
  position: absolute;
  inset: 0;
  background: 
    linear-gradient(180deg, rgba(8, 14, 33, 0.72) 0%, rgba(8, 14, 33, 0.48) 40%, rgba(8, 14, 33, 0.86) 82%, var(--navy-dark) 100%),
    linear-gradient(90deg, rgba(8, 14, 33, 0.88) 0%, rgba(8, 14, 33, 0.62) 50%, rgba(8, 14, 33, 0.28) 100%);
  pointer-events: none;
}

.video-control-btn {
  position: absolute;
  bottom: 32px;
  right: 32px;
  z-index: 25;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(8, 14, 33, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-light);
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.video-control-btn:hover {
  background: rgba(8, 14, 33, 0.95);
  border-color: var(--bronze);
  transform: scale(1.05);
}

.video-control-btn:focus-visible {
  outline: 2px solid var(--bronze);
  outline-offset: 3px;
}

@media (max-width: 640px) {
  .video-control-btn {
    bottom: 84px;
    right: 20px;
    width: 36px;
    height: 36px;
  }
}

/* =========================================================================
   SECTION THEMES (Alternating Rhythm)
   ========================================================================= */
.section-dark {
  background-color: var(--navy-dark);
  color: var(--text-light);
}

.section-dark-mid {
  background-color: var(--navy-mid);
  color: var(--text-light);
}

.section-light {
  background-color: var(--ivory-light);
  color: var(--text-dark);
}

.section-light h1,
.section-light h2,
.section-light h3,
.section-light h4 {
  color: var(--text-dark);
}

.section-light p {
  color: var(--text-dark-muted);
}

/* =========================================================================
   CARDS & PANELS
   ========================================================================= */
.card-dark {
  background: var(--navy-surface);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius-lg);
  transition: border-color 0.25s ease, transform 0.25s ease, background-color 0.25s ease;
}

.card-dark:hover {
  border-color: var(--navy-border-hover);
  transform: translateY(-2px);
}

.card-light {
  background: #ffffff;
  border: 1px solid var(--ivory-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 20px rgba(24, 28, 43, 0.03);
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.card-light:hover {
  border-color: var(--ivory-border-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(24, 28, 43, 0.06);
}

/* =========================================================================
   EXPANDABLE SERVICE ACCORDION
   ========================================================================= */
.service-accordion-item {
  border-bottom: 1px solid var(--navy-border);
  transition: background-color 0.2s ease;
}

.service-accordion-item:last-child {
  border-bottom: none;
}

.service-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0;
  background: transparent;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  text-align: left;
  transition: color 0.2s ease;
}

.service-header:hover {
  color: var(--bronze-light);
}

.service-header:focus-visible {
  outline: 2px solid var(--bronze);
  outline-offset: 4px;
}

.service-icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--navy-border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease;
}

.service-accordion-item.open .service-icon-wrap {
  transform: rotate(45deg);
  border-color: var(--bronze);
  color: var(--bronze);
}

.service-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  opacity: 0;
}

.service-accordion-item.open .service-body {
  max-height: 480px;
  opacity: 1;
  padding-bottom: 28px;
}

/* =========================================================================
   ANIMATIONS & MOTION SYSTEM (Respects Reduced Motion)
   ========================================================================= */
.reveal-item {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

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

/* Stagger Delays */
.delay-1 { transition-delay: 0.08s; }
.delay-2 { transition-delay: 0.16s; }
.delay-3 { transition-delay: 0.24s; }
.delay-4 { transition-delay: 0.32s; }

/* Subtle Image Hover Zoom for Pointer Devices */
@media (hover: hover) and (pointer: fine) {
  .img-hover-zoom {
    overflow: hidden;
  }
  .img-hover-zoom img {
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .img-hover-zoom:hover img {
    transform: scale(1.03);
  }
}

/* Respect Reduced Motion Preferences */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal-item {
    opacity: 1 !important;
    transform: none !important;
  }
  .hero-bg-video {
    display: none !important;
  }
  .hero-bg-poster {
    display: block !important;
  }
  .video-control-btn {
    display: none !important;
  }
}

/* =========================================================================
   MODALS & DRAWERS
   ========================================================================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 14, 33, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  background: var(--navy-mid);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  transform: scale(0.96) translateY(12px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.is-open .modal-dialog {
  transform: scale(1) translateY(0);
}

/* Mobile Nav Drawer */
.mobile-nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 85%;
  max-width: 340px;
  height: 100vh;
  background: var(--navy-dark);
  border-left: 1px solid var(--navy-border);
  z-index: 90;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  padding: 28px 24px;
}

.mobile-nav-drawer.is-open {
  transform: translateX(0);
}

/* Mobile Sticky Bottom Consultation Bar */
.mobile-consultation-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(8, 14, 33, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--navy-border);
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
