/* ==========================================================================
   SPOUZY BRAND MOTION (used by js/spouzy-intro.js)
   1. Loading intro: large hugging teddies with the SPOUZY logo, then the teddies fly into the navbar
   2. Navbar: the hugging teddies and the SPOUZY logo push each other in and out every 3 seconds
   Linked in the <head> of every page, before js/spouzy-intro.js.
   ========================================================================== */
.sp-brand-wrapper { outline: none; }
.sp-brand-wrapper:focus-visible {
  outline: 2px solid var(--sp-wine, #6b2d41);
  outline-offset: 4px;
  border-radius: 8px;
}

.sp-brand-swap {
  --sp-swap-gap: 8px; /* space between the two pictures so neither peeks in */
  position: relative;
  display: block;
  overflow: hidden;
  flex-shrink: 0;
}
.sp-brand-track {
  position: relative;
  display: block;
  transform: translateY(0);
  transition: transform 0.8s cubic-bezier(0.34, 1.32, 0.5, 1);
  will-change: transform;
}
/* Teddies sit just above the logo: moving the track down lets them push the logo out at the bottom */
.sp-brand-swap.is-teddy .sp-brand-track { transform: translateY(calc(100% + var(--sp-swap-gap))); }
.sp-brand-swap.no-anim .sp-brand-track { transition: none; }
.sp-brand-slot { display: flex; align-items: center; justify-content: center; }
.sp-brand-slot-teddy {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + var(--sp-swap-gap));
  height: 100%;
}
.sp-brand-teddy {
  display: block;
  height: 90%;
  width: auto;
  aspect-ratio: 496 / 540;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}
.sp-brand-swap.is-teddy .sp-brand-teddy { animation: sp-brand-hug 1.5s ease-in-out 0.9s infinite; }
@keyframes sp-brand-hug {
  0%, 100% { transform: scale(1); }
  45% { transform: scale(1.06); }
}

/* ---- First-visit intro ---- */
.sp-intro {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sp-font-sans, 'Plus Jakarta Sans', sans-serif);
  color: #4A2330;
  cursor: default;
  -webkit-tap-highlight-color: transparent;
}
.sp-intro.is-leaving { pointer-events: none; }
.sp-intro-bg {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  overflow: hidden;
  background: radial-gradient(120% 90% at 50% 38%, #FFFDF4 0%, #FFF4DA 55%, #F9E3CC 100%);
  transition: opacity 0.55s ease;
}
.sp-intro-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px 16px;
  text-align: center;
}
.sp-intro-teddy-wrap {
  position: relative;
  width: min(92vw, 560px, 62vh);
  aspect-ratio: 4 / 3;
}
.sp-intro-glow {
  position: absolute;
  left: 12%; right: 12%; top: 14%; bottom: -4%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 196, 168, 0.75), rgba(255, 220, 190, 0.35) 55%, rgba(255, 230, 200, 0));
  opacity: 0;
  transform: scale(0.75);
  transition: opacity 0.6s ease, transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sp-intro.is-playing .sp-intro-glow { opacity: 1; transform: scale(1); }
.sp-intro.is-hugged .sp-intro-glow { animation: sp-intro-glow 0.7s ease-out; }
@keyframes sp-intro-glow {
  0% { transform: scale(1); }
  45% { transform: scale(1.12); }
  100% { transform: scale(1); }
}
.sp-intro-teddy {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  transition: opacity 0.35s ease, transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sp-intro.is-playing .sp-intro-teddy { opacity: 1; transform: none; }
.sp-intro-teddy.is-video .sp-intro-video {
  position: absolute;
  top: 0;
  left: -16.6667%;
  width: 133.3333%;
  height: 100%;
  object-fit: fill;
}
.sp-intro-teddy.is-still { display: flex; align-items: center; justify-content: center; overflow: visible; }
.sp-intro-still { display: block; height: 92%; width: auto; }
.sp-intro.is-playing .sp-intro-teddy.is-still .sp-intro-still { animation: sp-intro-still-in 1.1s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes sp-intro-still-in {
  0% { transform: scale(0.82) rotate(-3deg); }
  55% { transform: scale(1.04) rotate(1.5deg); }
  100% { transform: scale(1) rotate(0); }
}
.sp-intro.is-hugged .sp-intro-teddy.is-still .sp-intro-still { animation: sp-brand-hug 0.6s ease-in-out; }
/* Hand-over: the hugging teddies fly into the navbar logo spot */
.sp-intro.is-flying .sp-intro-teddy {
  overflow: visible;
  transition: transform 0.8s cubic-bezier(0.65, 0, 0.25, 1);
}
.sp-intro.is-fading .sp-intro-teddy { opacity: 0; transform: scale(1.04); transition: opacity 0.45s ease, transform 0.6s ease; }

.sp-intro-burst { position: absolute; left: 50%; top: 18%; width: 0; height: 0; }
.sp-intro-pop {
  position: absolute;
  left: -11px;
  top: -11px;
  width: 22px;
  height: 22px;
  fill: #E8506B;
  opacity: 0;
}
.sp-intro.is-hugged .sp-intro-pop { animation: sp-intro-pop 1s cubic-bezier(0.2, 0.8, 0.3, 1) forwards; }
.sp-intro-pop-1 { --x: -96px; --y: -34px; --r: -18deg; }
.sp-intro-pop-2 { --x: -54px; --y: -86px; --r: -8deg; width: 16px; height: 16px; animation-delay: 0.06s !important; }
.sp-intro-pop-3 { --x: 0px; --y: -104px; --r: 0deg; width: 26px; height: 26px; animation-delay: 0.02s !important; }
.sp-intro-pop-4 { --x: 58px; --y: -82px; --r: 10deg; width: 16px; height: 16px; animation-delay: 0.08s !important; }
.sp-intro-pop-5 { --x: 98px; --y: -30px; --r: 16deg; animation-delay: 0.04s !important; }
.sp-intro-pop-6 { --x: 30px; --y: -58px; --r: 6deg; width: 12px; height: 12px; fill: #F58FA0; animation-delay: 0.12s !important; }
@keyframes sp-intro-pop {
  0% { opacity: 0; transform: translate(0, 0) scale(0.3); }
  25% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--x), var(--y)) scale(1.1) rotate(var(--r)); }
}

.sp-intro-float {
  position: absolute;
  bottom: -40px;
  width: 16px;
  height: 16px;
  fill: rgba(232, 80, 107, 0.16);
  animation: sp-intro-float 7s linear infinite;
}
.sp-intro-float-1 { left: 6%; width: 14px; height: 14px; animation-delay: -1s; }
.sp-intro-float-2 { left: 15%; width: 22px; height: 22px; animation-delay: -4.5s; animation-duration: 8s; }
.sp-intro-float-3 { left: 26%; animation-delay: -2.5s; }
.sp-intro-float-4 { left: 37%; width: 12px; height: 12px; animation-delay: -6s; animation-duration: 6s; }
.sp-intro-float-5 { left: 48%; width: 18px; height: 18px; animation-delay: -3.2s; animation-duration: 9s; }
.sp-intro-float-6 { left: 59%; width: 13px; height: 13px; animation-delay: -0.6s; }
.sp-intro-float-7 { left: 69%; width: 24px; height: 24px; animation-delay: -5.4s; animation-duration: 8.5s; }
.sp-intro-float-8 { left: 79%; animation-delay: -2s; animation-duration: 6.5s; }
.sp-intro-float-9 { left: 88%; width: 20px; height: 20px; animation-delay: -4s; }
.sp-intro-float-10 { left: 95%; width: 12px; height: 12px; animation-delay: -6.6s; animation-duration: 7.5s; }
@keyframes sp-intro-float {
  0% { transform: translateY(0) rotate(-10deg); opacity: 0; }
  12% { opacity: 1; }
  100% { transform: translateY(-110vh) rotate(14deg); opacity: 0; }
}

.sp-intro-logo {
  display: block;
  width: min(60vw, 280px);
  height: auto;
  margin-top: -6px;
  opacity: 0;
  transform: translateY(14px);
  filter: drop-shadow(0 6px 14px rgba(120, 60, 40, 0.16));
  transition: opacity 0.6s ease 0.15s, transform 0.75s cubic-bezier(0.2, 0.8, 0.2, 1) 0.15s;
}
.sp-intro-tagline {
  margin: 0;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #8A5A4A;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.6s ease 0.35s, transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) 0.35s;
}
.sp-intro-tagline span { color: #C77C5E; padding: 0 4px; }
.sp-intro-bar {
  width: 150px;
  height: 3px;
  margin-top: 6px;
  border-radius: 3px;
  overflow: hidden;
  background: rgba(138, 74, 58, 0.14);
  opacity: 0;
  transition: opacity 0.4s ease 0.3s;
}
.sp-intro-bar span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  transform: scaleX(0);
  transform-origin: left center;
  background: linear-gradient(90deg, #B5654A, #E8A17F, #C77C5E);
  transition: transform 1.6s cubic-bezier(0.4, 0, 0.2, 1) 0.2s;
}
.sp-intro.is-in .sp-intro-logo,
.sp-intro.is-in .sp-intro-tagline { opacity: 1; transform: none; }
.sp-intro.is-in .sp-intro-bar { opacity: 1; }
.sp-intro.is-in .sp-intro-bar span { transform: scaleX(0.86); }
.sp-intro.is-hugged .sp-intro-bar span { transform: scaleX(1); transition-duration: 0.35s; transition-delay: 0s; }
.sp-intro-skip {
  position: absolute;
  right: 18px;
  bottom: 18px;
  padding: 7px 16px;
  border: 1px solid rgba(138, 74, 58, 0.25);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.65);
  color: #6B3A2E;
  font: 600 12.5px/1.2 var(--sp-font-sans, 'Plus Jakarta Sans', sans-serif);
  letter-spacing: 0.04em;
  opacity: 0;
  transition: opacity 0.4s ease 0.9s, background 0.2s ease;
}
.sp-intro-skip:hover { background: #fff; }
.sp-intro-skip:focus-visible { outline: 2px solid #B5654A; outline-offset: 2px; }
.sp-intro.is-in .sp-intro-skip { opacity: 1; }
.sp-intro.is-leaving .sp-intro-bg,
.sp-intro.is-leaving .sp-intro-glow,
.sp-intro.is-leaving .sp-intro-burst,
.sp-intro.is-leaving .sp-intro-skip,
.sp-intro.is-leaving .sp-intro-bar { opacity: 0; transition: opacity 0.5s ease; }
.sp-intro.is-leaving .sp-intro-logo,
.sp-intro.is-leaving .sp-intro-tagline { opacity: 0; transform: translateY(-10px); transition: opacity 0.4s ease, transform 0.5s ease; }

@media (max-width: 560px) {
  .sp-intro-stage { gap: 10px; }
  .sp-intro-tagline { font-size: 10px; letter-spacing: 0.12em; max-width: 300px; line-height: 1.6; }
  .sp-intro-skip { right: 12px; bottom: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .sp-brand-track { transition: none; }
  .sp-brand-teddy { animation: none !important; }
}
