:root {
  color-scheme: light;
  --paper: #f6f0e6;
  --ink: #1d1a16;
  --muted: #61564c;
  --accent: #e95f3a;
  --accent-2: #1f7a6d;
  --accent-3: #f3b325;
  --accent-4: #2a4256;
  --card: #fff9f1;
  --shadow: rgba(30, 24, 18, 0.12);
  --radius: 22px;
  --border: rgba(29, 26, 22, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top, #fff4dc 0%, #f4ebdf 45%, #f0e1d0 100%);
  overflow-x: hidden;
}

.back-link {
  position: fixed;
  top: 24px;
  left: 24px;
  z-index: 5;
}

.back-link a {
  text-decoration: none;
  font-size: 0.95rem;
  color: var(--ink);
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 10px 20px -18px var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.back-link a:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px -20px var(--shadow);
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(0);
  opacity: 0.55;
  pointer-events: none;
}

.orb-one {
  width: 320px;
  height: 320px;
  top: -120px;
  right: -80px;
  background: radial-gradient(circle at 30% 30%, rgba(233, 95, 58, 0.55), rgba(233, 95, 58, 0));
}

.orb-two {
  width: 280px;
  height: 280px;
  bottom: 120px;
  left: -120px;
  background: radial-gradient(circle at 70% 30%, rgba(31, 122, 109, 0.45), rgba(31, 122, 109, 0));
}

.orb-three {
  width: 240px;
  height: 240px;
  bottom: -40px;
  right: 20%;
  background: radial-gradient(circle at 30% 70%, rgba(243, 179, 37, 0.4), rgba(243, 179, 37, 0));
}

.layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 120px 24px 80px;
  position: relative;
  z-index: 1;
}

.hero {
  background: linear-gradient(140deg, rgba(255, 249, 241, 0.96), rgba(246, 234, 215, 0.9));
  border-radius: calc(var(--radius) + 8px);
  padding: 48px;
  box-shadow: 0 25px 60px -40px var(--shadow);
  border: 1px solid rgba(29, 26, 22, 0.08);
}

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

.hero h1 {
  font-family: "Fraunces", "Times New Roman", serif;
  font-size: clamp(2.6rem, 4vw, 3.8rem);
  margin: 16px 0 12px;
}

.hero p {
  margin: 0 0 28px;
  color: var(--muted);
  max-width: 640px;
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 24px;
  align-items: center;
  margin-bottom: 32px;
}

button.primary {
  border: none;
  border-radius: 999px;
  padding: 12px 28px;
  background: var(--accent);
  color: #fffaf5;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 18px 30px -20px rgba(233, 95, 58, 0.7);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 32px -22px rgba(233, 95, 58, 0.7);
}

.toggle {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 0.95rem;
  color: var(--muted);
}

.toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-2);
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
}

.meta-card {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}

.meta-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.meta-value {
  font-weight: 600;
  margin-top: 6px;
}

.stats {
  margin-top: 36px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: 0 14px 28px -26px var(--shadow);
}

.stat-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.stat-value {
  font-size: clamp(2rem, 3vw, 2.6rem);
  font-weight: 700;
  margin-top: 12px;
  font-family: "Fraunces", "Times New Roman", serif;
}

.genres {
  margin-top: 48px;
}

.section-title {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.section-title h2 {
  margin: 0;
  font-size: 2rem;
  font-family: "Fraunces", "Times New Roman", serif;
}

.section-title p {
  margin: 0;
  color: var(--muted);
}

.genre-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.genre-card {
  background: #fffdf8;
  border-radius: var(--radius);
  padding: 22px;
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  box-shadow: 0 16px 34px -28px var(--shadow);
  transform: translateY(12px);
  opacity: 0;
  animation: floatIn 0.6s ease forwards;
  animation-delay: var(--delay, 0ms);
}

.genre-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.genre-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.genre-header h3 {
  margin: 0;
  font-size: 1.3rem;
}

.chip {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(31, 122, 109, 0.12);
  color: var(--accent-2);
}

.bar {
  margin: 18px 0 12px;
  height: 10px;
  background: rgba(29, 26, 22, 0.08);
  border-radius: 999px;
  position: relative;
  overflow: hidden;
}

.bar::before,
.bar::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  transition: width 0.3s ease;
}

.bar::before {
  width: var(--bar-total, 0%);
  background: linear-gradient(90deg, rgba(31, 122, 109, 0.35), rgba(31, 122, 109, 0.75));
}

.bar::after {
  width: var(--bar-sold, 0%);
  background: linear-gradient(90deg, rgba(233, 95, 58, 0.65), rgba(233, 95, 58, 0.95));
}

.genre-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--muted);
  position: relative;
  z-index: 1;
}

.genre-meta span strong {
  color: var(--ink);
}

.empty {
  margin-top: 18px;
  padding: 18px;
  background: rgba(233, 95, 58, 0.08);
  border-radius: var(--radius);
  border: 1px dashed rgba(233, 95, 58, 0.35);
}

.diagnostics {
  margin-top: 40px;
}

details {
  background: rgba(255, 255, 255, 0.7);
  border-radius: var(--radius);
  padding: 18px 24px;
  border: 1px solid var(--border);
}

summary {
  font-weight: 600;
  cursor: pointer;
}

.diag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 16px;
}

ul {
  padding-left: 18px;
  margin: 0;
  color: var(--muted);
}

pre {
  background: #1f1b16;
  color: #f9f1e8;
  padding: 14px;
  border-radius: 12px;
  overflow: auto;
  font-size: 0.85rem;
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 720px) {
  .layout {
    padding: 120px 16px 60px;
  }

  .hero {
    padding: 32px 24px;
  }

  .back-link {
    position: static;
    padding: 18px 18px 0;
  }

  .back-link a {
    display: inline-block;
  }
}

@media (prefers-reduced-motion: reduce) {
  .genre-card {
    animation: none;
    opacity: 1;
    transform: none;
  }

  button.primary {
    transition: none;
  }
}
