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

body {
  overflow-x: hidden;
}

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

/* ===== Scroll Reveal ===== */
.scroll-reveal {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.scroll-reveal[data-reveal-state="hidden"] {
  opacity: 0;
  transform: translateY(40px);
}

/* Only animate when user hasn't opted out of motion */
@media (prefers-reduced-motion: no-preference) {
  .scroll-reveal {
    opacity: 0;
    transform: translateY(40px);
  }

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

/* ===== Navbar ===== */
#navbar {
  background: transparent;
  transition: background 0.4s ease, box-shadow 0.4s ease, backdrop-filter 0.4s ease;
}

#navbar.scrolled {
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* ===== Mobile Menu ===== */
#mobileMenu {
  animation: slideDown 0.3s ease forwards;
}

#mobileMenu.hidden {
  animation: slideUp 0.25s ease forwards;
}

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

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

/* ===== Button Micro-interactions ===== */
a, button {
  -webkit-tap-highlight-color: transparent;
}

/* ===== Form Styles ===== */
input:focus,
select:focus,
textarea:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

/* ===== Image Lazy Load Fallback ===== */
img {
  transition: opacity 0.3s ease;
}

img[loading="lazy"] {
  opacity: 1;
}

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

::-webkit-scrollbar-track {
  background: #0f172a;
}

::-webkit-scrollbar-thumb {
  background: #14b8a6;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #2dd4bf;
}

/* ===== Selection ===== */
::-moz-selection {
  background: #0d9488;
  color: white;
}
::selection {
  background: #0d9488;
  color: white;
}

/* ===== Service Card Hover Glow ===== */
.group:hover .group-hover\:bg-teal-800 {
  box-shadow: 0 0 30px rgba(13, 148, 136, 0.3);
}

/* ===== Gradient Text Fallback ===== */
.font-serif em {
  font-style: italic;
}

/* ===== Smooth Anchor Scrolling Offset ===== */
[id] {
  scroll-margin-top: 80px;
}

/* ===== Print Styles ===== */
@media print {
  nav, #contactForm, .scroll-reveal { display: none; }
  body { color: #000; background: #fff; }
}
