/* ACSPL Cinematic Intro
   Plays once per session on the homepage. Auto-hides after ~9s. */

#acspl-intro {
  position: fixed;
  inset: 0;
  z-index: 99999;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 42%, #0a0e2e 0%, #050720 55%, #02030d 100%);
  display: block;
  opacity: 1;
  transform: scale(1);
  filter: blur(0px);
  transition:
    opacity 1.6s cubic-bezier(0.55, 0, 0.1, 1),
    transform 1.6s cubic-bezier(0.55, 0, 0.1, 1),
    filter 1.6s cubic-bezier(0.55, 0, 0.1, 1);
  -webkit-font-smoothing: antialiased;
  cursor: pointer;
}

html.acspl-intro-active,
body.acspl-intro-active {
  overflow: hidden !important;
  height: 100vh;
}

#acspl-intro.acspl-fade-out {
  opacity: 0;
  transform: scale(1.08);
  filter: blur(8px);
  pointer-events: none;
}

/* Hero behind the intro fades up so it feels like the intro
   is settling into the page instead of getting yanked away. */
body.acspl-intro-active .hp-hero,
body.acspl-intro-active .page-head--img {
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 1.4s ease-out, transform 1.6s cubic-bezier(0.55, 0, 0.1, 1);
}
body.acspl-intro-leaving .hp-hero,
body.acspl-intro-leaving .page-head--img {
  opacity: 1;
  transform: scale(1);
}

#acspl-intro canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Soft red/navy aura behind the globe */
#acspl-intro::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 42%;
  width: 70vmin;
  height: 70vmin;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 35%,
      rgba(230, 51, 41, 0.18) 0%,
      rgba(27, 31, 94, 0.25) 32%,
      rgba(0, 0, 0, 0) 65%);
  filter: blur(8px);
  pointer-events: none;
  animation: acspl-aura-pulse 4.5s ease-in-out infinite;
}

@keyframes acspl-aura-pulse {
  0%, 100% { opacity: 0.85; transform: translate(-50%, -50%) scale(1); }
  50%      { opacity: 1;    transform: translate(-50%, -50%) scale(1.06); }
}

/* Brand reveal at the bottom — Abril Fatface, CAPS, BOLD, logo tri-tone */
.acspl-intro-brand {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 11%;
  text-align: center;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 2.2s ease, transform 2.2s ease;
  pointer-events: none;
  padding: 0 24px;
}

.acspl-intro-brand.show {
  opacity: 1;
  transform: translateY(0);
}

.acspl-intro-brand .acspl-wordmark {
  font-family: "Abril Fatface", Georgia, serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: clamp(24px, 4.2vw, 60px);
  line-height: 1.05;
  filter: drop-shadow(0 0 30px rgba(255, 255, 255, 0.12));
}

/* Continuous gradient shimmer that flows left → right across the wordmark,
   never settling — gives the brand a living, premium look. The 5-stop palette
   (silver → white → warm blush → white → silver) is wider than the visible
   area so each frame shows a different slice as it sweeps through. */
.acspl-intro-brand .w {
  display: inline-block;
  background-image: linear-gradient(
    90deg,
    #C5C7D0 0%,
    #FFFFFF 18%,
    #FFD0C4 32%,
    #FFFFFF 50%,
    #FFD0C4 68%,
    #FFFFFF 82%,
    #C5C7D0 100%
  );
  background-size: 220% 100%;
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
          color: transparent;
  opacity: 0;
  transform: translateY(0.28em);
  transition: opacity 1.8s cubic-bezier(.2,.7,.3,1),
              transform 1.8s cubic-bezier(.2,.7,.3,1);
  animation: acspl-shimmer 7s linear infinite;
}

/* Stagger each word's shimmer phase so the colour wave travels through
   ACTIVE → CARGO → SOLUTIONS like a single light sweeping across the brand. */
.acspl-intro-brand .w1 { animation-delay:  0s; }
.acspl-intro-brand .w2 { animation-delay: -2.3s; }
.acspl-intro-brand .w3 { animation-delay: -4.6s; }

@keyframes acspl-shimmer {
  0%   { background-position:   0% 50%; }
  100% { background-position: 220% 50%; }
}

/* Per-word reveal cascade — longer + earlier so the brand grows in from
   the start rather than popping at 2.8s. Total reveal completes ~2.6s in. */
.acspl-intro-brand.show .w1 { transition-delay: 0.0s; }
.acspl-intro-brand.show .w2 { transition-delay: 0.35s; }
.acspl-intro-brand.show .w3 { transition-delay: 0.70s; }
.acspl-intro-brand.show .w {
  opacity: 1;
  transform: translateY(0);
}

/* Red tracer line that draws beneath the wordmark */
.acspl-intro-brand .acspl-tracer {
  margin: 16px auto 0;
  width: clamp(120px, 14vw, 220px);
  height: 2px;
  background: #E63329;
  box-shadow: 0 0 14px rgba(230, 51, 41, 0.7);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.95s cubic-bezier(.2,.7,.3,1) 0.85s;
}
.acspl-intro-brand.show .acspl-tracer {
  transform: scaleX(1);
}

.acspl-intro-brand .acspl-tagline {
  margin-top: 16px;
  font-family: "Manrope", system-ui, sans-serif;
  font-weight: 400;
  font-size: clamp(11px, 1.2vw, 13px);
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: rgba(197, 199, 208, 0.7);
}

.acspl-intro-brand .acspl-tagline span {
  color: #E63329;
  margin: 0 10px;
  font-weight: 600;
}

/* Top headline */
.acspl-intro-top {
  position: absolute;
  top: 9%;
  left: 0;
  right: 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.82);
  font-family: "Manrope", system-ui, sans-serif;
  font-weight: 500;
  font-size: clamp(10px, 1.2vw, 12px);
  letter-spacing: 0.36em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.acspl-intro-top.show { opacity: 1; transform: translateY(0); }
.acspl-intro-top::before,
.acspl-intro-top::after {
  content: "";
  display: inline-block;
  width: clamp(20px, 4vw, 50px);
  height: 1px;
  background: rgba(230, 51, 41, 0.7);
  vertical-align: middle;
  margin: 0 14px;
}

/* Skip button */
.acspl-intro-skip {
  position: absolute;
  right: 22px;
  bottom: 22px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-family: "Manrope", system-ui, sans-serif;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.6s ease 0.6s, background 0.2s ease, border-color 0.2s ease;
  z-index: 2;
}
.acspl-intro-skip.show { opacity: 1; }
.acspl-intro-skip:hover {
  background: rgba(230, 51, 41, 0.85);
  border-color: rgba(230, 51, 41, 0.95);
  color: #fff;
}

/* HUD corner readouts */
.acspl-hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  font-family: "Manrope", system-ui, sans-serif;
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  opacity: 0;
  transition: opacity 0.7s ease;
  z-index: 2;
}
.acspl-hud.show { opacity: 1; }

.acspl-hud-corner {
  position: absolute;
  padding: 14px 18px;
  line-height: 1.7;
  min-width: 150px;
}
.acspl-hud-corner.tl { top: 22px; left: 22px;  border-left: 1px solid rgba(230,51,41,0.55); border-top: 1px solid rgba(230,51,41,0.55); }
.acspl-hud-corner.tr { top: 22px; right: 22px; text-align: right; border-right: 1px solid rgba(125,211,252,0.55); border-top: 1px solid rgba(125,211,252,0.55); }
.acspl-hud-corner.bl { bottom: 22px; left: 22px; border-left: 1px solid rgba(74,222,128,0.55); border-bottom: 1px solid rgba(74,222,128,0.55); }
.acspl-hud-corner.br { bottom: 22px; right: 22px; text-align: right; border-right: 1px solid rgba(125,211,252,0.55); border-bottom: 1px solid rgba(125,211,252,0.55); }

.acspl-hud-tag {
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.32em;
  margin-bottom: 4px;
}
.acspl-hud-line { color: rgba(255,255,255,0.7); }
.acspl-hud-line span[data-counter] {
  display: inline-block;
  min-width: 4ch;
  font-variant-numeric: tabular-nums;
  color: #fff;
}

.acspl-hud-corner.bl .dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #4ade80;
  margin-right: 8px;
  vertical-align: middle;
  box-shadow: 0 0 8px #4ade80;
  animation: acspl-status-blink 1.4s ease-in-out infinite;
}

@keyframes acspl-status-blink {
  0%,100% { opacity: 1; }
  50%     { opacity: 0.35; }
}

/* Lens flare burst behind brand reveal */
.acspl-flare {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 0;
  height: 0;
  transform: translate(-50%, -50%);
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.85) 0%,
    rgba(230, 51, 41, 0.55) 25%,
    rgba(230, 51, 41, 0.0) 60%);
  opacity: 0;
}
.acspl-flare.go {
  animation: acspl-flare-burst 1.4s cubic-bezier(.2,.7,.3,1) forwards;
}
@keyframes acspl-flare-burst {
  0%   { width: 0;     height: 0;     opacity: 0; }
  20%  { width: 220px; height: 220px; opacity: 1; }
  100% { width: 1400px; height: 1400px; opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  #acspl-intro::before { animation: none; }
  .acspl-intro-brand .acspl-wordmark { filter: none; }
  .acspl-intro-brand .w { transition: none; }
  .acspl-intro-brand .acspl-tracer { transition: none; }
}

/* ---- Mobile (<= 700px) ---- */
@media (max-width: 700px) {
  /* HUD doesn't fit on phones — hide it entirely so the globe + brand breathe */
  .acspl-hud { display: none; }

  .acspl-intro-brand { bottom: 12%; padding: 0 16px; }
  .acspl-intro-brand .acspl-wordmark {
    letter-spacing: 0.03em;
    font-size: clamp(20px, 7.6vw, 32px);
  }
  .acspl-intro-brand .acspl-tagline {
    margin-top: 12px;
    letter-spacing: 0.3em;
    font-size: 9.5px;
  }

  .acspl-intro-top {
    top: 6%;
    letter-spacing: 0.22em;
    font-size: 9.5px;
    padding: 0 24px;
    line-height: 1.55;
  }
  .acspl-intro-top::before,
  .acspl-intro-top::after { display: none; }

  /* Smaller skip button so it doesn't dominate the corner */
  .acspl-intro-skip {
    right: 14px;
    bottom: 14px;
    padding: 7px 12px;
    font-size: 10px;
    letter-spacing: 0.16em;
  }

  /* Background aura sized for portrait */
  #acspl-intro::before {
    width: 90vmin;
    height: 90vmin;
    top: 38%;
  }
}

/* Very narrow phones (<= 380px) — shrink wordmark a touch more */
@media (max-width: 380px) {
  .acspl-intro-brand .acspl-wordmark {
    font-size: clamp(18px, 7.2vw, 26px);
    letter-spacing: 0.02em;
  }
  .acspl-intro-top { font-size: 9px; letter-spacing: 0.18em; }
}
