/* =========================================================
   HERO "RONDA" — frase central, câmera ao vivo e lanterna
   ========================================================= */
.xhero {
  --mx: 50%; --my: 45%;          /* posição da lanterna dentro da câmera */
  --gx: 50%; --gy: 50%;          /* brilho dourado no fundo */
  --r: 150px;                    /* raio da lanterna */
  --camh: clamp(280px, 50vh, 600px); /* altura da câmera */
  position: relative; min-height: 100vh; min-height: 100svh;
  display: grid; grid-template-rows: 1fr auto;
  padding: calc(var(--header-h) + 12px) 0 28px;
  overflow: hidden; isolation: isolate; background: var(--bg);
}

/* Fundo: grade técnica, brilho que segue o mouse e granulado de filme */
.xh-grid {
  position: absolute; inset: 0; z-index: -3; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 88px 88px; background-position: center center;
  mask-image: radial-gradient(70% 70% at 50% 50%, #000 20%, transparent 85%);
  -webkit-mask-image: radial-gradient(70% 70% at 50% 50%, #000 20%, transparent 85%);
}
.xh-glow {
  position: absolute; inset: 0; z-index: -2; pointer-events: none;
  background: radial-gradient(520px circle at var(--gx) var(--gy), rgba(250,190,33,.10), transparent 65%);
}
.xh-grain {
  position: absolute; inset: -50%; z-index: 5; pointer-events: none; opacity: .07;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: xhGrain 1s steps(6) infinite;
}
@keyframes xhGrain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-6%, 4%); } 40% { transform: translate(5%, -7%); }
  60% { transform: translate(-3%, 8%); } 80% { transform: translate(7%, 2%); } 100% { transform: translate(0, 0); }
}

/* Laterais verticais */
.xh-side {
  position: absolute; top: 50%; z-index: 3; margin: 0;
  font: 500 11px/1 var(--f-mono); letter-spacing: .22em; text-transform: uppercase; color: rgba(243,241,234,.42);
  writing-mode: vertical-rl; white-space: nowrap;
}
.xh-side--l { left: 28px; transform: translateY(-50%) rotate(180deg); }
.xh-side--r { right: 28px; transform: translateY(-50%); }
.xh-side b { color: var(--gold); font-weight: 500; }

/* Palco: câmera no centro e frase gigante por cima */
.xh-stage { position: relative; display: grid; place-items: center; min-height: 0; perspective: 1200px; }

.xh-cam {
  position: relative; margin: 0;
  height: var(--camh); aspect-ratio: 3 / 4;
  transform-style: preserve-3d; will-change: transform;
}
.xh-cam-inner {
  position: absolute; inset: 0; overflow: hidden; border-radius: 6px; background: #000;
}
.xh-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 60% 30%; display: block;
}
/* Imagem "noturna": sem cor e escura */
.xh-img--base { filter: grayscale(1) brightness(.38) contrast(1.15); }
/* Imagem iluminada: só aparece dentro do círculo da lanterna */
.xh-img--lit {
  filter: saturate(1.08) contrast(1.05);
  mask-image: radial-gradient(circle var(--r) at var(--mx) var(--my), #000 0%, #000 45%, transparent 100%);
  -webkit-mask-image: radial-gradient(circle var(--r) at var(--mx) var(--my), #000 0%, #000 45%, transparent 100%);
}
/* Linhas de vídeo + faixa de varredura */
.xh-cam-inner::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.18) 0 1px, transparent 1px 3px);
  box-shadow: inset 0 0 120px rgba(0,0,0,.75);
}
.xh-scan {
  position: absolute; left: 0; right: 0; top: 0; height: 22%; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(250,190,33,.10) 85%, rgba(250,190,33,.45) 100%);
  animation: xhScan 4.2s cubic-bezier(.45,0,.55,1) infinite;
}
@keyframes xhScan { from { transform: translateY(-100%); } to { transform: translateY(560%); } }

/* Cantos do visor */
.xh-corner { position: absolute; width: 26px; height: 26px; border: 0 solid var(--gold); pointer-events: none; }
.xh-corner--tl { top: -12px; left: -12px; border-top-width: 2px; border-left-width: 2px; }
.xh-corner--tr { top: -12px; right: -12px; border-top-width: 2px; border-right-width: 2px; }
.xh-corner--bl { bottom: -12px; left: -12px; border-bottom-width: 2px; border-left-width: 2px; }
.xh-corner--br { bottom: -12px; right: -12px; border-bottom-width: 2px; border-right-width: 2px; }

/* Mira que acompanha a lanterna */
.xh-reticle {
  position: absolute; left: var(--mx); top: var(--my); width: 44px; height: 44px; margin: -22px 0 0 -22px;
  border: 1px solid rgba(250,190,33,.7); border-radius: 50%; pointer-events: none;
}
.xh-reticle::before, .xh-reticle::after { content: ""; position: absolute; background: rgba(250,190,33,.7); }
.xh-reticle::before { left: 50%; top: -8px; bottom: -8px; width: 1px; }
.xh-reticle::after { top: 50%; left: -8px; right: -8px; height: 1px; }

/* HUD da câmera */
.xh-hud {
  position: absolute; z-index: 2; display: flex; align-items: center; gap: 8px;
  font: 500 10.5px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: rgba(243,241,234,.85);
  text-shadow: 0 1px 6px rgba(0,0,0,.8); white-space: nowrap;
}
.xh-hud--tl { top: 46px; left: 14px; }
.xh-hud--tr { top: 46px; right: 14px; font-variant-numeric: tabular-nums; }
.xh-hud--bl { bottom: 46px; left: 14px; }
.xh-hud--br { bottom: 46px; right: 14px; color: var(--gold); }
.xh-rec { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 10px var(--danger); animation: xhBlink 1.2s steps(1) infinite; }
@keyframes xhBlink { 50% { opacity: 0; } }

/* A FRASE — "difference" inverte as letras quando passam sobre a foto */
.xh-title {
  position: absolute; inset: 0; z-index: 4; margin: 0; pointer-events: none;
  display: flex; flex-direction: column; justify-content: center;
  font-family: var(--f-display); font-weight: 700;
  font-size: clamp(46px, min(9.4vw, 15vh), 176px); line-height: .9; letter-spacing: -.055em;
  color: var(--text); mix-blend-mode: difference; text-align: center;
}
.xh-row { display: block; white-space: nowrap; will-change: transform; }
.xh-row--1 { transform: translateX(-9%); }
/* as linhas encostam no topo e na base da câmera, invadindo só um pouco */
.xh-row--2 { transform: translateX(9%); margin-top: calc(var(--camh) - .36em); }
.xh-row em { font-style: normal; color: var(--gold); }
.xh-mask { display: inline-block; overflow: hidden; vertical-align: top; padding: .04em 0 .12em; margin: -.04em 0 -.12em; }
.xh-c { display: inline-block; will-change: transform; }

/* Faixa de baixo: texto, botões e indicação de rolagem */
.xh-bottom {
  position: relative; z-index: 6; width: 100%;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 28px;
}
.xh-lead { margin: 0; max-width: 360px; font-size: 15px; line-height: 1.6; color: rgba(243,241,234,.66); }
.xh-lead strong { color: var(--text); font-weight: 600; }
.xh-ctas { display: flex; gap: 12px; }
.xh-meta { justify-self: end; display: flex; align-items: center; gap: 26px; }
.xh-stat { text-align: right; }
.xh-stat strong { display: block; font: 600 24px/1 var(--f-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.xh-stat > span { font: 500 10px/1 var(--f-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.xh-scroll {
  display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.18); color: var(--text); transition: border-color .4s var(--ease), color .4s var(--ease);
}
.xh-scroll:hover { border-color: var(--gold); color: var(--gold); }
.xh-scroll svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; animation: xhBob 2s var(--ease) infinite; }
@keyframes xhBob { 0%, 100% { transform: translateY(-3px); } 50% { transform: translateY(4px); } }

/* Botões magnéticos */
.xh-ctas .btn { will-change: transform; }

/* Estado antes da animação de entrada */
.js .xhero [data-xh], .js .xh-c { visibility: hidden; }

/* ---------- Telas médias ---------- */
@media (max-width: 1100px) {
  .xh-bottom { grid-template-columns: 1fr auto; }
  .xh-lead { grid-column: 1 / -1; max-width: 520px; }
  .xh-ctas { justify-self: start; }
  .xh-stat { display: none; }
  .xh-side { display: none; }
}

/* ---------- Celular ---------- */
@media (max-width: 720px) {
  .xhero { grid-template-rows: auto auto; padding: calc(var(--header-h) + 28px) 0 32px; gap: 30px; }
  .xh-stage { padding: 20px 0; }
  .xhero { --camh: min(85vw, 400px); }
  .xh-hud--tl, .xh-hud--tr { top: 30px; }
  .xh-hud--br { bottom: 30px; }
  .xh-title { font-size: clamp(40px, 13.2vw, 76px); letter-spacing: -.05em; }
  .xh-row--1 { transform: none; }
  .xh-row--2 { transform: none; }
  .xh-hud { font-size: 9px; letter-spacing: .1em; }
  .xh-hud--bl { display: none; }
  .xh-bottom { grid-template-columns: 1fr; text-align: center; justify-items: center; gap: 22px; }
  .xh-lead { font-size: 15px; }
  .xh-ctas { flex-direction: column; width: 100%; justify-self: stretch; }
  .xh-ctas .btn { width: 100%; justify-content: center; }
  .xh-meta { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .xh-grain, .xh-scan, .xh-rec, .xh-scroll svg { animation: none; }
}
