/* ═══════════════════════════════════════════
   ANSELMOTION — hero-3d.css
   Hero com a logo-keyframe 3D guiada pela rolagem (js/hero-3d.js)
═══════════════════════════════════════════ */

.scrolly { position: relative; }          /* sem altura fixa: o pin do GSAP adiciona o espaço de rolagem e empurra as seções seguintes */
.stage {
  position: relative; height: 100vh; width: 100%;
  overflow: hidden;
  background: radial-gradient(60vmax 50vmax at 50% 50%, #130F22, var(--escuro) 75%) var(--escuro);
}
/* véu que dissolve o palco na cor de fundo da página durante a saída (opacidade animada no JS) */
.fade-out {
  position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: linear-gradient(to bottom, rgba(10,8,18,.0) 0%, var(--escuro) 45%);
  background-size: 100% 200%; background-position: 0 100%;
}
#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* a seção seguinte sobe por cima do fim do hero (que já dissolveu na cor de fundo): sem vazio entre eles */
.scrolly + section { position: relative; z-index: 3; margin-top: -45vh; }

/* ── Fundo: luz, grade de timeline, wordmark e grão ── */
.bg { position: absolute; inset: 0; pointer-events: none; }
.stage.gl-bg .bg { visibility: hidden; }   /* com WebGL o fundo é desenhado dentro da cena (para o vidro refratar) */
.bg-glow {
  background:
    radial-gradient(38vmax 30vmax at 50% 46%, rgba(82,43,158,.55), transparent 70%),
    radial-gradient(30vmax 18vmax at 50% 92%, rgba(245,196,0,.10), transparent 70%);
  animation: breathe 7s ease-in-out infinite alternate;
}
@keyframes breathe { from { opacity: .8; transform: scale(1); } to { opacity: 1; transform: scale(1.06); } }

.bg-grid {
  background-image:
    linear-gradient(to right, rgba(168,158,192,.10) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(168,158,192,.07) 1px, transparent 1px);
  background-size: 8vw 8vw;
  background-position: center center;
  -webkit-mask-image: radial-gradient(ellipse 70% 65% at 50% 50%, #000 20%, transparent 75%);
          mask-image: radial-gradient(ellipse 70% 65% at 50% 50%, #000 20%, transparent 75%);
}

/* a palavra tem ~8,4em de largura: 10vw cabe em ~90% da tela */
.bg-word {
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800;
  font-size: 10vw; letter-spacing: -.04em; line-height: 1; white-space: nowrap;
  color: transparent; -webkit-text-stroke: 1px rgba(240,238,245,.10);
}

.grain {
  position: absolute; inset: -50%; pointer-events: none; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0,0); } 20% { transform: translate(-4%,3%); } 40% { transform: translate(3%,-2%); }
  60% { transform: translate(-2%,-4%); } 80% { transform: translate(4%,2%); } 100% { transform: translate(0,0); }
}

/* ── Régua com timecode, como no After Effects ── */
.ruler {
  position: absolute; right: var(--px); bottom: 32px; width: 300px;
  font-family: 'DM Mono', ui-monospace, monospace; color: var(--cinza-texto);
}
.ruler-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
.ruler-tc {
  font-size: clamp(30px, 3vw, 44px); letter-spacing: .02em; color: var(--amarelo); line-height: 1.1; margin: 4px 0 10px;
  font-variant-numeric: tabular-nums; text-shadow: 0 0 24px rgba(245,196,0,.35);
}
.track {
  position: relative; height: 22px;
  background-image: repeating-linear-gradient(to right, rgba(168,158,192,.45) 0 1px, transparent 1px 10%),
                    repeating-linear-gradient(to right, rgba(168,158,192,.2) 0 1px, transparent 1px 2.5%);
  background-size: 100% 8px, 100% 4px; background-repeat: no-repeat; background-position: 0 0, 0 0;
  border-bottom: 1px solid rgba(168,158,192,.25);
}
.track .kf {
  position: absolute; top: 11px; width: 9px; height: 9px; margin-left: -4.5px;
  border: 1px solid var(--cinza-texto); background: var(--escuro); transform: rotate(45deg);
  transition: background .25s, border-color .25s;
}
.track .kf.on { background: var(--amarelo); border-color: var(--amarelo); }
.playhead { position: absolute; top: -6px; bottom: -4px; left: 0; width: 1px; background: var(--amarelo); }
.playhead::before {
  content: ''; position: absolute; top: 0; left: -5px;
  border-left: 5.5px solid transparent; border-right: 5.5px solid transparent; border-top: 7px solid var(--amarelo);
}

.signature {
  position: absolute; left: var(--px); bottom: 64px;
  font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--cinza-texto);
}
.signature strong { color: var(--branco); font-weight: 500; }

/* ── Informações de cada etapa ── */
.layer { position: absolute; inset: 0; pointer-events: none; }
.info {
  position: absolute; max-width: 420px;
  opacity: 0; will-change: transform, opacity;
}
.info .kicker {
  font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--amarelo); margin-bottom: 14px; display: flex; align-items: center; gap: 10px;
}
.info .kicker::before {           /* keyframe-losango como marcador */
  content: ''; width: 8px; height: 8px; background: var(--amarelo); transform: rotate(45deg);
}
.info h1, .info h2 {
  font-family: var(--font-display); font-weight: 800; line-height: .95;
  font-size: clamp(32px, 4.4vw, 64px); letter-spacing: -.02em; margin: 0;
}
.info p { color: var(--cinza-texto); font-size: 16px; line-height: 1.6; margin-top: 14px; font-weight: 300; }

.info-1 { top: 18vh; left: var(--px); max-width: 360px; }
.info-1 h2 { font-size: clamp(28px, 3.2vw, 48px); }
.info-2 { bottom: 170px; right: var(--px); text-align: right; }
.info-2 .stat-big { font-family: var(--font-display); font-weight: 800; font-size: clamp(56px, 7vw, 104px); line-height: .9; color: var(--amarelo); }
.info-2 .kicker { justify-content: flex-end; }
.info-3 {
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  max-width: 820px; width: max-content; text-align: center;
}
.info-3 h1 { font-size: clamp(40px, 6.4vw, 104px); }
.info-3 h1 em { font-style: normal; color: var(--amarelo); }
.info-3 .kicker { justify-content: center; }
.info-3 .hero-btns { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 2rem; pointer-events: auto; }

.scroll-hint {
  position: absolute; bottom: 32px; left: 50%; transform: translateX(-50%);
  font-size: 11px; letter-spacing: .25em; text-transform: uppercase; color: var(--cinza-texto);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.scroll-hint::after {
  content: ''; width: 1px; height: 40px;
  background: linear-gradient(var(--amarelo), transparent);
  animation: hint 1.8s ease-in-out infinite;
}
@keyframes hint { 0%,100% { transform: scaleY(.3); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } }

.loading {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  transition: opacity .6s;
}
.loading img { width: 120px; height: auto; opacity: .9; }   /* ícone estático: aparece enquanto carrega e como fallback sem WebGL */

@media (max-width: 900px) {
  .bg-grid { background-size: 18vw 18vw; }
  .ruler { right: var(--px-sm); left: var(--px-sm); width: auto; }
  .ruler-tc { font-size: 28px; }
  .signature, .scroll-hint { display: none; }
  .info-1 { top: 14vh; left: var(--px-sm); right: var(--px-sm); }
  .info-2 { bottom: 150px; right: var(--px-sm); left: var(--px-sm); }
  .info-3 { width: calc(100% - 2 * var(--px-sm)); }
}
@media (prefers-reduced-motion: reduce) { .bg-glow, .grain, .scroll-hint::after { animation: none; } }
