/* Exponential Network — motion layer. Everything here is gated on html.js and switched off for reduced motion. */

/* ---------- Scroll reveals ---------- */
.js [data-reveal] { opacity: 0; transition: opacity var(--dur-slow) var(--ease-out), translate var(--dur-slow) var(--ease-out), scale var(--dur-slow) var(--ease-out), clip-path 1.1s var(--ease-out), filter var(--dur-slow) var(--ease-out); transition-delay: calc(var(--i, 0) * 80ms + var(--d, 0ms)); }
.js [data-reveal="up"], .js [data-reveal=""] { translate: 0 36px; }
.js [data-reveal="left"] { translate: -48px 0; }
.js [data-reveal="right"] { translate: 48px 0; }
.js [data-reveal="scale"] { scale: .94; }
.js [data-reveal="blur"] { translate: 0 20px; filter: blur(10px); }
.js [data-reveal="clip"] { opacity: 1; clip-path: inset(18% 0 0 0); }
.js [data-reveal="clip"] img { scale: 1.18; transition: scale 1.6s var(--ease-out), transform 1.2s var(--ease-out); }
.js [data-reveal].is-in { opacity: 1; translate: none; scale: none; filter: none; clip-path: inset(0 0 0 0); }
.js [data-reveal="clip"].is-in img { scale: none; }

/* Lines that draw themselves */
.js .f-nums > div::before, .js .f-close::before { transform: scaleX(0); }
.js .f-nums.is-in > div::before, .js .f-close.is-in::before { transform: scaleX(1); }
.js .f-nums.is-in > div:nth-child(2)::before { transition-delay: .12s; }
.js .f-nums.is-in > div:nth-child(3)::before { transition-delay: .24s; }

/* ---------- Split headlines (word by word) ---------- */
.split .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .12em; margin-bottom: -.12em; }
.split .w > span { display: inline-block; transform: translate3d(0, 110%, 0); transition: transform 1.1s var(--ease-out); transition-delay: calc(var(--wi, 0) * 55ms + var(--d, 0ms)); }
.split.is-in .w > span { transform: none; }

/* ---------- Hero entrance ---------- */
.js .f-hero-media .media { transform: scale(1.12); transition: transform 2.4s var(--ease-out); }
.js .is-loaded .f-hero-media .media { transform: scale(1); }
.f-hero-media .media img { transform: translate3d(var(--hx, 0), var(--hy, 0), 0) scale(1.06); transition: transform 1.4s var(--ease-out); }

/* ---------- Smooth scrolling ---------- */
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* ---------- Parallax ---------- */
[data-parallax] { will-change: transform; }

/* ---------- Section transitions: sections rise in as rounded panels and flatten once in view ---------- */
.js [data-rise] { --e: 1; clip-path: inset(0 calc((1 - var(--e)) * 3.5vw) 0 round calc((1 - var(--e)) * 56px) calc((1 - var(--e)) * 56px) 0 0); }

/* ---------- 3D tilt ---------- */
[data-tilt] { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateZ(0); transition: transform .6s var(--ease-out), box-shadow var(--dur) var(--ease-out); }
[data-tilt].is-tilting { transition: transform .12s linear, box-shadow var(--dur) var(--ease-out); }
[data-tilt] .glare { position: absolute; inset: 0; z-index: 3; pointer-events: none; background: radial-gradient(400px circle at var(--gx, 50%) var(--gy, 50%), rgba(255,255,255,.18), transparent 45%); opacity: 0; transition: opacity var(--dur) ease; }
[data-tilt].is-tilting .glare { opacity: 1; }

/* ---------- Magnetic buttons + click ripple ---------- */
[data-magnetic] { transform: translate3d(var(--tx, 0), var(--ty, 0), 0); }
.f-btn .ripple { position: absolute; z-index: -1; border-radius: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; background: currentColor; opacity: .28; pointer-events: none; animation: f-ripple .7s var(--ease-out) forwards; }
@keyframes f-ripple { to { transform: scale(40); opacity: 0; } }

/* ---------- Spotlight on dark panels ---------- */
[data-spotlight] { position: relative; }
[data-spotlight]::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(600px circle at var(--sx, 50%) var(--sy, 50%), rgba(254,187,25,.09), transparent 55%); opacity: 0; transition: opacity .6s ease; }
[data-spotlight].is-lit::after { opacity: 1; }
[data-spotlight] > * { position: relative; z-index: 1; }

/* ---------- Page curtain (between pages) ---------- */
.f-curtain { position: fixed; inset: 0; z-index: 200; background: var(--navy-950); display: grid; place-items: center; pointer-events: none; transform-origin: 50% 0; transition: transform .7s var(--ease-in-out); }
.f-curtain i { width: 22px; height: 22px; background: var(--amber-500); animation: f-curtain-spin 1.2s var(--ease-in-out) infinite; transition: opacity .3s ease; }
@keyframes f-curtain-spin { 50% { transform: rotate(90deg) scale(.7); } 100% { transform: rotate(180deg); } }
.is-loaded .f-curtain { transform: scaleY(0); }
.is-loaded .f-curtain i { opacity: 0; }
.is-leaving .f-curtain { transform: scaleY(1); transform-origin: 50% 100%; }
.is-leaving .f-curtain i { opacity: 1; }
html:not(.js) .f-curtain { display: none; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
  .js [data-reveal], .js [data-reveal] img, .split .w > span, .js .f-hero-media .media, .f-hero-media .media img { opacity: 1 !important; transform: none !important; translate: none !important; scale: none !important; filter: none !important; clip-path: none !important; }
  .js [data-rise] { clip-path: none; }
  [data-parallax], [data-tilt], [data-magnetic] { transform: none !important; }
  .js .f-nums > div::before, .js .f-close::before { transform: none; }
  .f-curtain { display: none; }
  .f-drawer { clip-path: none; opacity: 0; }
  .f-drawer.is-open { opacity: 1; }
}
