/* ─── Reset & Base ─── */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  overflow-x: hidden;
}

::selection {
  background: rgba(143, 200, 184, 0.25);
  color: #061526;
}

/* ─── Animations ─── */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-up {
  animation: fadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* ─── Scroll-triggered reveals ─── */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

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

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* ─── Navigation ─── */
.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: #6fb5a0;
  transition: width 0.3s ease;
}

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

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

#mobile-menu.open .mobile-nav-link {
  animation: fadeUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

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

.menu-line {
  transform-origin: center;
}

body.menu-open .menu-line:first-child {
  transform: translateY(9px) rotate(45deg);
}

body.menu-open .menu-line:last-child {
  transform: translateY(-9px) rotate(-45deg);
}

/* ─── Service Cards ─── */
.service-card {
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #8fc8b8, #4d9e88);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.service-card:hover::before {
  transform: scaleX(1);
}

/* ─── Form Inputs ─── */
input:focus,
textarea:focus {
  outline: none;
}

/* ─── Smooth image loading ─── */
img {
  display: block;
  max-width: 100%;
}

/* ─── Focus styles ─── */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid #8fc8b8;
  outline-offset: 2px;
  border-radius: 4px;
}

/* ─── Header scroll state ─── */
#site-header.scrolled {
  box-shadow: 0 1px 20px rgba(10, 31, 53, 0.06);
}

/* ─── Mobile responsive adjustments ─── */
@media (max-width: 767px) {
  .font-serif {
    line-height: 1.1;
  }

  h1 {
    font-size: 2.75rem !important;
  }

  h1 span {
    font-size: 1.75rem !important;
  }
}

/* ─── Print ─── */
@media print {
  header, footer, #contact-form, .reveal {
    display: none;
  }

  body {
    color: #000;
    background: #fff;
  }
}
