/* Efeitos do /portfolio. Separado do fx.css da home (lá o main h2 é outro título). Sem bibliotecas.
   Movimento de entrada usa a propriedade `translate` e o tilt usa `transform`, para os dois não brigarem.
   Tudo fica desligado em "reduzir movimento". */
@media (prefers-reduced-motion:no-preference){
  /* 1. nome no topo: cada palavra sobe de dentro de uma máscara (a divisão é feita em fx-portfolio.js) */
  .cover h1 .w{display:inline-block;overflow:hidden;vertical-align:top;padding:.24em 0 .06em;margin:-.24em 0 -.06em}
  .cover h1 .w > span{display:inline-block;transform:translateY(105%);animation:fx-word .9s cubic-bezier(.2,.8,.2,1) forwards;animation-delay:calc(.1s + var(--i) * .1s)}
  @keyframes fx-word{to{transform:none}}

  /* 2. resto da capa entra em cascata; a pilha de fotos entra por último */
  .cover .role,.cover .pitch,.cover .facts{animation:fx-in .8s cubic-bezier(.2,.8,.2,1) backwards}
  .cover .role{animation-delay:.45s}.cover .pitch{animation-delay:.6s}.cover .facts{animation-delay:.8s}
  .cover .stack figure{animation:fx-in 1s cubic-bezier(.2,.8,.2,1) backwards}
  .cover .stack .a{animation-delay:.55s}.cover .stack .b{animation-delay:.7s}.cover .stack .c{animation-delay:.85s}
  @keyframes fx-in{from{opacity:0;translate:0 28px}to{opacity:1;translate:0 0}}

  /* 3. tilt 3D nas fotos (o JS põe o transform; a transição deixa ele suave) */
  .shot{transition:transform .45s cubic-bezier(.2,.8,.2,1)}
  .shot{will-change:transform}
}

@supports (animation-timeline:view()){
  @media (prefers-reduced-motion:no-preference){
    /* 4. ao rolar: fotos, cards, especificações, estatísticas e itens sobem */
    main .shot,main .card,main .specs > div,main .stats > div,main .copy li,main .tags,main .panel{
      animation:fx-rise linear both;animation-timeline:view();animation-range:entry 0% entry 36%}
    @keyframes fx-rise{from{opacity:0;translate:0 40px}to{opacity:1;translate:0 0}}

    /* 5. título de cada projeto entra mais largo e condensa */
    main .p-head h2{animation:fx-stretch linear both;animation-timeline:view();animation-range:entry 0% cover 30%}
    @keyframes fx-stretch{from{font-stretch:112%;opacity:.25}to{font-stretch:78%;opacity:1}}
  }
}
