/* ─────────────────────────────────────────
   CMG Elite v4.0  ·  iOS Premium Design
   ───────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');

/* ─── TOKENS ─── */
:root {
  --bg:            #000000;
  --bg2:           #080808;
  --bg3:           #121212;
  --surface:       rgba(18, 18, 20, 0.7);
  --surface2:      rgba(28, 28, 30, 0.5);
  --border:        rgba(255, 255, 255, 0.08);
  --border2:       rgba(255, 255, 255, 0.04);
  --t1:            #ffffff;
  --t2:            rgba(255, 255, 255, 0.75);
  --t3:            rgba(255, 255, 255, 0.4);
  --accent:        #ffffff;
  --accent-glow:   rgba(255, 255, 255, 0.15);
  --aurora:        linear-gradient(135deg, #FF3B30, #FF9500, #4CD964, #5AC8FA, #007AFF, #5856D6, #FF2D55);
  --red:           #FF453A;
  --green:         #30D158;
  --r-sm:  12px;
  --r-md:  18px;
  --r-lg:  24px;
  --r-xl:  36px;
  --r-2xl: 48px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", system-ui, sans-serif;
  font-optical-sizing: auto;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--bg);
  color: var(--t1);
  overflow-x: hidden;
  min-height: 100vh;
  line-height: 1.5;
}

/* ── Custom Scrollbar ── */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ── ambient glow ── */
body::before {
  content: '';
  position: fixed;
  top: -30%; left: 50%;
  transform: translateX(-50%);
  width: 130vw; height: 100vh;
  background: radial-gradient(ellipse at center, var(--accent-glow) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
  transition: background 1.5s ease;
  animation: float-glow 20s ease-in-out infinite alternate;
}
@keyframes float-glow {
  0% { transform: translateX(-50%) translateY(0) scale(1); }
  100% { transform: translateX(-50%) translateY(30px) scale(1.05); }
}

.wrap {
  position: relative;
  z-index: 10;
  max-width: 680px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── background bubbles ── */
.bg-bubble {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  z-index: 1;
  animation: float 20s infinite alternate;
  opacity: 0.45;
}
.bg-pink {
  width: 400px; height: 400px;
  background: #FF2D55;
  top: -100px; right: -100px;
  animation-delay: 0s;
}
.bg-blue {
  width: 350px; height: 350px;
  background: #007AFF;
  bottom: 100px; left: -100px;
  animation-delay: -5s;
}
.bg-purple {
  width: 300px; height: 300px;
  background: #5856D6;
  bottom: -100px; right: 20%;
  animation-delay: -10s;
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -40px) scale(1.1); }
  100% { transform: translate(-30px, 40px) scale(0.95); }
}

/* ─────────────────────────────────────────
   HEADER / NAV
   ───────────────────────────────────────── */
header {
  position: sticky;
  top: 0;
  z-index: 999;
  height: 56px;
  display: flex;
  align-items: center;
  border-bottom: 0.5px solid var(--border);
  background: rgba(0,0,0,0.75);
  backdrop-filter: saturate(180%) blur(30px);
  -webkit-backdrop-filter: saturate(180%) blur(30px);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.wordmark {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.8px;
  color: var(--t1);
  text-decoration: none;
}
.wordmark em { color: var(--accent); font-style: normal; }

.nav-pill {
  display: flex;
  gap: 8px;
}
.nav-pill a {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 20px;
  background: rgba(0,122,255,0.1);
  transition: background 0.2s;
}
.nav-pill a:hover { background: rgba(0,122,255,0.2); }

/* ─────────────────────────────────────────
   HERO
   ───────────────────────────────────────── */
.hero {
  padding: 72px 0 48px;
  text-align: center;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0,122,255,0.12);
  border: 0.5px solid rgba(0,122,255,0.3);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 20px;
  margin-bottom: 24px;
}
.hero-kicker-dot {
  width: 5px; height: 5px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.hero-title {
  font-size: clamp(48px, 12vw, 92px);
  font-weight: 900;
  letter-spacing: -4px;
  line-height: 1.05;
  margin-bottom: 24px;
  background: linear-gradient(170deg, #ffffff 20%, rgba(255,255,255,0.3) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 10px 40px rgba(255,255,255,0.1);
}

.hero-sub {
  font-size: 16px;
  font-weight: 400;
  color: var(--t2);
  line-height: 1.6;
  max-width: 440px;
  margin: 0 auto 44px;
}

/* ─────────────────────────────────────────
   SEARCH CARD
   ───────────────────────────────────────── */
/* ─────────────────────────────────────────
   SEARCH CARD (Ultima iOS Glass)
   ───────────────────────────────────────── */
.search-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--r-2xl);
  padding: 12px;
  backdrop-filter: blur(120px) saturate(200%);
  -webkit-backdrop-filter: blur(120px) saturate(200%);
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,0.05),
    0 40px 100px -20px rgba(0,0,0,0.7);
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.6s;
}
.search-card:hover {
  transform: translateY(-5px) scale(1.01);
  box-shadow: 
    inset 0 1px 1px rgba(255,255,255,0.1),
    0 60px 130px -30px rgba(0,0,0,0.8);
}

/* Segmented control (Pure Glass) */
.seg {
  position: relative;
  display: flex;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 100px;
  padding: 6px;
  margin-bottom: 20px;
  gap: 0;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.seg-pill {
  position: absolute;
  top: 6px; left: 6px;
  height: calc(100% - 12px);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(25px) saturate(180%);
  border-radius: 100px;
  box-shadow: 0 4px 25px rgba(0,0,0,0.4), inset 0 1px 1px rgba(255,255,255,0.1);
  transition: all 0.6s cubic-bezier(0.2, 1, 0.2, 1);
  z-index: 0;
  border: 0.5px solid rgba(255,255,255,0.1);
}
.seg-btn {
  position: relative;
  flex: 1;
  padding: 14px 4px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.3);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  z-index: 1;
  transition: color 0.4s ease;
}
.seg-btn:hover { color: rgba(255, 255, 255, 0.6); }
.seg-btn.active {
  color: #fff;
}

/* Input row */
.input-row {
  display: flex;
  gap: 10px;
  padding: 4px;
}

.input-wrap {
  flex: 1;
  position: relative;
}

.query-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.02) !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  border-radius: 100px !important;
  padding: 16px 24px !important;
  color: #fff !important;
  font-size: 16px !important;
  font-weight: 450 !important;
  font-family: inherit !important;
  outline: none;
  transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  caret-color: #fff;
}
.query-input::placeholder { color: rgba(255,255,255,0.3) !important; font-weight: 400 !important; }
.query-input:focus {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

/* Search button (iOS Primary) */
.search-btn {
  position: relative;
  background: #fff;
  color: #000;
  border: none;
  padding: 0 32px;
  border-radius: 100px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 8px 30px rgba(255,255,255,0.15);
  min-width: 120px;
  justify-content: center;
  overflow: hidden;
  letter-spacing: -0.01em;
  height: 54px;
}
.search-btn:hover:not(:disabled) {
  transform: scale(1.02);
  background: #f0f0f0;
  box-shadow: 0 12px 40px rgba(255,255,255,0.25);
}
.search-btn:active:not(:disabled) { transform: scale(0.96); }
.search-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.btn-label, .btn-spinner { position: relative; z-index: 1; }

.btn-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(0,0,0,0.1);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* Error */
.error-box {
  margin-top: 12px;
  padding: 12px 16px;
  background: rgba(255,69,58,0.12);
  border: 0.5px solid rgba(255,69,58,0.35);
  border-radius: var(--r-md);
  color: var(--red);
  font-size: 13px;
  font-weight: 500;
  animation: slide-in 0.3s ease;
}

/* ─────────────────────────────────────────
   RESULTS CARD
   ───────────────────────────────────────── */
/* ─────────────────────────────────────────
   RESULTS CARD (iOS 27 Glass)
   ───────────────────────────────────────── */
.results-card {
  display: none;
  margin-top: 44px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--r-2xl);
  overflow: hidden;
  backdrop-filter: blur(160px) saturate(220%);
  -webkit-backdrop-filter: blur(160px) saturate(220%);
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,0.03),
    0 100px 180px -40px rgba(0,0,0,0.9);
  animation: card-in 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Art banner */
.art-banner {
  position: relative;
  width: 100%;
  height: 320px;
  background: var(--bg3);
  overflow: hidden;
}
.art-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 20%, rgba(0,0,0,0.8) 100%);
}
#artImg {
  width: 100%; height: 100%;
  background-size: cover;
  background-position: center;
  transition: transform 10s ease;
}
.art-banner:hover #artImg { transform: scale(1.1); }
.art-no-img {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 100px;
  color: rgba(255,255,255,0.1);
  background: linear-gradient(135deg, #111, #000);
}

/* Badges over art */
.art-badges {
  position: absolute;
  bottom: 24px; left: 24px;
  z-index: 2;
  display: flex;
  gap: 10px;
  align-items: center;
}
.badge-explicit {
  background: rgba(255, 59, 48, 0.25);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 59, 48, 0.3);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.2px;
  padding: 4px 10px;
  border-radius: 8px;
}
.badge-album {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 12px;
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Body */
.result-body {
  padding: 32px 32px 0;
}

.track-title {
  font-size: 32px;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 8px;
  color: #fff;
}
.track-artist {
  font-size: 19px;
  font-weight: 450;
  color: var(--t2);
  letter-spacing: -0.01em;
}

/* Preview player (Pill design) */
.preview-wrap {
  display: none;
  align-items: center;
  gap: 16px;
  margin-top: 28px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 20px;
  border-radius: 100px;
  transition: all 0.4s ease;
  width: fit-content;
}
.preview-wrap.playing {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 30px rgba(255,255,255,0.1);
}
.play-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: #fff;
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.play-btn:hover { transform: scale(1.15); }
.play-icon-tri {
  border-left: 10px solid #000;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  margin-left: 3px;
}
.playing .play-icon-tri {
  border: none;
  width: 3px; height: 12px;
  background: #000;
  box-shadow: 6px 0 0 #000;
  margin-left: -3px;
}
.preview-label { font-size: 10px; font-weight: 900; letter-spacing: 2px; color: rgba(255,255,255,0.5); }

/* Meta list (Transparent rows) */
.meta-list {
  margin: 32px 0 0;
  border-radius: var(--r-xl);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(0,0,0,0.2);
}
.meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  gap: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  transition: background 0.3s ease;
}
.meta-row:last-child { border-bottom: none; }
.meta-row:hover { background: rgba(255,255,255,0.03); }
.meta-key {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.meta-val {
  font-size: 17px;
  font-weight: 500;
  color: #fff;
  text-align: right;
  word-break: break-all;
  letter-spacing: -0.015em;
}

/* ─────────────────────────────────────────
   DSP CHIPS  (streaming links)
   ───────────────────────────────────────── */
/* ─────────────────────────────────────────
   DSP CHIPS (Glass Pill Design)
   ───────────────────────────────────────── */
.dsp-section {
  padding: 32px;
}
.dsp-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}
.dsp-title {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 3px;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
}
.dsp-divider {
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.06);
}
.dsp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.dsp-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-decoration: none;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}
.dsp-chip:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.chip-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--c, #fff);
  box-shadow: 0 0 10px var(--c);
  flex-shrink: 0;
}
.chip-label { line-height: 1; flex: 1; }
.chip-arrow {
  opacity: 0.3;
  font-size: 12px;
  transition: opacity 0.3s;
}
.dsp-chip:hover .chip-arrow { opacity: 1; }

/* ─────────────────────────────────────────
   SEARCH RESULTS (iOS Glass List)
   ───────────────────────────────────────── */
.search-results {
  display: none;
  margin-top: 44px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--r-2xl);
  overflow: hidden;
  backdrop-filter: blur(160px) animate-saturate;
  box-shadow: 0 100px 180px -40px rgba(0,0,0,0.9);
  animation: card-in 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sr-header {
  padding: 24px 32px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  gap: 16px;
}
.sr-header-label {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 3px;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
}

.sr-list { padding: 4px 0 8px; }
.sr-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  text-decoration: none;
  color: inherit;
  border-bottom: 0.5px solid var(--border2);
  transition: background 0.15s;
  animation: slide-in 0.4s ease both;
}
.sr-row:last-child { border-bottom: none; }
.sr-row:hover { background: rgba(255,255,255,0.04); }

.sr-art {
  width: 50px; height: 50px;
  border-radius: 10px;
  background: var(--bg3);
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.sr-art-icon { font-size: 22px; color: var(--t3); }

.sr-info { flex: 1; min-width: 0; }
.sr-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--t1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sr-artist {
  font-size: 13px;
  font-weight: 400;
  color: var(--t2);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sr-type-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--accent);
  background: rgba(0,122,255,0.1);
  padding: 3px 8px;
  border-radius: 6px;
  flex-shrink: 0;
}
.sr-arrow {
  font-size: 15px;
  color: var(--t3);
  flex-shrink: 0;
}

/* ─────────────────────────────────────────
   FOOTER (Corporate Elite)
   ───────────────────────────────────────── */
footer {
  margin-top: 120px;
  padding-bottom: 64px;
  border-top: 1px solid rgba(255,255,255,0.03);
  padding-top: 48px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: rgba(255,255,255,0.25);
  font-weight: 600;
  letter-spacing: -0.2px;
}
.footer-links { display: flex; gap: 32px; }
.footer-links a { 
  color: inherit; 
  text-decoration: none; 
  transition: all 0.3s ease; 
  position: relative;
}
.footer-links a::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 1px;
  background: rgba(255,255,255,0.2);
  transition: width 0.3s ease;
}
.footer-links a:hover { color: #fff; }
.footer-links a:hover::after { width: 100%; }

@media (max-width: 600px) {
  .footer-inner { flex-direction: column; gap: 24px; text-align: center; }
}

/* ─────────────────────────────────────────
   PAGE LOADER
   ───────────────────────────────────────── */
#pageLoader {
  position: fixed; inset: 0;
  background: #000;
  z-index: 99999;
  transition: opacity 0.5s ease;
}
#pageLoader.loaded { opacity: 0; pointer-events: none; }

/* ─────────────────────────────────────────
   ANIMATIONS
   ───────────────────────────────────────── */
/* ── STAGGERED ENTRANCE ── */
.stagger-in > * {
  opacity: 0;
  transform: translateY(30px);
  animation: spring-in 1s cubic-bezier(0.2, 0.9, 0.3, 1.2) forwards;
}
.stagger-in > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-in > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-in > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-in > *:nth-child(4) { animation-delay: 0.4s; }

@keyframes spring-in {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse {
  0%,100% { opacity: 1; }
  50% { opacity: 0.4; }
}
@keyframes card-in {
  0%   { opacity: 0; transform: translateY(50px) scale(0.92); filter: blur(20px); }
  100% { opacity: 1; transform: none; filter: blur(0); }
}
@keyframes slide-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  25%      { transform: translateX(-6px); }
  75%      { transform: translateX(6px); }
}
.shake { animation: shake 0.4s ease; }

/* ─────────────────────────────────────────
   RESPONSIVE
   ───────────────────────────────────────── */
@media (max-width: 600px) {
  .hero { padding: 48px 0 36px; }
  .hero-title { letter-spacing: -2px; }
  .art-banner { height: 220px; }
  .result-body { padding: 20px 16px 0; }
  .dsp-section { padding: 20px 16px; }
  .input-row { flex-direction: column; }
  .search-btn { width: 100%; padding: 16px; }
  .nav-pill { display: none; }
}
