/* Mobile track-detail cover + site-wide reading contrast.
   Desktop two-column layout at widths above 900px stays unchanged. */

/* Stronger dimmer so text is not fighting the circuit scene behind the glass. */
html:root[data-theme] body dialog.detail::backdrop,
html:root[data-theme] body dialog.mini-dialog::backdrop,
html:root[data-theme] body #track-detail::backdrop,
html:root[data-theme] body .pack-checkout-dialog::backdrop {
  background: rgba(2, 6, 3, .86) !important;
  -webkit-backdrop-filter: blur(18px) saturate(80%) !important;
  backdrop-filter: blur(18px) saturate(80%) !important;
}
html:root[data-theme="light"] body dialog.detail::backdrop,
html:root[data-theme="light"] body dialog.mini-dialog::backdrop,
html:root[data-theme="light"] body #track-detail::backdrop,
html:root[data-theme="light"] body .pack-checkout-dialog::backdrop {
  background: rgba(8, 22, 12, .62) !important;
}

/* Solid enough panel for WCAG AA body text, still a tinted glass sheet. */
html:root[data-theme][data-theme] body dialog.detail,
html:root[data-theme][data-theme] body #track-detail {
  background-color: rgba(6, 14, 9, .94) !important;
}
html:root[data-theme="light"][data-theme] body dialog.detail,
html:root[data-theme="light"][data-theme] body #track-detail {
  background-color: rgba(236, 246, 239, .96) !important;
}

/* Display titles were Bebas Neue with negative letter-spacing and a hairline
   stroke, so letters collided and looked blurry, especially on a phone. */
html body #track-detail h2,
html body dialog.detail h2 {
  letter-spacing: .03em !important;
  line-height: 1.15 !important;
  overflow-wrap: anywhere;
  -webkit-text-stroke: 0 !important;
  text-shadow: none !important;
}

#track-detail .detail-close,
dialog.detail .detail-close {
  z-index: 6;
}

/* Phone portrait and landscape (iPhone 14 landscape is 844px, above the old 720px breakpoint). */
@media (max-width: 900px) {
  html body dialog.detail,
  html body #track-detail.detail {
    width: calc(100% - 16px);
    max-width: 100%;
    max-height: 90dvh;
    overflow: auto;
    overscroll-behavior: contain;
  }

  html body #track-detail .detail-grid,
  html body dialog.detail .detail-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto auto;
  }

  html body #track-detail .detail-art,
  html body dialog.detail .detail-art {
    position: relative;
    width: min(100%, 58dvh);
    max-width: 100%;
    min-width: 0;
    min-height: 0 !important;
    max-height: 58dvh !important;
    aspect-ratio: 1 / 1;
    place-items: stretch;
    justify-self: center;
  }

  html body #track-detail .detail-art > .vault-artwork,
  html body dialog.detail .detail-art > .vault-artwork {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    border-radius: 0;
  }

  html body #track-detail .detail-art img,
  html body #track-detail .detail-art .vault-wave-image,
  html body dialog.detail .detail-art img {
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
  }

  html body #track-detail .detail-content,
  html body dialog.detail .detail-content {
    padding: 20px 18px 24px;
    min-width: 0;
  }

  html body #track-detail h2,
  html body dialog.detail h2 {
    font-size: clamp(1.7rem, 8vw, 2.35rem) !important;
    line-height: 1.18 !important;
    letter-spacing: .045em !important;
    margin: 16px 52px 10px 0;
  }

  /* Minimum sizes: labels >= 12px, body >= 15px. */
  html body .detail-kicker,
  html body .radio-tag,
  html body .detail-meta span,
  html body .pill,
  html body .pack-samples span,
  html body .artist,
  html body .queue-item span,
  html body .timeline,
  html body .private,
  html body .summary,
  html body .download-lock,
  html body .track-feedback .detail-kicker {
    font-size: 12px !important;
    line-height: 1.45 !important;
    letter-spacing: .08em;
  }

  html body .detail-description,
  html body .detail-content p,
  html body .detail-artist,
  html body .detail-meta b,
  html body .headline p,
  html body .public-home p,
  html body .track-feedback p,
  html body .track-feedback #track-feedback-list,
  html body .playerbar,
  html body .playerbar .playing-info,
  html body .playerbar .playing-info span,
  html body .playerbar .time,
  html body .now-title,
  html body .now-sub {
    font-size: 15px !important;
    line-height: 1.55 !important;
  }

  html body .playerbar .playing-info span,
  html body .playerbar .timeline,
  html body .playing-info span {
    color: color-mix(in srgb, var(--vault-neon, #2dff3a) 72%, white) !important;
  }
}

/* Dim hardcoded greys: lift to a readable green-on-dark mix (>= 4.5:1 on the panel). */
html:root[data-theme="dark"] body .detail-description,
html:root[data-theme="dark"] body .pill,
html:root[data-theme="dark"] body .pack-samples span,
html:root[data-theme="dark"] body .pack-body p {
  color: color-mix(in srgb, var(--vault-neon, #2dff3a) 68%, white) !important;
}

html:root[data-theme="dark"] body .playerbar .playing-info span,
html:root[data-theme="dark"] body .playerbar .timeline {
  color: color-mix(in srgb, var(--vault-neon, #2dff3a) 72%, white) !important;
}
