/* Alternativa 02: estrela controlada pela rolagem real da página */
.hero-track { position: relative; }
.hero-track > .hero { position: sticky; top: 0; }
.gate { position: fixed; inset: 0; z-index: 90; pointer-events: none; overflow: hidden; }
.gate__black {
  position: absolute; left: 50%; top: 50%; width: 300vmax; height: 300vmax; background: var(--black);
  transform: translate(-50%, -50%) rotate(var(--r, 0deg));
  -webkit-mask: linear-gradient(#000 0 0), url(assets/intro/star.svg) center / var(--m, 0px) no-repeat;
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) exclude, url(assets/intro/star.svg) center / var(--m, 0px) no-repeat;
}
.gate__star { position: absolute; left: 50%; top: 50%; width: 144px; height: 144px; margin: -72px 0 0 -72px; }
.gate__star img { width: 100%; height: 100%; transform: scale(var(--s, 1)) rotate(var(--r, 0deg)); opacity: var(--o, 1); }
.gate__intro { width: 100%; height: 100%; animation: g-in 1.6s var(--ease-out) .2s both; }
.gate__hint {
  position: absolute; left: 0; right: 0; bottom: calc(40px + env(safe-area-inset-bottom)); text-align: center;
  font: 500 14px/1 var(--sans); letter-spacing: var(--track-label); text-transform: uppercase; color: var(--text-muted);
  opacity: calc(1 - var(--p, 0) * 6); animation: g-hint .8s ease 1.6s both;
  margin: 0 auto; width: max-content; padding: 15px 16px; pointer-events: none;
}
/* Tocar em "Role para entrar" também entra no site; só enquanto a frase está na tela (some com a rolagem) */
.gate-on .gate__hint { pointer-events: auto; cursor: pointer; }
.gate__skip {
  position: fixed; z-index: 91; right: calc(16px + env(safe-area-inset-right)); top: calc(16px + env(safe-area-inset-top));
  min-height: 44px; padding: 0 16px; background: none; border: 1px solid var(--border); border-radius: var(--radius-pill); color: var(--text-soft);
  font: 500 14px/1 var(--sans); letter-spacing: var(--track-label); text-transform: uppercase; cursor: pointer;
  transition: border-color .2s ease, color .2s ease, opacity .3s ease, visibility 0s linear .3s;
}
.gate__skip:hover { border-color: var(--text); color: var(--text); }
/* Enquanto a abertura cobre a tela, o Hero já está desenhado por trás e acende junto com a abertura da estrela
   (--hero-o vem da rolagem, sem atraso). Teclado e leitor de tela ficam fora pelo atributo inert, aplicado no JS */
.gate-run .header, .gate-run .hero__content, .gate-run .hero__foot { opacity: var(--hero-o, 0); }
.gate-run .hero__content, .gate-run .hero__foot { transition: none; }
.gate-run .header { transition: background-color .25s var(--ease), border-color .25s var(--ease); }
.gate-on .gate__skip { transition-delay: 0s; }
html:not(.gate-on) .gate__skip { opacity: 0; visibility: hidden; }
.gate-done .gate { opacity: 0; visibility: hidden; }
.gate.is-leaving { opacity: 0; transition: opacity .3s var(--ease-out); }
.gate.is-leaving .gate__hint { pointer-events: none; }

/* Celular: a única frase da abertura é "Role para entrar". "Pular introdução" continua para teclado e leitor de tela
   (aparece ao receber foco), e a estrela e a frase chegam mais cedo */
@media (max-width: 767px) {
  .gate__skip:not(:focus-visible) { opacity: 0; pointer-events: none; }
  .gate__intro { animation-duration: 1s; animation-delay: .1s; }
  .gate__hint { animation-delay: .9s; bottom: calc(24px + env(safe-area-inset-bottom)); }
}

@keyframes g-in {
  0% { opacity: 0; transform: scale(.2) rotate(-360deg); }
  70% { opacity: 1; transform: scale(1) rotate(0deg); }
  85% { transform: scale(1.1); }
  100% { opacity: 1; transform: none; }
}
@keyframes g-hint { from { opacity: 0; } }
