/* =========================================================
   ARIES MARINE — ANIMATIONS STYLESHEET
   Handles: hero zoom, fade-up entrance, scroll reveal,
            hover accents, reduced-motion accessibility
   Depends on: css/style.css
   ========================================================= */

/* ---------------------------------------------------------
   HERO BACKGROUND — slow cinematic zoom
   --------------------------------------------------------- */
@keyframes heroZoom {
  from { transform: scale(1); }
  to   { transform: scale(1.08); }
}

.hero-bg {
  animation: heroZoom 20s ease-in-out infinite alternate;
  transform-origin: center center;
  will-change: transform;
}

/* ---------------------------------------------------------
   FADE-UP ENTRANCE (hero text elements)
   --------------------------------------------------------- */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.anim-fade-up {
  opacity: 0;
  animation: fadeUp 0.9s ease forwards;
}

.anim-fade-up.delay-1 { animation-delay: 0.25s; }
.anim-fade-up.delay-2 { animation-delay: 0.5s; }
.anim-fade-up.delay-3 { animation-delay: 0.75s; }

/* ---------------------------------------------------------
   SCROLL REVEAL (sections on scroll)
   Base state is defined in style.css.
   This file only enhances with a smoother curve.
   --------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered reveal for grid children */
.strengths-grid .reveal:nth-child(1),
.services-grid .reveal:nth-child(1),
.compliance-grid .reveal:nth-child(1),
.seafarer-categories .reveal:nth-child(1),
.why-grid .reveal:nth-child(1),
.process-flow .reveal:nth-child(1) { transition-delay: 0.05s; }

.strengths-grid .reveal:nth-child(2),
.services-grid .reveal:nth-child(2),
.compliance-grid .reveal:nth-child(2),
.seafarer-categories .reveal:nth-child(2),
.why-grid .reveal:nth-child(2),
.process-flow .reveal:nth-child(2) { transition-delay: 0.12s; }

.strengths-grid .reveal:nth-child(3),
.services-grid .reveal:nth-child(3),
.compliance-grid .reveal:nth-child(3),
.seafarer-categories .reveal:nth-child(3),
.why-grid .reveal:nth-child(3),
.process-flow .reveal:nth-child(3) { transition-delay: 0.19s; }

.strengths-grid .reveal:nth-child(4),
.services-grid .reveal:nth-child(4),
.compliance-grid .reveal:nth-child(4),
.seafarer-categories .reveal:nth-child(4),
.why-grid .reveal:nth-child(4),
.process-flow .reveal:nth-child(4) { transition-delay: 0.26s; }

.services-grid .reveal:nth-child(5),
.process-flow .reveal:nth-child(5) { transition-delay: 0.33s; }

.services-grid .reveal:nth-child(6),
.process-flow .reveal:nth-child(6) { transition-delay: 0.4s; }

.why-grid .reveal:nth-child(5) { transition-delay: 0.33s; }
.why-grid .reveal:nth-child(6) { transition-delay: 0.4s; }
.why-grid .reveal:nth-child(7) { transition-delay: 0.47s; }
.why-grid .reveal:nth-child(8) { transition-delay: 0.54s; }

/* ---------------------------------------------------------
   HOVER ENHANCEMENTS
   --------------------------------------------------------- */

/* Buttons — subtle lift and shadow */
.btn {
  will-change: transform;
}
.btn:hover {
  box-shadow: 0 10px 22px rgba(10, 31, 61, 0.18);
}

/* Service card icon — gentle scale on card hover */
.service-card:hover .service-icon {
  transform: scale(1.08);
  transition: transform 0.3s ease;
}

/* Service link arrow — slide on hover */
.service-link {
  position: relative;
}
.service-link::after {
  content: '';
  display: inline-block;
  margin-left: 4px;
  transition: transform 0.25s ease;
}
.service-link:hover::after {
  transform: translateX(4px);
}

/* Card top border draw-in already handled in style.css.
   Strengthen it here with slightly smoother timing. */
.service-card::before {
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Strength card number subtle pulse on hover */
.strength-card:hover .strength-num {
  color: var(--gold-light);
  transition: color 0.3s ease;
}

/* Compliance badge subtle glow on hover */
.compliance-card:hover .compliance-badge {
  background: var(--gold);
  color: var(--navy);
  transition: background 0.3s ease, color 0.3s ease;
}

/* Seafarer category subtle glow */
.seafarer-cat:hover h3 {
  color: var(--gold-light);
  transition: color 0.3s ease;
}

/* Timeline dot subtle scale on hover */
.timeline-item:hover::before {
  transform: scale(1.25);
  transition: transform 0.3s ease;
}

/* Vessel list pill hover already handled in style.css */

/* Footer link subtle slide */
.footer-col a {
  position: relative;
  display: inline-block;
  transition: color 0.25s ease, transform 0.25s ease;
}
.footer-col a:hover {
  transform: translateX(3px);
}

/* ---------------------------------------------------------
   FORM FEEDBACK ANIMATIONS
   --------------------------------------------------------- */
@keyframes shakeError {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-4px); }
  40%      { transform: translateX(4px); }
  60%      { transform: translateX(-3px); }
  80%      { transform: translateX(3px); }
}

.form-group input.invalid,
.form-group textarea.invalid {
  animation: shakeError 0.35s ease;
}

@keyframes successPop {
  0%   { opacity: 0; transform: translateY(8px) scale(0.98); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.form-success {
  animation: successPop 0.4s ease forwards;
}

/* ---------------------------------------------------------
   MOBILE MENU TRANSITIONS
   --------------------------------------------------------- */
.main-nav {
  will-change: right;
}

/* Fade-in mobile menu links */
@media (max-width: 768px) {
  .main-nav.open ul li {
    animation: fadeUp 0.35s ease forwards;
    opacity: 0;
  }
  .main-nav.open ul li:nth-child(1) { animation-delay: 0.05s; }
  .main-nav.open ul li:nth-child(2) { animation-delay: 0.10s; }
  .main-nav.open ul li:nth-child(3) { animation-delay: 0.15s; }
  .main-nav.open ul li:nth-child(4) { animation-delay: 0.20s; }
  .main-nav.open ul li:nth-child(5) { animation-delay: 0.25s; }
  .main-nav.open ul li:nth-child(6) { animation-delay: 0.30s; }
}

/* ---------------------------------------------------------
   REDUCED MOTION — Accessibility
   Users who enable "reduce motion" in their OS get a calm,
   static experience with no animation, no zoom, no fades.
   --------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .hero-bg {
    animation: none !important;
    transform: none !important;
  }

  .anim-fade-up,
  .reveal {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
}