/* ==========================================================
   mezule — public site + auth
   Palette: #00643D brand green, white text, marigold accent.
   Type: Bricolage Grotesque (display) + Figtree (body).
   ========================================================== */
:root {
  --brand: #024522;
  --brand-deep: #003d26;
  --brand-night: #002818;
  --brand-lift: #0b7c4e;
  --ink: #ffffff;
  --ink-soft: rgba(255, 255, 255, .78);
  --ink-mute: rgba(255, 255, 255, .55);
  --line: rgba(255, 255, 255, .16);
  --line-strong: rgba(255, 255, 255, .34);
  --glass: rgba(255, 255, 255, .07);
  --glass-hi: rgba(255, 255, 255, .13);
  --accent: #FFCF4A;
  --accent-hi: #FFDB78;
  --accent-ink: #123524;
  --danger: #FFA59B;
  --ok: #9BF0C4;
  --font-display: 'Bricolage Grotesque', 'Trebuchet MS', system-ui, sans-serif;
  --font-body: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --nav-h: 68px;
  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 12px);
  -webkit-text-size-adjust: 100%;
}
html.no-scroll { overflow: hidden; }
body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--brand);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
}
/* soft depth behind everything, still reads as #00643D */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(900px 620px at 88% -8%, rgba(255, 207, 74, .14), transparent 62%),
    radial-gradient(760px 640px at -8% 34%, rgba(0, 28, 17, .5), transparent 62%),
    radial-gradient(820px 700px at 104% 92%, rgba(0, 32, 19, .55), transparent 62%),
    var(--brand);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
ul { list-style: none; padding: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; }
.skip {
  position: fixed; left: 12px; top: -60px; z-index: 200;
  background: var(--accent); color: var(--accent-ink);
  padding: 10px 16px; border-radius: 10px; font-weight: 600; text-decoration: none;
  transition: top .2s;
}
.skip:focus { top: 12px; }

/* icons (Google Material Symbols Rounded) */
.ms {
  font-family: 'Material Symbols Rounded';
  font-weight: normal; font-style: normal;
  font-size: 24px; line-height: 1; letter-spacing: normal; text-transform: none;
  display: inline-block; white-space: nowrap; direction: ltr; flex: none;
  width: 1em; height: 1em; overflow: hidden; /* keeps layout stable if the icon font is slow */
  -webkit-font-smoothing: antialiased; user-select: none;
  font-variation-settings: 'FILL' 0, 'wght' 450, 'GRAD' 0, 'opsz' 24;
}
.ms.fill { font-variation-settings: 'FILL' 1, 'wght' 450, 'GRAD' 0, 'opsz' 24; }

/* ---------- buttons ---------- */
.btn {
  --h: 50px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: var(--h); padding: 0 26px;
  border-radius: 999px; border: 1.5px solid transparent;
  font-weight: 650; font-size: 1rem; line-height: 1;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .15s, background-color .2s, color .2s, border-color .2s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hi); }
.btn-outline { border-color: rgba(255, 255, 255, .6); color: #fff; background: transparent; }
.btn-outline:hover { background: #fff; color: var(--brand-deep); }
.btn-ghost { color: var(--ink-soft); background: transparent; }
.btn-ghost:hover { background: var(--glass); color: #fff; }
.btn-sm { --h: 40px; padding: 0 18px; font-size: .94rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .65; cursor: not-allowed; }
.btn.loading { pointer-events: none; }
.btn.loading::after {
  content: ""; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 46px; height: 46px; flex: none;
  border-radius: 14px; border: 1.5px solid var(--line-strong);
  background: transparent; color: #fff; text-decoration: none; cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s, transform .15s;
}
.icon-btn:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.icon-btn:active { transform: scale(.94); }

/* ---------- navbar ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--nav-h);
  border-bottom: 1px solid transparent;
  transition: background-color .3s, border-color .3s, backdrop-filter .3s;
}
.nav.scrolled {
  background: rgba(0, 54, 33, .74);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  backdrop-filter: blur(16px) saturate(1.3);
  border-color: var(--line);
}
.nav-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.logo {
  display: inline-flex; align-items: center; gap: 3px;
  font-family: var(--font-display); font-weight: 800; font-size: 1.7rem;
  letter-spacing: -.045em; color: #fff; text-decoration: none; line-height: 1;
}
.logo .dot { width: .38em; height: .38em; margin-top: .45em; border-radius: 50%; background: var(--accent); }
.nav-links {
  display: flex; gap: 4px; padding: 5px;
  border-radius: 999px; background: var(--glass); border: 1px solid var(--line);
}
.nav-links a {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; min-width: 40px; padding: 0 10px;
  border-radius: 999px; color: var(--ink-soft);
  font-weight: 600; font-size: .92rem; text-decoration: none;
  transition: background-color .2s, color .2s;
}
.nav-links a:hover { background: var(--glass-hi); color: #fff; }
.nav-links a.active { background: var(--accent); color: var(--accent-ink); }
.nav-links .ms { font-size: 22px; }
.nav-links .lbl { display: none; }
@media (min-width: 780px) {
  .nav-links a { padding: 0 16px; }
  .nav-links .lbl { display: inline; }
}
.nav-auth { position: relative; display: flex; align-items: center; }
@media (max-width: 400px) {
  .logo { font-size: 1.45rem; }
  .nav-links a { min-width: 36px; height: 36px; padding: 0 8px; }
  .nav-auth .btn-sm { --h: 36px; padding: 0 14px; font-size: .88rem; }
}

.avatar {
  width: 42px; height: 42px; border-radius: 50%; border: 1.5px solid var(--line-strong);
  background: var(--accent); color: var(--accent-ink);
  font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; cursor: pointer;
}
.user-menu {
  position: absolute; right: 0; top: calc(100% + 10px); width: min(260px, 86vw);
  background: var(--brand-night); border: 1px solid var(--line); border-radius: 18px;
  padding: 8px; box-shadow: 0 20px 50px rgba(0, 0, 0, .4);
}
.user-menu[hidden] { display: none; }
.um-head { display: grid; padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; min-width: 0; }
.um-head strong, .um-head span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.um-head span { font-size: .85rem; color: var(--ink-mute); }
.user-menu a, .user-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 11px 12px; border: 0; border-radius: 12px; background: none;
  color: var(--ink-soft); text-decoration: none; font-weight: 550; cursor: pointer; text-align: left;
}
.user-menu a:hover, .user-menu button:hover { background: var(--glass-hi); color: #fff; }

/* ---------- hero ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: min(100svh, 880px);
  display: grid; place-items: center; text-align: center;
  padding: calc(var(--nav-h) + 36px) 0 clamp(120px, 18vw, 190px);
}
.hero h1 {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(2.8rem, 10.5vw, 6.6rem);
  line-height: .96; letter-spacing: -.05em; text-wrap: balance;
}
.hero-lead {
  margin-top: clamp(14px, 2.4vw, 24px);
  font-family: var(--font-display); font-weight: 650;
  font-size: clamp(1.4rem, 4.4vw, 2.4rem); letter-spacing: -.03em; color: var(--accent);
}
.hero-sub { max-width: 32ch; margin: 12px auto 0; color: var(--ink-soft); font-size: clamp(1rem, 2.4vw, 1.18rem); text-wrap: balance; }
.hero .btn { margin-top: clamp(26px, 4vw, 38px); --h: 54px; padding: 0 32px; }
.wave {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: -1; height: clamp(120px, 20vw, 210px);
  display: flex; align-items: flex-end; justify-content: center; gap: clamp(3px, .7vw, 8px);
  padding-inline: 8px; overflow: hidden;
  -webkit-mask-image: linear-gradient(to top, #000 10%, transparent);
  mask-image: linear-gradient(to top, #000 10%, transparent);
}
.wave i {
  flex: 0 1 clamp(3px, .8vw, 9px); height: var(--h); border-radius: 99px;
  background: linear-gradient(to top, rgba(255, 207, 74, .75), rgba(255, 207, 74, .08));
  transform-origin: bottom; transform: scaleY(.4);
  animation: bar 1.5s ease-in-out infinite alternate; animation-delay: var(--d);
}
@keyframes bar { to { transform: scaleY(1); } }

/* ---------- sections ---------- */
.section { padding: clamp(52px, 8vw, 104px) 0; }
.section + .section { padding-top: 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: clamp(18px, 3vw, 30px); }
.section-head h2, .page-head h1 {
  font-family: var(--font-display); font-weight: 800; letter-spacing: -.04em; line-height: 1.05;
}
.section-head h2 { font-size: clamp(1.8rem, 5vw, 2.8rem); }
.see-all {
  margin-left: auto; flex: none; padding: 6px 2px;
  font-weight: 650; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px;
  text-decoration-color: var(--accent); transition: color .2s;
}
.see-all:hover { color: var(--accent); }

/* information */
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); gap: 14px; align-items: start; }
.info-item {
  min-width: 0; padding: 22px 22px 20px; border-radius: 26px;
  background: var(--glass); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 10px;
}
.info-item h3 { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; overflow-wrap: anywhere; }
.info-item .idx { color: var(--accent); margin-right: 8px; }
.info-body { color: var(--ink-soft); overflow-wrap: anywhere; word-break: break-word; hyphens: auto; white-space: pre-line; }
.info-body.clamp { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; line-clamp: 5; overflow: hidden; }
.more {
  align-self: flex-start; padding: 4px 0; border: 0; background: none; cursor: pointer;
  color: var(--accent); font-weight: 650; text-decoration: underline; text-underline-offset: 4px;
}
.more[hidden] { display: none; }
.info-skel { height: 150px; border-radius: 26px; }

/* beats list + cards */
.beat-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 12px; }
.beat-card {
  position: relative; min-width: 0;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px;
  padding: 10px 12px 10px 10px; border-radius: 26px;
  background: var(--glass); border: 1px solid var(--line);
  transition: border-color .2s, background-color .2s;
}
.beat-card:not(.skel):hover { border-color: var(--line-strong); background: var(--glass-hi); }
.beat-card.is-current { border-color: var(--accent); background: rgba(255, 207, 74, .1); }
.card-open { position: absolute; inset: 0; z-index: 1; border: 0; background: none; border-radius: inherit; cursor: pointer; }
.thumb {
  position: relative; z-index: 2; width: 66px; height: 66px; border-radius: 18px; overflow: hidden; flex: none;
}
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .4s; }
.thumb img.loaded { opacity: 1; }
.thumb-play {
  position: absolute; inset: 0; display: grid; place-items: center; border: 0; cursor: pointer;
  background: rgba(0, 24, 14, .22); color: #fff; transition: background-color .2s;
}
.thumb-play:hover { background: rgba(0, 24, 14, .46); }
.thumb-play .ms { font-size: 30px; filter: drop-shadow(0 1px 4px rgba(0, 0, 0, .35)); }
.eq { position: absolute; right: 6px; bottom: 6px; display: none; align-items: flex-end; gap: 2px; height: 12px; pointer-events: none; }
.eq i { width: 3px; height: 100%; background: #fff; border-radius: 2px; transform-origin: bottom; animation: eq .9s ease-in-out infinite alternate; }
.eq i:nth-child(2) { animation-delay: .25s; }
.eq i:nth-child(3) { animation-delay: .5s; }
@keyframes eq { from { transform: scaleY(.25); } to { transform: scaleY(1); } }
.beat-card.is-playing .eq { display: flex; }
.meta { min-width: 0; }
.meta h3 { font-family: var(--font-display); font-weight: 700; font-size: 1.08rem; letter-spacing: -.02em; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta p { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.meta p span, .dlg-text p span {
  font-size: .8rem; font-weight: 600; color: var(--ink-soft);
  padding: 2px 10px; border-radius: 99px; background: rgba(255, 255, 255, .1);
  white-space: nowrap;
}
.beat-card .buy-btn { position: relative; z-index: 2; }

.skeleton { background: linear-gradient(100deg, rgba(255, 255, 255, .06) 30%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .06) 70%); background-size: 220% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -220% 0; } }
.beat-card.skel .meta { display: grid; gap: 10px; }
.skeleton.line { height: 12px; border-radius: 6px; display: block; }
.skeleton.w60 { width: 60%; } .skeleton.w40 { width: 40%; }
.skeleton.sq { width: 46px; height: 46px; border-radius: 14px; }

.state { display: grid; justify-items: center; gap: 12px; text-align: center; padding: 44px 20px; border: 1.5px dashed var(--line-strong); border-radius: 26px; color: var(--ink-soft); }
.state[hidden] { display: none; }
.state .ms { font-size: 40px; color: var(--accent); }
.state p { max-width: 36ch; }

/* contact */
.contact-card {
  display: grid; gap: 22px; padding: clamp(20px, 4vw, 34px); border-radius: 30px;
  background: var(--glass); border: 1px solid var(--line);
  grid-template-columns: minmax(0, 1fr) auto; align-items: center;
}
.contact-mail { display: flex; align-items: center; gap: 16px; text-decoration: none; min-width: 0; }
.contact-mail > .ms:first-child { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 18px; background: var(--accent); color: var(--accent-ink); font-size: 26px; flex: none; }
.cm-text { display: grid; min-width: 0; }
.cm-text small { color: var(--ink-mute); font-size: .85rem; }
.cm-text strong { font-family: var(--font-display); font-size: clamp(1.05rem, 3.4vw, 1.6rem); font-weight: 700; letter-spacing: -.02em; overflow-wrap: anywhere; }
.cm-go { margin-left: 4px; color: var(--ink-mute); transition: color .2s, transform .2s; }
.contact-mail:hover .cm-go { color: var(--accent); transform: translate(2px, -2px); }
.socials { display: flex; gap: 10px; }
.socials a { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 16px; border: 1.5px solid var(--line-strong); font-size: 1.2rem; text-decoration: none; transition: background-color .2s, color .2s, border-color .2s; }
.socials a:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
@media (max-width: 640px) {
  .contact-card { grid-template-columns: 1fr; }
  .socials { justify-content: flex-start; }
}
.footer { padding: 18px 0 40px; text-align: center; color: var(--ink-mute); font-size: .9rem; }

/* ---------- catalog ---------- */
.page { padding: calc(var(--nav-h) + clamp(28px, 6vw, 64px)) 0 clamp(40px, 6vw, 72px); min-height: 80vh; }
.page-head { margin-bottom: 26px; }
.page-head h1 { font-size: clamp(2.6rem, 9vw, 5rem); }
.page-sub { margin-top: 10px; color: var(--ink-soft); }
.toolbar { display: grid; grid-template-columns: minmax(0, 1fr) repeat(4, 150px); gap: 10px; margin-bottom: 22px; }
.search, .select { position: relative; display: block; }
.search .ms, .select .ms { position: absolute; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--ink-mute); }
.search .ms { left: 16px; }
.select .ms { right: 12px; }
.toolbar input, .toolbar select {
  width: 100%; height: 50px; border-radius: 16px; border: 1.5px solid var(--line);
  background: var(--glass); color: #fff; font: inherit; padding: 0 16px;
  appearance: none; -webkit-appearance: none;
}
.toolbar input { padding-left: 48px; }
.toolbar select { padding-right: 40px; cursor: pointer; }
.toolbar select option { color: #10261b; }
.toolbar input::placeholder { color: var(--ink-mute); }
.toolbar input:focus, .toolbar select:focus { border-color: var(--accent); outline: none; }
.load-more { display: grid; place-items: center; margin-top: 28px; }
.load-more [hidden] { display: none; }
@media (max-width: 1060px) { .toolbar { grid-template-columns: repeat(4, minmax(0, 1fr)); } .search { grid-column: 1 / -1; } }
@media (max-width: 640px) { .toolbar { grid-template-columns: 1fr 1fr; } }
.select[hidden] { display: none; }

/* ---------- dialog ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px;
  background: rgba(22, 26, 24, .5);
  -webkit-backdrop-filter: blur(14px) grayscale(.7); backdrop-filter: blur(14px) grayscale(.7);
  opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s;
}
.overlay.open { opacity: 1; visibility: visible; }
.dialog {
  position: relative; width: min(100%, 380px); max-height: calc(100dvh - 32px); overflow-y: auto;
  padding: 16px 16px 22px; border-radius: 34px;
  background: linear-gradient(165deg, #0a7a4c 0%, #004a2d 75%);
  border: 1px solid rgba(255, 255, 255, .2);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
  transform: translateY(18px) scale(.97); transition: transform .3s cubic-bezier(.2, .8, .2, 1);
  outline: none; scrollbar-width: none;
}
.dialog::-webkit-scrollbar { display: none; }
.overlay.open .dialog { transform: none; }
.dlg-close {
  position: absolute; top: 24px; right: 24px; z-index: 3; width: 38px; height: 38px; display: grid; place-items: center;
  border: 0; border-radius: 50%; cursor: pointer; color: #fff;
  background: rgba(0, 24, 14, .45); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.dlg-close:hover { background: rgba(0, 24, 14, .7); }
.dlg-art {
  position: relative; overflow: hidden; aspect-ratio: 1; margin-inline: auto;
  width: min(100%, max(150px, calc(100dvh - 330px)));
  border-radius: 26px;
}
.dlg-art img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .4s; }
.dlg-art img.loaded { opacity: 1; }
.dlg-art.playing img { animation: breathe 5s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.07); } }
.dlg-info { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; padding-inline: 4px; }
.dlg-text { min-width: 0; }
.dlg-text h3 { font-family: var(--font-display); font-weight: 750; font-size: 1.3rem; letter-spacing: -.03em; line-height: 1.2; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.dlg-text p { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.dlg-seek { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; margin-top: 16px; padding-inline: 4px; font-size: .78rem; color: var(--ink-mute); font-variant-numeric: tabular-nums; }
.dlg-seek input { --p: 0%; width: 100%; height: 18px; background: none; appearance: none; -webkit-appearance: none; cursor: pointer; }
.dlg-seek input::-webkit-slider-runnable-track { height: 5px; border-radius: 5px; background: linear-gradient(to right, var(--accent) var(--p), rgba(255, 255, 255, .2) var(--p)); }
.dlg-seek input::-moz-range-track { height: 5px; border-radius: 5px; background: rgba(255, 255, 255, .2); }
.dlg-seek input::-moz-range-progress { height: 5px; border-radius: 5px; background: var(--accent); }
.dlg-seek input::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -4.5px; border-radius: 50%; background: #fff; border: 0; }
.dlg-seek input::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 0; }
.dlg-controls { display: flex; align-items: center; justify-content: center; gap: clamp(18px, 7vw, 32px); margin-top: 12px; }
.ctl { width: 52px; height: 52px; display: grid; place-items: center; border: 0; border-radius: 50%; background: none; color: #fff; cursor: pointer; transition: background-color .2s, transform .15s; }
.ctl:hover { background: var(--glass-hi); }
.ctl:active { transform: scale(.92); }
.ctl .ms { font-size: 32px; }
.ctl-play { width: 70px; height: 70px; background: var(--accent); color: var(--accent-ink); }
.ctl-play:hover { background: var(--accent-hi); }
.ctl-play .ms { font-size: 38px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); z-index: 300;
  max-width: min(92vw, 420px); padding: 13px 20px; border-radius: 16px;
  background: var(--brand-night); color: #fff; border: 1px solid var(--line-strong);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .35); font-size: .94rem; text-align: center;
  transform: translate(-50%, 24px); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast[data-type="error"] { border-color: var(--danger); }

/* ---------- auth ---------- */
.auth { min-height: 100svh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-art {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
  padding: clamp(24px, 4.5vw, 56px) clamp(24px, 5vw, 64px);
  background: linear-gradient(160deg, #037a4c 0%, #003d26 100%);
}
.auth-art .wave { height: 46%; opacity: .9; }
.auth-art-copy h2 { font-family: var(--font-display); font-weight: 800; font-size: clamp(2.2rem, 5vw, 4rem); line-height: 1; letter-spacing: -.045em; text-wrap: balance; }
.auth-art-copy p { margin-top: 14px; color: var(--ink-soft); font-size: 1.1rem; max-width: 30ch; }
.auth-panel { display: grid; place-items: center; padding: clamp(28px, 5vw, 64px) var(--gutter); }
.auth-card { width: min(100%, 420px); }
.auth-card h1 { font-family: var(--font-display); font-weight: 800; font-size: clamp(2rem, 5vw, 2.7rem); letter-spacing: -.045em; line-height: 1.05; }
.auth-sub { margin: 8px 0 22px; color: var(--ink-soft); }
.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 8px; font-weight: 600; font-size: .94rem; }
.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.label-row label { margin-bottom: 8px; }
.link-btn { border: 0; background: none; cursor: pointer; color: var(--accent); font-size: .9rem; font-weight: 600; padding: 0; text-decoration: underline; text-underline-offset: 4px; }
.input { position: relative; }
.input > .ms { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-mute); font-size: 22px; pointer-events: none; }
.input input {
  width: 100%; height: 52px; padding: 0 48px 0 46px; border-radius: 16px;
  border: 1.5px solid var(--line); background: var(--glass); color: #fff; font: inherit;
  transition: border-color .2s, background-color .2s;
}
.input input::placeholder { color: var(--ink-mute); }
.input input:focus { outline: none; border-color: var(--accent); background: var(--glass-hi); }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; display: grid; place-items: center; border: 0; background: none; border-radius: 12px; color: var(--ink-mute); cursor: pointer; }
.pw-toggle:hover { color: #fff; background: var(--glass); }
.strength { display: flex; gap: 6px; margin-top: 10px; }
.strength i { flex: 1; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .16); transition: background-color .25s; }
.strength i.on.s1 { background: #FF8A7A; } .strength i.on.s2 { background: #FFB45A; }
.strength i.on.s3 { background: var(--accent); } .strength i.on.s4 { background: var(--ok); }
.hint { display: block; min-height: 1.2em; margin-top: 6px; color: var(--ink-mute); font-size: .82rem; }
.form-msg { margin-bottom: 18px; padding: 12px 14px; border-radius: 14px; font-size: .94rem; border: 1px solid var(--line-strong); background: var(--glass); }
.form-msg[hidden] { display: none; }
.form-msg[data-type="error"] { border-color: var(--danger); color: var(--danger); background: rgba(255, 130, 110, .1); }
.form-msg[data-type="success"] { border-color: var(--ok); color: var(--ok); background: rgba(155, 240, 196, .1); }
.auth-card form[hidden], #google-wrap[hidden] { display: none; }
.auth-card .btn { margin-top: 6px; }
.divider { display: flex; align-items: center; gap: 14px; margin: 20px 0 14px; color: var(--ink-mute); font-size: .9rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-switch { margin-top: 24px; text-align: center; color: var(--ink-soft); }
.auth-switch a { color: var(--accent); font-weight: 650; text-underline-offset: 4px; }

@media (max-width: 880px) {
  .auth { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .auth-art { gap: 14px; padding: 22px 24px 26px; }
  .auth-art .wave { height: 100%; opacity: .5; }
  .auth-art-copy h2 { font-size: 2rem; }
  .auth-art-copy p { margin-top: 6px; font-size: 1rem; }
  .auth-panel { align-items: start; padding-top: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ==========================================================
   Store: buy button, checkout, order, terms
   ========================================================== */
.nav-cell { display: none; }
.buy-btn { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.buy-btn:hover { background: var(--accent-hi); border-color: var(--accent-hi); }
.meta p span.price, .dlg-text p span.price { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.footer a { color: inherit; text-underline-offset: 4px; margin-left: 10px; }
.footer a:hover { color: var(--accent); }

.wrap.narrow { width: min(920px, 100% - 2 * var(--gutter)); }
.back-link { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 18px; color: var(--ink-soft); text-decoration: none; font-weight: 600; }
.back-link:hover { color: #fff; }
.back-link .ms { font-size: 20px; }

.checkout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.checkout[hidden] { display: none; }
.summary, .pay-form, .order-card, .prose {
  border-radius: 28px; background: var(--glass); border: 1px solid var(--line); padding: clamp(18px, 3vw, 28px);
}
.summary { display: grid; gap: 18px; }
.sum-art { aspect-ratio: 1; border-radius: 22px; overflow: hidden; width: min(100%, 320px); margin-inline: auto; }
.sum-art img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .4s; }
.sum-art img.loaded { opacity: 1; }
.summary h2, .pay-form h2 { font-family: var(--font-display); font-size: 1.5rem; font-weight: 750; letter-spacing: -.03em; line-height: 1.2; overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chips span { font-size: .8rem; font-weight: 600; color: var(--ink-soft); padding: 2px 10px; border-radius: 99px; background: rgba(255, 255, 255, .1); }
.sum-lines { display: grid; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.sum-lines > div { display: flex; justify-content: space-between; gap: 12px; }
.sum-lines dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; }
.sum-lines .total { font-family: var(--font-display); font-size: 1.3rem; font-weight: 800; }
.sum-note, .pay-note, .order-note { display: flex; gap: 8px; align-items: flex-start; margin-top: 14px; color: var(--ink-mute); font-size: .88rem; }
.sum-note .ms, .order-note .ms { font-size: 20px; color: var(--accent); }
.pay-form { display: grid; gap: 4px; }
.pay-form h2 { margin-bottom: 12px; }
.pay-form .btn { margin-top: 12px; }
.pay-form .check { margin-top: 4px; }
.pay-form .check a, .prose a { color: var(--accent); }
.pay-note { margin-top: 12px; }
.check { display: inline-flex; align-items: flex-start; gap: 10px; cursor: pointer; font-weight: 500; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); flex: none; }
@media (max-width: 760px) { .checkout { grid-template-columns: 1fr; } }

.order-card { display: grid; justify-items: center; gap: 12px; text-align: center; padding: clamp(28px, 6vw, 56px) clamp(18px, 4vw, 40px); }
.order-card h1 { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.8rem, 5vw, 2.8rem); letter-spacing: -.04em; line-height: 1.05; }
.order-sub { color: var(--ink-soft); max-width: 44ch; }
.status-ico .ms { font-size: 64px; }
.status-ico.ok .ms { color: var(--ok); } .status-ico.bad .ms { color: var(--danger); } .status-ico.warn .ms { color: var(--accent); }
.receipt { display: grid; gap: 10px; width: min(100%, 440px); margin: 10px 0; padding: 16px 18px; border-radius: 20px; background: rgba(0, 0, 0, .16); text-align: left; }
.receipt > div { display: flex; justify-content: space-between; gap: 16px; }
.receipt dt { color: var(--ink-mute); flex: none; }
.receipt dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; min-width: 0; }
.mono { font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace; font-size: .86em; }
.order-ref { color: var(--ink-mute); overflow-wrap: anywhere; }
.dl-list { display: grid; gap: 10px; width: min(100%, 440px); }
.order-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.empty-note { color: var(--ink-mute); }
.order-note { justify-content: center; text-align: left; max-width: 44ch; }

.prose { display: grid; gap: 8px; }
.prose h2 { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; letter-spacing: -.02em; margin-top: 10px; }
.prose p { color: var(--ink-soft); }
.private-note { display: flex; gap: 8px; align-items: center; color: var(--ink-mute); font-size: .84rem; }
.private-note .ms { font-size: 18px; }
.spinner { width: 38px; height: 38px; border-radius: 50%; border: 3px solid var(--line-strong); border-top-color: var(--accent); animation: spin .8s linear infinite; }

/* ---------- sold beats: still listenable, not buyable ---------- */
.beat-card.is-sold .thumb img { filter: grayscale(.85); }
.sold-tag {
  position: absolute; left: 0; top: 0; z-index: 1; padding: 2px 8px; pointer-events: none;
  background: #fff; color: #123524; font-size: .62rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
}
.buy-btn.is-sold, .buy-btn.is-sold:hover {
  background: transparent; border-color: var(--line-strong); color: var(--ink-mute); cursor: not-allowed;
}
.meta p span.price, .dlg-text p span.price { transition: none; }

/* ==========================================================
   Cart
   ========================================================== */
.nav-right { display: flex; align-items: center; gap: 10px; }
.cart-link {
  position: relative; display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--glass); color: #fff; text-decoration: none;
  transition: background-color .2s;
}
.cart-link:hover { background: var(--glass-hi); }
.cart-count {
  position: absolute; top: -5px; right: -5px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px;
  display: grid; place-items: center; background: var(--accent); color: var(--accent-ink);
  font-size: .72rem; font-weight: 800; line-height: 1;
}
.cart-count[hidden] { display: none; }
.login-ico { display: none; }
@media (max-width: 520px) {
  .nav-inner { gap: 8px; }
  .nav-right { gap: 8px; }
  .cart-link { width: 38px; height: 38px; }
  .nav-auth .login-btn { width: 38px; height: 38px; padding: 0; border-radius: 50%; --h: 38px; }
  .login-txt { display: none; }
  .login-ico { display: inline-block; font-size: 22px; }
}

.buy-btn.in-cart, .buy-btn.in-cart:hover { background: #fff; border-color: #fff; color: var(--brand-deep); }
.cart-btn { font: inherit; }

.toast.has-action { pointer-events: auto; display: flex; align-items: center; gap: 16px; text-align: left; }
.toast-action { color: var(--accent); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }

.muted { color: var(--ink-mute); }
.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.cart-layout[hidden] { display: none; }
.cart-list { display: grid; gap: 10px; }
.cart-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 6px 14px;
  padding: 10px 12px 10px 10px; border-radius: 22px; background: var(--glass); border: 1px solid var(--line);
}
.cart-thumb { position: relative; width: 60px; height: 60px; border-radius: 16px; overflow: hidden; }
.cart-thumb img, .sum-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .4s; }
.cart-thumb img.loaded, .sum-thumb img.loaded { opacity: 1; }
.cart-info { min-width: 0; }
.cart-info h3 { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; letter-spacing: -.02em; line-height: 1.25; overflow-wrap: anywhere; }
.cart-info .chips { margin-top: 6px; }
.cart-price { font-weight: 700; font-variant-numeric: tabular-nums; }
.cart-row .mini {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; border: 1.5px solid var(--line);
  background: transparent; color: #fff; cursor: pointer; transition: background-color .2s, border-color .2s, color .2s;
}
.cart-row .mini:hover { background: rgba(255, 130, 110, .18); border-color: var(--danger); color: var(--danger); }
.cart-summary { position: sticky; top: calc(var(--nav-h) + 16px); gap: 12px; }
.cart-summary h2 { font-family: var(--font-display); font-size: 1.4rem; font-weight: 750; letter-spacing: -.03em; }
.cart-summary .sum-lines { margin-top: 0; }
@media (max-width: 800px) {
  .cart-layout { grid-template-columns: 1fr; }
  .cart-summary { position: static; }
  .cart-row { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "thumb info remove" "thumb price remove"; }
  .cart-thumb { grid-area: thumb; } .cart-info { grid-area: info; } .cart-price { grid-area: price; } .cart-row .mini { grid-area: remove; }
}

.sum-items { display: grid; gap: 12px; }
.sum-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.sum-thumb { position: relative; width: 48px; height: 48px; border-radius: 12px; overflow: hidden; }
.sum-meta { display: grid; min-width: 0; }
.sum-meta strong { overflow-wrap: anywhere; line-height: 1.25; }
.sum-meta span { color: var(--ink-mute); font-size: .84rem; }
.sum-each { font-weight: 650; font-variant-numeric: tabular-nums; }

.dl-items { display: grid; gap: 10px; width: min(100%, 520px); margin: 6px 0; }
.dl-item { display: flex; align-items: center; justify-content: space-between; gap: 10px 14px; flex-wrap: wrap; padding: 12px 14px; border-radius: 18px; background: rgba(0, 0, 0, .16); text-align: left; }
.dl-item strong { overflow-wrap: anywhere; min-width: 0; }
.dl-files { display: flex; gap: 8px; flex-wrap: wrap; }

/* ==========================================================
   Categories (home) + genre labels + pay-in choice
   ========================================================== */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 14px; padding: 0; list-style: none; }
.cat-grid > li { min-width: 0; }
.cat-tile {
  position: relative; isolation: isolate; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px;
  min-height: 190px; padding: 20px 22px; border-radius: 28px; overflow: hidden;
  color: #fff; text-decoration: none; border: 1px solid rgba(255, 255, 255, .22);
  transition: transform .25s ease, box-shadow .25s ease;
}
.cat-tile::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgba(0, 24, 14, .62), rgba(0, 24, 14, 0) 62%); }
.cat-name { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.5rem, 4vw, 2rem); letter-spacing: -.03em; line-height: 1.05; overflow-wrap: anywhere; text-shadow: 0 1px 12px rgba(0, 0, 0, .25); }
.cat-count { font-weight: 600; font-size: .92rem; color: rgba(255, 255, 255, .92); }
.cat-go {
  position: absolute; top: 16px; right: 16px; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; background: #fff; color: var(--brand-deep);
  transition: transform .25s ease, background-color .25s ease;
}
.cat-tile:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .55); }
.cat-tile:hover .cat-go { transform: translate(2px, -2px); background: var(--accent); }
.cat-tile:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.cat-tile.skeleton { display: block; border-radius: 28px; }
@media (prefers-reduced-motion: reduce) {
  .cat-tile, .cat-go { transition: none; }
  .cat-tile:hover { transform: none; }
}

.meta p.meta-genres { display: block; margin-top: 6px; font-size: .78rem; font-weight: 600; color: var(--ink-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dlg-text p.dlg-genres[hidden] { display: none; }
.dlg-text p.dlg-genres span { background: transparent; border: 1px solid var(--line-strong); }

.pay-options { display: grid; gap: 10px; margin: 6px 0 10px; padding: 0; border: 0; min-width: 0; }
.pay-options[hidden] { display: none; }
.pay-options legend { padding: 0; margin-bottom: 10px; font-weight: 650; }
.pay-opts { display: grid; gap: 10px; }
.pay-opt {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 18px; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--glass); transition: border-color .2s, background-color .2s;
}
.pay-opt input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }
.pay-opt.sel { border-color: var(--accent); background: rgba(255, 207, 74, .1); }
.po-main { display: grid; min-width: 0; }
.po-main strong { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.po-main small { color: var(--ink-mute); font-size: .82rem; }
.po-cur { margin-left: auto; padding-left: 8px; font-weight: 800; letter-spacing: .05em; font-size: .85rem; color: var(--ink-soft); }
