/* ============================================================
   FORGOTIFY · STYLES
   Spotify design system + ominous moonlit aesthetic
   ============================================================ */

:root {
  --bg-deep: #08090b;
  --bg-base: #0d0e11;
  --surface-1: #131418;
  --surface-2: #1a1c21;
  --surface-3: #22252b;

  --text-base: #ffffff;
  --text-muted: #a8aab0;
  --text-dim: #6b6e75;
  --text-faint: #3d4047;

  --moon: #c8e84a;
  --moon-glow: rgba(200, 232, 74, 0.15);
  --moon-dim: #8aa030;

  --crimson: #c14d5e;
  --amber: #d4a04a;

  --border: rgba(255,255,255,0.06);
  --border-strong: rgba(255,255,255,0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg-deep);
  color: var(--text-base);
  font-family: 'Inter', -apple-system, sans-serif;
  font-weight: 300;
  overflow-x: hidden;
  min-height: 100vh;
  letter-spacing: -0.005em;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(200, 232, 74, 0.10) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(200, 232, 74, 0.025) 0%, transparent 60%);
  pointer-events: none;
  z-index: 1;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.025 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 2;
  opacity: 0.6;
}

/* ============================================================
   LOGIN GATE
   ============================================================ */
.login-gate {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}
.login-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 56px 48px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  position: relative;
  box-shadow: 0 40px 80px rgba(0,0,0,0.5);
}
.login-card::before {
  content: '';
  position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(200, 232, 74, 0.5), transparent);
}
.logo-row.big {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}
.logo-mark.big {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}
.logo-mark.big svg {
  width: 100%;
  height: 100%;
  filter:
    drop-shadow(0 0 2px rgba(240, 255, 140, 0.45))
    drop-shadow(0 0 8px rgba(216, 240, 96, 0.28))
    drop-shadow(0 0 18px rgba(200, 232, 74, 0.15));
}
.logo-text.big {
  font-size: 24px;
  letter-spacing: 0.4em;
  margin-bottom: 0;
}
.login-tagline {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--moon);
  text-transform: uppercase;
  margin-bottom: 32px;
}
.login-blurb {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 32px;
  font-weight: 300;
}
.login-blurb strong {
  color: var(--text-base);
  font-weight: 500;
}
.login-btn {
  width: 100%;
  margin-bottom: 12px;
  padding: 16px 24px;
}
.login-btn.disabled,
.login-demo.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
/* Small-print under the login buttons — explains why sign-in is gated
   without making the public path feel second-class. */
.login-beta-note {
  margin-top: 16px;
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.6;
  font-weight: 300;
}
.login-demo {
  width: 100%;
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}
.login-demo:hover {
  color: var(--text-base);
}
.login-setup {
  margin-top: 24px;
  padding: 16px;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-left: 2px solid var(--amber);
  border-radius: 6px;
  text-align: left;
}
.setup-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--amber);
  letter-spacing: 0.2em;
  margin-bottom: 8px;
}
.login-setup p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}
.login-setup code {
  font-family: 'JetBrains Mono', monospace;
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 11px;
  color: var(--moon);
}

/* ============================================================
   APP CONTAINER
   ============================================================ */
.container {
  position: relative;
  z-index: 10;
  max-width: 1280px;
  margin: 0 auto;
  /* Vertical padding is owned by the header (sticky) and the rest of
     the content. Removing top padding here so the header sits flush
     against the viewport when stuck. */
  padding: 0 28px 100px;
}

/* ============================================================
   HEADER — sticky so it stays visible as you scroll.
   Outer <header> spans the full viewport (background, blur, border);
   .header-inner constrains the actual content to the page max-width.
   ============================================================ */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  /* Semi-transparent base + backdrop blur lets the page's moonlight
     gradient subtly bleed through instead of being a hard cutoff. */
  background: rgba(8, 9, 11, 0.82);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  margin-bottom: 48px;
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 28px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.logo-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo-mark {
  width: 24px;
  height: 24px;
}
.logo-mark svg {
  width: 100%;
  height: 100%;
  filter:
    drop-shadow(0 0 2px rgba(240, 255, 140, 0.45))
    drop-shadow(0 0 5px rgba(216, 240, 96, 0.25))
    drop-shadow(0 0 12px rgba(200, 232, 74, 0.14));
}
.logo-text {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: 18px;
  letter-spacing: 0.4em;
  color: var(--text-base);
  text-transform: uppercase;
}
.header-meta {
  display: flex;
  gap: 24px;
  align-items: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}
.header-meta .pulse {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--moon);
  border-radius: 50%;
  margin-right: 8px;
  box-shadow: 0 0 8px var(--moon);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}
.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
  cursor: pointer;
}
.nav-link:hover { color: var(--moon); }

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 6px 6px 6px 14px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-base);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  white-space: nowrap;
}
/* Desktop shows full name; mobile (handled in 900px media query) swaps to first name only */
.user-name-short { display: none; }

/* ----- Streak chip ----- */
.streak-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  white-space: nowrap;
  transition: color 200ms, border-color 200ms, box-shadow 200ms;
}
.streak-chip .streak-flame {
  font-size: 12px;
  line-height: 1;
}
.streak-chip.alive {
  color: var(--moon);
  border-color: rgba(200, 232, 74, 0.35);
  box-shadow: 0 0 12px rgba(200, 232, 74, 0.08), inset 0 0 0 1px rgba(200, 232, 74, 0.06);
}
.streak-chip.alive .streak-flame {
  text-shadow: 0 0 10px rgba(200, 232, 74, 0.6);
}
.streak-chip.cold {
  color: var(--text-dim);
  border-color: var(--border);
}

/* ----- Save button saved state ----- */
.btn#save-btn.saved {
  color: var(--moon);
  border-color: rgba(200, 232, 74, 0.45);
  background: rgba(200, 232, 74, 0.05);
}
.btn#save-btn.saved:hover {
  background: rgba(200, 232, 74, 0.05);
}
.logout-btn {
  background: var(--surface-3);
  color: var(--text-muted);
  border: none;
  padding: 6px 12px;
  border-radius: 100px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.logout-btn:hover {
  background: var(--crimson);
  color: var(--text-base);
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  display: grid;
  /* Mirror the player-section grid (2.125fr 1fr = 68/32) and gap so the
     lead paragraph's left edge sits directly above the pipeline column
     beneath it. Keeps the hero and the section below in visual rhythm. */
  grid-template-columns: 2.125fr 1fr;
  gap: 32px;
  align-items: end;
  padding: 60px 0 80px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 60px;
  position: relative;
}
.hero-moon {
  position: absolute;
  top: -40px;
  right: 18%;
  width: 240px;
  height: 240px;
  pointer-events: none;
  opacity: 0.6;
}
.hero-content { position: relative; z-index: 2; }
.hero-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--moon);
  text-transform: uppercase;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.hero-tag::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--moon);
}
.hero h1 {
  font-family: 'Inter', sans-serif;
  font-weight: 200;
  font-size: clamp(56px, 7vw, 104px);
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--text-base);
  margin-bottom: 32px;
}
.hero h1 em {
  font-style: italic;
  font-weight: 300;
  color: var(--moon);
}
.hero p.lead {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-muted);
  /* No max-width — let the 32% grid column dictate the width so the
     paragraph aligns with the pipeline column beneath. */
  font-weight: 300;
}
.hero p.lead strong {
  color: var(--text-base);
  font-weight: 500;
}

/* ============================================================
   PLAYER
   ============================================================ */
.player-section {
  display: grid;
  /* Player gets noticeably more room than the pipeline — pipeline is
     informational, player is where you live. 2.125:1 = 68/32 split. */
  grid-template-columns: 2.125fr 1fr;
  gap: 32px;
  margin-bottom: 80px;
}
.player-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s ease;
}
.player-card:hover { border-color: var(--border-strong); }
.player-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(200, 232, 74, 0.4), transparent);
  opacity: 0.6;
}
.card-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--text-dim);
  text-transform: uppercase;
}
.card-label .recovered {
  color: var(--moon);
  display: flex;
  align-items: center;
  gap: 6px;
}
.card-label .recovered::before {
  content: '';
  width: 5px;
  height: 5px;
  background: var(--moon);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--moon);
}

.player-inner {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 28px;
  align-items: start;
}
.track-art {
  width: 200px;
  height: 200px;
  background: var(--surface-3);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.04);
}

/* Demo mode: the art slot holds a larger Spotify preview card instead of
   the (redundant) album image. Wider column + taller, no image chrome. */
.player-inner.demo-layout {
  grid-template-columns: 300px 1fr;
  align-items: stretch;
}
/* Hybrid demo card: large real cover art stacked over a slim Spotify
   player strip. We render the cover ourselves (Spotify's embed caps its
   own cover ~320px), so the art can be as big as we like. */
.track-art.embed-mode {
  width: 300px;
  max-width: 300px;
  height: auto;
  margin: 0;
  background: transparent;
  border-radius: 0;
  overflow: visible;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.track-art.embed-mode .hero-art {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 14px;
  display: block;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.04);
}
.track-art.embed-mode .hero-player {
  width: 100%;
  height: 80px;
  border: 0;
  border-radius: 12px;
  display: block;
}

/* Demo: action buttons live in the right column beside the card so the
   space next to the cover isn't blank. Open-in-Spotify + Share share a
   row; Rescue Next drops to its own full-width row as the primary CTA.
   Title block sits at the top; buttons are pinned to the bottom so they
   line up with the player strip, with breathing room in between. */
.player-inner.demo-layout .track-info {
  justify-content: flex-start;
}
.player-inner.demo-layout .track-meta-tags {
  margin-bottom: 47px;
}
/* Callout sits in the same band as the Spotify player strip in the left
   column: 12px gap above (matching the art→player gap) puts its top edge
   level with the player, and an 80px min-height mirrors the player's box so
   Rescue Next above it bottom-aligns with the album art. */
.player-inner.demo-layout .playback-hint {
  margin: 12px 0 0;
  font-size: 12px;
  white-space: nowrap;
  min-height: 80px;
  box-sizing: border-box;
  justify-content: center;
}
.player-inner.demo-layout .playback-hint .hint-text {
  flex: 0 1 auto;
  text-align: center;
}
.player-inner.demo-layout .track-album {
  margin-bottom: 0;
}
.player-inner.demo-layout .controls-row {
  margin-top: auto;
  padding-top: 0;
  border-top: none;
}
.player-inner.demo-layout .controls-row .btn.primary {
  margin-left: 0;
  flex-basis: 100%;
  justify-content: center;
}

/* Hint banner relocated to a full-width slot under the player, with a
   divider line above it to separate it from the actions. */
.playback-hint.hint-standalone {
  position: relative;
  margin: 18px 0 0;
}
.playback-hint.hint-standalone::before {
  content: '';
  position: absolute;
  top: -9px;
  left: 0;
  right: 0;
  border-top: 1px solid var(--border);
}
.track-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.9) contrast(1.05);
}
.track-art .placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
}
.track-art .placeholder svg {
  width: 35%;
  height: 35%;
}
.track-info {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.track-meta-tags {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 100px;
  background: var(--surface-3);
  color: var(--text-muted);
}
.tag.moon {
  background: transparent;
  border: 1px solid var(--moon-dim);
  color: var(--moon);
}
.track-title {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  color: var(--text-base);
}
.track-artist {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-weight: 300;
}
.track-album {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: auto;
  padding-bottom: 16px;
}

/* Playback progress bar */
.playback-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 18px 0 22px;
}

/* Inline hint shown in demo mode and for signed-in Free users — sits in
   the same vertical slot the playback-bar would occupy, so the player
   card never looks half-finished. Tone is informational, not loud. */
.playback-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin: 18px 0 22px;
  background: rgba(200, 232, 74, 0.04);
  border: 1px solid rgba(200, 232, 74, 0.18);
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-dim);
}
.playback-hint .hint-icon {
  color: var(--moon);
  font-size: 14px;
  flex-shrink: 0;
}
.playback-hint .hint-text {
  flex: 1;
  min-width: 0;
}
.playback-hint .hint-text strong {
  color: var(--text);
  font-weight: 500;
}
/* Demo-mode inline Spotify embed — sits where the playback bar would.
   Negative top margin tucks it against the hint banner above so the
   two read as one playback unit. */
.demo-embed {
  margin: -10px 0 22px;
}

/* Sign-in CTA inside the hint — small but unmistakably tappable. Moon
   accent so it reads as "the primary thing to do" without crowding the
   rest of the banner. */
.playback-hint .hint-action {
  flex-shrink: 0;
  padding: 6px 12px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--bg-deep);
  background: var(--moon);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 0 14px rgba(200, 232, 74, 0.25);
}
.playback-hint .hint-action:hover {
  transform: scale(1.04);
  box-shadow: 0 0 18px rgba(200, 232, 74, 0.4);
}
.playback-hint .hint-action:active {
  transform: scale(0.97);
}
/* On narrow viewports, let the banner wrap to two lines instead of
   forcing the button onto a cramped single row. */
@media (max-width: 480px) {
  .playback-hint {
    flex-wrap: wrap;
  }
  .playback-hint .hint-action {
    margin-left: auto;
  }
}

/* Shown when another Spotify device on the same account grabs playback. */
.device-lost-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  margin-bottom: 20px;
  background: rgba(212, 160, 74, 0.08);
  border: 1px solid rgba(212, 160, 74, 0.35);
  border-radius: 10px;
  font-size: 13px;
  color: var(--text-dim);
}
.device-lost-msg {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.device-lost-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 8px var(--amber);
  flex-shrink: 0;
}
.device-lost-banner .btn.primary {
  /* Slightly tighter than the default so it fits nicely inline. */
  padding: 8px 16px;
  font-size: 12px;
}
/* Round, prominent play/pause button living inline with the scrubber —
   the standard music-player anchor. Sized to match the visual weight of
   the action buttons below it. */
.play-pause-inline {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--moon);
  color: var(--bg-deep);
  border: none;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 0 20px rgba(200, 232, 74, 0.22);
}
.play-pause-inline:hover {
  transform: scale(1.06);
  box-shadow: 0 0 24px rgba(200, 232, 74, 0.4);
}
.play-pause-inline:active {
  transform: scale(0.97);
}
.time-display {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
  min-width: 32px;
}
.progress-track {
  flex: 1;
  height: 3px;
  background: var(--surface-3);
  border-radius: 100px;
  overflow: hidden;
  position: relative;
}
.progress-fill {
  height: 100%;
  background: var(--moon);
  border-radius: 100px;
  width: 0%;
  transition: width 0.3s linear;
  box-shadow: 0 0 8px var(--moon-glow);
}

/* Legacy class kept for backward-compat — no longer used in the player card. */
.controls {
  display: flex;
  gap: 10px;
  margin-top: 4px;
  flex-wrap: wrap;
}

/* Single row of action buttons spanning the FULL width of the player
   card (sits outside .player-inner now). Track-context actions sit
   left; Rescue Next (.btn.primary) gets pushed right via margin-left:auto
   so it reads as the standalone primary action. */
.controls-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.controls-row .btn.primary {
  margin-left: auto;
}
.btn {
  background: transparent;
  color: var(--text-base);
  border: 1px solid var(--border-strong);
  padding: 12px 22px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  border-radius: 100px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn:hover {
  border-color: var(--text-base);
  transform: translateY(-1px);
}
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.btn.primary {
  background: var(--moon);
  color: var(--bg-deep);
  border-color: var(--moon);
  font-weight: 600;
  box-shadow: 0 0 24px rgba(200, 232, 74, 0.2);
}
.btn.primary:hover {
  background: #d4f060;
  box-shadow: 0 0 32px rgba(200, 232, 74, 0.4);
  transform: translateY(-2px);
}
.btn.icon-btn {
  padding: 12px 18px;
  font-size: 14px;
  letter-spacing: 0;
}

.stats-bar {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1px;
  margin-top: 20px;
  background: var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.stat {
  background: var(--surface-2);
  padding: 14px 16px;
  text-align: center;
}
.stat .label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.stat .value {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: 22px;
  color: var(--text-base);
  letter-spacing: -0.02em;
}
.stat .value.moon { color: var(--moon); }

/* ============================================================
   PIPELINE INSPECTOR
   ============================================================ */
.pipeline {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
}
.pipeline-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.25em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.pipeline-step {
  display: flex;
  gap: 14px;
  margin-bottom: 18px;
  align-items: flex-start;
  opacity: 0.35;
  transition: opacity 0.4s ease, transform 0.3s ease;
}
.pipeline-step.active { opacity: 1; transform: translateX(4px); }
.pipeline-step.done { opacity: 0.65; }
.step-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--moon);
  font-weight: 500;
  min-width: 28px;
  padding-top: 2px;
}
.step-body {
  flex: 1;
  /* Narrow the text column so each step's description wraps an
     extra word or two — feels more deliberate than a near-edge run. */
  padding-right: 20px;
}
.step-title {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: var(--text-base);
  font-weight: 500;
  letter-spacing: 0.02em;
  margin-bottom: 4px;
}
.step-desc {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
  font-weight: 300;
}
.pipeline-step.active .step-num::after {
  content: ' ●';
  animation: pulse 1s ease-in-out infinite;
}

.why-box {
  margin-top: 24px;
  padding: 18px;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-left: 2px solid var(--moon);
  border-radius: 6px;
}
.why-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  color: var(--moon);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.why-text {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  font-weight: 300;
}

/* ============================================================
   FILTERS
   ============================================================ */
.filters { margin-bottom: 60px; }
.filters-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.25em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 16px;
}
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 760px;
}
.chip {
  background: var(--surface-1);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 9px 18px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 100px;
}
.chip:hover {
  color: var(--text-base);
  border-color: var(--border-strong);
}
.chip.active {
  background: var(--text-base);
  color: var(--bg-deep);
  border-color: var(--text-base);
  font-weight: 500;
}

/* ============================================================
   HISTORY
   ============================================================ */
.history-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.history-header .sub { margin-bottom: 0; }
.history-section h2 {
  font-family: 'Inter', sans-serif;
  font-weight: 200;
  font-size: 36px;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
  color: var(--text-base);
}
.history-section .sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}
#export-btn {
  flex-shrink: 0;
}
.history-list {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.history-item {
  padding: 16px 24px;
  display: grid;
  grid-template-columns: 30px 1fr 1.5fr 120px 100px;
  gap: 24px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s ease;
}
.history-item:last-child { border-bottom: none; }
.history-item:hover { background: var(--surface-2); }
.h-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
}
.h-title {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 400;
  color: var(--text-base);
}
.h-artist {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 300;
}
.h-pop {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--moon);
  text-align: right;
  letter-spacing: 0.08em;
}
.h-status {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-dim);
  text-align: right;
  letter-spacing: 0.1em;
}
.empty-state {
  padding: 40px 24px;
  text-align: center;
  color: var(--text-dim);
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: 14px;
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  margin-top: 80px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 40px;
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.7;
  font-weight: 300;
}
footer strong {
  color: var(--moon);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 12px;
  font-weight: 500;
}

/* ============================================================
   TOASTS
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1000;
  pointer-events: none;
}
.toast {
  background: var(--surface-1);
  border: 1px solid var(--border-strong);
  color: var(--text-base);
  padding: 14px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 400;
  max-width: 380px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
  transform: translateX(120%);
  transition: transform 0.3s ease;
  pointer-events: auto;
  border-left: 2px solid var(--text-muted);
}
.toast.show { transform: translateX(0); }
.toast-success { border-left-color: var(--moon); }
.toast-error { border-left-color: var(--crimson); }
.toast-warn { border-left-color: var(--amber); }
.toast-info { border-left-color: var(--text-muted); }

/* ============================================================
   UTILITIES
   ============================================================ */
.loading .track-title,
.loading .track-artist,
.loading .track-album {
  color: transparent;
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
  border-radius: 4px;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.fade-in { animation: fadeIn 0.5s ease-out; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 30px; }
  .hero-moon { right: 0; width: 160px; height: 160px; opacity: 0.4; }
  .player-section { grid-template-columns: 1fr; }
  .player-inner { grid-template-columns: 1fr; gap: 20px; }
  .player-inner.demo-layout { grid-template-columns: 1fr; }
  .track-art { width: 100%; height: auto; aspect-ratio: 1; }
  /* Hybrid card goes full-width; art keeps its square ratio, player stays slim */
  .track-art.embed-mode { width: 100%; max-width: 100%; height: auto; aspect-ratio: auto; }
  footer { grid-template-columns: 1fr; gap: 24px; }
  .history-item {
    grid-template-columns: 24px 1fr 80px;
    grid-template-rows: auto auto;
    gap: 6px 16px;
  }
  .h-artist { grid-column: 2 / 3; }
  .h-pop { grid-row: 1 / 3; grid-column: 3; }
  .h-status { display: none; }
  .pipeline-status { display: none; }
  .header-meta { font-size: 10px; gap: 14px; }
  /* Mobile user-chip shows first name only to keep the nav row tight */
  .user-name-full { display: none; }
  .user-name-short { display: inline; }
  /* Left-align the primary Rescue Next button on mobile (desktop pushes it right) */
  .controls-row .btn.primary { margin-left: 0; }
  .login-card { padding: 40px 24px; }
}

/* ============================================================
   ABOUT PAGE
   ============================================================ */
.logo-link {
  text-decoration: none;
  color: inherit;
}
.about-page {
  position: relative;
  z-index: 5;
  padding-bottom: 120px;
}
/* About-page album-grid backdrop. Pinned to the top, full-width bleed,
   faded toward the page background so the hero text stays legible.
   Sits below the body radial-glow (z:1) and noise (z:2) layers. */
.about-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 560px;
  background-image:
    linear-gradient(180deg, rgba(8, 9, 11, 0.35) 0%, rgba(8, 9, 11, 0.78) 60%, var(--bg-deep) 100%),
    url('./about-bg.jpg');
  background-size: cover;
  background-position: center 25%;
  background-repeat: no-repeat;
  opacity: 0.7;
  pointer-events: none;
  z-index: 0;
}
@media (max-width: 900px) {
  .about-bg { height: 380px; }
}
.about-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 16px;
}
.about-hero {
  padding: 64px 0 56px;
  border-bottom: 1px solid var(--border);
}
.about-hero h1 {
  font-family: 'Inter', sans-serif;
  font-weight: 200;
  font-size: clamp(36px, 5vw, 60px);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 28px;
}
.about-hero h1 em {
  font-style: italic;
  color: var(--text-muted);
}
.about-hero .lead {
  max-width: 760px;
  font-size: 18px;
  line-height: 1.7;
  color: var(--text-muted);
}
.about-hero .lead strong {
  color: var(--moon);
  font-weight: 500;
}

/* TIME 50 Best Websites prestige callout */
.time-prestige {
  margin: 56px 0;
}
.time-prestige-inner {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 32px;
  align-items: center;
  background: var(--surface-1);
  border: 1px solid rgba(200, 232, 74, 0.18);
  border-radius: 16px;
  padding: 36px 40px;
  box-shadow: 0 0 40px rgba(200, 232, 74, 0.04), inset 0 0 0 1px rgba(200, 232, 74, 0.04);
}
.time-mark {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 56px;
  letter-spacing: -0.02em;
  color: var(--moon);
  line-height: 1;
  padding-right: 32px;
  border-right: 1px solid var(--border);
}
.time-prestige-title {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 22px;
  margin-bottom: 12px;
  color: var(--text-base);
}
.time-prestige-blurb {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 14px;
  max-width: 640px;
}
.time-prestige-link {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--moon);
  text-decoration: none;
  text-transform: uppercase;
}
.time-prestige-link:hover {
  color: var(--text-base);
}

/* Section blocks */
.about-section {
  padding: 56px 0;
  border-bottom: 1px solid var(--border);
}
.about-section h2 {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: clamp(28px, 3.5vw, 38px);
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin-bottom: 24px;
}
.about-section p {
  max-width: 760px;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-muted);
  margin-bottom: 18px;
}
.about-section p em {
  font-style: italic;
  color: var(--moon);
}
.about-section p code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  background: var(--surface-2);
  padding: 2px 8px;
  border-radius: 4px;
  color: var(--text-base);
}
.press-intro {
  color: var(--text-dim);
  margin-bottom: 32px;
}
.rebuild-meta {
  margin-top: 32px;
  font-size: 13px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  border-left: 2px solid var(--moon);
  padding-left: 16px;
}

/* Press wall grid */
.press-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.press-card {
  display: block;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: border-color 200ms, transform 200ms, box-shadow 200ms;
}
.press-card:hover {
  border-color: rgba(200, 232, 74, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
/* Thumbnail at the top of each card */
.press-thumb-wrap {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--surface-2);
  position: relative;
  border-bottom: 1px solid var(--border);
}
.press-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 400ms;
}
.press-card:hover .press-thumb {
  transform: scale(1.04);
}
/* Graceful fallback when og:image fetch failed — script adds .press-thumb-missing */
.press-thumb-wrap.press-thumb-missing {
  background:
    radial-gradient(ellipse 60% 80% at 50% 50%, rgba(200, 232, 74, 0.08) 0%, transparent 70%),
    var(--surface-2);
}
.press-thumb-wrap.press-thumb-missing::before {
  content: '◐';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: var(--text-faint);
}
.press-thumb-wrap.press-thumb-missing img {
  display: none;
}
/* Card text now lives in its own padded zone below the thumb */
.press-card > .press-source,
.press-card > .press-headline,
.press-card > .press-meta {
  padding-left: 22px;
  padding-right: 22px;
}
.press-card > .press-source { padding-top: 18px; }
.press-card > .press-meta { padding-bottom: 16px; }
.press-source {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 18px;
  color: var(--moon);
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}
.press-headline {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-base);
  margin-bottom: 14px;
  min-height: 44px;
}
.press-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  text-transform: uppercase;
}

/* Pull quote grid */
.quote-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.pullquote {
  /* Tighten the line length so each quote wraps an extra word or two.
     Visually feels more like a stacked column of pull quotes than a banner. */
  padding-right: 56px;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
}
.pullquote p {
  font-family: 'Inter', sans-serif;
  font-weight: 200;
  font-style: italic;
  font-size: 20px;
  line-height: 1.45;
  color: var(--text-base);
  margin-bottom: 16px;
  max-width: none;
}
.pullquote cite {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  font-style: normal;
  text-transform: uppercase;
}

/* Founders */
.founders-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 8px;
}
.founder-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 24px;
}
.founder-name {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 20px;
  margin-bottom: 4px;
  color: var(--text-base);
}
.founder-role {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--moon);
  text-transform: uppercase;
  margin-bottom: 14px;
}
.founder-bio {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0 0 14px;
  max-width: none;
}
.founder-link {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--moon);
  text-decoration: none;
}
.founder-link:hover {
  color: var(--text-base);
}

/* CTA */
.about-cta {
  text-align: center;
  padding: 80px 0 40px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 60px;
}
.about-cta p {
  font-family: 'Inter', sans-serif;
  font-weight: 200;
  font-size: 28px;
  letter-spacing: -0.01em;
  color: var(--text-muted);
  margin-bottom: 28px;
}

/* Responsive */
@media (max-width: 960px) {
  .press-grid { grid-template-columns: repeat(2, 1fr); }
  .quote-grid { grid-template-columns: 1fr; }
  .founders-grid { grid-template-columns: 1fr; }
  .time-prestige-inner { grid-template-columns: 1fr; gap: 20px; padding: 28px; }
  .time-mark { border-right: none; border-bottom: 1px solid var(--border); padding-right: 0; padding-bottom: 20px; }
}
@media (max-width: 560px) {
  .press-grid { grid-template-columns: 1fr; }
  .about-hero { padding: 40px 0; }
  .about-section { padding: 40px 0; }
}
