/* =============================================
   SINDHI LADA — سنڌي لاڏا
   Design System & Styles
   ============================================= */

/* ── Reset ─────────────────────────────────── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ── Design Tokens ─────────────────────────── */
:root {
  /* Sindhi Heritage Palette */
  --color-bg-deep: #080510;
  --color-bg-dark: #0E0718;
  --color-crimson: #8B1538;
  --color-crimson-deep: #6B1028;
  --color-gold: #E8A317;
  --color-saffron: #FFD700;
  --color-terracotta: #D4652A;
  --color-amber: #F0A030;
  --color-indigo: #2D1B69;
  --color-indigo-deep: #1A0B2E;

  /* Surfaces */
  --surface: rgba(255, 255, 255, 0.07);
  --surface-hover: rgba(255, 255, 255, 0.12);
  --surface-active: rgba(255, 255, 255, 0.18);
  --border: rgba(255, 255, 255, 0.15);
  --border-subtle: rgba(255, 255, 255, 0.08);

  /* Text */
  --text: #FFF5E6;
  --text-muted: rgba(255, 245, 230, 0.65);
  --text-dim: rgba(255, 245, 230, 0.4);

  /* Typography */
  --font-ui: 'Inter', system-ui, -apple-system, sans-serif;
  --font-sindhi: 'Noto Nastaliq Urdu', serif;

  /* Shadows */
  --shadow-glass: 0 8px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  --shadow-glow-gold: 0 0 60px rgba(232, 163, 23, 0.15);
  --shadow-text: 0 2px 12px rgba(0, 0, 0, 0.6);

  /* Misc */
  --radius-full: 9999px;
  --transition: 250ms ease;
  --transition-fast: 150ms ease;
}

/* ── Base ──────────────────────────────────── */
html,
body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font-ui);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
  outline: none;
}

/* ── Background Layers ─────────────────────── */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: -10;
}

/* Layer 1: Base gradient */
.bg-gradient {
  background:
    radial-gradient(ellipse at 15% 50%, rgba(139, 21, 56, 0.35) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 20%, rgba(45, 27, 105, 0.30) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 85%, rgba(212, 101, 42, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 50%, rgba(26, 11, 46, 0.6) 0%, transparent 70%),
    linear-gradient(180deg, #080510 0%, #120820 40%, #0E0518 70%, #080510 100%);
}

/* Layer 2: User-replaceable background image */
.bg-image {
  background-image: url('./sindhi-hero.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.35;
  filter: brightness(0.5);
}

/* Layer 3: Sindhi embroidery pattern overlay */
.bg-pattern {
  opacity: 0.35;
  background-image:
    /* Large diamond grid */
    linear-gradient(45deg, rgba(232, 163, 23, 0.06) 1px, transparent 1px),
    linear-gradient(-45deg, rgba(232, 163, 23, 0.06) 1px, transparent 1px),
    /* Smaller inner grid */
    linear-gradient(45deg, rgba(139, 21, 56, 0.04) 1px, transparent 1px),
    linear-gradient(-45deg, rgba(139, 21, 56, 0.04) 1px, transparent 1px),
    /* Mirror-work dots */
    radial-gradient(circle 2px at center, rgba(232, 163, 23, 0.12) 1px, transparent 1px),
    radial-gradient(circle 1.5px at center, rgba(255, 215, 0, 0.08) 1px, transparent 1px);
  background-size:
    80px 80px,
    80px 80px,
    40px 40px,
    40px 40px,
    80px 80px,
    40px 40px;
  background-position:
    0 0,
    0 0,
    20px 20px,
    20px 20px,
    40px 40px,
    20px 20px;
  animation: patternDrift 60s linear infinite;
}

@keyframes patternDrift {
  0% {
    background-position: 0 0, 0 0, 20px 20px, 20px 20px, 40px 40px, 20px 20px;
  }

  100% {
    background-position: 80px 80px, -80px 80px, 60px 100px, -20px 100px, 120px 120px, 60px 100px;
  }
}

/* Layer 4: Vignette overlay */
.bg-vignette {
  background: radial-gradient(ellipse at center, transparent 40%, rgba(8, 5, 16, 0.7) 100%);
  pointer-events: none;
}

/* ── Floating Particles ────────────────────── */
.particles {
  position: fixed;
  inset: 0;
  z-index: -5;
  overflow: hidden;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--color-gold);
  opacity: 0;
  animation: particleFloat linear infinite;
}

@keyframes particleFloat {
  0% {
    opacity: 0;
    transform: translateY(100vh) scale(0);
  }

  10% {
    opacity: 0.6;
  }

  90% {
    opacity: 0.3;
  }

  100% {
    opacity: 0;
    transform: translateY(-10vh) scale(1);
  }
}

/* ── Main Layout ───────────────────────────── */
main {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  min-height: 100dvh;
  flex: 1;
  overflow: hidden;
  padding-bottom: 70px; /* Space for absolute footer */
}

/* ── HUD: Top Left — Clock ─────────────────── */
.hud-clock {
  position: fixed;
  left: 1.25rem;
  top: 1.25rem;
  z-index: 20;
  font-size: 0.875rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  text-shadow: var(--shadow-text);
  letter-spacing: 0.02em;
}

.hud-clock .clock-time {
  font-size: 1rem;
  font-weight: 600;
}

.hud-clock .clock-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── HUD: Top Center — Listeners ───────────── */
.hud-listeners {
  position: fixed;
  left: 50%;
  top: 1.25rem;
  z-index: 20;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 1rem 0.375rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  text-shadow: var(--shadow-text);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.hud-listeners .dot-container {
  position: relative;
  width: 10px;
  height: 10px;
  flex-shrink: 0;
}

.hud-listeners .dot-ping {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #4ade80;
  opacity: 0.75;
  animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.hud-listeners .dot-solid {
  position: relative;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.9);
}

@keyframes ping {

  75%,
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

.hud-listeners .count {
  font-variant-numeric: tabular-nums;
}

.hud-listeners .label {
  color: var(--text-muted);
}

/* ── HUD: Top Right — YouTube Link ─────────── */
.hud-links {
  position: fixed;
  right: 1.25rem;
  top: 1.25rem;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pill-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  text-shadow: var(--shadow-text);
  transition: var(--transition);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.pill-link:hover {
  background: var(--surface-hover);
  opacity: 0.9;
}

.pill-link:active {
  transform: scale(0.95);
}

.pill-link .pill-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.pill-link .pill-text {
  display: none;
}

.pill-link .pill-arrow {
  display: none;
  transform: rotate(-45deg);
  opacity: 0.5;
  transition: opacity var(--transition-fast);
}

.pill-link:hover .pill-arrow {
  opacity: 0.9;
}

@media (min-width: 640px) {
  .pill-link {
    padding: 0.5rem 0.875rem 0.5rem 0.75rem;
  }

  .pill-link .pill-text,
  .pill-link .pill-arrow {
    display: inline-flex;
  }
}

/* ── Title Section ─────────────────────────── */
.title-section {
  margin-top: 14vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 1.5rem;
  text-align: center;
  animation: fadeInUp 1s ease 0.3s both;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.title-sindhi {
  font-family: var(--font-sindhi);
  font-size: clamp(3rem, 10vw, 6rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.6;
  text-shadow:
    0 4px 24px rgba(0, 0, 0, 0.5),
    0 0 80px rgba(232, 163, 23, 0.12);
  direction: rtl;
}

.title-english {
  font-size: clamp(0.75rem, 2vw, 1rem);
  font-weight: 600;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin-top: 0.25rem;
  text-shadow: 0 0 20px rgba(232, 163, 23, 0.3);
}

.title-tagline {
  font-size: clamp(0.7rem, 1.5vw, 0.875rem);
  color: var(--text-muted);
  margin-top: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.05em;
}

/* ── Decorative Embroidery Border ──────────── */
.embroidery-border {
  width: 180px;
  height: 2px;
  margin-top: 1.25rem;
  position: relative;
  overflow: visible;
}

.embroidery-border::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
      transparent,
      var(--color-gold),
      var(--color-crimson),
      var(--color-gold),
      transparent);
  border-radius: 1px;
}

.embroidery-border::after {
  content: '◆';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: var(--color-gold);
  font-size: 0.5rem;
  text-shadow: 0 0 8px rgba(232, 163, 23, 0.5);
}

/* ── Player Section ────────────────────────── */
.player-section {
  margin-bottom: 6vh;
  width: 100%;
  max-width: 560px;
  padding: 0 1.5rem;
  display: flex;
  justify-content: center;
  animation: fadeInUp 1s ease 0.6s both;
}

.player-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 0.75rem 1.25rem 0.75rem 0.75rem;
  border-radius: 60px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(40px) saturate(1.5);
  -webkit-backdrop-filter: blur(40px) saturate(1.5);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: var(--shadow-glass);
  transition: box-shadow var(--transition);
}

.player-card:hover {
  box-shadow: var(--shadow-glass), var(--shadow-glow-gold);
}

/* ── Vinyl Record ──────────────────────────── */
.vinyl-container {
  position: relative;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}

.vinyl-disc {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  ring: 1px solid rgba(255, 255, 255, 0.2);
  animation: vinylSpin 8s linear infinite;
  animation-play-state: paused;
}

.vinyl-disc.spinning {
  animation-play-state: running;
}

@keyframes vinylSpin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.vinyl-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Vinyl center hole */
.vinyl-hole {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  border: 2px solid rgba(255, 255, 255, 0.35);
  pointer-events: none;
}

/* ── Track Info ────────────────────────────── */
.track-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.track-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.track-artist {
  font-size: 0.8125rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Progress Bar ──────────────────────────── */
.progress-container {
  margin-top: 0.5rem;
}

.progress-bar-wrapper {
  position: relative;
  height: 8px;
  width: 100%;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.progress-bar-track {
  position: absolute;
  inset: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.85);
  width: 0%;
  transition: width 0.3s linear;
}

.progress-bar-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 12px;
  height: 12px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: white;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.progress-bar-wrapper:hover .progress-bar-thumb {
  opacity: 1;
}

.progress-time {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 0.6875rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
}

/* ── Player Controls ───────────────────────── */
.player-controls {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.ctrl-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--text-muted);
  transition: var(--transition-fast);
}

.ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

.ctrl-btn:active {
  transform: scale(0.93);
}

.ctrl-btn svg {
  width: 18px;
  height: 18px;
}

/* Play Button */
.play-btn {
  width: 44px;
  height: 44px;
  background: white;
  color: #111 !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.play-btn:hover {
  background: white !important;
  transform: scale(1.08);
  color: #111 !important;
}

.play-btn:active {
  transform: scale(0.95) !important;
}

.play-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.play-btn svg {
  width: 20px;
  height: 20px;
}

/* ── Audio Visualizer Bars (Decorative) ────── */
.visualizer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.visualizer.active {
  opacity: 0.15;
}

.viz-bar {
  width: 3px;
  border-radius: 1.5px 1.5px 0 0;
  background: linear-gradient(to top, var(--color-crimson), var(--color-gold));
  animation: vizPulse 0.8s ease-in-out infinite alternate;
  animation-play-state: paused;
}

.visualizer.active .viz-bar {
  animation-play-state: running;
}

@keyframes vizPulse {
  0% {
    height: 4px;
  }

  100% {
    height: var(--viz-height, 30px);
  }
}

/* ── Click-to-Start Overlay ────────────────── */
.start-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(8, 5, 16, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  cursor: pointer;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.start-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.start-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  display: grid;
  place-items: center;
  margin-bottom: 1.5rem;
  transition: var(--transition);
  animation: breathe 2s ease-in-out infinite;
}

@keyframes breathe {

  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(232, 163, 23, 0.3);
  }

  50% {
    transform: scale(1.05);
    box-shadow: 0 0 30px 10px rgba(232, 163, 23, 0.1);
  }
}

.start-overlay:hover .start-icon {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--color-gold);
}

.start-icon svg {
  width: 32px;
  height: 32px;
  fill: white;
  margin-left: 4px;
}

.start-text {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.start-text-sindhi {
  font-family: var(--font-sindhi);
  font-size: 1.25rem;
  color: var(--text);
  margin-bottom: 0.5rem;
  direction: rtl;
}

/* ── YouTube IFrame (hidden via wrapper in HTML) ── */

/* ── Scroll to hide overflow ───────────────── */
::-webkit-scrollbar {
  display: none;
}

/* ── Loading State ─────────────────────────── */
.loading .track-title::after {
  content: '';
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-muted);
  margin-left: 4px;
  animation: loadDot 1s ease-in-out infinite;
}

/* ── Footer ────────────────────────────────── */
.site-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 1.5rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  animation: fadeInUp 1s ease 0.9s both;
  z-index: 10;
}

.site-footer .heart {
  color: var(--color-crimson);
  display: inline-block;
  animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  14% { transform: scale(1.3); }
  28% { transform: scale(1); }
  42% { transform: scale(1.3); }
  70% { transform: scale(1); }
}

@keyframes loadDot {

  0%,
  100% {
    opacity: 0.3;
  }

  50% {
    opacity: 1;
  }
}

/* ── Responsive ────────────────────────────── */
@media (max-width: 480px) {
  .title-section {
    margin-top: 10vh;
  }

  .player-card {
    gap: 0.75rem;
    padding: 0.625rem 1rem 0.625rem 0.625rem;
    border-radius: 50px;
  }

  .vinyl-container {
    width: 56px;
    height: 56px;
  }

  .vinyl-hole {
    width: 10px;
    height: 10px;
  }

  .player-controls {
    gap: 0;
  }

  .ctrl-btn {
    width: 32px;
    height: 32px;
  }

  .play-btn {
    width: 38px;
    height: 38px;
  }

  .hud-clock {
    left: 0.75rem;
    top: 0.75rem;
  }

  .hud-clock .clock-date {
    display: none; /* Save space on small screens */
  }

  .hud-listeners {
    top: 0.75rem;
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem 0.25rem 0.5rem;
  }

  .hud-links {
    right: 0.75rem;
    top: 0.75rem;
    gap: 0.25rem;
  }

  .site-footer {
    padding: 1rem;
    font-size: 0.65rem;
  }

  .title-sindhi {
    font-size: clamp(2.5rem, 8vw, 4rem);
  }

  .player-section {
    margin-bottom: 4vh;
    padding: 0 1rem;
  }
}

@media (max-height: 600px) {
  .title-section {
    margin-top: 6vh;
  }

  .title-sindhi {
    font-size: clamp(2rem, 8vw, 3.5rem);
  }

  .player-section {
    margin-bottom: 3vh;
  }
}

/* ── Ambient Glow behind player ────────────── */
.player-section::before {
  content: '';
  position: absolute;
  width: 300px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(139, 21, 56, 0.2), transparent 70%);
  filter: blur(40px);
  pointer-events: none;
  z-index: -1;
}

/* ── Selection Color ───────────────────────── */
::selection {
  background: rgba(232, 163, 23, 0.3);
  color: var(--text);
}