:root {
  --paper: #f4f0e8;
  --ink: #181713;
  --muted: #68645c;
  --line: rgba(24, 23, 19, 0.17);
  --card: #fffdf8;
  --red: #ff5f4d;
  --shadow: 0 2px 0 rgba(24, 23, 19, 0.9), 0 12px 30px rgba(24, 23, 19, 0.08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 10%, rgba(255, 208, 72, 0.24), transparent 24rem),
    linear-gradient(rgba(24, 23, 19, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: auto, 100% 28px, auto;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

button, input { font: inherit; }
button, .add-button { -webkit-tap-highlight-color: transparent; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 99;
  transform: translateY(-180%);
  background: var(--ink);
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 0.6rem;
}
.skip-link:focus { transform: translateY(0); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 74px;
  padding: 0.75rem clamp(1rem, 3vw, 3.5rem);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem;
  border-bottom: 1px solid var(--line);
  background: rgba(244, 240, 232, 0.88);
  backdrop-filter: blur(18px);
}

.brand {
  color: inherit;
  text-decoration: none;
  display: flex;
  gap: 0.72rem;
  align-items: center;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--red);
  border: 2px solid var(--ink);
  display: grid;
  place-items: center;
  box-shadow: 0 3px 0 var(--ink);
}

.brand-mark span {
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 13px solid var(--ink);
  margin-left: 3px;
}

.brand-copy { display: grid; line-height: 1; }
.brand-copy strong { font-size: 0.92rem; letter-spacing: 0.11em; }
.brand-copy small { margin-top: 0.35rem; color: var(--muted); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; }

.desk-controls { display: flex; align-items: center; gap: 0.55rem; }
.desk-controls button { cursor: pointer; }

.icon-control,
.mode-control,
.stop-button {
  min-height: 42px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.75);
  color: var(--ink);
  border-radius: 999px;
}

.icon-control { width: 42px; padding: 0; font-weight: 900; }
.icon-control.is-muted { background: #ffcb53; }

.volume-control { display: grid; width: clamp(70px, 10vw, 128px); padding: 0 0.4rem; }
input[type="range"] { accent-color: var(--ink); cursor: pointer; }

.mode-control { display: flex; align-items: center; gap: 0.5rem; padding: 0 0.85rem; font-size: 0.8rem; font-weight: 750; }
.mode-dot { width: 8px; height: 8px; border-radius: 50%; background: #55bc7a; box-shadow: 0 0 0 4px rgba(85,188,122,.15); }
.mode-control[aria-pressed="true"] .mode-dot { background: #9575ff; box-shadow: 0 0 0 4px rgba(149,117,255,.16); }

.stop-button {
  padding: 0 0.7rem 0 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--ink);
  color: white;
  font-size: 0.82rem;
  font-weight: 800;
}
.stop-square { width: 9px; height: 9px; background: var(--red); border-radius: 2px; }
kbd { font-family: inherit; font-size: 0.68rem; border: 1px solid currentColor; border-radius: 0.35rem; padding: 0.12rem 0.33rem; opacity: 0.68; box-shadow: 0 1px 0 currentColor; }

.hero {
  padding: clamp(4rem, 8vw, 7.5rem) clamp(1.25rem, 6vw, 6rem) clamp(3.5rem, 7vw, 6rem);
  max-width: 1520px;
  margin: auto;
  overflow: hidden;
}

.hero-kicker, .eyebrow {
  margin: 0 0 1.25rem;
  font-size: 0.72rem;
  line-height: 1;
  font-weight: 850;
  letter-spacing: 0.18em;
}
.hero-kicker { display: flex; align-items: center; gap: 0.7rem; color: var(--muted); }
.hero-kicker span { width: 34px; height: 4px; background: var(--red); }

h1 {
  margin: 0;
  max-width: 850px;
  font-size: clamp(4.2rem, 11vw, 10.2rem);
  line-height: 0.75;
  letter-spacing: -0.075em;
  font-weight: 950;
  text-transform: uppercase;
}

h1 em {
  color: transparent;
  -webkit-text-stroke: clamp(2px, 0.045em, 6px) var(--ink);
  font-style: normal;
  margin-left: clamp(0rem, 8vw, 6rem);
}

.hero > p {
  max-width: 480px;
  margin: clamp(2rem, 5vw, 4.5rem) 0 0 auto;
  font-size: clamp(1rem, 1.7vw, 1.35rem);
  line-height: 1.45;
  color: var(--muted);
  font-weight: 550;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto auto;
  gap: 0.8rem;
  margin-top: 2rem;
  min-width: 0;
}

.search-box {
  min-height: 58px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.85rem;
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 0.9rem;
  padding: 0 1rem;
  box-shadow: 0 4px 0 var(--ink);
  min-width: 0;
}
.search-box > span:first-child { font-size: 1.6rem; font-weight: 900; transform: rotate(-18deg); }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 1rem; font-weight: 650; }
.search-box input::placeholder { color: #918c81; }

.surprise-button, .add-button {
  border: 2px solid var(--ink);
  border-radius: 0.9rem;
  padding: 0 1.15rem;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  background: #ffcf54;
  color: var(--ink);
  font-weight: 850;
  box-shadow: 0 4px 0 var(--ink);
  cursor: pointer;
  white-space: nowrap;
}
.add-button { background: #fffdf8; }
.surprise-button:active, .add-button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }

.board {
  padding: clamp(3rem, 6vw, 5.5rem) clamp(1.25rem, 4vw, 4.5rem) 8rem;
  background: #1d1c19;
  color: #f8f4ec;
  border-top: 1px solid #000;
  overflow: hidden;
}

.board-toolbar { max-width: 1420px; margin: auto; display: flex; align-items: end; justify-content: space-between; gap: 2rem; }
.board .eyebrow { color: #ffcf54; margin-bottom: 0.8rem; }
.board h2 { margin: 0; font-size: clamp(1.8rem, 4vw, 3.5rem); line-height: 1; letter-spacing: -0.045em; }
.shortcut-hint { color: #a9a69f; font-size: 0.8rem; white-space: nowrap; }

.filters {
  max-width: 1420px;
  margin: 2.3rem auto 2rem;
  display: flex;
  gap: 0.55rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 3px;
}
.filters::-webkit-scrollbar { display: none; }
.filter-button {
  border: 1px solid rgba(255,255,255,.2);
  background: transparent;
  color: #bcb8b0;
  border-radius: 999px;
  padding: 0.62rem 0.9rem;
  cursor: pointer;
  font-size: 0.79rem;
  font-weight: 750;
  white-space: nowrap;
}
.filter-button:hover { border-color: rgba(255,255,255,.55); color: white; }
.filter-button[aria-pressed="true"] { background: #f7f3eb; color: var(--ink); border-color: #f7f3eb; }
.filter-button span { opacity: 0.55; margin-left: 0.3rem; }

.sound-grid {
  max-width: 1420px;
  margin: auto;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(0.75rem, 1.4vw, 1.25rem);
}

.sound-card {
  position: relative;
  min-width: 0;
  padding: 1rem 1rem 0.95rem;
  border-radius: 1.15rem;
  border: 1px solid rgba(255,255,255,.1);
  background: #282724;
  min-height: 234px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.sound-card:hover { transform: translateY(-4px); border-color: rgba(255,255,255,.3); background: #2e2d29; }
.sound-card.is-playing { border-color: var(--sound); background: color-mix(in srgb, var(--sound) 10%, #282724); }

.sound-button {
  position: relative;
  width: 132px;
  height: 132px;
  max-width: 70%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 4px solid rgba(0,0,0,.72);
  background: var(--sound);
  color: #171612;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 2.35rem;
  box-shadow:
    0 9px 0 color-mix(in srgb, var(--sound) 60%, #000),
    0 13px 0 #090909,
    0 20px 30px rgba(0,0,0,.3),
    inset 0 9px 14px rgba(255,255,255,.25);
  transition: transform .08s ease, box-shadow .08s ease;
}
.sound-button::after {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,.18);
}
.sound-button:hover { transform: translateY(-2px); }
.sound-button:active, .sound-card.is-playing .sound-button {
  transform: translateY(8px) scale(.98);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--sound) 55%, #000), 0 4px 0 #090909, inset 0 7px 14px rgba(0,0,0,.13);
}
.sound-button:focus-visible { outline: 3px solid white; outline-offset: 4px; }

.sound-meta { width: 100%; margin-top: 1.35rem; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0.7rem; }
.sound-copy { min-width: 0; }
.sound-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.94rem; }
.sound-copy small { color: #99968f; font-size: 0.69rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 750; }
.favorite-button { width: 30px; height: 30px; border: 0; background: transparent; color: #817e77; cursor: pointer; border-radius: 50%; font-size: 1.1rem; }
.favorite-button:hover { background: rgba(255,255,255,.08); color: white; }
.favorite-button[aria-pressed="true"] { color: #ffcf54; }
.key-badge { position: absolute; top: 0.75rem; left: 0.75rem; width: 24px; height: 24px; display: grid; place-items: center; background: rgba(0,0,0,.36); color: #d7d3ca; border: 1px solid rgba(255,255,255,.15); border-radius: .4rem; font-size: .7rem; font-weight: 800; }

.empty-state { max-width: 1420px; margin: 4rem auto; text-align: center; color: #aaa69e; }
.empty-state > span { display: block; font-size: 4rem; color: #ffcf54; }
.empty-state h3 { color: white; font-size: 1.4rem; margin: .4rem 0; }
.empty-state p { margin: .4rem 0 1.3rem; }
.empty-state button { border: 1px solid white; border-radius: 999px; color: white; background: transparent; padding: .7rem 1rem; cursor: pointer; }

.now-playing {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: 1.2rem;
  transform: translate(-50%, 160%);
  min-width: min(430px, calc(100vw - 2rem));
  min-height: 68px;
  padding: 0.65rem 0.7rem 0.65rem 1rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #fffdf8;
  color: var(--ink);
  box-shadow: 0 6px 0 var(--ink), 0 20px 50px rgba(0,0,0,.25);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.9rem;
  transition: transform .26s cubic-bezier(.2,.8,.2,1);
}
.now-playing.is-visible { transform: translate(-50%, 0); }
.now-playing small { display: block; color: var(--muted); font-size: .61rem; letter-spacing: .14em; font-weight: 850; }
.now-playing strong { display: block; font-size: .95rem; margin-top: .18rem; }
.now-playing button { border: 0; border-radius: 999px; background: var(--red); color: var(--ink); padding: .7rem .95rem; font-weight: 850; cursor: pointer; }
.now-pulse { display: flex; align-items: center; gap: 3px; height: 24px; }
.now-pulse i { display: block; width: 3px; height: 9px; border-radius: 3px; background: var(--ink); animation: bounce .7s ease-in-out infinite alternate; }
.now-pulse i:nth-child(2) { animation-delay: -.4s; height: 18px; }
.now-pulse i:nth-child(3) { animation-delay: -.2s; height: 13px; }
@keyframes bounce { to { transform: scaleY(.35); } }

.toast { position: fixed; z-index: 50; top: 90px; left: 50%; transform: translate(-50%, -30px); opacity: 0; pointer-events: none; padding: .7rem 1rem; border-radius: 999px; background: var(--ink); color: white; font-size: .8rem; font-weight: 750; transition: .2s ease; }
.toast.is-visible { transform: translate(-50%, 0); opacity: 1; }

footer { min-height: 140px; padding: 2.5rem clamp(1.25rem, 4vw, 4.5rem); display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 2rem; border-top: 1px solid var(--line); }
footer > span { font-weight: 950; text-transform: uppercase; letter-spacing: -.03em; }
footer p { margin: 0; text-align: center; color: var(--muted); font-size: .8rem; }
footer button { border: 0; border-bottom: 1px solid currentColor; background: transparent; padding: .3rem 0; cursor: pointer; font-size: .8rem; font-weight: 750; }

dialog { width: min(560px, calc(100vw - 2rem)); border: 2px solid var(--ink); border-radius: 1.2rem; padding: 0; background: #fffdf8; color: var(--ink); box-shadow: 0 8px 0 var(--ink), 0 30px 70px rgba(0,0,0,.35); }
dialog::backdrop { background: rgba(20,19,17,.62); backdrop-filter: blur(5px); }
dialog form { padding: 2rem; position: relative; }
dialog h2 { font-size: clamp(1.8rem, 5vw, 3rem); line-height: 1; letter-spacing: -.05em; margin: 0 0 1.7rem; }
.dialog-close { position: absolute; top: 1rem; right: 1rem; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: transparent; cursor: pointer; font-size: 1.4rem; }
dialog dl { margin: 0; border-top: 1px solid var(--line); }
dialog dl div { display: grid; grid-template-columns: 110px 1fr; gap: 1rem; padding: .9rem 0; border-bottom: 1px solid var(--line); }
dialog dt { font-weight: 800; }
dialog dd { margin: 0; color: var(--muted); }
.dialog-note { margin: 1.4rem 0 0; padding: 1rem; border-radius: .75rem; background: #f0ebe0; color: var(--muted); line-height: 1.45; font-size: .85rem; }

@media (max-width: 1050px) {
  .sound-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sound-card { min-height: 220px; }
  .sound-button { width: 118px; height: 118px; }
}

@media (max-width: 820px) {
  .volume-control, .mode-control span:last-child, .stop-button kbd { display: none; }
  .mode-control { width: 42px; padding: 0; justify-content: center; }
  .search-row { grid-template-columns: 1fr 1fr; }
  .search-box { grid-column: 1 / -1; }
  .hero > p { margin-left: 0; }
  .sound-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  footer { grid-template-columns: 1fr auto; }
  footer p { grid-row: 2; grid-column: 1 / -1; text-align: left; }
}

@media (max-width: 590px) {
  .topbar { min-height: 66px; padding: .65rem .85rem; }
  .brand-copy small { display: none; }
  .brand-mark { width: 36px; height: 36px; }
  .desk-controls { gap: .35rem; }
  .icon-control, .mode-control { width: 38px; min-height: 38px; }
  .stop-button { min-height: 38px; padding: 0 .75rem; font-size: 0; }
  .stop-button .stop-square { width: 11px; height: 11px; }
  .hero { padding-top: 4rem; }
  h1 { max-width: 100%; font-size: clamp(3.3rem, 16.8vw, 4.4rem); line-height: .79; }
  h1 em { margin-left: 0; }
  .hero > p { max-width: 100%; font-size: 1rem; }
  .search-row { grid-template-columns: 1fr; }
  .search-box, .surprise-button, .add-button { grid-column: 1; }
  .surprise-button, .add-button { min-height: 50px; }
  .board-toolbar { align-items: start; flex-direction: column; gap: 1rem; }
  .board h2 { max-width: 100%; font-size: 2rem; overflow-wrap: anywhere; }
  .sound-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
  .sound-card { min-height: 190px; padding: .8rem; }
  .sound-button { width: 96px; height: 96px; font-size: 1.9rem; box-shadow: 0 7px 0 color-mix(in srgb, var(--sound) 60%, #000), 0 10px 0 #090909, 0 15px 25px rgba(0,0,0,.3), inset 0 8px 13px rgba(255,255,255,.25); }
  .sound-meta { margin-top: 1.15rem; }
  .sound-copy strong { white-space: normal; line-height: 1.15; }
  .sound-copy small { display: none; }
  .key-badge { top: .55rem; left: .55rem; }
}

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