/* GIS motion layer v2 — review candidate, 8 Nov 2026.
   Apply only to confirmed, existing content wrappers. No markup or copy changes.
   Content is visible until JavaScript opts into motion; reduced-motion and
   JavaScript-disabled cases remain visible. No external dependencies. */
:root {
  --gis-motion-duration: 620ms;
  --gis-motion-distance: 40px;
}

/* Optional: add this to the existing route-card grid, not to ribbon/nav/forms. */
.gis-motion-clip {
  overflow-x: clip;
}

html.gis-motion-active [data-gis-reveal] {
  opacity: 0;
  /* Never animate FROM visible to hidden while JavaScript first activates. */
  transition: none;
  will-change: opacity, transform;
}
html.gis-motion-active.gis-motion-animate [data-gis-reveal] {
  transition: opacity var(--gis-motion-duration) ease,
              transform var(--gis-motion-duration) ease;
  transition-delay: var(--gis-reveal-delay, 0ms);
}
html.gis-motion-active [data-gis-reveal="from-left"] {
  transform: translate3d(calc(-1 * var(--gis-motion-distance)), 0, 0);
}
html.gis-motion-active [data-gis-reveal="from-right"] {
  transform: translate3d(var(--gis-motion-distance), 0, 0);
}
html.gis-motion-active [data-gis-reveal="from-below"] {
  transform: translate3d(0, 22px, 0);
}
html.gis-motion-active [data-gis-reveal="from-above"] {
  transform: translate3d(0, calc(-1 * var(--gis-motion-distance)), 0);
}
[data-gis-reveal="block-rise"] {
  --gis-motion-duration: 1500ms;
}
html.gis-motion-active [data-gis-reveal="block-rise"] {
  transform: translate3d(0, 36px, 0);
}

[data-gis-reveal="gis-example-rise"] {
  --gis-motion-duration: 1500ms;
}
html.gis-motion-active [data-gis-reveal="gis-example-rise"] {
  transform: translate3d(0, 80px, 0);
}
@media (min-width: 901px) {
  html.gis-motion-active.gis-motion-animate [data-gis-reveal="gis-example-rise"]:not(:focus-within) {
    transition-delay: 180ms;
  }
}

html.gis-motion-active [data-gis-reveal].gis-revealed {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  will-change: auto;
}

.route-grid.gis-motion-clip > .route {
  --gis-motion-duration: 1500ms;
}

@media (min-width: 701px) {
  .route-grid.gis-motion-clip > .route {
    --gis-motion-distance: 115%;
  }
}

html.gis-motion-active.gis-motion-animate [data-gis-reveal]:focus-within {
  opacity: 1;
  transform: none;
  transition: none;
}

/* Opt-in image wipe: only use on existing decorative/non-interactive artwork. */
.gis-motion-wipe {
  position: relative;
  overflow: hidden;
}
.gis-motion-wipe::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--gis-motion-wipe-colour, #fffdfa);
  transform: translateX(101%);
  transition: transform 500ms ease-in-out 500ms;
  pointer-events: none;
}
html.gis-motion-active .gis-motion-wipe[data-gis-reveal]::after {
  transform: translateX(0);
}
html.gis-motion-active .gis-motion-wipe.gis-revealed::after {
  transform: translateX(101%);
}

/* Reference-inspired static 1px underline, optional and non-animated. */
.gis-motion-underlined-label {
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .45em;
}

@media (max-width: 720px) {
  :root { --gis-motion-distance: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  html.gis-motion-active [data-gis-reveal] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    will-change: auto !important;
  }
  .gis-motion-wipe::after {
    transform: translateX(101%) !important;
    transition: none !important;
  }
}

/* The colour travels with each service introduction. */
.gis-hero-entry-copy,
.osp-hero-entry {
  min-width: 0;
  padding: clamp(0.875rem, 2vw, 1.75rem);
  border-radius: 12px;
}

.gis-hero-entry-copy {
  background: #edf3ff;
  border: 1px solid #dbe5f8;
}

.osp-hero-entry {
  background: #edf6f3;
  border: 1px solid #d9e8e4;
}

/* The AI Exposure Review introduction enters as one block on page load. */
@media (prefers-reduced-motion: no-preference) {
  .gis-hero-entry {
    overflow-x: clip;
  }
  .gis-hero-entry-copy {
    animation: gis-hero-arrive 1500ms both;
  }
  .gis-hero-entry-copy:focus-within {
    animation: none;
  }
}

@keyframes gis-hero-arrive {
  0% {
    opacity: 0.35;
    transform: translate3d(100vw, -18px, 0);
    animation-timing-function: cubic-bezier(0.2, 0.65, 0.3, 1);
  }
  82% {
    opacity: 0.96;
    transform: translate3d(0, -10px, 0);
    animation-timing-function: ease-out;
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

/* The OSPDesk introduction and enquiry form rise together on page load. */
@media (prefers-reduced-motion: no-preference) {
  .osp-hero-entry {
    animation: osp-hero-arrive 1500ms cubic-bezier(0.25, 0.25, 0.45, 1) both;
  }
  .osp-hero-entry:focus-within {
    animation: none;
  }
}

@keyframes osp-hero-arrive {
  from {
    opacity: 0.35;
    transform: translateY(80vh);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* On the two-column layout, the Snapshot crosses the rising enquiry panel. */
@media (min-width: 901px) and (prefers-reduced-motion: no-preference) {
  .osp-snapshot-entry {
    animation: osp-snapshot-arrive 1500ms cubic-bezier(0.25, 0.25, 0.45, 1) both;
  }
  .osp-snapshot-entry:focus-within {
    animation: none;
  }
}

@keyframes osp-snapshot-arrive {
  from {
    opacity: 0.35;
    transform: translateX(-100vw);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.resources-hero,
.templates-hero {
  overflow: hidden;
  overflow: clip;
}

.resources-hero-entry,
.templates-hero-panel {
  background: linear-gradient(110deg, #edf3ff, #edf6f3);
  border: 1px solid #dbe5eb;
  border-radius: 12px;
  padding: clamp(1rem, 3vw, 2rem);
}

@media (prefers-reduced-motion: no-preference) {
  .resources-hero-entry {
    animation: resources-hero-arrive 1500ms cubic-bezier(0.25, 0.25, 0.45, 1) both;
  }
}

@keyframes resources-hero-arrive {
  from {
    opacity: 0.35;
    transform: translateY(-45vh);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .templates-hero-panel {
    animation: templates-hero-arrive 1500ms cubic-bezier(0.25, 0.25, 0.45, 1) both;
  }
}

@keyframes templates-hero-arrive {
  from {
    opacity: 0.35;
    transform: translateX(-82vw);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
