/*
  Stick'd — polish and animations.
  Everything in this file is decoration: the shop works the same without it.
  All motion switches off for people whose device asks for reduced motion
  (see the rule at the bottom of shop.css).
*/
:root { interpolate-size: allow-keywords; }

/* ================= Shared keyframes ================= */
@keyframes rise { from { opacity: 0; translate: 0 26px; } to { opacity: 1; translate: 0 0; } }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }
@keyframes twinkle { 0%, 100% { scale: 0.6; rotate: 0deg; opacity: 0.75; } 50% { scale: 1.15; rotate: 45deg; opacity: 1; } }
@keyframes spin { to { rotate: 360deg; } }
@keyframes pop-in-s { 0% { scale: 0.6; } 60% { scale: 1.12; } 100% { scale: 1; } }
.pop-in { animation: pop-in-s 0.38s cubic-bezier(.3,1.6,.5,1); }

/* ================= Hero ================= */
.hero { position: relative; }
.hero-inner { position: relative; z-index: 1; }

/* Logo gets "slapped on" like a sticker, then bobs */
.hero-logo { animation: slap 0.8s cubic-bezier(.2,1.5,.4,1) both, logo-bob 4s ease-in-out 1s infinite; }
@keyframes slap { 0% { scale: 2.4; opacity: 0; } 55% { opacity: 1; } 100% { scale: 1; opacity: 1; } }
.tag-sticker { animation: rise 0.5s ease 0.35s both; }
.hero-title span { animation: rise 0.55s cubic-bezier(.2,1.4,.4,1) both; }
.hero-title .ht-1 { animation-delay: 0.45s; }
.hero-title .ht-2 { animation-delay: 0.56s; }
.hero-title .ht-3 { animation: rise 0.55s cubic-bezier(.2,1.4,.4,1) 0.67s both, aura 3.2s ease-in-out 1.3s infinite; }
.hero-lead { animation: rise 0.5s ease 0.8s both; }
.hero-actions { animation: rise 0.5s ease 0.9s both; }

/* Doodles borrowed from the logo: crown, sparkles and purple "excite" marks */
.doodle { position: absolute; z-index: 0; pointer-events: none; }
.doodle svg { display: block; width: 100%; height: auto; }
.d-crown { width: 70px; top: 7%; left: 47%; rotate: -14deg; animation: bob 5s ease-in-out infinite; }
.d-spark-1 { width: 36px; top: 10%; right: 5%; animation: twinkle 2.4s ease-in-out infinite; }
.d-spark-2 { width: 24px; bottom: 14%; left: 46%; animation: twinkle 3s ease-in-out 0.8s infinite; }
.d-spark-3 { width: 30px; bottom: 9%; right: 4%; animation: twinkle 2.7s ease-in-out 1.4s infinite; }
.d-excite { width: 60px; top: 4%; left: 2%; rotate: -100deg; animation: bob 4s ease-in-out 0.5s infinite; }

/* Spinning gold starburst behind the sticker pile */
.sticker-pile { isolation: isolate; }
.sticker-pile::before {
  content: ""; position: absolute; z-index: -1; left: 50%; top: 50%;
  width: min(92%, 430px); aspect-ratio: 1; translate: -50% -50%;
  border-radius: 50%; border: var(--border); box-shadow: 8px 8px 0 var(--ink);
  background: repeating-conic-gradient(var(--gold) 0 10deg, #ffe27a 10deg 20deg);
  animation: spin 50s linear infinite;
}
.pile-sticker {
  animation: sticker-in 0.7s cubic-bezier(.2,1.5,.4,1) both, float 5s ease-in-out infinite;
  animation-delay: calc(0.5s + var(--i, 0) * 0.09s), calc(var(--d) * -1);
}
@keyframes sticker-in { from { scale: 0; rotate: -120deg; opacity: 0; } to { scale: 1; rotate: 0deg; opacity: 1; } }
.pile-hint {
  position: absolute; right: 4%; bottom: 2%; z-index: 3; font-weight: 800; font-size: 0.85rem;
  background: var(--paper); border: 2px solid var(--ink); border-radius: 999px; padding: 4px 12px; rotate: 4deg;
  animation: rise 0.5s ease 1.4s both;
}

/* ================= Crossing tape marquees ================= */
.tapes { position: relative; height: 128px; overflow: hidden; background: var(--paper); }
.tapes .marquee { position: absolute; left: -6%; width: 112%; top: 50%; border: var(--border); box-shadow: 0 6px 0 rgba(12, 8, 18, 0.18); }
.tapes .tape-1 { rotate: -3deg; translate: 0 -62%; z-index: 2; }
.tapes .tape-2 { rotate: 2.5deg; translate: 0 -30%; background: var(--gold); }
.tape-2 .marquee-track { animation-duration: 42s; animation-direction: reverse; }
.tape-2 .marquee-track span { color: var(--ink); }
.tape-2 .marquee-track i { color: var(--purple); }

/* ================= Section headings: swoosh + excite marks ================= */
.fancy { position: relative; display: inline-block; padding-bottom: 12px; }
.fancy::after {
  content: ""; position: absolute; left: -2%; right: -2%; bottom: -4px; height: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 16' preserveAspectRatio='none'%3E%3Cpath d='M5 11 C 60 4, 140 3, 195 8' stroke='%237414c4' stroke-width='7' stroke-linecap='round' fill='none'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}
.fancy::before {
  content: ""; position: absolute; right: -44px; top: -22px; width: 40px; height: 36px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 36'%3E%3Cg stroke='%237414c4' stroke-width='6' stroke-linecap='round' fill='none'%3E%3Cpath d='M8 30 5 10'/%3E%3Cpath d='M18 26 28 6'/%3E%3Cpath d='M24 33 36 26'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
}
.on-dark .fancy::after, .on-dark .fancy::before { filter: brightness(1.8); }

/* ================= Pop-in as things scroll into view =================
   Everything is visible by default. effects.js adds .is-in just before an
   element scrolls into view, which plays a one-off entrance. */
.is-in { animation: reveal 0.6s cubic-bezier(.2,1,.3,1) both; }
.grid > .card.is-in:nth-child(5n+2), .vibe.is-in:nth-child(3n+2), .way.is-in:nth-child(2), .steps li.is-in:nth-child(2) { animation-delay: 0.07s; }
.grid > .card.is-in:nth-child(5n+3), .vibe.is-in:nth-child(3n+3), .way.is-in:nth-child(3), .steps li.is-in:nth-child(3) { animation-delay: 0.14s; }
.grid > .card.is-in:nth-child(5n+4) { animation-delay: 0.21s; }
.grid > .card.is-in:nth-child(5n+5) { animation-delay: 0.28s; }
.fancy.is-in { animation: none; }
.fancy.is-in::after { animation: draw 0.7s cubic-bezier(.6,0,.3,1) 0.15s both; }
.fancy.is-in::before { animation: excite 0.5s cubic-bezier(.3,1.6,.5,1) 0.6s both; }
@keyframes draw { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes excite { from { scale: 0; rotate: -40deg; } to { scale: 1; rotate: 0deg; } }
@keyframes reveal { from { opacity: 0; translate: 0 48px; scale: 0.92; } to { opacity: 1; translate: 0 0; scale: 1; } }

/* ================= Cards: 3D tilt, holographic shine, peeling corner ================= */
.card-img { overflow: hidden; }
.card-img::after {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity 0.25s;
  background:
    radial-gradient(circle at var(--mx, 50%) var(--my, 30%), rgba(255, 255, 255, 0.75), transparent 42%),
    linear-gradient(115deg, transparent 20%, rgba(176, 124, 240, 0.32) 38%, rgba(252, 194, 0, 0.32) 52%, rgba(255, 255, 255, 0.45) 60%, transparent 78%);
  background-size: 100% 100%, 260% 260%;
  background-position: 0 0, var(--sx, 50%) 50%;
}
.card-img::before {
  content: ""; position: absolute; right: 0; bottom: 0; z-index: 3; width: 0; height: 0; pointer-events: none;
  background: linear-gradient(135deg, #ffffff 0%, #ddd3ec 46%, rgba(12, 8, 18, 0.25) 49%, transparent 51%);
  border-top-left-radius: 10px;
  filter: drop-shadow(-3px -3px 3px rgba(12, 8, 18, 0.18));
  transition: width 0.25s cubic-bezier(.3,1.5,.5,1), height 0.25s cubic-bezier(.3,1.5,.5,1);
}
.card:not(.is-out):hover .card-img::after { opacity: 1; }
.card:not(.is-out):hover .card-img::before { width: 38px; height: 38px; }
@media (hover: hover) and (pointer: fine) {
  .card:not(.skeleton):hover {
    transform: perspective(800px) translate(-2px, -2px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
    transition: transform 0.1s linear, box-shadow 0.15s;
  }
}

/* Loading placeholders */
.card.skeleton { box-shadow: none; border-color: #d9cfe8; pointer-events: none; }
.sk-img { aspect-ratio: 1; border-bottom: 3px solid #d9cfe8; }
.sk-line { height: 14px; margin: 14px 14px 0; border-radius: 7px; }
.sk-line.short { width: 40%; margin-bottom: 18px; }
.skeleton .sk-img, .skeleton .sk-line {
  background: linear-gradient(90deg, var(--paper-2) 0 40%, #ffffff 50%, var(--paper-2) 60% 100%) 0 0 / 300% 100%;
  animation: shimmer 1.2s linear infinite;
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* ================= Buttons: shine sweep ================= */
.btn { position: relative; overflow: hidden; isolation: isolate; }
.btn::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.6) 50%, transparent 70%);
  translate: -120% 0; transition: translate 0.55s ease;
}
.btn:hover:not(:disabled)::after { translate: 120% 0; }
.hero-actions .btn:first-child { animation: nudge 4s ease-in-out 3s infinite; }
@keyframes nudge { 0%, 88%, 100% { rotate: 0deg; } 91% { rotate: -4deg; } 94% { rotate: 4deg; } 97% { rotate: -2deg; } }

/* Cart button reacts when something lands in it */
.cart-btn.cart-hit { animation: cart-hit 0.5s cubic-bezier(.3,1.6,.5,1); }
@keyframes cart-hit { 0% { scale: 1; } 30% { scale: 1.18; rotate: -6deg; } 60% { rotate: 4deg; } 100% { scale: 1; rotate: 0deg; } }

/* Things that fly around the screen */
.fly, .burst-sticker { position: fixed; z-index: 95; pointer-events: none; object-fit: contain; }
.burst-sticker { width: 84px; height: 84px; filter: drop-shadow(0 5px 0 rgba(12, 8, 18, 0.25)); }

/* ================= Shop by vibe ================= */
.vibes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.vibe {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px;
  min-height: 190px; padding: 18px 20px; overflow: hidden; text-decoration: none;
  border: var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s;
}
.vibe:hover { transform: translate(-3px, -3px) rotate(-1deg); box-shadow: 8px 8px 0 var(--ink); }
@media (min-width: 981px) { .vibe.w3 { grid-column: span 2; } .vibe.w3 .vibe-fan { width: 240px; } }
@media (max-width: 980px) { .vibe.w2 { grid-column: span 2; } }
.vibe:nth-child(4n+1) { background: var(--gold); }
.vibe:nth-child(4n+2) { background: var(--purple); color: #fff; }
.vibe:nth-child(4n+3) { background: var(--lavender); }
.vibe:nth-child(4n+4) { background: var(--ink); color: var(--gold); }
.vibe h3 { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.3rem, 2.4vw, 1.7rem); position: relative; z-index: 1; max-width: 60%; }
.vibe p { font-weight: 700; position: relative; z-index: 1; }
.vibe-fan { position: absolute; top: 12px; right: 6px; width: 170px; height: 120px; }
.vibe-fan img {
  position: absolute; top: 0; right: 40px; width: 92px; height: 92px; object-fit: contain;
  rotate: var(--r); translate: var(--x) 0;
  filter: drop-shadow(0 4px 0 rgba(12, 8, 18, 0.22));
  transition: rotate 0.35s cubic-bezier(.3,1.6,.5,1), translate 0.35s cubic-bezier(.3,1.6,.5,1);
}
.vibe:hover .vibe-fan img { rotate: var(--r2); translate: var(--x2) -10px; }

/* ================= FAQ ================= */
.faq { display: grid; gap: 12px; max-width: 860px; }
.faq details { background: var(--paper); border: var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.faq summary {
  list-style: none; cursor: pointer; position: relative;
  padding: 18px 64px 18px 20px; font-weight: 800; font-size: 1.1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 16px; top: 50%; translate: 0 -50%;
  display: grid; place-items: center; width: 34px; height: 34px;
  font-size: 1.4rem; font-weight: 800; line-height: 1;
  background: var(--gold); border: 2px solid var(--ink); border-radius: 50%;
  transition: rotate 0.3s cubic-bezier(.3,1.5,.5,1), background 0.2s;
}
.faq details[open] summary::after { rotate: 45deg; background: var(--purple); color: #fff; }
.faq details > p { padding: 0 20px 18px; max-width: 65ch; }
.faq details::details-content { block-size: 0; overflow: clip; transition: block-size 0.3s ease, content-visibility 0.3s allow-discrete; }
.faq details[open]::details-content { block-size: auto; }

/* ================= Page headers: floating sticker decorations ================= */
.page-head .wrap { position: relative; z-index: 1; }
.ph-decor {
  position: absolute; z-index: 0; top: 50%; width: clamp(96px, 13vw, 150px); height: auto;
  translate: 0 -50%; rotate: var(--r); pointer-events: none;
  filter: drop-shadow(0 6px 0 rgba(12, 8, 18, 0.25));
  animation: decor-in 0.7s cubic-bezier(.2,1.5,.4,1) both, bob 4.5s ease-in-out 0.7s infinite;
}
.ph-decor.d1 { right: 4%; }
.ph-decor.d2 { right: calc(4% + clamp(80px, 11vw, 130px)); top: 32%; width: clamp(70px, 9vw, 104px); animation-delay: 0.12s, 1s; }
@keyframes decor-in { from { scale: 0; opacity: 0; } to { scale: 1; opacity: 1; } }

/* ================= Lucky dip ================= */
.lucky-page { position: relative; }
.lucky-page::after {
  content: "?  ?  ?"; position: absolute; left: 3%; bottom: 6%; pointer-events: none;
  font-family: var(--font-display); font-size: 3rem; letter-spacing: 0.3em; color: rgba(255, 255, 255, 0.18);
  rotate: -8deg; animation: bob 5s ease-in-out infinite;
}
.lucky-feature .mystery { animation: wobble 3s ease-in-out infinite, bob 3.5s ease-in-out infinite; }

/* ================= Cart drawer: lines slide in when it opens ================= */
.drawer.is-opening .drawer-body > * { animation: line-in 0.42s cubic-bezier(.2,1.2,.4,1) both; }
.drawer.is-opening .drawer-body > :nth-child(2) { animation-delay: 0.05s; }
.drawer.is-opening .drawer-body > :nth-child(3) { animation-delay: 0.1s; }
.drawer.is-opening .drawer-body > :nth-child(4) { animation-delay: 0.15s; }
.drawer.is-opening .drawer-body > :nth-child(5) { animation-delay: 0.2s; }
.drawer.is-opening .drawer-body > :nth-child(n+6) { animation-delay: 0.25s; }
@keyframes line-in { from { opacity: 0; translate: 40px 0; } to { opacity: 1; translate: 0 0; } }

/* Bundle tray: the newest sticker pops into its slot */
.slot.is-new img { animation: slot-pop 0.45s cubic-bezier(.3,1.8,.5,1); }
@keyframes slot-pop { 0% { scale: 0; rotate: -60deg; } 100% { scale: 1; rotate: 0deg; } }

/* ================= Checkout ================= */
.test-warn {
  display: flex; gap: 10px; align-items: flex-start; font-weight: 600;
  background: var(--gold-light); border: 2px solid var(--ink); border-radius: var(--radius-sm); padding: 12px 14px;
}
.test-warn strong { flex: none; }
.privacy-note { font-size: 0.88rem; color: var(--ink-soft); text-align: center; }
.done-badge { animation: stamp 0.6s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes stamp { 0% { scale: 3; opacity: 0; rotate: 14deg; } 100% { scale: 1; opacity: 1; rotate: 0deg; } }
.done > *:not(.done-badge) { animation: rise 0.45s ease both; animation-delay: 0.45s; }

/* ================= Footer ================= */
.footer-tagline { font-family: var(--font-display); font-size: clamp(1.6rem, 4vw, 2.4rem); line-height: 1.05; color: var(--gold); max-width: 14em; margin: 4px 0 8px; }
.footer-tagline span { color: var(--purple-light); }
.footer-logo { animation: logo-bob 4s ease-in-out infinite; transform-origin: 30% 60%; }

/* ================= Page transitions (browsers with View Transitions) ================= */
.site-header { view-transition-name: site-header; }
.tabbar { view-transition-name: tabbar; }
::view-transition-old(root) { animation: vt-out 0.16s ease both; }
::view-transition-new(root) { animation: vt-in 0.32s cubic-bezier(.2,1,.4,1) both; }
@keyframes vt-out { to { opacity: 0; translate: 0 -14px; } }
@keyframes vt-in { from { opacity: 0; translate: 0 22px; } }

/* ================= Small screens ================= */
@media (max-width: 980px) {
  .d-crown { left: auto; right: 8%; top: 3%; width: 54px; }
  .d-spark-2 { display: none; }
  .vibes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .tapes { height: 104px; }
  .d-excite, .d-spark-3 { display: none; }
  .fancy::before { right: -36px; width: 32px; height: 30px; }
  .vibe { min-height: 160px; padding: 14px; }
  .vibe-fan { width: 120px; height: 90px; right: -6px; }
  .vibe-fan img { width: 64px; height: 64px; right: 28px; }
  .vibe h3 { max-width: 100%; }
  .ph-decor.d1 { width: 76px; right: 2%; top: 22%; opacity: 0.95; }
  .ph-decor.d2 { display: none; }
  .page-head h1 { padding-right: 70px; }
  .lucky-page::after { display: none; }
  .pile-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; }
}
