/* ========================================
   PropertyVault — Global Styles
   ======================================== */

:root {
  /* Colors */
  --navy: #0F2B3C;
  --navy-light: #1A3A4F;
  --navy-lighter: #234B63;
  --teal: #3FBFA0;
  --teal-dark: #2E9A80;
  --teal-light: #5DD4B8;
  --teal-glow: rgba(63, 191, 160, 0.15);
  --white: #FFFFFF;
  --gray-50: #F8FAFB;
  --gray-100: #F0F4F6;
  --gray-200: #E2E8ED;
  --gray-300: #C8D3DB;
  --gray-400: #94A3B0;
  --gray-500: #6B7D8A;
  --gray-600: #4A5D6A;
  --gray-700: #2D3E4A;
  --text-primary: #0F2B3C;
  --text-secondary: #4A5D6A;
  --text-muted: #94A3B0;
  --text-light: #C8D3DB;
  --bg-dark: #0B1F2C;
  --bg-darker: #071520;
  --success: #22C55E;
  --warning: #F59E0B;
  --error: #EF4444;

  /* Typography */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Space Grotesk', 'Inter', sans-serif;

  /* Spacing */
  --section-pad: 100px;
  --container-max: 1200px;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --duration: 0.3s;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(15, 43, 60, 0.08);
  --shadow-md: 0 4px 12px rgba(15, 43, 60, 0.1);
  --shadow-lg: 0 12px 40px rgba(15, 43, 60, 0.12);
  --shadow-xl: 0 20px 60px rgba(15, 43, 60, 0.15);
  --shadow-glow: 0 0 30px rgba(63, 191, 160, 0.2);

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

/* ========== RESET ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { font-family: var(--font-body); color: var(--text-primary); background: var(--white); line-height: 1.6; overflow-x: hidden; }
img, svg { display: block; max-width: 100%; }
a { text-decoration: none; color: inherit; transition: color var(--duration) var(--ease); }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
ul, ol { list-style: none; }

/* ========== LAYOUT ========== */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: var(--section-pad) 0;
}

.section-white { background: var(--white); }
.section-light { background: var(--gray-50); }
.section-dark { background: var(--navy); }

/* ========== TYPOGRAPHY ========== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
}

.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 60px;
}

.section-tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--teal);
  margin-bottom: 16px;
  padding: 6px 16px;
  background: var(--teal-glow);
  border-radius: 100px;
}

.section-tag-light {
  color: var(--teal-light);
  background: rgba(63, 191, 160, 0.1);
}

.section-title {
  font-size: clamp(2rem, 4vw, 2.8rem);
  color: var(--text-primary);
  margin-bottom: 20px;
}

.section-title-light { color: var(--white); }

.section-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.section-subtitle-light { color: var(--gray-400); }

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

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  transition: all var(--duration) var(--ease);
  white-space: nowrap;
}

.btn-lg {
  padding: 16px 32px;
  font-size: 1.05rem;
  border-radius: var(--radius-md);
}

.btn-primary {
  background: var(--teal);
  color: var(--navy);
  font-weight: 700;
}

.btn-primary:hover {
  background: var(--teal-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.btn-ghost {
  background: transparent;
  color: var(--navy);
  border: 2px solid var(--gray-200);
}

.btn-ghost:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.btn-ghost-light {
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(255, 255, 255, 0.25);
}

.btn-ghost-light:hover {
  border-color: var(--teal);
  color: var(--teal);
}

/* ========== HERO BACKGROUNDS (shared across pages) ========== */
.page-hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, var(--bg-darker) 0%, var(--navy) 40%, var(--navy-light, #163B52) 100%);
  pointer-events: none;
}

.page-hero-gradient {
  position: absolute;
  top: -200px;
  right: -200px;
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(63, 191, 160, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.page-hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(63, 191, 160, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(63, 191, 160, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

/* ========== NAVIGATION ========== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(15, 43, 60, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(63, 191, 160, 0.1);
  transition: all var(--duration) var(--ease);
}

.nav-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 10;
}

.nav-logo-text {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--white);
}

.nav-logo-accent { color: var(--teal); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray-300);
  transition: color var(--duration) var(--ease);
}

.nav-link:hover { color: var(--white); }

.nav-link-highlight {
  color: var(--white);
  font-weight: 600;
}

.nav-link-highlight:hover { color: var(--teal); }

/* Active page indicator — desktop */
.nav-link.nav-current {
  color: var(--teal);
  position: relative;
}

.nav-link.nav-current::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--teal);
  border-radius: 1px;
}

.nav-dropdown-menu a.nav-current {
  color: var(--teal) !important;
  font-weight: 600;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-btn-ghost {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray-300);
  padding: 8px 16px;
  transition: color var(--duration) var(--ease);
}

.nav-btn-ghost:hover { color: var(--white); }

.nav-btn-primary {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--navy);
  background: var(--teal);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  transition: all var(--duration) var(--ease);
}

.nav-btn-primary:hover {
  background: var(--teal-dark);
  transform: translateY(-1px);
}

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  z-index: 10;
  cursor: pointer;
  background: none;
  border: none;
}

.nav-hamburger span {
  width: 24px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: all var(--duration) var(--ease);
}

/* Hamburger X animation */
.nav-hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.nav-hamburger.active span:nth-child(2) {
  opacity: 0;
}
.nav-hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Lock body scroll when menu open */
body.menu-open {
  overflow: hidden;
}

/* When menu is open, expand nav to full screen and remove backdrop-filter
   (backdrop-filter creates a containing block that breaks position:fixed on children) */
body.menu-open .nav {
  height: 100vh;
  height: 100dvh;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: var(--navy);
}

/* ========== FOOTER ========== */
.footer {
  background: var(--bg-dark);
  padding: 60px 0 30px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.footer-logo-text {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--white);
}

.footer-tagline {
  font-size: 0.9rem;
  color: var(--gray-500);
  line-height: 1.6;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col-title {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-400);
  margin-bottom: 4px;
}

.footer-link {
  font-size: 0.9rem;
  color: var(--gray-500);
  transition: color var(--duration) var(--ease);
}

.footer-link:hover { color: var(--teal); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.8rem;
  color: var(--gray-600);
}

.footer-patent {
  color: var(--gray-500);
  font-weight: 500;
}

.footer-credit {
  color: var(--gray-500);
  font-size: 0.8rem;
  margin-top: 0.5rem;
  letter-spacing: 0.02em;
}

/* ========== ANIMATIONS & POLISH ========== */

/* Scroll animations */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.animate-in {
  opacity: 1;
  transform: translateY(0);
}

/* Better link underline animation */
.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--teal);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Subtle gradient border effect for cards on hover */
.card-glow:hover {
  box-shadow: 0 0 0 1px rgba(63, 191, 160, 0.3), 0 12px 40px rgba(15, 43, 60, 0.12);
}

/* Better button press effect */
.btn:active {
  transform: translateY(0) scale(0.98);
}

/* Selection color */
::selection {
  background: rgba(63, 191, 160, 0.25);
  color: var(--navy);
}

/* Smooth focus styles for accessibility */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Loading/skeleton placeholder utility */
@keyframes shimmer {
  0% { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}

.skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-50) 50%, var(--gray-100) 75%);
  background-size: 2000px 100%;
  animation: shimmer 2s infinite;
  border-radius: var(--radius-sm);
}

/* Scrollbar styling for webkit */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--gray-50);
}

::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

/* ========== NAV DROPDOWN ========== */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-trigger {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray-300);
  transition: color var(--duration) var(--ease);
  cursor: pointer;
}

.nav-dropdown-trigger:hover { color: var(--white); }

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  min-width: 200px;
  background: var(--navy);
  border: 1px solid rgba(63, 191, 160, 0.15);
  border-radius: var(--radius-md);
  padding: 8px 0;
  padding-top: 20px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.3);
  z-index: 100;
}

/* Invisible bridge so mouse can travel from trigger to menu */
.nav-dropdown-menu::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 20px;
}

.nav-dropdown:hover .nav-dropdown-menu {
  display: block;
}

.nav-dropdown-menu a {
  display: block;
  padding: 10px 20px;
  font-size: 0.9rem;
  color: var(--gray-300);
  transition: all 0.15s ease;
}

.nav-dropdown-menu a:hover {
  background: rgba(63,191,160,0.08);
  color: var(--teal);
}

/* Mobile menu section headers */
.nav-mobile-section {
  display: none;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 968px) {
  :root { --section-pad: 70px; }

  .nav-links, .nav-actions { display: none; }
  .nav-hamburger { display: flex; }

  /* Dropdown becomes flat list on mobile */
  .nav-dropdown-trigger { display: none; }
  .nav-dropdown-menu {
    display: contents;
    position: static;
    transform: none;
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 0;
    min-width: auto;
  }

  .nav-dropdown-menu a {
    padding: 0;
    font-size: 1.2rem;
    font-weight: 500;
  }

  .nav-mobile-section {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--teal);
    opacity: 0.5;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 2px;
    text-align: left;
    width: 100%;
  }

  /* First section header — "For Professionals" inside the dropdown */
  .nav-links.active .nav-mobile-section:first-of-type {
    margin-top: 12px;
  }

  .nav-links.active {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    position: absolute !important;
    top: 72px;
    left: 0;
    right: 0;
    bottom: 110px;
    background: var(--navy);
    padding: 20px 32px;
    gap: 4px;
    z-index: 5;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .nav-links.active .nav-link {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--gray-300);
    padding: 10px 0;
    transition: color 0.15s ease;
    text-align: left;
    width: 100%;
  }

  .nav-links.active .nav-link:hover {
    color: var(--white);
  }

  /* Dropdown links in mobile menu */
  .nav-links.active .nav-dropdown-menu a {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--gray-300);
    padding: 10px 0;
    text-align: left;
  }

  /* Active page indicator in mobile menu */
  .nav-links.active .nav-link.nav-current {
    color: var(--teal);
    font-weight: 700;
  }

  .nav-links.active .nav-dropdown-menu a.nav-current {
    color: var(--teal);
    font-weight: 700;
  }

  .nav-actions.active {
    display: flex !important;
    flex-direction: column !important;
    position: absolute !important;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 5;
    gap: 10px;
    padding: 20px 30px;
    padding-bottom: max(20px, env(safe-area-inset-bottom));
    background: var(--navy);
    border-top: 1px solid rgba(63,191,160,0.15);
  }

  .nav-actions.active .nav-btn-primary,
  .nav-actions.active .nav-btn-ghost {
    display: block;
    text-align: center;
    padding: 16px;
    font-size: 1rem;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }

  .footer-brand { grid-column: 1 / -1; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
}

@media (max-width: 640px) {
  :root { --section-pad: 50px; }

  .footer-grid { grid-template-columns: 1fr; }
}
