/* ==========================================================================
   Holanda Proteção e Controle — motion.css
   Preloader, revelações no scroll, texto dividido, transição entre páginas.
   Tudo é ativado só quando o JS marca <html class="js">: sem JS,
   o conteúdo aparece normalmente.
   ========================================================================== */

/* -------------------------------------------------------------------------
   Keyframes gerais
   ------------------------------------------------------------------------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* -------------------------------------------------------------------------
   Preloader (só na primeira visita da sessão)
   ------------------------------------------------------------------------- */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  place-items: center;
  background: var(--c-ink);
  color: var(--c-white);
}
.js.is-preloading .preloader { display: grid; }
.preloader__inner { display: grid; justify-items: center; gap: 1.75rem; }
.preloader__mark { width: 84px; height: 84px; animation: preload-mark .9s var(--ease-out) both; }
.preloader__bar {
  position: relative;
  width: 160px;
  height: 2px;
  background: rgba(255, 255, 255, .12);
  overflow: hidden;
}
.preloader__bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--c-orange);
  transform-origin: left;
  animation: preload-bar 1s var(--ease-in-out) both;
}
.preloader.is-done {
  display: grid;
  clip-path: inset(0 0 100% 0);
  transition: clip-path .9s var(--ease-in-out);
}
@keyframes preload-mark {
  from { opacity: 0; transform: scale(.85); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: none; }
}
@keyframes preload-bar { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* -------------------------------------------------------------------------
   Revelação no scroll
   ------------------------------------------------------------------------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(36px);
  transition:
    opacity .9s var(--ease-out) var(--delay, 0s),
    transform 1.1s var(--ease-out) var(--delay, 0s);
}
.js [data-reveal="fade"] { transform: none; }
.js [data-reveal="left"] { transform: translateX(-40px); }
.js [data-reveal="right"] { transform: translateX(40px); }
.js [data-reveal="scale"] { transform: scale(.94); }
.js [data-reveal].is-in { opacity: 1; transform: none; }
/* No mobile, entradas laterais viram verticais (evita rolagem horizontal) */
@media (max-width: 960px) {
  .js [data-reveal="left"]:not(.is-in), .js [data-reveal="right"]:not(.is-in) { transform: translateY(36px); }
}

/* Imagem que "abre" de baixo para cima */
.js [data-reveal="clip"] {
  opacity: 1;
  transform: none;
  clip-path: inset(100% 0 0 0);
  transition: clip-path 1.3s var(--ease-in-out) var(--delay, 0s);
}
.js [data-reveal="clip"] img { transform: scale(1.25); transition: transform 1.8s var(--ease-out) var(--delay, 0s); }
.js [data-reveal="clip"].is-in { clip-path: inset(0 0 0 0); }
.js [data-reveal="clip"].is-in img { transform: scale(1); }
.js .frame--chamfer[data-reveal="clip"].is-in {
  clip-path: polygon(var(--chamfer) 0, 100% 0, 100% calc(100% - var(--chamfer)), calc(100% - var(--chamfer)) 100%, 0 100%, 0 var(--chamfer));
}
.js .frame--chamfer[data-reveal="clip"] {
  clip-path: polygon(0 100%, 100% 100%, 100% 100%, 100% 100%, 0 100%, 0 100%);
}

/* Linha que se desenha */
.js [data-reveal="line"] { opacity: 1; transform: scaleX(0); transform-origin: left; transition: transform 1.2s var(--ease-in-out) var(--delay, 0s); }
.js [data-reveal="line"].is-in { transform: scaleX(1); }

/* -------------------------------------------------------------------------
   Texto dividido em palavras
   ------------------------------------------------------------------------- */
.split-word {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-bottom: .08em;
  margin-bottom: -.08em;
}
.split-word > span {
  display: inline-block;
  transform: translateY(105%);
  transition: transform 1s var(--ease-out);
  transition-delay: calc(var(--i) * 55ms + var(--delay, 0s));
}
.is-in .split-word > span,
.split-ready.is-in .split-word > span { transform: none; }

/* Hero aguarda o fim do preloader */
.js [data-hero] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .9s var(--ease-out) var(--delay, 0s), transform 1.1s var(--ease-out) var(--delay, 0s);
}
.js.hero-in [data-hero] { opacity: 1; transform: none; }
.js .hero__frame { clip-path: inset(0 0 100% 0); transition: clip-path 1.4s var(--ease-in-out) .15s; }
.js.hero-in .hero__frame {
  clip-path: polygon(var(--chamfer) 0, 100% 0, 100% calc(100% - var(--chamfer)), calc(100% - var(--chamfer)) 100%, 0 100%, 0 var(--chamfer));
}
.js .hero__frame img { transition: transform 2.2s var(--ease-out) .15s; transform: scale(1.25); }
.js.hero-in .hero__frame img { transform: scale(1.08); }

/* Diagrama: traços que se desenham */
.js .schematic .sc-draw { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 2.2s var(--ease-in-out) var(--delay, .6s); }
.js.hero-in .schematic .sc-draw,
.js .is-in .schematic .sc-draw { stroke-dashoffset: 0; }

/* -------------------------------------------------------------------------
   Parallax (o JS aplica --py)
   ------------------------------------------------------------------------- */
[data-parallax] { will-change: translate; translate: 0 var(--py, 0px); }

/* -------------------------------------------------------------------------
   Transição entre páginas (View Transitions entre documentos)
   ------------------------------------------------------------------------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .35s var(--ease-in-out) both; }
::view-transition-new(root) { animation: vt-in .6s var(--ease-out) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-12px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(16px); } }

/* -------------------------------------------------------------------------
   Movimento reduzido
   ------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    transition-delay: 0s !important;
  }
  .js [data-reveal], .js [data-hero] { opacity: 1 !important; transform: none !important; clip-path: none !important; }
  .js [data-reveal] img, .js .hero__frame img { transform: none !important; }
  .js .hero__frame { clip-path: polygon(var(--chamfer) 0, 100% 0, 100% calc(100% - var(--chamfer)), calc(100% - var(--chamfer)) 100%, 0 100%, 0 var(--chamfer)) !important; }
  .split-word > span { transform: none !important; }
  [data-parallax] { translate: none !important; }
  .schematic .sc-pulse, .btn--shine::after, .wa-float::before { animation: none !important; display: none; }
  .waveform .wave-move, .schematic .sc-blink { animation: none !important; }
  .js .schematic .sc-draw { stroke-dashoffset: 0 !important; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; }
}
