/*
  effects.css — efeitos interativos inspirados no NESH.
  Carregado depois de styles.css. Seções novas (visão geral, planos, clientes, carrossel) em sections.css.
*/

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

body.scroll-locked {
  overflow: hidden;
}

/* ---------- Hover com texto rolando ---------- */
/* clip-path força um recorte exato em pixel; só overflow:hidden deixava vazar 1px do acento
   de letras como "í" da segunda cópia (ex.: bolinha sutil sob o "Í" de "Disponível") — a
   camada composta pelo transform da .roll-inner antialiasa um fio para fora do corte. */
.roll {
  display: inline-block;
  overflow: hidden;
  clip-path: inset(0);
  vertical-align: bottom;
  height: 1.3em;
  line-height: 1.3;
}
.roll-inner {
  display: flex;
  flex-direction: column;
  transition: transform 0.55s var(--ease-out-expo);
}
.roll-inner > span {
  display: block;
  height: 1.3em;
  white-space: nowrap;
}
.roll-host:hover .roll-inner,
.roll-host:focus-visible .roll-inner {
  transform: translateY(-1.3em);
}

/* ---------- Hero: palavra girando + foto ---------- */
.hero-split {
  display: inline;
}

.word-rotator {
  display: block;
  height: 1.2em;
  overflow: hidden;
  /* "Com Resultado," é a frase mais larga: 0.84em mantém a linha dentro da coluna (ver tests/) */
  font-size: 0.84em;
  color: var(--accent-color);
}
.word-rotator-item {
  display: block;
  line-height: 1.2;
  white-space: nowrap;
}

.hero-section {
  overflow: hidden;
}

.hero-stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: stretch;
  gap: 1.5rem;
  width: 100%;
  padding: 2rem 0 2.5rem;
}

/* Iniciais gigantes no fundo, estilo cartaz — a foto entra por cima, cortando as letras */
.hero-giant-type {
  position: absolute;
  top: -4vh;
  right: -2vw;
  z-index: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(9rem, 22vw, 19rem);
  line-height: 0.78;
  letter-spacing: -0.02em;
  color: var(--accent-color);
  opacity: 0.9;
  pointer-events: none;
  user-select: none;
}

/* Retrato: entrada suave com fade e deslocamento (ver text-effects.js) */
.hero-portrait {
  position: relative;
  z-index: 1;
  grid-column: 2;
  grid-row: 1;
  height: 78vh;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  align-self: end;
  transform: none;
}
.hero-portrait img {
  display: block;
  height: 100%;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: bottom center;
  /* Sem drop-shadow de propósito: a máscara abaixo recorta o elemento, e o recorte cortava
     a sombra em linha reta nas bordas da imagem — era a "caixa" escura que aparecia em volta
     do retrato. */
  will-change: transform, opacity;
  /* Suaviza o corte inferior da imagem fundindo-a com o escuro do fundo */
  -webkit-mask-image: linear-gradient(to bottom, black 85%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 85%, transparent 100%);
}

.hero-copy {
  position: relative;
  z-index: 2;
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: left;
}

.hero-stage .hero-title,
.hero-stage .hero-actions {
  position: relative;
  z-index: 2;
}
.hero-stage .hero-title {
  margin-bottom: 2rem;
  text-shadow: 0 6px 30px rgba(0,0,0,0.45);
}
.hero-copy .hero-actions {
  justify-content: flex-start;
}

/*
  Hero no celular: a ordem é TEXTO → CTA → FOTO.
  Antes a foto vinha primeiro (order:-1, 52vh) e, somada ao padding do topo, empurrava
  o título e o botão para fora da primeira tela — quem abria o site via só uma foto, sem
  saber o que a Priscila faz. Agora a promessa e o CTA aparecem de cara, e o retrato entra
  logo abaixo, com altura limitada para caber junto na mesma tela.
*/
@media (max-width: 900px) {
  /* `display: contents` dissolve a caixa do .hero-copy e promove título, CTA e galeria
     a filhos diretos do stage — só assim dá para intercalar o retrato entre eles com
     `order`, já que o retrato é irmão do .hero-copy, não filho.
     Em navegador antigo sem suporte, cai no empilhamento normal (galeria antes da foto):
     continua legível, só perde a ordem ideal. */
  .hero-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: 0 0 1rem;
  }
  .hero-copy {
    display: contents;
  }
  .hero-stage .hero-title {
    order: 1;
    text-align: center;
    margin-bottom: 1.5rem;
  }
  .hero-stage .hero-actions {
    order: 2;
    width: 100%;
    justify-content: center;
  }
  /* O "PS" sai do posicionamento absoluto e entra no fluxo, logo antes do retrato.
     Absoluto exigia adivinhar a altura do título (2 ou 3 linhas conforme o aparelho) e
     acabava caindo por cima da prova social. No fluxo, a margem negativa faz o retrato
     subir por cima dele — o efeito de cartaz continua e não depende de medida fixa. */
  .hero-giant-type {
    position: relative;
    z-index: 0;
    order: 3;
    top: auto;
    right: auto;
    transform: none;
    font-size: min(30vw, 8rem);
    line-height: 0.8;
    opacity: 0.45;
    margin-bottom: -0.62em;
  }
  .hero-portrait {
    position: relative;
    z-index: 1;
    order: 3;
    height: min(36vh, 280px);
    margin: 0;
    align-self: center;
    transform: none;
  }
  .hero-portrait img {
    max-width: min(76vw, 280px);
  }
  .hero-stage .hero-gallery {
    order: 4;
    margin-top: 1rem;
  }
  .hero-tag-wrap {
    justify-content: center;
  }
}

/* Faixa de fotos: Priscila em campo e de uniforme, abaixo dos CTAs */
.hero-gallery {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: stretch;
  gap: 0.9rem;
  margin-top: 3rem;
  max-width: 100%;
}
.hero-gallery-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  text-align: left;
  padding: 0.6rem 1.1rem;
  gap: 0.2rem;
}
.hero-gallery-stat strong {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.8rem;
  line-height: 1;
  color: var(--accent-color);
}
.hero-gallery-stat span {
  font-size: 0.68rem;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
}
.hero-gallery-item {
  width: 50px;
  height: 90px;
  border-radius: 40px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.15);
  flex-shrink: 0;
  cursor: pointer;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.4s ease;
}
.hero-gallery-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0.4) brightness(0.8);
  transition: filter 0.6s ease, transform 0.6s ease;
  object-position: center;
}
/* Foto do Rodrigo Faro: grupo horizontal cortado num pilar estreito — centraliza no rosto
   da Priscila em vez do padrão central, que caía bem no letreiro de fundo. */
.hero-gallery-item:nth-child(4) img {
  object-position: 62% 55%;
}

.hero-gallery:hover .hero-gallery-item {
  filter: brightness(0.6);
}
.hero-gallery .hero-gallery-item:hover {
  width: 140px;
  border-color: var(--accent-color);
  filter: brightness(1);
}
.hero-gallery-item:hover img {
  filter: grayscale(0) brightness(1.1);
  transform: scale(1.05);
}

.js.js-pending .hero-gallery,
.js.js-pending .hero-giant-type,
.js.js-pending .hero-portrait img {
  opacity: 0;
}

@media (max-width: 900px) {
  .hero-gallery {
    margin-top: 2rem;
    flex-wrap: wrap;
    justify-content: center;
  }
  .hero-gallery-stat {
    width: 100%;
    align-items: center;
    text-align: center;
    padding: 0 0 0.4rem;
  }
  .hero-gallery-item {
    width: 68px;
    height: 88px;
  }
}

@media (max-width: 420px) {
  .hero-gallery-item {
    width: 58px;
    height: 76px;
  }
}

/* ---------- Odômetro nos anos ---------- */
.timeline-year {
  font-variant-numeric: tabular-nums;
}
.odo-digit {
  display: inline-block;
  height: 1em;
  overflow: hidden;
  vertical-align: top;
}
.odo-strip,
.odo-strip > span {
  display: block;
  line-height: 1;
}
.odo-strip > span {
  height: 1em;
}
.odo-char {
  white-space: pre;
}

/* ---------- Modal (reaproveitado pelo popup de outros clientes) ---------- */
.story-dialog {
  margin: auto;
  width: min(640px, calc(100% - 2rem));
  max-height: calc(100dvh - 2rem);
  padding: 0;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  background: var(--surface-color);
  color: var(--text-primary);
  overflow: auto;
}
.story-dialog::backdrop {
  background: rgba(10,10,12,0.75);
  backdrop-filter: blur(6px);
}
.story-dialog-inner {
  position: relative;
  padding: 3rem 2.5rem;
}
.story-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15);
  background: transparent;
  color: var(--text-primary);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
.story-close:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
}
.story-year {
  display: block;
  margin-bottom: 1rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.2rem;
  line-height: 1;
  color: var(--accent-color);
}
.story-title {
  margin-bottom: 1.25rem;
  padding-right: 3rem;
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 4vw, 1.8rem);
  line-height: 1.2;
}
.story-body p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}
@media (max-width: 480px) {
  .story-dialog-inner {
    padding: 2.5rem 1.5rem;
  }
}

/*
  ---------- Cursor personalizado: rótulo contextual (estilo NESH) ----------
  Ponto neon discreto por padrão; vira um anel sobre qualquer elemento interativo;
  e quando o elemento carrega data-cursor="Texto" (ou é um link externo), vira uma
  pílula com esse texto. Sem mix-blend-mode — o rótulo precisa de cor própria e legível.
*/
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent-color);
  box-shadow: 0 0 14px rgba(254, 99, 61,0.5);
  pointer-events: none;
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    width 0.35s var(--ease-out-expo),
    height 0.35s var(--ease-out-expo),
    padding 0.35s var(--ease-out-expo),
    background-color 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease,
    opacity 0.3s ease;
}
.cursor[hidden] {
  display: none; /* display:flex acima anularia o atributo hidden */
}
.cursor.is-visible { opacity: 1; }

/* Anel sobre qualquer elemento interativo sem rótulo próprio */
.cursor.is-hover {
  width: 42px;
  height: 42px;
  background: transparent;
  border: 1.5px solid var(--accent-color);
  box-shadow: none;
}

/* Pílula com texto: carrosséis ("Arraste") e links externos ("Abrir ↗") */
.cursor.has-label {
  width: auto;
  height: 42px;
  padding: 0 1.3rem;
  background: var(--accent-color);
  border: none;
  box-shadow: 0 10px 28px rgba(254, 99, 61,0.28);
}
.cursor-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent-ink);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s ease 0.05s;
}
.cursor.has-label .cursor-label { opacity: 1; }

/* ---------- Preloader ---------- */
.preloader {
  display: none;
}
.show-preloader .preloader {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 2rem 5%;
  background: var(--accent-color);
  color: var(--accent-ink);
}
.show-preloader body {
  overflow: hidden;
}
.preloader-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3rem, 14vw, 9rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
}
.preloader-count {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 7vw, 4rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.preloader-count::after {
  content: "%";
}

/* ---------- Convite para rolar (canto inferior do hero) ----------
   Fixo no canto; some assim que a pessoa começa a rolar (js/ui.js initScrollCue). A entrada
   tem atraso para não competir com a abertura do hero. Saída no link e entrada no filho:
   uma animação com fill "both" venceria a opacidade da classe .is-hidden no mesmo elemento. */
.scroll-cue {
  position: fixed;
  right: max(5vw, calc((100vw - 1400px) / 2 + 70px));
  bottom: 2rem;
  z-index: 50;
  color: var(--text-secondary);
  text-decoration: none;
  transition: opacity 0.5s ease, translate 0.6s var(--ease-out-expo);
}
.scroll-cue.is-hidden {
  opacity: 0;
  translate: 0 12px;
  pointer-events: none;
}
.scroll-cue-inner {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  animation: scroll-cue-in 0.9s var(--ease-out-expo) 2.4s both;
}
.scroll-cue-label {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  transition: color 0.3s ease;
}
.scroll-cue-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.18);
  color: var(--accent-color);
  overflow: hidden;
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}
.scroll-cue-icon svg {
  width: 16px;
  height: 16px;
  animation: scroll-cue-drop 2.2s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}
.scroll-cue:hover .scroll-cue-label {
  color: var(--text-primary);
}
.scroll-cue:hover .scroll-cue-icon {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: var(--accent-ink);
}

@keyframes scroll-cue-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
/* a seta desce, para no centro e sai por baixo — o gesto de rolar */
@keyframes scroll-cue-drop {
  0% { transform: translateY(-160%); opacity: 0; }
  30%, 65% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(160%); opacity: 0; }
}

/* No touch o gesto de arrastar já é intuitivo, e o hero ocupa mais que a tela: fixo no
   canto ele ficaria sobreposto ao título em vez de "no rodapé". Fica só no desktop. */
@media (max-width: 768px) {
  .scroll-cue {
    display: none;
  }
}

/* com a duração zerada pelo reset global, a seta pararia no último quadro (invisível) */
@media (prefers-reduced-motion: reduce) {
  .scroll-cue-icon svg {
    animation: none;
  }
}
