/* tag0r theme — dark only */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=JetBrains+Mono:wght@500&display=swap');

/* ── Reset / base ─────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --background:  #0a0a0b;
  --foreground:  #ffffff;
  --muted-fg:    rgba(255, 255, 255, 0.6);
  --surface:     rgba(255, 255, 255, 0.05);
  --ring:        rgba(255, 255, 255, 0.10);
}

html,
body {
  height: 100%;
  background: var(--background);
  color: var(--foreground);
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-weight: 500;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

/* WordPress adds a <div id="wpadminbar"> — keep it from shifting layout */
#wpadminbar { display: none !important; }

/* ── App shell ─────────────────────────────────────────────────────────────── */
#app {
  position: fixed;
  inset: 0;
  overflow: hidden;
  /* background is set per-track via JS; transition must live here */
  transition: background 700ms ease;
}

/* ── Player column ─────────────────────────────────────────────────────────── */
#player {
  position: relative;
  z-index: 1;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 480px;
  padding: 1.5rem 1.25rem;
}

/* ── Header / wordmark ─────────────────────────────────────────────────────── */
#site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#wordmark-el {
  font-size: 1.25rem;   /* ~20px */
  font-weight: 700;
  letter-spacing: 0.3em;
  color: var(--foreground);
  line-height: 1;
}

/* ── Cover carousel ────────────────────────────────────────────────────────── */
#cover-section {
  display: flex;
  align-items: center;
  justify-content: space-between;  /* arrows flush to edges, cover centred */
  margin-top: auto;
}

#cover-wrap {
  position: relative;
  flex: 1;
  max-width: calc(100% - 9rem); /* leave 4rem each side for the arrows + gap */
  aspect-ratio: 1 / 1;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.8);
  outline: 1px solid rgba(255, 255, 255, 0.1);
}

.cover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 500ms ease;
}

.cover-img.active {
  opacity: 1;
}

/* Prev / next chevrons — flex items, 64×64, edge-aligned via space-between */
#btn-prev-cover,
#btn-next-cover {
  flex: 0 0 4rem;
  height: 4rem;
  display: grid;
  place-items: center;
  background: none;
  border: none;
  cursor: pointer;
  color: #ffffff;
  transition: opacity 150ms, transform 100ms;
  line-height: 0;
  padding: 0;
}

#btn-prev-cover:hover,
#btn-next-cover:hover  { opacity: 0.7; }

#btn-prev-cover:active,
#btn-next-cover:active { transform: scale(0.9); }

/* ── Track info ─────────────────────────────────────────────────────────────── */
#track-info {
  margin-top: 1.5rem;
  text-align: center;
}

#track-title {
  font-size: 1.25rem;  /* ~20px */
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#track-artist {
  margin-top: 0.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted-fg);
}

/* ── Progress bar ───────────────────────────────────────────────────────────── */
#progress-area {
  margin-top: 1.25rem;
  padding: 0 0.25rem;
}

#scrub-bar {
  position: relative;
  height: 1.5rem;   /* 24px touch area */
  width: 100%;
  cursor: pointer;
  touch-action: none;
  user-select: none;
}

#waveform-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

#timecodes {
  display: flex;
  justify-content: space-between;
  margin-top: 0.375rem;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.625rem;   /* 10px */
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
}

/* ── Transport ──────────────────────────────────────────────────────────────── */
#transport {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.25rem;
}

#transport button {
  display: grid;
  place-items: center;
  width: 4rem;    /* 64px */
  height: 4rem;
  padding: 0;
  background: none;
  border: none;
  color: #ffffff;
  cursor: pointer;
  line-height: 0;
  transition: opacity 150ms, transform 100ms;
}

#transport button:hover  { opacity: 0.7; }
#transport button:active { transform: scale(0.93); }

/* ── Bottom icon row ─────────────────────────────────────────────────────────── */
#link-row {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 1.5rem;
}

.link-btn {
  display: grid;
  place-items: center;
  width: 3.25rem;   /* 52px — room for 32px icon */
  height: 3.25rem;
  flex-shrink: 0;
  border-radius: 0.75rem;  /* rounded-xl */
  background: var(--surface);
  border: none;
  outline: 1px solid var(--ring);
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  text-decoration: none;
  transition: background 150ms, color 150ms, transform 100ms;
  line-height: 0;
}

.link-btn:hover  { background: rgba(255, 255, 255, 0.10); color: #ffffff; }
.link-btn:active { transform: scale(0.95); }

/* ── Panel overlay ───────────────────────────────────────────────────────────── */
#panel-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  background: rgba(10, 10, 11, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  /* Hidden state — JS toggles open/closing classes */
}

#panel-overlay[aria-hidden="true"] {
  display: none;
}

#panel-overlay.open {
  animation: fade-in 400ms ease-out forwards;
}

#panel-overlay.closing {
  animation: fade-out 350ms ease-out forwards;
  pointer-events: none;
}

/* Inner content box: bottom-aligned */
#panel-inner {
  position: relative;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;  /* content sits at the bottom */
  width: 100%;
  max-width: 480px;
  height: 100%;
  padding: 1.5rem 1.25rem 6rem;  /* generous bottom pad keeps content above close btn */
}

#panel-overlay.open #panel-inner {
  animation: slide-in-up 500ms ease-out forwards;
}

#panel-overlay.closing #panel-inner {
  animation: slide-out-down 450ms ease-in forwards;
}

/* Panel content typography */
#panel-body h2 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--foreground);
}

#panel-body p {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.7);
}

#panel-body a {
  color: rgba(255, 255, 255, 0.85);
}

/* .btn / <a class="btn"> — a white CTA button inside a panel */
#panel-body .btn,
#panel-body a.btn {
  display: block;
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  background: #ffffff;
  color: #000000 !important;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 100ms, background 150ms;
  line-height: 1.4;
}

#panel-body .btn:hover  { background: rgba(255, 255, 255, 0.9); }
#panel-body .btn:active { transform: scale(0.98); }

/* Close button: fixed bottom-right of panel */
#panel-close {
  position: absolute;
  bottom: 2rem;
  right: 1.25rem;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.10);
  border: none;
  outline: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--foreground);
  cursor: pointer;
  line-height: 0;
  transition: background 150ms, transform 100ms;
}

#panel-close:hover  { background: rgba(255, 255, 255, 0.18); }
#panel-close:active { transform: scale(0.95); }

/* ── Animations ──────────────────────────────────────────────────────────────── */
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fade-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}

@keyframes slide-in-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

@keyframes slide-out-down {
  from { transform: translateY(0); }
  to   { transform: translateY(100%); }
}

/* ── Responsive: tighten spacing on very small screens ───────────────────── */
@media (max-width: 360px) {
  #link-row {
    gap: 0.25rem;
  }
  .link-btn {
    width: 2.75rem;
    height: 2.75rem;
  }
  #transport {
    gap: 1.5rem;
  }
}
