:root {
  color-scheme: dark;
  font: 16px/1.5 system-ui, sans-serif;
  --base: #0a0d15;
  --panel: #151a26;
  --line: #2a3142;
  --text: #f6f7fb;
  --muted: #aab4c9;
  --accent: #ff3d6e;
  color: var(--text);
  background: var(--base);
}
* { box-sizing: border-box; }
body { margin: 0; }
header, main, footer { width: min(1120px, calc(100% - 36px)); margin-inline: auto; }
header { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); font-weight: 800; text-decoration: none; }
a { color: #ff9db6; text-underline-offset: 4px; }
.skip { position: fixed; top: 10px; left: 10px; background: var(--base); padding: 8px; transform: translateY(-200%); z-index: 3; }
.skip:focus { transform: none; }
.intro { display: flex; align-items: center; gap: clamp(12px, 4vw, 42px); padding: clamp(26px, 5vw, 64px) 0; }
.intro img { width: clamp(48px, 10vw, 92px); height: auto; }
h1 { margin: 0 0 12px; font-size: clamp(2rem, 6vw, 5rem); letter-spacing: -.065em; line-height: 1.05; overflow-wrap: anywhere; }
h2 { margin: 0 0 14px; font-size: clamp(1.25rem, 3vw, 1.65rem); letter-spacing: -.025em; }
p { margin: 0 0 12px; color: var(--muted); }
main > section + section { margin-bottom: 36px; }
.sound-filters { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
label { display: grid; gap: 4px; color: var(--muted); font-size: .8rem; font-weight: 650; }
label:first-child { flex: 1 1 200px; }
input, select, button, .signup, .action { min-height: 40px; padding: 8px 12px; border-radius: 8px; font: inherit; }
input, select { width: 100%; min-width: 0; border: 1px solid var(--line); color: var(--text); background: var(--panel); font-size: .95rem; }
button { cursor: pointer; }
.signup, .action { display: inline-flex; align-items: center; justify-content: center; border: 1px solid #ff7499; background: var(--accent); color: #130a13; font-weight: 800; text-decoration: none; white-space: nowrap; }
.action:hover, .signup:hover { background: #ff789d; }
.sound-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); gap: 12px; list-style: none; margin: 0; padding: 0; }
.sound-card { position: relative; min-width: 0; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); overflow: hidden; }
.sound-card:hover, .sound-card:focus-within { border-color: #62708b; }
.sound-tile { position: absolute; inset: 0; display: block; color: var(--text); text-decoration: none; }
.sound-tile:focus-visible { outline-offset: -4px; }
.sound-tile :is(img, video) { width: 100%; height: 100%; object-fit: cover; }
.sound-emoji { position: absolute; inset: 19% 0 23%; display: grid; place-items: center; font-size: clamp(2rem, 5vw, 3rem); }
.sound-category { position: absolute; top: 7px; background: #111624eb; border: 1px solid #ffffff1f; border-radius: 6px; }
.sound-category { left: 7px; max-width: calc(100% - 54px); padding: 2px 5px; color: #dee3ef; font-size: .67rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sound-meta { position: absolute; inset: auto 0 0; display: grid; gap: 3px; padding: 8px 10px; font-size: .85rem; }
.has-art .sound-meta { background: #090c15e8; }
.sound-meta strong, .sound-meta > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sound-meta > span { color: var(--muted); font-size: .75rem; }
.activity { float: right; color: #ffacc2; }
.playback-notice:empty { display: none; }
.catalog-notice { padding: 12px; border-left: 2px solid #aa5371; background: var(--panel); }
.more { display: inline-block; margin-top: 16px; }
.join { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 24px; background: linear-gradient(120deg,#25192a,var(--panel)); border: 1px solid var(--line); border-radius: 12px; }
.join p, .join h2 { margin-bottom: 0; }
audio { display: block; max-width: 100%; margin: 20px 0; }
footer { margin-top: 32px; padding: 18px 0; border-top: 1px solid var(--line); }
@media (max-width: 360px) { .sound-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Match the playback track at the top of the in-app sound caption. */
.sound-options {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 32px;
  min-height: 32px;
  padding: 0;
  border: 1px solid #ffffff1f;
  border-radius: 6px;
  color: var(--text);
  background: #111624eb;
  font-size: 1.1rem;
  line-height: 1;
}
.sound-options:hover { background: #31394c; }
.sound-menu {
  position: fixed;
  inset: 8px auto auto 8px;
  width: max-content;
  max-width: calc(100vw - 16px);
  margin: 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--panel);
  box-shadow: 0 8px 28px #0008;
}
.sound-menu :is(a, button) {
  display: block;
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  border: 0;
  border-radius: 4px;
  color: inherit;
  background: transparent;
  text-align: left;
  text-decoration: none;
  font-size: .85rem;
}
.sound-menu :is(a, button):hover { background: #ffffff12; }
.sound-progress {
  appearance: none;
  position: absolute;
  inset: 0 0 auto;
  width: 100%;
  height: 2px;
  border: 0;
  background: #ff3d6e33;
  color: var(--accent);
}
.sound-progress::-webkit-progress-bar { background: #ff3d6e33; }
.sound-progress::-webkit-progress-value { background: var(--accent); }
.sound-progress::-moz-progress-bar { background: var(--accent); }
.detail-player { display: block; max-width: 100%; max-height: 68vh; margin: 20px 0; }

button.sound-tile {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: transparent;
  text-align: left;
}
.sound-card:has(.sound-tile[aria-pressed=true]) { border-color: var(--accent); }
.detail-nav { display: flex; gap: 16px; flex-wrap: wrap; padding: 22px 0; }
.sound-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 52px);
  align-items: center;
  padding: clamp(16px, 4vw, 44px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}
.detail-art {
  display: grid;
  place-items: center;
  min-width: 0;
  overflow: hidden;
  border-radius: 12px;
  background: #0c101a;
}
.detail-art img { display: block; width: 100%; height: auto; }
.detail-art video { width: 100%; margin: 0; background: #000; }
.detail-emoji { display: grid; place-items: center; width: 100%; min-height: 200px; font-size: clamp(68px, 14vw, 140px); }
.detail-copy { min-width: 0; }
.detail-copy h1 { font-size: clamp(2rem, 5vw, 4.25rem); }
.detail-byline { margin-bottom: 20px; }
.detail-byline .activity { float: none; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.detail-actions :is(a, button) {
  min-height: 42px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #242b3d;
  color: var(--text);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 650;
}
.detail-actions :is(a, button):hover { border-color: #986581; }
.detail-actions a[href^="/download/"], .detail-actions a[download] { background: var(--accent); color: #130a13; border-color: var(--accent); }
.detail-copy .playback-notice { margin-top: 12px; }
.detail-related { margin-top: 36px; }
@media (max-width: 720px) { .sound-detail { grid-template-columns: minmax(0, 1fr); } }

/* Community discovery */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.intro {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  min-height: 300px;
  margin-block: clamp(16px, 3vw, 36px);
  padding: clamp(24px, 5vw, 62px);
  overflow: hidden;
  border: 1px solid #4c2c45;
  border-radius: 20px;
  background: radial-gradient(ellipse at 80% 30%, #401d3d, transparent 67%), #131523;
}
.intro-copy h1 { font-size: clamp(2.65rem, 7.2vw, 6rem); line-height: .96; }
.intro-copy h1 span { color: #ff80a8; }
.intro-copy p { max-width: 34ch; margin: 18px 0 0; }
.catalog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.catalog-head h2 { margin: 0; font-size: clamp(1.45rem, 3vw, 2rem); }
.catalog-search { flex: 1 1 210px; }
.sound-filters input, .sound-filters select, .sound-filters .action { min-height: 46px; }
.sound-filters input::placeholder { color: #aab4c9; }
.catalog-categories { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; padding-bottom: 16px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.catalog-categories a {
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: .85rem;
}
.catalog-categories a[aria-current] { border-color: #ff7da477; color: #ffe1ec; background: #49283e; }
.catalog-categories a:hover { color: var(--text); border-color: #ad7b9e; }
.catalog .sound-grid { margin-top: 16px; gap: clamp(10px, 1.5vw, 18px); grid-template-columns: repeat(auto-fill, minmax(min(100%, 165px), 1fr)); }
.sound-card { transition: border-color 160ms ease, box-shadow 160ms ease; }
.sound-card:hover { box-shadow: 0 8px 28px #0006; }
.sound-meta { gap: 5px; padding: 10px 12px; }
.has-art .sound-meta { background: #0c101ae8; }
.sound-meta strong { font-size: .94rem; }
@media (max-width: 620px) {
  .intro { grid-template-columns: 1fr; min-height: 0; }
  .catalog .sound-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sound-filters .catalog-search { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) { .sound-card { transition: none; } }

/* Featured sounds share the same live playback controls as the catalog. */
.sound-stage {
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: clamp(20px, 5vw, 72px);
  padding: clamp(24px, 5vw, 58px);
  background:
    radial-gradient(ellipse at 88% 32%, #7b315d99, transparent 65%),
    linear-gradient(125deg, #151725 38%, #261b36);
}
.sound-stage .intro-copy { container-type: inline-size; }
.sound-stage .intro-copy h1 {
  font-size: clamp(1.8rem, 4.4vw, 4.6rem);
  font-size: min(clamp(2.35rem, 6.5vw, 5.6rem), 14cqi);
  overflow-wrap: normal;
}
.sound-stage .intro-copy h1 span { white-space: nowrap; }
.stage-link { display: inline-block; margin-top: 16px; color: #ffc1d4; font-weight: 700; }
.stage-clips {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 10px 0;
}
.stage-clips .sound-card {
  z-index: 1;
  border-color: #a3739b;
  box-shadow: 0 18px 32px #090711a6;
  transform: translateY(10px) rotate(-6deg);
}
.stage-clips .sound-card:nth-child(2) { z-index: 2; transform: translateY(-10px) scale(1.12); }
.stage-clips .sound-card:nth-child(3) { transform: translateY(14px) rotate(6deg); }
.stage-clips .sound-card:focus-within { z-index: 3; }
.stage-clips .sound-card:has([aria-pressed=true]) { border-color: #ff7ba6; box-shadow: 0 0 32px #ff448845; }
.stage-clips .sound-meta { padding-inline: 8px; }
.stage-clips .sound-meta strong { font-size: clamp(.72rem, 1.45vw, .94rem); }
.intro-compact {
  display: block;
  min-height: auto;
  padding-block: 26px;
}
.intro-compact h1 { margin: 0; font-size: clamp(2rem, 5vw, 3.5rem); }
.intro-compact h1 span { color: #ff80a8; }
.catalog .sound-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 142px), 1fr)); }
@media (max-width: 720px) {
  .sound-stage { grid-template-columns: minmax(0, 1fr); }
  .stage-clips { width: min(100%, 420px); margin-inline: auto; }
}
@media (max-width: 440px) {
  .catalog .sound-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stage-clips .sound-category { display: none; }
  .stage-clips .sound-options { top: 4px; right: 4px; }
}
