:root {
  --bg: #100d16;
  --bg-2: #19121f;
  --panel: rgba(28, 23, 35, 0.88);
  --panel-strong: #241a2d;
  --ink: #fff8f1;
  --muted: #c8b8c5;
  --coral: #ff6f61;
  --peach: #ffc371;
  --teal: #3de0d0;
  --plum: #6a3dbf;
  --line: rgba(255, 248, 241, 0.13);
  --shadow: 0 24px 80px rgba(7, 3, 10, 0.42);
  --radius: 8px;
  --font: "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(16, 13, 22, 0.98) 0%, rgba(33, 23, 42, 0.98) 52%, rgba(21, 40, 47, 0.98) 100%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 120px);
  color: var(--ink);
  font-family: var(--font);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 111, 97, 0.12), transparent 36%),
    linear-gradient(90deg, rgba(61, 224, 208, 0.08), transparent 42%);
  mix-blend-mode: screen;
}

button, input, select { font: inherit; }
button { cursor: pointer; }

.shell {
  min-height: 660px;
  padding: 24px clamp(18px, 4vw, 58px) 118px;
  position: relative;
}

.nav,
.hero,
.toolbar,
.spotlight,
.card-line,
.status-row,
.drawer-actions,
.section-heading,
.library-heading,
.mood-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 1.08rem;
  font-weight: 900;
}

.brand span {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  background: linear-gradient(135deg, var(--coral), var(--peach));
  color: #1e0e14;
  box-shadow: 0 14px 36px rgba(255, 111, 97, 0.25);
  font-weight: 950;
}

.nav-actions,
.hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.primary-btn,
.ghost-btn,
.drawer-actions button,
.close-btn,
.hero-actions a,
.mood-buttons button {
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 850;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.primary-btn,
.ghost-btn,
.drawer-actions button,
.hero-actions a {
  padding: 11px 16px;
}

.primary-btn,
.drawer-actions button {
  background: linear-gradient(135deg, var(--coral), var(--peach));
  color: #211016;
  box-shadow: 0 16px 34px rgba(255, 111, 97, 0.24);
}

.primary-btn:hover,
.drawer-actions button:hover,
.hero-actions a:hover,
.mood-buttons button:hover {
  transform: translateY(-2px);
}

.ghost-btn {
  background: rgba(255, 248, 241, 0.09);
  border-color: var(--line);
  color: var(--ink);
}

.hero-actions { margin-top: 26px; }

.hero-actions a {
  color: var(--ink);
  text-decoration: none;
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.07);
}

.hero {
  min-height: 500px;
  align-items: flex-end;
}

.hero h1 {
  max-width: 900px;
  margin: 10px 0 18px;
  font-size: clamp(2.7rem, 7vw, 6.7rem);
  line-height: 0.89;
  letter-spacing: 0;
}

.hero p {
  max-width: 660px;
  color: #efe1ea;
  line-height: 1.72;
  font-size: 1.02rem;
}

.eyebrow {
  margin: 0;
  color: var(--teal);
  font-size: 0.74rem;
  font-weight: 950;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-pick {
  width: min(360px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(160deg, rgba(255, 248, 241, 0.12), rgba(255, 255, 255, 0.03)),
    rgba(24, 17, 31, 0.76);
  padding: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-pick span,
.metrics span,
.status-row span,
.progress-panel span,
.drawer-progress span,
.section-heading span {
  color: var(--muted);
  font-size: 0.79rem;
  font-weight: 850;
}

.hero-pick strong {
  display: block;
  margin: 10px 0;
  font-size: 1.75rem;
}

.hero-pick p {
  margin: 0 0 16px;
  color: var(--muted);
}

.hero-pick small {
  display: block;
  margin-top: 9px;
  color: #f5ced1;
  font-weight: 750;
}

.pick-score,
.mini-progress,
.drawer-progress i,
.rail-card i,
.progress-track {
  display: block;
  overflow: hidden;
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.pick-score i,
.mini-progress i,
.drawer-progress b,
.rail-card b,
.progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--coral), var(--peach), var(--teal));
}

.main {
  width: min(1220px, calc(100% - 32px));
  margin: -86px auto 52px;
  display: grid;
  gap: 20px;
  position: relative;
}

.main > *,
.metrics article,
.mood-strip > *,
.spotlight > *,
.toolbar > *,
.library-heading > * {
  min-width: 0;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
}

.metrics article,
.toolbar,
.spotlight,
.drawer-card,
.mood-strip,
.rail-section,
.library-heading {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.metrics article {
  padding: 16px;
}

.metrics strong {
  display: block;
  margin-top: 6px;
  font-size: 2rem;
}

.mood-strip {
  align-items: flex-end;
  padding: 20px;
}

.mood-strip h2,
.section-heading h2,
.library-heading h2 {
  margin: 4px 0 0;
  font-size: clamp(1.4rem, 3vw, 2.1rem);
}

.mood-buttons {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.mood-buttons button {
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--line);
  color: var(--ink);
}

.mood-buttons button.active {
  background: rgba(61, 224, 208, 0.18);
  border-color: rgba(61, 224, 208, 0.6);
  color: #d6fffb;
}

.toolbar {
  padding: 12px;
}

input,
select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: var(--radius);
  background: rgba(12, 10, 16, 0.82);
  color: var(--ink);
  padding: 12px;
  outline: 0;
}

input:focus,
select:focus {
  border-color: rgba(61, 224, 208, 0.58);
  box-shadow: 0 0 0 3px rgba(61, 224, 208, 0.12);
}

.spotlight {
  overflow: hidden;
  position: relative;
  padding: 24px;
  background:
    linear-gradient(125deg, rgba(255, 111, 97, 0.16), transparent 36%),
    linear-gradient(90deg, rgba(36, 26, 45, 0.92), rgba(18, 34, 42, 0.9));
}

.spotlight::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 5px;
  background: linear-gradient(90deg, var(--coral), var(--peach), var(--teal), var(--plum));
}

.spotlight-copy {
  max-width: 760px;
}

.spotlight h2 {
  margin: 4px 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
}

.spotlight p {
  color: #eadbe5;
  line-height: 1.6;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.project-tags span {
  border-radius: 999px;
  background: rgba(255, 111, 97, 0.16);
  color: #ffd5ce;
  padding: 6px 9px;
  font-size: 0.74rem;
  font-weight: 900;
}

.progress-panel {
  min-width: 250px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(7, 5, 10, 0.32);
  padding: 18px;
}

.progress-panel strong {
  display: block;
  margin: 8px 0;
  font-size: 3rem;
}

.progress-panel p {
  margin: 12px 0 0;
  color: var(--muted);
  font-weight: 750;
}

.rail-section {
  padding: 20px;
}

.section-heading,
.library-heading {
  box-shadow: none;
  background: transparent;
  border: 0;
  padding: 0;
}

.continue-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(250px, 1fr);
  gap: 12px;
  overflow-x: auto;
  padding: 16px 2px 2px;
  scrollbar-width: thin;
}

.rail-card {
  min-height: 132px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  color: var(--ink);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--poster) 42%, transparent), rgba(255, 255, 255, 0.03)),
    rgba(12, 10, 16, 0.72);
  transition: transform 0.2s ease, border-color 0.2s ease, filter 0.2s ease;
}

.rail-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--poster) 64%, white);
  filter: saturate(1.1);
}

.rail-card span,
.rail-card small {
  display: block;
}

.rail-card span {
  margin-bottom: 9px;
  font-size: 1.24rem;
  font-weight: 950;
}

.rail-card small {
  margin-bottom: 28px;
  color: #fff0ed;
  font-weight: 750;
}

.library-heading {
  padding-top: 8px;
}

.library-heading p {
  color: var(--muted);
  font-weight: 800;
}

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

.media-card {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  background: var(--panel-strong);
  box-shadow: 0 18px 48px rgba(7, 3, 10, 0.38);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.media-card:hover {
  transform: translateY(-7px) scale(1.018);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 30px 74px rgba(7, 3, 10, 0.56);
  z-index: 3;
}

.poster {
  position: relative;
  aspect-ratio: 2 / 3;
  min-height: 0;
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, transparent 0%, rgba(12, 5, 11, 0.62) 100%),
    linear-gradient(135deg, color-mix(in srgb, var(--poster) 72%, #271d2e), #130f17 72%);
}

.poster span {
  font-size: 3.2rem;
  font-weight: 950;
  color: rgba(255, 255, 255, 0.94);
  text-shadow: 0 10px 28px rgba(0, 0, 0, 0.32);
}

.poster b {
  position: absolute;
  left: 12px;
  bottom: 12px;
  border-radius: 999px;
  background: rgba(16, 13, 22, 0.76);
  color: #fff;
  padding: 6px 8px;
  font-size: 0.72rem;
}

.media-copy {
  padding: 13px;
}

.media-copy h3 {
  margin: 10px 0 6px;
}

.media-copy p {
  color: var(--muted);
  margin: 0 0 14px;
}

.mini-progress {
  height: 7px;
  margin-bottom: 10px;
}

.drawer {
  position: fixed;
  inset: 0 0 0 auto;
  width: 100%;
  display: flex;
  justify-content: flex-end;
  background: rgba(8, 5, 11, 0);
  pointer-events: none;
  transition: background 0.2s ease;
  z-index: 20;
}

.drawer.open {
  background: rgba(8, 5, 11, 0.55);
  pointer-events: auto;
}

.drawer-card {
  width: min(460px, 100%);
  height: 100%;
  overflow: auto;
  border-radius: 0;
  padding: 22px;
  background: #15101c;
  transform: translateX(100%);
  transition: transform 0.22s ease;
}

.drawer.open .drawer-card {
  transform: translateX(0);
}

.close-btn {
  float: right;
  width: 34px;
  height: 34px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  border-color: var(--line);
}

.drawer-card h2 {
  clear: both;
  font-size: 2.2rem;
}

.drawer-card p {
  color: #eadbe5;
  line-height: 1.65;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 18px 0;
}

.detail-grid div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
}

.detail-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
}

.drawer-progress {
  margin: 18px 0;
}

.drawer-progress span {
  display: block;
  margin-bottom: 8px;
}

.drawer-actions {
  flex-wrap: wrap;
  justify-content: flex-start;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  opacity: 0;
  transform: translateY(18px);
  background: #fff8f1;
  color: #211016;
  border-radius: var(--radius);
  padding: 12px 14px;
  font-weight: 900;
  box-shadow: var(--shadow);
  transition: 0.2s ease;
  z-index: 30;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.empty {
  color: var(--muted);
  font-weight: 750;
}

@media (max-width: 860px) {
  .hero,
  .spotlight,
  .toolbar,
  .mood-strip,
  .library-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .mood-buttons {
    justify-content: flex-start;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .progress-panel,
  .hero-pick {
    min-width: 0;
    width: 100%;
  }

  .main {
    margin-top: -48px;
  }
}

@media (max-width: 560px) {
  .nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .metrics,
  .detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero h1 {
    font-size: 2.45rem;
  }

  .continue-rail {
    grid-auto-columns: minmax(220px, 86vw);
  }
}
