/* =====================================================================================
   DBCK motion layer — styles for motion.js (cursor, 3D splits, tilt, floating shapes,
   marquee, scroll progress) and cross-page view transitions. Loaded on every page.
   ===================================================================================== */

/* Smooth page-to-page transitions (cross-document View Transitions; ignored where unsupported) */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root) { animation: vt-out 420ms cubic-bezier(.65, 0, .35, 1) both; }
  ::view-transition-new(root) { animation: vt-in 620ms cubic-bezier(.22, 1, .36, 1) both; }
}
@keyframes vt-out { to { opacity: 0; transform: scale(.985); filter: blur(4px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(18px); } }

/* Lenis */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

/* Scroll progress */
.scroll-progress {
  position: fixed; inset: 0 0 auto 0; z-index: 400; height: 3px;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold-bright), var(--gold));
  transform: scaleX(0); transform-origin: 0 50%; pointer-events: none;
}

/* Split headlines: each word rises out of a mask and unfolds in 3D */
.split-word { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; perspective: 600px; }
.split-inner { display: inline-block; transform-style: preserve-3d; will-change: transform; }

/* 3D tilt glare */
[data-tilt] { position: relative; transform-style: preserve-3d; will-change: transform; }
.tilt-glare {
  position: absolute; inset: 0; z-index: 3; border-radius: inherit; pointer-events: none;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 238, 196, .38), transparent 55%);
  mix-blend-mode: soft-light; opacity: 0; transition: opacity .35s ease;
}
[data-tilt].is-tilting .tilt-glare { opacity: 1; }
.tilt-depth { transform: translateZ(40px); }
.tilt-depth-lg { transform: translateZ(70px); }

/* Custom cursor (fine pointers only; the native cursor stays visible) */
.cursor { position: fixed; inset: 0; z-index: 500; pointer-events: none; opacity: 0; transition: opacity .3s; }
.cursor.is-active { opacity: 1; }
.cursor__dot, .cursor__ring, .cursor__label { position: fixed; left: 0; top: 0; }
.cursor__dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: var(--gold); }
.cursor__ring {
  width: 38px; height: 38px; margin: -19px 0 0 -19px; border-radius: 50%;
  border: 1px solid rgba(168, 132, 63, .75);
  transition: width .35s var(--ease-out), height .35s var(--ease-out), margin .35s var(--ease-out), background .35s, border-color .35s;
}
.cursor.is-hover .cursor__ring { width: 64px; height: 64px; margin: -32px 0 0 -32px; background: rgba(168, 132, 63, .12); border-color: var(--gold); }
.cursor.is-down .cursor__ring { width: 30px; height: 30px; margin: -15px 0 0 -15px; }
.cursor.has-label .cursor__ring { width: 92px; height: 92px; margin: -46px 0 0 -46px; background: var(--maroon); border-color: var(--gold); }
.cursor__label {
  width: 92px; margin: -.6em 0 0 -46px; text-align: center;   /* GSAP moves it with transform */
  font-size: .68rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-bright);
  opacity: 0; transition: opacity .25s;
}
.cursor.has-label .cursor__label { opacity: 1; }

/* Floating 3D shapes (generated by motion.js inside [data-float-shapes]) */
[data-float-shapes] { position: relative; isolation: isolate; overflow: clip; }   /* shapes never cause sideways scroll */
.float-shape {
  position: absolute; left: var(--x); top: var(--y); z-index: -1; pointer-events: none;
  transform-style: preserve-3d;
  animation: float-3d var(--t, 16s) ease-in-out var(--d, 0s) infinite alternate;
  opacity: .5;
}
.float-shape--ring { width: calc(90px * var(--s)); height: calc(90px * var(--s)); border: 1.5px solid var(--gold); border-radius: 50%; }
.float-shape--ring::after { content: ""; position: absolute; inset: 18%; border: 1px solid rgba(168, 132, 63, .5); border-radius: 50%; transform: rotateX(70deg); }
.float-shape--dot { width: calc(10px * var(--s)); height: calc(10px * var(--s)); border-radius: 50%; background: var(--gold); box-shadow: 0 0 24px 6px rgba(168, 132, 63, .45); }
.float-shape--cube { width: calc(44px * var(--s)); height: calc(44px * var(--s)); animation-name: float-cube; }
.float-shape--cube i {
  position: absolute; inset: 0; border: 1px solid rgba(168, 132, 63, .85); background: rgba(168, 132, 63, .06);
}
.float-shape--cube i:nth-child(1) { transform: translateZ(calc(22px * var(--s))); }
.float-shape--cube i:nth-child(2) { transform: rotateY(180deg) translateZ(calc(22px * var(--s))); }
.float-shape--cube i:nth-child(3) { transform: rotateY(90deg) translateZ(calc(22px * var(--s))); }
.float-shape--cube i:nth-child(4) { transform: rotateY(-90deg) translateZ(calc(22px * var(--s))); }
.float-shape--cube i:nth-child(5) { transform: rotateX(90deg) translateZ(calc(22px * var(--s))); }
.float-shape--cube i:nth-child(6) { transform: rotateX(-90deg) translateZ(calc(22px * var(--s))); }
@keyframes float-3d {
  0%   { transform: translate3d(0, 0, 0) rotateX(0deg) rotateY(0deg) rotateZ(0deg); }
  50%  { transform: translate3d(18px, -26px, 40px) rotateX(55deg) rotateY(35deg) rotateZ(20deg); }
  100% { transform: translate3d(-14px, 12px, -20px) rotateX(110deg) rotateY(80deg) rotateZ(45deg); }
}
@keyframes float-cube {
  0%   { transform: rotateX(-20deg) rotateY(0deg) translateY(0); }
  100% { transform: rotateX(340deg) rotateY(360deg) translateY(-30px); }
}
.section--maroon .float-shape, .on-dark .float-shape { opacity: .55; }
.section--alt .float-shape, .section .float-shape { opacity: .45; }

/* Marquee */
[data-marquee] { overflow: hidden; }
.marquee__track { display: flex; width: max-content; will-change: transform; }

/* Glass surface used on dark sections */
.glass {
  background: linear-gradient(145deg, rgba(255, 245, 225, .10), rgba(255, 245, 225, .03));
  border: 1px solid rgba(201, 165, 94, .28);
  backdrop-filter: blur(14px) saturate(130%);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 240, 210, .12);
}

/* Static fallback: no JS animation library or reduced motion */
.motion-static .float-shape, .motion-reduced .float-shape { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .float-shape { animation: none !important; }
}
