/*
 * Abertura animada da home (src/components/IntroCopo.astro).
 * Só tem efeito quando o <html> recebe a classe "intro-on".
 * Linha do tempo (s): logo/copo 0–0.5 · limão 0.35 · açúcar 0.85 · cachaça 1.25–2.2
 * · transborda 2.2–2.75 · escoa 2.85–3.45.
 */

#intro {
  display: none;
}

html.intro-on,
html.intro-on body {
  overflow: hidden;
}

html.intro-on #intro {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 100000;
  transition: opacity 0.3s ease;
}

.intro-fadeout {
  opacity: 0;
}

.intro-skip {
  position: absolute;
  right: 20px;
  bottom: 20px;
  z-index: 1;
  padding: 6px 16px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font: 500 13px 'Poppins', sans-serif;
  cursor: pointer;
}

.intro-skip:hover,
.intro-skip:focus-visible {
  background: rgba(0, 0, 0, 0.6);
}

/* ---------- palco escuro com o copo ---------- */

.intro-stage {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  background: radial-gradient(ellipse at 50% 45%, #2a2a2a 0%, #121212 70%);
  animation: intro-hide 0.01s 2.75s forwards;
}

.intro-logo {
  width: 180px;
  height: auto;
  opacity: 0;
  animation: intro-fade-in 0.5s 0s ease-out forwards, intro-glow 1.6s 0.5s ease-in-out infinite alternate;
}

.intro-glass {
  width: min(200px, 46vw);
  height: auto;
  overflow: visible;
}

.intro-cup {
  opacity: 0;
  animation: intro-fade-in 0.4s 0.1s ease-out forwards;
}

.intro-lime {
  transform-origin: 0 0;
  transform: translate(100px, -260px);
  animation:
    intro-lime-drop 0.6s 0.35s cubic-bezier(0.5, 0, 0.75, 0) forwards,
    intro-lime-float 0.9s 1.4s ease-out forwards;
}

.intro-sugar {
  fill: #fff;
  opacity: 0;
  transform: translate(var(--x), -90px);
  animation: intro-sugar-fall 0.45s calc(0.85s + var(--d)) ease-in forwards;
}

.intro-stream {
  fill: #e8f19a;
  transform: translateY(-1640px);
  animation: intro-pour 0.95s 1.25s linear forwards;
}

.intro-liquid {
  transform: translateY(250px);
  animation: intro-fill 0.9s 1.35s cubic-bezier(0.25, 0.6, 0.35, 1) forwards;
}

.intro-wave {
  fill: url(#intro-liquid-grad);
  opacity: 0.92;
  animation: intro-slosh 0.7s linear infinite;
}

.intro-bubble {
  fill: rgba(255, 255, 255, 0.7);
  opacity: 0;
  animation: intro-bubble 0.8s var(--d) ease-out forwards;
}

/* ---------- a chimboca transbordando pela tela ---------- */

.intro-flood {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #e9f39f 0%, #cfe070 100%);
  transform: translateY(calc(100% + 40px));
  animation:
    intro-rise 0.55s 2.2s cubic-bezier(0.4, 0, 0.2, 1) both,
    intro-drain 0.6s 2.85s cubic-bezier(0.55, 0, 0.8, 0.4) forwards;
}

.intro-flood-wave {
  position: absolute;
  left: 0;
  top: -39px;
  width: 200%;
  height: 40px;
  fill: #e9f39f;
  animation: intro-wave-run 0.8s linear infinite;
}

/* ---------- banner entrando depois da abertura ---------- */

html.intro-on .banner-content > * {
  opacity: 0;
}

html.intro-done .banner-content > * {
  animation: intro-hero 0.8s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

html.intro-done .banner-content > :nth-child(2) { animation-delay: 0.12s; }
html.intro-done .banner-content > :nth-child(3) { animation-delay: 0.24s; }
html.intro-done .banner-content > :nth-child(4) { animation-delay: 0.36s; }

/* ---------- keyframes ---------- */

@keyframes intro-fade-in {
  to { opacity: 1; }
}

@keyframes intro-hide {
  to { visibility: hidden; opacity: 0; }
}

@keyframes intro-glow {
  from { filter: drop-shadow(0 0 0 rgba(244, 172, 42, 0)); }
  to { filter: drop-shadow(0 0 14px rgba(244, 172, 42, 0.75)); }
}

@keyframes intro-lime-drop {
  0% { transform: translate(100px, -260px) rotate(0deg); }
  100% { transform: translate(100px, 214px) rotate(220deg); }
}

@keyframes intro-lime-float {
  0% { transform: translate(100px, 214px) rotate(220deg); }
  100% { transform: translate(92px, 120px) rotate(250deg); }
}

@keyframes intro-sugar-fall {
  0% { opacity: 1; transform: translate(var(--x), -90px); }
  90% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--x), 232px); }
}

@keyframes intro-pour {
  0% { transform: translateY(-1640px); }
  25% { transform: translateY(0); }
  80% { transform: translateY(0); }
  100% { transform: translateY(1640px); }
}

@keyframes intro-fill {
  to { transform: translateY(32px); }
}

@keyframes intro-slosh {
  from { transform: translateX(0); }
  to { transform: translateX(-100px); }
}

@keyframes intro-bubble {
  0% { opacity: 0; transform: translateY(0); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-120px); }
}

@keyframes intro-rise {
  from { transform: translateY(calc(100% + 40px)); }
  to { transform: translateY(0); }
}

@keyframes intro-drain {
  from { transform: translateY(0); }
  to { transform: translateY(calc(100% + 40px)); }
}

@keyframes intro-wave-run {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@keyframes intro-hero {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}
