/* ==========================================================================
   Codera — motion layer
   Lit-window facade, drifting light, spring word reveals, floating mark,
   orbit, page curtain, cursor. Only transform / opacity are animated.
   ========================================================================== */

/* ---------- light backdrop ---------- */
.backdrop { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.facade { position: absolute; inset: 0; width: 100%; height: 100%; }
.blob { position: absolute; border-radius: 50%; will-change: transform; }
.blob.a { width: 860px; height: 860px; right: -260px; top: -300px; background: radial-gradient(closest-side, rgba(var(--sky-rgb), 0.26), transparent); animation: drift-a 22s ease-in-out infinite; }
.blob.b { width: 720px; height: 720px; left: 6%; bottom: -380px; background: radial-gradient(closest-side, rgba(var(--iris-rgb), 0.16), transparent); animation: drift-b 28s ease-in-out infinite; }
body.t-ordero .blob.a { background: radial-gradient(closest-side, rgba(45, 212, 191, 0.22), transparent); }
body.t-payoff .blob.a { background: radial-gradient(closest-side, rgba(255, 122, 69, 0.24), transparent); }
@keyframes drift-a { 0%, 100% { transform: translate3d(0, 0, 0) scale(1); } 33% { transform: translate3d(-90px, 60px, 0) scale(1.12); } 66% { transform: translate3d(30px, -30px, 0) scale(0.95); } }
@keyframes drift-b { 0%, 100% { transform: translate3d(0, 0, 0); } 33% { transform: translate3d(120px, -50px, 0); } 66% { transform: translate3d(-40px, 30px, 0); } }
.fade-bottom { position: absolute; inset: auto 0 0 0; height: 45%; background: linear-gradient(to bottom, transparent, var(--ink)); }
.grid-lines {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 80px 80px; mask-image: radial-gradient(ellipse 70% 70% at 60% 0%, #000 25%, transparent 75%); opacity: 0.55;
}

/* ---------- preloader ---------- */
.preloader { position: fixed; inset: 0; z-index: var(--z-cursor); display: grid; place-items: center; background: var(--ink); clip-path: inset(0); transition: clip-path 1100ms var(--in-out); }
.preloader.is-done { clip-path: inset(0 0 100% 0); pointer-events: none; }
.pl-inner { display: grid; justify-items: center; gap: 22px; }
.pl-windows { display: grid; grid-template-columns: repeat(5, 14px); gap: 6px; }
.pl-windows i { width: 14px; height: 11px; border-radius: 3px; background: rgba(214, 228, 255, 0.06); transition: background-color 300ms, box-shadow 300ms; }
.pl-windows i.on { background: var(--sky); box-shadow: 0 0 14px 2px rgba(var(--sky-rgb), 0.55); }
.pl-count { font-family: var(--f-label); font-size: 13px; letter-spacing: 0.18em; color: var(--muted); font-variant-numeric: tabular-nums; }
html.no-preload .preloader { display: none; }
/* failsafe: if the script that dismisses it never runs, the preloader must not trap the page */
.preloader { animation: pl-failsafe 1ms linear 6s forwards; }
@keyframes pl-failsafe { to { visibility: hidden; pointer-events: none; } }

/* ---------- page curtain ---------- */
.curtain { position: fixed; inset: 0; z-index: var(--z-overlay); pointer-events: none; display: grid; grid-template-columns: repeat(6, 1fr); }
.curtain i { background: var(--ink-3); transform: scaleY(0); transform-origin: bottom; transition: transform 620ms var(--in-out); }
.curtain i:nth-child(odd) { background: var(--ink-2); }
.curtain i:nth-child(2) { transition-delay: 30ms; } .curtain i:nth-child(3) { transition-delay: 60ms; }
.curtain i:nth-child(4) { transition-delay: 90ms; } .curtain i:nth-child(5) { transition-delay: 120ms; } .curtain i:nth-child(6) { transition-delay: 150ms; }
.curtain.is-active i { transform: scaleY(1); }
.curtain.is-leaving i { transform-origin: top; transform: scaleY(0); }

/* ---------- cursor ---------- */
.cursor-dot, .cursor-ring { position: fixed; top: 0; left: 0; z-index: var(--z-cursor); pointer-events: none; border-radius: 50%; opacity: 0; transition: opacity var(--t-base); }
.cursor-dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: var(--accent); }
.cursor-ring {
  width: 38px; height: 38px; margin: -19px 0 0 -19px; border: 1px solid rgba(214, 228, 255, 0.35); display: grid; place-items: center;
  transition: opacity var(--t-base), width 450ms var(--spring), height 450ms var(--spring), margin 450ms var(--spring), background-color 300ms, border-color 300ms;
}
.cursor-ring b { font-family: var(--f-label); font-size: 11px; font-weight: 600; letter-spacing: 0.08em; color: var(--accent-ink); opacity: 0; transition: opacity 200ms; white-space: nowrap; }
html.has-cursor .cursor-dot, html.has-cursor .cursor-ring { opacity: 1; }
html.c-hover .cursor-ring { width: 60px; height: 60px; margin: -30px 0 0 -30px; border-color: rgba(var(--accent-rgb), 0.7); background: rgba(var(--accent-rgb), 0.08); }
html.c-label .cursor-ring { width: 92px; height: 92px; margin: -46px 0 0 -46px; background: var(--accent); border-color: transparent; }
html.c-label .cursor-ring b { opacity: 1; }
html.c-label .cursor-dot { opacity: 0; }

/* ---------- reveals ---------- */
.js [data-reveal] { opacity: 0; transform: translate3d(0, 34px, 0); transition: opacity 800ms var(--out), transform 1100ms var(--spring); transition-delay: var(--d, 0s); }
.js [data-reveal="fade"] { transform: none; }
.js [data-reveal="scale"] { transform: scale(0.92); }
.js [data-reveal].is-in { opacity: 1; transform: none; }

.w { display: inline-block; overflow: hidden; overflow: clip; vertical-align: bottom; padding-bottom: 0.1em; margin-bottom: -0.1em; }
.w > span { display: inline-block; }
.js [data-split] .w > span { transform: translate3d(0, 108%, 0); opacity: 0; transition: transform 1000ms var(--spring), opacity 400ms var(--out); transition-delay: calc(var(--i, 0) * 50ms + var(--d, 0s)); }
.js [data-split].is-in .w > span { transform: none; opacity: 1; }

/* scrub — words light up like windows */
.scrub .sw { color: rgba(214, 228, 255, 0.16); transition: color 400ms var(--out), text-shadow 400ms; }
.scrub .sw.on { color: var(--text); }
.scrub .hl.on { color: var(--sky); text-shadow: 0 0 24px rgba(var(--sky-rgb), 0.45); }

/* ---------- floating mark + orbit ---------- */
.mark-stage { position: relative; width: min(500px, 90vw, 64svh); aspect-ratio: 1; perspective: 1100px; display: grid; place-items: center; }
.mark-glow { position: absolute; inset: 14%; border-radius: 50%; background: radial-gradient(closest-side, rgba(var(--iris-rgb), 0.42), transparent); animation: pulse-glow 6s ease-in-out infinite; will-change: transform, opacity; }
@keyframes pulse-glow { 0%, 100% { transform: scale(1); opacity: 0.7; } 50% { transform: scale(1.14); opacity: 1; } }
.mark-tilt { position: relative; width: 46%; transform-style: preserve-3d; will-change: transform; }
.mark-float { animation: float-y 6.5s ease-in-out 1s infinite; will-change: transform; }
@keyframes float-y { 0%, 100% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(0, -16px, 0); } }
.mark-tile {
  position: relative; aspect-ratio: 1; border-radius: 28%; display: grid; place-items: center;
  background: linear-gradient(150deg, #1a2130, #0b0e14 70%); border: 1px solid rgba(214, 228, 255, 0.14);
  box-shadow: 0 50px 90px -30px rgba(56, 120, 248, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.mark-tile::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.14) 50%, transparent 65%); background-size: 250% 100%; animation: sheen 5s ease-in-out 1.5s infinite; }
@keyframes sheen { 0% { background-position: 120% 0; } 40%, 100% { background-position: -120% 0; } }
.mark-tile svg { width: 62%; height: 62%; filter: drop-shadow(0 0 22px rgba(var(--sky-rgb), 0.55)); }
.mark-tile .c-arc { stroke-dasharray: 80; stroke-dashoffset: 80; animation: draw 1400ms 300ms var(--out) forwards; }
/* the cursor appears once the arc is drawn, then blinks like a text caret */
.mark-tile .c-cur { opacity: 0; animation: cur-in 240ms 1500ms forwards, blink 1200ms linear 2200ms infinite; }
@keyframes cur-in { to { opacity: 1; } }
.orbit { position: absolute; inset: 0; border-radius: 50%; border: 1px dashed rgba(214, 228, 255, 0.1); animation: spin 48s linear infinite; }
.orbit.o2 { inset: 13%; animation-duration: 34s; animation-direction: reverse; border-style: solid; border-color: rgba(214, 228, 255, 0.06); }
@keyframes spin { to { transform: rotate(360deg); } }
.sat { position: absolute; width: 64px; height: 64px; margin: -32px 0 0 -32px; left: 50%; top: 0; }
.orbit.o2 .sat { width: 52px; height: 52px; margin: -26px 0 0 -26px; }
.sat-in { width: 100%; height: 100%; border-radius: 18px; overflow: hidden; display: grid; place-items: center; background: var(--ink-3); border: 1px solid var(--line-2); box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.8); animation: spin 48s linear infinite reverse; }
.orbit.o2 .sat-in { animation-duration: 34s; animation-direction: normal; border-radius: 15px; }
.sat-in img { width: 100%; height: 100%; object-fit: cover; }
.sat-in svg { width: 50%; height: 50%; color: var(--sky); }
.sat.s2 { left: 100%; top: 50%; } .sat.s3 { left: 50%; top: 100%; } .sat.s4 { left: 0; top: 50%; }
.orbit.o2 .sat.s2 { left: 85%; top: 85%; } .orbit.o2 .sat.s3 { left: 15%; top: 85%; }

/* ---------- marquee ---------- */
.marquee { display: flex; overflow: hidden; user-select: none; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.mq-track { display: flex; flex: none; gap: var(--mq-gap, 48px); padding-right: var(--mq-gap, 48px); animation: mq var(--mq-dur, 40s) linear infinite; }
.marquee.rev .mq-track { animation-direction: reverse; }
.marquee:hover .mq-track { animation-play-state: paused; }
@keyframes mq { to { transform: translateX(-100%); } }
.mq-item { display: inline-flex; align-items: center; gap: var(--mq-gap, 48px); white-space: nowrap; }
.mq-item::after { content: ""; width: 10px; height: 8px; border-radius: 2px; background: var(--sky); box-shadow: 0 0 12px rgba(var(--sky-rgb), 0.7); }

/* ---------- sliding digits ---------- */
.digits { display: inline-flex; overflow: hidden; overflow: clip; line-height: 1; height: 1em; }
.digit { display: inline-block; height: 1em; overflow: hidden; overflow: clip; }
.digit-col { display: flex; flex-direction: column; transition: transform 1600ms var(--spring); transition-delay: var(--dd, 0s); }
.digit-col span { height: 1em; display: block; }

@media (prefers-reduced-motion: reduce) {
  .blob, .mark-glow, .mark-float, .mark-tile::after, .orbit, .sat-in, .mq-track { animation: none !important; }
  .js [data-reveal], .js [data-split] .w > span { opacity: 1 !important; transform: none !important; }
  .preloader, .cursor-dot, .cursor-ring { display: none !important; }
  .mark-tile .c-arc { stroke-dashoffset: 0; }
  .mark-tile .c-cur, .brand:hover .c-cur { opacity: 1; animation: none; }
}
