:root {
  --ink: #1b1324;
  --ink-deep: #100a18;
  --sand: #f3d9b1;
  --rose: #f45b69;
  --ember: #e26d5c;
  --fog: rgba(255, 255, 255, 0.08);
  --glow: rgba(248, 233, 255, 0.4);
  --font-display: "Palatino Linotype", "Book Antiqua", Palatino, serif;
  --font-body: "Optima", "Gill Sans", Candara, "Trebuchet MS", sans-serif;
  --transition: 220ms ease;
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: #06040b;
  color: #f8efe0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0;
}

.frame-shell {
  width: clamp(320px, 100vmin, 700px);
  height: clamp(320px, 100vmin, 700px);
}

.frame {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 10% 10%, #2d2244 0%, #17101f 40%, #0d0b14 100%);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}

.frame-shell {
  font-size: 1rem;
}

body[data-frame="md"] .track-name {
  font-size: 16px;
}

body[data-frame="md"] .track-number {
  font-size: 10px;
  letter-spacing: 2px;
}

body[data-frame="sm"] .track-name {
  font-size: 13px;
}

body[data-frame="sm"] .track-number {
  font-size: 9px;
  letter-spacing: 2px;
}

body[data-frame="xs"] .track-name {
  font-size: 11px;
}

body[data-frame="xs"] .track-number {
  font-size: 8px;
  letter-spacing: 2px;
}

.scene {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(0px);
  opacity: 0.7;
  mix-blend-mode: screen;
  animation: drift 18s ease-in-out infinite;
}

.orb-one {
  width: 38vw;
  height: 38vw;
  background: radial-gradient(circle, #f8e9ff 0%, rgba(248, 233, 255, 0) 70%);
  top: -10vw;
  left: -8vw;
}

.orb-two {
  width: 32vw;
  height: 32vw;
  background: radial-gradient(circle, #f45b69 0%, rgba(244, 91, 105, 0) 70%);
  bottom: -8vw;
  right: -6vw;
  animation-delay: -6s;
}

.grain {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E");
  opacity: 0.5;
}

main {
  position: relative;
  z-index: 1;
  padding: 12px 24px 16px;
  overflow: hidden;
  flex: 1;
}

body.view-track main {
  padding: 0;
}

body.view-track #track.view.is-active {
  height: 100%;
}

body.view-track .track-gallery {
  height: 100%;
}

body.view-track .media-stage {
  border-radius: 0;
  border: none;
  background: rgba(10, 8, 14, 0.4);
}

.view {
  display: none;
  animation: fadeUp 500ms ease;
}

.view.is-active {
  display: block;
}

#track.view.is-active {
  height: 100%;
}

#tracks.view.is-active {
  height: 100%;
  overflow-y: auto;
  padding-right: 6px;
}

.cover-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: center;
}

.cover-art img {
  width: 100%;
  max-width: 300px;
  border-radius: var(--radius);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45);
}

.cover-link {
  border: none;
  padding: 0;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
}

.cover-link:focus-visible {
  outline: 2px solid var(--sand);
  outline-offset: 6px;
}

.cover-copy {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tag {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 4px;
  color: rgba(248, 239, 224, 0.7);
}

h1,
h2 {
  font-family: var(--font-display);
  letter-spacing: 4px;
  margin: 0;
}

h1 {
  font-size: 2.4rem;
}

#cover-title {
  font-size: clamp(1.3rem, 3.6vmin, 2.1rem);
  line-height: 1.1;
}

h2 {
  font-size: 2rem;
}

.track-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  min-height: 2.4em;
  line-height: 1.3;
}

.track-title-bottom {
  -webkit-line-clamp: 1;
  min-height: 1.3em;
  font-size: 1.4rem;
}

.subtitle {
  font-size: 18px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(248, 239, 224, 0.8);
}

.lead {
  font-size: 16px;
  line-height: 1.6;
  color: rgba(248, 239, 224, 0.85);
}

.cover-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

@media (max-width: 560px) {
  .cover-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .cover-art img {
    max-width: 100%;
  }

  .cover-actions {
    gap: 10px;
  }
}

.primary,
.ghost {
  border: none;
  cursor: pointer;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 3px;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

.primary {
  background: var(--sand);
  color: var(--ink);
  box-shadow: 0 14px 30px rgba(244, 91, 105, 0.3);
}

.primary:hover {
  transform: translateY(-2px);
}

.ghost {
  background: rgba(248, 239, 224, 0.08);
  color: inherit;
  border: 1px solid rgba(248, 239, 224, 0.25);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
}

.icon-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}


.icon-btn .icon-pause {
  display: none;
}

.icon-btn.is-playing .icon-play {
  display: none;
}

.icon-btn.is-playing .icon-pause {
  display: block;
}

.is-hidden {
  display: none;
}

.ghost.toggle.is-active {
  border-color: var(--sand);
  color: var(--sand);
  box-shadow: inset 0 0 0 1px var(--sand);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 12px;
}

.section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.note {
  max-width: 320px;
  font-size: 14px;
  color: rgba(248, 239, 224, 0.7);
}

.track-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.track-card {
  position: relative;
  padding: 18px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(248, 239, 224, 0.1);
  cursor: pointer;
  text-align: left;
  color: #f8efe0;
  transition: transform var(--transition), border-color var(--transition);
}

.track-card:hover {
  transform: translateY(-4px);
  border-color: rgba(248, 239, 224, 0.4);
}

.track-number {
  font-size: 12px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: rgba(248, 239, 224, 0.6);
}

.track-name {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 2px;
  margin-top: 8px;
}

.player-label {
  font-size: 12px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: rgba(248, 239, 224, 0.7);
  margin-bottom: 12px;
}

.status {
  font-size: 13px;
  color: rgba(248, 239, 224, 0.6);
  margin-top: 10px;
}

.audio-status {
  margin-top: 0;
  margin-bottom: 0;
}

.track-tag {
  margin: 0;
}

.track-gallery {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.track-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0 0 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: auto;
  transition: opacity 240ms ease, transform 240ms ease;
  z-index: 3;
}

.track-bottom-panel {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(10, 8, 14, 0.78);
  border-top: 1px solid rgba(248, 239, 224, 0.1);
}

.track-bottom-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 100%;
}

.track-bottom-controls {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 10px;
}

.control-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.seek-group {
  width: 100%;
}

.seek-slider {
  width: 100%;
  appearance: none;
  height: 6px;
  border-radius: 999px;
  background: rgba(248, 239, 224, 0.2);
  outline: none;
  cursor: pointer;
}

.seek-slider::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--sand);
  border: 2px solid rgba(12, 8, 18, 0.8);
}

.seek-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--sand);
  border: 2px solid rgba(12, 8, 18, 0.8);
}

.asset-group {
  justify-content: flex-end;
}

#track.is-idle .track-bottom {
  opacity: 0.05;
  transform: translateY(14px);
}

.media-stage {
  flex: 1;
  min-height: 0;
  background: #0d0b14;
  border-radius: var(--radius);
  border: 1px solid rgba(248, 239, 224, 0.12);
  position: relative;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 12px;
}

.media-slot {
  position: absolute;
  inset: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 260ms ease;
}

.media-slot.is-active {
  opacity: 1;
}

.media-slot img,
.media-slot video {
  max-width: 100%;
  max-height: 100%;
  border-radius: 12px;
}

.media-thumbs {
  display: flex;
  gap: 10px;
  margin-top: 0;
  flex-wrap: wrap;
  padding: 0 16px 8px;
  transition: opacity 240ms ease, transform 240ms ease;
  pointer-events: auto;
}

#track.is-idle .media-thumbs {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}

.media-thumb {
  width: 70px;
  height: 52px;
  border-radius: 10px;
  border: 1px solid rgba(248, 239, 224, 0.2);
  overflow: hidden;
  cursor: pointer;
  opacity: 0.7;
}

.media-thumb.is-active {
  opacity: 1;
  border-color: var(--sand);
}

.media-thumb img,
.media-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}


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

@keyframes drift {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(40px, -20px);
  }
}
