/* ============================================
   Darryl Grimaldi – The Real Estate Guy
   Custom Styles
   ============================================ */

/* --- Base & Typography --- */
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  overflow-x: hidden;
}

::selection {
  background-color: #0d9488;
  color: white;
}

/* --- Scroll Reveal Animations --- */
.reveal {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal[data-delay="1"] { transition-delay: 0.1s; }
.reveal[data-delay="2"] { transition-delay: 0.2s; }
.reveal[data-delay="3"] { transition-delay: 0.3s; }
.reveal[data-delay="4"] { transition-delay: 0.4s; }

/* Hidden state — applied via JS for progressive enhancement */
.js-enabled .reveal-hidden {
  opacity: 0;
  transform: translateY(32px);
}

.js-enabled .reveal-hidden.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal-hidden { opacity: 1 !important; transform: none !important; }
  .reveal-hidden.revealed { opacity: 1 !important; transform: none !important; }
}

/* --- Navbar --- */
#navbar.scrolled {
  background-color: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06), 0 4px 20px rgba(0, 0, 0, 0.06);
}

#navbar.scrolled .font-serif {
  color: #0f172a;
}

#navbar.scrolled .menu-line {
  background-color: #0f172a;
}

/* --- Mobile Menu --- */
#mobile-menu.open {
  opacity: 1;
  pointer-events: all;
}

#mobile-menu.open .mobile-link {
  animation: fadeDown 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
}

#mobile-menu.open .mobile-link:nth-child(1) { animation-delay: 0.05s; }
#mobile-menu.open .mobile-link:nth-child(2) { animation-delay: 0.1s; }
#mobile-menu.open .mobile-link:nth-child(3) { animation-delay: 0.15s; }
#mobile-menu.open .mobile-link:nth-child(4) { animation-delay: 0.2s; }
#mobile-menu.open .mobile-link:nth-child(5) { animation-delay: 0.25s; }

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Menu Toggle Animation --- */
.menu-toggle-active .menu-line:nth-child(1) {
  transform: rotate(45deg) translate(4px, 4px);
}

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

.menu-toggle-active .menu-line:nth-child(3) {
  width: 20px;
  transform: rotate(-45deg) translate(4px, -4px);
}

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

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* --- Focus Styles --- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #0d9488;
  outline-offset: 2px;
  border-radius: 4px;
}

/* --- Stats Counter Animation --- */
@keyframes countUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.stat-item {
  animation: countUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.stat-item:nth-child(1) { animation-delay: 0s; }
.stat-item:nth-child(2) { animation-delay: 0.1s; }
.stat-item:nth-child(3) { animation-delay: 0.2s; }
.stat-item:nth-child(4) { animation-delay: 0.3s; }

/* --- Image Hover --- */
.group:hover .group-hover\:scale-110 {
  transform: scale(1.1);
}
