/* 3D variant (build with PUBLIC_FX=3d). Everything is scoped to html.fx3d, so the normal site never sees it.
   Idea: the page heads are a room seen in perspective (yellow lane tape on the floor, LED strips on the ceiling),
   photos sit at different depths, cards tilt under the pointer, the gallery is a coverflow. */

/* ---------- the room ---------- */
.fx3d .hero, .fx3d .phero { position: relative; overflow: hidden; perspective: 900px; perspective-origin: 62% 42%; background: #07070c; --mx: 0; --my: 0; --sy: 0; }
.fx3d .hero > :not(.room), .fx3d .phero > :not(.room) { position: relative; z-index: 1; }
.fx3d .room { position: absolute; inset: 0; z-index: 0; pointer-events: none; transform-style: preserve-3d;
  transform: translate3d(calc(var(--mx) * -26px), calc(var(--my) * -12px), calc(var(--sy) * 240px)) rotateY(calc(var(--mx) * 3deg)); }
.fx3d .room--still { transform: none; }
.fx3d .room__floor, .fx3d .room__ceil { position: absolute; left: -75%; width: 250%; height: 2400px; backface-visibility: hidden; }
.fx3d .room__floor { bottom: 0; transform-origin: 50% 100%; transform: rotateX(80deg);
  background:
    linear-gradient(to bottom, #07070c 0%, rgba(7, 7, 12, 0) 55%),
    repeating-linear-gradient(90deg, transparent 0 254px, rgba(255, 200, 61, 0.95) 254px 260px),
    repeating-linear-gradient(0deg, transparent 0 196px, rgba(255, 255, 255, 0.09) 196px 200px),
    linear-gradient(0deg, #1a1a28, #0b0b12);
  animation: fx-walk 7s linear infinite; }
.fx3d .room__ceil { top: 0; transform-origin: 50% 0; transform: rotateX(-80deg);
  background:
    linear-gradient(to top, #07070c 0%, rgba(7, 7, 12, 0) 55%),
    repeating-linear-gradient(90deg, transparent 0 470px, rgba(123, 92, 255, 0) 470px, rgba(170, 150, 255, 1) 486px, rgba(123, 92, 255, 0) 502px, transparent 502px 520px),
    repeating-linear-gradient(90deg, transparent 0 990px, rgba(62, 230, 192, 0) 990px, rgba(62, 230, 192, 0.8) 1004px, rgba(62, 230, 192, 0) 1018px, transparent 1018px 1040px),
    linear-gradient(180deg, #14131f, #0a0a10); }
@keyframes fx-walk { to { background-position: 0 0, 0 0, 0 200px, 0 0; } }
.fx3d .room__fog { position: absolute; inset: 0;
  background:
    radial-gradient(60% 36% at 62% 42%, rgba(123, 92, 255, 0.42), transparent 70%),
    linear-gradient(90deg, rgba(7, 7, 12, 0.9) 0%, rgba(7, 7, 12, 0.55) 46%, rgba(7, 7, 12, 0) 78%); }
.fx3d .phero .room__fog { background: radial-gradient(60% 40% at 62% 42%, rgba(123, 92, 255, 0.34), transparent 70%), linear-gradient(90deg, rgba(7, 7, 12, 0.92) 0%, rgba(7, 7, 12, 0.6) 55%, rgba(7, 7, 12, 0.15) 100%); }
.fx3d .ihero { background: #07070c; }
.fx3d .hero .strip { background: rgba(7, 7, 12, 0.78); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }

/* ---------- hero: photos at different depths ---------- */
.fx3d .hero__in, .fx3d .hero__media { transform-style: preserve-3d; }
.fx3d .hero__txt { transform: translate3d(calc(var(--mx) * 8px), calc(var(--my) * 5px), 0); }
.fx3d .hero__media { transform: rotateY(calc(-13deg + var(--mx) * 9deg)) rotateX(calc(3deg + var(--my) * -6deg)) translateY(calc(var(--sy) * -50px)); }
.fx3d .hero__video { transform: translateZ(30px); box-shadow: 0 50px 90px rgba(0, 0, 0, 0.6), 0 0 90px rgba(123, 92, 255, 0.45); }
.fx3d .hero__photo { transform: translateZ(150px) translateX(-9%); box-shadow: 0 40px 70px rgba(0, 0, 0, 0.65); border: 1px solid rgba(255, 255, 255, 0.16); }
.fx3d .hero .display .tape { display: inline-block;
  text-shadow: 1px 1px 0 #d9a520, 2px 2px 0 #c7961a, 3px 3px 0 #b58715, 4px 4px 0 #a37911, 5px 5px 0 #916b0d, 6px 6px 0 #7f5d0a, 7px 7px 0 #6d4f07, 8px 8px 0 #5b4205, 14px 20px 34px rgba(0, 0, 0, 0.75); }
@media (max-width: 899px) {
  .fx3d .hero, .fx3d .phero { perspective-origin: 50% 30%; }
  .fx3d .hero__media { transform: rotateY(calc(-9deg + var(--mx) * 8deg)) rotateX(calc(2deg + var(--my) * -4deg)); margin-inline: 4%; }
  .fx3d .hero__photo { transform: translateZ(90px) translateX(-6%); }
  .fx3d .room__fog { background: radial-gradient(90% 30% at 50% 30%, rgba(123, 92, 255, 0.36), transparent 70%), linear-gradient(180deg, rgba(7, 7, 12, 0.78) 0%, rgba(7, 7, 12, 0.5) 45%, rgba(7, 7, 12, 0) 80%); }
}

/* ---------- things arrive from depth ---------- */
.fx3d.js [data-reveal]:not(.in) { opacity: 0; transform: perspective(1000px) rotateX(20deg) translateY(56px) scale(0.95); transform-origin: 50% 100%; }
.fx3d.js [data-reveal] { transition: opacity .7s ease, transform .9s cubic-bezier(.2, .8, .2, 1); }

/* ---------- photos that turn as you scroll past ---------- */
.fx3d [data-par] { transform: perspective(1100px) rotateY(calc(var(--p, 0) * var(--turn, -16deg))) rotateX(calc(var(--p, 0) * 7deg)) translateZ(var(--z, 0px)); transition: transform .18s linear; will-change: transform; }
.fx3d .trial__class[data-par] { box-shadow: 0 40px 70px -24px rgba(20, 16, 50, 0.5); }
.fx3d .trial__scale[data-par] { --z: 90px; --turn: -26deg; box-shadow: 0 34px 60px rgba(20, 16, 50, 0.45); }
.fx3d .about__imgs > .frame[data-par]:last-child { --z: 60px; --turn: 20deg; }
.fx3d .about__imgs > .frame[data-par] { box-shadow: 0 40px 70px -20px rgba(0, 0, 0, 0.7); }

/* ---------- cards tilt under the pointer ---------- */
.fx3d.js [data-tilt].in, .fx3d [data-tilt]:not([data-reveal]) { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }
.fx3d [data-tilt] { transform-style: preserve-3d; position: relative; }
.fx3d [data-tilt].is-tilting { transition: transform .1s linear, box-shadow .2s; z-index: 2; }
.fx3d .cls[data-tilt] .frame, .fx3d .post[data-tilt] .frame { transform: translateZ(1px); transition: transform .25s ease, box-shadow .25s ease; }
.fx3d .cls.is-tilting .frame, .fx3d .post.is-tilting .frame { transform: translateZ(46px); box-shadow: 0 36px 60px -18px color-mix(in srgb, var(--c, #7b5cff) 55%, transparent); }
.fx3d .cls[data-tilt] .h3, .fx3d .post[data-tilt] .h3 { transition: transform .25s ease; }
.fx3d .cls.is-tilting .h3, .fx3d .post.is-tilting .h3 { transform: translateZ(26px); }
.fx3d .card[data-tilt].is-tilting { box-shadow: 0 40px 70px -24px rgba(74, 47, 214, 0.7); }
.fx3d [data-tilt]::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .2s;
  background: radial-gradient(420px circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, 0.16), transparent 60%); }
.fx3d [data-tilt].is-tilting::after { opacity: 1; }

/* ---------- gallery: a corridor you walk through by scrolling ---------- */
.fx3d .gal--walk { padding: 0; }
.fx3d .walk { position: relative; height: calc(100vh + var(--n) * 260px); }
.fx3d .walk__stick { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; perspective: 900px; perspective-origin: 50% 50%; background: #07070c; --cz: 0px; }
.fx3d .walk .room__floor, .fx3d .walk .room__ceil { left: -100%; width: 300%; }
.fx3d .walk .room__floor { animation: none; background-position: 0 0, 0 0, 0 var(--cz), 0 0; }
.fx3d .walk__fog { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(46% 34% at 50% 50%, rgba(123, 92, 255, 0.5), rgba(7, 7, 12, 0) 70%); }
.fx3d .walk__cam { position: absolute; inset: 0; transform-style: preserve-3d; transform: translateZ(var(--cz)); will-change: transform; }
.fx3d .walk__p, .fx3d .walk__end { position: absolute; top: 50%; left: 50%; }
.fx3d .walk__p { height: min(56vh, 460px); width: auto; flex: none;
  transform: translate(-50%, -50%) translate3d(calc(var(--side) * min(31vw, 430px)), 0, calc(var(--i) * -480px)) rotateY(calc(var(--side) * -40deg));
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 50px 80px rgba(0, 0, 0, 0.7), 0 0 70px rgba(123, 92, 255, 0.35); }
.fx3d .walk__end { transform: translate(-50%, -50%) translateZ(calc(var(--i) * -480px)); display: grid; justify-items: center; gap: 22px; text-align: center; width: min(86vw, 620px); }
.fx3d .walk__end b { font-stretch: 64%; font-weight: 800; text-transform: uppercase; font-size: clamp(3rem, 9vw, 6.4rem); line-height: 0.9; color: var(--tape);
  text-shadow: 1px 1px 0 #d9a520, 2px 2px 0 #c7961a, 3px 3px 0 #b58715, 4px 4px 0 #a37911, 5px 5px 0 #916b0d, 6px 6px 0 #7f5d0a, 12px 18px 30px rgba(0, 0, 0, 0.8); }
.fx3d .walk__head { position: absolute; left: 0; right: 0; top: clamp(76px, 11vh, 120px); z-index: 2; pointer-events: none; text-shadow: 0 2px 30px #07070c, 0 0 12px #07070c; }
.fx3d .walk__head .h2 { margin-bottom: 0 !important; }
.fx3d .walk__bar { position: absolute; left: var(--gut); right: var(--gut); bottom: clamp(84px, 11vh, 110px); height: 3px; background: rgba(255, 255, 255, 0.14); z-index: 2; border-radius: 2px; }
.fx3d .walk__bar i { display: block; height: 100%; width: 100%; background: var(--tape); transform-origin: 0 50%; transform: scaleX(var(--pr, 0)); border-radius: 2px; }
@media (max-width: 899px) {
  .fx3d .walk__p { height: min(40vh, 320px); transform: translate(-50%, -50%) translate3d(calc(var(--side) * 21vw), calc(var(--side) * 5vh), calc(var(--i) * -480px)) rotateY(calc(var(--side) * -30deg)); }
}

/* ---------- more depth ---------- */
.fx3d .hero__in { transform-origin: 50% 100%; transform: rotateX(calc(var(--sy) * 16deg)) translateZ(calc(var(--sy) * -140px)); opacity: calc(1 - var(--sy) * 0.85); }
.fx3d .btn:not(.btn--line):not(.btn--tape) { box-shadow: 0 6px 0 #3a23b8, 0 14px 24px rgba(0, 0, 0, 0.35); transform: translateY(-3px); transition: transform .08s, box-shadow .08s, background .15s; }
.fx3d .btn:not(.btn--line):not(.btn--tape):hover { transform: translateY(-5px); box-shadow: 0 8px 0 #3a23b8, 0 20px 30px rgba(0, 0, 0, 0.4); }
.fx3d .btn:not(.btn--line):not(.btn--tape):active { transform: translateY(3px); box-shadow: 0 0 0 #3a23b8; }
.fx3d .dock .btn, .fx3d .dock a { box-shadow: none !important; transform: none !important; }
.fx3d .svc__img { transition: transform .3s cubic-bezier(.2, .8, .2, 1), box-shadow .3s; }
.fx3d .svc__a:hover .svc__img { transform: perspective(700px) rotateY(-16deg) rotateX(4deg) scale(1.1); box-shadow: 26px 30px 40px -14px rgba(20, 16, 50, 0.5); }
.fx3d .six__mats { transform: perspective(260px) rotateX(48deg) rotateZ(-6deg); transform-origin: 50% 100%; }
.fx3d .six__mats i { box-shadow: 0 5px 0 #7f5d0a; }
.fx3d.js .cls[data-par].in { transform: perspective(1100px) rotateY(calc(var(--p, 0) * var(--turn, -16deg))) rotateX(calc(var(--p, 0) * 9deg)); transition: transform .18s linear; }
.fx3d .cls[data-par]:nth-child(even) { --turn: 16deg; }

/* ---------- big figures stand off the page ---------- */
.fx3d .limit b { text-shadow: 1px 1px 0 #3d26b5, 2px 2px 0 #3520a0, 3px 3px 0 #2d1b8b, 4px 4px 0 #261776, 8px 12px 18px rgba(20, 16, 50, 0.35); }

@media (prefers-reduced-motion: reduce) {
  .fx3d .room__floor { animation: none; }
  .fx3d [data-par], .fx3d [data-tilt], .fx3d .hero__media, .fx3d .hero__in, .fx3d .room { transform: none !important; }
}

/* inner pages: text sits on the floor, so the tape is quieter there */
.fx3d .phero .room__floor { opacity: 0.4; }

/* phones: the big planes are the memory cost (an iPhone tab was killed at the gallery), so they are smaller and never repainted */
@media (max-width: 899px) {
  .fx3d .room__floor, .fx3d .room__ceil { height: 1300px; left: -50%; width: 200%; animation: none; }
  .fx3d .walk .room__floor, .fx3d .walk .room__ceil { left: -50%; width: 200%; }
  .fx3d .walk .room__floor { background-position: 0 0; }
  .fx3d .walk__p { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14); }
  .fx3d .walk__cam { will-change: auto; }
}
