/* =========================================================
   MOTION — logo 6666 líquido, abertura e transição de página
   ========================================================= */
/* ---------- CURVAS ÚNICAS DO SITE ----------
   --ease     saída longa e macia (expo out): entradas, hovers, reveals
   --ease-io  ida e volta suave: cortinas, painéis, movimentos de tela
   --ease-in  saída rápida: o que está indo embora
   --ease-pop leve overshoot: microinterações pequenas (pontos, pills) */
:root {
  --ease: cubic-bezier(.16, 1, .3, 1);
  --ease-io: cubic-bezier(.65, .05, .2, 1);
  --ease-in: cubic-bezier(.55, 0, .8, .2);
  --ease-pop: cubic-bezier(.34, 1.45, .64, 1);
  --dur-s: .35s; --dur-m: .7s; --dur-l: 1.2s;
}
.mark { display: inline-block; line-height: 0; will-change: transform; }
.mark svg { width: 100%; height: auto; display: block; overflow: visible; }
.mark__base { fill: var(--red); opacity: .2; }
.mark__fill { fill: var(--red); }

/* header: o 6666 fica sempre visível e indica o scroll */
.mark--hdr { width: 74px; }
.hdr .hdr__brand { gap: 12px; }
.hdr:not(.is-page) .hdr__name { display: none; }
.hdr.is-compact .mark--hdr { opacity: 1; }
.hdr__brand .mark--hdr { transform-origin: 30% 60%; }
.mark--ftr { width: 68px; }
.mark--ftr .mark__base { opacity: 1; }

/* placeholder antes do JS montar a abertura/cortina (evita piscar) */
html.intro body, html.pt-in body { overflow: hidden; }
html.intro body::after, html.pt-in body::after {
  content: ""; position: fixed; inset: 0; z-index: 9998; background: var(--bg); background-image: var(--page-bg, none); background-attachment: fixed;
}

/* ABERTURA */
div.intro {
  position: fixed; inset: 0; z-index: 9998; background: var(--bg); background-image: var(--page-bg, none);
  display: grid; place-items: center; cursor: pointer;
  clip-path: inset(0 0 0 0); transition: clip-path 1s var(--ease-io) .1s;
}
div.intro.is-out { clip-path: inset(0 0 100% 0); }
.intro__name {
  position: absolute; left: 50%; top: calc(50% + clamp(70px, 10vw, 130px)); transform: translateX(-50%);
  display: flex; font-weight: 700; font-size: clamp(18px, 2vw, 28px); letter-spacing: -.05em; color: var(--ink); white-space: nowrap;
}
.intro__ch { display: inline-block; overflow: hidden; padding-bottom: .08em; }
.intro__ch i { display: inline-block; font-style: normal; transform: translateY(110%); transition: transform .9s var(--ease); }
div.intro.is-in .intro__ch i { transform: none; }
div.intro.is-out .intro__ch i { transform: translateY(-110%); transition-duration: .6s; transition-timing-function: var(--ease-in); }
.intro__meta {
  position: absolute; left: var(--pad, 24px); right: var(--pad, 24px); bottom: 24px; display: flex; justify-content: space-between;
  font: 600 11px/1 "JetBrains Mono", ui-monospace, monospace; text-transform: uppercase; letter-spacing: .06em; color: var(--mid);
}
.mark--intro {
  position: fixed; z-index: 9999; left: 50%; top: 50%; width: clamp(200px, 34vw, 480px); margin-left: calc(clamp(200px, 34vw, 480px) / -2);
  transform-origin: 0 0; margin-top: calc(clamp(200px, 34vw, 480px) * -0.1628 - 10px);
  opacity: 0; transition: opacity .4s; pointer-events: auto; cursor: pointer;
}
.mark--intro.is-in { opacity: 1; }
.mark--intro.is-gone { opacity: 0; }
/* o logo do header espera a abertura terminar; o hero entra depois */
html.intro .mark--hdr, html.intro-run .mark--hdr { opacity: 0; }
#word { transition: clip-path 1.2s var(--ease-io); clip-path: inset(-20% -10% -40% -10%); }
html.intro #word, html.intro-run #word { clip-path: inset(100% 0 0 0); }
#track { transition: opacity 1s ease .25s; }
html.intro #track, html.intro-run #track { opacity: 0; }
html.intro .hdr__nav, html.intro-run .hdr__nav, html.intro .hdr__right, html.intro-run .hdr__right { opacity: 0; }
.hdr__nav, .hdr__right { transition: opacity .6s ease .2s; }

/* CORTINA entre páginas */
.pt {
  position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center;
  background: var(--bg); background-image: var(--page-bg, none); background-attachment: fixed;
  clip-path: inset(100% 0 0 0); transition: clip-path .55s var(--ease-io);
}
.pt.is-in { clip-path: inset(0 0 0 0); }
.pt.is-static { transition: none; }
.pt.is-out { clip-path: inset(0 0 100% 0); transition: clip-path .8s var(--ease-io) .05s; }
.mark--pt { width: clamp(90px, 10vw, 140px); }
.pt.is-out .mark--pt { transform: translateY(-30px); opacity: 0; transition: transform .6s var(--ease-io), opacity .4s; }

/* ---------- ROLAGEM SUAVE (Lenis) ---------- */
html.lenis, html.lenis body { height: auto; }
html.lenis { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: clip; }
.lenis [data-lenis-prevent] { overscroll-behavior: contain; }

/* ---------- REVEAL DE TÍTULOS (palavra por palavra, com máscara) ---------- */
.sm { display: inline-block; overflow: clip; vertical-align: top; padding: .16em .08em .32em; margin: -.16em -.08em -.32em; }
.sm > .si, .sm > .wd { display: inline-block; transform: translateY(108%) rotate(3deg); transform-origin: 0 100%;
  transition: transform 1.15s var(--ease); transition-delay: calc(var(--k, 0) * 55ms + 40ms); }
.is-split.is-shown .sm > .si, .is-split.is-shown .sm > .wd { transform: none; }

/* ---------- MICROINTERAÇÕES ---------- */
[data-mag] { transition: translate .7s var(--ease); }
[data-mag].is-mag { transition: translate .25s var(--ease); }
a, button { -webkit-tap-highlight-color: transparent; }
button { transition: scale .35s var(--ease-pop); }
button:active, .prefs__opt:active, .vtog button:active, .chip:active, .ulink:active { scale: .96; transition-duration: .12s; }
a.hcard .hcard__m, .fw__media, .ic__img, .labi__img { transition: scale .6s var(--ease), box-shadow .6s var(--ease), clip-path 1.2s var(--ease); }
a.hcard:active .hcard__m, .fw:active .fw__media { scale: .975; transition-duration: .15s; }
.fw:hover .fw__media img { transform: scale(1.045); }
.fw__media img { transition: transform 1.4s var(--ease), opacity .6s var(--ease) !important; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 2px; }
:focus:not(:focus-visible) { outline: none; }
.hero__label { transition: opacity .35s var(--ease), translate .6s var(--ease); }
.hero__label.is-swap { translate: 0 -.6em; }
.cursor { transition: transform .5s var(--ease-pop) !important; }

/* ---------- HERO: cards entram em cascata, reagem à velocidade e ao mouse ---------- */
.hcard { animation: hcIn 1.5s var(--ease) both; animation-delay: calc(var(--i, 0) * 70ms + .15s); }
html.intro .hcard, html.intro-run .hcard { animation-play-state: paused; }
@keyframes hcIn { from { opacity: 0; translate: 0 60px; } to { opacity: 1; translate: 0 0; } }
.hcard__shine { position: absolute; inset: 0; pointer-events: none; z-index: 2; opacity: 0; transition: opacity .6s var(--ease);
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,.22), transparent 60%); mix-blend-mode: soft-light; }
a.hcard:hover .hcard__shine { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .sm > .si, .sm > .wd { transform: none !important; transition: none !important; }
  .hcard { animation: none; }
  div.intro, .pt { display: none !important; }
  html.intro body::after, html.pt-in body::after { display: none; }
}

/* abertura: imagens piscando atrás do 6666 (inspirado em unanim) */
.intro__bg { position: absolute; left: 50%; top: 50%; z-index: 0; width: calc(16vw + var(--g, 0) * 18vw); aspect-ratio: 4 / 5; transform: translate(-50%, -54%); overflow: hidden; border-radius: 4px;
  transition: width .2s linear, opacity .6s, border-radius .9s var(--ease-io); }
.intro__bg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; filter: grayscale(.15) contrast(1.05); }
.intro__bg img.is-on { opacity: 1; }
.intro__bg.is-out { width: 120vw; aspect-ratio: auto; height: 120vh; border-radius: 0; opacity: 0; transition: width .9s var(--ease-io), height .9s var(--ease-io), opacity .9s ease .25s, border-radius .9s; }
.intro__name, .intro__meta { z-index: 1; }
div.intro .intro__name { color: #fff; mix-blend-mode: difference; }
html.intro-run .mark--intro .mark__base { opacity: .25; }

/* transição nativa entre páginas (Chrome/Edge/Safari recentes) */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root) { animation: vtOut .42s cubic-bezier(.7, 0, .84, 0) both; }
  ::view-transition-new(root) { animation: vtIn .9s cubic-bezier(.16, 1, .3, 1) both; }
  .hdr { view-transition-name: site-hdr; }
  ::view-transition-group(site-hdr) { animation-duration: .5s; }
}
@keyframes vtOut { to { opacity: 0; transform: translateY(-28px); filter: blur(6px); } }
@keyframes vtIn { from { opacity: 0; transform: translateY(46px); filter: blur(4px); } }

/* prévia das páginas no menu */
.npv { position: fixed; z-index: 70; padding: 8px; border-radius: 14px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: 0 30px 60px -28px rgba(0,0,0,.5); pointer-events: none;
  opacity: 0; transform: translateY(-8px) scale(.97); transform-origin: 50% 0; filter: blur(6px); transition: opacity .25s, transform .45s var(--ease), filter .35s, left .45s var(--ease), width .45s var(--ease); }
.npv.is-on { opacity: 1; transform: none; filter: none; }
.npv img { display: block; width: 100%; height: 100%; object-fit: cover; }
.npv__ft { padding: 10px 6px 4px; }
.npv__ft b { display: block; font-size: 15px; font-weight: 700; letter-spacing: -.03em; }
.npv__ft sup { font-size: 10px; margin-left: 3px; color: var(--mid); }
.npv__ft p { font-size: 12px; line-height: 1.4; color: var(--mid); margin-top: 3px; }
.npv__mos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; border-radius: 8px; overflow: hidden; }
.npv__mos i { position: relative; aspect-ratio: 1; overflow: hidden; background: var(--grey); }
.npv__mos i img { position: absolute; inset: 0; }
.npv__mos i img.is-in { animation: npvIn .6s var(--ease) both; }
@keyframes npvIn { from { opacity: 0; transform: scale(1.15); } }
.npv.is-ar { border-color: color-mix(in srgb, var(--red) 45%, var(--line)); box-shadow: 0 30px 60px -28px rgba(0,0,0,.5), 0 0 0 3px color-mix(in srgb, var(--red) 14%, transparent); }
.npv.is-ar .npv__ft { display: grid; grid-template-columns: 1fr auto; align-items: center; }
.npv.is-ar .npv__ft p { grid-column: 1 / -1; }
.npv__new { font-size: 11px; font-weight: 700; padding: 5px 10px; border-radius: 999px; background: var(--red); color: var(--on-red, #fff); }
.npv__fan { position: relative; height: 130px; }
.npv__fan i { position: absolute; top: 10px; width: 46%; height: 110px; left: 27%; border-radius: 6px; overflow: hidden; box-shadow: 0 12px 24px -12px rgba(0,0,0,.5); transition: transform .6s var(--ease); }
.npv__fan i:nth-child(1) { transform: rotate(-9deg) translateX(-62%); } .npv__fan i:nth-child(3) { transform: rotate(9deg) translateX(62%); } .npv__fan i:nth-child(2) { z-index: 2; transform: translateY(-4px); }
.npv__ph { height: 150px; border-radius: 8px; overflow: hidden; background: #0e0e0e; }
.npv__ct { padding: 18px 12px 10px; border-radius: 8px; background: var(--grey); }
.npv__ct span { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; }
.npv__ct span i { width: 7px; height: 7px; border-radius: 50%; background: #2bd46a; }
.npv__ct b { display: block; margin-top: 10px; font-size: 34px; line-height: .9; font-weight: 700; letter-spacing: -.06em; color: var(--red); }
.npv, .npv__mos, .npv__fan i, .npv__ph, .npv__ct { border-radius: 3px; }
.npv { box-shadow: 0 14px 30px -18px rgba(0,0,0,.35); }
.npv__new { border-radius: 2px; }
