/* =========================================================================
   GMU Landing — animation layer
   Ambient + interactive motion designed around the existing GMU tokens.
   ========================================================================= */

/* ---------- Global reset of motion defaults ---------- */
*, *::before, *::after {
  -webkit-font-smoothing: antialiased;
}

html { scroll-behavior: smooth; }
body { margin: 0; background: #fff; overflow-x: hidden; }

/* ---------- Scroll-progress bar ---------- */
.gmu-scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; z-index: 100;
  background: var(--gmu-ribbon);
  width: var(--scroll, 0%);
  box-shadow: 0 0 12px rgba(230,51,35,0.6);
}

/* ---------- Reveal-on-scroll ---------- */
.gmu-reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 700ms var(--gmu-ease-out), transform 700ms var(--gmu-ease-out);
  will-change: opacity, transform;
}
.gmu-reveal.is-in { opacity: 1; transform: translateY(0); }
.gmu-reveal--left { transform: translateX(-48px); }
.gmu-reveal--left.is-in { transform: translateX(0); }
.gmu-reveal--right { transform: translateX(48px); }
.gmu-reveal--right.is-in { transform: translateX(0); }
.gmu-reveal--scale { transform: scale(0.92); }
.gmu-reveal--scale.is-in { transform: scale(1); }

/* ---------- Type-in stagger for hero headline ---------- */
.gmu-stagger > span {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.7em) rotateX(-40deg);
  transform-origin: 50% 100%;
  animation: gmu-word-in 900ms var(--gmu-ease-out) forwards;
}
@keyframes gmu-word-in {
  to { opacity: 1; transform: translateY(0) rotateX(0); }
}

/* ---------- Marquee ticker ---------- */
/* Motion is driven by rAF in Partners.jsx (transform set inline), not by a CSS
   animation — a percentage translate can't loop seamlessly across unequal card
   widths + the trailing-gap asymmetry. `width: max-content` keeps the track at
   its true content width so the JS period measurement is exact. Speed, the
   drag-to-scroll interaction, and the post-drag hold all live in the effect;
   it does not pause on hover. */
.gmu-marquee {
  display: flex; gap: 64px; align-items: center;
  width: max-content;
  will-change: transform;
}

/* ---------- Ribbon — animated shimmer ---------- */
.gmu-ribbon-fx {
  position: relative; overflow: hidden;
}
.gmu-ribbon-fx::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.35) 50%, transparent 70%);
  transform: translateX(-100%);
  animation: gmu-shimmer 5.5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes gmu-shimmer {
  0%, 60% { transform: translateX(-110%); }
  85%, 100% { transform: translateX(120%); }
}

/* ---------- Button — shine sweep on hover ---------- */
.gmu-btn { position: relative; overflow: hidden; isolation: isolate; }
.gmu-btn::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 40%, rgba(255,255,255,0.45) 50%, transparent 60%);
  transform: translateX(-120%);
  transition: transform 600ms var(--gmu-ease-out);
  z-index: 0;
}
.gmu-btn:hover::before { transform: translateX(120%); }
.gmu-btn > * { position: relative; z-index: 1; }

/* ---------- Hex tile float ---------- */
@keyframes gmu-float-y {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
.gmu-float { animation: gmu-float-y 5s ease-in-out infinite; }
.gmu-float--slow { animation-duration: 7.5s; }
.gmu-float--delay { animation-delay: -2.5s; }

/* ---------- Hero product shots — transparent cutouts floating bare (no card,
   no border). A grounding dark shadow hugs the silhouette by default for
   legibility against the busy backdrop; it gradually gives way to a red glow
   at the peak of the cycle, then returns — a crossfade, not a stack, via
   drop-shadow, which respects the image's alpha channel. ---------- */
@keyframes gmu-shot-glow {
  0%, 100% { filter: drop-shadow(0 14px 18px rgba(20,20,20,0.5)); }
  40%      { filter: drop-shadow(0 14px 18px rgba(20,20,20,0.25))
                     drop-shadow(0 0 12px rgba(230,51,35,0.25)); }
  50%      { filter: drop-shadow(0 14px 18px rgba(20,20,20,0.08))
                     drop-shadow(0 0 20px rgba(230,51,35,0.45)); }
  60%      { filter: drop-shadow(0 14px 18px rgba(20,20,20,0.25))
                     drop-shadow(0 0 12px rgba(230,51,35,0.25)); }
}
.gmu-shot { animation: gmu-shot-glow 4.5s ease-in-out infinite; }
.gmu-shot--alt { animation-duration: 6s; animation-delay: -2s; }
.gmu-shot--alt2 { animation-duration: 5.2s; animation-delay: -3.4s; }
.gmu-shot--alt3 { animation-duration: 6.6s; animation-delay: -1.1s; }
.gmu-shot--alt4 { animation-duration: 5.7s; animation-delay: -4.3s; }
.gmu-shot--alt5 { animation-duration: 4.9s; animation-delay: -0.6s; }

/* Glossy sheen sweeping across — the parent is masked to the image alpha
   (see HeroShot) so the glint only rides the product, never a rectangle. */
@keyframes gmu-shot-sheen {
  0%   { transform: translateX(-160%) skewX(-18deg); opacity: 0; }
  8%   { opacity: 0.75; }
  30%  { transform: translateX(300%) skewX(-18deg); opacity: 0; }
  100% { transform: translateX(300%) skewX(-18deg); opacity: 0; }
}
.gmu-shot-sheen {
  position: absolute; top: 0; bottom: 0; left: 0; width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.85), transparent);
  animation: gmu-shot-sheen 6.5s ease-in-out infinite;
}
.gmu-shot-sheen--alt { animation-duration: 8s; animation-delay: -3s; }
.gmu-shot-sheen--alt2 { animation-duration: 7.2s; animation-delay: -5.1s; }
.gmu-shot-sheen--alt3 { animation-duration: 8.4s; animation-delay: -1.6s; }
.gmu-shot-sheen--alt4 { animation-duration: 7.7s; animation-delay: -6.3s; }
.gmu-shot-sheen--alt5 { animation-duration: 6.9s; animation-delay: -0.9s; }

/* ---------- Catalog & detail product shots — bare transparent cutouts, no
   hexagon frame. A grounding drop-shadow hugs the alpha silhouette at rest; on
   hover the grounding deepens and a glossy sheen sweeps across, masked to the
   same alpha so the glint rides the product, not a rectangle. `--glow` layers a
   red halo under the shadow for shots that stand bare (detail page). Hover is
   driven either by the wrapper's own :hover or an `is-hover` class set by a
   parent tile. No transform on the <img> itself — the sheen mask is keyed to the
   wrapper box, so geometry must stay put or the glint would drift off the
   silhouette; lift/scale lives on the enclosing tile instead. ---------- */
.gmu-prodshot { position: relative; display: grid; place-items: center; }
.gmu-prodshot__img {
  display: block; width: 100%; height: 100%; object-fit: contain;
  filter: drop-shadow(0 8px 12px rgba(20,20,20,0.16));
  transition: filter 360ms var(--gmu-ease-out);
  will-change: filter;
}
.gmu-prodshot:hover .gmu-prodshot__img,
.gmu-prodshot.is-hover .gmu-prodshot__img {
  filter: drop-shadow(0 14px 20px rgba(20,20,20,0.22));
}
.gmu-prodshot--glow:hover .gmu-prodshot__img,
.gmu-prodshot--glow.is-hover .gmu-prodshot__img {
  filter: drop-shadow(0 14px 20px rgba(20,20,20,0.22))
          drop-shadow(0 0 18px rgba(230,51,35,0.45));
}
.gmu-prodshot__sheen-wrap {
  position: absolute; inset: 0; overflow: hidden; pointer-events: none;
}
.gmu-prodshot__sheen {
  position: absolute; top: 0; bottom: 0; left: 0; width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.85), transparent);
  transform: translateX(-160%) skewX(-18deg); opacity: 0;
}
.gmu-prodshot:hover .gmu-prodshot__sheen,
.gmu-prodshot.is-hover .gmu-prodshot__sheen {
  animation: gmu-prodshot-sheen 720ms var(--gmu-ease-out);
}
@keyframes gmu-prodshot-sheen {
  0%   { transform: translateX(-160%) skewX(-18deg); opacity: 0; }
  12%  { opacity: 0.75; }
  100% { transform: translateX(320%) skewX(-18deg); opacity: 0; }
}

/* ---------- Ambient hex outline drift in background ---------- */
@keyframes gmu-hex-drift {
  0%   { transform: translate(0,0) rotate(0); opacity: 0.0; }
  10%  { opacity: 0.5; }
  90%  { opacity: 0.5; }
  100% { transform: translate(20px, -160px) rotate(20deg); opacity: 0; }
}
.gmu-ambient-hex {
  position: absolute; pointer-events: none;
  animation: gmu-hex-drift 14s linear infinite;
}

/* ---------- Pulse dot (map / live indicator) ---------- */
.gmu-pulse-dot {
  position: relative; width: 14px; height: 14px;
  background: var(--gmu-red); border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(230,51,35,0.6);
  animation: gmu-pulse 2s ease-out infinite;
}
@keyframes gmu-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(230,51,35,0.55); }
  80%  { box-shadow: 0 0 0 28px rgba(230,51,35,0); }
  100% { box-shadow: 0 0 0 0 rgba(230,51,35,0); }
}

/* ---------- Oscilloscope sine wave ---------- */
.gmu-sine path {
  stroke: var(--gmu-red);
  stroke-width: 1.5;
  fill: none;
  stroke-dasharray: 4 6;
  animation: gmu-sine-dash 24s linear infinite;
}
@keyframes gmu-sine-dash {
  to { stroke-dashoffset: -1000; }
}

/* ---------- Gauge / dial idle wobble ---------- */
@keyframes gmu-needle-wobble {
  0%, 100% { transform: rotate(-58deg); }
  20%      { transform: rotate(-25deg); }
  35%      { transform: rotate(8deg); }
  55%      { transform: rotate(34deg); }
  80%      { transform: rotate(-10deg); }
}

/* ---------- Service card 3D tilt sets a CSS var from JS ---------- */
.gmu-tilt {
  transition: transform 200ms var(--gmu-ease-out), box-shadow 200ms var(--gmu-ease-out);
  transform-style: preserve-3d;
  will-change: transform;
}

/* ---------- Hex grid hover ripple (per-tile delay set via --d) ---------- */
.gmu-hexgrid-tile {
  transition: transform 240ms var(--gmu-ease-out), filter 240ms var(--gmu-ease-out);
  transition-delay: var(--d, 0ms);
  cursor: pointer;
}
.gmu-hexgrid:hover .gmu-hexgrid-tile {
  transform: translateY(-2px) scale(1.03);
}
.gmu-hexgrid-tile:hover {
  transform: translateY(-8px) scale(1.08) !important;
  filter: drop-shadow(0 10px 16px rgba(230,51,35,0.35));
  transition-delay: 0ms;
}

/* ---------- Section header underline draw ---------- */
.gmu-underline {
  position: relative; display: inline-block;
}
.gmu-underline::after {
  content: ''; position: absolute; left: 0; bottom: -8px;
  height: 3px; background: var(--gmu-red); border-radius: 2px;
  width: 0;
  transition: width 800ms var(--gmu-ease-out);
}
.gmu-reveal.is-in .gmu-underline::after { width: 64px; }

/* ---------- Marquee partner glow on hover ---------- */
.gmu-partner-card {
  transition: transform 240ms var(--gmu-ease-out), filter 240ms var(--gmu-ease-out);
}
.gmu-partner-card:hover {
  transform: translateY(-3px);
  filter: drop-shadow(0 6px 14px rgba(230,51,35,0.3));
}

/* ---------- Header underline on hover ---------- */
.gmu-navlink {
  position: relative; padding: 10px 14px; display: inline-block;
  font-family: var(--gmu-font-display); font-weight: 600;
  font-size: 14px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--gmu-ink); cursor: pointer;
  transition: color 180ms var(--gmu-ease-out);
}
.gmu-navlink::after {
  content: ''; position: absolute; left: 14px; right: 14px; bottom: 4px;
  height: 2px; background: var(--gmu-red); transform: scaleX(0); transform-origin: left;
  transition: transform 320ms var(--gmu-ease-out);
}
.gmu-navlink:hover, .gmu-navlink.is-active { color: var(--gmu-red); }
.gmu-navlink:hover::after, .gmu-navlink.is-active::after { transform: scaleX(1); }

/* ---------- Form field float-label ---------- */
.gmu-field {
  position: relative; display: block;
}
.gmu-field input, .gmu-field textarea, .gmu-field select {
  font-family: var(--gmu-font-body); font-size: 15px;
  padding: 22px 14px 10px;
  border: 1px solid var(--gmu-line);
  border-radius: var(--gmu-radius-1);
  background: #fff; color: var(--gmu-ink);
  width: 100%; box-sizing: border-box; outline: none;
  transition: border-color 180ms var(--gmu-ease-out), box-shadow 180ms var(--gmu-ease-out);
}
.gmu-field textarea { resize: vertical; min-height: 100px; }
.gmu-field select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  padding: 26px 34px 8px 14px; line-height: 1.2;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23888' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
  cursor: pointer;
}
.gmu-field input:focus, .gmu-field textarea:focus, .gmu-field select:focus {
  border-color: var(--gmu-red);
  box-shadow: 0 0 0 3px rgba(230,51,35,0.12);
}
.gmu-field-label {
  position: absolute; left: 14px; top: 16px;
  font-family: var(--gmu-font-display); font-weight: 600;
  font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--gmu-fg-3); pointer-events: none;
  transition: top 180ms var(--gmu-ease-out), font-size 180ms var(--gmu-ease-out), color 180ms var(--gmu-ease-out);
}
.gmu-field.is-filled .gmu-field-label,
.gmu-field input:focus + .gmu-field-label,
.gmu-field textarea:focus + .gmu-field-label,
.gmu-field select:focus + .gmu-field-label {
  top: 6px; font-size: 10px; color: var(--gmu-red);
}

/* ---------- Live ticker (number jitter) ---------- */
@keyframes gmu-ticker-blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}
.gmu-ticker-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--gmu-success); margin-right: 6px;
  animation: gmu-ticker-blink 1.6s ease-in-out infinite;
}

/* ---------- Sticky section nav rail dot ---------- */
.gmu-rail {
  position: fixed; right: 24px; top: 50%; transform: translateY(-50%);
  z-index: 50; display: flex; flex-direction: column; gap: 12px;
  pointer-events: auto;
}
.gmu-rail-dot {
  width: 11px; height: 11px;
  clip-path: polygon(50% 2%, 96% 26%, 96% 74%, 50% 98%, 4% 74%, 4% 26%);
  background: var(--gmu-ink-4); cursor: pointer; position: relative;
  transition: background 220ms var(--gmu-ease-out), transform 220ms var(--gmu-ease-out);
}
.gmu-rail-dot:hover { transform: scale(1.5); background: var(--gmu-red-700); }
.gmu-rail-dot.is-active { background: var(--gmu-red); transform: scale(1.7); }
.gmu-rail-dot .gmu-rail-tip {
  position: absolute; right: 22px; top: 50%; transform: translateY(-50%) translateX(8px);
  background: var(--gmu-ink); color: #fff;
  font-family: var(--gmu-font-display); font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 4px 10px;
  opacity: 0; pointer-events: none; white-space: nowrap;
  transition: opacity 180ms, transform 180ms;
}
.gmu-rail-dot:hover .gmu-rail-tip { opacity: 1; transform: translateY(-50%) translateX(0); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  .gmu-reveal { opacity: 1; transform: none; }
}
