/* Tenet · css/movimento.css · motion do site (09/10/2026), última camada.
   Sem script; só transform/translate/scale/opacity; tudo em reduced-motion:
   no-preference; rolagem em @supports. O que é só da home mora em home.css
   (teto de 190 KB de CSS na /otto, capturas.mjs). Entrada usa translate e
   hover usa transform: somam. */

@layer movimento {
  :root {
    --mv-mola:  cubic-bezier(.34, 1.36, .64, 1);
    --mv-suave: cubic-bezier(.22, 1, .36, 1);
    --mv-sobe:  28px;
  }

  /* grão (arquivo próprio: a CSP barra data:) */
  .abertura-fundo::after, .cena-heroi::after {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background: url("../img/grao.svg?v=c75d62a4") 0 0 / 240px repeat; opacity: .05;
  }
  .cena-heroi { position: relative; isolation: isolate; overflow-x: clip; }
  @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) :is(.abertura-fundo, .cena-heroi)::after { opacity: .07; } }
  @media (prefers-contrast: more), (forced-colors: active) { :is(.abertura-fundo, .cena-heroi)::after { display: none; } }

  .botao { position: relative; isolation: isolate; overflow: hidden; }
  .botao-primario::after {
    content: ""; position: absolute; inset: -1px; z-index: -1; pointer-events: none;
    background: linear-gradient(105deg, rgb(255 255 255 / 0) 30%, light-dark(rgb(255 255 255 / .22), rgb(255 255 255 / .55)) 50%, rgb(255 255 255 / 0) 70%);
    translate: -110% 0;
  }
  .botao-primario { box-shadow: inset 0 1px 0 light-dark(rgb(255 255 255 / .16), rgb(255 255 255 / .7)), 0 1px 2px var(--sombra-cor), 0 8px 20px -10px var(--sombra-cor); }

  .topo::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -1px; block-size: 1.5px; pointer-events: none;
    background: linear-gradient(90deg, color-mix(in oklab, var(--otto) 30%, transparent), var(--otto));
    transform-origin: 0 50%; scale: 0 1; opacity: 0;
  }
  .topo-pilula::after { left: 28px; right: 28px; bottom: 0; border-radius: 99px; }

  @media (prefers-reduced-motion: no-preference) {
    .topo { view-transition-name: topo; }
    ::view-transition-old(root) { animation: .22s var(--ease-ui) both vt-sai; }
    ::view-transition-new(root) { animation: .42s var(--mv-suave) both vt-entra; }
    ::view-transition-group(topo) { animation-duration: .3s; }

    .cena-heroi::before {
      content: ""; position: absolute; inset: -10% -20% 0; z-index: -2; pointer-events: none;
      background:
        radial-gradient(30rem 26rem at 78% 30%, light-dark(rgb(145 103 234 / .16), rgb(119 60 214 / .24)), transparent 70%),
        radial-gradient(24rem 22rem at 92% 72%, light-dark(rgb(211 185 151 / .30), rgb(158 128 94 / .12)), transparent 70%);
      animation: aurora 30s ease-in-out infinite alternate; will-change: transform;
    }

    :is(.abertura-texto, .heroi-texto) > * { animation: entra .9s var(--mv-suave) both; }
    :is(.abertura-texto, .heroi-texto) > :nth-child(2) { animation-delay: .09s; }
    :is(.abertura-texto, .heroi-texto) > :nth-child(3) { animation-delay: .18s; }
    :is(.abertura-texto, .heroi-texto) > :nth-child(4) { animation-delay: .27s; }
    :is(.abertura-texto, .heroi-texto) > :nth-child(5) { animation-delay: .36s; }
    .heroi-pilulas > li { animation: entra-pilula .7s var(--mv-mola) both; }
    .heroi-pilulas > li:nth-child(1) { animation-delay: .32s; }
    .heroi-pilulas > li:nth-child(2) { animation-delay: .40s; }
    .heroi-pilulas > li:nth-child(3) { animation-delay: .48s; }

    .botao { transition: background-color .18s var(--ease-ui), border-color .18s var(--ease-ui), color .18s var(--ease-ui), transform .35s var(--mv-mola), box-shadow .25s var(--ease-ui); }
    .botao:active { transform: scale(.965); transition-duration: .08s; }
    .botao-primario::after { transition: translate .75s var(--mv-suave); }
    .botao-primario:hover::after { translate: 110% 0; }
    .botao-primario:hover { box-shadow: inset 0 1px 0 light-dark(rgb(255 255 255 / .16), rgb(255 255 255 / .7)), 0 1px 2px var(--sombra-cor), 0 14px 28px -12px var(--sombra-cor); }
    :is(.bento-q, .pergunta.cartao-vidro, .passos > li, .menu-otto) { transition: transform .45s var(--mv-suave); }
    @media (hover: hover) {
      :is(.bento-q, .pergunta.cartao-vidro, .passos > li, .menu-otto):hover { transform: translateY(-3px); }
      :is(a, label, button).pilula-vidro:hover { transform: translateY(-1px); }
    }
    :is(a, label, button).pilula-vidro { transition: background-color .18s var(--ease-ui), color .18s var(--ease-ui), box-shadow .18s var(--ease-ui), transform .35s var(--mv-mola); }
    :is(a, label, button).pilula-vidro:active { transform: scale(.96); transition-duration: .08s; }
    :is(.nav-principal, .topo-ancoras) a { position: relative; }
    :is(.nav-principal, .topo-ancoras) a::after {
      content: ""; position: absolute; left: 12px; right: 12px; bottom: 7px; block-size: 1px;
      background: var(--otto); scale: 0 1; transition: scale .35s var(--mv-suave);
    }
    :is(.nav-principal, .topo-ancoras) a:hover::after { scale: 1 1; }

    :is(.menu-painel, .topo-menu-painel):target { transition: opacity .3s var(--ease-ui), translate .45s var(--mv-suave); }
    @starting-style { :is(.menu-painel, .topo-menu-painel):target { opacity: 0; translate: 0 -10px; } }
    .pergunta[open] > :not(summary) { --mv-sobe: 8px; animation: entra .45s var(--mv-suave) both; }

    .peca-fila-v3 .fila-linha[data-destaque] .fila-espera .selo-ok { position: relative; }
    .peca-fila-v3 .fila-linha[data-destaque] .fila-espera .selo-ok::after {
      content: ""; position: absolute; inset: -3px; border-radius: 99px; pointer-events: none;
      box-shadow: 0 0 0 1.5px color-mix(in oklab, var(--otto) 70%, transparent);
      animation: halo 2.4s 1.6s var(--ease-ui) infinite both;
    }
  }

  @supports (animation-timeline: view()) {
    @media (prefers-reduced-motion: no-preference) {
      :is(.otto-texto > *, .jeito .rotulo-sobre, .jeito-lista > li, .gente-grade > *, .contato-texto > *,
          .cena:not(.cena-heroi) .cena-cabeca > *, .passos > li, .bento-q, .cuidado-v3 > li, .cuidado-linha,
          .perguntas > .pergunta, .chama-estado > *, .legal-cabeca > *) {
        animation: revela linear; animation-timeline: view(); animation-range: entry 0% entry 90%;
      }
      :is(.otto-texto, .jeito-lista, .cena-cabeca, .passos, .peca-bento, .cuidado-v3, .perguntas, .chama-estado, .contato-texto) > :nth-child(2) { animation-range: entry 0% entry 100%; }
      :is(.otto-texto, .jeito-lista, .cena-cabeca, .passos, .peca-bento, .cuidado-v3, .perguntas, .chama-estado, .contato-texto) > :nth-child(3) { animation-range: entry 0% cover 30%; }
      :is(.otto-texto, .jeito-lista, .cena-cabeca, .passos, .peca-bento, .cuidado-v3, .perguntas, .chama-estado, .contato-texto) > :nth-child(4) { animation-range: entry 0% cover 36%; }
      :is(.otto-texto, .jeito-lista, .cena-cabeca, .passos, .peca-bento, .cuidado-v3, .perguntas, .chama-estado, .contato-texto) > :nth-child(n+5) { animation-range: entry 0% cover 42%; }
      :is(.otto-texto, .cena-cabeca, .contato-texto, .gente-fala) .frase { animation-name: revela-titulo; }

      .heroi-peca { animation: sai-devagar linear; animation-timeline: view(); animation-range: exit 0% exit 100%; }

      .topo::after { animation: progresso linear both; animation-timeline: scroll(root block); }

      .conta-214 { --alvo: 214; --n: 214; }
      .conta { animation: conta linear; animation-timeline: view(); animation-range: entry 20% cover 40%; counter-reset: n var(--n); }
      .conta > span { display: none; }
      .conta::after { content: counter(n); }
    }
  }

  @keyframes entra { from { opacity: 0; translate: 0 var(--mv-sobe); } }
  @keyframes entra-pilula { from { opacity: 0; translate: 0 10px; scale: .92; } }
  @keyframes revela { from { opacity: 0; translate: 0 var(--mv-sobe); } }
  @keyframes revela-titulo { from { opacity: 0; translate: 0 calc(var(--mv-sobe) * 1.5); scale: .985; } }
  @keyframes sai-devagar { to { translate: 0 -64px; opacity: .55; } }
  @keyframes progresso { from { scale: 0 1; opacity: 1; } to { scale: 1 1; opacity: 1; } }
  @keyframes aurora { 50% { transform: translate3d(-4%, 3%, 0) scale(1.08); } 100% { transform: translate3d(3%, -2%, 0) scale(1.03); } }
  @keyframes halo { 0% { opacity: .9; scale: 1; } 70%, 100% { opacity: 0; scale: 1.35; } }
  @keyframes vt-sai { to { opacity: 0; } }
  @keyframes vt-entra { from { opacity: 0; translate: 0 14px; } }
  @keyframes conta { from { --n: 0; } to { --n: var(--alvo); } }
}

@property --n { syntax: "<integer>"; initial-value: 0; inherits: false; }
@media (prefers-reduced-motion: no-preference) { @view-transition { navigation: auto; } }
