/* Meridian Estate — Corporate Sophistication Design System */

:root {
  --color-navy: #163A70;
  --color-navy-dark: #0f2a52;
  --color-gold: #C9A962;
  --color-gold-light: #E8D5A3;
  --color-surface: #F0F4F8;
  --color-white: #ffffff;
  --shadow-float-sm: 0 4px 20px rgba(22, 58, 112, 0.06),
    0 12px 40px rgba(22, 58, 112, 0.08);
  --shadow-float-md: 0 8px 32px rgba(22, 58, 112, 0.08),
    0 24px 64px rgba(22, 58, 112, 0.12);
  --shadow-float-lg: 0 12px 48px rgba(22, 58, 112, 0.1),
    0 32px 80px rgba(22, 58, 112, 0.16);
  --shadow-float-xl: 0 20px 60px rgba(22, 58, 112, 0.12),
    0 48px 100px rgba(22, 58, 112, 0.2);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

html {
  scroll-behavior: smooth;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--color-surface);
}

::selection {
  background-color: rgba(22, 58, 112, 0.15);
  color: #163A70;
}

/* ── Floating Cards ── */
.float-card {
  background: var(--color-white);
  border-radius: 1.25rem;
  box-shadow: var(--shadow-float-md);
  transition: transform 0.5s var(--ease-out-expo),
    box-shadow 0.5s var(--ease-out-expo);
}

.float-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-float-lg);
}

.float-card--elevated {
  box-shadow: var(--shadow-float-lg);
}

.float-card--hero {
  box-shadow: var(--shadow-float-xl);
}

/* Depth layers */
.layer-back {
  position: relative;
  z-index: 1;
}

.layer-mid {
  position: relative;
  z-index: 10;
}

.layer-front {
  position: relative;
  z-index: 20;
}

/* Glass morphism */
.glass-light {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: var(--shadow-float-xl);
}

.glass {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

/* ── Hero: Centered Photo + Overlapping Search ── */
.hero-meridian {
  position: relative;
  padding-top: 5rem;
  padding-bottom: 0;
  overflow: visible;
}

.hero-photo-wrap {
  position: relative;
  max-width: 56rem;
  margin: 0 auto;
  border-radius: 1.5rem;
  overflow: hidden;
  box-shadow: var(--shadow-float-lg);
  aspect-ratio: 16 / 9;
}

.hero-photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-photo-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(15, 42, 82, 0.15) 0%,
    rgba(15, 42, 82, 0.45) 100%
  );
  pointer-events: none;
}

.hero-search-overlap {
  position: relative;
  z-index: 20;
  max-width: 52rem;
  margin: -4rem auto 0;
  padding: 0 1.5rem;
}

@media (min-width: 768px) {
  .hero-search-overlap {
    margin-top: -5.5rem;
  }
}

@media (min-width: 1024px) {
  .hero-search-overlap {
    margin-top: -6.5rem;
  }
}

/* ── Geometric Decorations ── */
.geo-shape {
  position: absolute;
  pointer-events: none;
  z-index: 0;
}

.geo-shape--circle {
  border-radius: 50%;
  border: 2px solid rgba(201, 169, 98, 0.25);
}

.geo-shape--ring {
  border-radius: 50%;
  border: 1px solid rgba(22, 58, 112, 0.12);
}

.geo-shape--diamond {
  transform: rotate(45deg);
  border: 2px solid rgba(201, 169, 98, 0.2);
  background: rgba(201, 169, 98, 0.04);
}

.geo-shape--line {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(22, 58, 112, 0.15),
    transparent
  );
}

.geo-shape--grid {
  background-image: linear-gradient(
      rgba(22, 58, 112, 0.04) 1px,
      transparent 1px
    ),
    linear-gradient(90deg, rgba(22, 58, 112, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* Navbar scroll state */
.navbar-scrolled {
  background: rgba(255, 255, 255, 0.94) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: var(--shadow-float-sm);
}

.navbar-scrolled .nav-link {
  color: #1a1a1a !important;
}

.navbar-scrolled .nav-link:hover {
  color: var(--color-navy) !important;
}

.navbar-scrolled .logo-text {
  color: var(--color-navy) !important;
}

.navbar-scrolled .hamburger-line {
  background-color: #1a1a1a;
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.8s var(--ease-out-expo),
    transform 0.8s var(--ease-out-expo);
}

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

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.8s var(--ease-out-expo),
    transform 0.8s var(--ease-out-expo);
}

.reveal-left.revealed {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.8s var(--ease-out-expo),
    transform 0.8s var(--ease-out-expo);
}

.reveal-right.revealed {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.7s var(--ease-out-expo),
    transform 0.7s var(--ease-out-expo);
}

.reveal-scale.revealed {
  opacity: 1;
  transform: scale(1);
}

.delay-100 { transition-delay: 100ms; }
.delay-200 { transition-delay: 200ms; }
.delay-300 { transition-delay: 300ms; }
.delay-400 { transition-delay: 400ms; }
.delay-500 { transition-delay: 500ms; }

/* Property card */
.property-card {
  transition: transform 0.5s var(--ease-out-expo),
    box-shadow 0.5s var(--ease-out-expo);
  box-shadow: var(--shadow-float-sm);
}

.property-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-float-lg);
}

.property-card .property-image {
  transition: transform 0.7s var(--ease-out-expo);
}

.property-card:hover .property-image {
  transform: scale(1.06);
}

/* Ripple effect */
.ripple-btn {
  position: relative;
  overflow: hidden;
}

.ripple-btn .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transform: scale(0);
  animation: ripple-animation 0.6s linear;
  pointer-events: none;
}

@keyframes ripple-animation {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* Gold accent line */
.gold-line {
  width: 48px;
  height: 2px;
  background: linear-gradient(90deg, var(--color-gold), var(--color-gold-light));
}

/* Section separator */
.section-divider {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(22, 58, 112, 0.12),
    transparent
  );
}

/* Counter */
.counter-value {
  font-variant-numeric: tabular-nums;
}

/* Carousel */
.carousel-track {
  display: flex;
  transition: transform 0.6s var(--ease-out-expo);
}

.carousel-slide {
  flex: 0 0 100%;
}

@media (min-width: 768px) {
  .carousel-slide {
    flex: 0 0 50%;
  }
}

@media (min-width: 1024px) {
  .carousel-slide {
    flex: 0 0 33.333%;
  }
}

/* Testimonial slider */
.testimonial-track {
  display: flex;
  transition: transform 0.7s var(--ease-out-expo);
}

.testimonial-slide {
  flex: 0 0 100%;
}

@media (min-width: 768px) {
  .testimonial-slide {
    flex: 0 0 50%;
  }
}

@media (min-width: 1024px) {
  .testimonial-slide {
    flex: 0 0 33.333%;
  }
}

/* Timeline */
.timeline-line {
  background: linear-gradient(
    90deg,
    var(--color-navy),
    var(--color-gold),
    var(--color-navy)
  );
  height: 2px;
}

.timeline-step.active .timeline-icon {
  background: var(--color-navy);
  color: white;
  box-shadow: 0 0 0 4px rgba(22, 58, 112, 0.15),
    var(--shadow-float-sm);
}

/* Map placeholder */
.map-container {
  background: linear-gradient(135deg, #e4eaf2 0%, #d0dae8 100%);
  position: relative;
  overflow: hidden;
}

.map-pin {
  animation: pin-bounce 2s ease-in-out infinite;
}

@keyframes pin-bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

/* Mobile menu */
.mobile-menu {
  transform: translateX(100%);
  transition: transform 0.4s var(--ease-out-expo);
}

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

.hamburger-line {
  transition: transform 0.3s var(--ease-out-expo), opacity 0.3s;
}

.hamburger.active .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.hamburger.active .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Form focus glow */
.form-input:focus {
  box-shadow: 0 0 0 3px rgba(22, 58, 112, 0.12);
}

/* Hero parallax */
.hero-bg {
  will-change: transform;
}

/* Loading fade */
.page-loader {
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.hidden {
  opacity: 0;
  visibility: hidden;
}

/* Hover glow on buttons */
.btn-glow:hover {
  box-shadow: 0 8px 32px rgba(22, 58, 112, 0.25);
}

.btn-gold-glow:hover {
  box-shadow: 0 8px 32px rgba(201, 169, 98, 0.35);
}

/* Feature card */
.feature-card {
  transition: transform 0.4s var(--ease-out-expo),
    box-shadow 0.4s var(--ease-out-expo);
  box-shadow: var(--shadow-float-sm);
}

.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-float-md);
}

.feature-card:hover .feature-icon {
  transform: scale(1.08);
}

.feature-icon {
  transition: transform 0.4s var(--ease-spring);
}

/* Stats floating cards */
.stat-card {
  box-shadow: var(--shadow-float-md);
  transition: transform 0.4s var(--ease-out-expo),
    box-shadow 0.4s var(--ease-out-expo);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-float-lg);
}

/* Section depth backgrounds */
.section-layered {
  position: relative;
  isolation: isolate;
}

.section-layered::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--color-white);
  z-index: -1;
  border-radius: 0;
}

/* Reduced motion */
@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,
  .reveal-left,
  .reveal-right,
  .reveal-scale {
    opacity: 1;
    transform: none;
  }

  .float-card:hover,
  .property-card:hover,
  .feature-card:hover,
  .stat-card:hover {
    transform: none;
  }
}
