/* Melhorias Fuuxis: hero com movimento, animações de scroll e ajustes para celular. */

/* Barra de progresso de leitura */
.progresso-leitura {
  position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 60;
  background: var(--champagne); transform-origin: left; transform: scaleX(0);
  pointer-events: none;
}

/* Hero em vídeo */
#inicio { min-height: 100svh; }
#inicio > .hero-video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 76% center;
  transform: scale(var(--hero-zoom, 1.06)); transform-origin: 70% 40%;
  will-change: transform;
}
@media (min-width: 640px) { #inicio > .hero-video { object-position: center; } }
#inicio > .relative.z-10 { will-change: transform, opacity; }

/* Título do hero: palavras surgem em sequência */
.hero-titulo { font-size: clamp(2.55rem, 10.6vw, 4.6rem); line-height: 1.02; text-wrap: balance; }
.hero-titulo .palavra { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: .08em; margin-bottom: -.08em; }
.hero-titulo .palavra > span {
  display: inline-block; transform: translateY(110%);
  animation: hero-palavra .9s cubic-bezier(.2,.75,.2,1) forwards;
  animation-delay: calc(.25s + var(--i) * .07s);
}
.hero-titulo em { font-style: normal; color: var(--champagne); }
@keyframes hero-palavra { to { transform: translateY(0); } }

/* Indicador de rolagem no hero */
.hero-rolar {
  position: absolute; left: 50%; bottom: 1.4rem; z-index: 10; transform: translateX(-50%);
  width: 1.5rem; height: 2.4rem; border: 1px solid color-mix(in oklab, var(--on-dark) 55%, transparent); border-radius: 1rem;
}
.hero-rolar::after {
  content: ""; position: absolute; left: 50%; top: .45rem; width: 3px; height: 6px; margin-left: -1.5px;
  border-radius: 2px; background: var(--champagne); animation: hero-rolar 1.8s ease-in-out infinite;
}
@keyframes hero-rolar { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(.9rem); } }
@media (max-width: 639px) { .hero-rolar { display: none; } }

/* Revelação no scroll */
.js-anim [data-revelar] {
  opacity: 0; transform: translateY(32px);
  transition: opacity .9s ease, transform .9s cubic-bezier(.2,.75,.2,1);
  transition-delay: var(--atraso, 0s);
}
.js-anim [data-revelar].visivel { opacity: 1; transform: none; }
.js-anim [data-revelar="imagem"] { opacity: 1; transform: none; clip-path: inset(12% 0 0 0); transition: clip-path 1.1s cubic-bezier(.2,.75,.2,1); transition-delay: var(--atraso, 0s); }
.js-anim [data-revelar="imagem"].visivel { clip-path: inset(0 0 0 0); }

/* Parallax suave nas imagens */
.parallax-img { overflow: hidden; }
.parallax-img > img { transform: translateY(var(--py, 0px)) scale(1.08); will-change: transform; }

/* Botões com toque mais vivo */
#inicio a.inline-flex, #contato a.inline-flex, #sobre a.inline-flex { transition: transform .25s ease, background-color .25s ease, border-color .25s ease; }
#inicio a.inline-flex:active, #contato a.inline-flex:active, #sobre a.inline-flex:active { transform: scale(.97); }

/* WhatsApp flutuante com pulso discreto */
a[aria-label="Agendar pelo WhatsApp"]::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%; border: 1px solid var(--champagne);
  animation: zap-pulso 2.6s ease-out infinite;
}
@keyframes zap-pulso { 0% { transform: scale(1); opacity: .8; } 100% { transform: scale(1.6); opacity: 0; } }

/* ===== Celular ===== */
@media (max-width: 639px) {
  /* Menos espaço vazio entre seções */
  #servicos, #sobre, #contato { padding-block: 4.5rem; }
  #espaco, #trabalhos { padding-block: 4.25rem; }
  #servicos .grid.border-b { gap: 1.25rem; padding-bottom: 2rem; }
  #servicos h2, #espaco h2, #trabalhos h2 { font-size: 2.6rem; }
  #sobre h2 { font-size: 3.4rem; }
  #contato h2 { font-size: 2.55rem; }

  /* Hero */
  #inicio > .relative.z-10 { padding-bottom: 4.5rem; }
  #inicio .mt-8.flex { margin-top: 1.75rem; }

  /* Serviços em carrossel deslizável */
  .servicos-grid {
    display: flex; gap: .9rem; margin: 2rem -1.25rem 0; padding: 0 1.25rem .5rem;
    overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 1.25rem;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .servicos-grid::-webkit-scrollbar { display: none; }
  .servicos-grid > article { flex: 0 0 76%; scroll-snap-align: start; }
  .servicos-grid > article .pt-6 { padding-top: 1rem; }
  .servicos-grid > article h3 { font-size: 1.7rem; }
  .servicos-grid > article p { min-height: 0; margin-top: .4rem; }
  .servicos-nav { display: flex; align-items: center; gap: 1rem; margin-top: 1.25rem; }
  .servicos-trilho { position: relative; flex: 1; height: 2px; background: color-mix(in oklab, var(--foreground) 12%, transparent); border-radius: 2px; overflow: hidden; }
  .servicos-trilho span { position: absolute; inset: 0 auto 0 0; width: 12.5%; background: var(--champagne-strong); border-radius: 2px; transition: transform .2s linear; }
  .servicos-dica { font-size: .62rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--muted-foreground); white-space: nowrap; }

  /* Galeria do salão: lado a lado para encurtar a página */
  .salao-galeria { grid-template-columns: 1fr 1fr; gap: .75rem; margin-top: 2rem; }
  .salao-galeria img { aspect-ratio: 4 / 5; height: auto; object-fit: cover; }
  .salao-galeria img:first-child { grid-column: 1 / -1; aspect-ratio: 4 / 3; }

  /* Trabalhos */
  .trabalhos-galeria { gap: .6rem; margin-top: 2rem; }
  .trabalhos-galeria img { border-radius: .15rem; }

  /* Sobre */
  #sobre .debora-video-frame { max-width: 22rem; }
}
@media (min-width: 640px) { .servicos-nav { display: none; } .hero-titulo { font-size: clamp(3.2rem, 5.6vw, 4.8rem); max-width: 46rem; } }

@media (prefers-reduced-motion: reduce) {
  #inicio > .hero-video { display: none; }
  .hero-titulo .palavra > span { animation: none; transform: none; }
  .js-anim [data-revelar] { opacity: 1; transform: none; clip-path: none; transition: none; }
  .parallax-img > img { transform: none; }
  a[aria-label="Agendar pelo WhatsApp"]::before, .hero-rolar::after { animation: none; }
}
