/* MaxTerize music theme: loaded after each page's inline styles, so it wins. */
:root {
  --bg: #07060e;
  --card: rgba(24, 20, 44, .62);
  --text: #f1eeff;
  --muted: #9a94bd;
  --accent: #8b5cff;
  --accent2: #ff3fa4;
  --accent3: #28d7ff;
  --line: rgba(160, 130, 255, .22);
}

html { background: var(--bg); }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}
/* glow sits in its own fixed layer: 'background-attachment: fixed' renders as a solid blob on iPhones */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 500px at 12% -8%, rgba(139, 92, 255, .38), transparent 60%),
    radial-gradient(800px 520px at 100% 8%, rgba(255, 63, 164, .22), transparent 60%),
    radial-gradient(900px 600px at 50% 115%, rgba(40, 215, 255, .14), transparent 60%);
}

/* animated equalizer drifting along the bottom of every page */
#eq { position: fixed; left: 0; right: 0; bottom: 0; width: 100%; height: 38vh; z-index: 0; pointer-events: none; opacity: .5; }
main { position: relative; z-index: 1; max-width: 640px; }

/* header */
.brand { text-align: center; padding: 18px 0 6px; }
h1 {
  font-size: clamp(2.3rem, 9vw, 3.4rem); margin: 0; text-align: center; letter-spacing: 1px;
  text-shadow: 0 0 28px rgba(139, 92, 255, .55);
}
h1 .ter {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: none; filter: drop-shadow(0 0 14px rgba(255, 63, 164, .45));
}
p.sub { text-align: center; max-width: 30em; margin: 10px auto 18px; font-size: 1.02rem; line-height: 1.5; }
.pill-row { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.pill {
  font-size: .78rem; letter-spacing: .4px; padding: 6px 12px; border-radius: 999px;
  color: var(--text); background: rgba(139, 92, 255, .14); border: 1px solid var(--line);
}

/* nav as a segmented control */
.nav { display: flex; justify-content: center; gap: 6px; margin: 0 auto 22px; font-size: .95rem; }
.nav a {
  margin: 0; padding: 8px 18px; border-radius: 999px; text-decoration: none;
  color: var(--muted); border: 1px solid transparent; transition: .2s;
}
.nav a:hover { color: var(--text); }
.nav a.on { color: #fff; background: linear-gradient(90deg, rgba(139, 92, 255, .5), rgba(255, 63, 164, .4)); border-color: var(--line); box-shadow: 0 0 18px rgba(139, 92, 255, .35); }
.nav > span { display: contents; }
.nav .dot { display: none; }

/* glass cards */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .05);
}

/* inputs */
.ref input, .title input, .opts select, .stem select {
  background: rgba(10, 8, 24, .7); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px; transition: border-color .2s, box-shadow .2s;
}
.ref input:focus, .title input:focus, .opts select:focus, .stem select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139, 92, 255, .25);
}
.stem { background: rgba(10, 8, 24, .55); border: 1px solid var(--line); }

/* drop zone */
.drop {
  border: 2px dashed rgba(139, 92, 255, .5); border-radius: 16px; padding: 34px 16px;
  background: linear-gradient(180deg, rgba(139, 92, 255, .08), rgba(255, 63, 164, .05));
  color: var(--text); transition: .25s;
}
.drop:hover, .drop.over { border-color: var(--accent2); box-shadow: 0 0 30px rgba(255, 63, 164, .25); transform: translateY(-1px); }
.drop .bars { display: flex; justify-content: center; align-items: flex-end; gap: 4px; height: 34px; margin-bottom: 10px; }
.drop .bars i { width: 5px; border-radius: 3px; background: linear-gradient(180deg, var(--accent2), var(--accent)); animation: bounce 1.1s ease-in-out infinite; }
.drop .bars i:nth-child(1) { animation-delay: -.9s; } .drop .bars i:nth-child(2) { animation-delay: -.6s; }
.drop .bars i:nth-child(3) { animation-delay: -.3s; } .drop .bars i:nth-child(4) { animation-delay: -.75s; }
.drop .bars i:nth-child(5) { animation-delay: -.45s; } .drop .bars i:nth-child(6) { animation-delay: -.15s; }
.drop .bars i:nth-child(7) { animation-delay: -.8s; }
@keyframes bounce { 0%, 100% { height: 6px; } 50% { height: 34px; } }

/* buttons */
button {
  background: linear-gradient(90deg, var(--accent), var(--accent2)); color: #fff; font-weight: 600;
  border: 0; border-radius: 12px; padding: 13px 20px; letter-spacing: .2px;
  box-shadow: 0 6px 22px rgba(139, 92, 255, .4); transition: transform .15s, box-shadow .15s, filter .15s;
}
button:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.08); box-shadow: 0 8px 28px rgba(255, 63, 164, .4); }
button.ghost { background: rgba(139, 92, 255, .14); border: 1px solid var(--line); box-shadow: none; color: var(--muted); }
.ab button.on { background: linear-gradient(90deg, var(--accent), var(--accent2)); color: #fff; border-color: transparent; box-shadow: 0 6px 22px rgba(139, 92, 255, .4); }
#buy, #go { width: 100%; }

audio { width: 100%; color-scheme: dark; border-radius: 12px; }
a { color: var(--accent3); }
a.small { color: var(--muted); }
.msg { color: var(--muted); }

/* section titles */
.sec-title { font-family: 'Orbitron', system-ui, sans-serif; font-weight: 800; font-size: 1.05rem; letter-spacing: 1px; margin: 26px 0 12px; text-align: center; }
.sec-title span { color: var(--accent2); }

/* how it works */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.step { padding: 16px 12px; text-align: center; margin: 0 !important; }
.step b { display: block; font-family: 'Orbitron', system-ui, sans-serif; font-size: 1.3rem; color: var(--accent2); margin-bottom: 6px; }
.step p { margin: 0; font-size: .86rem; color: var(--muted); line-height: 1.4; }
.step p strong { color: var(--text); display: block; margin-bottom: 3px; font-size: .95rem; }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } .step { display: flex; gap: 12px; text-align: left; align-items: center; } .step b { margin: 0; } }

/* sample A/B */
.sample-card { padding: 18px; }
.sample-wave { position: relative; height: 92px; border-radius: 12px; overflow: hidden; background: rgba(10, 8, 24, .65); border: 1px solid var(--line); cursor: pointer; }
.sample-wave canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.sample-ctl { display: flex; gap: 8px; margin-top: 12px; align-items: stretch; }
.sample-ctl button { flex: 1; padding: 12px 8px; }
.sample-ctl .play { flex: 0 0 52px; font-size: 1.1rem; padding: 0; }
.sample-note { color: var(--muted); font-size: .8rem; margin: 10px 0 0; text-align: center; }

footer { position: relative; z-index: 1; padding-bottom: 28px; }

@media (prefers-reduced-motion: reduce) {
  .drop .bars i { animation: none; height: 18px; }
  #eq { display: none; }
}
.nav > span.hidden { display: none; }

/* language switcher + RTL / CJK */
.lang-box { position: absolute; top: 10px; right: 10px; z-index: 5; }
[dir="rtl"] .lang-box { right: auto; left: 10px; }
.lang-box select { background: rgba(10,8,24,.8); color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; font-size: .85rem; }
html[dir="rtl"] body { text-align: right; }
html[dir="rtl"] .sample-wave, html[dir="rtl"] .sample-ctl, html[dir="rtl"] audio, html[dir="rtl"] .brand { direction: ltr; }
html[dir="rtl"] .step b { margin-left: 0; }
html:lang(ar) body, html:lang(zh) body, html:lang(ja) body { font-family: system-ui, -apple-system, 'Segoe UI', 'Noto Sans Arabic', 'Noto Sans SC', 'Noto Sans JP', 'PingFang SC', 'Hiragino Sans', 'Microsoft YaHei', sans-serif; }
html:lang(ar) .sec-title, html:lang(zh) .sec-title, html:lang(ja) .sec-title, html:lang(ar) .step b, html:lang(zh) .step b, html:lang(ja) .step b { font-family: inherit; letter-spacing: 0; }
.step p span { display: block; }

.consent { display: flex; gap: 10px; align-items: flex-start; font-size: .82rem; color: var(--muted); line-height: 1.45; margin: 10px 0; cursor: pointer; }
.consent input { margin-top: 3px; flex: 0 0 auto; width: 18px; height: 18px; accent-color: var(--accent); }
.consent.hidden { display: none; }
footer a { color: var(--muted); }
.legal { max-width: 720px; margin: 0 auto; padding: 28px 16px 40px; line-height: 1.6; position: relative; z-index: 1; }
.legal h1 { font-size: 1.6rem; text-align: left; margin: 24px 0 4px; }
.legal h2 { font-size: 1.05rem; margin: 22px 0 6px; color: var(--accent3); }
.legal p, .legal li { color: #d8d3f2; font-size: .95rem; }
.legal .fill { background: rgba(255,63,164,.25); border-radius: 4px; padding: 0 4px; }
.legal .upd { color: var(--muted); font-size: .85rem; }
.legal .back { display: inline-block; margin-top: 8px; }
