/* ============================================================
   AllTheMuse — Shared Components
   Loaded LAST (after tokens.css, styles.css, assets/app.css)
   so the new system wins for shared class names.
   Everything here works in both light and dark themes.
   ============================================================ */

/* ---------- Reset-ish basics scoped to component zones ---------- */
.nav, .nav *, .site-footer, .site-footer * { box-sizing: border-box; }

/* ---------- Glassy sticky nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.7rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.logo {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
  text-decoration: none;
  color: var(--ink);
  white-space: nowrap;
}
.logo-dot { color: var(--purple); }
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  margin-left: auto;
}
.nav-links a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 500;
  font-size: 0.93rem;
  opacity: 0.82;
  transition: opacity 0.15s var(--ease), color 0.15s var(--ease);
}
.nav-links a:hover { opacity: 1; color: var(--purple-ink); }
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
#auth-link.nav-login {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  opacity: 0.85;
}
#auth-link.nav-login:hover { opacity: 1; color: var(--purple-ink); }

/* Nav CTA pill — "Create free" */
.nav-cta {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 1.3rem;
  border-radius: var(--r-pill);
  background: var(--cta);
  color: var(--on-cta);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.15s var(--ease), box-shadow 0.2s var(--ease);
  box-shadow: var(--sh-sm);
}
.nav-cta:hover { transform: translateY(-1px); box-shadow: var(--sh-md); }
/* Explicit dark-mode pairing — never rely on variable resolution for this CTA */
html[data-theme="dark"] .nav-cta { background: #f5f5f7; color: #101014; }

/* Muse detail social proof strip */
.social-proof {
  display: flex; gap: 1.6rem; flex-wrap: wrap;
  margin-top: 1.1rem; padding-top: 1.1rem;
  border-top: 1px solid var(--line);
}
.sp-stat { display: flex; flex-direction: column; gap: 0.15rem; }
.sp-stat b { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }
.sp-stat span { font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }

/* Theme toggle */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.15s var(--ease), border-color 0.15s var(--ease);
}
.theme-toggle:hover { border-color: var(--purple); transform: translateY(-1px); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* Coin pill (logged-in balance) */
#coin-pill:empty { display: none; }
.coin-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--amber-soft);
  color: var(--amber-ink);
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.5rem 1rem;
  border-radius: var(--r-pill);
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.15s var(--ease), box-shadow 0.2s var(--ease);
}
.coin-pill:hover { transform: translateY(-1px); box-shadow: var(--sh-sm); }

/* Official Muse Coin artwork */
.coin-img {
  width: 1.2em; height: 1.2em; border-radius: 50%;
  display: inline-block; vertical-align: -0.24em; flex: none;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.18));
}
/* Coins inside buttons can never stretch, regardless of cascade */
.btn .coin-img { width: 1.25em; height: 1.25em; object-fit: contain; flex: 0 0 auto; }
.coin-img.xl { width: 72px; height: 72px; vertical-align: baseline; }
.coin-pill .coin-img { width: 20px; height: 20px; vertical-align: baseline; }
.fx-particle { position: fixed; z-index: 9999; pointer-events: none; border-radius: 50%; }

/* Logged-in user chip */
.nav-user { position: relative; }
.nav-user-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 0.3rem 0.8rem 0.3rem 0.35rem;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
}
.nav-avatar, .nav-avatar-initial {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  background: var(--purple-soft);
  color: var(--purple-ink);
  overflow: hidden;
}
.nav-avatar img, img.nav-avatar { object-fit: cover; }
.nav-name { font-weight: 600; font-size: 0.9rem; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-chev { font-size: 0.75rem; opacity: 0.6; }
.nav-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 210px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
}
.nav-menu[hidden] { display: none; }
.nav-menu a, .nav-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.65rem 0.8rem;
  border-radius: var(--r-sm);
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 0.92rem;
  text-decoration: none;
  cursor: pointer;
}
.nav-menu a:hover, .nav-menu button:hover { background: var(--bg-soft); }

/* Mobile burger + sheet */
.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 0 11px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  cursor: pointer;
}
.nav-burger span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
}
.nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.nav-sheet {
  position: fixed;
  top: 64px;
  left: 0.75rem;
  right: 0.75rem;
  z-index: 190;
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-xl);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  animation: sheetIn 0.22s var(--ease);
}
.nav-sheet[hidden] { display: none; }
.nav-sheet a {
  padding: 0.85rem 1rem;
  border-radius: var(--r-md);
  color: var(--ink);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
}
.nav-sheet a:hover { background: var(--bg-soft); }
.nav-sheet .nav-sheet-cta {
  margin-top: 0.4rem;
  text-align: center;
  background: var(--cta);
  color: var(--on-cta);
}
@keyframes sheetIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 46px;
  padding: 0 1.6rem;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s var(--ease), box-shadow 0.2s var(--ease), background 0.15s var(--ease), border-color 0.15s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(0.98); }
.btn:disabled, .btn.disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.btn-primary {
  background: var(--cta);
  color: var(--on-cta);
  box-shadow: var(--sh-sm);
}
.btn-primary:hover { box-shadow: var(--sh-md); }
/* Purple accent button */
.btn-purple {
  background: linear-gradient(135deg, var(--purple) 0%, var(--purple-deep) 100%);
  color: #fff;
  box-shadow: var(--sh-purple);
}
.btn-purple:hover { box-shadow: 0 16px 40px rgba(124, 92, 255, 0.42); }
.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}
.btn-secondary:hover { border-color: var(--purple); box-shadow: var(--sh-sm); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
}
.btn-ghost:hover { background: var(--bg-soft); }
.btn-lg { min-height: 54px; padding: 0 2.2rem; font-size: 1.03rem; }
.btn-sm { min-height: 36px; padding: 0 1.15rem; font-size: 0.85rem; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-sm);
  overflow: hidden;
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease);
}
a.card:hover, .card-lift:hover { transform: translateY(-5px); box-shadow: var(--sh-lg); }
.card-body { padding: 1.1rem 1.25rem 1.3rem; }
.card-title { font-weight: 700; font-size: 1.05rem; letter-spacing: -0.015em; margin: 0 0 0.35rem; color: var(--ink); }
.card-text { color: var(--muted); font-size: 0.93rem; line-height: 1.55; margin: 0; }

/* Muse avatar card (homepage carousel + grids) */
.muse-card {
  position: relative;
  flex: 0 0 auto;
  width: 220px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--sh-sm);
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease);
  scroll-snap-align: start;
}
.muse-card:hover { transform: translateY(-6px); box-shadow: var(--sh-lg); }
.muse-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--bg-soft);
}
.muse-card-body { padding: 0.8rem 0.95rem 1rem; }
.muse-card-name {
  display: block;
  font-weight: 700;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
  margin-bottom: 0.35rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.muse-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.muse-card-price { font-weight: 700; font-size: 0.88rem; color: var(--amber-ink); }
.muse-card-price.free { color: var(--green-ink); }

/* ---------- Badges, pills, tags ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.75rem;
  border-radius: var(--r-pill);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge-rarity-common { background: var(--rarity-common-bg); color: var(--rarity-common-ink); }
.badge-rarity-rare { background: var(--rarity-rare-bg); color: var(--rarity-rare-ink); }
.badge-rarity-epic { background: var(--rarity-epic-bg); color: var(--rarity-epic-ink); box-shadow: 0 0 0 1px rgba(124, 92, 255, 0.22); }
.badge-rarity-legendary {
  background: linear-gradient(120deg, var(--rarity-legendary-bg), #fbe8c4);
  color: var(--rarity-legendary-ink);
  box-shadow: var(--rarity-legendary-glow);
}
html[data-theme="dark"] .badge-rarity-legendary {
  background: linear-gradient(120deg, var(--rarity-legendary-bg), #3a2c12);
}
.badge-free { background: var(--green-soft); color: var(--green-ink); }
.badge-premium { background: var(--purple-soft); color: var(--purple-ink); }

.pill-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.2rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s var(--ease);
}
.pill-filter:hover { border-color: var(--purple); color: var(--ink); }
.pill-filter.active {
  background: var(--cta);
  border-color: var(--cta);
  color: var(--on-cta);
}
.pill-filter .count { font-size: 0.78rem; opacity: 0.7; font-weight: 700; }

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.7rem;
  border-radius: var(--r-pill);
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

/* ---------- Inputs ---------- */
.input, .search-input {
  width: 100%;
  padding: 0.85rem 1.15rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font);
  font-size: 0.95rem;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.input:focus, .search-input:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px var(--purple-glow);
}
.search-wrap { position: relative; max-width: 480px; }
.search-wrap .search-icon {
  position: absolute;
  left: 1.05rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--faint);
  pointer-events: none;
}
.search-wrap .input, .search-wrap .search-input { padding-left: 2.7rem; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(10, 10, 14, 0.45);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: modalIn 0.2s var(--ease);
}
.modal {
  width: 100%;
  max-width: 430px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-2xl);
  box-shadow: var(--sh-xl);
  padding: 1.8rem;
  position: relative;
  animation: modalPop 0.26s var(--ease-spring);
}
.modal h3 { margin: 0 0 0.5rem; font-size: 1.3rem; letter-spacing: -0.02em; color: var(--ink); }
.modal-close {
  position: absolute;
  top: 0.9rem;
  right: 1.1rem;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 0;
  background: var(--bg-soft);
  color: var(--ink);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}
.modal-close:hover { background: var(--line); }
/* Login-prompt art: constrained here (components.css) because the modal can
   open on pages that don't load app.css. Without this, the 1320×880 art
   overflows the panel and renders it blank. */
.login-prompt-art {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 28px;
  margin: 0 auto 1.1rem;
  display: block;
  box-shadow: var(--sh-md);
}
.modal-rows { margin: 1.1rem 0; }
.modal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.93rem;
}
.modal-row strong { color: var(--ink); }
.modal-actions { display: flex; gap: 0.75rem; margin-top: 1.2rem; }
.modal-actions .btn { flex: 1; }
.modal .btn { box-sizing: border-box; max-width: 100%; }
.modal-note { color: var(--muted); font-size: 0.9rem; line-height: 1.55; }
.modal-err { color: #d70015; font-size: 0.88rem; margin-top: 0.8rem; }
@keyframes modalIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalPop { from { opacity: 0; transform: translateY(12px) scale(0.97); } to { opacity: 1; transform: none; } }

/* ---------- Skeleton shimmer ---------- */
.skel, .skeleton {
  position: relative;
  overflow: hidden;
  background: var(--skel-base);
  border-radius: var(--r-md);
}
.skel::after, .skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, var(--skel-hi), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
.skel-card { border-radius: var(--r-xl); overflow: hidden; }
.skel-img { aspect-ratio: 1; border-radius: 0; }
.skel-line { height: 14px; margin: 12px 14px 0; }
.skel-line.short { width: 55%; margin-bottom: 14px; }

/* ---------- Empty state (honest: never fabricate) ---------- */
.empty-state {
  text-align: center;
  padding: 3.2rem 1.5rem;
  border: 1.5px dashed var(--line);
  border-radius: var(--r-xl);
  background: var(--surface);
}
.empty-state-art {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  margin: 0 auto 1.2rem;
  background: var(--purple-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.empty-state-art img { width: 100%; height: 100%; object-fit: cover; }
.empty-state h3 { margin: 0 0 0.5rem; font-size: 1.2rem; letter-spacing: -0.02em; color: var(--ink); }
.empty-state p { color: var(--muted); font-size: 0.95rem; margin: 0 0 1.4rem; line-height: 1.6; max-width: 380px; margin-left: auto; margin-right: auto; }

/* ---------- Horizontal carousel ---------- */
.carousel {
  display: flex;
  gap: 1.1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0.4rem 0.2rem 1.2rem;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.carousel::-webkit-scrollbar { display: none; }
.carousel-nav { display: flex; gap: 0.6rem; }
.carousel-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 1.15rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s var(--ease);
}
.carousel-btn:hover:not(:disabled) { border-color: var(--purple); color: var(--purple-ink); transform: translateY(-1px); }
.carousel-btn:disabled { opacity: 0.35; cursor: default; }

/* ---------- Section scaffolding ---------- */
.section { padding: 4.5rem 0; }
.section-inner { max-width: 1120px; margin: 0 auto; padding: 0 1.5rem; }
.section-head { max-width: 640px; margin-bottom: 2.2rem; }
.section-head h2, .section-title-2 {
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  letter-spacing: -0.03em;
  margin: 0.4rem 0 0.6rem;
  color: var(--ink);
  line-height: 1.12;
}
.section-sub { color: var(--muted); font-size: 1.05rem; line-height: 1.6; margin: 0; }
.kicker {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--purple-ink);
  margin: 0;
}
.section-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.8rem; }
.view-all a {
  color: var(--purple-ink);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.95rem;
  white-space: nowrap;
}
.view-all a:hover { text-decoration: underline; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
  margin-top: 0;
}
.site-footer .footer-inner { max-width: 1180px; margin: 0 auto; padding: 3.5rem 1.5rem 2rem; }
.footer-top {
  display: grid;
  grid-template-columns: 1.2fr 2fr;
  gap: 2.5rem;
  padding-bottom: 2.5rem;
}
.footer-brand p { color: var(--muted); margin: 0.7rem 0 0; font-size: 0.95rem; line-height: 1.6; max-width: 300px; }
.footer-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.footer-col h3 {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 0.9rem;
}
.footer-col a {
  display: block;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.93rem;
  font-weight: 500;
  padding: 0.32rem 0;
}
.footer-col a:hover { color: var(--ink); }
.footer-base {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  flex-wrap: wrap;
  padding-top: 1.6rem;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 0.82rem;
}
.footer-base a { color: var(--faint); text-decoration: none; }
.footer-base a:hover { color: var(--ink); }
.footer-affil { margin-left: auto; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 1.4rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  background: var(--ink);
  color: var(--bg);
  padding: 0.85rem 1.5rem;
  border-radius: var(--r-pill);
  font-size: 0.92rem;
  font-weight: 500;
  box-shadow: var(--sh-lg);
  max-width: min(92vw, 480px);
  text-align: center;
}
.toast[hidden] { display: none; }

/* ---------- Link-like button ---------- */
.linklike {
  background: none;
  border: 0;
  padding: 0;
  color: var(--purple-ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-actions { margin-left: auto; }
  .nav-burger { display: inline-flex; }
  #auth-link.nav-login, .nav-cta { display: none; }
  .nav-actions .theme-toggle { width: 42px; height: 42px; }
  .footer-top { grid-template-columns: 1fr; }
  .footer-links { grid-template-columns: repeat(2, 1fr); }
  .muse-card { width: 180px; }
  .section { padding: 3.2rem 0; }
}
@media (max-width: 520px) {
  .footer-links { grid-template-columns: 1fr 1fr; }
  .footer-affil { margin-left: 0; width: 100%; }
  .modal-actions { flex-direction: column; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .muse-card:hover, a.card:hover, .btn:hover, .nav-cta:hover, .coin-pill:hover { transform: none; }
  .skel::after, .skeleton::after { animation: none; }
  .nav-sheet, .modal, .modal-backdrop { animation: none; }
}

/* ============================================================
   TRACK D — MICRO-INTERACTIONS (appended 2026-10-11)
   Premium-calm motion: 200–350ms easings, transform/opacity only,
   everything honors prefers-reduced-motion. Existing rules above
   are untouched.
   ============================================================ */

/* ---------- card hover lift — fine pointers only ---------- */
@media (hover: hover) {
  .muse-card:hover, .disc-card:hover, a.card:hover, .card-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--sh-lg);
  }
  [data-tilt] { will-change: transform; }
}

/* ---------- press scaling ---------- */
.btn:active, .muse-card:active, .disc-card:active,
.pill-filter:active, .remix-pill:active {
  transform: scale(0.97);
}

/* ---------- fade-up on scroll (.reveal -> .is-visible, wired by motion.js) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- unlock / collection celebration: soft glow pulse ---------- */
@keyframes atm-glow-pulse {
  0% { box-shadow: 0 0 0 0 rgba(124, 92, 255, 0); }
  35% { box-shadow: 0 0 0 7px rgba(124, 92, 255, 0.28), var(--sh-lg); }
  100% { box-shadow: 0 0 0 0 rgba(124, 92, 255, 0); }
}
.glow-pulse { animation: atm-glow-pulse 0.9s var(--ease) 1; }

/* ---------- achievement toast ---------- */
.achv-toast {
  position: fixed;
  left: 50%;
  bottom: 5.5rem;
  transform: translate(-50%, 16px);
  opacity: 0;
  z-index: 950;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  max-width: min(92vw, 380px);
  padding: 0.9rem 1.3rem;
  border-radius: var(--r-xl, 20px);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--sh-lg);
  color: var(--ink);
  font-size: 0.92rem;
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.achv-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.achv-gem {
  flex: none;
  width: 2.2rem;
  height: 2.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(120deg, var(--rarity-legendary-bg), #ffe9a8);
  color: var(--rarity-legendary-ink);
  font-size: 1.1rem;
  box-shadow: var(--rarity-legendary-glow);
}
.achv-text { display: flex; flex-direction: column; gap: 0.1rem; line-height: 1.4; }
.achv-text strong { font-weight: 800; letter-spacing: -0.01em; }
.achv-text span { color: var(--muted); font-size: 0.85rem; }

/* ---------- floating "Remix in Studio" pill ---------- */
.remix-pill {
  position: fixed;
  left: 50%;
  bottom: max(1.2rem, env(safe-area-inset-bottom));
  transform: translate(-50%, 90px);
  opacity: 0;
  z-index: 450;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.85rem 1.7rem;
  border-radius: 999px;
  background: var(--cta);
  color: var(--on-cta);
  font-weight: 800;
  font-size: 0.95rem;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: var(--sh-lg);
  pointer-events: none;
  transition: transform 0.35s var(--ease), opacity 0.35s var(--ease);
}
.remix-pill[hidden] { display: none; }
.remix-pill.show {
  transform: translate(-50%, 0);
  opacity: 1;
  pointer-events: auto;
}

/* ---------- reduced motion: everything calms down ---------- */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .glow-pulse { animation: none; }
  .achv-toast { transition: none; }
  .remix-pill { transition: none; }
  .btn:active, .muse-card:active, .disc-card:active,
  .pill-filter:active, .remix-pill:active { transform: none; }
}
