/* ============================================
   THYNKIA 2026: motion layer styles (home + solutions). Goes with js/motion.js.
   Without JS every section keeps its normal layout.
   ============================================ */

/* ---------- Hero depth ---------- */
/* the video is only moved once the visitor scrolls or moves the mouse: until then it paints like a plain image (fast first paint) */
.hero.moving .hero-video { will-change: transform; }
.hero-copy { will-change: transform, opacity; }
.wisps { position: absolute; inset: -10%; z-index: -1; pointer-events: none; will-change: transform; }
.wisps i { position: absolute; border-radius: 50%; background: radial-gradient(closest-side, rgba(255,255,255,.55), rgba(255,255,255,0)); filter: blur(6px); animation: wisp 26s ease-in-out infinite alternate; }
.wisps i:nth-child(1) { width: 46%; height: 18%; left: 2%; top: 22%; }
.wisps i:nth-child(2) { width: 38%; height: 14%; right: 4%; top: 12%; animation-duration: 32s; animation-delay: -8s; }
.wisps i:nth-child(3) { width: 30%; height: 12%; left: 36%; top: 52%; opacity: .7; animation-duration: 22s; animation-delay: -14s; }
@keyframes wisp { from { transform: translateX(-4%); } to { transform: translateX(6%); } }

/* ---------- Integrations: orbit ---------- */
.orbit-on svg.beams { display: none; }
.orbit-on .orbit-canvas { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.orbit-on .beam-col { position: absolute; inset: 0; padding: 0; left: 0 !important; right: 0 !important; display: block; }
.orbit-on .node { position: absolute; left: 0; top: 0; will-change: transform; cursor: pointer; transition: box-shadow .3s; }
.orbit-on .node.on { box-shadow: 0 0 0 3px var(--accent), 0 12px 26px -10px rgba(91,69,224,.55); }
.orbit-on .hub { z-index: 4; }
.orbit-cap { position: absolute; left: 50%; bottom: 14px; z-index: 8; transform: translate(-50%, 8px); max-width: calc(100% - 28px); padding: 9px 14px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 13.5px; line-height: 1.3; text-align: center; opacity: 0; transition: opacity .3s, transform .3s var(--ease); pointer-events: none; }
.orbit-cap.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- What we build: exploded stack ---------- */
.t-infra .plane { transition: transform .9s var(--ease); }
.t-infra.exploded .plane:nth-child(2), .t-infra:hover .plane:nth-child(2) { transform: translateZ(95px); }
.t-infra.exploded .plane:nth-child(3), .t-infra:hover .plane:nth-child(3) { transform: translateZ(190px); }
.t-infra.exploded .plane:nth-child(4), .t-infra:hover .plane:nth-child(4) { transform: translateZ(285px); }
.t-infra .plane b { padding: 4px 10px; border-radius: 999px; transition: background-color .6s, box-shadow .6s; }
.t-infra.exploded .plane b, .t-infra:hover .plane b { background: rgba(11,15,26,.55); box-shadow: 0 0 0 1px rgba(255,255,255,.25); }
.t-infra .stack { transition: transform .9s var(--ease); }
.t-infra.exploded .stack, .t-infra:hover .stack { transform: translateY(78px) scale(.5); }

/* ---------- How we work: scroll-driven timeline + flip card ---------- */
.tl.scrub .tl-fill { transform: scaleX(var(--tp, 0)); transition: transform .12s linear; }
.tl.scrub .tl-dot { animation: none; left: calc(var(--tp, 0) * 100%); opacity: calc(var(--tp, 0) * 20); transition: left .12s linear; }
@media (max-width: 900px) {
  .tl.scrub .tl-fill { transform: scaleY(var(--tp, 0)); }
  .tl.scrub .tl-dot { left: 50% !important; top: calc(var(--tp, 0) * 100%); animation: none; }
}
.flip-card { perspective: 900px; background: none !important; padding: 0 !important; overflow: visible !important; cursor: pointer; }
.flip-inner { display: grid; height: 100%; transform-style: preserve-3d; transition: transform .9s cubic-bezier(.3,1.35,.5,1); }
.flip-card.flipped .flip-inner { transform: rotateY(180deg); }
.flip-card .face { grid-area: 1 / 1; border-radius: 16px; padding: 18px 18px 16px; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: flex; flex-direction: column; }
.flip-card .front { background: var(--ground); color: var(--ink); }
.flip-card .back { background: var(--accent); color: #fff; transform: rotateY(180deg); }
.flip-card .back span { color: #fff !important; }
.flip-card .back .ok-tag { margin-top: auto; align-self: flex-start; display: inline-flex; gap: 6px; align-items: center; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.18); font-size: 12.5px; font-weight: 600; }
.flip-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 16px; }

/* ---------- Results: globe ---------- */
.results .globe { position: absolute; inset: 0; z-index: -1; pointer-events: none; }

/* ---------- Case studies ---------- */
#casos.m-hscroll { overflow: clip; }
#casos.m-hscroll .wrap { position: sticky; }
#casos.m-hscroll .cases-grid { display: flex; gap: 14px; width: max-content; will-change: transform; }
#casos.m-hscroll .case-card { width: min(380px, 29vw); flex: none; }

/* ---------- Testimonials: one row sliding sideways (motion.js adds the looping copy and .moving) ---------- */
.qrow { overflow-x: auto; scrollbar-width: none; margin-inline: calc(var(--gutter) * -1); padding: 6px var(--gutter) 34px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent); mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent); }
.qrow::-webkit-scrollbar { display: none; }
.qrow-track { display: flex; align-items: stretch; width: max-content; }
.qrow .quote { width: 380px; flex: none; margin: 0 16px 0 0; }
.qrow.moving { overflow: hidden; padding-inline: 0; }
.qrow.moving .qrow-track { animation: qslide 38s linear infinite; }
.qrow.moving:hover .qrow-track, .qrow.moving:active .qrow-track { animation-play-state: paused; }
@keyframes qslide { from { transform: translateX(-50%); } to { transform: translateX(0); } }   /* left to right */
@media (max-width: 760px) { .qrow .quote { width: 78vw; margin-right: 12px; } .qrow.moving .qrow-track { animation-duration: 30s; } }
.who .ini svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.faces .stackf span svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
/* ---------- Industries ---------- */
#industrias { position: relative; }
#industrias > .wrap { position: relative; z-index: 1; }
#industrias .dotfield { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.ind-ico { width: 44px; height: 44px; padding: 9px; border-radius: 12px; background: var(--ground); color: var(--ink); fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: background-color .3s, color .3s, transform .5s var(--ease); }
.ind-ico * { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.4s var(--ease) .2s; }
.ind-list li.in .ind-ico * { stroke-dashoffset: 0; }
.ind-list li:hover .ind-ico { background: var(--accent); color: #fff; transform: rotate(-6deg) scale(1.08); }
.ind-list li:hover .res { background: var(--accent); color: #fff; }
.ind-list li.custom .ind-ico { background: rgba(255,255,255,.1); color: #fff; }

/* ---------- FAQ ---------- */
.faq-list details p { overflow: hidden; }
.faq-list summary::after { transition: transform .4s cubic-bezier(.3,1.4,.5,1), background-color .3s; }
.faq-list details[open] summary::after { background-color: var(--accent-soft); }

/* ---------- Logo strip: drum ---------- */
.marquee.drum .marquee-track { animation: none; will-change: transform; }
.marquee.drum li { transform-origin: 50% 50%; will-change: transform; }
.logo-mask { width: 24px; height: 24px; flex: none; background: #3a3f4d; -webkit-mask: var(--logo) center / contain no-repeat; mask: var(--logo) center / contain no-repeat; transition: background-color .3s; }
.marquee-list li:hover .logo-mask { background: var(--brand); }
.marquee-list li:hover { color: var(--ink); }

/* ---------- Solutions page: scroll story (desktop) ---------- */
.story { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); column-gap: 80px; }
.story > .sol { grid-column: 1; display: flex; align-items: center; min-height: 82vh; }
.story > .sol + .sol { margin-top: 0; }
.story-stage { grid-column: 2; grid-row: 1 / span 6; position: sticky; top: calc(50vh - 260px); height: 520px; }
.story-box { position: relative; height: 100%; }
.story-box .sol-art { position: absolute; inset: 0; min-height: 0; opacity: 0; transform: translateY(24px) scale(.97); transition: opacity .6s var(--ease), transform .7s var(--ease), visibility 0s .6s; visibility: hidden; }
.story-box .sol-art.cur { opacity: 1; transform: none; visibility: visible; transition-delay: 0s; }

/* results: cards let the globe glow through a little */
.results .metric { background: rgba(22,27,40,.84); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
@media (max-width: 520px) { .how-card .split { grid-template-columns: 1fr; } }

/* ---------- Results: each figure plays once and lands on the result ---------- */
.metric { position: relative; }
.mfig { height: 64px; margin-bottom: 26px; }
.mfig.bars { display: grid; align-content: center; gap: 10px; max-width: 150px; }
.mfig .mb { display: grid; grid-template-columns: 50px 1fr; align-items: center; gap: 10px; }
.mfig .mb small { font-size: 12.5px; color: #9aa0ad; }
.mfig .mb i { display: block; width: calc(var(--w) * 100%); height: 11px; border-radius: 6px; background: #3a4256; transform-origin: left; transform: scaleX(0); transition: transform 1.1s var(--ease); }
.mfig .mb.acc i { background: var(--accent); transition-delay: .45s; transition-duration: 1.3s; }
.metric.go .mfig .mb i { transform: scaleX(1); }
.mfig.ring { width: 64px; overflow: visible; }
.mfig.ring .rb { fill: none; stroke: #2a3142; stroke-width: 6; }
.mfig.ring .rf { fill: none; stroke: var(--accent); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 163.4; stroke-dashoffset: 163.4; transform: rotate(-90deg); transform-origin: 32px 32px; transition: stroke-dashoffset 1.4s var(--ease); }
.metric.go .mfig.ring .rf { stroke-dashoffset: calc(163.4 * (1 - var(--to))); }
.mfig .mhand { fill: none; stroke: #e9e9e4; stroke-width: 3; stroke-linecap: round; transform-origin: 32px 32px; transition: transform 1.4s var(--ease); }
.metric.go .mfig .mhand { transform: rotate(var(--deg)); }
.mfig .hub { fill: #fff; } .mfig .crown { fill: none; stroke: #c9ccd4; stroke-width: 3; stroke-linecap: round; }
.mfig .mcheck { fill: none; stroke: #6fe0b8; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 30; stroke-dashoffset: 30; transition: stroke-dashoffset .5s ease 1.3s; }
.metric.go .mfig .mcheck { stroke-dashoffset: 0; }
.mfig.days { display: flex; align-items: center; gap: 6px; }
.mfig.days i { width: 20px; height: 20px; border-radius: 6px; background: #2a3142; transition: background-color .35s ease calc(var(--k) * .17s), transform .35s ease calc(var(--k) * .17s); }
.metric.go .mfig.days i { background: var(--accent); transform: scale(1.06); }
.mfig.line { width: 120px; overflow: visible; }
.mfig.line .base { stroke: #2a3142; stroke-width: 2; }
.mfig.line .ln { fill: none; stroke: var(--accent); stroke-width: 3.5; stroke-linecap: round; stroke-dasharray: 150; stroke-dashoffset: 150; transition: stroke-dashoffset 1.5s var(--ease); }
.mfig.line .end { fill: #8f84f5; opacity: 0; transform-origin: 118px 4px; transform: scale(.4); transition: opacity .4s 1.3s, transform .5s cubic-bezier(.3,1.6,.5,1) 1.3s; }
.metric.go .mfig.line .ln { stroke-dashoffset: 0; } .metric.go .mfig.line .end { opacity: 1; transform: none; }
.mfig.weeks { position: relative; display: flex; justify-content: space-between; align-items: center; max-width: 150px; }
.mfig.weeks .wl { position: absolute; left: 12px; right: 12px; top: 50%; height: 3px; margin-top: -1.5px; background: #2a3142; border-radius: 2px; }
.mfig.weeks .wl i { position: absolute; inset: 0; background: var(--accent); border-radius: 2px; transform-origin: left; transform: scaleX(0); transition: transform 1.2s var(--ease); }
.mfig.weeks b { position: relative; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 11px !important; font-weight: 600; letter-spacing: 0; line-height: 1; color: #9aa0ad !important; background: #2a3142; transition: background-color .3s ease calc(var(--k) * .3s), color .3s ease calc(var(--k) * .3s); }
.metric.go .mfig.weeks .wl i { transform: scaleX(1); } .metric.go .mfig.weeks b { background: var(--accent); color: #fff !important; }
.metric .hit { position: absolute; top: 22px; right: 22px; display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 4px 10px 4px 8px; border-radius: 999px; background: rgba(43,181,138,.16); color: #6fe0b8; font-size: 12.5px; font-weight: 600; opacity: 0; transform: translateY(-6px) scale(.92); transition: opacity .45s ease 1.6s, transform .5s cubic-bezier(.3,1.5,.5,1) 1.6s; }
.metric .hit span { margin: 0; font-size: inherit; color: inherit; line-height: 1.2; }
.metric .hit svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.metric.go .hit { opacity: 1; transform: none; }

/* ---------- Case studies: glide stays smooth ---------- */
#casos.m-hscroll { content-visibility: visible; }

