@layer tenet-movimento;
/* =============================================================================
   Tenet Tecnologia · tenet.ia.br · css/tenet-movimento.css
   O movimento da Tenet (docs/plano-site-v4.md, §4): a montagem do título
   linha a linha, o rótulo que se digita, o eixo, a paralaxe da grade e as
   micro-interações secas, sem a mola do Otto (subida de 12 px, 40 ms entre
   itens, cubic-bezier(.2, 0, 0, 1)).

   Vem logo depois de tenet.css; a camada tenet-movimento é declarada depois
   de tenet e vence as duas folhas de movimento anteriores. Tudo sob
   .tom-tenet, em prefers-reduced-motion: no-preference e, o que depende da
   rolagem, em @supports (animation-timeline: view()). O .texto-aco nunca se
   anima por dentro: anima-se o invólucro .linha (contrato em tenet.css).
   Teto: 6 KB (capturas.mjs). Preenchido pela frente F5.
   ========================================================================== */

@layer tenet-movimento {
  /* movimento.css lê estes três: trocados aqui, o que ele já faz (botão,
     pílula, menu, sublinhado) fica seco. Na ilha roxa volta a mola da /otto. */
  .tom-tenet {
    --tt-seco: cubic-bezier(.2, 0, 0, 1);
    --mv-mola: var(--tt-seco); --mv-suave: var(--tt-seco); --mv-sobe: 12px;
  }
  .tom-tenet .tom-otto { --mv-mola: cubic-bezier(.34, 1.36, .64, 1); --mv-suave: cubic-bezier(.22, 1, .36, 1); }

  @media (prefers-reduced-motion: no-preference) {
    /* ---------------------------------------------------------- abertura --
       O rótulo se digita enquanto as linhas sobem, 70 ms entre elas; lede e
       links a 40 ms; depois o filme e o eixo. O h1 fica parado: sobe cada
       .linha, e o aço dentro dela vai junto sem ser tocado. */
    .tom-tenet .abertura-texto > * { animation: tt-sobe .56s var(--tt-seco) both; }
    .tom-tenet .abertura-texto > .frase-heroi { animation: none; }
    .tom-tenet .frase-heroi .linha { animation: tt-linha .56s .1s var(--tt-seco) both; }
    .tom-tenet .frase-heroi .linha:nth-child(2) { animation-delay: .17s; }
    .tom-tenet .frase-heroi .linha:nth-child(3) { animation-delay: .24s; }
    .tom-tenet .frase-heroi .linha:nth-child(4) { animation-delay: .31s; }
    .tom-tenet .abertura-lede { animation-delay: .38s; }
    .tom-tenet .abertura-acoes { animation-delay: .42s; }
    /* 28 caracteres de mono, da mesma largura: cada passo revela uma letra */
    .tom-tenet .abertura-texto > .abertura-rotulo { animation: tt-digita .9s steps(33) both; }

    .tom-tenet .abertura-filme { animation: tt-filme .7s .2s var(--tt-seco) both; }
    /* o eixo de 1 px sobre o fio do vídeo, descendo em aço; a máscara o
       tira de cima da lâmina, que cortada lia como duas portas */
    .tom-tenet .abertura-filme::after {
      content: ""; position: absolute; inset: 0 auto 0 calc(50% - .5px); inline-size: 1px;
      mask: linear-gradient(#000 17%, #0000 19% 81%, #000 83%);
      background: var(--aco-fio); pointer-events: none; transform-origin: 50% 0;
      animation: tt-eixo .9s .5s var(--tt-seco) both;
    }

    /* a citação sobe com a figura dela, não sozinha */
    .tom-tenet .gente-fala .frase { animation: none; }
  }

  @supports (animation-timeline: view()) {
    @media (prefers-reduced-motion: no-preference) {
      /* -------------------------------------------- revelar das seções --
         12 px e opacidade, curva da Tenet. Sem fill: fora da faixa nada
         fica apagado; a faixa nasce com o item abaixo da tela (cover 0%),
         senão ele pisca. Os 40 ms viram 4% de faixa por irmão (--tt-i).
         .revela é o gancho das páginas novas. */
      .tom-tenet :is(.produtos > li, .home-cabeca > *, .jeito-lista > li, .gente-grade > *,
          .ficha > div, .contato-texto > *, .legal-cabeca > *, .revela > *) {
        animation: tt-sobe linear; animation-timing-function: var(--tt-seco);
        animation-timeline: view();
        animation-range: cover 0% cover calc(18% + var(--tt-i) * 4%);
      }
      .tom-tenet main :nth-child(2) { --tt-i: 1; }
      .tom-tenet main :nth-child(3) { --tt-i: 2; }
      .tom-tenet main :nth-child(4) { --tt-i: 3; }
      .tom-tenet main :nth-child(n+5) { --tt-i: 4; }

      /* a grade do herói fica 40 px para trás quando ele sai */
      .tom-tenet .abertura { view-timeline: --tt-abertura; }
      .tom-tenet .abertura-tecnica {
        animation: tt-paralaxe linear both; animation-timeline: --tt-abertura;
        animation-range: exit 0% exit 100%;
      }

      /* O fio de leitura (de 1280 px): o trilho esquerdo da célula se enche
         de aço com a rolagem. O --aco-grad é horizontal: o fio nasce deitado
         e gira 90°; o translate devolve o 1 px que o giro tira do trilho. */
      @media (min-width: 1280px) {
        .tom-tenet body::before {
          content: ""; position: fixed; z-index: 3; pointer-events: none;
          top: var(--topo); left: max(var(--margem), 50% - var(--max) / 2);
          inline-size: calc(100vh - var(--topo)); block-size: 1px;
          background: var(--aco-grad); transform-origin: 0 0; translate: 1px 0; rotate: 90deg;
          animation: tt-leitura linear both; animation-timeline: scroll(root block);
        }
      }
    }
  }

  /* os fios são enfeite: no contraste alto e nas cores forçadas, saem */
  @media (prefers-contrast: more), (forced-colors: active) {
    .tom-tenet body::before, .tom-tenet .abertura-filme::after { display: none; }
  }

  @keyframes tt-sobe { from { opacity: 0; translate: 0 12px; } }
  @keyframes tt-linha { from { opacity: 0; translate: 0 105%; } }
  @keyframes tt-digita { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0); } }
  @keyframes tt-filme { from { opacity: 0; scale: .98; } }
  @keyframes tt-eixo { from { scale: 1 0; } }
  @keyframes tt-paralaxe { to { translate: 0 -40px; } }
  @keyframes tt-leitura { from { scale: 0 1; } }
}

/* sem herança: o filho não leva o índice do pai */
@property --tt-i { syntax: "<integer>"; inherits: false; initial-value: 0; }
