/* Now That's Personal! — "Keepsake Ribbon" signature motion.
   Sites animate regardless of OS reduced-motion settings — no
   prefers-reduced-motion opt-outs here on purpose. */

/* ---------------------------------------------------------------------
   Intro — bubblegum panel, logo plaque, smiling sun badge with twinkles,
   curtain lift. Covers the site from the very first frame (markup +
   critical CSS are inlined in <head>, this file only adds the keyframes
   once it loads — by which point nothing has painted yet).
--------------------------------------------------------------------- */
#sun-intro {
  position: fixed;
  top: 0; left: 0; right: 0; height: 100svh;
  z-index: 9999;
  background: linear-gradient(150deg, #8A4468, var(--hot-pink) 55%, var(--hot-pink-deep));
  display: flex;
  align-items: center;
  justify-content: center;
  animation: intro-curtain 0.7s cubic-bezier(.65,0,.35,1) 2.15s forwards;
}
#sun-intro.intro-done { display: none; }
#sun-intro .intro-frame {
  position: absolute;
  inset: 18px;
  border: 3px dashed rgba(250,244,233,.75);
  border-radius: 18px;
  opacity: 0;
  animation: intro-frame-draw 0.6s ease-out 0.15s forwards;
}
#sun-intro .intro-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  animation: intro-stage-in 0.5s ease-out 0.05s forwards;
}
#sun-intro .intro-plaque {
  position: relative;
  overflow: hidden;
  background: #fff;
  border-radius: 16px;
  padding: 16px 20px;
  box-shadow: 0 14px 40px rgba(0,0,0,.35), 0 0 44px rgba(231,198,107,.45);
  opacity: 0;
  animation: intro-logo-spin-in 1s cubic-bezier(.3,1.35,.4,1) 0.15s forwards;
}
#sun-intro .intro-plaque::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: linear-gradient(115deg, transparent 32%, rgba(255,255,255,.8) 50%, transparent 68%);
  transform: translateX(-130%);
  animation: intro-logo-shine 0.8s ease-in-out 1.1s forwards;
}
#sun-intro .intro-plaque img { display: block; width: min(320px, 72vw); height: auto; }
#sun-intro .intro-twinkle {
  position: absolute; color: #FFF3B0; opacity: 0; pointer-events: none;
  animation: intro-twinkle-pop 0.7s ease-out forwards;
}
#sun-intro .tw-1 { top: -16px; right: -14px; font-size: 24px; animation-delay: 1.25s; }
#sun-intro .tw-2 { bottom: -6px; left: -18px; font-size: 17px; animation-delay: 1.45s; }
#sun-intro .tw-3 { top: 34px; left: -26px; font-size: 13px; animation-delay: 1.65s; }
@keyframes intro-logo-spin-in {
  from { opacity: 0; transform: rotate(-6deg) scale(0.6); }
  to { opacity: 1; transform: rotate(0deg) scale(1); }
}
@keyframes intro-logo-shine {
  from { transform: translateX(-130%); }
  to { transform: translateX(130%); }
}
@keyframes intro-frame-draw { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: scale(1); } }
@keyframes intro-stage-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
  70% { opacity: 1; transform: rotate(12deg) scale(1.08); }
  100% { opacity: 1; transform: rotate(0deg) scale(1); }
}
@keyframes intro-twinkle-pop {
  0% { opacity: 0; transform: scale(0.3) rotate(0deg); }
  60% { opacity: 1; transform: scale(1.25) rotate(30deg); }
  100% { opacity: 1; transform: scale(1) rotate(45deg); }
}
@keyframes intro-curtain {
  to { transform: translateY(-100%); visibility: hidden; }
}

/* ---------------------------------------------------------------------
   Marquee ribbon
--------------------------------------------------------------------- */
.marquee-ribbon {
  overflow: hidden;
  background: var(--walnut-ink);
  color: var(--cream);
  border-top: 3px solid var(--rope-gold);
  border-bottom: 3px solid var(--rope-gold);
  white-space: nowrap;
}
.marquee-ribbon .marquee-track {
  display: inline-flex;
  animation: marquee-scroll 156s linear infinite;
}
.marquee-ribbon .marquee-seg {
  display: inline-block;
  padding: 10px 0;
  font-family: 'Fraunces', serif;
  font-size: 22px;
  letter-spacing: 0.02em;
  color: var(--turquoise);
}
.marquee-ribbon .marquee-seg span.dot { color: var(--blush); margin: 0 18px; }
@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------------------------------------------------------------------
   Hero photo float
--------------------------------------------------------------------- */
.hero-float { animation: hero-float 5.5s ease-in-out infinite; }
@keyframes hero-float {
  0%, 100% { transform: translateY(0) rotate(-0.4deg); }
  50% { transform: translateY(-10px) rotate(0.4deg); }
}

/* ---------------------------------------------------------------------
   Hero ribbon — a gold ribbon wraps the hero photo's frame while a
   little bow travels the line and settles at the corner (mask reveal
   synced to the bow by the ribbon-sync script: wraps 0-78% of the 11s
   circuit, rests complete, fades, restarts). A faint dotted guide
   shows the full frame the whole time.
--------------------------------------------------------------------- */
.hero-photo-frame { position: relative; display: inline-block; }
.ribbon-svg {
  position: absolute; inset: -16px; width: calc(100% + 32px); height: calc(100% + 32px);
  pointer-events: none; overflow: visible;
  /* opacity + mask reveal are driven by the ribbon-sync script (one clock) */
}
.ribbon-svg .frame-guide {
  fill: none; stroke: var(--rope-gold); stroke-width: 3; opacity: .25;
  stroke-linecap: round; stroke-dasharray: 0.5 1.2;
}
.ribbon-svg .frame-ribbon {
  fill: none; stroke: var(--rope-gold); stroke-width: 5; stroke-linecap: round;
  /* ribbon segments wrapping the frame like gift wrap */
  stroke-dasharray: 2.2 0.9;
}
.ribbon-svg .frame-mask-draw {
  stroke-dasharray: 100; stroke-dashoffset: 100;
  /* stroke-dashoffset is set by the ribbon-sync script, same clock as the bow */
}
.ribbon-svg .bow-pop { transform-box: fill-box; transform-origin: center; }


/* ---------------------------------------------------------------------
   Product card hover: lift + shadow + shine sweep
--------------------------------------------------------------------- */
.product-card { position: relative; transition: transform .25s ease, box-shadow .25s ease; overflow: hidden; }
.product-card:hover, .product-card:focus-within { transform: translateY(-6px); box-shadow: 0 18px 34px rgba(70,32,47,.28); }
.product-card .shine {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,.55) 50%, transparent 60%);
  background-size: 250% 250%;
  background-position: -120% -120%;
  transition: background-position .65s ease;
}
.product-card:hover .shine, .product-card:focus-within .shine { background-position: 120% 120%; }

/* ---------------------------------------------------------------------
   Ribbon divider — CSS, never an image recreation of the logo
--------------------------------------------------------------------- */
.rope-divider {
  height: 14px;
  background: repeating-linear-gradient(135deg, var(--sunny) 0 12px, var(--hot-pink) 12px 24px, var(--turquoise) 24px 36px);
  background-size: 50px 50px;
  opacity: 0.95;
}

/* ---------------------------------------------------------------------
   Cart bubble bounce + drawer slide
--------------------------------------------------------------------- */
@keyframes cart-bounce {
  0%, 100% { transform: scale(1); }
  30% { transform: scale(1.28); }
  55% { transform: scale(0.92); }
  75% { transform: scale(1.08); }
}
.cart-bump { animation: cart-bounce 0.5s ease; }

#cart-drawer {
  position: fixed;
  top: 0; right: 0; height: 100svh;
  width: min(420px, 100vw);
  background: var(--cream);
  box-shadow: -14px 0 40px rgba(70,32,47,.35);
  transform: translateX(100%);
  transition: transform .32s cubic-bezier(.3,.9,.3,1);
  z-index: 500;
  display: flex;
  flex-direction: column;
}
#cart-drawer.open { transform: translateX(0); }
#cart-backdrop {
  position: fixed; inset: 0; background: rgba(70,32,47,.45);
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
  z-index: 499;
}
#cart-backdrop.open { opacity: 1; pointer-events: auto; }

/* ---------------------------------------------------------------------
   Order success — keepsake mark spins once with sparkle puffs
--------------------------------------------------------------------- */
.success-star { width: 86px; height: 86px; animation: success-spin 0.9s cubic-bezier(.3,1.5,.4,1) both; }
@keyframes success-spin {
  0% { transform: rotate(0deg) scale(0.6); opacity: 0; }
  60% { transform: rotate(300deg) scale(1.1); opacity: 1; }
  100% { transform: rotate(360deg) scale(1); opacity: 1; }
}
.sparkle-puff {
  position: absolute; width: 6px; height: 6px; border-radius: 50%;
  background: var(--turquoise); opacity: 0;
  animation: sparkle-out 0.8s ease-out both;
}
@keyframes sparkle-out {
  0% { opacity: 0; transform: translate(0,0) scale(0.4); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: var(--puff-end, translate(40px,-40px)) scale(1.1); }
}

/* ---------------------------------------------------------------------
   Floating mobile cart bubble
--------------------------------------------------------------------- */
#cart-bubble-mobile {
  position: fixed;
  bottom: 18px; right: 18px;
  z-index: 480;
  width: 58px; height: 58px;
  border-radius: 50%;
  background: var(--turquoise);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 22px rgba(23,179,184,.5);
  border: none;
  cursor: pointer;
}
@media (max-width: 760px) { #cart-bubble-mobile { display: flex; } }
