html.splash-on { overflow: hidden; }
html.splash-pouring { overflow: hidden; }
html.splash-on body,
html.splash-on.splash-pouring body { background: #fbf6f0; }

.splash-drain {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 298;
  overflow: hidden;
  pointer-events: none;
}
html.splash-on .splash-drain,
html.splash-pouring .splash-drain { display: block; }
.splash-drain-wine {
  position: absolute;
  inset: 0;
  background: none;
  transform: translateY(0);
  will-change: transform;
}
.splash-drain-sheet {
  position: absolute;
  top: 0;
  left: 0;
  width: 200%;
  height: 100%;
  display: block;
}
html.splash-on .splash-drain-sheet,
html.splash-pouring .splash-drain-sheet {
  animation: splash-wave-roll 2.4s linear infinite;
}
html.splash-pouring .splash-drain-wine {
  animation: splash-pour-away 1.12s cubic-bezier(.38, .02, .22, 1) 0.4s forwards;
}

.splash {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
  background: transparent;
  color: #f3e6d2;
  cursor: default;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
html.splash-on .splash,
html.splash-pouring .splash { display: grid; }
.splash.is-welcome { cursor: pointer; }
.splash.is-welcome .splash-tag { letter-spacing: 0.18em; }
.splash-glow {
  position: absolute;
  width: min(520px, 88vw);
  height: min(520px, 88vw);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(196, 165, 116, 0.16) 0%, rgba(196, 165, 116, 0) 68%);
  pointer-events: none;
}
.splash-scene {
  position: relative;
  display: grid;
  justify-items: center;
  text-align: center;
  width: min(320px, 86vw);
}

.splash-mark {
  width: 72px;
  height: 64px;
  margin-bottom: 10px;
  overflow: visible;
}
.splash-mark path {
  stroke: #e8d5b0;
  stroke-width: 2.35;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}
.splash-mark path:nth-child(2) { stroke-width: 1.85; }
.splash-mark circle {
  fill: #e8d5b0;
  transform-origin: 32px 48px;
  transform: scale(0);
}

.splash-glass {
  width: min(168px, 46vw);
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.35));
}
.splash-bowl { opacity: 0.92; }
.splash-wine {
  transform: translateY(142px);
  transform-box: view-box;
  transform-origin: 0 0;
}
.splash-pour {
  opacity: 0;
  transform: scaleY(0);
  transform-box: fill-box;
  transform-origin: 50% 0;
}

.splash-name {
  margin: 22px 0 0;
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 600;
  font-size: clamp(1.55rem, 5.4vw, 2.05rem);
  letter-spacing: 0.04em;
  line-height: 1.15;
  color: #f7efe4;
  opacity: 0;
}
.splash-rule {
  display: block;
  height: 1px;
  width: 72px;
  margin-top: 14px;
  background: linear-gradient(90deg, transparent, #c4a574, transparent);
  transform: scaleX(0);
  transform-origin: center;
}
.splash-tag {
  margin: 12px 0 0;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #c4a574;
  opacity: 0;
}
.splash-wait {
  margin: 14px 0 0;
  min-height: 0;
  font-size: 0;
  color: transparent;
}

@media (prefers-reduced-motion: no-preference) {
  .splash.is-play .splash-glass {
    animation: splash-glass-in 0.7s cubic-bezier(.22, 1, .36, 1) both;
  }
  .splash.is-play .splash-pour {
    animation: splash-pour 1.55s cubic-bezier(.22, .61, .36, 1) 0.16s both;
  }
  .splash.is-play .splash-wine {
    animation: splash-fill 1.4s cubic-bezier(.4, .08, .22, 1) 0.2s forwards;
  }
  .splash.is-play .splash-wave-a {
    animation: splash-wave 1.35s ease-in-out 0.4s infinite alternate;
  }
  .splash.is-play .splash-wave-b {
    animation: splash-wave 1.7s ease-in-out 0.55s infinite alternate-reverse;
  }
  .splash.is-play .splash-mark path:nth-child(1) {
    animation: splash-draw 0.72s cubic-bezier(.4, 0, .2, 1) 1.42s forwards;
  }
  .splash.is-play .splash-mark path:nth-child(2) {
    animation: splash-draw 0.56s cubic-bezier(.4, 0, .2, 1) 1.62s forwards;
  }
  .splash.is-play .splash-mark circle {
    animation: splash-dot 0.34s cubic-bezier(.22, 1, .36, 1) 2.06s forwards;
  }
  .splash.is-play .splash-name {
    animation: splash-type 0.62s cubic-bezier(.22, 1, .36, 1) 2.08s both;
  }
  .splash.is-play .splash-rule {
    animation: splash-rule 0.48s cubic-bezier(.22, 1, .36, 1) 2.38s forwards;
  }
  .splash.is-play .splash-tag {
    animation: splash-fade 0.52s cubic-bezier(.22, 1, .36, 1) 2.52s both;
  }
  .splash.is-play .splash-wait {
    animation: splash-fade 0.7s cubic-bezier(.22, 1, .36, 1) both;
  }
  .splash.is-out {
    animation: splash-leave 0.48s cubic-bezier(.22, 1, .36, 1) forwards;
    pointer-events: none;
  }
}

.splash.is-static .splash-wine { transform: translateY(14px); }
.splash.is-static .splash-pour { opacity: 0; }
.splash.is-static .splash-mark path { stroke-dashoffset: 0; }
.splash.is-static .splash-mark circle { transform: scale(1); }
.splash.is-static .splash-name,
.splash.is-static .splash-tag { opacity: 1; }
.splash.is-static .splash-rule { transform: scaleX(1); }
.splash.is-static.is-out {
  animation: splash-leave 0.22s ease forwards;
  pointer-events: none;
}

@keyframes splash-glass-in {
  from { opacity: 0; transform: translateY(10px) scale(.97); }
  to { opacity: 1; transform: none; }
}
@keyframes splash-pour {
  0% { transform: scaleY(0); opacity: 0; }
  12% { opacity: 1; }
  18% { transform: scaleY(1); opacity: 1; }
  78% { transform: scaleY(1); opacity: .9; }
  100% { transform: scaleY(.2); opacity: 0; }
}
@keyframes splash-fill {
  to { transform: translateY(14px); }
}
@keyframes splash-wave {
  from { transform: translateX(-7px); }
  to { transform: translateX(7px); }
}
@keyframes splash-draw {
  to { stroke-dashoffset: 0; }
}
@keyframes splash-dot {
  from { transform: scale(0); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
@keyframes splash-type {
  from { opacity: 0; transform: translateY(10px); letter-spacing: 0.16em; }
  to { opacity: 1; transform: none; }
}
@keyframes splash-fade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@keyframes splash-rule {
  from { transform: scaleX(0); opacity: 0; }
  to { transform: scaleX(1); opacity: 1; }
}
@keyframes splash-leave {
  to {
    opacity: 0;
    filter: blur(8px);
    transform: translateY(-18px) scale(.98);
    visibility: hidden;
  }
}
@keyframes splash-pour-away {
  from { transform: translateY(0); }
  to { transform: translateY(100%); }
}
@keyframes splash-wave-roll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .splash-pour { opacity: 0; }
  .splash-wine { transform: translateY(14px); }
  html.splash-pouring .splash-drain-wine {
    animation: splash-pour-away 0.2s ease forwards;
  }
  html.splash-on .splash-drain-sheet,
  html.splash-pouring .splash-drain-sheet {
    animation: none;
  }
}

@media print {
  .splash { display: none !important; }
}

@media (max-height: 720px) {
  .splash-glass { width: min(140px, 40vw); }
  .splash-mark { width: 58px; height: 52px; margin-bottom: 6px; }
  .splash-name { margin-top: 16px; font-size: clamp(1.35rem, 4.8vw, 1.75rem); }
}

@media (max-height: 480px) {
  .splash-scene { transform: scale(.84); }
}
