:root { --ease: cubic-bezier(.2,.8,.2,1); }
html, body { scroll-behavior: smooth; }

.reveal { opacity: 1; transform: none; } /* animation removed */
.revealed { /* no longer needed */ }

details summary::-webkit-details-marker { display: none; }
details[open] { background: #171717; } /* neutral-900 */

/* focus styles for keyboard users */
:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* Custom text selection for dark theme */
::selection { background: #ffffff; color: #000000; }
::-moz-selection { background: #ffffff; color: #000000; }

/* Animated process line */
#process-path {
    transition: stroke-dashoffset 2s cubic-bezier(0.455, 0.03, 0.515, 0.955);
}

/* Custom cursor */
#cursor-dot {
    width: 32px;
    height: 32px;
    background: radial-gradient(circle, rgba(255,255,255,.25) 0%, transparent 70%);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    transform: translate(-50%, -50%);
    transition: width 0.2s ease, height 0.2s ease;
    z-index: 9999;
    left: -100px; /* Initially hidden */
}
@media (pointer: coarse) {
    #cursor-dot {
        display: none;
    }
}
#cursor-dot.interactive {
    width: 48px;
    height: 48px;
}

#scroll-progress { position: fixed; inset: 0 auto auto 0; height: 2px; width: 0; background: #fff; z-index: 99999; transition: width .2s var(--ease); }

@media (prefers-reduced-motion: reduce) {
  html, body { scroll-behavior: auto; }
  #process-path { transition-duration: 0.01ms !important; }
  .page-content { animation: none !important; }
}

.nav-link.active { color: #fff !important; }

body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }

.cta-link { transition: transform .2s var(--ease), opacity .2s var(--ease); }
.cta-link:hover { transform: translateY(-1px); }

.cta-gradient {
  background-image: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.05) 0%, transparent 60%);
}

.rounded-xl.border { transition: transform .3s var(--ease), box-shadow .3s var(--ease); }
.rounded-xl.border:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(0,0,0,.35); }
#testimonial-slider.rounded-xl.border:hover { transform: none; box-shadow: none; }

.autoplay-track { position: relative; }
.autoplay-bar { height: 100%; width: 0%; background: #fff; transition: width 5s linear; }
/* testimonial dots */
#testimonial-dots button { width: 8px; height: 8px; border-radius: 9999px; background: #3f3f46; border: 1px solid #27272a; transition: transform .2s var(--ease), background .2s var(--ease); }
#testimonial-dots button[aria-current="true"] { background: #fff; transform: scale(1.2); }

.testimonial-nav-btn {
  display: inline-flex;
  justify-content: space-between;
  align-items: center;
  width: auto;
  padding: 1rem;
  font-size: 0.875rem;
  color: #a3a3a3; /* neutral-400 */
  transition: color 0.2s ease-in-out, background-color 0.2s ease-in-out;
}

.testimonial-nav-btn:hover:not(:disabled) {
  color: #fff;
  background-color: #171717; /* neutral-900 */
}

.testimonial-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

#grid-bg { position: absolute; inset: 0 0 auto 0; height: 80vh; pointer-events: none; z-index: 0; background-image: repeating-linear-gradient(to right, rgba(255,255,255,0.06) 0 1px, transparent 1px 40px), repeating-linear-gradient(to bottom, rgba(255,255,255,0.06) 0 1px, transparent 1px 40px); -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0) 85%); mask-image: linear-gradient(to bottom, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0) 85%); }

#mobile-menu { overflow: hidden; transition: height .4s var(--ease), opacity .3s var(--ease), padding-top .4s var(--ease), padding-bottom .4s var(--ease); opacity: 0; }
#mobile-menu:not(.hidden) { opacity: 1; }

/* elevate content above grid bg */
#content, header, footer { position: relative; z-index: 1; }

.volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 7rem; height: 20px; background: transparent; cursor: pointer;
}
/* WebKit */
.volume-slider::-webkit-slider-runnable-track {
  height: 4px; background: linear-gradient(90deg, #fff var(--v,0%), #2a2a2a var(--v,0%));
  border-radius: 9999px;
}
.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; border: 2px solid #000;
  margin-top: -5px; transition: transform .15s var(--ease), box-shadow .15s var(--ease);
}
.volume-slider:hover::-webkit-slider-thumb { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(255,255,255,.08); }
/* Firefox */
.volume-slider::-moz-range-track {
  height: 4px; background: #2a2a2a; border-radius: 9999px;
}
.volume-slider::-moz-range-progress {
  height: 4px; background: #fff; border-radius: 9999px;
}
.volume-slider::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; border: 2px solid #000; transition: transform .15s var(--ease), box-shadow .15s var(--ease);
}
.volume-slider:hover::-moz-range-thumb { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(255,255,255,.08); }

#radio-app.full-page { max-width: none !important; padding: 0 !important; }

/* Episode progress bar */
#episode-progress-container {
  display: none;
}
.episode-progress-bar {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: transparent;
  cursor: pointer;
  padding: 0;
  margin: 0;
}
.episode-progress-bar::-webkit-slider-runnable-track {
  height: 4px;
  background: linear-gradient(90deg, #fff var(--p,0%), #2a2a2a var(--p,0%));
  border-radius: 9999px;
}
.episode-progress-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  margin-top: -4px;
  transition: transform .15s var(--ease);
}
.episode-progress-bar:hover::-webkit-slider-thumb {
  transform: scale(1.25);
}
.episode-progress-bar::-moz-range-track {
  height: 4px;
  background: #2a2a2a;
  border-radius: 9999px;
}
.episode-progress-bar::-moz-range-progress {
  height: 4px;
  background: #fff;
  border-radius: 9999px;
}
.episode-progress-bar::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  border: none;
  transition: transform .15s var(--ease);
}
.episode-progress-bar:hover::-moz-range-thumb {
  transform: scale(1.25);
}

/* Fluid titles and logo sizing for station page */
.station-page .title { font-size: clamp(1.25rem, 2vw + 0.5rem, 2rem); }
.station-logo { width: clamp(56px, 8vw, 72px); height: clamp(56px, 8vw, 72px); }
/* Preserve square logos consistently */
.logo-square { aspect-ratio: 1 / 1; object-fit: contain; }
/* Safe-area support for the bottom player */
.player-bar { padding-bottom: env(safe-area-inset-bottom); }

.station-card:hover {
  transform: translateY(-2px);
  border-color: #3f3f46; /* neutral-700 */
}

/* Page transitions */
@keyframes page-fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes page-fade-out {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-10px); }
}
.page-content.page-enter {
  animation: page-fade-in 0.3s var(--ease) forwards;
}
.page-content.page-exit {
  animation: page-fade-out 0.2s var(--ease) forwards;
}

.station-page {
  --min-h: calc(100vh - 64px - env(safe-area-inset-bottom));
  min-height: var(--min-h);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.station-page-bg {
  position: absolute;
  top: -5%;
  left: -5%;
  width: 110%;
  height: 110%;
  background-size: cover;
  background-position: center;
  filter: blur(40px) brightness(0.5);
  opacity: 0.5;
  z-index: -1;
  pointer-events: none;
  transition: background-image 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.station-page a {
  word-break: break-word;
}

#playlist-modal-backdrop {
  __DELETE_ME__
}
#playlist-modal-backdrop.show {
  __DELETE_ME__
}

#playlist-modal {
  __DELETE_ME__
}
#playlist-modal-backdrop.show #playlist-modal {
  __DELETE_ME__
}

#full-playlist-container {
  scrollbar-gutter: stable;
}

/* Modal styles */
#modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 100;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  pointer-events: none;
}
#modal-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

#modal-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  background-color: #111;
  border: 1px solid var(--border);
  border-radius: 0.75rem; /* 12px */
  padding: 1.5rem; /* 24px */
  width: 90%;
  max-width: 28rem; /* 448px */
  z-index: 101;
  opacity: 0;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
  pointer-events: none;
}
#modal-backdrop.show #modal-dialog {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}

#modal-dialog h2 {
  font-size: 1.125rem; /* 18px */
  font-weight: 500;
  color: #fff;
  margin-bottom: 0.5rem; /* 8px */
}
#modal-dialog p {
  color: #a3a3a3; /* neutral-400 */
  font-size: 0.875rem; /* 14px */
  line-height: 1.5;
  margin-bottom: 1.5rem; /* 24px */
}
#modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem; /* 12px */
}

#modal-buttons button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem; /* 6px */
  padding: 0.5rem 1rem; /* 8px 16px */
  font-size: 0.875rem; /* 14px */
  font-weight: 500;
  transition: background-color 0.2s;
  cursor: pointer;
}
#modal-buttons button.btn-primary {
  background-color: #fff;
  color: #000;
}
#modal-buttons button.btn-primary:hover {
  background-color: #e6e6e6;
}
#modal-buttons button.btn-secondary {
  background-color: #27272a; /* neutral-800 */
  color: #fff;
  border: 1px solid #3f3f46; /* neutral-700 */
}
#modal-buttons button.btn-secondary:hover {
  background-color: #3f3f46; /* neutral-700 */
}
#modal-buttons button.btn-danger {
  background-color: #dc2626; /* red-600 */
  color: #fff;
}
#modal-buttons button.btn-danger:hover {
  background-color: #b91c1c; /* red-700 */
}

/* Episode play button styles */
.episode-play-btn {
  background-color: #171717; /* neutral-900 */
  border: 1px solid var(--border);
  color: #a3a3a3; /* neutral-400 */
  transition: all 0.2s var(--ease);
}
.episode-play-btn:hover {
  background-color: #27272a; /* neutral-800 */
  border-color: #3f3f46; /* neutral-700 */
  color: #fff;
  transform: scale(1.05);
}

/* Settings Page Toggles */
.setting-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.setting-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.setting-toggle .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #3f3f46; /* neutral-700 */
  transition: .3s;
  border-radius: 24px;
}
.setting-toggle .slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}
.setting-toggle input:checked + .slider {
  background-color: #fff;
}
.setting-toggle input:checked + .slider:before {
  transform: translateX(20px);
  background-color: #000;
}

/* Settings to hide elements */
body.no-grid #grid-bg {
  display: none;
}
body.no-cursor #cursor-dot {
  display: none;
}