/* TRENX — supplemental styles layered on top of Tailwind (CDN, JIT).
   Anything expressible as a Tailwind utility lives in the markup;
   this file only holds what utilities can't reach: the hero slider,
   the header's scroll state, reveal animations, and the service
   sliders. */

html {
  scroll-padding-top: 84px;
}

::selection {
  background: #7C0F10;
  color: #fff;
}

:focus-visible {
  outline: 2px solid #A21F1F;
  outline-offset: 2px;
}

/* ---------- Header: transparent over the hero, solid once scrolled ---------- */
#site-header {
  background: linear-gradient(to bottom, rgba(23, 22, 26, 0.65) 0%, rgba(23, 22, 26, 0) 100%);
}

#site-header[data-scrolled="true"] {
  background: #17161A;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

/* ---------- Nav link underline on scroll-active section ---------- */
.nav-link {
  position: relative;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  height: 2px;
  width: 0;
  background: #A21F1F;
  transition: width 0.25s ease;
}

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

/* ---------- Hero slider (crossfade) ---------- */
.hero-slide {
  opacity: 0;
  transition: opacity 1.2s ease-in-out;
}

.hero-slide.is-active {
  opacity: 1;
}

.hero-slide img {
  animation: hero-zoom 8s ease-out forwards;
}

@keyframes hero-zoom {
  from { transform: scale(1.08); }
  to { transform: scale(1); }
}

.hero-dot.is-active {
  background: #fff;
  width: 1.75rem;
  border-radius: 9999px;
}

/* ---------- One orchestrated entrance for the hero on page load ---------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

#hero-content.is-revealed .reveal {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.12s; }
.reveal-delay-2 { transition-delay: 0.24s; }
.reveal-delay-3 { transition-delay: 0.36s; }

/* ---------- Scroll reveal, used generously across sections/cards ---------- */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal-on-scroll,
  #hero-content .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .hero-slide img {
    animation: none;
  }
}

/* ---------- Service sliders: native scroll-snap, hide scrollbar ---------- */
.service-slider {
  scrollbar-width: none;
}

.service-slider::-webkit-scrollbar {
  display: none;
}

.slider-arrow:active {
  transform: scale(0.94);
}

/* ---------- Mobile menu bars -> X ---------- */
#menu-toggle[aria-expanded="true"] [data-bar="1"] {
  transform: translateY(6px) rotate(45deg);
}

#menu-toggle[aria-expanded="true"] [data-bar="2"] {
  opacity: 0;
}

#menu-toggle[aria-expanded="true"] [data-bar="3"] {
  width: 1.75rem;
  transform: translateY(-6px) rotate(-45deg);
}

/* ---------- Contact form state ---------- */
.field-error:empty {
  display: none;
}

input.has-error,
textarea.has-error {
  border-color: #7C0F10 !important;
}
