/* ==========================================================================
   Single / song landing page — shared template styles
   Used by /too-far/, /harbour-me/, /schwimm-im-glueck/, /wieder-blau/ …
   Each page's own style.css overrides the vars below to match its cover.
   Structure: .single-page > .col-left (cover + stream pills)
                            + .col-right (title, snippet, countdown, lyrics)
   base.css handles tokens, reset, body, Inter font, focus-visible,
   touch-action, .visually-hidden, reduced-motion.
   ========================================================================== */

:root {
  /* per-song palette — override in the page's style.css */
  --accent: #8a7cff;
  --accent-rgb: 138, 124, 255;
  --accent-contrast: #0b0b12;  /* text on solid accent (presave pill) */
  --accent-bright: #b1a8ff;    /* lighter accent for the presave gradient */
  --night-1: #060912;          /* gradient top */
  --night-2: #0a1024;          /* gradient bottom */
  --glow-top: rgba(120, 150, 220, 0.10);  /* ambient radial top-left */
}

/* html carries the base tone so generic page fades (body opacity → 0)
   never flash white */
html { height: 100%; background: var(--night-2); }

body {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(ellipse 60% 40% at 18% 8%, var(--glow-top), transparent 60%),
    radial-gradient(ellipse 50% 60% at 80% 90%, rgba(var(--accent-rgb), 0.05), transparent 60%),
    linear-gradient(180deg, var(--night-1) 0%, var(--night-2) 100%);
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
}

/* Ambient canvas behind everything */
#stars {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* =============================================
   Layout — mobile-first single column
   ============================================= */
.single-page {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
  padding: clamp(28px, 6vh, 72px) var(--space-5) var(--space-5);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.col-left,
.col-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

/* =============================================
   Cover
   ============================================= */
.cover-wrap {
  position: relative;
  width: min(72vw, 34dvh, 320px);
  aspect-ratio: 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.65),
    0 0 60px rgba(var(--accent-rgb), 0.12);
  user-select: none;
  -webkit-user-select: none;
  animation: cover-in 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.5s ease;
}

.cover-wrap:hover {
  transform: translateY(-5px) scale(1.012);
  box-shadow:
    0 32px 90px rgba(0, 0, 0, 0.7),
    0 0 90px rgba(var(--accent-rgb), 0.22);
}

/* Entrance cascade — everything rises in, one after another */
@keyframes rise-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

.col-left .stream-row { animation: rise-in 0.6s 0.25s cubic-bezier(0.22, 1, 0.36, 1) both; }
.col-right > *:nth-child(1) { animation: rise-in 0.6s 0.12s cubic-bezier(0.22, 1, 0.36, 1) both; }
.col-right > *:nth-child(2) { animation: rise-in 0.6s 0.20s cubic-bezier(0.22, 1, 0.36, 1) both; }
.col-right > *:nth-child(3) { animation: rise-in 0.6s 0.27s cubic-bezier(0.22, 1, 0.36, 1) both; }
.col-right > *:nth-child(4) { animation: rise-in 0.6s 0.34s cubic-bezier(0.22, 1, 0.36, 1) both; }
.col-right > *:nth-child(5) { animation: rise-in 0.6s 0.42s cubic-bezier(0.22, 1, 0.36, 1) both; }
.col-right > *:nth-child(6) { animation: rise-in 0.6s 0.50s cubic-bezier(0.22, 1, 0.36, 1) both; }

#cover {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* faint rim */
.cover-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
  pointer-events: none;
}

@keyframes cover-in {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

/* Stream pills live under the cover */
.stream-row {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  justify-content: center;
  margin-top: var(--space-4);
}

/* =============================================
   Title block
   ============================================= */
.single-title {
  margin-top: var(--space-4);
  font-size: clamp(1.9rem, 7.5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--accent);
  text-shadow:
    0 0 18px rgba(var(--accent-rgb), 0.55),
    0 0 60px rgba(var(--accent-rgb), 0.25);
  /* entrance + slow neon breathing, like a real sign */
  animation:
    rise-in 0.6s 0.12s cubic-bezier(0.22, 1, 0.36, 1) both,
    title-glow 4.5s 1.2s ease-in-out infinite alternate;
}

@keyframes title-glow {
  from {
    text-shadow:
      0 0 18px rgba(var(--accent-rgb), 0.45),
      0 0 60px rgba(var(--accent-rgb), 0.18);
  }
  to {
    text-shadow:
      0 0 26px rgba(var(--accent-rgb), 0.75),
      0 0 90px rgba(var(--accent-rgb), 0.35);
  }
}

.single-artist {
  margin-top: var(--space-2);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.single-date {
  margin-top: var(--space-1);
  font-size: 0.9rem;
  color: var(--muted);
  letter-spacing: 0.06em;
}

/* =============================================
   Snippet player
   ============================================= */
.snippet {
  margin-top: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.snippet-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 20px;
  min-height: 44px;
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  backdrop-filter: blur(10px);
  color: var(--text);
  font: 600 0.9rem var(--font-sans);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease,
              width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

#snippetLabel { transition: opacity 0.13s ease; }

.snippet-btn:hover {
  background: var(--surface-hover);
  border-color: rgba(var(--accent-rgb), 0.5);
  transform: translateY(-1px);
}

/* play/stop icons stacked + morphing */
.snippet-ic {
  position: relative;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.snippet-ic svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: var(--accent);
  transition: opacity 0.22s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.snippet-ic .icon-stop { opacity: 0; transform: rotate(-90deg) scale(0.4); }

.snippet-btn.playing .icon-play { opacity: 0; transform: rotate(90deg) scale(0.4); }
.snippet-btn.playing .icon-stop { opacity: 1; transform: none; }

.snippet-btn.playing {
  border-color: rgba(var(--accent-rgb), 0.5);
  box-shadow: 0 0 20px rgba(var(--accent-rgb), 0.18);
}

/* equalizer bars while playing — slides in/out smoothly */
.eq {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 18px;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-width 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
}

.eq.on {
  max-width: 40px;
  opacity: 1;
}

.eq span {
  width: 3px;
  border-radius: 2px;
  background: var(--accent);
  animation: eq-bounce 0.9s ease-in-out infinite;
}

.eq span:nth-child(1) { animation-delay: 0s; }
.eq span:nth-child(2) { animation-delay: 0.15s; }
.eq span:nth-child(3) { animation-delay: 0.3s; }
.eq span:nth-child(4) { animation-delay: 0.1s; }
.eq span:nth-child(5) { animation-delay: 0.25s; }

@keyframes eq-bounce {
  0%, 100% { height: 5px; }
  50% { height: 18px; }
}

/* =============================================
   Countdown + presave (pre-release)
   ============================================= */
.pre {
  margin-top: var(--space-4);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}

.countdown {
  display: flex;
  gap: clamp(20px, 4vw, 34px);
}

.cd-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 52px;
  position: relative;
}

/* thin colon between units instead of boxes */
.cd-block:not(:last-child)::after {
  content: ':';
  position: absolute;
  right: calc(-0.5 * clamp(20px, 4vw, 34px));
  transform: translateX(50%);
  top: 0.18em;
  font-family: var(--font-mono);
  font-size: 1.6rem;
  color: var(--muted);
  opacity: 0.4;
}

.cd-num {
  font-family: var(--font-mono);
  font-size: 2.2rem;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

/* soft crossfade when a digit changes */
.cd-num.tick { animation: num-fade 0.3s ease; }

@keyframes num-fade {
  from { opacity: 0.25; transform: translateY(0.12em); }
  to   { opacity: 1; transform: none; }
}

.cd-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

/* =============================================
   Pills (presave + stream links)
   ============================================= */
.big-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 24px;
  min-height: 44px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.big-pill svg { width: 18px; height: 18px; }

.big-pill:hover {
  background: var(--surface-hover);
  transform: translateY(-1px);
  box-shadow: 0 0 24px rgba(var(--accent-rgb), 0.2);
  border-color: rgba(var(--accent-rgb), 0.5);
}

/* icon bop on hover */
.big-pill:hover svg,
.snippet-btn:hover svg,
.lyrics-btn:hover svg { animation: icon-bop 0.45s cubic-bezier(0.22, 1, 0.36, 1); }

@keyframes icon-bop {
  0%   { transform: none; }
  40%  { transform: rotate(-8deg) scale(1.2); }
  100% { transform: none; }
}

.presave-pill {
  padding: 16px 40px;
  min-height: 54px;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: linear-gradient(120deg, var(--accent), var(--accent-bright), var(--accent));
  background-size: 200% 100%;
  border-color: transparent;
  color: var(--accent-contrast);
  box-shadow: 0 8px 34px rgba(var(--accent-rgb), 0.4);
  animation: grad-move 3.5s linear infinite;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease, filter 0.3s ease;
}

/* hover: grow + shine (re-assert gradient — .big-pill:hover would flatten it) */
.presave-pill:hover {
  background: linear-gradient(120deg, var(--accent), var(--accent-bright), var(--accent));
  background-size: 200% 100%;
  border-color: transparent;
  transform: scale(1.06);
  filter: brightness(1.08);
  box-shadow:
    0 12px 50px rgba(var(--accent-rgb), 0.6),
    0 0 90px rgba(var(--accent-rgb), 0.3);
}

.presave-pill:active { transform: scale(1.01); transition-duration: 0.1s; }

@keyframes grad-move {
  to { background-position: -200% 0; }
}

/* =============================================
   Lyrics — button + fullscreen overlay
   ============================================= */
.lyrics-btn {
  margin-top: var(--space-4);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: var(--muted);
  font: 600 0.85rem var(--font-sans);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  cursor: pointer;
  padding: var(--space-2) var(--space-4);
  min-height: 44px;
  transition: color 0.2s ease;
}

.lyrics-btn svg { width: 16px; height: 16px; }
.lyrics-btn:hover { color: var(--accent); }

/* lyrics + share side by side */
.action-row {
  margin-top: var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.action-row .lyrics-btn { margin-top: 0; }

/* =============================================
   More songs — subtle strip above the footer
   ============================================= */
.more-songs {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  animation: rise-in 0.6s 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.ms-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  opacity: 0.7;
  margin-right: var(--space-2);
}

.ms-item {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  overflow: hidden;
  opacity: 0.75;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease, opacity 0.3s ease;
}

.ms-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ms-item:hover {
  opacity: 1;
  transform: translateY(-2px);
  box-shadow:
    0 6px 16px rgba(0, 0, 0, 0.5),
    0 0 14px rgba(var(--accent-rgb), 0.25);
}

.ms-all {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  margin-left: var(--space-2);
  transition: color 0.2s ease;
}

.ms-all:hover { color: var(--accent); }

.lyrics-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(4, 6, 12, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  justify-content: center;
  animation: overlay-in 0.25s ease both;
}

@keyframes overlay-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* closing — fade the veil, sink the words */
.lyrics-overlay.closing { animation: overlay-out 0.3s ease both; }
.lyrics-overlay.closing .lyrics-scroll { animation: lyrics-out 0.3s ease both; }

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

@keyframes lyrics-out {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: translateY(18px) scale(0.985); }
}

.lyrics-close {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  right: 20px;
  z-index: 61;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.lyrics-close svg { width: 18px; height: 18px; }
.lyrics-close:hover { color: var(--accent); border-color: rgba(var(--accent-rgb), 0.5); }

.lyrics-scroll {
  width: 100%;
  max-width: 640px;
  height: 100%;
  overflow-y: auto;
  padding: clamp(40px, 8vh, 72px) var(--space-5) 80px;
  text-align: center;
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--accent-rgb), 0.4) transparent;
  animation: lyrics-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.lyrics-title {
  font-size: 1.5rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  text-shadow: 0 0 18px rgba(var(--accent-rgb), 0.5);
  margin-bottom: var(--space-5);
}

.lyrics-content {
  color: var(--text);
  font-size: 0.95rem;
  user-select: none;
  -webkit-user-select: none;
}

.lyrics-stanza {
  margin-bottom: var(--space-4);
  break-inside: avoid;
}

.lyrics-line,
.lyrics-tag { display: block; }

.lyrics-line { line-height: 1.75; }

/* each line floats in, one after another (replays on every open) */
.lyrics-content .lyrics-line,
.lyrics-content .lyrics-tag {
  opacity: 0;
  animation: line-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: min(calc(var(--i, 0) * 0.03s), 0.8s);
}

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

.lyrics-tag {
  margin-bottom: 4px;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  opacity: 0.85;
  line-height: 1.6;
}


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

/* =============================================
   Footer
   ============================================= */
.single-foot {
  position: relative;
  z-index: 1;
  padding: var(--space-4);
  margin-top: auto;
}

.single-foot a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  transition: color 0.2s ease;
}

.single-foot a:hover { color: var(--accent); }

.hidden { display: none !important; }

/* =============================================
   Mobile — center vertically when content fits;
   scroll naturally when it doesn't (never lock
   scrolling here: content height varies by state)
   ============================================= */
@media (max-width: 600px) {
  .single-page {
    flex: 1;
    justify-content: center;
    padding-top: var(--space-4);
    padding-bottom: var(--space-3);
  }
}

/* =============================================
   Desktop — side-by-side, no scrolling.
   Cover + stream pills left, the rest right.
   ============================================= */
@media (min-width: 900px) and (min-height: 620px) {
  body { height: 100dvh; overflow: hidden; }

  .single-page {
    flex: 1;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    max-width: 1140px;
    gap: clamp(48px, 7vw, 96px);
    padding: var(--space-5) var(--space-6);
    text-align: left;
  }

  .col-left {
    flex: 0 0 auto;
    width: auto;
  }

  .cover-wrap { width: min(40vw, 60vh, 480px); }

  .stream-row { margin-top: var(--space-5); }

  .col-right {
    flex: 0 1 auto;
    max-width: 520px;
    align-items: flex-start;
    text-align: left;
  }

  .single-title { margin-top: 0; font-size: clamp(2.4rem, 3.5vw, 3.4rem); }
  .snippet { margin-top: var(--space-5); }
  .pre { margin-top: var(--space-5); align-items: flex-start; }
  .cd-num { font-size: 2.6rem; }
  .lyrics-btn { padding-left: 0; }
}
