/* Caribbean Group V5.1 — refined text motion for the V4.8 homepage layout. */
.motioncarousel {
  width: 8.8ch;
  min-width: 8.8ch;
  overflow: hidden;
  isolation: isolate;
}

.motioncarousel::after {
  width: 100%;
  height: 1px;
  bottom: 0;
  background: linear-gradient(90deg, #6edce8 0 34%, transparent 78%);
  opacity: .9;
}

.motioncarousel > span {
  transform-origin: left center;
  will-change: opacity, transform, filter;
}

html[data-motion="active"] .motiontitle .titleline:last-child {
  animation: headlinearrival .8s .1s both;
}

html[data-motion="active"] .motioncarousel > span {
  animation: cg-word-shift 10.5s cubic-bezier(.22,.7,.25,1) infinite;
  opacity: 0;
}

html[data-motion="active"] .motioncarousel > span:nth-child(2) { animation-delay: -7s; }
html[data-motion="active"] .motioncarousel > span:nth-child(3) { animation-delay: -3.5s; }

@keyframes cg-word-shift {
  0%, 27% { opacity: 1; transform: translateY(0); filter: blur(0); }
  32%, 94% { opacity: 0; transform: translateY(-.34em); filter: blur(2px); }
  95% { opacity: 0; transform: translateY(.3em); filter: blur(2px); }
  100% { opacity: 1; transform: translateY(0); filter: blur(0); }
}

html[data-motion-visibility="hidden"] .motioncarousel > span,
html[data-motion-visibility="hidden"] .motiontitle .titleline {
  animation-play-state: paused !important;
}

@media (max-width: 760px) {
  .motioncarousel { width: 8ch; min-width: 8ch; }
}

@media (max-width: 390px) {
  .homehero .herocopy h1 { font-size: clamp(29px, 9vw, 40px); }
  .motioncarousel { width: 7.8ch; min-width: 7.8ch; }
}

@media (prefers-reduced-motion: reduce) {
  html[data-motion="active"] .motioncarousel > span {
    animation: none !important;
    opacity: 0 !important;
    transform: none !important;
    filter: none !important;
  }
  .motioncarousel > span:first-child { opacity: 1 !important; }
}
