/* Interactive layer (js/fx.js). Everything is scoped to .fx on <html>:
   set SITE.interattivo = false in js/data.js to switch the whole layer off. */

/* ---------- Words that rise out of a mask (hero title, section titles) */
.fx .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .12em; margin-bottom: -.12em; }
.fx .w > i { display: inline-block; font-style: normal; transform: translateY(110%); transition: transform 1s var(--ease); transition-delay: calc(var(--i) * 55ms + var(--wd, 0ms)); }
.fx .is-words .w > i, .fx.is-ready .hero__body h1 .w > i { transform: none; }
.fx.is-ready .hero__body h1 { --wd: 150ms; }

/* ---------- Hero: viewfinder HUD, mouse parallax, shrink on scroll */
.fx .hero { --px: 0px; --py: 0px; --hp: 0; }
.fx:not(.is-iris) .hero__video {
  transform: translate3d(var(--px), var(--py), 0) scale(calc(1.05 - var(--hp) * .13));
  border-radius: calc(var(--hp) * 28px);
}
.fx.fx-live .hero__video { transition: transform .25s linear; }
.fx .hero__shade { opacity: calc(1 - var(--hp) * .6); }
.fx.is-ready.fx-live .hero__body { transform: translateY(calc(var(--hp) * -70px)); opacity: calc(1 - var(--hp) * 1.4); }

.hud { display: none; }
.fx .hud {
  display: block; position: absolute; inset: 88px var(--gut) 28px; pointer-events: none; z-index: 1;
  font: 500 11px/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .1em; color: rgba(243, 241, 236, .78);
  opacity: 0; transition: opacity 1.2s .6s;
  transform: translate3d(calc(var(--px) * -.6), calc(var(--py) * -.6), 0);
}
.fx.is-ready .hud { opacity: calc(1 - var(--hp) * 2); }
.hud__c { position: absolute; width: 22px; height: 22px; border: 0 solid rgba(243, 241, 236, .7); }
.hud__c--tl { left: 0; top: 0; border-width: 1.5px 0 0 1.5px; }
.hud__c--tr { right: 0; top: 0; border-width: 1.5px 1.5px 0 0; }
.hud__c--bl { left: 0; bottom: 0; border-width: 0 0 1.5px 1.5px; }
.hud__c--br { right: 0; bottom: 0; border-width: 0 1.5px 1.5px 0; }
.hud__x { position: absolute; left: 50%; top: 46%; width: 26px; height: 26px; margin: -13px 0 0 -13px; opacity: .55; }
.hud__x::before, .hud__x::after { content: ""; position: absolute; background: currentColor; }
.hud__x::before { left: 50%; top: 0; bottom: 0; width: 1px; }
.hud__x::after { top: 50%; left: 0; right: 0; height: 1px; }
.hud__data { position: absolute; right: 34px; bottom: 6px; display: flex; gap: 18px; }
.hud__data b { font-weight: 500; color: var(--ink); }
.hud__lv { position: absolute; left: 34px; bottom: 4px; display: flex; align-items: flex-end; gap: 3px; height: 14px; }
.hud__lv i { width: 3px; background: rgba(243, 241, 236, .7); height: 20%; transition: height .12s linear; }
.hud__lv i:nth-last-child(-n+2) { background: var(--red); }

/* ---------- Project cards: 3D tilt, glare, scrub with playhead and timecode */
.fx .card__btn { perspective: 1200px; }
.fx .tilt { transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .5s var(--ease); will-change: transform; }
.fx .tilt.is-tilting { transition: transform .08s linear; }
.fx .card__media::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .4s;
  background: radial-gradient(420px circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, .16), transparent 60%);
}
.fx .card__btn:hover .card__media::after { opacity: 1; }
.scrub { position: absolute; top: 0; bottom: 0; left: 0; width: 2px; margin-left: -1px; background: var(--red); opacity: 0; pointer-events: none; z-index: 2; transition: opacity .25s; }
.scrub::before { content: ""; position: absolute; left: -5px; top: 0; border: 6px solid transparent; border-top-color: var(--red); }
.scrub__tc {
  position: absolute; left: 14px; bottom: 14px; z-index: 2; padding: 6px 10px; border-radius: 6px; pointer-events: none; opacity: 0; transition: opacity .25s;
  font: 500 12px/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .08em; background: rgba(14, 14, 14, .6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.scrub__tc::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--red); }
.card.is-scrub .scrub, .card.is-playing .scrub__tc { opacity: 1; }
.scrub__ticks { position: absolute; left: 0; right: 0; bottom: 0; height: 9px; z-index: 1; pointer-events: none; opacity: 0; transition: opacity .25s;
  background: repeating-linear-gradient(90deg, rgba(243, 241, 236, .55) 0 1px, transparent 1px 10%); }
.card.is-playing .scrub__ticks { opacity: 1; }
.fx .card.fx-pop { animation: fx-pop .6s var(--ease) both; animation-delay: calc(var(--n, 0) * 50ms); }
@keyframes fx-pop { from { opacity: 0; transform: translateY(24px) scale(.97); } }

/* ---------- Magnetic buttons, nav underline */
.fx .mag { transition: transform .35s var(--ease), background .3s, color .3s, border-color .3s; }
.fx .mag.is-mag { transition: transform .1s linear, background .3s, color .3s, border-color .3s; }
.fx .top__nav a:not(.top__cta) { position: relative; }
.fx .top__nav a:not(.top__cta)::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; background: var(--red); transform: scaleX(0); transform-origin: 0 50%; transition: transform .35s var(--ease); }
.fx .top__nav a:not(.top__cta):hover::after, .fx .top__nav a.is-here::after { transform: scaleX(1); }

/* ---------- Reels: drag to scroll */
.fx.has-cursor .reels { cursor: none; }
.fx .reels.is-drag { scroll-snap-type: none; scroll-behavior: auto; user-select: none; }
.fx .reels.is-drag .reel { pointer-events: none; }
.fx .reel { transform: skewX(var(--sk, 0deg)); transition: transform .4s var(--ease); }

/* ---------- Clients strip driven by scroll speed */
.fx .marquee__track { animation: none; will-change: transform; }

/* ---------- Method: images drift inside their frame */
.fx .step__media:not(.compare) > img, .fx .step__media:not(.compare) > video { transform: translateY(var(--par, 0px)) scale(1.16); will-change: transform; }
.fx .step__n { display: inline-flex; align-items: center; gap: 10px; }
.fx .step__n::after { content: ""; width: 48px; height: 1px; background: var(--red); transform: scaleX(0); transform-origin: 0 50%; transition: transform .9s var(--ease) .2s; }
.fx .step__txt.is-in .step__n::after { transform: scaleX(1); }

/* ---------- Player opens like the intro iris, from the point you clicked */
.fx .modal { animation: none; }

/* ---------- Timeline: the page as an edit, with a playhead you can drag */
.tl { display: none; }
.fx-tl .progress { display: none; }
.fx-tl .tl {
  display: flex; align-items: center; gap: 16px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 55; height: 46px; padding: 0 var(--gut);
  background: rgba(14, 14, 14, .82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line);
  font: 500 11px/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .08em; color: var(--ink);
  transform: translateY(100%); transition: transform .5s var(--ease);
}
.fx-tl .tl.is-on { transform: none; }
.fx-tl body { padding-bottom: 46px; }
.tl__tc { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; min-width: 108px; font-variant-numeric: tabular-nums; }
.tl__tc::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--red); animation: blink 1.2s steps(2) infinite; }
.tl__track { position: relative; flex: 1; height: 22px; display: flex; gap: 2px; cursor: ew-resize; touch-action: none; }
.tl__clip {
  position: relative; height: 100%; padding: 0 8px; border-radius: 4px; overflow: hidden; white-space: nowrap; text-align: left; text-transform: uppercase;
  font: inherit; font-size: 10px; letter-spacing: .1em; color: rgba(243, 241, 236, .62); background: rgba(243, 241, 236, .09);
  display: flex; align-items: center; transition: background .25s, color .25s; pointer-events: none;
}
.tl__clip.is-here { background: rgba(229, 50, 45, .28); color: var(--ink); }
.tl__clip:nth-child(1) { background: rgba(243, 241, 236, .05); }
.tl__head { position: absolute; top: -8px; bottom: -8px; left: 0; width: 2px; margin-left: -1px; background: var(--red); pointer-events: none; will-change: transform; }
.tl__head::before { content: ""; position: absolute; left: -5px; top: 0; border: 6px solid transparent; border-top-color: var(--red); }
.tl__hint { flex: 0 0 auto; color: var(--ink-2); text-transform: uppercase; font-size: 10px; }
.has-cursor .tl__track { cursor: none; }
@media (max-width: 1100px) { .tl__hint { display: none; } }

@media (max-width: 700px) {
  .fx .hud { inset: 76px 14px 18px; font-size: 10px; }
  .hud__lv, .hud__x { display: none; }
  .hud__data { right: 28px; gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .fx .w > i { transform: none; }
}
