/* ======================================= */
/* Premium Reset & Variables */
/* ======================================= */

:root {
  --primary-white: #FFFFFF;
  --secondary-bg: #F8FAFC;
  /* Frosty gray */
  --primary-dark-blue: #0A192F;
  /* Premium tech navy */
  --secondary-blue: #112240;
  --accent-green: #059669;
  /* Emerald premium */
  --accent-green-hover: #10B981;
  --text-light: #64748b;
  /* Muted secondary text */

  --heading-font: 'Outfit', sans-serif;
  --body-font: 'Plus Jakarta Sans', sans-serif;

  --transition-smooth: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Prevent horizontal scroll from absolutely-positioned decorative elements */
html {
  overflow-x: hidden;
}

body {
  font-family: var(--body-font);
  color: #334155;
  /* Slate color for premium readability */
  background-color: var(--secondary-bg);
  line-height: 1.6;
  overflow-x: hidden;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

/* ======================================= */
/* Typography */
/* ======================================= */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--heading-font);
  font-weight: 800;
  line-height: 1.1;
  color: var(--primary-dark-blue);
  margin-bottom: 1.2rem;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(3rem, 6vw, 5rem);
}

h2 {
  font-size: clamp(2.2rem, 4vw, 3.5rem);
}

.heading-white {
  color: var(--primary-white);
}

h3 {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 600;
}

h4 {
  font-size: 1.25rem;
  font-weight: 600;
}

p {
  margin-bottom: 1.5rem;
  font-size: 1.125rem;
}

/* ======================================= */
/* Seamless Transitions & Interaction */
/* ======================================= */
/* Wrapping block for JS to fade */
.fade-wrapper {
  opacity: 0;
  transform: translateY(15px);
  animation: pageFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.fade-wrapper.fade-out {
  opacity: 0;
  transform: translateY(-15px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

@keyframes pageFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scroll Reveals */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: var(--transition-smooth);
}

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

/* Base Link */
a {
  color: var(--accent-green);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--accent-green-hover);
}

/* ======================================= */
/* Layout & Density */
/* ======================================= */
.container {
  max-width: 1700px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section {
  padding: 6rem 0;
}

.dense-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2.5rem;
  margin-top: 3rem;
}

.dense-grid>* {
  flex: 1 1 320px;
  max-width: 480px;
}

/* Center content inside plain .card children of dense-grid */
.dense-grid>.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.dense-grid>.card p {
  font-weight: 600;
  margin-bottom: 0;
}

.crowded-flex {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 2.5rem;
}

.text-center {
  text-align: center;
}

/* Buttons  */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2.5rem;
  background-color: var(--accent-green);
  color: var(--primary-white);
  border-radius: 50px;
  font-weight: 600;
  font-family: var(--body-font);
  font-size: 1.1rem;
  border: none;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: 0 10px 25px rgba(5, 150, 105, 0.3);
}

.btn:hover {
  background-color: var(--accent-green-hover);
  transform: translateY(-4px);
  box-shadow: 0 15px 35px rgba(5, 150, 105, 0.4);
  color: white;
}

.btn-secondary {
  background-color: var(--primary-white);
  color: var(--primary-dark-blue);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
  background-color: var(--primary-dark-blue);
  color: var(--primary-white);
  box-shadow: 0 15px 35px rgba(10, 25, 47, 0.2);
}

/* ======================================= */
/* Glassmorphism Header */
/* ======================================= */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 1000;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  transition: var(--transition-smooth);
}

.header.scrolled {
  padding: 0.5rem 0;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--heading-font);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary-dark-blue);
  white-space: nowrap; /* prevent name wrapping to second line */
}

.brand-logo {
  height: 4rem; /* slightly larger on desktop */
  width: auto;
}

/* Hamburger button — hidden on desktop, shown on mobile */
.nav-toggle {
  display: none;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 2.5rem;
  align-items: center;
}

.nav-link {
  color: #64748B;
  font-weight: 600;
  font-size: 1rem;
  position: relative;
  padding: 0.5rem 0;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-green);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s cubic-bezier(0.86, 0, 0.07, 1);
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary-dark-blue);
}

.nav-link:hover::after,
.nav-link.active::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* ======================================= */
/* Hero Section */
/* ======================================= */
.hero {
  background-color: var(--primary-dark-blue);
  background-image: linear-gradient(rgba(10, 25, 47, 0.70), rgba(10, 25, 47, 0.90)), url('https://images.unsplash.com/photo-1600585154340-be6161a56a0c?w=1920&h=1080&fit=crop');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  padding: 14rem 0 10rem;
  position: relative;
}

/* Abstract premium shapes behind hero */
.hero::before {
  content: '';
  position: absolute;
  top: -10%;
  right: -5%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.1) 0%, rgba(255, 255, 255, 0) 70%);
  border-radius: 50%;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 900px;
}

.hero h1 {
  color: var(--primary-white);
  margin-bottom: 1.5rem;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.hero p {
  color: #E2E8F0;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}


/* ======================================= */
/* Premium Cards */
/* ======================================= */
.bg-light {
  background-color: var(--primary-white);
}

.bg-dark {
  background-color: var(--primary-dark-blue);
  color: var(--primary-white);
}

.bg-dark h2,
.bg-dark h3,
.bg-dark p {
  color: var(--primary-white);
}

.card {
  background: var(--primary-white);
  border-radius: 16px;
  padding: 3rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.02);
  transition: var(--transition-smooth);
}

/* Lift on hover — exclude flip-card faces so they don't fight the flip animation */
.card:not(.flip-card-front):not(.flip-card-back):hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
}

.card h3 {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.card h3 i {
  color: var(--accent-green);
  font-size: 1.8rem;
}

/* Property Cards */
.property-card {
  background: var(--primary-white);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
  transition: var(--transition-smooth);
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.property-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.1);
}

.property-img-wrap {
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.property-img {
  height: 240px;
  width: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.8s ease;
}

.property-card:hover .property-img {
  transform: scale(1.05);
}

/* Photo count badge (e.g. "📷 4") */
.card-img-count {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(10, 25, 47, 0.65);
  backdrop-filter: blur(4px);
  color: white;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 50px;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.property-info {
  padding: 1.25rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.property-price {
  font-family: var(--heading-font);
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--accent-green);
  margin-bottom: 0.3rem;
}

.property-card-title {
  font-size: 1.05rem !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
  margin-bottom: 0.4rem !important;
  color: var(--primary-dark-blue);
}

.property-loc {
  font-size: 0.875rem;
  color: var(--text-light);
  margin-bottom: 0 !important;
  flex: 1;
}

.property-loc i {
  color: var(--accent-green);
  margin-right: 4px;
}

.property-view-hint {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-green);
  margin-top: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  opacity: 0.8;
  transition: opacity 0.2s, gap 0.2s;
}

.property-card:hover .property-view-hint {
  opacity: 1;
  gap: 0.55rem;
}

/* ======================================= */
/* UI Elements & Forms */
/* ======================================= */
.contact-form {
  background: var(--primary-white);
  padding: 3.5rem;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.05);
}

.form-group {
  margin-bottom: 2rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.8rem;
  color: var(--primary-dark-blue);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 1.2rem 1.5rem;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  font-family: var(--body-font);
  font-size: 1rem;
  background: #F8FAFC;
  transition: var(--transition-smooth);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-green);
  background: var(--primary-white);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

/* ======================================= */
/* Footer */
/* ======================================= */
.footer {
  background-color: var(--primary-dark-blue);
  color: #94A3B8;
  padding: 6rem 0 3rem;
  position: relative;
  overflow: hidden;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-green) 0%, #34D399 100%);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 4rem;
  margin-bottom: 4rem;
}

.footer h3 {
  color: var(--primary-white);
  font-size: 1.5rem;
}

.footer ul {
  list-style: none;
}

.footer ul li {
  margin-bottom: 1rem;
}

.footer a {
  color: #94A3B8;
  transition: var(--transition-smooth);
}

.footer a:hover {
  color: var(--primary-white);
  padding-left: 5px;
}

.copyright {
  text-align: center;
  padding-top: 3rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.9rem;
}

/* ======================================= */
/* Responsive */
/* ======================================= */
@media (max-width: 768px) {
  /* Hero fixes */
  .hero {
    padding: 8rem 0 5rem;
    background-attachment: scroll;
  }

  .hero::before {
    display: none;
  }

  /* Header — logo left, hamburger right */
  .header {
    padding: 0.75rem 1rem;
  }

  /* Collapse the <nav> wrapper to 0 width so the logo and hamburger
     are the only two visible flex children — keeps logo at the far left */
  nav {
    flex: 0 0 0;
    overflow: hidden;
  }

  .nav-container {
    justify-content: flex-start;
  }

  /* Shrink logo text so it never wraps */
  .logo {
    font-size: 1.1rem;
    gap: 0.5rem;
  }

  .brand-logo {
    height: 3rem;
  }

  /* ---- Hamburger button (single merged block) ---- */
  .nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    z-index: 1100;
    margin-left: auto; /* push to far right */
  }

  .nav-toggle span {
    display: block;
    width: 26px;
    height: 2.5px;
    background: var(--primary-dark-blue);
    border-radius: 2px;
    transition: all 0.3s ease;
  }

  /* Animate to X when menu is open */
  .nav-toggle.open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
  .nav-toggle.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
  .nav-toggle.open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

  /* ---- Full-screen mobile menu overlay ---- */
  .nav-menu {
    display: none;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    background: white;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
    z-index: 1050;
  }

  .nav-menu.open {
    display: flex;
  }

  .nav-link {
    font-size: 1.5rem;
  }

  /* ---- Dense grid: stack to single column ---- */
  .dense-grid > * {
    flex: 1 1 100%;
    max-width: 100%;
  }

  .card {
    padding: 2rem;
  }

  /* ---- Flip cards: no 3D flip on mobile — simple tap-to-reveal instead ---- */
  .flip-card {
    flex: 1 1 100%;
    height: auto !important;
    perspective: none;
    overflow: visible !important;
  }

  .flip-card-inner {
    transform: none !important;
    transform-style: flat;
    transition: none;
    position: static !important;
    height: auto !important;
    overflow: visible !important;
  }

  /* Front face: show by default on mobile */
  .flip-card-front {
    position: static !important;
    transform: none !important;
    height: auto !important;
    overflow: visible !important;
    padding: 2rem;
  }

  /* Back face: hidden by default, revealed on tap */
  .flip-card-back {
    display: none;
    position: static !important;
    transform: none !important;
    height: auto !important;
    overflow: visible !important;
    padding: 2rem;
  }

  /* When JS adds .flipped: swap front out, back in */
  .flip-card.flipped .flip-card-front {
    display: none;
  }

  .flip-card.flipped .flip-card-back {
    display: block;
  }

  /* Neutralise all 3D flip triggers */
  .flip-card:hover .flip-card-inner,
  .flip-card.flipped .flip-card-inner {
    transform: none !important;
  }

  /* Contact form */
  .contact-form {
    padding: 2rem 1.5rem;
  }
}

/* Dark section card fix */
.bg-dark .card {
  background: rgba(255, 255, 255, 0.05);
  /* glass effect */
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: none;
}

.bg-dark .card p {
  color: #CBD5F5;
  /* softer readable text */
}

.bg-dark .card h3 {
  color: #FFFFFF;
}

.flip-card {
  background: transparent;
  width: 100%;
  height: 320px;
  perspective: 1000px;
  flex: 1 1 400px;
  transition: transform 0.3s ease;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.7s ease;
  transform-style: preserve-3d;
}

/* Flip on hover (desktop) */
.flip-card:hover .flip-card-inner {
  transform: rotateY(180deg);
}

/* Front & Back shared */
.flip-card-front,
.flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 12px;
  padding: 30px;
  overflow: hidden;
}

/* Front Style */
.flip-card-front {
  background: white;
}

/* Back Style */
.flip-card-back {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  /* dark luxury tone */
  color: white;
  transform: rotateY(180deg);
}

.flip-card-back ul {
  padding-left: 20px;
}

.flip-card-back li {
  margin-bottom: 8px;
}

/* Mobile: flip on click via JS .flipped class */
.flip-card.flipped .flip-card-inner {
  transform: rotateY(180deg);
}

/* ======================================= */
/* Property Detail Overlay                 */
/* ======================================= */
#prop-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 3000;
}

#prop-overlay.open {
  display: block;
}

.pov-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 25, 47, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.pov-card {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--primary-white);
  border-radius: 20px;
  width: 92%;
  max-width: 1000px;
  max-height: 88vh;
  overflow: hidden;
  display: flex;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

/* Gallery (left panel) */
.pov-gallery {
  position: relative;
  flex: 0 0 52%;
  background: #0A192F;
  overflow: hidden;
}

#pov-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pov-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(4px);
  border: none;
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: background 0.2s;
  z-index: 2;
}

.pov-nav:hover { background: rgba(255, 255, 255, 0.3); }
.pov-prev { left: 14px; }
.pov-next { right: 14px; }

.pov-dots {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 7px;
  z-index: 2;
}

.pov-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transition: background 0.2s, transform 0.2s;
  cursor: pointer;
}

.pov-dot.active {
  background: white;
  transform: scale(1.3);
}

.pov-counter {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(0, 0, 0, 0.45);
  color: white;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 50px;
  z-index: 2;
}

/* Close button */
.pov-close {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 10;
  background: rgba(0, 0, 0, 0.45);
  border: none;
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.2s;
}

.pov-close:hover { background: rgba(0, 0, 0, 0.7); }

/* Details (right panel) */
.pov-details {
  flex: 1;
  overflow-y: auto;
  padding: 2.5rem 2.25rem;
  display: flex;
  flex-direction: column;
}

.pov-price {
  font-family: var(--heading-font);
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent-green);
  margin-bottom: 0.4rem;
}

.pov-title {
  font-size: 1.5rem !important;
  color: var(--primary-dark-blue);
  margin-bottom: 0.6rem !important;
  line-height: 1.25 !important;
}

.pov-location {
  color: var(--text-light);
  font-size: 0.95rem;
  margin-bottom: 1.25rem !important;
}

.pov-location i {
  color: var(--accent-green);
  margin-right: 5px;
}

.pov-desc {
  color: #475569;
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 1.25rem !important;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid #F1F5F9;
}

.pov-features {
  list-style: none;
  margin-bottom: 1.75rem !important;
  flex: 1;
}

.pov-features li {
  padding: 0.55rem 0;
  border-bottom: 1px solid #F8FAFC;
  font-size: 0.92rem;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0;
}

.pov-features li i {
  color: var(--accent-green);
  font-size: 0.8rem;
  flex-shrink: 0;
}

.pov-cta {
  width: 100%;
  justify-content: center;
  border-radius: 12px;
  margin-top: auto;
}

/* ── Overlay responsive ── */
@media (max-width: 768px) {
  .pov-card {
    flex-direction: column;
    top: auto;
    bottom: 0;
    left: 0;
    transform: none;
    width: 100%;
    max-width: 100%;
    max-height: 92vh;
    border-radius: 20px 20px 0 0;
  }

  .pov-gallery {
    flex: 0 0 250px;
    height: 250px;
  }

  .pov-details {
    padding: 1.5rem;
  }

  .pov-price { font-size: 1.6rem; }
  .pov-title { font-size: 1.2rem !important; }
}