:root {
  --bg: #050505;
  --panel: #0d0d0d;
  --panel-soft: #121212;
  --text: #f2f2f2;
  --muted: #8f8f8f;
  --line: #242424;
  --accent: #ff2525;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background: var(--bg) !important;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-transform: lowercase;
}

a,
button {
  color: inherit;
}

.site-header,
main {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 0;
  background: var(--bg);
}

.brand,
.nav a {
  text-decoration: none;
}

.brand {
  color: var(--text);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.nav a,
.play-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  cursor: pointer;
  font: 600 0.82rem Inter, sans-serif;
  padding: 9px 12px;
  text-transform: lowercase;
  transition: border-color 160ms ease, color 160ms ease, transform 160ms ease, background 160ms ease;
}

.nav a:hover,
.play-button:hover {
  border-color: rgba(255, 37, 37, 0.72);
  color: var(--accent);
  transform: translateY(-1px);
}

.hero {
  max-width: 920px;
  padding: 96px 0 54px;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 900px;
  margin-bottom: 20px;
  font-size: clamp(4.8rem, 17vw, 13rem);
  line-height: 0.82;
  letter-spacing: -0.08em;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 5vw, 4.8rem);
  line-height: 0.92;
  letter-spacing: -0.06em;
}

h3 {
  margin-bottom: 0;
  font-size: clamp(1rem, 1.7vw, 1.25rem);
  line-height: 1;
  letter-spacing: -0.03em;
}

.hero p {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.8vw, 1.18rem);
  line-height: 1.65;
}

.hero a {
  color: var(--text);
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
}

.beats-panel {
  border-top: 1px solid var(--line);
  padding: 44px 0 70px;
}

.panel-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  min-width: 0;
  margin-bottom: 14px;
}

.panel-head span {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.panel-head p {
  flex: 0 0 auto;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1;
  text-align: right;
  white-space: nowrap;
}

.beat-list {
  display: grid;
  gap: 7px;
}

.beat-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px;
  background: var(--panel);
  transition: border-color 160ms ease, transform 160ms ease;
}

.beat-card:hover,
.beat-card.playing {
  border-color: rgba(255, 37, 37, 0.72);
}

.beat-card.playing {
  background: #111;
}

.play-button {
  min-width: 62px;
  min-height: 36px;
  padding: 7px 10px;
  font-size: 0.78rem;
}

.beat-main {
  min-width: 0;
}

.beat-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  margin-bottom: 5px;
}

.beat-meta h3 {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.beat-meta p {
  flex: 0 0 auto;
  max-width: 34%;
  margin-bottom: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.1;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

canvas {
  display: block;
  width: 100%;
  height: 50px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #080808;
}

audio {
  display: none;
}

.empty,
.error {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: var(--panel);
  color: var(--muted);
}

@media (max-width: 700px) {
  .site-header,
  .panel-head,
  .beat-meta,
  .beat-card {
    align-items: stretch;
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  .nav {
    justify-content: flex-start;
  }

  .play-button {
    min-height: 36px;
    width: 100%;
  }
}
