/* ============================================================================
   VAL RIBEIRO MAKEUP — animations.css
   Preloader cinematográfico, cursor personalizado, estados de revelação
   e keyframes. Tudo respeita `prefers-reduced-motion`.
   ========================================================================= */

/* ---------------------------------------------------------------------------
   1. KEYFRAMES
   ------------------------------------------------------------------------ */
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@keyframes navItemIn {
  to { opacity: 1; transform: none; }
}

/* Varredura de brilho sobre a logo do preloader */
@keyframes shimmerSweep {
  0%   { transform: translateX(-130%) skewX(-18deg); }
  100% { transform: translateX(230%)  skewX(-18deg); }
}

/* Linha do indicador de scroll */
@keyframes scrollPulse {
  0%   { transform: translateY(-100%); }
  55%  { transform: translateY(0); }
  100% { transform: translateY(100%); }
}

/* Respiração suave — usado no glow do hero */
@keyframes breathe {
  0%, 100% { transform: scale(1);    opacity: .85; }
  50%      { transform: scale(1.07); opacity: 1; }
}

/* Flutuação lenta das molduras */
@keyframes floatSoft {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}

/* Pulso do anel do WhatsApp */
@keyframes waPulse {
  0%   { box-shadow: 0 0 0 0 rgba(37, 211, 102, .45); }
  70%  { box-shadow: 0 0 0 16px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* Giro do selo "desde 2017" */
@keyframes stampSpin {
  to { transform: rotate(360deg); }
}

/* ---------------------------------------------------------------------------
   2. PRELOADER — abertura cinematográfica
   ------------------------------------------------------------------------ */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  background: var(--ivory);
  overflow: hidden;
}
/* remove o preloader do fluxo assim que a animação termina */
.preloader.is-done { display: none; }

/* Halo quente por trás da logo */
.preloader::before {
  content: '';
  position: absolute;
  width: min(70vw, 720px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle,
              rgba(231, 179, 196, .34) 0%,
              rgba(222, 195, 160, .22) 42%,
              transparent 70%);
  filter: blur(28px);
  animation: breathe 5s ease-in-out infinite;
}

.preloader__inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding-inline: 1.5rem;
  text-align: center;
}

.preloader__logo {
  position: relative;
  overflow: hidden;
  /* revelado por GSAP via clip-path */
}
.preloader__logo img {
  width: clamp(200px, 42vw, 360px);
  height: auto;
}

/* Faixa de brilho que atravessa a logo */
.preloader__shimmer {
  position: absolute;
  top: 0; left: 0;
  width: 42%; height: 100%;
  background: linear-gradient(90deg,
              transparent,
              rgba(222, 195, 160, .75),
              rgba(255, 255, 255, .9),
              transparent);
  mix-blend-mode: overlay;
  pointer-events: none;
  opacity: 0;
}

.preloader__tagline {
  font-size: .64rem;
  letter-spacing: .38em;
  text-transform: uppercase;
  color: var(--taupe);
  opacity: 0;
}

.preloader__bar {
  position: relative;
  width: min(220px, 55vw);
  height: 1px;
  background: var(--line);
  overflow: hidden;
}
.preloader__fill {
  position: absolute;
  inset: 0;
  transform: scaleX(0);
  transform-origin: left center;
  background: linear-gradient(90deg, var(--rose), var(--champagne));
}

.preloader__count {
  font-family: var(--font-display);
  font-size: .95rem;
  color: var(--taupe);
  letter-spacing: .1em;
}

/* Cortina que sobe revelando o site */
.preloader__curtain {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: var(--ivory);
  transform: scaleY(0);
  transform-origin: bottom center;
  pointer-events: none;
}

/* Trava o scroll enquanto o preloader estiver ativo */
body.is-loading { overflow: hidden; }

/* ---------------------------------------------------------------------------
   3. CURSOR PERSONALIZADO
   ------------------------------------------------------------------------ */
.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0; left: 0;
  z-index: 1500;
  pointer-events: none;
  border-radius: 50%;
  opacity: 0;
  will-change: transform;
  transition: opacity .35s var(--ease);
}
.cursor-dot {
  width: 6px; height: 6px;
  margin: -3px 0 0 -3px;
  background: var(--rose);
}
.cursor-ring {
  width: 38px; height: 38px;
  margin: -19px 0 0 -19px;
  border: 1px solid rgba(189, 74, 113, .55);
  display: grid;
  place-items: center;
  transition: width .4s var(--ease), height .4s var(--ease),
              margin .4s var(--ease), background .4s var(--ease),
              border-color .4s var(--ease), opacity .35s var(--ease);
}

/* visível apenas quando o JS confirma um ponteiro fino */
body.has-cursor .cursor-dot,
body.has-cursor .cursor-ring { opacity: 1; }

/* Sobre elementos interativos */
body.cursor-hover .cursor-ring {
  width: 62px; height: 62px;
  margin: -31px 0 0 -31px;
  background: rgba(189, 74, 113, .10);
  border-color: rgba(189, 74, 113, .8);
}
body.cursor-hover .cursor-dot { opacity: 0; }

/* Sobre itens do portfólio — exibe rótulo "Ver" */
body.cursor-view .cursor-ring {
  width: 84px; height: 84px;
  margin: -42px 0 0 -42px;
  background: var(--rose);
  border-color: var(--rose);
}
body.cursor-view .cursor-dot { opacity: 0; }

.cursor-ring__label {
  font-family: var(--font-sans);
  font-size: .58rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: #fff;
  opacity: 0;
  transform: scale(.7);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
body.cursor-view .cursor-ring__label { opacity: 1; transform: none; }

/* Esconde o cursor nativo apenas quando o customizado está ativo */
body.has-cursor,
body.has-cursor a,
body.has-cursor button,
body.has-cursor .gallery__item { cursor: none; }

/* ---------------------------------------------------------------------------
   4. ESTADOS DE REVELAÇÃO (aplicados por GSAP/ScrollTrigger)
   ------------------------------------------------------------------------ */

/* Estado inicial — o JS anima para o estado final.
   Se o JS falhar, a regra `.no-js` abaixo devolve tudo à visibilidade. */
.reveal-up,
[data-stagger] > * {
  opacity: 0;
  transform: translateY(28px);
}

/* Títulos animados linha a linha.
   O estado inicial NÃO fica no CSS de propósito: uma transform vinda da folha
   de estilo é lida pelo GSAP como deslocamento em pixels e briga com o
   yPercent, deixando o título preso fora da tela. Aqui só escondemos o bloco;
   quem posiciona as linhas é o JS, logo antes de revelar. */
.hero__title,
.cta-final__title { visibility: hidden; }

.hero__title .line > span,
.cta-final__title .line > span { display: block; }

/* Molduras revelam com máscara + zoom-out da imagem */
.frame img,
.hero__figure img { transform: scale(1.12); }

/* Quando o JS não roda, nada fica invisível */
.no-js .reveal-up,
.no-js [data-stagger] > * { opacity: 1; transform: none; }
.no-js .hero__title,
.no-js .cta-final__title { visibility: visible; }
.no-js .frame img,
.no-js .hero__figure img { transform: none; }
.no-js .preloader { display: none; }

/* ---------------------------------------------------------------------------
   5. ANIMAÇÕES CONTÍNUAS
   ------------------------------------------------------------------------ */
.hero__glow { animation: breathe 9s ease-in-out infinite; }
.hero__figure--float { animation: floatSoft 7s ease-in-out infinite; }
.frame--small { animation: floatSoft 8.5s ease-in-out infinite .6s; }

.hero__scroll-line::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--rose);
  animation: scrollPulse 2.4s var(--ease) infinite;
}

.wa-float.is-visible { animation: waPulse 2.8s ease-out infinite 1s; }

/* ---------------------------------------------------------------------------
   6. AOS — ajuste fino das durações padrão
   ------------------------------------------------------------------------ */
[data-aos] { pointer-events: none; }
[data-aos].aos-animate { pointer-events: auto; }

/* ---------------------------------------------------------------------------
   7. MOVIMENTO REDUZIDO
   Respeita a preferência do sistema: mantém tudo legível e estático.
   ------------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }

  .reveal-up,
  [data-stagger] > * { opacity: 1 !important; transform: none !important; }

  .hero__title,
  .cta-final__title { visibility: visible !important; }
  .hero__title .line > span,
  .cta-final__title .line > span { transform: none !important; }

  .frame img,
  .hero__figure img { transform: none !important; }

  .cursor-dot, .cursor-ring { display: none !important; }

  .marquee__track { animation: none; }

  #scene-canvas { display: none; }
}
