/* ============================================================
   Página Sob Medida — núcleo técnico compartilhado
   Reset, acessibilidade e utilitários ESTRUTURAIS de animação.
   Nenhuma decisão visual (cor, tipografia, composição) mora
   aqui — isso é responsabilidade do CSS de cada página.
   ============================================================ */

/* --- Reset mínimo --- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, svg, video, canvas { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }

/* --- Acessibilidade --- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}
.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 100;
  background: #000; color: #fff; padding: 10px 16px; border-radius: 4px;
  transition: top .2s ease;
}
.skip-link:focus { top: 8px; }
:focus-visible { outline: 3px solid currentColor; outline-offset: 2px; }

/* --- Container genérico (cada página define --page-max se quiser) --- */
.container { max-width: var(--page-max, 1240px); margin: 0 auto; padding-left: var(--page-gutter, 24px); padding-right: var(--page-gutter, 24px); }

/* --- Revelação ao rolar --- */
[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .7s cubic-bezier(.16,.84,.44,1), transform .7s cubic-bezier(.16,.84,.44,1);
}
[data-reveal].is-visible { opacity: 1; transform: none; }
[data-reveal="scale"] { transform: scale(.92); }
[data-reveal="scale"].is-visible { transform: scale(1); }
[data-reveal="left"] { transform: translateX(-28px); }
[data-reveal="left"].is-visible { transform: none; }
[data-reveal="right"] { transform: translateX(28px); }
[data-reveal="right"].is-visible { transform: none; }

/* --- Contador --- */
[data-counter] { font-variant-numeric: tabular-nums; }

/* --- Botão magnético / brilho de cursor: só o encaixe estrutural --- */
[data-magnetic] { display: inline-flex; will-change: transform; transition: transform .15s ease-out; }
[data-cursor-glow] { position: relative; overflow: hidden; }
[data-cursor-glow]::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at var(--gx,50%) var(--gy,50%), var(--glow-color, rgba(255,255,255,.16)), transparent 60%);
  transition: opacity .3s ease;
}
[data-cursor-glow]:hover::before { opacity: 1; }

/* --- Parallax --- */
[data-parallax] { will-change: transform; }

/* --- Antes / depois --- */
[data-before-after] { position: relative; overflow: hidden; --ba-pos: 50%; }
[data-before-after] [data-ba-before],
[data-before-after] [data-ba-after] { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
[data-before-after] [data-ba-before] { position: relative; }
[data-before-after] input[type="range"] {
  position: absolute; left: 0; bottom: 14px; width: 100%; margin: 0; z-index: 3;
  -webkit-appearance: none; appearance: none; background: transparent; height: 28px;
}
[data-before-after] input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 42px; height: 42px; border-radius: 50%;
  background: #fff; box-shadow: 0 4px 14px rgba(0,0,0,.35); cursor: ew-resize; margin-top: -13px;
}
[data-before-after] input[type="range"]::-webkit-slider-runnable-track { height: 2px; background: rgba(255,255,255,.7); }
[data-before-after] .ba-handle {
  position: absolute; top: 0; bottom: 0; left: var(--ba-pos); width: 2px; background: #fff;
  pointer-events: none; z-index: 2; box-shadow: 0 0 0 1px rgba(0,0,0,.15);
}

/* --- Galeria com rolagem horizontal --- */
[data-scroller] {
  display: flex; gap: var(--scroller-gap, 20px); overflow-x: auto; scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch; touch-action: pan-y; cursor: grab; scrollbar-width: thin;
}
[data-scroller]:active { cursor: grabbing; }
[data-scroller] > * { scroll-snap-align: start; flex: none; }

/* --- Partículas --- */
[data-particles] { position: relative; }
.particles-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* --- Palavras alternando --- */
[data-word-swap] { display: inline-block; transition: opacity .26s ease, transform .26s ease; }
[data-word-swap].is-swapping { opacity: 0; transform: translateY(6px); }

/* --- Barra de progresso de rolagem --- */
[data-scroll-progress] {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%; z-index: 80;
  background: var(--accent, #333); transition: width .1s linear;
}

/* --- Varredura (dedetização / segurança eletrônica) --- */
.scan-line {
  position: absolute; left: 0; right: 0; height: 2px;
  background: var(--scan-color, rgba(120,255,180,.9));
  box-shadow: 0 0 16px 2px var(--scan-color, rgba(120,255,180,.7));
  animation: scan-sweep 3.2s ease-in-out infinite;
}
@keyframes scan-sweep {
  0%, 100% { top: 4%; opacity: 0; }
  8% { opacity: 1; }
  50% { top: 92%; opacity: 1; }
  58% { opacity: 0; }
}

/* --- Flutuação suave (lavanderia / bolhas) --- */
.float-el { animation: float-y 7s ease-in-out infinite; }
@keyframes float-y { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-16px); } }

/* --- FAQ acessível (details/summary nativos + altura animada) --- */
details.faq-item > summary { cursor: pointer; list-style: none; }
details.faq-item > summary::-webkit-details-marker { display: none; }
details.faq-item .faq-body { overflow: hidden; }

/* --- Movimento reduzido: desativa tudo que não é essencial --- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
  [data-parallax] { transform: none !important; }
  .scan-line, .float-el { animation: none !important; }
  * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* --- Imagens: nunca "quebradas" sem aviso visual --- */
img { background: #e9e5da; }
