:root {
  --motion-out: cubic-bezier(.13, .88, .27, 1);
}

@keyframes rise {
  from { transform: translateY(28px); }
  to { transform: none; }
}

@keyframes run {
  to { transform: translateX(-50%); }
}

@keyframes dismiss {
  to { opacity: 0; visibility: hidden; }
}

.track { animation: run 36s linear infinite; }
.paused, .offscreen .track { animation-play-state: paused !important; }
.track .discipline {
  display: inline-flex;
  align-items: center;
  flex: none;
  white-space: nowrap;
}
.track .discipline::after {
  content: "";
  display: block;
  width: .52em;
  height: 2px;
  margin-inline: .7em;
  background: currentColor;
  border-radius: 1px;
}

.solid:hover { background: #074ddd; }
.header-cta:hover { background: #192532; }
.closing { animation: dismiss .14s forwards !important; }

@media (prefers-reduced-motion: no-preference) {
  @keyframes title-cut {
    0% {
      transform: translate3d(var(--title-x, -68px), var(--title-y, 14px), 0);
      clip-path: var(--title-mask, inset(-10% 100% -30% -4%));
    }
    34% {
      transform: translate3d(var(--title-rebound, 5px), 0, 0);
      clip-path: inset(-14% -4% -30%);
    }
    100% {
      transform: none;
      clip-path: inset(-14% -4% -30%);
    }
  }

  @keyframes card-cut {
    0% {
      opacity: 0;
      transform: translate3d(var(--entry-x, -29px), var(--entry-y, 72px), 0) rotate(var(--entry-angle, -3deg)) scale(.875);
    }
    38% {
      opacity: 1;
      transform: translate3d(0, var(--settle-y, -6px), 0) rotate(0deg) scale(1.025);
    }
    100% { opacity: 1; transform: none; }
  }

  @keyframes panel-in {
    from { transform: translateY(var(--entry-y, 28px)) scale(.92); }
    44% { transform: translateY(var(--settle-y, -4px)) scale(1.012); }
    to { transform: none; }
  }

  @keyframes divider-in {
    from { opacity: .15; scale: 1 .08; }
    40% { opacity: 1; scale: 1 1.025; }
    to { opacity: 1; scale: 1; }
  }

  @keyframes logo-assemble {
    from { opacity: 0; transform: scale(.72) rotate(var(--entry-angle, -3deg)); }
    48% { opacity: 1; transform: scale(1.045); }
    to { opacity: 1; transform: none; }
  }

  @keyframes banner-sweep {
    from { opacity: .3; clip-path: var(--title-mask, inset(0 100% 0 0)); }
    to { opacity: 1; clip-path: inset(0); }
  }

  @keyframes reel-pop {
    from { transform: scale(.81); }
    42% { transform: scale(1.032); }
    to { transform: none; }
  }

  @keyframes price-hinge {
    from { transform: perspective(650px) rotateX(var(--hinge-angle, 27deg)) translateY(24px); }
    46% { transform: perspective(650px) rotateX(-3deg); }
    to { transform: none; }
  }

  @keyframes contact-slide {
    from { transform: translateX(var(--contact-x, 52px)); }
    to { transform: none; }
  }

  @keyframes footer-settle {
    from { transform: translateY(11px); }
    to { transform: none; }
  }

  #inicio .intro h1 { --title-y: 30px; }

  #inicio .intro h1 > span {
    animation: title-cut .46s var(--motion-out) backwards;
  }

  #inicio .intro h1 > em,
  [data-reveal-from="above"] {
    --title-x: 68px;
    --title-rebound: -5px;
    --title-mask: inset(-10% -4% -30% 100%);
    --entry-y: -72px;
    --settle-y: 6px;
  }

  #inicio .intro h1 > em {
    animation: title-cut .46s var(--motion-out) .08s backwards;
  }

  #inicio .intro .desc { animation: rise .33s var(--motion-out) .17s backwards; }
  #inicio .actions > a { animation: rise .32s var(--motion-out) .23s backwards; }
  #inicio .actions > a + a { animation-delay: .29s; }

  [data-reveal="title"].is-revealed {
    animation: title-cut .42s var(--motion-out) backwards;
  }

  :is([data-reveal="card"], [data-reveal="media"]).is-revealed {
    animation: card-cut .44s var(--motion-out) var(--reveal-delay, 0ms) backwards;
  }

  :is([data-reveal="card"], [data-reveal="media"]):nth-child(even) {
    --entry-x: 29px;
    --entry-angle: 3deg;
  }

  [data-reveal="block"].is-revealed {
    animation: panel-in .35s var(--motion-out) var(--reveal-delay, 0ms) backwards;
  }

  #formatos [data-layout="logos"] [data-reveal="card"].is-revealed {
    animation-name: logo-assemble;
  }

  #formatos :is([data-layout="banners"], [data-layout="barrinhas"]) [data-reveal="card"].is-revealed {
    animation-name: banner-sweep;
  }

  #videos :is([data-reveal="title"], [data-reveal="media"]).is-revealed {
    animation-name: reel-pop;
  }

  #precos :is([data-reveal="title"], [data-reveal="card"]).is-revealed {
    transform-origin: center bottom;
    animation-name: price-hinge;
  }

  #precos [data-reveal-from="above"] { --hinge-angle: -27deg; }
  #contato .quote-intro { --contact-x: -52px; }
  #contato :is([data-reveal="title"], [data-reveal="card"], [data-reveal="block"]).is-revealed {
    animation-name: contact-slide;
  }

  .site-footer [data-reveal="block"].is-revealed {
    animation-name: footer-settle;
    animation-duration: .54s;
  }

  [data-reveal="divider"].is-revealed { animation: divider-in .34s var(--motion-out) backwards; }
  .divider[data-reveal]:not(.is-revealed)::before { animation-play-state: paused; }
  [data-reveal]:focus-within { opacity: 1; animation: none !important; }

  .seen, #grid .card, details[open] p, #step.active {
    animation: rise .45s var(--motion-out) both;
  }

  #mobile[open] nav a,
  #mobile[open] .mobile-quote {
    --entry-y: 26px;
    animation: panel-in .27s var(--motion-out) .025s backwards;
  }

  #mobile[open] nav a:nth-child(2) { animation-delay: .055s; }
  #mobile[open] nav a:nth-child(3) { animation-delay: .085s; }
  #mobile[open] nav a:nth-child(4) { animation-delay: .115s; }
  #mobile[open] .mobile-quote { animation-delay: .15s; }

  #art-viewer[open]:not(.closing), #project[open]:not(.closing), #mobile[open]:not(.closing) {
    animation: panel-in .28s var(--motion-out) backwards;
  }

  :is(.solid, .textlink, .header-cta, .quote-channel, .footer-nav a, #reel-categories button) {
    transition: background-color .2s, border-color .2s, color .2s, translate .24s var(--motion-out), scale .22s var(--motion-out);
  }

  :is(.solid, .textlink, .header-cta, .quote-channel, #reel-categories button):active { scale: .965; }
  :is(.solid, .textlink, .header-cta, .quote-channel) > svg { transition: translate .22s var(--motion-out); }
  #formats-grid .piece-open { transition: translate .28s var(--motion-out), box-shadow .26s; }
  #formats-grid .piece-open img { transition: scale .43s var(--motion-out); }
  #prices-grid .price-card { transition: translate .29s var(--motion-out), border-color .2s, box-shadow .22s; }

  @media (hover: hover) and (pointer: fine) {
    #formats-grid .piece-open:hover { translate: 0 -4px; box-shadow: 0 0 0 1px var(--accent); }
    #formats-grid .piece-open:hover img { scale: 1.055; }
    #prices-grid .price-card:hover { translate: 0 -6px; }
    :is(.solid, .textlink, .quote-channel, .footer-nav a):hover { translate: 0 -2px; }
    :is(.solid, .textlink, .header-cta, .quote-channel):hover > svg { translate: 3px -2px; }
  }

  @media (max-width: 600px) {
    [data-reveal] { --entry-x: -10px; --entry-angle: -1.2deg; --entry-y: 54px; --title-x: -42px; }
    [data-reveal-from="above"] { --entry-y: -54px; --title-x: 42px; }
    :is([data-reveal="card"], [data-reveal="media"]):nth-child(even) { --entry-x: 10px; --entry-angle: 1.2deg; }
    #inicio .intro h1 > span { --title-x: -42px; }
    #inicio .intro h1 > em { --title-x: 42px; }
    #contato { --contact-x: 30px; }
    #contato .quote-intro { --contact-x: -30px; }
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  #cursor { display: none; }
  .track { animation: none !important; }
}
