/* JBYSY — motion + interaction layer
   Solid colors only. No gradients. Honours prefers-reduced-motion.
*/

/* ===== Reveal on scroll ===== */
[data-reveal],
.reveal,
.reveal-stagger > * {
  opacity: 0;
  transform: translate3d(0, 18px, 0);
  transition:
    opacity 720ms cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 720ms cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: opacity, transform;
}
[data-reveal].is-in,
.reveal.is-in,
.reveal-stagger > .is-in {
  opacity: 1;
  transform: none;
}

/* Reveal variants */
[data-reveal="fade"] { transform: none; }
[data-reveal="left"] { transform: translate3d(-24px, 0, 0); }
[data-reveal="right"] { transform: translate3d(24px, 0, 0); }
[data-reveal="scale"] { transform: scale(0.97); }

/* Stagger: each direct child gets a delay step */
.reveal-stagger > *:nth-child(1) { transition-delay: 40ms; }
.reveal-stagger > *:nth-child(2) { transition-delay: 120ms; }
.reveal-stagger > *:nth-child(3) { transition-delay: 200ms; }
.reveal-stagger > *:nth-child(4) { transition-delay: 280ms; }
.reveal-stagger > *:nth-child(5) { transition-delay: 360ms; }
.reveal-stagger > *:nth-child(6) { transition-delay: 440ms; }
.reveal-stagger > *:nth-child(7) { transition-delay: 520ms; }
.reveal-stagger > *:nth-child(8) { transition-delay: 600ms; }

/* ===== Marquee ===== */
.marquee {
  display: flex;
  overflow: hidden;
  gap: 0;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee__track {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 56px;
  padding-right: 56px;
  animation: marquee-x 38s linear infinite;
  white-space: nowrap;
}
.marquee:hover .marquee__track { animation-play-state: paused; }

@keyframes marquee-x {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-100%, 0, 0); }
}

/* ===== Accordion ===== */
[data-acc-item] [data-acc-panel] {
  overflow: hidden;
  max-height: 0;
  transition: max-height 420ms cubic-bezier(0.22, 0.61, 0.36, 1);
}
[data-acc-item] [data-acc-trigger] {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
}
[data-acc-item] [data-acc-trigger] .chev {
  transition: transform 320ms cubic-bezier(0.22, 0.61, 0.36, 1);
  flex: 0 0 auto;
}
[data-acc-item].is-open [data-acc-trigger] .chev {
  transform: rotate(180deg);
}

/* ===== Button polish — solid color, no gradient ===== */
.btn {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  transition:
    background-color 200ms ease,
    color 200ms ease,
    border-color 200ms ease,
    transform 200ms cubic-bezier(0.22, 0.61, 0.36, 1),
    box-shadow 240ms ease;
}
.btn::before {
  content: '';
  position: absolute;
  inset: -2px;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 280ms ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  box-shadow: 0 1px 0 rgba(27,42,74,0.18);
}
.btn-primary:hover {
  background: var(--navy-700);
  border-color: var(--navy-700);
  box-shadow:
    0 14px 28px -14px rgba(27,42,74,0.55),
    0 3px 8px -3px rgba(27,42,74,0.35);
}

.btn-gold:hover {
  background: var(--gold-600);
  border-color: var(--gold-600);
  color: var(--white);
  box-shadow:
    0 14px 28px -14px rgba(201,168,76,0.55),
    0 3px 8px -3px rgba(201,168,76,0.35);
}

.btn-ghost {
  position: relative;
}
.btn-ghost::after {
  content: '';
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 9px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 320ms cubic-bezier(0.22, 0.61, 0.36, 1);
  opacity: 0.7;
}
.btn-ghost:hover::after { transform: scaleX(1); }

/* ===== Mini link arrow drift ===== */
.mini-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap 220ms ease, color 200ms ease;
}
.mini-link:hover { gap: 12px; color: var(--gold-600); }

.inline-accent-link {
  position: relative;
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 1px;
  transition: background-size 280ms cubic-bezier(0.22, 0.61, 0.36, 1), color 200ms ease;
  padding-bottom: 1px;
}
.inline-accent-link:hover {
  background-size: 0% 1px;
  color: var(--gold-600);
}

/* ===== Focus rings ===== */
:where(a, button, .btn, .input, .select, .textarea):focus-visible {
  outline: 2px solid var(--gold-600);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ===== Tilt support ===== */
[data-tilt] {
  transform-style: preserve-3d;
  transition: transform 280ms cubic-bezier(0.22, 0.61, 0.36, 1);
}
[data-tilt]:hover {
  transform: perspective(800px) rotateX(var(--rx, 0)) rotateY(var(--ry, 0));
}

/* ===== Cursor follower (only when used) ===== */
[data-cursor] {
  position: fixed;
  top: 0;
  left: 0;
  width: 26px;
  height: 26px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  pointer-events: none;
  z-index: 80;
  mix-blend-mode: multiply;
  opacity: 0;
}

/* ===== Nav scrolled state ===== */
.site-nav {
  transition:
    padding 240ms cubic-bezier(0.22, 0.61, 0.36, 1),
    background 240ms ease,
    border-color 240ms ease,
    box-shadow 240ms ease,
    transform 320ms cubic-bezier(0.22, 0.61, 0.36, 1);
}
.site-nav.is-scrolled {
  background: rgba(251,250,246,0.96);
  box-shadow: 0 1px 0 rgba(15,23,41,0.04), 0 6px 18px -10px rgba(27,42,74,0.18);
}
.site-nav.is-scrolled .site-nav__inner {
  padding-top: 10px;
  padding-bottom: 10px;
}
.site-nav.is-hidden {
  transform: translateY(-100%);
}
body.nav-locked { overflow: hidden; }

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .marquee__track { animation: none !important; }
}
