/* ---------- Tokens ---------- */
:root {
  --ink: #1d1a2c;
  --ink-soft: #4b475c;
  --muted: #6d6980;
  --dark: #2b2a33;
  --bg: #fbf7fb;
  --lavender: #efe8fb;
  --lavender-strong: #e3d8fa;
  --white: #fff;
  --accent: #ffc93c;
  --heart: #ff5c8a;

  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-pill: 999px;
  --shadow: 0 10px 30px rgba(80, 60, 140, 0.08);

  --font-display: 'Fredoka', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, sans-serif;
}

/* ---------- Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 24px; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 80% -10%, var(--lavender-strong), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, #f3ecff, transparent 60%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); margin: 0; line-height: 1.1; }
p { margin: 0; }
ul { list-style: none; margin: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
svg { display: block; }
[hidden] { display: none !important; }

.container { width: min(1120px, 100% - 48px); margin-inline: auto; }
.container--narrow { width: min(760px, 100% - 48px); }
.muted { color: var(--muted); }

/* ---------- Components ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-weight: 600;
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn:hover { transform: translateY(-2px); }
.btn svg { width: 1.1em; height: 1.1em; }
.btn--dark { background: var(--dark); color: var(--white); box-shadow: 0 8px 20px rgba(30, 25, 50, 0.2); }
.btn--light { background: var(--white); color: var(--ink); box-shadow: var(--shadow); }
.btn:disabled { opacity: 0.6; cursor: wait; transform: none; }
.btn.is-active { color: var(--heart); }
.btn.is-active svg { fill: currentColor; }
.btn--sm { padding: 10px 20px; font-size: 1rem; }
.btn--lg { padding: 16px 30px; font-size: 1.15rem; }
.btn--xl { padding: 18px 64px; font-size: 1.6rem; position: relative; }

.badge {
  min-width: 20px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--heart);
  font-size: 0.75rem;
  line-height: 20px;
  text-align: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  background: var(--lavender-strong);
  font-weight: 700;
  font-size: 0.95rem;
}
.pill svg { width: 16px; height: 16px; }

.card {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.card--lavender { background: var(--lavender); }

/* Little "sparkle" dashes used as decoration. */
.spark {
  display: inline-block;
  width: 22px;
  height: 26px;
  vertical-align: top;
  background:
    linear-gradient(var(--accent), var(--accent)) 0 0 / 14px 4px,
    linear-gradient(var(--accent), var(--accent)) 4px 11px / 18px 4px,
    linear-gradient(var(--accent), var(--accent)) 0 22px / 14px 4px;
  background-repeat: no-repeat;
}
.spark--right { transform: skewY(-12deg); }
.spark--left { transform: scaleX(-1) skewY(-12deg); }

/* ---------- Header ---------- */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
}
.logo sup { font-size: 0.5em; }
.logo__mark svg { width: 34px; height: 34px; stroke-width: 2.2; }

.nav { display: flex; gap: 6px; }
.nav__link {
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  color: var(--ink-soft);
  transition: background 0.2s;
}
.nav__link:hover,
.nav__link.is-active { background: var(--lavender-strong); color: var(--ink); }

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  align-items: center;
  gap: 24px;
  padding-block: 24px 40px;
}

.hero__content { display: grid; gap: 24px; justify-items: start; }
.hero__title { font-size: clamp(3rem, 6vw, 4.5rem); font-weight: 700; }
.hero__text { max-width: 30ch; font-size: 1.25rem; line-height: 1.5; color: var(--ink-soft); }

.social-proof { display: flex; align-items: center; gap: 14px; font-size: 0.95rem; }
.social-proof p { max-width: 18ch; }
.avatars { display: flex; }
.avatars span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-left: -8px;
  border: 3px solid var(--white);
  border-radius: 50%;
  background: var(--c);
  font-weight: 700;
  color: var(--white);
}
.avatars span:first-child { margin-left: 0; }

.hero__visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 420px;
  /* Swipeable: horizontal drags change buddy, vertical swipes still scroll the page. */
  touch-action: pan-y;
  user-select: none;
  cursor: grab;
  outline: none;
}
.hero__visual.is-dragging { cursor: grabbing; }
.hero__visual:focus-visible .hero__blob { outline: 3px solid var(--lavender-strong); outline-offset: 4px; }
.hero__buddy svg { pointer-events: none; }
.hero__blob {
  position: absolute;
  inset: 6% 0 0 12%;
  border-radius: 48% 52% 40% 60% / 55% 45% 55% 45%;
  background-color: var(--hero-bg, #f4e8dc);
  background-image: linear-gradient(140deg, rgba(255, 255, 255, 0.35), rgba(0, 0, 0, 0.04));
  transition: background-color 0.6s ease;
}
/* The stage gets the swap animation (from JS); the SVG inside gets the idle float. */
.hero__buddy {
  position: relative;
  width: min(440px, 100%);
  filter: drop-shadow(0 24px 30px rgba(60, 40, 80, 0.18));
}
.hero__buddy svg { animation: float 4s ease-in-out infinite; }

.hero__picker { position: relative; display: grid; justify-items: center; gap: 10px; }
.hero__name { font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; }
.hero__dots { display: flex; gap: 8px; }
.hero__dot {
  width: 12px;
  height: 12px;
  padding: 0;
  border: 2px solid var(--white);
  border-radius: var(--radius-pill);
  background: var(--dot);
  opacity: 0.45;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  transition: width 0.3s, opacity 0.3s;
}
.hero__dot:hover { opacity: 0.8; }
.hero__dot[aria-current='true'] { width: 28px; opacity: 1; }
.hero__visual > .spark { position: absolute; top: 4%; left: 10%; }
.hero__heart { position: absolute; right: 4%; bottom: 16%; width: 40px; height: 40px; stroke-width: 2.4; }

/* ---------- Highlights strip ---------- */
.highlights {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 26px 20px;
}
.highlights li {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-weight: 600;
  line-height: 1.3;
}
.highlights li + li { border-left: 1px solid #ece8f2; }
.highlights svg { width: 36px; height: 36px; stroke-width: 1.6; flex-shrink: 0; }

/* ---------- Sections ---------- */
.section { padding-block: 64px 32px; }
.section__head { text-align: center; margin-bottom: 36px; }
.section__head h2 { font-size: clamp(2rem, 4vw, 2.6rem); font-weight: 700; }
.section__head p { margin-top: 10px; font-size: 1.1rem; color: var(--ink-soft); }

/* ---------- Buddy grid ---------- */
.buddy-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.buddy-card {
  position: relative;
  padding: 0 18px 14px;
  margin-top: 24px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, var(--bg), color-mix(in srgb, var(--bg) 60%, white));
  transition: transform 0.25s, box-shadow 0.25s;
}
.buddy-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }

.buddy-card__art { width: 72%; margin: -28px auto 0; }
.buddy-card:hover .buddy-card__art { animation: wiggle 0.6s ease-in-out; }

.buddy-card__footer { display: flex; align-items: center; justify-content: space-between; }
.buddy-card__name { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.05rem; }
.buddy-card__name::before {
  content: '';
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--dot);
}

.heart-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  transition: transform 0.2s, background 0.2s;
}
.heart-btn:hover { background: rgba(255, 255, 255, 0.7); }
.heart-btn svg { width: 24px; height: 24px; stroke-width: 2.2; }
.heart-btn.is-active { color: var(--heart); animation: pop 0.35s ease; }
.heart-btn.is-active svg { fill: var(--heart); }

/* Eyes blink on every buddy, staggered per card. */
.buddy-eyes {
  transform-box: fill-box;
  transform-origin: center;
  animation: blink 5s infinite;
}
.buddy-card:nth-child(3n + 2) .buddy-eyes { animation-delay: 1.3s; }
.buddy-card:nth-child(3n) .buddy-eyes { animation-delay: 2.6s; }

/* ---------- Try it on your bag ---------- */
.tryon {
  display: grid;
  grid-template-columns: minmax(0, 520px) 1fr;
  grid-template-areas:
    'scene  panel'
    'picker picker';
  align-items: center;
  gap: 24px 56px;
}

.tryon__scene {
  grid-area: scene;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: #efe6da;
  box-shadow: 0 24px 60px rgba(70, 50, 30, 0.18);
}
.tryon__photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* The buddy hangs from its ring: the ring's top sits exactly on the scene anchor,
   and both the idle sway and the drop-in swing rotate around that point. */
.tryon__hanger {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--size);
  aspect-ratio: 200 / 180;
  translate: -50% calc(-1 * var(--attach-y));
  transform-origin: 50% var(--attach-y);
  filter: drop-shadow(10px 18px 14px rgba(70, 45, 20, 0.35));
  animation: sway 3.6s ease-in-out infinite;
}
.tryon__buddy { width: 100%; height: 100%; transform-origin: 50% var(--attach-y); }
.tryon__buddy svg { width: 100%; height: 100%; overflow: visible; }

/* Singing: the keychain bobs and its eyes bounce to the beat. */
.tryon__hanger.is-singing .tryon__buddy svg { animation: sing-bounce 0.6s ease-in-out infinite; }
.tryon__hanger.is-singing .buddy-eyes { animation: sing-eyes 0.3s ease-in-out infinite alternate; }

.tryon__sound { top: 14px; right: 14px; }

/* What the buddy sings, shown above the bag. */
.tryon__bubble {
  position: absolute;
  top: 5%;
  left: 50%;
  z-index: 3;
  width: max-content;
  max-width: 80%;
  padding: 10px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow);
  font-weight: 700;
  font-size: 0.95rem;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, -8px) scale(0.85);
  transition: opacity 0.25s, transform 0.35s cubic-bezier(0.3, 1.5, 0.5, 1);
  pointer-events: none;
}
.tryon__bubble.is-visible { opacity: 1; transform: translate(-50%, 0) scale(1); }

/* Sparkles on landing + music notes while singing (created by try-on.js). */
.tryon__fx { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.tryon-sparkle {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 22px;
  height: 22px;
  margin: -11px;
  background: var(--c);
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  filter: drop-shadow(0 0 6px #fff);
  animation: sparkle-out 0.9s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}
.tryon-note {
  position: absolute;
  left: var(--x);
  top: var(--y);
  color: var(--c);
  font-size: var(--size);
  font-weight: 700;
  text-shadow: 0 0 2px #fff, 0 0 8px #fff, 0 2px 6px rgba(0, 0, 0, 0.15);
  animation: note-float 1.6s ease-out forwards;
}

.tryon__mood-pill {
  position: absolute;
  left: 16px;
  bottom: 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(6px);
  font-weight: 700;
  font-size: 0.9rem;
}
.tryon__mood-pill svg { width: 16px; height: 16px; color: #8b5cf6; }

/* Horizontal buddy strip under the bag */
.tryon__picker { grid-area: picker; display: flex; align-items: center; gap: 8px; min-width: 0; }
.tryon__strip {
  position: relative;
  display: flex;
  flex: 1;
  gap: 12px;
  padding: 10px 4px 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  outline: none;
}
.tryon__strip::-webkit-scrollbar { display: none; }

.tryon__thumb {
  flex: 0 0 auto;
  display: grid;
  justify-items: center;
  gap: 4px;
  width: 104px;
  padding: 10px 8px 8px;
  border: 2px solid transparent;
  border-radius: 18px;
  background: var(--bg);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink);
  scroll-snap-align: center;
  transition: transform 0.2s, background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.tryon__thumb svg { width: 76px; overflow: visible; }
.tryon__thumb:hover { transform: translateY(-3px); }
.tryon__thumb[aria-selected='true'] {
  border-color: var(--dot);
  background: var(--white);
  box-shadow: var(--shadow);
  transform: translateY(-4px);
}
.tryon__strip:focus-visible .tryon__thumb[aria-selected='true'] { outline: 3px solid var(--lavender-strong); outline-offset: 2px; }

.tryon__arrow { flex-shrink: 0; background: var(--white); box-shadow: var(--shadow); }

/* Info panel */
.tryon__panel { grid-area: panel; display: grid; justify-items: start; gap: 14px; max-width: 420px; }
.tryon__eyebrow { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.tryon__name { font-size: clamp(2.2rem, 4vw, 3rem); }
.tryon__mood { font-size: 1.1rem; }
.tryon__mood strong { color: #8b5cf6; }
.tryon__panel .muted { line-height: 1.55; }

.tryon__scenes { display: flex; gap: 10px; }
.tryon__scene-btn {
  width: 64px;
  height: 80px;
  padding: 0;
  overflow: hidden;
  border: 3px solid transparent;
  border-radius: 14px;
  background: none;
}
.tryon__scene-btn img { width: 100%; height: 100%; object-fit: cover; }
.tryon__scene-btn[aria-pressed='true'] { border-color: var(--dark); }

@media (hover: none) {
  .tryon__picker .tryon__arrow { display: none; }
}

@media (max-width: 960px) {
  .tryon {
    grid-template-columns: 1fr;
    grid-template-areas: 'scene' 'picker' 'panel';
    justify-items: center;
  }
  .tryon__scene { width: min(520px, 100%); }
  .tryon__picker { width: 100%; }
  .tryon__panel { justify-items: center; text-align: center; }
}

@media (max-width: 640px) {
  .tryon { gap: 16px; }
  .tryon__scene { border-radius: var(--radius-md); }
  .tryon__picker .tryon__arrow { display: none; }
  .tryon__thumb { width: 88px; font-size: 0.82rem; }
  .tryon__thumb svg { width: 64px; }
  .tryon__mood-pill { left: 12px; bottom: 12px; font-size: 0.8rem; }
  .tryon__bubble { max-width: 70%; padding: 8px 12px; font-size: 0.8rem; }
  .tryon__sound { top: 10px; right: 10px; width: 36px; height: 36px; }
}

/* ---------- Rarity pill (grid cards + mystery box) ---------- */
.rarity {
  --rarity: var(--muted);
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  background: var(--rarity);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  vertical-align: middle;
}
[data-rarity='common'] { --rarity: #8a8599; }
[data-rarity='rare'] { --rarity: #3d8ff0; }
[data-rarity='secret'] { --rarity: #8b5cf6; }

/* ---------- Mystery Box ---------- */
.mystery {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: center;
  gap: 40px;
  padding: 44px;
  background: linear-gradient(135deg, #f1eaff, #fff4e8);
}

.mystery__info { display: grid; justify-items: start; gap: 18px; }
.mystery__info h2 { font-size: clamp(2rem, 4vw, 2.6rem); }
.mystery__info .pill svg { color: #8b5cf6; }
.mystery__text { max-width: 44ch; font-size: 1.1rem; line-height: 1.55; color: var(--ink-soft); }

.mystery__odds { display: flex; flex-wrap: wrap; gap: 10px; }
.mystery__odds li {
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background: var(--white);
  box-shadow: var(--shadow);
  font-size: 0.9rem;
  font-weight: 600;
}
.mystery__odds strong { color: var(--rarity); }

.mystery__shelf { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.mystery__shelf li { width: 46px; padding: 4px; border-radius: 12px; background: rgba(255, 255, 255, 0.8); }
.mystery__shelf li:not(.is-found) svg { filter: brightness(0); opacity: 0.15; }
.mystery__shelf .buddy-eyes { animation: none; }

.mystery__play { display: grid; justify-items: center; gap: 16px; }
/* --glow is the rarity colour shared by the glow, rays and twinkles. */
.mystery__stage {
  --glow: #ffe08a;
  position: relative;
  width: min(320px, 100%);
  aspect-ratio: 32 / 34;
}
.mystery__stage[data-rarity='rare'] { --glow: #8fc0ff; }
.mystery__stage[data-rarity='secret'] { --glow: #b48cff; }

.mystery__box {
  position: absolute;
  bottom: 0;
  left: 12.5%;
  width: 75%;
  overflow: visible;
  transform-origin: 50% 100%;
}
/* Build-up: shakes harder and harder, then squashes right before the pop. */
[data-state='shaking'] .mystery__box { animation: box-build var(--shake-ms) ease-in forwards; }
[data-state='open'] .mystery__box { animation: box-release 0.45s cubic-bezier(0.3, 1.6, 0.5, 1); }

.mystery__lid {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  transition: transform 0.5s cubic-bezier(0.3, 1.4, 0.6, 1), opacity 0.4s;
}
[data-state='open'] .mystery__lid { transform: translate(50px, -80px) rotate(28deg); opacity: 0; }

/* The buddy starts tiny inside the box and springs up out of it. */
.mystery__reveal {
  position: absolute;
  top: 12%;
  left: 15%;
  z-index: 2;
  width: 70%;
  opacity: 0;
  transform: translateY(55%) scale(0.2) rotate(-14deg);
  transition: transform 0.7s cubic-bezier(0.3, 1.5, 0.5, 1) 0.05s, opacity 0.3s 0.05s;
}
[data-state='open'] .mystery__reveal { opacity: 1; transform: none; }
.mystery__reveal { pointer-events: none; } /* decorative; lets taps reach the box */

/* The sealed box can be tapped for a little shake + rattle. */
[data-state='idle'] .mystery__box { cursor: pointer; }
.mystery__hint { font-size: 0.85rem; color: var(--muted); }
.mystery__play:not(:has([data-state='idle'])) .mystery__hint { visibility: hidden; }

.mystery__glow {
  position: absolute;
  inset: 0 5% 30%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--glow) 0%, transparent 70%);
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.6s, transform 0.6s;
}
[data-rarity='secret'] > .mystery__glow { animation: pulse 1.6s ease-in-out infinite; }
[data-state='open'] > .mystery__glow { opacity: 1; transform: scale(1.1); }

/* Slowly spinning light rays behind the buddy. */
.mystery__rays {
  position: absolute;
  inset: -12% -12% 18%;
  background: repeating-conic-gradient(from 0deg, var(--glow) 0deg 9deg, transparent 9deg 24deg);
  -webkit-mask: radial-gradient(circle, #000 18%, transparent 68%);
  mask: radial-gradient(circle, #000 18%, transparent 68%);
  opacity: 0;
  transform: scale(0.3);
  transition: opacity 0.5s, transform 0.7s cubic-bezier(0.3, 1.4, 0.5, 1);
}
[data-state='open'] > .mystery__rays {
  opacity: 0.55;
  transform: scale(1);
  animation: spin 14s linear infinite;
}
[data-rarity='secret'] > .mystery__rays { animation-duration: 6s; }

/* A quick burst of light the moment the lid pops. */
.mystery__flash {
  position: absolute;
  inset: 20% 10% 10%;
  z-index: 1;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, var(--glow) 35%, transparent 70%);
  opacity: 0;
  pointer-events: none;
}
[data-state='open'] > .mystery__flash { animation: flash 0.7s ease-out; }

/* Stars that keep twinkling around the revealed buddy. */
.mystery__twinkles { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.twinkle {
  position: absolute;
  width: 16px;
  height: 16px;
  background: #fff;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  filter: drop-shadow(0 0 4px var(--glow));
  opacity: 0;
}
.twinkle:nth-child(even) { width: 11px; height: 11px; background: var(--glow); }
[data-state='open'] .twinkle { animation: twinkle 1.8s ease-in-out var(--delay) infinite; }

/* Glitter burst (particles are created by mystery-box.js). */
.mystery__fx { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.glitter {
  position: absolute;
  left: 50%;
  top: 58%;
  width: var(--size);
  height: var(--size);
  margin: calc(var(--size) / -2);
  background: var(--color);
  opacity: 0;
  animation: glitter-fly var(--duration) cubic-bezier(0.15, 0.7, 0.3, 1) var(--delay) forwards;
}
.glitter--dot { border-radius: 50%; }
.glitter--confetti { height: calc(var(--size) * 0.45); border-radius: 2px; }
.glitter--star {
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  filter: drop-shadow(0 0 3px var(--color));
}

/* Round 🔊/🔇 toggle (wired up by bindMuteButton in js/sound.js) */
.sound-btn {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 5;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--white);
  box-shadow: var(--shadow);
  font-size: 1.1rem;
}

.mystery__result { display: flex; align-items: center; gap: 10px; font-size: 1.15rem; }
.mystery__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

@media (max-width: 960px) {
  .mystery { grid-template-columns: 1fr; text-align: center; }
  .mystery__info { justify-items: center; }
  .mystery__odds, .mystery__shelf { justify-content: center; }
}

@media (max-width: 640px) {
  .mystery { gap: 24px; padding: 28px 16px; }
  .mystery__text { font-size: 1rem; }
  .mystery__odds li { font-size: 0.8rem; padding: 6px 12px; }
  .mystery__shelf li { width: 40px; }
  .mystery__stage { width: min(260px, 100%); }
  .mystery__result { font-size: 1rem; }
}

/* ---------- Features ---------- */
#features { padding-top: 64px; }
.features {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 32px;
  padding: 28px 36px;
}
.features__title { font-size: 1.9rem; font-weight: 700; }
.features__title svg { display: inline; width: 26px; height: 26px; color: var(--accent); vertical-align: top; }
.features__list { display: grid; grid-template-columns: repeat(6, 1fr); }
.features__list li {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding-inline: 8px;
  text-align: center;
  font-weight: 600;
  font-size: 0.95rem;
  border-left: 1px solid #d9d0ee;
}
.features__list svg { width: 30px; height: 30px; stroke-width: 1.8; }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 12px; }
.faq details {
  padding: 18px 22px;
  border-radius: var(--radius-md);
  background: var(--white);
  box-shadow: var(--shadow);
}
.faq summary {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
  list-style: none;
}
.faq summary::after { content: '+'; font-size: 1.4rem; line-height: 1; transition: transform 0.2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin-top: 10px; color: var(--ink-soft); line-height: 1.6; }

/* ---------- CTA + Footer ---------- */
.cta { display: grid; justify-items: center; gap: 16px; padding-block: 48px 64px; text-align: center; }
.cta p { color: var(--ink-soft); font-size: 1.1rem; }
.cta .spark { position: absolute; top: 50%; translate: 0 -50%; }
.cta .spark--left { left: -48px; }
.cta .spark--right { right: -48px; }

.footer { padding: 48px 0 24px; margin-top: 32px; border-top: 1px solid var(--lavender-strong); font-size: 0.9rem; color: var(--muted); text-align: center; }
.footer__inner { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; text-align: left; line-height: 1.6; }
.footer__inner strong { display: block; margin-bottom: 6px; color: var(--ink); font-family: var(--font-display); font-size: 1.05rem; }
.footer__inner a:hover { color: var(--ink); text-decoration: underline; }
.footer__links { display: grid; gap: 4px; align-content: start; }
.footer__copy { margin-top: 32px; }

/* ---------- Header actions + Pre-book / Wishlist choice ---------- */
.header__actions { display: flex; align-items: center; gap: 10px; }
.header__wish { position: relative; }
.choice { display: flex; flex-wrap: wrap; gap: 12px; }
.choice__note { font-size: 0.95rem; margin-top: -8px; }
.cta .choice { justify-content: center; }
.cta .btn--xl { padding-inline: 44px; }

/* ---------- Running banner ---------- */
.ticker {
  display: block;
  overflow: hidden;
  background: var(--dark);
  color: var(--white);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}
.ticker strong { color: var(--accent); }
.ticker__track { display: flex; width: max-content; animation: ticker 32s linear infinite; }
.ticker:hover .ticker__track { animation-play-state: paused; }
.ticker__group { display: flex; }
.ticker__group > span { padding: 7px 28px; position: relative; }
.ticker__group > span::after { content: '•'; position: absolute; right: -4px; opacity: 0.5; }
@keyframes ticker { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .ticker__track { animation: none; }
}

/* ---------- Pricing ---------- */
.pricing { display: grid; grid-template-columns: 1fr 1.2fr; gap: 40px; align-items: center; padding: 40px; }
.pricing__product { display: grid; justify-items: center; gap: 16px; text-align: center; }
.pricing__product h3 { font-size: 1.6rem; }
.pricing__art { width: min(260px, 70%); padding: 24px; border-radius: var(--radius-lg); background: #fdebdd; }
.pricing__offer { display: grid; justify-items: start; gap: 16px; }
.pricing__now { font-family: var(--font-display); font-size: 1.3rem; color: var(--ink-soft); }
.pricing__now strong { font-size: clamp(3rem, 7vw, 4rem); line-height: 1; color: var(--ink); }
.pricing__expected { font-size: 1.1rem; }
.pricing__points { display: grid; gap: 10px; }
.pricing__points li { display: flex; gap: 10px; align-items: flex-start; line-height: 1.4; }
.pricing__points svg { flex: none; width: 20px; height: 20px; color: var(--heart); }
.pricing__fine { font-size: 0.9rem; }
.pricing__fine a, .field__hint a, .faq a { text-decoration: underline; }

/* ---------- Policy pages ---------- */
.policy { margin-block: 24px 48px; padding: 48px; line-height: 1.7; color: var(--ink-soft); }
.policy h1 { font-size: clamp(2rem, 5vw, 2.6rem); color: var(--ink); margin-bottom: 8px; }
.policy h2 { font-size: 1.35rem; color: var(--ink); margin: 32px 0 8px; }
.policy p + p, .policy ul { margin-top: 10px; }
.policy ul { list-style: disc; padding-left: 22px; }
.policy li + li { margin-top: 6px; }
.policy a { color: var(--ink); text-decoration: underline; }
.policy strong { color: var(--ink); }

@media (max-width: 760px) {
  .pricing { grid-template-columns: 1fr; padding: 28px 22px; gap: 28px; }
  .footer__inner { grid-template-columns: 1fr; gap: 20px; }
  .policy { padding: 28px 22px; }
}

/* ---------- Dialog ---------- */
.dialog {
  width: min(480px, 100% - 32px);
  max-height: calc(100dvh - 32px);
  padding: 32px;
  border: 0;
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 80px rgba(30, 20, 60, 0.3);
}
.dialog::backdrop { background: rgba(30, 25, 50, 0.4); backdrop-filter: blur(4px); }
.dialog h3 { font-size: 1.6rem; margin-bottom: 8px; }
.dialog .muted + .muted { margin-top: 6px; font-weight: 600; }
.dialog__close-form { position: absolute; top: 12px; right: 12px; }
.dialog__form { display: grid; gap: 12px; margin-top: 20px; }
.dialog__form input,
.dialog__form textarea {
  padding: 14px 18px;
  border: 2px solid var(--lavender-strong);
  border-radius: var(--radius-pill);
  font: inherit;
  outline: none;
}
.dialog__form input:focus,
.dialog__form textarea:focus { border-color: var(--ink-soft); }
.dialog__form textarea { border-radius: var(--radius-md); resize: vertical; }
.dialog__form [aria-invalid="true"] { border-color: var(--heart); }
.field { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.field > span, .field legend { padding: 0; font-weight: 700; font-size: 0.95rem; }
.field em { font-weight: 400; color: var(--muted); }
.field__hint { font-size: 0.85rem; color: var(--muted); margin-top: -4px; }
.field__error { padding: 10px 14px; border-radius: var(--radius-md); background: #ffe3ec; color: #b0204d; font-weight: 600; font-size: 0.9rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border: 2px solid var(--lavender-strong);
  border-radius: var(--radius-pill);
  font-weight: 600; font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.chip__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--dot); }
.chip input:checked + span { background: var(--lavender); border-color: var(--ink-soft); }
.chip input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.dialog__again { margin-top: 20px; padding: 12px 20px; }
.dialog__form .btn { justify-content: center; padding: 14px; }

.icon-btn { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--lavender); }
.icon-btn svg { width: 18px; height: 18px; }

/* ---------- Animations ---------- */
@keyframes float { 50% { transform: translateY(-14px) rotate(-1deg); } }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.1); } }
@keyframes wiggle { 25% { rotate: -4deg; } 75% { rotate: 4deg; } }
@keyframes pop { 50% { transform: scale(1.3); } }
@keyframes pulse { 50% { transform: scale(1.25); } }
@keyframes spin { to { rotate: 360deg; } }
@keyframes sway { 0%, 100% { rotate: -2.5deg; } 50% { rotate: 2.5deg; } }
@keyframes sing-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3%); } }
@keyframes sing-eyes { to { transform: scale(1.12, 0.8); } }
@keyframes sparkle-out {
  0% { opacity: 1; transform: translate(0, 0) scale(0.4) rotate(0deg); }
  60% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1.2) rotate(140deg); }
}
@keyframes note-float {
  0% { opacity: 0; transform: translate(0, 0) scale(0.6) rotate(-10deg); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), -110px) scale(1) rotate(15deg); }
}
@keyframes box-build {
  0% { rotate: 0deg; }
  10% { rotate: -2deg; }
  20% { rotate: 2deg; }
  30% { rotate: -4deg; }
  40% { rotate: 4deg; }
  50% { rotate: -6deg; }
  60% { rotate: 6deg; }
  70% { rotate: -9deg; }
  80% { rotate: 9deg; scale: 1; }
  100% { rotate: 0deg; scale: 1.1 0.86; }
}
@keyframes box-release {
  0% { scale: 1.1 0.86; }
  40% { scale: 0.92 1.1; }
  100% { scale: 1; }
}
@keyframes flash {
  0% { opacity: 0; transform: scale(0.4); }
  25% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.6); }
}
@keyframes twinkle {
  0%, 100% { opacity: 0; transform: scale(0.2) rotate(0deg); }
  50% { opacity: 1; transform: scale(1) rotate(90deg); }
}
@keyframes glitter-fly {
  0% { opacity: 1; transform: translate(0, 0) rotate(0deg) scale(0.4); }
  15% { opacity: 1; transform: translate(calc(var(--x) * 0.45), calc(var(--y) * 0.45)) rotate(calc(var(--spin) * 0.2)) scale(1.1); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--x), calc(var(--y) + 70px)) rotate(var(--spin)) scale(0.6); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Responsive ---------- */
.menu-btn { display: none; }

/* Tablet */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; text-align: center; padding-top: 8px; }
  .hero__content { justify-items: center; }
  .hero__visual { min-height: 340px; }
  .highlights { grid-template-columns: repeat(2, 1fr); row-gap: 20px; }
  .highlights li:nth-child(3) { border-left: 0; }
  .buddy-grid { gap: 20px; }
  .features { grid-template-columns: 1fr; text-align: center; }
  .features__list { grid-template-columns: repeat(3, 1fr); row-gap: 20px; }
  .features__list li:nth-child(4) { border-left: 0; }
}

/* Phone */
@media (max-width: 640px) {
  .container,
  .container--narrow { width: calc(100% - 32px); }

  /* Header: logo · wishlist · menu toggle, with the nav as a dropdown panel */
  .header { position: relative; gap: 10px; padding-block: 14px; }
  .logo { font-size: 1.25rem; }
  .logo__mark svg { width: 28px; height: 28px; }
  .header__actions { margin-left: auto; gap: 8px; }
  .header .btn--sm { padding: 8px 14px; font-size: 0.9rem; }
  .header__wish .btn__label { display: none; }
  .header__wish { padding-inline: 11px; }
  .choice { justify-content: center; }
  .choice .btn { flex: 1 1 auto; justify-content: center; }
  .cta .btn--xl { padding: 16px 28px; font-size: 1.2rem; }
  .cta .spark { display: none; }
  .menu-btn { display: grid; order: 3; width: 40px; height: 40px; }
  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 10;
    flex-direction: column;
    padding: 10px;
    border-radius: var(--radius-md);
    background: var(--white);
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  }
  .nav.is-open { opacity: 1; visibility: visible; transform: none; }
  .nav__link { padding: 12px 16px; }

  .hero { gap: 8px; padding-bottom: 24px; }
  .hero__content { gap: 18px; }
  .hero__text { font-size: 1.05rem; }
  .btn--lg { padding: 14px 26px; font-size: 1.05rem; }
  .hero__visual { min-height: 280px; }
  .hero__buddy { width: min(300px, 85%); }
  .hero__heart { width: 30px; height: 30px; }

  .highlights { padding: 18px 12px; row-gap: 18px; }
  .highlights li { flex-direction: column; gap: 8px; text-align: center; font-size: 0.9rem; }
  .highlights li:nth-child(odd) { border-left: 0; }
  .highlights svg { width: 30px; height: 30px; }

  .section { padding-block: 48px 16px; }
  .section__head { margin-bottom: 20px; }
  .section__head p { font-size: 1rem; }

  /* Two compact buddies per row instead of one tall column */
  .buddy-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .buddy-card { padding: 0 8px 8px 12px; margin-top: 16px; }
  .buddy-card__art { width: 85%; margin-top: -16px; }
  /* An odd last card spans the full row so it isn't left hanging. */
  .buddy-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .buddy-card:last-child:nth-child(odd) .buddy-card__art { width: 42%; }
  .buddy-card__name { font-size: 0.95rem; gap: 6px; }
  .buddy-card__name::before { width: 10px; height: 10px; }
  .heart-btn { width: 34px; height: 34px; }
  .heart-btn svg { width: 20px; height: 20px; }

  #features { padding-top: 40px; }
  .features { padding: 24px 16px; gap: 20px; }
  .features__title { font-size: 1.6rem; }
  .features__list li { font-size: 0.85rem; padding-inline: 4px; }

  .faq details { padding: 16px 18px; }
  .faq summary { font-size: 1rem; gap: 12px; }

  .cta { padding-block: 32px 40px; }
  .btn--xl { padding: 16px 36px; font-size: 1.3rem; }
  .cta .spark { display: none; }
  .dialog { padding: 28px 22px; }
}

/* Small phones (≤ 360px) */
@media (max-width: 360px) {
  .header .btn__label,
  .hero__title .spark { display: none; }
  .header .btn--sm { gap: 6px; padding: 10px 12px; }
  .features__list { grid-template-columns: repeat(2, 1fr); }
  .features__list li { border-left: 0; }
}
