:root {
  --bg: #090f1a;
  --panel: rgba(12, 22, 40, 0.75);
  --text: #edf3ff;
  --muted: #b4c0d9;
  --accent: #33d1ff;
  --accent-2: #8cffb5;
  --border: rgba(255, 255, 255, 0.12);
  --shadow: 0 20px 70px rgba(1, 9, 20, 0.45);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 15% 25%, #122341 0%, transparent 45%),
    radial-gradient(circle at 85% 15%, #0b3b4a 0%, transparent 40%),
    linear-gradient(160deg, #070b14 0%, #090f1a 60%, #0b1322 100%);
  min-height: 100%;
}

body {
  position: relative;
  overflow-x: hidden;
}

.ambient {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  z-index: 0;
  pointer-events: none;
}

.ambient-1 {
  width: 320px;
  height: 320px;
  top: -80px;
  left: -80px;
  background: rgba(51, 209, 255, 0.18);
}

.ambient-2 {
  width: 380px;
  height: 380px;
  right: -110px;
  bottom: -120px;
  background: rgba(140, 255, 181, 0.14);
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3.5rem 1.25rem 2rem;
  position: relative;
  z-index: 1;
}

.hero {
  padding: 4rem 2rem;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: linear-gradient(150deg, rgba(20, 34, 60, 0.82), rgba(8, 18, 36, 0.72));
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent-2);
  font-weight: 600;
  font-size: 0.75rem;
}

h1 {
  margin: 0.6rem 0;
  font-size: clamp(2.4rem, 7vw, 5rem);
  letter-spacing: -0.02em;
  line-height: 1;
}

.subtext {
  margin: 1rem 0 0;
  max-width: 62ch;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.25rem);
}

.signed-in-text {
  margin: 0.9rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.8rem;
}

.btn {
  text-decoration: none;
  padding: 0.75rem 1.2rem;
  border-radius: 12px;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  color: #05111e;
  background: linear-gradient(120deg, var(--accent), #8ef7ff);
  box-shadow: 0 12px 28px rgba(51, 209, 255, 0.25);
}

.btn-secondary {
  border: 1px solid var(--border);
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.btn-spotify {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  border: 1px solid #1ed760;
  color: #ecffef;
  background: linear-gradient(120deg, #0f5328, #13733a);
  box-shadow: 0 12px 28px rgba(30, 215, 96, 0.2);
}

.btn-spotify img {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
}

.features {
  margin-top: 1.4rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem 1.1rem;
}

.card h2 {
  margin: 0;
  font-size: 1.02rem;
}

.card p {
  margin: 0.55rem 0 0;
  color: var(--muted);
}

.about {
  margin-top: 1rem;
  padding: 1.4rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(7, 15, 28, 0.7);
}

.about h2 {
  margin: 0;
  font-size: clamp(1.2rem, 3.5vw, 1.85rem);
}

.about p {
  color: var(--muted);
  margin: 0.8rem 0 0;
}

.sync-panel {
  margin-top: 1.4rem;
  padding: 0.95rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.sync-panel p {
  margin: 0;
  color: var(--muted);
  font-weight: 500;
}

.recommendation-state label {
  display: block;
  color: var(--accent-2);
  font-size: 0.86rem;
  margin-bottom: 0.5rem;
}

.recommendation-state input {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  padding: 0.68rem 0.8rem;
  font-size: 0.96rem;
}

.recommendation-state input:focus {
  outline: 2px solid rgba(51, 209, 255, 0.35);
  outline-offset: 1px;
}

.generate-row {
  margin-top: 0.85rem;
  display: flex;
  align-items: flex-end;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.length-control {
  min-width: 220px;
  flex: 1 1 280px;
}

.length-control label {
  margin-bottom: 0.35rem;
  font-size: 0.84rem;
}

#playlist-length-slider {
  width: 100%;
}

.generate-status {
  margin-top: 0.7rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.generate-status a {
  color: var(--accent);
  text-decoration: none;
}

.progress-track {
  margin-top: 0.7rem;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  transition: width 0.25s ease;
}

.playlists-section {
  margin-top: 1.2rem;
}

.playlist-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.8rem;
}

.playlist-row {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.95rem 1rem;
}

.playlist-name {
  margin: 0;
  font-size: 1rem;
}

.playlist-meta {
  margin: 0.5rem 0 0;
  color: var(--accent-2);
  font-size: 0.88rem;
}

.playlist-description {
  margin: 0.55rem 0 0;
  color: var(--muted);
}

.playlist-link {
  display: inline-block;
  margin-top: 0.8rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.playlist-empty {
  margin-top: 0.9rem;
  color: var(--muted);
}

.callback-code {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.callback-code span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.callback-code code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
  word-break: break-all;
}

footer {
  position: relative;
  z-index: 1;
  text-align: center;
  color: var(--muted);
  padding: 0.9rem 1rem 1.6rem;
}

footer a {
  color: var(--accent);
}

@media (max-width: 900px) {
  .features {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 2.5rem 1.25rem;
  }
}
