/* Modern Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Core Palette - Dark Mode Default */
  --bg-base: #000000;
  --bg-gradient-start: #0f172a;
  --bg-gradient-end: #000000;

  /* Glass Surface */
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-highlight: rgba(255, 255, 255, 0.15);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);

  /* Text */
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.6);
  --text-accent: #60a5fa;
  /* Blue-ish */

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #60a5fa 0%, #a855f7 100%);
  --gradient-surface: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.0) 100%);

  /* Spacing & Radius */
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 8px;
  --radius-full: 9999px;

  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 3rem;

  /* Animation */
  --ease-elastic: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg-base: #f8fafc;
    --bg-gradient-start: #f1f5f9;
    --bg-gradient-end: #e2e8f0;

    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-highlight: rgba(255, 255, 255, 0.8);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);

    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-accent: #3b82f6;

    --gradient-surface: linear-gradient(180deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.4) 100%);
  }
}

body {
  font-family: 'Outfit', 'Inter', sans-serif;
  /* Assuming font is loaded or fallback */
  background-color: var(--bg-base);
  background-image:
    radial-gradient(circle at 0% 0%, rgba(96, 165, 250, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 100% 100%, rgba(168, 85, 247, 0.15) 0%, transparent 50%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  padding-bottom: 100px;
  /* Tabbar space */
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

img {
  display: block;
  max-width: 100%;
}

/* --- Layout --- */
.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--spacing-md);
  padding-top: 90px;
  /* Topbar space */
  animation: fadeIn 0.6s var(--ease-smooth);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Components: Topbar --- */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 70px;
  background: rgba(var(--bg-base), 0.7);
  /* Fallback */
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--spacing-md);
  z-index: 1000;
}

.brand {
  font-weight: 800;
  font-size: 1.5rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.03em;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all 0.3s var(--ease-elastic);
  color: var(--text-primary);
}

.icon-btn:hover {
  transform: scale(1.1) rotate(5deg);
  background: var(--glass-highlight);
  box-shadow: 0 0 15px rgba(96, 165, 250, 0.3);
}

/* --- Components: Tabbar --- */
.tabbar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 40px);
  max-width: 500px;
  height: 64px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  display: flex;
  justify-content: space-between;
  padding: 4px;
  box-shadow: var(--glass-shadow);
  z-index: 1000;
}

.tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.3s var(--ease-smooth);
  position: relative;
  overflow: hidden;
}

.tab:hover {
  color: var(--text-primary);
}

.tab.is-active {
  background: var(--text-primary);
  color: var(--bg-base);
  /* Invert for contrast */
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* --- Sections --- */
.section {
  margin-bottom: var(--spacing-xl);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-lg);
}

.section-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(to right, var(--text-primary), var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.chip {
  padding: 6px 16px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.chip:hover {
  background: var(--glass-highlight);
  transform: translateY(-1px);
}

/* --- Cards (Liquid Glass) --- */
.grid {
  display: grid;
  gap: var(--spacing-lg);
}

.album-sm {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.album-md {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.card {
  position: relative;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.4s var(--ease-elastic);
  background-image: var(--gradient-surface);
}

.card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.3);
  border-color: var(--glass-highlight);
  z-index: 10;
}

.album-cover {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.card:hover .album-cover {
  transform: scale(1.05);
}

.album-body {
  padding: var(--spacing-md);
  position: relative;
  z-index: 2;
}

.album-title {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.album-sub {
  font-size: 0.9rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meta-top {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-accent);
  text-transform: uppercase;
  margin-bottom: 6px;
  letter-spacing: 0.05em;
}

.aoty-desc {
  margin-top: var(--spacing-md);
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: all 0.3s ease;
}

.aoty-desc.is-expanded {
  -webkit-line-clamp: unset;
  overflow: visible;
  color: var(--text-primary);
}

/* --- Artists --- */
.artist-row {
  display: flex;
  gap: var(--spacing-lg);
  overflow-x: auto;
  padding: 10px 4px 20px 4px;
  /* Space for shadow */
  scrollbar-width: none;
}

.artist-row::-webkit-scrollbar {
  display: none;
}

.artist-chip {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-sm);
  width: 100px;
  cursor: pointer;
  transition: transform 0.3s var(--ease-elastic);
}

.artist-chip:hover {
  transform: translateY(-5px);
}

.artist-avatar {
  width: 90px;
  height: 90px;
  border-radius: 40%;
  /* Squircle */
  object-fit: cover;
  border: 2px solid var(--glass-border);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.artist-chip:hover .artist-avatar {
  border-color: var(--text-accent);
  box-shadow: 0 12px 30px rgba(96, 165, 250, 0.4);
  border-radius: 50%;
}

.artist-name {
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  color: var(--text-primary);
}

/* Artist List Items */
.artist-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  margin-bottom: var(--spacing-md);
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
}

.artist-item:hover {
  background: var(--glass-highlight);
  transform: translateX(5px);
}

.artist-item .avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
}

.artist-name-line {
  font-weight: 700;
  font-size: 1.1rem;
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.badge {
  font-size: 0.65rem;
  background: var(--gradient-primary);
  color: white;
  padding: 4px 8px;
  border-radius: 6px;
  font-weight: 800;
  text-transform: uppercase;
}

.link-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pill {
  font-size: 0.75rem;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  transition: all 0.2s ease;
}

.pill:hover {
  background: var(--text-primary);
  color: var(--bg-base);
  border-color: transparent;
}

/* Segments */
.seg {
  display: flex;
  background: rgba(0, 0, 0, 0.2);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--glass-border);
}

.seg-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 8px 20px;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.seg-btn.is-active {
  background: var(--glass-highlight);
  color: var(--text-primary);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.empty {
  padding: var(--spacing-xl);
  text-align: center;
  color: var(--text-secondary);
  font-style: italic;
  background: var(--glass-bg);
  border-radius: var(--radius-md);
}

/* --- Artist Detail Page --- */
.artist-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: var(--spacing-xl);
  padding: var(--spacing-xl) 0;
  background: linear-gradient(180deg, var(--glass-bg) 0%, transparent 100%);
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
}

.hero-avatar {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--glass-border);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  margin-bottom: var(--spacing-md);
}

.hero-name {
  font-size: 3rem;
  font-weight: 900;
  margin-bottom: var(--spacing-sm);
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-links {
  margin-top: var(--spacing-md);
  display: flex;
  gap: var(--spacing-sm);
  justify-content: center;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: var(--spacing-md);
  color: var(--text-secondary);
  font-weight: 600;
  transition: color 0.2s;
}

.back-btn:hover {
  color: var(--text-primary);
}