/* Progressive motion and interaction layer */
:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 4px;
}

.header,
.nav-shell,
.logo img {
  transition:
    min-height 220ms ease,
    box-shadow 220ms ease,
    width 220ms ease;
}

.header.scrolled {
  box-shadow: 0 10px 30px rgba(7, 27, 46, 0.1);
}

.header.scrolled .nav-shell {
  min-height: 72px;
}

.header.scrolled .logo img {
  width: 155px;
}

.footer-logo {
  height: auto;
}

.experience {
  background: #a94b00;
}

.section-dark .eyebrow {
  color: #75bfff;
}

.whatsapp {
  background: #08783d;
}

.error-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--navy);
  color: #fff;
  text-align: center;
}

.error-content {
  max-width: 620px;
}

.error-content img {
  width: 190px;
  height: auto;
  filter: brightness(0) invert(1);
  margin: 0 auto 36px;
}

.error-code {
  display: block;
  color: #75bfff;
  font-size: clamp(4rem, 15vw, 8rem);
  line-height: 1;
}

.error-content h1 {
  font-size: clamp(2rem, 6vw, 3.5rem);
  margin: 12px 0;
}

.error-content p {
  color: #bed0dc;
}

.error-content a {
  display: inline-block;
  margin-top: 20px;
  padding: 13px 22px;
  border-radius: 10px;
  background: #fff;
  color: var(--navy);
  font-weight: 800;
}

.will-reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 650ms cubic-bezier(0.22, 1, 0.36, 1) var(--reveal-delay, 0ms),
    transform 650ms cubic-bezier(0.22, 1, 0.36, 1) var(--reveal-delay, 0ms);
}

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

.menu-toggle span {
  transform-origin: center;
}

.menu-toggle.open span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.menu-toggle.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.menu-toggle.open span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.lightbox-open {
  overflow: hidden;
}

.lightbox.open img {
  animation: lightbox-enter 240ms ease-out both;
}

@keyframes lightbox-enter {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
}

@media (max-width: 960px) {
  .nav {
    max-height: calc(100dvh - 76px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .nav a {
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .header.scrolled .nav-shell {
    min-height: 68px;
  }

  .header.scrolled .nav {
    inset-block-start: 68px;
  }
}

@media (max-width: 650px) {
  html {
    scroll-padding-top: 72px;
  }

  .container,
  .hero-copy,
  .section-title > *,
  .about-grid > *,
  .contact-wrap > * {
    min-width: 0;
  }

  .hero h1 {
    font-size: clamp(2.65rem, 14vw, 3.25rem);
    overflow-wrap: anywhere;
  }

  .hero p {
    max-width: 100%;
  }

  .button-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .button-row .button {
    width: 100%;
    min-height: 52px;
  }

  .service-card {
    min-height: min(460px, 122vw);
  }

  .service-content {
    padding: 24px;
  }

  .experience {
    right: 10px;
    bottom: 18px;
  }

  .whatsapp,
  .back-top {
    right: max(14px, env(safe-area-inset-right));
  }

  .whatsapp {
    bottom: max(14px, env(safe-area-inset-bottom));
  }

  .back-top {
    bottom: calc(max(14px, env(safe-area-inset-bottom)) + 62px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .will-reveal {
    opacity: 1;
    transform: none;
  }
}
