/* ==========================================================================
   SAI MARINE SOLUTIONS - MOTION LAYER
   Supporting styles for the GSAP / ScrollTrigger scroll experience.

   Rules of engagement:
   - Nothing here hides content on its own. Entrance states are set by GSAP at
     runtime, so the site stays fully readable if JavaScript never runs.
   - Hover micro-interactions live in CSS (not GSAP) so they never fight the
     inline transforms GSAP writes during scroll animations.
   ========================================================================== */

:root {
  --brand-red: #c71221;
  --motion-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* --------------------------------------------------------------------------
   1. Hero cinematic entrance
   -------------------------------------------------------------------------- */

/* Injected veil that lifts as the hero timeline plays (sits above the
   gradient overlay, below the copy). */
.hero-intro-veil {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--navy-950);
  z-index: 1;
  pointer-events: none;
}

/* Line-by-line heading reveal: each line clips its own inner span. */
.anim-line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}

.anim-line-inner {
  display: block;
}


/* --------------------------------------------------------------------------
   2. Expertise horizontal storytelling (desktop only, added by JS)
   -------------------------------------------------------------------------- */
/* Compact padding while the section is pinned, so a full panel clears the
   sticky navbar and still fits a standard 1080p viewport. */
.anim-hsection {
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

.anim-hwrap {
  overflow: hidden; /* guarantees no horizontal page overflow */
}

.anim-htrack {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 4rem;
  will-change: transform;
}

.anim-htrack > .content-block {
  flex: 0 0 100%;
  margin-bottom: 0 !important;
}

.anim-hprogress {
  position: relative;
  height: 2px;
  background: rgba(10, 37, 64, 0.12);
  margin-top: 2.25rem;
}

.anim-hprogress span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 100%;
  background: var(--brand-red);
  transform: scaleX(0);
  transform-origin: left center;
}

/* --------------------------------------------------------------------------
   3. Decorative red rule (final CTA)
   -------------------------------------------------------------------------- */
.anim-rule {
  display: block;
  width: 72px;
  height: 3px;
  background: var(--brand-red);
  margin: 0 auto 1.75rem auto;
  transform: scaleX(0);
  transform-origin: center center;
}

/* --------------------------------------------------------------------------
   4. Hover micro-interactions
   Kept subtle, transform/opacity only, no layout shift.
   -------------------------------------------------------------------------- */

/* Icon + arrow nudge on the compliance service cards */
.service-card .service-icon-box,
.service-card .service-card-link svg {
  transition: transform 0.35s var(--motion-ease);
}

.service-card:hover .service-icon-box {
  transform: translateY(-3px);
}

.service-card:hover .service-card-link svg {
  transform: translateX(5px);
}

/* Service card hover states live in style.css alongside the card itself */

/* Primary CTA buttons: slight rise handled by existing rules, add red glow */
.btn-crimson:hover {
  box-shadow:
    0 12px 24px -4px rgba(199, 18, 33, 0.55),
    0 0 0 1px rgba(199, 18, 33, 0.35);
}

.btn-primary:hover,
.btn-outline-white:hover {
  transform: translateY(-3px) scale(1.02);
}

/* Case-study metric cards + leadership card: gentle lift */
.cs-metric-card,
.leader-card,
.vm-box {
  transition:
    transform 0.4s var(--motion-ease),
    box-shadow 0.4s var(--motion-ease);
}

.cs-metric-card:hover,
.vm-box:hover {
  transform: translateY(-4px);
}

/* --------------------------------------------------------------------------
   5. Accessibility - honour reduced motion
   Every scripted animation is skipped in JS as well; this covers the CSS side.
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .hero-intro-veil {
    display: none;
  }

  .anim-rule,
  .anim-hprogress span {
    transform: scaleX(1);
  }

  .service-card .service-icon-box,
  .service-card .service-card-link svg,
  .photo-service-card,
  .photo-service-card .psc-img,
  .photo-service-card .psc-badge,
  .photo-service-card .psc-plus,
  .photo-service-card::before,
  .cs-metric-card,
  .leader-card,
  .vm-box {
    transition: none;
  }

  .btn-primary:hover,
  .btn-outline-white:hover {
    transform: none;
  }
}
