:root {
  --bg0: #0a0a0a;
  --bg1: #141414;
  --ink: #f2f2f2;
  --muted: #9a9590;
  --accent: #e65100;
  --accent-hot: #ff6d1f;
  --accent-dim: #b33f00;
  --danger: #c45c4a;
  --ok: #c4a574;
  --line: rgba(255, 255, 255, 0.1);
  --panel: rgba(18, 18, 18, 0.88);
  --font-display: "Bebas Neue", Impact, sans-serif;
  --font-body: "Space Grotesk", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg0);
  line-height: 1.5;
  position: relative;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 70% 45% at 15% 0%, rgba(230, 81, 0, 0.22), transparent 55%),
    radial-gradient(ellipse 50% 40% at 100% 20%, rgba(80, 40, 20, 0.35), transparent 50%),
    linear-gradient(168deg, #050505 0%, #121212 42%, #0a0a0a 100%);
}
.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
}

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink);
  text-decoration: none;
}
.brand-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 50%;
  background: #000;
}
.brand-mark {
  width: 64px;
  height: 40px;
  object-fit: cover;
  object-position: 6% 8%;
  border: 1px solid var(--line);
  border-radius: 2px;
  flex-shrink: 0;
}
.comment-hint {
  margin: -0.35rem 0 0.85rem;
  font-size: 0.88rem;
}
.export-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 0;
}
.export-links .btn {
  text-decoration: none;
  display: inline-block;
}
.brand-word {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}
.brand-word strong {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 400;
  letter-spacing: 0.06em;
}
.brand-word small {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}
.nav { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}
.nav a[aria-current="page"], .nav a:hover { color: var(--ink); }
.linkish {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  padding: 0;
}
.linkish:hover { color: var(--ink); }

.main {
  max-width: 42rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}
.main:has(.library), .main:has(.admin) { max-width: 48rem; }

.hero-logo {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 0 1.25rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  animation: rise 0.75s ease-out both;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}
.hero-logo--compact {
  max-height: 220px;
  object-fit: cover;
  object-position: center 20%;
}

.brand-hero {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 8vw, 4rem);
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 0.95;
  margin: 0 0 0.5rem;
  animation: rise 0.7s ease-out both;
}
.brand-hero em {
  font-style: normal;
  color: var(--accent);
}
.lede {
  color: var(--muted);
  margin: 0 0 1.5rem;
  max-width: 32rem;
  animation: rise 0.7s 0.08s ease-out both;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.7rem;
  color: var(--accent);
  margin: 0 0 0.35rem;
  font-weight: 600;
}
.eyebrow a { color: inherit; }

.auth-panel, .now, .comment-box, .admin article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 1.25rem 1.35rem;
  backdrop-filter: blur(8px);
}
.now { animation: rise 0.75s 0.12s ease-out both; }
.now h2 {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 400;
  letter-spacing: 0.03em;
  margin: 0;
}
.artist { color: var(--muted); margin: 0.25rem 0 1rem; }
.path { font-size: 0.85rem; word-break: break-all; }

.stack { display: flex; flex-direction: column; gap: 0.85rem; }
.stack label { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.9rem; color: var(--muted); }
input, textarea, select {
  font: inherit;
  color: var(--ink);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.55rem 0.7rem;
}
textarea { resize: vertical; }
.btn {
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  border: none;
  border-radius: 2px;
  padding: 0.65rem 1.1rem;
  background: var(--accent);
  color: #0a0a0a;
  letter-spacing: 0.02em;
}
.btn:hover { background: var(--accent-hot); }
.btn.ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent-dim);
}
.btn.danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}
.row { display: flex; gap: 0.75rem; align-items: center; justify-content: space-between; }
.inline { display: inline; }
.mt { margin-top: 0.75rem; }
.muted { color: var(--muted); }
.muted a { color: var(--accent); }
.flash {
  padding: 0.65rem 0.8rem;
  border-radius: 2px;
  margin-bottom: 1rem;
}
.flash.error { background: rgba(196, 92, 74, 0.2); color: #f0b4aa; }
.flash.ok { background: rgba(230, 81, 0, 0.15); color: #ffc599; }

audio {
  width: 100%;
  margin: 0.75rem 0;
  filter: contrast(0.95);
}

.progress-wrap { margin: 0.5rem 0 0.25rem; }
.progress-track {
  position: relative;
  height: 8px;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  overflow: visible;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent-hot));
  border-radius: 999px;
  transition: width 0.4s linear;
}
.markers { position: absolute; inset: 0; pointer-events: none; }
.marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  background: none;
  border: none;
  color: var(--ok);
  cursor: pointer;
  pointer-events: auto;
  padding: 0;
  font-size: 0.7rem;
  line-height: 1;
}
.times {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.35rem;
  font-variant-numeric: tabular-nums;
}

.comment-box { margin-top: 1.75rem; }
.comment-box h3 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.45rem;
  letter-spacing: 0.04em;
}
.comment-list { list-style: none; padding: 0; margin: 1rem 0 0; }
.comment-list li {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  gap: 0.25rem 0.75rem;
  padding: 0.65rem 0;
  border-top: 1px solid var(--line);
  font-size: 0.95rem;
}
.comment-list time { color: var(--accent); font-variant-numeric: tabular-nums; }
.comment-list strong { grid-column: 2; font-size: 0.8rem; color: var(--muted); }
.comment-list span { grid-column: 2; }

.library h1, .admin h1, .track-page h1 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.04em;
  font-size: 2.4rem;
  margin: 0 0 0.35rem;
}
.search-row { display: flex; gap: 0.5rem; margin-bottom: 1.25rem; }
.search-row input { flex: 1; }
.track-list { list-style: none; padding: 0; margin: 0; }
.track-list li { border-top: 1px solid var(--line); }
.track-list a {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.15rem 1rem;
  padding: 0.85rem 0.15rem;
  color: inherit;
  text-decoration: none;
}
.track-list a:hover strong { color: var(--accent); }
.track-list span { grid-column: 1; color: var(--muted); font-size: 0.9rem; }
.track-list time { grid-row: 1 / span 2; align-self: center; color: var(--muted); font-variant-numeric: tabular-nums; }

.rating-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  margin: 1rem 0;
  color: var(--muted);
}

.admin-grid {
  display: grid;
  gap: 1.25rem;
}
@media (min-width: 700px) {
  .admin-grid { grid-template-columns: 1fr 1fr; }
}
.admin article h2 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  margin: 0 0 0.85rem;
}
.invite-list, .user-list { list-style: none; padding: 0; margin: 1rem 0 0; }
.invite-list li, .user-list li {
  padding: 0.5rem 0;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.invite-list code {
  font-size: 0.8rem;
  word-break: break-all;
  color: var(--accent);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

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