/* Load after the page styles. Without motion-ready, all content stays visible. */
.motion-ready [data-motion-item]:nth-child(n) {
  --reveal-distance: 16px;
  opacity: 0;
  translate: 0 var(--reveal-distance);
  transition: opacity 480ms ease, translate 600ms cubic-bezier(.2, .7, .2, 1), scale 140ms ease, filter 220ms ease;
  transition-delay: clamp(0ms, var(--reveal-delay, 0ms), 280ms), clamp(0ms, var(--reveal-delay, 0ms), 280ms), 0ms, 0ms;
}

/* Replace the old reveal transform without touching native component transforms. */
.motion-ready .reveal[data-motion-item] { transform: none; }
.motion-ready [data-motion-item].motion-heading { --reveal-distance: 18px; }
.motion-ready .history-text-line[data-motion-item]:nth-child(n) {
  --reveal-distance: 12px;
  transition-duration: 450ms, 550ms, 140ms, 220ms;
}
.motion-ready [data-motion-item]:nth-child(n).is-visible {
  opacity: 1;
  translate: none;
}

.brand-stats .stat img {
  transition: scale 220ms ease, filter 220ms ease;
}
.about-investor { transition: translate 240ms ease; }
.co-strength img {
  transition: translate 240ms ease, scale 240ms ease, filter 240ms ease;
}
/* The old hover transform is replaced by the fine-pointer effect below. */
.co-strength:hover img { transform: none; }

@media (hover: hover) and (pointer: fine) {
  .brand-stats .stat:hover img {
    scale: 1.045;
    filter: brightness(1.1);
  }
  .about-investor:hover,
  .motion-ready .about-investor[data-motion-item].is-visible:hover {
    translate: 0 -3px;
  }
  .co-strength:hover img {
    translate: 0 -3px;
    scale: 1.035;
    filter: brightness(1.08);
  }
  [data-carousel] .co-carousel__viewport { cursor: grab; }
  [data-carousel].is-dragging .co-carousel__viewport,
  [data-carousel].is-dragging .co-preview-select { cursor: grabbing; }
}

/* Individual scale preserves city skew, arrow offsets and footer positioning. */
.city-grid button {
  transition: background 250ms, color 250ms, border-color 250ms, scale 140ms ease, filter 140ms ease;
}
.co-carousel__arrow {
  transition: background 200ms ease, transform 200ms ease, scale 140ms ease, filter 140ms ease;
}
.carousel-dots button {
  transition: background 250ms, transform 250ms, scale 140ms ease;
}
.contact-trigger, .modal-close, .image-zoom {
  transition: scale 140ms ease, filter 140ms ease;
}
.back-top {
  transition: opacity 250ms, visibility 250ms, transform 250ms, background 200ms, scale 140ms ease;
}
:is(.city-grid button, .co-carousel__arrow, .carousel-dots button, .contact-trigger, .modal-close, .back-top, .image-zoom):not(:disabled):not([aria-disabled="true"]):active {
  scale: .97;
}
.site-footer .footer-contact:not(:disabled):not([aria-disabled="true"]):active { scale: .985; }
:is(.city-grid button, .co-carousel__arrow, .carousel-dots button, .contact-trigger, .modal-close, .back-top, .image-zoom, .co-preview-select):focus-visible {
  outline: 2px solid var(--yellow, #ded10b);
  outline-offset: 5px;
}

/* Native close(), Escape and focus restoration remain immediate. */
dialog.modal[open] {
  animation: juhu-dialog-in 180ms cubic-bezier(.2, .7, .2, 1) both;
}
dialog.modal[open]::backdrop { animation: juhu-backdrop-in 180ms ease both; }
@keyframes juhu-dialog-in {
  from { opacity: 0; translate: 0 8px; }
  to { opacity: 1; translate: none; }
}
@keyframes juhu-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

[data-carousel] .co-carousel__viewport { touch-action: pan-y pinch-zoom; }
[data-carousel] .co-carousel__viewport img { -webkit-user-drag: none; }
[data-carousel].is-dragging .co-carousel__viewport {
  user-select: none;
  -webkit-user-select: none;
}
.co-carousel .co-carousel__slide,
#store-showcase .co-carousel__slide {
  translate: var(--carousel-drag, 0px) 0;
  transition: left 600ms cubic-bezier(.22, .7, .2, 1), width 600ms cubic-bezier(.22, .7, .2, 1), top 600ms cubic-bezier(.22, .7, .2, 1), opacity 400ms, translate 220ms ease-out;
}
.co-carousel.is-dragging .co-carousel__slide,
#store-showcase.is-dragging .co-carousel__slide {
  transition: left 600ms cubic-bezier(.22, .7, .2, 1), width 600ms cubic-bezier(.22, .7, .2, 1), top 600ms cubic-bezier(.22, .7, .2, 1), opacity 400ms;
}
#store-showcase .co-carousel__slide.is-current .co-store-heading {
  animation: juhu-store-heading-in 240ms ease-out both;
}
@keyframes juhu-store-heading-in {
  from { opacity: .35; translate: 8px 0; }
  to { opacity: 1; translate: none; }
}

@media (max-width: 760px) {
  .motion-ready [data-motion-item]:nth-child(n) { --reveal-distance: 12px; }
  .motion-ready [data-motion-item].motion-heading { --reveal-distance: 14px; }
}

/* Restore final content immediately, including if the preference changes live. */
@media (prefers-reduced-motion: reduce) {
  [data-motion-item] {
    opacity: 1 !important;
    translate: none !important;
    transition: none !important;
  }
  .motion-ready .reveal[data-motion-item] { transform: none !important; }
  .brand-stats .stat img, .about-investor, .co-strength img,
  .city-grid button, .co-carousel__arrow, .carousel-dots button,
  .contact-trigger, .modal-close, .back-top, .image-zoom,
  .co-carousel .co-carousel__slide, #store-showcase .co-carousel__slide,
  #store-showcase .co-store-heading, dialog.modal[open] {
    animation: none !important;
    transition: none !important;
    translate: none !important;
    scale: none !important;
  }
  .brand-stats .stat img, .co-strength img { filter: none !important; }
  dialog.modal[open]::backdrop { animation: none !important; }
}
.motion-reduced [data-motion-item] {
  opacity: 1 !important;
  translate: none !important;
  transition: none !important;
}
.motion-reduced .reveal[data-motion-item] { transform: none !important; }
.motion-reduced :is(.brand-stats .stat img, .about-investor, .co-strength img, .city-grid button, .co-carousel__arrow, .carousel-dots button, .contact-trigger, .modal-close, .back-top, .image-zoom, .co-carousel__slide, .co-store-heading, dialog.modal[open]) {
  animation: none !important;
  transition: none !important;
  translate: none !important;
  scale: none !important;
}
.motion-reduced :is(.brand-stats .stat img, .co-strength img) { filter: none !important; }
.motion-reduced dialog.modal[open]::backdrop { animation: none !important; }
