:root {
  --ink: #102033;
  --muted: #5b6b7c;
  --paper: #edf1f6;
  --panel: rgba(255, 255, 255, 0.78);
  --line: rgba(16, 32, 51, 0.12);
  --night: #0c1422;
  --night-2: #162338;
  --amber: #d9a441;
  --teal: #2f9e8b;
  --white: #ffffff;
  --shadow: 0 18px 40px rgba(12, 20, 34, 0.16);
  --radius: 16px;
  --font: "Outfit", "Segoe UI", sans-serif;
  --display: "Syne", "Outfit", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font);
  background: var(--paper);
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 12% -10%, rgba(47, 158, 139, 0.22), transparent 34%),
    radial-gradient(circle at 88% 0%, rgba(217, 164, 65, 0.18), transparent 30%),
    linear-gradient(180deg, #d9e2ec 0%, var(--paper) 42%, #e7ebf1 100%);
}

.page-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(16, 32, 51, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 32, 51, 0.03) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 78%);
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 14px clamp(16px, 3vw, 28px);
  background:
    linear-gradient(180deg, rgba(12, 20, 34, 0.96), rgba(18, 30, 48, 0.92));
  color: var(--white);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  min-width: max-content;
}

.brand span {
  display: grid;
  line-height: 1.05;
}

.brand strong {
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: linear-gradient(120deg, #6be7cf, #8fd0ff 55%, #f0c56a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand em {
  font-style: normal;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: min(320px, 100%);
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.7);
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--white);
}

.search input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 64px;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 18px;
}

.toolbar h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  letter-spacing: -0.03em;
}

.toolbar p,
.count {
  margin: 6px 0 0;
  color: var(--muted);
}

.song-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.song-btn {
  display: block;
  text-decoration: none;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 16px 16px 18px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease;
  position: relative;
  overflow: hidden;
  animation: rise-in 420ms ease both;
}

.song-btn::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--teal), var(--amber));
  opacity: 0.85;
}

.song-btn:hover,
.song-btn:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(47, 158, 139, 0.35);
  box-shadow: var(--shadow);
  outline: none;
  background: rgba(255, 255, 255, 0.92);
}

.song-btn strong {
  display: block;
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.3;
}

.song-btn span {
  display: inline-flex;
  margin-top: 8px;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.song-btn.is-missing {
  opacity: 0.72;
  cursor: default;
}

.song-btn.is-missing::before {
  background: #9aa7b5;
}

.empty {
  margin-top: 40px;
  text-align: center;
  color: var(--muted);
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 820px) {
  .topbar {
    flex-wrap: wrap;
  }

  .brand {
    justify-content: center;
    flex: 1 1 auto;
  }

  .search {
    min-width: 0;
    flex: 1 1 100%;
  }

  .toolbar {
    align-items: start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

