/* ==========================================================================
   De Pilsgrims — intro "Inschenken"
   Puur CSS, ±2,8 s, eindigt vanzelf (ook zonder JS). JS is alleen nodig voor
   klik-om-over-te-slaan en "één keer per sessie".
   Tijdlijn
     0,10 s  bier wordt ingeschonken (stijgt tot 46%), schuimkraag golft mee
     0,50 s  embleem ploft in (veer, eindigt op -4°, zoals in de hero)
     0,95 s  "Even inschenken…" verschijnt
     2,00 s  embleem tilt weg, bier zakt weg
     2,35 s  overlay vervaagt → site zichtbaar
   ========================================================================== */

.pg-intro {
  --intro-bg: var(--bg, #F4E8D0);
  --intro-foam: var(--c-schuim, #FFF9EE);
  --intro-ease: var(--ease, cubic-bezier(.2, .8, .2, 1));
  position: fixed; inset: 0; z-index: 1000;
  display: grid; place-items: center;
  background: var(--intro-bg);
  overflow: hidden; cursor: pointer;
  animation: pg-intro-out .45s ease 2.35s forwards;
}
.pg-intro--contained { position: absolute; }

/* het bier */
.pg-intro__beer {
  position: absolute; left: 0; right: 0; bottom: 0; height: 0;
  background: linear-gradient(180deg, #F2C063 0%, #E5A43A 55%, #C98522 100%);
  animation:
    pg-intro-pour 1.1s cubic-bezier(.3, .7, .2, 1) .1s both,
    pg-intro-drain .55s cubic-bezier(.5, 0, .9, .4) 2s forwards;
}
/* schuimkraag: twee rijen bolletjes die tegen elkaar in golven */
.pg-intro__beer::before,
.pg-intro__beer::after {
  content: ""; position: absolute; left: -40px; right: -40px; height: 34px; top: -22px;
  background:
    radial-gradient(circle at 14px 20px, var(--intro-foam) 14px, transparent 14.5px) 0 0 / 28px 34px repeat-x;
  animation: pg-intro-foam 1.6s linear infinite;
}
.pg-intro__beer::after {
  top: -12px; opacity: .85;
  background:
    radial-gradient(circle at 10px 16px, var(--intro-foam) 10px, transparent 10.5px) 9px 0 / 22px 26px repeat-x;
  animation-duration: 2.2s; animation-direction: reverse;
}
/* belletjes in het bier */
.pg-intro__beer span {
  position: absolute; bottom: -10px; width: 7px; height: 7px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .95), rgba(255, 246, 225, .3) 55%, transparent 70%);
  border: 1px solid rgba(255, 255, 255, .6);
  animation: pg-intro-bubble 1.4s linear infinite; opacity: 0;
}
.pg-intro__beer span:nth-child(1) { left: 12%; animation-delay: .3s; }
.pg-intro__beer span:nth-child(2) { left: 27%; animation-delay: .7s; width: 5px; height: 5px; }
.pg-intro__beer span:nth-child(3) { left: 44%; animation-delay: .45s; width: 9px; height: 9px; }
.pg-intro__beer span:nth-child(4) { left: 61%; animation-delay: .9s; }
.pg-intro__beer span:nth-child(5) { left: 76%; animation-delay: .55s; width: 5px; height: 5px; }
.pg-intro__beer span:nth-child(6) { left: 90%; animation-delay: 1s; width: 8px; height: 8px; }

/* embleem + regel */
.pg-intro__mark {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 22px;
  animation: pg-intro-lift .5s var(--intro-ease) 2s forwards;
}
.pg-intro__logo {
  width: min(52vw, 260px); height: auto; display: block;
  filter: drop-shadow(0 24px 34px rgba(110, 62, 8, .38));
  opacity: 0; transform: scale(.6) rotate(-16deg);
  animation: pg-intro-logo .9s cubic-bezier(.34, 1.56, .64, 1) .5s forwards;
}
.pg-intro__line {
  margin: 0; font: 800 12px/1 var(--font-body, "Mulish", sans-serif);
  letter-spacing: .18em; text-transform: uppercase; color: var(--c-espresso, #2A1C12);
  opacity: 0; transform: translateY(6px);
  animation: pg-intro-line .5s var(--intro-ease) .95s forwards;
}

@keyframes pg-intro-pour {
  0%   { height: 0; }
  70%  { height: 49%; }
  100% { height: 46%; }
}
@keyframes pg-intro-drain {
  from { height: 46%; }
  to   { height: 0; }
}
@keyframes pg-intro-foam {
  from { transform: translateX(0); }
  to   { transform: translateX(28px); }
}
@keyframes pg-intro-bubble {
  0%   { transform: translateY(0); opacity: 0; }
  15%  { opacity: .9; }
  100% { transform: translateY(-38vh); opacity: 0; }
}
@keyframes pg-intro-logo {
  0%   { opacity: 0; transform: scale(.6) rotate(-16deg); }
  60%  { opacity: 1; }
  100% { opacity: 1; transform: scale(1) rotate(-4deg); }
}
@keyframes pg-intro-line {
  to { opacity: 1; transform: none; }
}
@keyframes pg-intro-lift {
  to { opacity: 0; transform: translateY(-28px) scale(.96); }
}
@keyframes pg-intro-out {
  to { opacity: 0; visibility: hidden; pointer-events: none; }
}

/* overslaan (JS zet .is-skipping) */
.pg-intro.is-skipping { animation: pg-intro-out .25s ease forwards; }

/* één keer per sessie: <html class="pg-intro-seen"> verbergt hem vóór de eerste paint */
.pg-intro-seen .pg-intro { display: none; }

/* rustige variant: geen inschenken, embleem staat er, korte fade */
@media (prefers-reduced-motion: reduce) {
  .pg-intro { animation: pg-intro-out .3s ease .7s forwards; }
  .pg-intro__beer { height: 46%; animation: none; }
  .pg-intro__beer::before, .pg-intro__beer::after, .pg-intro__beer span { animation: none; }
  .pg-intro__beer span { display: none; }
  .pg-intro__mark, .pg-intro__logo, .pg-intro__line { animation: none; opacity: 1; transform: none; }
  .pg-intro__logo { transform: rotate(-4deg); }
}
