:root {
  color-scheme: light;
  --bg: #f4efe7;
  --panel: rgba(255, 251, 247, 0.74);
  --panel-strong: rgba(255, 250, 244, 0.92);
  --text: #17212b;
  --muted: #576574;
  --line: rgba(23, 33, 43, 0.08);
  --accent: #0f766e;
  --accent-strong: #0a5e58;
  --accent-soft: rgba(15, 118, 110, 0.1);
  --warm: #ff8454;
  --shadow: 0 24px 80px rgba(27, 40, 53, 0.12);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --transition: 220ms ease;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Plus Jakarta Sans", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 132, 84, 0.18), transparent 28%),
    linear-gradient(145deg, #f7f2eb 0%, #f1efe8 52%, #e7f4f1 100%);
}

button,
input,
summary,
a {
  font: inherit;
}

button {
  cursor: pointer;
}

.page-shell {
  position: relative;
  overflow: hidden;
}

.orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(20px);
  opacity: 0.6;
  pointer-events: none;
  animation: drift 16s ease-in-out infinite alternate;
}

.orb-one {
  width: 360px;
  height: 360px;
  top: -80px;
  right: -60px;
  background: rgba(255, 132, 84, 0.18);
}

.orb-two {
  width: 300px;
  height: 300px;
  bottom: 6%;
  left: -120px;
  background: rgba(15, 118, 110, 0.16);
  animation-duration: 20s;
}

.grid-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.4;
  background-image:
    linear-gradient(rgba(23, 33, 43, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 33, 43, 0.02) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.75), transparent 86%);
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 64px;
}

.panel {
  backdrop-filter: blur(18px);
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.42);
  box-shadow: var(--shadow);
}

.hero-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 36px;
  border-radius: var(--radius-xl);
}

.hero-copy h1,
.section-heading h2,
.results-heading h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: -0.04em;
}

.hero-copy h1 {
  font-size: clamp(2.3rem, 4.2vw, 4.6rem);
  line-height: 0.95;
  max-width: none;
}

.lede {
  max-width: none;
  margin: 18px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}

.workspace-grid {
  display: grid;
  grid-template-columns: 390px minmax(0, 1fr);
  gap: 24px;
  margin-top: 24px;
}

.controls-panel,
.results-panel {
  padding: 28px;
  border-radius: var(--radius-xl);
}

.start-here-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(255, 132, 84, 0.14);
  border: 1px solid rgba(255, 132, 84, 0.28);
  color: #a64c28;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  animation: pulse-callout 1.9s ease-in-out infinite;
}

.start-here-badge::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--warm);
  box-shadow: 0 0 0 rgba(255, 132, 84, 0.5);
  animation: pulse-dot 1.9s ease-in-out infinite;
}

.section-heading.second-step {
  margin-top: 30px;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.chip,
.mood-card,
.primary-button,
.secondary-button,
.action-link {
  transition:
    transform var(--transition),
    background-color var(--transition),
    border-color var(--transition),
    box-shadow var(--transition),
    opacity var(--transition);
}

.chip {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.5);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 999px;
}

.chip:hover,
.chip.selected {
  transform: translateY(-1px);
  background: rgba(15, 118, 110, 0.12);
  border-color: rgba(15, 118, 110, 0.28);
}

.field-label {
  display: block;
  margin: 20px 0 10px;
  font-weight: 600;
}

.text-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  padding: 14px 16px;
  color: var(--text);
  outline: none;
}

.text-input:focus {
  border-color: rgba(15, 118, 110, 0.44);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.mood-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.mood-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-height: 126px;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.56);
  text-align: left;
}

.mood-card:hover,
.mood-card.selected {
  transform: translateY(-2px);
  border-color: rgba(255, 132, 84, 0.4);
  box-shadow: 0 18px 34px rgba(255, 132, 84, 0.12);
}

.mood-emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255, 132, 84, 0.12);
  color: var(--warm);
  font-size: 0.82rem;
  font-weight: 700;
}

.mood-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
}

.mood-copy,
.status-text,
.song-reason,
.summary-card,
.loading-copy,
.api-panel p,
.result-meta {
  color: var(--muted);
  line-height: 1.6;
}

.api-panel {
  margin-top: 22px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.46);
  border: 1px solid rgba(23, 33, 43, 0.06);
}

.api-panel summary {
  cursor: pointer;
  font-weight: 700;
}

.primary-button {
  width: 100%;
  margin-top: 22px;
  border: 0;
  border-radius: 18px;
  padding: 16px 18px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.02rem;
  font-weight: 700;
  color: #fffaf4;
  background: linear-gradient(135deg, var(--accent) 0%, #1b9386 100%);
  box-shadow: 0 18px 40px rgba(15, 118, 110, 0.24);
}

.primary-button:hover {
  transform: translateY(-2px);
}

.primary-button:disabled {
  opacity: 0.65;
  cursor: progress;
}

.secondary-button {
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 18px;
  padding: 13px 18px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--accent-strong);
  background: rgba(15, 118, 110, 0.08);
}

.secondary-button:hover {
  transform: translateY(-2px);
}

.secondary-button:disabled {
  opacity: 0.65;
  cursor: progress;
}

.status-row {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.mode-badge {
  width: fit-content;
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 132, 84, 0.12);
  color: #b6572d;
  font-size: 0.84rem;
  font-weight: 700;
}

.results-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.summary-card {
  margin-top: 18px;
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.52));
  border: 1px solid rgba(23, 33, 43, 0.06);
}

.loading-state {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.56);
}

.loading-title {
  margin: 0;
  font-weight: 700;
}

.spinner {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 4px solid rgba(15, 118, 110, 0.16);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.results-actions {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

.song-card {
  border-radius: 24px;
  background: var(--panel-strong);
  border: 1px solid rgba(255, 255, 255, 0.56);
  box-shadow: 0 18px 38px rgba(23, 33, 43, 0.08);
  transform: translateY(16px);
  opacity: 0;
  animation: card-in 0.5s ease forwards;
}

.song-art-wrap {
  position: relative;
  aspect-ratio: 1.15 / 1;
  overflow: hidden;
}

.song-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.song-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(23, 33, 43, 0.78);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}

.song-content {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.artist-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.artist-photo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.28), rgba(255, 132, 84, 0.34));
}

.song-title {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1rem;
}

.artist-name,
.song-meta {
  margin: 4px 0 0;
  color: var(--muted);
}

.artist-name-button {
  border: 0;
  padding: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(15, 118, 110, 0.28);
  text-underline-offset: 2px;
}

.artist-name-button:hover {
  color: var(--accent-strong);
}

.song-reason,
.song-meta {
  font-size: 0.88rem;
}

.song-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preview-player {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: min(100%, 220px);
  flex: 1 1 180px;
}

.preview-toggle-button {
  border: 0;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(23, 33, 43, 0.08);
  color: var(--text);
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
}

.preview-progress {
  position: relative;
  flex: 1 1 auto;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(23, 33, 43, 0.1);
}

.preview-progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent) 0%, var(--warm) 100%);
  transition: width 120ms linear;
}

.action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  padding: 9px 12px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
}

.primary-link {
  background: rgba(15, 118, 110, 0.12);
  color: var(--accent-strong);
}

.secondary-link {
  background: rgba(23, 33, 43, 0.08);
  color: var(--text);
}

.artist-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
}

.artist-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 22, 29, 0.5);
  backdrop-filter: blur(8px);
}

.artist-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(720px, calc(100% - 24px));
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 22px;
  padding: 24px;
  border-radius: 26px;
  background: rgba(255, 251, 247, 0.96);
  box-shadow: 0 28px 80px rgba(23, 33, 43, 0.24);
}

.artist-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(23, 33, 43, 0.08);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}

.artist-modal-media {
  aspect-ratio: 1 / 1.1;
  overflow: hidden;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.22), rgba(255, 132, 84, 0.28));
}

.artist-modal-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.artist-modal-body {
  display: grid;
  align-content: start;
  gap: 12px;
  padding-top: 12px;
}

.artist-modal-body h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
}

.artist-modal-summary {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.action-link:hover {
  transform: translateY(-1px);
}

.hidden {
  display: none !important;
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  animation: reveal-in 0.8s ease forwards;
}

.reveal-delay-1 {
  animation-delay: 120ms;
}

.reveal-delay-2 {
  animation-delay: 220ms;
}

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(28px, 24px, 0) scale(1.08);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse-callout {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 132, 84, 0.08);
  }
  50% {
    transform: scale(1.02);
    box-shadow: 0 0 0 10px rgba(255, 132, 84, 0);
  }
}

@keyframes pulse-dot {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 132, 84, 0.45);
  }
  60% {
    box-shadow: 0 0 0 10px rgba(255, 132, 84, 0);
  }
}

@keyframes reveal-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes card-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1024px) {
  .workspace-grid,
  .results-grid {
    grid-template-columns: 1fr;
  }

  .hero-copy h1 {
    max-width: none;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 18px;
    padding-bottom: 28px;
  }

  .hero-card,
  .controls-panel,
  .results-panel {
    padding: 22px;
  }

  .mood-grid {
    grid-template-columns: 1fr;
  }

  .results-heading {
    flex-direction: column;
    align-items: flex-start;
  }

  .artist-modal-dialog {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}