:root {
  --bg: #0d0f14;
  --surface: #151922;
  --surface-elevated: #1c2230;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(245, 158, 11, 0.35);
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --accent: #f59e0b;
  --accent-bright: #fbbf24;
  --accent-ink: #111318;
  --success: #34d399;
  --success-bg: rgba(16, 185, 129, 0.12);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-card: 0 20px 60px rgba(0, 0, 0, 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  overflow-x: clip;
  position: relative;
}

.bg-glow {
  position: fixed;
  inset: -20% -10% auto -10%;
  height: 460px;
  background: radial-gradient(
    ellipse 60% 55% at 50% 0%,
    rgba(245, 158, 11, 0.14),
    rgba(245, 158, 11, 0.03) 55%,
    transparent 80%
  );
  pointer-events: none;
  z-index: 0;
}

.container {
  width: 100%;
  max-width: 780px;
  margin-inline: auto;
  padding-inline: 18px;
  position: relative;
  z-index: 1;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(13, 15, 20, 0.72);
  backdrop-filter: blur(10px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 14px;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-size: 0.98rem;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(245, 158, 11, 0.14);
  color: var(--accent-bright);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.secure-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--success);
  background: var(--success-bg);
  border: 1px solid rgba(52, 211, 153, 0.25);
  padding: 5px 10px;
  border-radius: 999px;
}

.back-link {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  transition: color 0.15s ease, border-color 0.15s ease;
}

.back-link:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Main & Desktop Ad Rails Layout */
.page-shell {
  flex: 1;
  width: 100%;
  position: relative;
  z-index: 1;
}

.ad-rail {
  display: none;
}

.ad-frame--sky {
  width: 160px;
  height: 600px;
  border: 1px solid var(--border);
}

.ad-frame--sky-sm {
  width: 160px;
  height: 300px;
  border: 1px solid var(--border);
}

.main-content {
  flex: 1;
  padding-block: 24px 44px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

@media (min-width: 1200px) {
  .page-shell {
    max-width: 1184px;
    margin-inline: auto;
    padding-inline: 18px;
    display: grid;
    grid-template-columns: 160px minmax(0, 780px) 160px;
    gap: 24px;
    align-items: stretch;
  }

  .page-shell > .main-content {
    grid-column: 2;
    grid-row: 1;
    max-width: none;
    padding-inline: 0;
  }

  .ad-rail {
    display: block;
    grid-row: 1;
    padding-block: 24px 44px;
  }

  .ad-rail--left {
    grid-column: 1;
  }

  .ad-rail--right {
    grid-column: 3;
  }

  .ad-rail-sticky {
    position: sticky;
    top: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
  }
}

.main-content--centered {
  justify-content: flex-start;
  align-items: center;
}

.main-content--centered > * {
  width: 100%;
}

/* Adsterra slots - fixed CLS-safe containers */
.ad-slot {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.ad-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  user-select: none;
}

.ad-frame {
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: rgba(21, 25, 34, 0.42);
}

/* Exact top banner box: 320x50 mobile, 728x90 desktop (CLS = 0) */
.ad-frame--top {
  width: 320px;
  height: 50px;
  max-width: 100%;
}

@media (min-width: 768px) {
  .ad-frame--top {
    width: 728px;
    height: 90px;
  }

  .ad-slot--mobile-only {
    display: none;
  }
}

/* Exact 300x250 rectangle box (CLS = 0) */
.ad-frame--rect {
  width: 300px;
  height: 250px;
  max-width: 100%;
  border: 1px solid var(--border);
}

/* Native Banner 4:1 - placed below primary card with reserved min-height */
.ad-frame--native {
  width: 100%;
  min-height: 220px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(21, 25, 34, 0.55);
  border: 1px solid var(--border);
  color: var(--text);
}

.ad-frame--native > div {
  width: 100%;
}

/* Download Card */
.download-card {
  background: linear-gradient(180deg, var(--surface) 0%, #12161f 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 26px;
  box-shadow: var(--shadow-card);
}

.download-card--centered {
  max-width: 620px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.vinyl-wrap {
  width: 112px;
  height: 112px;
  margin-bottom: 16px;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.45));
}

.vinyl-wrap--sm {
  width: 88px;
  height: 88px;
  margin-bottom: 14px;
}

.vinyl-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.vinyl-wrap.is-spinning .vinyl-svg {
  animation: spin 3s linear infinite;
  will-change: transform;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.artist-label {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-bright);
}

.track-title {
  margin: 6px 0 6px;
  font-size: clamp(1.55rem, 3.8vw, 2.15rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-weight: 800;
}

.track-title--sm {
  font-size: clamp(1.4rem, 3.2vw, 1.85rem);
}

.track-filename {
  margin: 0 0 14px;
  font-size: 0.88rem;
  color: var(--text-muted);
  word-break: break-word;
}

.spec-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.spec-list--centered {
  justify-content: center;
}

.spec-chip {
  font-size: 0.78rem;
  font-weight: 600;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 999px;
}

.spec-chip--accent {
  color: #fde68a;
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.3);
}

.divider {
  width: 100%;
  height: 1px;
  background: var(--border);
  margin: 22px 0;
}

/* Action Panels */
.action-panel {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.is-hidden {
  display: none !important;
}

.btn-primary {
  width: 100%;
  max-width: 400px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 24px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-bright) 0%, var(--accent) 100%);
  color: var(--accent-ink);
  font-size: 1.06rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(245, 158, 11, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 14px 32px rgba(245, 158, 11, 0.36);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:focus-visible {
  outline: 3px solid rgba(251, 191, 36, 0.55);
  outline-offset: 3px;
}

.btn-primary--ready {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  box-shadow: 0 10px 28px rgba(16, 185, 129, 0.28);
}

.btn-primary--ready:hover {
  box-shadow: 0 14px 32px rgba(16, 185, 129, 0.36);
}

.btn-size {
  font-size: 0.82rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(17, 19, 24, 0.16);
}

.helper-text {
  margin: 0;
  font-size: 0.86rem;
  color: var(--text-muted);
  max-width: 460px;
}

/* 8-second progress bar */
.wait-header {
  width: 100%;
  max-width: 480px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.wait-status {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  text-align: left;
}

.wait-metrics {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.wait-percent {
  font-size: 0.86rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  min-width: 3.6ch;
  text-align: right;
}

.wait-timer {
  font-size: 0.86rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--accent-bright);
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid var(--border-strong);
  padding: 4px 11px;
  border-radius: 999px;
  min-width: 4.5ch;
  text-align: center;
}

.progress-track {
  width: 100%;
  max-width: 480px;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.progress-fill {
  height: 100%;
  width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-bright) 100%);
  box-shadow: 0 0 16px rgba(251, 191, 36, 0.35);
  transform: scaleX(0);
  transform-origin: left center;
  will-change: transform;
}

.ready-banner {
  width: 100%;
  max-width: 460px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--success-bg);
  border: 1px solid rgba(52, 211, 153, 0.3);
  color: #a7f3d0;
  font-size: 0.9rem;
  font-weight: 600;
}

/* Discreet SEO Info Block (below fold on Home) */
.seo-section {
  margin-top: 10px;
  padding: 22px 24px;
  border-radius: var(--radius-md);
  background: rgba(21, 25, 34, 0.55);
  border: 1px solid var(--border);
}

.seo-section h2 {
  margin: 0 0 10px;
  font-size: 1.04rem;
  font-weight: 700;
  color: var(--text);
}

.seo-section > p {
  margin: 0 0 16px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.seo-section strong {
  color: #e2e8f0;
  font-weight: 600;
}

.audio-facts {
  margin: 0 0 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.audio-facts > div {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
}

.audio-facts dt {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.audio-facts dd {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 600;
  color: #e2e8f0;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.faq-item {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  padding: 10px 14px;
}

.faq-item summary {
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  color: #e2e8f0;
}

.faq-item p {
  margin: 8px 0 0;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.faq-item code {
  color: #fde68a;
  font-size: 0.82rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 18px;
  margin-top: auto;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-copy {
  margin: 0;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-link {
  background: none;
  border: none;
  padding: 4px 2px;
  color: var(--text-muted);
  font-size: 0.84rem;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.15s ease;
}

.footer-link:hover {
  color: var(--text);
}

/* Modals */
.legal-modal {
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-elevated);
  color: var(--text);
  max-width: 520px;
  width: calc(100% - 32px);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
}

.legal-modal::backdrop {
  background: rgba(5, 7, 11, 0.72);
  backdrop-filter: blur(4px);
}

.modal-box {
  padding: 20px 22px 22px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.modal-head h2 {
  margin: 0;
  font-size: 1.1rem;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.12);
}

.modal-body p,
.modal-body ul {
  margin: 0 0 12px;
  font-size: 0.9rem;
  color: #cbd5e1;
}

.modal-body p:last-child {
  margin-bottom: 0;
}

.modal-body ul {
  padding-left: 20px;
}

.contact-box {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border);
  text-align: center;
}

.contact-box code {
  font-size: 0.95rem;
  color: var(--accent-bright);
}

/* Responsive */
@media (max-width: 640px) {
  .main-content {
    padding-block: 18px 34px;
    gap: 18px;
  }

  .download-card {
    padding: 24px 18px;
  }

  .vinyl-wrap {
    width: 96px;
    height: 96px;
  }

  .ad-frame--native {
    min-height: 340px;
    padding: 10px;
  }

  .wait-header {
    min-height: 2.8em;
  }

  .audio-facts {
    grid-template-columns: 1fr;
  }

  .seo-section {
    padding: 18px 16px;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .vinyl-wrap.is-spinning .vinyl-svg {
    animation: none;
  }

  .btn-primary {
    transition: none;
  }
}
