/*
 * WaveMark high-end refinement layer.
 * New production-safe adjustments live here instead of extending the legacy
 * stylesheet. The original visual system remains intact underneath.
 */

:root {
  --wm-focus: #6bcef3;
  --wm-focus-dark: #07183f;
}

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

body {
  overflow-x: clip;
}

/* Width/height attributes reserve aspect ratio; component rules can still
   override this when an image intentionally fills a frame. */
img {
  height: auto;
}

body.menu-open {
  overflow: hidden;
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--wm-focus);
  outline-offset: 4px;
}

.portfolio-field-tile:focus-visible,
.filter-button:focus-visible,
.case-story-rail button:focus-visible {
  outline-color: white;
  outline-offset: 3px;
}

/* Keep secondary case copy legible over the pale portfolio act. */
body:has(.portfolio-museum-hero) .case-study-coverage p {
  color: #425675;
  font-size: max(.86rem, 14px);
}

body:has(.portfolio-museum-hero) .portfolio-gallery-hint,
body:has(.portfolio-museum-hero) .portfolio-gallery-topline {
  font-size: max(.72rem, 12px);
  letter-spacing: .08em;
}

/* One contextual cue teaches the primary gesture without looking clickable. */
.scroll-gesture-cue {
  position: absolute;
  z-index: 18;
  left: 50%;
  bottom: clamp(22px, 4vh, 42px);
  display: flex;
  gap: 12px;
  align-items: center;
  color: rgba(255,255,255,.82);
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  opacity: 0;
  transform: translate3d(-50%, 12px, 0);
  transition: opacity .45s ease, transform .6s var(--ease-premium);
  pointer-events: none;
}

.scroll-gesture-cue.is-visible {
  opacity: 1;
  transform: translate3d(-50%, 0, 0);
}

.scroll-gesture-cue.is-dismissed {
  opacity: 0;
  transform: translate3d(-50%, -10px, 0);
}

.scroll-gesture-icon {
  position: relative;
  width: 22px;
  height: 34px;
  border: 1px solid rgba(255,255,255,.66);
  border-radius: 14px;
}

.scroll-gesture-icon i {
  position: absolute;
  top: 7px;
  left: 50%;
  width: 3px;
  height: 7px;
  border-radius: 3px;
  background: var(--sky);
  transform: translateX(-50%);
  animation: wmScrollGesture 1.45s ease-in-out infinite;
}

@keyframes wmScrollGesture {
  0%, 100% { opacity: .2; transform: translate(-50%, 0); }
  42% { opacity: 1; }
  72% { opacity: .15; transform: translate(-50%, 11px); }
}

/* A tighter edit of the existing scroll choreography. */
@media (min-width: 801px) and (prefers-reduced-motion: no-preference) {
  .immersive-hero.scroll-scene {
    height: 178svh;
    min-height: 1220px;
  }

  .home-services[data-card-stack] .section-heading {
    margin-bottom: clamp(34px, 5vh, 48px);
  }

  .home-services[data-card-stack] .service-stack {
    gap: 10vh;
  }

  .execution-bridge {
    height: 108vh;
    min-height: 780px;
    margin-top: -4vh;
  }

  .proof-choreography[data-proof-scene] {
    min-height: 235vh;
  }

  .coverage[data-coverage-pin] {
    height: 118vh;
    min-height: 850px;
  }

  .about-network-v3 {
    min-height: 162vh;
  }

  .retail-journey,
  .btl-canvas,
  .scanmark-flow {
    min-height: 175svh;
  }

  .execution-rhythm-services {
    min-height: 115svh !important;
  }

  body:has(.portfolio-museum-hero) .case-studies[data-case-stories] {
    height: 285svh;
    min-height: 1850px;
  }
}

@media (max-width: 800px) {
  html { scroll-padding-top: 76px; }

  .scroll-gesture-cue {
    bottom: max(22px, env(safe-area-inset-bottom));
    width: max-content;
    max-width: calc(100% - 42px);
    font-size: .58rem;
    letter-spacing: .09em;
  }

  .scroll-gesture-icon {
    width: 26px;
    height: 30px;
    border: 0;
  }

  .scroll-gesture-icon::before {
    content: "☝";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: white;
    font-size: 1.45rem;
    animation: wmTouchGesture 1.45s ease-in-out infinite;
  }

  .scroll-gesture-icon i { display: none; }
}

@keyframes wmTouchGesture {
  0%, 100% { opacity: .25; transform: translateY(7px); }
  45% { opacity: 1; }
  75% { opacity: .15; transform: translateY(-8px); }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-gesture-cue { display: none; }
  .scroll-gesture-icon i,
  .scroll-gesture-icon::before { animation: none; }
}
