/* =====================================================================
   ABERTURA DO PORTAL — o avião cruza a logo, corta ao meio e abre o site
   Linha do tempo (2,6 s):
     0,0–0,6  céu do anoitecer + logo surge com brilho
     0,55–1,45 avião atravessa a tela com o rastro dourado (passa no centro em ~1,0)
     0,85–1,5 corte dourado brilha na logo
     1,15–2,3 logo e céu se abrem na diagonal do voo e revelam o site
   A diagonal do voo tem 8°; as metades da logo usam o mesmo ângulo (±7% = tan 8°/2)
   ===================================================================== */
#abertura { display: none; }
html.com-abertura { overflow: hidden; }
html.com-abertura #abertura {
  --s: min(62vmin, 380px);           /* tamanho da logo */
  --ang: -8deg;                       /* inclinação do voo */
  display: block; position: fixed; inset: 0; z-index: 99999; overflow: hidden; cursor: pointer;
  transition: opacity .25s ease;
}
#abertura.ab-pulando { opacity: 0; }

/* ---------- Céu (duas metades que se abrem) ---------- */
.ab-ceu { position: absolute; left: -60vw; width: 220vw; height: 160vh; will-change: transform; }
.ab-ceu.ab-sup {
  bottom: 50%; transform-origin: 50% 100%; transform: rotate(var(--ang));
  background: radial-gradient(ellipse 34% 26% at 50% 100%, rgba(236, 181, 91, .45), transparent 70%),
              linear-gradient(180deg, #050a18 0%, #0a1936 50%, #2b2b58 78%, #5a3f63 92%, #8a5250 100%);
  box-shadow: inset 0 -2px 0 rgba(236, 181, 91, .0);
  animation: ab-abrir-sup 1.15s cubic-bezier(.7, 0, .2, 1) 1.15s forwards;
}
.ab-ceu.ab-inf {
  top: 50%; transform-origin: 50% 0; transform: rotate(var(--ang));
  background: radial-gradient(ellipse 34% 26% at 50% 0%, rgba(236, 181, 91, .45), transparent 70%),
              linear-gradient(180deg, #8a5250 0%, #5a3a4a 10%, #2a2340 28%, #0c1430 55%, #050a18 100%);
  animation: ab-abrir-inf 1.15s cubic-bezier(.7, 0, .2, 1) 1.15s forwards;
}
/* fio de luz dourado nas bordas do corte */
.ab-ceu.ab-sup::after, .ab-ceu.ab-inf::after { content: ""; position: absolute; left: 0; right: 0; height: 2px; background: #ffd98a; box-shadow: 0 0 18px 4px rgba(236, 181, 91, .8); opacity: 0; animation: ab-fio .9s ease 1.1s forwards; }
.ab-ceu.ab-sup::after { bottom: 0; }
.ab-ceu.ab-inf::after { top: 0; }
@keyframes ab-abrir-sup { to { transform: rotate(var(--ang)) translateY(-105%); } }
@keyframes ab-abrir-inf { to { transform: rotate(var(--ang)) translateY(105%); } }
@keyframes ab-fio { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: .6; } }

/* estrelinhas no céu */
.ab-estrelas { position: absolute; inset: 0; pointer-events: none; opacity: 0; animation: ab-estrelas 1.3s ease .1s forwards;
  background-image: radial-gradient(1.5px 1.5px at 12% 18%, #fff8, transparent), radial-gradient(1px 1px at 28% 9%, #fff9, transparent), radial-gradient(1.5px 1.5px at 44% 22%, #fff6, transparent),
    radial-gradient(1px 1px at 63% 12%, #fffa, transparent), radial-gradient(1.5px 1.5px at 79% 26%, #fff7, transparent), radial-gradient(1px 1px at 90% 8%, #fff9, transparent),
    radial-gradient(1px 1px at 8% 34%, #fff6, transparent), radial-gradient(1px 1px at 86% 40%, #fff6, transparent); }
@keyframes ab-estrelas { 0% { opacity: 0; } 40% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- Logo (duas metades na diagonal do voo) ---------- */
.ab-logo { position: absolute; left: 50%; top: 50%; width: var(--s); height: var(--s); margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2); }
.ab-metade { position: absolute; inset: 0; will-change: transform; }
.ab-metade img { width: 100%; height: 100%; display: block; border-radius: 50%;
  -webkit-mask-image: radial-gradient(circle, #000 64%, transparent 71%); mask-image: radial-gradient(circle, #000 64%, transparent 71%);
  filter: drop-shadow(0 0 30px rgba(236, 181, 91, .35)); }
.ab-metade.ab-sup { clip-path: polygon(0 0, 100% 0, 100% 43%, 0 57%); animation: ab-surgir .6s cubic-bezier(.2, .8, .2, 1) both, ab-logo-sup 1.1s cubic-bezier(.7, 0, .2, 1) 1.15s forwards; }
.ab-metade.ab-inf { clip-path: polygon(0 57%, 100% 43%, 100% 100%, 0 100%); animation: ab-surgir .6s cubic-bezier(.2, .8, .2, 1) both, ab-logo-inf 1.1s cubic-bezier(.7, 0, .2, 1) 1.15s forwards; }
@keyframes ab-surgir { from { opacity: 0; transform: scale(.82); filter: brightness(1.6); } to { opacity: 1; transform: scale(1); filter: none; } }
@keyframes ab-logo-sup { 0% { transform: none; } 18% { transform: translate(-1.5%, -2%) rotate(-1deg); } 100% { transform: translate(-14vw, -70vh) rotate(-12deg); opacity: .9; } }
@keyframes ab-logo-inf { 0% { transform: none; } 18% { transform: translate(1.5%, 2%) rotate(1deg); } 100% { transform: translate(14vw, 70vh) rotate(12deg); opacity: .9; } }

.ab-frase { position: absolute; left: 0; right: 0; top: calc(50% + var(--s) / 2 + 14px); margin: 0; text-align: center; color: #ecb55b;
  font: 600 clamp(11px, 1.6vmin, 14px) "Montserrat", system-ui, sans-serif; letter-spacing: .32em; text-transform: uppercase;
  opacity: 0; animation: ab-frase 1.15s ease .25s forwards; }
@keyframes ab-frase { 0% { opacity: 0; transform: translateY(6px); } 30% { opacity: 1; transform: none; } 70% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- Voo: avião, rastro e corte (todos na mesma diagonal) ---------- */
.ab-voo { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform: rotate(var(--ang)); pointer-events: none; }
.ab-aviao { position: absolute; left: 0; top: 0; width: min(24vmin, 150px); height: auto; transform: translate(-50%, -50%) translateX(-80vw);
  filter: drop-shadow(0 0 10px rgba(255, 220, 160, .55)); animation: ab-aviao .9s cubic-bezier(.45, .05, .55, .95) .55s forwards; }
@keyframes ab-aviao { from { transform: translate(-50%, -50%) translateX(-80vw); } to { transform: translate(-50%, -50%) translateX(80vw); } }
/* rastro dourado: cresce atrás do avião (mesmo tempo e curva) e some */
.ab-rastro { position: absolute; left: -80vw; top: -1.5px; width: 160vw; height: 3px; transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, transparent 0%, rgba(236, 181, 91, .15) 30%, rgba(236, 181, 91, .9) 92%, #fff6df 100%);
  box-shadow: 0 0 14px rgba(236, 181, 91, .6); border-radius: 3px;
  animation: ab-rastro .9s cubic-bezier(.45, .05, .55, .95) .55s forwards, ab-sumir .5s ease 1.45s forwards; }
@keyframes ab-rastro { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes ab-sumir { to { opacity: 0; } }
/* o corte: um risco de luz atravessando a logo logo depois do avião */
.ab-corte { position: absolute; left: calc(var(--s) / -2); top: -2px; width: var(--s); height: 4px; border-radius: 4px; transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, rgba(255, 248, 223, 0), #fff8df 20%, #ffffff 50%, #fff8df 80%, rgba(255, 248, 223, 0));
  box-shadow: 0 0 22px 6px rgba(236, 181, 91, .85), 0 0 60px 14px rgba(236, 181, 91, .35);
  animation: ab-corte .35s cubic-bezier(.3, 0, .2, 1) .85s forwards, ab-sumir .45s ease 1.3s forwards; }
@keyframes ab-corte { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- Pular ---------- */
.ab-pular { position: absolute; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, .08); color: rgba(247, 239, 228, .8); border: 1px solid rgba(247, 239, 228, .25); border-radius: 999px;
  padding: 7px 16px; font: 600 12px "Inter", system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase; cursor: pointer;
  animation: ab-sumir .3s ease 1.3s forwards; }
.ab-pular:hover { color: #fff; border-color: #ecb55b; }

@media (prefers-reduced-motion: reduce) { #abertura { display: none !important; } html.com-abertura { overflow: auto; } }
