/*
 * Almathec — camada de movimento da landing page.
 * Só CSS puro (sem build). Tudo respeita prefers-reduced-motion.
 * Usa as variáveis de tema já definidas em landing/index.blade.php.
 */

/* ---- Barra de progresso de scroll ------------------------------------- */
.scroll-progress{ position:fixed; inset:0 0 auto 0; height:3px; z-index:60; pointer-events:none; }
.scroll-progress > i{ display:block; height:100%; width:100%; transform-origin:0 50%; transform:scaleX(var(--p,0));
    background:linear-gradient(90deg,var(--accent),var(--accent-light),#7df3ff); box-shadow:0 0 14px rgba(90,162,255,.8); }

/* ---- Hero: canvas de rede neural + aurora ----------------------------- */
.hero-fx{ position:absolute; inset:0; z-index:0; pointer-events:none; overflow:hidden; }
.hero-fx canvas{ position:absolute; inset:0; width:100%; height:100%; opacity:.9; }
.hero-aurora{ position:absolute; inset:-20% -10% auto -10%; height:80%; filter:blur(60px); opacity:.55;
    background:
        radial-gradient(40% 60% at 20% 30%, rgba(31,107,255,.55), transparent 70%),
        radial-gradient(35% 55% at 75% 20%, rgba(125,243,255,.28), transparent 70%),
        radial-gradient(30% 50% at 55% 70%, rgba(90,162,255,.32), transparent 70%); }
:root[data-theme="light"] .hero-aurora{ opacity:.35; }
:root[data-theme="light"] .hero-fx canvas{ opacity:.55; }
.hero-content{ position:relative; z-index:1; }

/* Headline palavra por palavra */
.split-words .w{ display:inline-block; overflow:hidden; vertical-align:bottom; padding-bottom:.08em; }
.split-words .w > span{ display:inline-block; transform:translateY(105%); opacity:0; }
.split-words.in-view .w > span{ animation:wordUp .8s cubic-bezier(.2,.8,.2,1) forwards; animation-delay:calc(var(--i)*70ms + 120ms); }
@keyframes wordUp{ to{ transform:none; opacity:1; } }

.grad-shimmer{ background:linear-gradient(100deg,var(--ice) 0%,var(--accent-light) 30%,#7df3ff 50%,var(--accent-light) 70%,var(--ice) 100%);
    background-size:220% 100%; -webkit-background-clip:text; background-clip:text; color:transparent; animation:shimmer 6s linear infinite; }
@keyframes shimmer{ to{ background-position:-220% 0; } }

/* Terminal / digitação do hero */
.typed-line{ display:inline-flex; align-items:center; gap:10px; padding:9px 14px; border-radius:12px; border:1px solid var(--border-soft);
    background:rgba(8,16,36,.55); backdrop-filter:blur(8px); font:600 13px/1 'Space Grotesk',sans-serif; color:var(--text-dim); }
:root[data-theme="light"] .typed-line{ background:rgba(255,255,255,.7); }
.typed-line b{ color:var(--accent-light); font-weight:700; }
.typed-caret{ display:inline-block; width:2px; height:1.05em; background:var(--accent-light); margin-left:2px; animation:caret 1s steps(1) infinite; vertical-align:-2px; }
@keyframes caret{ 50%{ opacity:0; } }

/* ---- Ticker (marquee) -------------------------------------------------- */
.ticker{ position:relative; overflow:hidden; border-block:1px solid var(--border); background:var(--surface-2);
    mask-image:linear-gradient(90deg,transparent,#000 8%,#000 92%,transparent); -webkit-mask-image:linear-gradient(90deg,transparent,#000 8%,#000 92%,transparent); }
.ticker-track{ display:flex; width:max-content; gap:44px; padding:16px 0; animation:tick 38s linear infinite; }
.ticker:hover .ticker-track{ animation-play-state:paused; }
.ticker-track span{ display:inline-flex; align-items:center; gap:12px; font:600 13px/1 'Space Grotesk',sans-serif; letter-spacing:.14em; text-transform:uppercase; color:var(--text-faint); white-space:nowrap; }
.ticker-track span::before{ content:""; width:7px; height:7px; border-radius:50%; background:var(--accent-light); box-shadow:0 0 12px rgba(90,162,255,.9); }
@keyframes tick{ to{ transform:translateX(-50%); } }

/* ---- Spotlight (luz que segue o mouse) -------------------------------- */
.spot{ position:relative; isolation:isolate; }
.spot::before{ content:""; position:absolute; inset:0; border-radius:inherit; z-index:-1; opacity:0; transition:opacity .25s ease;
    background:radial-gradient(260px circle at var(--mx,50%) var(--my,50%), rgba(90,162,255,.22), transparent 65%); }
.spot:hover::before{ opacity:1; }
.spot::after{ content:""; position:absolute; inset:0; border-radius:inherit; pointer-events:none; opacity:0; transition:opacity .25s ease; padding:1px;
    background:radial-gradient(180px circle at var(--mx,50%) var(--my,50%), rgba(125,243,255,.8), transparent 70%);
    -webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0); -webkit-mask-composite:xor; mask-composite:exclude; }
.spot:hover::after{ opacity:1; }

/* ---- Tilt 3D ----------------------------------------------------------- */
[data-tilt]{ transform-style:preserve-3d; transition:transform .18s ease-out; will-change:transform; }

/* ---- Seção "scroll story": automação passo a passo -------------------- */
.story{ position:relative; }
.story-grid{ display:grid; gap:40px; grid-template-columns:1fr; }
@media (min-width:1024px){ .story-grid{ grid-template-columns:1fr 1.05fr; gap:64px; } }
.story-steps{ display:flex; flex-direction:column; gap:0; }
.story-step{ min-height:62vh; display:flex; flex-direction:column; justify-content:center; opacity:.35; transition:opacity .45s ease, transform .45s ease; transform:translateX(-8px); }
.story-step.is-active{ opacity:1; transform:none; }
.story-step .num{ font:700 13px/1 'Space Grotesk',sans-serif; letter-spacing:.2em; color:var(--accent-light); margin-bottom:14px; }
.story-step h3{ font-size:clamp(1.5rem,3vw,2.1rem); font-weight:700; line-height:1.15; margin-bottom:12px; }
.story-step p{ color:var(--text-dim); max-width:30rem; line-height:1.7; }
.story-step .kpi{ display:inline-flex; align-items:center; gap:8px; margin-top:18px; padding:8px 14px; border-radius:999px; font:700 12px/1 'Inter',sans-serif; color:#62dca6; border:1px solid rgba(98,220,166,.35); background:rgba(98,220,166,.08); width:max-content; }
.story-sticky{ position:sticky; top:96px; align-self:start; height:min(70vh,520px); }
@media (max-width:1023px){ .story-step{ min-height:auto; padding:28px 0; opacity:1; transform:none; } .story-sticky{ display:none; } }

.story-stage{ position:relative; height:100%; border-radius:28px; overflow:hidden; border:1px solid rgba(90,162,255,.4);
    background:linear-gradient(150deg,#0e2f6e,#061230 70%); box-shadow:0 40px 90px -30px rgba(0,0,0,.7); }
:root[data-theme="light"] .story-stage{ box-shadow:0 40px 90px -40px rgba(18,55,110,.45); }
.story-stage .grid-bg{ position:absolute; inset:0; opacity:.18; background-image:linear-gradient(rgba(142,184,255,.5) 1px,transparent 1px),linear-gradient(90deg,rgba(142,184,255,.5) 1px,transparent 1px); background-size:28px 28px; }
.story-panel{ position:absolute; inset:0; display:grid; place-items:center; padding:28px; opacity:0; transform:scale(.96) translateY(14px); transition:opacity .55s ease, transform .55s ease; pointer-events:none; }
.story-panel.is-active{ opacity:1; transform:none; }
.chat-demo{ width:min(100%,380px); display:flex; flex-direction:column; gap:10px; }
.bubble{ max-width:86%; padding:11px 14px; border-radius:16px; font-size:13px; line-height:1.45; color:#eaf2ff; opacity:0; transform:translateY(10px); }
.story-panel.is-active .bubble{ animation:bubbleIn .5s ease forwards; animation-delay:calc(var(--d,0)*600ms + 250ms); }
@keyframes bubbleIn{ to{ opacity:1; transform:none; } }
.bubble.in{ background:rgba(255,255,255,.1); border:1px solid rgba(255,255,255,.14); border-top-left-radius:4px; align-self:flex-start; }
.bubble.out{ background:linear-gradient(135deg,#1f6bff,#4d94ff); border-top-right-radius:4px; align-self:flex-end; }
.bubble.sys{ align-self:center; font-size:11px; letter-spacing:.06em; text-transform:uppercase; font-weight:700; color:#7df3ff; background:rgba(125,243,255,.08); border:1px solid rgba(125,243,255,.3); border-radius:999px; }
.flow{ width:min(100%,400px); display:flex; flex-direction:column; gap:12px; }
.flow-row{ display:flex; align-items:center; gap:12px; padding:12px 14px; border-radius:14px; background:rgba(255,255,255,.07); border:1px solid rgba(255,255,255,.14); color:#eaf2ff; font-size:13px; font-weight:600; opacity:0; transform:translateX(-14px); }
.story-panel.is-active .flow-row{ animation:rowIn .5s ease forwards; animation-delay:calc(var(--d,0)*450ms + 200ms); }
@keyframes rowIn{ to{ opacity:1; transform:none; } }
.flow-row i{ width:30px; height:30px; border-radius:9px; display:grid; place-items:center; font-style:normal; background:rgba(90,162,255,.22); color:#a9ccff; font-size:14px; }
.flow-row em{ margin-left:auto; font-style:normal; font-size:11px; color:#62dca6; font-weight:700; }
.bars{ width:min(100%,380px); display:flex; flex-direction:column; gap:16px; color:#eaf2ff; font-size:12px; font-weight:600; }
.bar{ display:grid; gap:7px; }
.bar > div{ height:12px; border-radius:99px; background:rgba(255,255,255,.1); overflow:hidden; }
.bar > div > b{ display:block; height:100%; width:0; border-radius:inherit; background:linear-gradient(90deg,#1f6bff,#7df3ff); transition:width 1.2s cubic-bezier(.2,.8,.2,1) .25s; }
.bar.before > div > b{ background:linear-gradient(90deg,#ff836d,#ffc95c); }
.story-panel.is-active .bar > div > b{ width:var(--w); }
.bar span{ display:flex; justify-content:space-between; }
.big-num{ font:700 clamp(3rem,7vw,4.6rem)/1 'Space Grotesk',sans-serif; text-align:center; color:#fff; text-shadow:0 0 40px rgba(90,162,255,.7); }
.big-num small{ display:block; margin-top:10px; font:600 13px/1.4 'Inter',sans-serif; color:#a9ccff; text-shadow:none; letter-spacing:.04em; }

/* ---- Bento: benefícios ------------------------------------------------- */
.bento{ display:grid; gap:16px; grid-template-columns:1fr; }
@media (min-width:768px){ .bento{ grid-template-columns:repeat(6,1fr); } .bento .b-a{ grid-column:span 4; } .bento .b-b{ grid-column:span 2; } .bento .b-c{ grid-column:span 2; } .bento .b-d{ grid-column:span 4; } }
.bento-card{ border-radius:24px; padding:28px; background:var(--surface); border:1px solid var(--border); overflow:hidden; min-height:210px; display:flex; flex-direction:column; justify-content:space-between; }
.bento-card h3{ font-size:1.25rem; font-weight:700; margin-bottom:8px; }
.bento-card p{ color:var(--text-dim); font-size:.92rem; line-height:1.6; max-width:34rem; }
.bento-metric{ font:700 clamp(2.6rem,5vw,3.6rem)/1 'Space Grotesk',sans-serif; }
.pulse-ring{ position:relative; width:64px; height:64px; margin-bottom:18px; }
.pulse-ring::before,.pulse-ring::after{ content:""; position:absolute; inset:0; border-radius:50%; border:2px solid var(--accent-light); animation:ring 2.4s ease-out infinite; }
.pulse-ring::after{ animation-delay:1.2s; }
.pulse-ring i{ position:absolute; inset:22px; border-radius:50%; background:var(--accent-light); box-shadow:0 0 24px rgba(90,162,255,.9); }
@keyframes ring{ from{ transform:scale(.4); opacity:.9; } to{ transform:scale(1.25); opacity:0; } }
.mini-flow{ display:flex; align-items:center; gap:10px; margin-top:18px; flex-wrap:wrap; }
.mini-flow span{ padding:8px 12px; border-radius:10px; font-size:12px; font-weight:700; background:var(--surface-2); border:1px solid var(--border-soft); }
.mini-flow svg{ width:18px; height:18px; color:var(--accent-light); }

/* ---- Cursor glow global ------------------------------------------------ */
.cursor-glow{ position:fixed; left:0; top:0; width:420px; height:420px; margin:-210px 0 0 -210px; border-radius:50%; pointer-events:none; z-index:0;
    background:radial-gradient(circle,rgba(31,107,255,.14),transparent 65%); transform:translate3d(var(--cx,-999px),var(--cy,-999px),0); transition:opacity .3s; }
@media (hover:none){ .cursor-glow{ display:none; } }

/* ---- Reveals variados -------------------------------------------------- */
[data-reveal="left"]{ opacity:0; transform:translateX(-36px); }
[data-reveal="right"]{ opacity:0; transform:translateX(36px); }
[data-reveal="zoom"]{ opacity:0; transform:scale(.92); }
[data-reveal].in-view{ opacity:1; transform:none; transition:opacity .8s ease, transform .8s cubic-bezier(.2,.8,.2,1); transition-delay:var(--reveal-delay,0ms); }

/* Scroll-driven nativo (Chrome/Edge): parallax suave nas orbes */
@supports (animation-timeline: view()){
    .parallax-y{ animation:plx linear both; animation-timeline:view(); animation-range:cover 0% cover 100%; }
    @keyframes plx{ from{ transform:translateY(40px); } to{ transform:translateY(-40px); } }
}

@media (prefers-reduced-motion: reduce){
    .ticker-track,.grad-shimmer,.pulse-ring::before,.pulse-ring::after,.typed-caret{ animation:none!important; }
    .split-words .w > span,.bubble,.flow-row,[data-reveal]{ opacity:1!important; transform:none!important; animation:none!important; }
    .story-step{ opacity:1; transform:none; }
    .bar > div > b{ width:var(--w)!important; transition:none; }
    .hero-fx canvas,.cursor-glow{ display:none; }
}
