/* ===== DESIGN TOKENS ===== */
:root {
  /* Type Scale */
  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem  + 0.35vw, 1rem);
  --text-base: clamp(1rem,     0.95rem + 0.25vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 1rem    + 0.75vw, 1.5rem);
  --text-xl:   clamp(1.5rem,   1.2rem  + 1.25vw, 2.25rem);
  --text-2xl:  clamp(2rem,     1.2rem  + 2.5vw,  3.5rem);
  --text-3xl:  clamp(2.5rem,   1rem    + 4vw,    5rem);

  /* Spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  /* Transition */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Content widths */
  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;
  /* About / Support / Contact — one column, wider than 65ch body (matches “Support us” block) */
  --page-simple-max: min(48rem, 100%);

  /* Fonts */
  --font-display: 'Instrument Serif', Georgia, serif;
  --font-body: 'Satoshi', 'Helvetica Neue', sans-serif;

  /* ===== ESTAKADA99 PALETTE — Frutiger Aero / Summery Glass ===== */
  --color-bg: #7ec8e3;
  --color-surface: rgba(255, 255, 255, 0.35);
  --color-surface-2: rgba(255, 255, 255, 0.28);
  --color-surface-light: rgba(255, 255, 255, 0.45);
  --color-panel: rgba(255, 255, 255, 0.42);
  --color-panel-hover: rgba(255, 255, 255, 0.58);

  --color-text: #1a2a3a;
  --color-text-muted: #3a5068;
  --color-text-faint: #6b8299;
  --color-text-inverse: #f0f8ff;

  /* Soft dusty coral / rose — pastel cousin to the peach sky (less “lipstick” than deep terracotta) */
  --color-accent: #d3a89c;
  --color-accent-hover: #be9286;
  --color-accent-light: #f1e6e3;
  --color-accent-rgb: 211, 168, 156;

  --color-player-bg: rgba(255, 255, 255, 0.22);
  --color-player-text: #1a2a3a;
  --color-player-accent: var(--color-accent);
  --color-player-accent-hover: var(--color-accent-hover);
  --color-player-accent-soft: rgba(var(--color-accent-rgb), 0.35);

  --color-border: rgba(0, 40, 80, 0.10);

  --shadow-sm: 0 1px 4px rgba(0, 60, 120, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 60, 120, 0.10);
  --shadow-lg: 0 12px 40px rgba(0, 60, 120, 0.14);

  /* Frosted glass — Aero-style translucent panels */
  --glass-blur: 20px;
  --glass-saturate: 1.35;
  --glass-panel: rgba(255, 255, 255, 0.42);
  --glass-panel-hover: rgba(255, 255, 255, 0.58);
  --glass-surface: rgba(255, 255, 255, 0.30);
  --glass-surface-2: rgba(255, 255, 255, 0.24);
  --glass-surface-light: rgba(255, 255, 255, 0.50);
  --glass-border: rgba(255, 255, 255, 0.45);
  --glass-border-soft: rgba(255, 255, 255, 0.30);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

/* ===== SUMMERY SKY BACKGROUND (slow color-shifting gradient + dreamy blobs) ===== */
html {
  min-height: 100%;
  background-color: #5ba3c9;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background: linear-gradient(
    135deg,
    #56c1e8 0%,
    #7ed6f5 18%,
    #a8e6cf 35%,
    #f9e4b7 52%,
    #f7b8a8 68%,
    #c4a8e8 82%,
    #82c4f0 100%
  );
  background-size: 400% 400%;
  animation: estakadaBgShift 100s cubic-bezier(0.42, 0, 0.58, 1) infinite alternate;
}

/* Dreamy aero blobs — soft light patches drifting over the sky */
body::after {
  content: '';
  position: fixed;
  inset: -50%;
  z-index: -1;
  pointer-events: none;
  opacity: 0.7;
  filter: blur(60px);
  background:
    radial-gradient(ellipse 72% 68% at 28% 42%, rgba(255, 255, 255, 0.55) 0%, transparent 50%),
    radial-gradient(ellipse 68% 62% at 72% 58%, rgba(160, 220, 255, 0.45) 0%, transparent 48%),
    radial-gradient(ellipse 58% 70% at 48% 22%, rgba(255, 210, 180, 0.40) 0%, transparent 46%),
    radial-gradient(ellipse 52% 56% at 18% 78%, rgba(200, 180, 255, 0.35) 0%, transparent 44%);
  animation: estakadaLavaDrift 70s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite alternate;
}

@keyframes estakadaBgShift {
  0% {
    background-position: 0% 20%;
  }
  50% {
    background-position: 100% 80%;
  }
  100% {
    background-position: 20% 40%;
  }
}

@keyframes estakadaLavaDrift {
  0% {
    transform: translate(0%, 0%) scale(1) rotate(0deg);
  }
  16% {
    transform: translate(6%, -8%) scale(1.06) rotate(1.5deg);
  }
  33% {
    transform: translate(-5%, 4%) scale(0.95) rotate(-1deg);
  }
  50% {
    transform: translate(-7%, -3%) scale(1.04) rotate(0.5deg);
  }
  66% {
    transform: translate(4%, 8%) scale(1.02) rotate(-1.5deg);
  }
  83% {
    transform: translate(8%, 2%) scale(0.97) rotate(0.5deg);
  }
  100% {
    transform: translate(0%, 0%) scale(1) rotate(0deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  body::before {
    animation: none;
    background-position: 50% 50%;
    background-size: 100% 100%;
  }

  body::after {
    animation: none;
    transform: none;
    filter: blur(40px);
    opacity: 0.5;
  }
}

/* Low refresh / e-paper style displays */
@media (update: slow) {
  body::before {
    animation: none;
    background-position: 50% 50%;
    background-size: 100% 100%;
  }

  body::after {
    animation: none;
    transform: none;
    filter: blur(44px);
    opacity: 0.62;
  }
}

/*
 * Phones / small tablets: animating full-viewport gradients + huge blurred blobs
 * forces constant repaints and composite work — same palette, static frame.
 */
@media (max-width: 900px) {
  :root {
    --glass-blur: 12px;
    --glass-saturate: 1.22;
  }

  body::before {
    animation: none;
    background-position: 50% 50%;
    background-size: 100% 100%;
  }

  body::after {
    animation: none;
    transform: none;
    filter: blur(44px);
    opacity: 0.65;
  }

  .player {
    backdrop-filter: blur(16px) saturate(1.25);
    -webkit-backdrop-filter: blur(16px) saturate(1.25);
  }

  .chat-panel__glass,
  .schedule-panel {
    backdrop-filter: blur(14px) saturate(1.25);
    -webkit-backdrop-filter: blur(14px) saturate(1.25);
  }
}

/* Hidden tab: pause background motion (saves CPU when audio plays in background) */
html.doc-visibility-paused body::before,
html.doc-visibility-paused body::after {
  animation-play-state: paused;
}

/* ===== AUDIO-REACTIVE BACKGROUND (desktop + fine pointer; respects reduced motion) ===== */
.bg-audio-reactive {
  display: none;
}

@media (min-width: 1024px) and (pointer: fine) {
  @media (prefers-reduced-motion: no-preference) {
    .bg-audio-reactive {
      --audio-pulse: 0;
      --audio-tilt: 0;
      --audio-glow: 0;
      --audio-mid: 0;
      --audio-high: 0;
      --audio-shift-x: 0;
      --audio-shift-y: 0;

      display: block;
      position: fixed;
      inset: -10%;
      z-index: -1;
      pointer-events: none;
      opacity: 0;
      transition: opacity 5s cubic-bezier(0.42, 0, 0.58, 1);
      filter: blur(56px);
      mix-blend-mode: soft-light;
      background:
        radial-gradient(
          ellipse 78% 72% at calc(32% + var(--audio-shift-x) * 1%) calc(40% + var(--audio-shift-y) * 1%),
          rgba(255, 255, 255, calc(0.38 + var(--audio-glow) * 0.42)) 0%,
          transparent 52%
        ),
        radial-gradient(
          ellipse 70% 64% at calc(70% - var(--audio-shift-x) * 0.55%) calc(58% - var(--audio-shift-y) * 0.45%),
          rgba(170, 230, 255, calc(0.34 + var(--audio-mid) * 0.38)) 0%,
          transparent 50%
        ),
        radial-gradient(
          ellipse 64% 60% at calc(46% + var(--audio-tilt) * 7%) calc(22% + var(--audio-pulse) * 5%),
          rgba(255, 198, 210, calc(0.28 + var(--audio-high) * 0.36)) 0%,
          transparent 48%
        );
      transform: translate3d(
          calc(var(--audio-tilt) * 2.8%),
          calc(var(--audio-pulse) * -2.2%),
          0
        )
        scale(calc(1.03 + var(--audio-pulse) * 0.14));
    }

    html[data-audio-reactive='on'] .bg-audio-reactive {
      opacity: 0.88;
    }
  }
}

/* ===== IMAGES (mild save deterrent; not security) ===== */
img {
  -webkit-user-drag: none;
  user-select: none;
  -moz-user-select: none;
}

.card-image,
.resident-photo {
  user-select: none;
  -moz-user-select: none;
}

/* ===== GLOBAL LAYOUT ===== */
.page-wrapper {
  position: relative;
  z-index: 0;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  padding-bottom: 3.5rem;
}

#main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

@media (max-width: 768px) {
  .page-wrapper {
    padding-bottom: 3rem;
  }
}

.container {
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

/* ===== NAVIGATION ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  box-sizing: border-box;
  background: var(--glass-surface);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  border-bottom: 1px solid var(--glass-border);
  border-top: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: var(--glass-highlight), 0 6px 28px rgba(0, 50, 100, 0.06);
}

.nav-brand-group {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.nav-logo {
  display: flex;
  align-items: center;
  line-height: 0;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-logo img {
  display: block;
  height: clamp(1.5rem, 4.2vw, 2rem);
  width: auto;
  max-width: min(11rem, 42vw);
  object-fit: contain;
}

.nav-logo:hover {
  opacity: 0.88;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  list-style: none;
  justify-content: flex-end;
  flex: 0 1 auto;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
  background: var(--glass-surface-2);
  backdrop-filter: blur(10px) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(10px) saturate(var(--glass-saturate));
  border: 1px solid var(--glass-border-soft);
  box-shadow: var(--glass-highlight);
}

.nav-links a:hover {
  background: var(--glass-panel-hover);
}

.nav-links a.active {
  background: color-mix(in srgb, var(--color-accent) 52%, white);
  color: var(--color-text);
  border-color: rgba(var(--color-accent-rgb), 0.35);
  box-shadow: 0 2px 12px rgba(var(--color-accent-rgb), 0.22);
}

.nav-links a.nav-links__external {
  gap: var(--space-2);
}

.nav-links__external-icon {
  flex-shrink: 0;
  opacity: 0.7;
}

/* Mobile hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: var(--space-2);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

@media (max-width: 768px) {
  .nav { flex-wrap: wrap; justify-content: space-between; }
  .nav-brand-group { margin-right: 0; }
  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    width: calc(100% + 2 * var(--space-4));
    max-width: none;
    flex: 1 1 100%;
    min-width: 0;
    box-sizing: border-box;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-2) 0;
    margin-inline: calc(-1 * var(--space-4));
  }
  .nav-links.open { display: flex; }
  .nav-links li {
    width: 100%;
    min-width: 0;
  }
  .nav-links a {
    width: 100%;
    box-sizing: border-box;
    text-align: center;
  }
}



/* ===== HOMEPAGE CONTENT ===== */
.home-content {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr);
  grid-template-rows: 1fr;
  gap: var(--space-4);
  padding: var(--space-4);
  height: calc(100dvh - 10rem);
  min-height: 0;
}

.home-content > .chat-panel,
.home-content > .schedule-panel {
  min-height: 0;
  min-width: 0;
}

@media (max-width: 768px) {
  .home-content {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 1fr;
    padding: var(--space-3);
    gap: var(--space-3);
    height: calc(100dvh - 10rem);
  }

  /* Chat lives in nav link only on small screens — no homepage embed. */
  .home-content > .chat-panel {
    display: none !important;
  }
}

/*
 * Glass behind chat content only (.chat-panel__glass) — backdrop-filter on an ancestor of the
 * Chatango iframe would blur the iframe in Chromium.
 */
.chat-panel {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  border: 1px solid var(--glass-border);
  border-top: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-2xl);
  padding: 0;
  overflow: hidden;
  box-shadow: var(--glass-highlight), var(--shadow-md);
  background: transparent;
}

.chat-panel__glass {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.36);
  backdrop-filter: blur(22px) saturate(1.42);
  -webkit-backdrop-filter: blur(22px) saturate(1.42);
}

.chat-panel__body {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: var(--space-6);
}

.chat-panel h2 {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-4);
  color: var(--color-text);
  flex-shrink: 0;
}

.chat-embed-wrapper {
  flex: 1;
  min-height: max(12rem, 180px);
  min-width: min(100%, 280px);
  width: 100%;
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  isolation: isolate;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid var(--glass-border-soft);
}

.chat-embed-close-shield {
  position: absolute;
  top: 0;
  right: 0;
  width: 44px;
  height: 44px;
  z-index: 4;
  pointer-events: auto;
}

@media (min-width: 769px) {
  .nav-links__item--chat-mobile {
    display: none;
  }
}

/* Schedule panel — frosted glass */
.schedule-panel {
  background: rgba(255, 255, 255, 0.36);
  backdrop-filter: blur(22px) saturate(1.42);
  -webkit-backdrop-filter: blur(22px) saturate(1.42);
  border: 1px solid var(--glass-border);
  border-top: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-2xl);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  box-shadow: var(--glass-highlight), var(--shadow-md);
  isolation: isolate;
}

.schedule-panel h2 {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-4);
  color: var(--color-text);
  flex-shrink: 0;
}

/* One show per row — full width so titles aren’t squished on mobile */
.schedule-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2);
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 60, 120, 0.15) transparent;
}

/* No per-row backdrop-filter — scrolling many blurred layers is costly; panel blur is enough */
.schedule-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  background: var(--glass-surface-2);
  border: 1px solid var(--glass-border-soft);
  border-radius: var(--radius-xl);
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  text-align: left;
  box-shadow: var(--glass-highlight);
}

.schedule-item-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2) var(--space-4);
  width: 100%;
}

.schedule-item:hover {
  background: var(--glass-panel-hover);
}

.schedule-item:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.schedule-chevron {
  margin-left: auto;
  flex-shrink: 0;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  opacity: 0.65;
  align-self: center;
}

.schedule-item.is-expanded .schedule-chevron {
  transform: rotate(-135deg);
}

.schedule-item-body {
  width: 100%;
  padding-top: var(--space-3);
  margin-top: var(--space-2);
  border-top: 1px solid var(--color-border);
}

.schedule-item-body[hidden] {
  display: none !important;
}

.schedule-description {
  margin: 0;
  font-size: var(--text-sm);
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  color: inherit;
}

.schedule-description-na {
  color: var(--color-text-muted);
  font-style: italic;
}

.schedule-item.now-playing .schedule-description-na {
  color: var(--color-text-muted);
}

.schedule-item.now-playing .schedule-item-body {
  border-top-color: var(--color-border);
}

.schedule-item.schedule-item--past .schedule-item-body {
  border-top-color: var(--color-border);
  opacity: 1;
}

.schedule-item.now-playing {
  background: color-mix(in srgb, var(--color-accent) 44%, white);
  border-color: rgba(var(--color-accent-rgb), 0.4);
  color: var(--color-text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 4px 16px rgba(var(--color-accent-rgb), 0.18);
}

.schedule-item.now-playing .schedule-time {
  color: var(--color-text-muted);
  white-space: nowrap;
}

/* On-air slot whose title contains (LIVE) — red instead of green */
.schedule-item.schedule-item--broadcast-live {
  background: rgba(180, 42, 42, 0.95);
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 4px 18px rgba(180, 42, 42, 0.45);
}

.schedule-item.schedule-item--broadcast-live .schedule-description-na {
  color: rgba(255, 255, 255, 0.75);
}

.schedule-item.schedule-item--broadcast-live .schedule-item-body {
  border-top-color: rgba(255, 255, 255, 0.28);
}

.schedule-item.schedule-item--broadcast-live .schedule-time {
  color: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
}

.schedule-item.schedule-item--past {
  opacity: 0.5;
  background: var(--glass-surface-2);
}

.schedule-item.schedule-item--past .schedule-time,
.schedule-item.schedule-item--past .schedule-show {
  color: var(--color-text-muted);
}

.schedule-item.schedule-item--past:hover {
  opacity: 0.55;
  transform: none;
  background: var(--glass-surface-2);
}

.schedule-time {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 500;
  flex: 0 0 auto;
  min-width: 10.5ch;
  margin-bottom: 0;
  white-space: nowrap;
}

.schedule-show {
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.25;
  flex: 1 1 12rem;
  min-width: 0;
}

/* ===== PAGE SECTIONS ===== */
.page-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.page-section {
  padding: clamp(var(--space-8), 6vw, var(--space-16)) var(--space-4);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.page-section > .container {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Fill the viewport so short bios + embeds don’t look like a small “island” (same airy feel as long profiles) */
#page-resident-detail .page-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 5.5rem);
  padding-top: clamp(2.5rem, 7vh, 4.5rem);
  padding-bottom: clamp(3.25rem, 11vh, 6.5rem);
}

.page-title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 400;
  font-style: italic;
  color: var(--color-text);
  margin-bottom: var(--space-8);
  line-height: 1.05;
}

#page-residents .page-title {
  text-align: center;
  margin-inline: auto;
}

#page-residents .page-section > .container,
#page-archive .page-section > .container,
#page-resident-detail .page-section > .container {
  justify-content: flex-start;
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 0;
}

/* Keep toolbar + search full width when the grid only has a narrow “no results” row */
#page-residents .page-section > .container {
  align-items: stretch;
  width: 100%;
}

#page-residents .residents-toolbar {
  width: 100%;
  box-sizing: border-box;
}

#page-residents .residents-grid {
  width: 100%;
  min-width: 0;
}

.page-body {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 65ch;
  line-height: 1.7;
}

.page-body p + p {
  margin-top: var(--space-4);
}

/* Centered copy layout (Archive only; About / Donate / Contacts read left like typical sites) */
#page-archive .container {
  text-align: center;
}

#page-archive .page-title {
  margin-inline: auto;
}

/* Center the content column in the viewport (stretch was forcing full width → huge right gap) */
#page-about .page-section,
#page-donate .page-section,
#page-contacts .page-section {
  align-items: center;
}

/* Same column width + top alignment; text stays left inside the box */
#page-about .page-section > .container,
#page-donate .page-section > .container,
#page-contacts .page-section > .container {
  justify-content: flex-start;
  align-self: center;
  width: min(100%, var(--page-simple-max));
  max-width: var(--page-simple-max);
  box-sizing: border-box;
}

#page-about .page-title,
#page-donate .page-title,
#page-contacts .page-title {
  margin-inline: 0;
  text-align: left;
  width: 100%;
}

#page-about .page-body,
#page-donate .page-body,
#page-contacts .page-body {
  margin-inline: 0;
  text-align: left;
  max-width: none;
  width: 100%;
}

#page-archive .archive-intro {
  margin-inline: auto;
  text-align: center;
}

/* ----- 404 ----- */
.page-not-found-section .container {
  justify-content: center;
  align-items: center;
  text-align: center;
}

.page-not-found-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-6);
  padding-block: var(--space-8);
}

.page-not-found-code {
  font-family: var(--font-display);
  font-size: clamp(3.25rem, 11vw, 5.5rem);
  font-weight: 400;
  font-style: italic;
  line-height: 1;
  color: var(--color-text);
  margin: 0;
}

.page-not-found-message {
  font-family: var(--font-body, sans-serif);
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 28rem;
  margin: 0;
  line-height: 1.65;
}

.page-not-found-message a {
  color: var(--color-accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.page-not-found-message a:hover {
  text-decoration-thickness: 2px;
}

#page-donate .donate-options,
#page-contacts .contact-links {
  justify-content: flex-start;
}

/* ===== CARD GRID (Residents, Archive) ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

@media (min-width: 480px) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 768px) {
  .card-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-4);
  }
}

@media (min-width: 1024px) {
  .card-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (min-width: 1200px) {
  .card-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

/* Residents page: cap at 5 columns */
#page-residents .residents-grid {
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 480px) {
  #page-residents .residents-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 640px) {
  #page-residents .residents-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 880px) {
  #page-residents .residents-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-4);
  }
}

.residents-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.residents-search-wrap {
  flex: 1 1 12rem;
  min-width: min(100%, 12rem);
}

.residents-search-input {
  width: 100%;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--glass-surface-2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--color-text);
  border: 1px solid var(--glass-border-soft);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.residents-search-input::placeholder {
  color: var(--color-text-muted);
  font-weight: 400;
}

.residents-search-input:hover {
  border-color: var(--color-accent);
}

.residents-search-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px rgba(var(--color-accent-rgb), 0.22);
  background: var(--glass-panel);
}

.residents-surprise-btn {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.residents-surprise-btn:hover:not(:disabled) {
  background: rgba(var(--color-accent-rgb), 0.14);
  border-color: var(--color-accent-hover);
  color: var(--color-accent-hover);
}

.residents-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: var(--space-4) 0;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-align: center;
  justify-self: center;
  max-width: 100%;
}

.card {
  background: var(--glass-panel);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  border: 1px solid var(--glass-border);
  border-top: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-2xl);
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
  color: var(--color-text);
  box-shadow: var(--glass-highlight), var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* Residents: backdrop-filter on many tiles is costly while scrolling; skip off-screen work */
#page-residents .card {
  content-visibility: auto;
  contain-intrinsic-size: auto 292px;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* Uniform card height: cap title at 2 lines; full title on hover (title on <a>) */
#page-residents .card-show {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  line-height: 1.3;
  min-height: calc(2 * 1.3 * 1em);
  overflow-wrap: break-word;
  word-break: break-word;
}

#page-residents .card-byline {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-image {
  aspect-ratio: 1;
  background: rgba(200, 225, 245, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-image-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(200, 225, 245, 0.4), rgba(255, 255, 255, 0.5));
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-image-placeholder svg {
  width: 40%;
  height: 40%;
  opacity: 0.3;
  color: var(--color-text-muted);
}

.card-info {
  padding: var(--space-3) var(--space-4);
}

.card-show {
  font-size: var(--text-sm);
  font-weight: 700;
}

.card-byline {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* ===== ARCHIVE (SoundCloud embeds) ===== */
.archive-intro {
  margin-bottom: var(--space-6);
  max-width: 65ch;
}

.archive-intro a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Full container width only — the old 150% + center hack made SoundCloud visual widgets absurdly wide vs 300px height (stretched artwork). */
.archive-wrap {
  width: 100%;
}

.archive-embed-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-6);
}

.archive-embed-card {
  width: 100%;
  max-width: 42rem;
  margin-inline: auto;
  background: var(--glass-panel);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  border: 1px solid var(--glass-border);
  border-top: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-2xl);
  padding: var(--space-4);
  overflow: hidden;
  box-shadow: var(--glass-highlight), var(--shadow-sm);
}

.archive-embed-frame {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: rgba(200, 225, 245, 0.3);
}

.archive-embed-frame iframe {
  display: block;
  width: 100%;
  height: 300px;
  min-height: 300px;
  border: 0;
}

.archive-embed-card--cube .archive-embed-frame + div {
  margin-top: var(--space-2);
  max-width: 100%;
}

.archive-embed-card--cube .archive-embed-frame + div a:hover {
  text-decoration: underline;
}

/* Pagination: 10 tracks per page */
.archive-pagination {
  margin-top: var(--space-8);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}

.archive-pagination-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
}

.archive-page-btn {
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--glass-surface-2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--color-text);
  border: 1px solid var(--glass-border-soft);
  font-size: var(--text-sm);
  font-weight: 600;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.archive-page-btn:hover:not(:disabled) {
  background: var(--glass-panel-hover);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.archive-page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.archive-page-indicator {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.archive-status {
  text-align: center;
  padding: var(--space-8);
  color: var(--color-text-muted);
  max-width: 42rem;
  margin: 0 auto;
}

.archive-status a {
  color: var(--color-accent);
}

.archive-status--muted {
  font-size: var(--text-sm);
  margin-bottom: var(--space-4);
  text-align: left;
  padding: 0 0 var(--space-3);
}

.archive-fallback {
  width: 100%;
  max-width: 42rem;
  margin-inline: auto;
}

.archive-fallback .archive-oembed iframe {
  width: 100%;
  max-width: 100%;
  min-height: 300px;
  border: 0;
  border-radius: var(--radius-lg);
}

.archive-profile-link {
  margin-top: var(--space-4);
  text-align: center;
  max-width: none;
}

.archive-profile-link a {
  color: var(--color-accent);
  font-weight: 600;
}

/* ===== RESIDENT DETAIL ===== */
/* Photo left | name, bio, socials, show (right). Stack on small screens. */
.resident-detail {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: clamp(var(--space-6), 3.5vw, var(--space-10));
  row-gap: var(--space-6);
  padding: clamp(var(--space-3), 2vh, var(--space-5)) clamp(var(--space-2), 2vw, var(--space-4))
    clamp(var(--space-8), 6vh, var(--space-12));
  align-items: start;
  align-content: start;
}

#page-resident-detail .resident-detail {
  flex: 1 1 auto;
  min-height: calc(100dvh - 11.5rem);
  box-sizing: border-box;
}

.resident-photo {
  grid-column: 1;
  grid-row: 1;
  width: min(400px, 100%);
  max-width: 400px;
  aspect-ratio: 1 / 1;
  background: var(--glass-panel);
  border-radius: var(--radius-2xl);
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-md);
}

.resident-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.resident-photo-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(200, 225, 245, 0.4), rgba(255, 255, 255, 0.3));
  display: flex;
  align-items: center;
  justify-content: center;
}

.resident-info {
  grid-column: 2;
  grid-row: 1;
  padding-top: 0;
  min-width: 0;
  width: 100%;
}

@media (max-width: 768px) {
  #page-resident-detail .resident-detail {
    min-height: calc(100dvh - 9.5rem);
  }

  .resident-detail {
    grid-template-columns: 1fr;
    justify-items: stretch;
    padding-bottom: clamp(var(--space-8), 5vh, var(--space-10));
    padding-inline: var(--space-2);
  }

  .resident-photo {
    grid-column: 1;
    grid-row: 1;
    justify-self: center;
    max-width: min(320px, 80vw);
  }

  .resident-info {
    grid-column: 1;
    grid-row: 2;
    padding-top: var(--space-2);
  }
}

.resident-name {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 400;
  font-style: italic;
  color: var(--color-text);
  margin-bottom: var(--space-5);
}

.resident-bio {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.75;
  max-width: 62ch;
  margin-bottom: var(--space-6);
}

.resident-socials {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-2);
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  background: var(--glass-surface-2);
  backdrop-filter: blur(12px) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(12px) saturate(var(--glass-saturate));
  border: 1px solid var(--glass-border-soft);
  color: var(--color-text);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 500;
  transition: transform 0.2s ease, background 0.2s ease;
}

.social-link:hover {
  background: var(--glass-panel-hover);
  transform: translateY(-1px);
}

.resident-info .resident-show {
  margin-top: var(--space-8);
}

.resident-show {
  background: var(--glass-panel);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  border: 1px solid var(--glass-border);
  border-top: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-2xl);
  padding: var(--space-4) var(--space-5);
  box-shadow: var(--glass-highlight), var(--shadow-sm);
}

.resident-show h3 {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.resident-show-embed {
  margin-top: var(--space-3);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: rgba(200, 225, 245, 0.3);
}

.resident-show-iframe {
  display: block;
  width: 100%;
  height: 166px;
  border: 0;
}

/* ===== DONATE PAGE ===== */
.donate-options {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-top: var(--space-8);
}

.donate-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-full);
  background: var(--color-accent);
  color: var(--color-text);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 600;
  border: 1px solid rgba(var(--color-accent-rgb), 0.35);
  cursor: pointer;
}

.donate-btn:hover {
  background: var(--color-accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(var(--color-accent-rgb), 0.32);
}

.donate-btn--alt {
  background: var(--glass-panel);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  color: var(--color-text);
  border: 1px solid var(--glass-border);
  border-top: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: var(--glass-highlight), var(--shadow-sm);
}

.donate-btn--alt:hover {
  background: var(--glass-panel-hover);
  box-shadow: var(--glass-highlight), var(--shadow-md);
}

/* ===== CONTACT PAGE — same pills as .donate-btn--alt; grid avoids flex 1 1 0 overlap when column is narrow ===== */
.contact-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13.5rem), 1fr));
  gap: var(--space-4);
  margin-top: var(--space-8);
  width: 100%;
}

.contact-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-full);
  text-decoration: none;
  color: var(--color-text);
  font-size: var(--text-sm);
  font-weight: 600;
  background: var(--glass-panel);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  border: 1px solid var(--glass-border);
  border-top: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: var(--glass-highlight), var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  position: relative;
  z-index: 0;
}

.contact-item:hover {
  background: var(--glass-panel-hover);
  transform: translateY(-2px);
  box-shadow: var(--glass-highlight), var(--shadow-md);
  z-index: 1;
}

.contact-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.contact-text {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.contact-label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.contact-value {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== PERSISTENT AUDIO PLAYER — Frosted Glass ===== */
.player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  overflow: visible;
  background: rgba(255, 255, 255, 0.32);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  color: var(--color-player-text);
  padding: var(--space-2) var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  border-top: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 -4px 24px rgba(0, 50, 100, 0.08);
}

.player-copy-toast {
  position: absolute;
  left: 50%;
  bottom: 100%;
  margin-bottom: var(--space-2);
  padding: var(--space-2) var(--space-5);
  max-width: min(92vw, 22rem);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  color: var(--color-text);
  background: var(--glass-panel);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  border: 1px solid var(--glass-border);
  border-top: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-highlight), var(--shadow-md), 0 8px 28px rgba(0, 50, 100, 0.1);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(6px);
  transition: opacity 0.28s ease, transform 0.28s ease, visibility 0.28s ease;
  z-index: 2;
}

.player-copy-toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.player-middle {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  justify-content: center;
}

.player-show-info {
  min-width: 0;
}

.player-show-title {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.player-show-title.player-show-title--live-pulse {
  color: #ff5c5c;
  animation: playerLiveTitlePulse 1.5s ease-in-out infinite;
}

@keyframes playerLiveTitlePulse {
  0%, 100% {
    color: #ff7a7a;
    text-shadow: 0 0 0 transparent;
  }
  50% {
    color: #ff2a2a;
    text-shadow: 0 0 14px rgba(255, 60, 60, 0.85);
  }
}

.player-show-time {
  font-size: var(--text-xs);
  opacity: 0.7;
}

.player-track-line {
  margin: 0;
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1.35;
  opacity: 0.92;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35em 0.5em;
  align-items: baseline;
  /* Don’t stretch full .player-middle width — hover / copy hit-area matches label + track text */
  align-self: flex-start;
  width: fit-content;
  max-width: 100%;
  box-sizing: border-box;
}

.player-track-label {
  flex-shrink: 0;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: var(--text-xs);
  opacity: 0.75;
}

.player-track-text {
  min-width: 0;
  word-break: break-word;
}

@media (min-width: 769px) {
  .player-track-line.is-copy-ready {
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: opacity 0.15s ease, background 0.15s ease;
  }

  .player-track-line.is-copy-ready:hover {
    opacity: 1;
    background: rgba(0, 60, 120, 0.08);
  }

  .player-track-line.is-copy-ready:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
  }

  .player-track-line.is-copied-flash {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
  }
}

.player-controls {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.player-btn {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 60, 120, 0.10);
  color: var(--color-player-text);
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.35);
  transition: background 0.2s ease, transform 0.15s ease;
}

.player-btn:hover {
  background: rgba(0, 60, 120, 0.18);
  transform: scale(1.05);
}

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

.player-btn.is-loading {
  cursor: wait;
}

.player-spinner-track {
  stroke: rgba(0, 60, 120, 0.15);
  stroke-width: 2;
}

.player-spinner-head {
  stroke: var(--color-player-text);
  stroke-width: 2;
  stroke-linecap: round;
}

#loading-icon {
  animation: playerSpin 0.85s linear infinite;
}

@keyframes playerSpin {
  to { transform: rotate(360deg); }
}

.player-volume {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
}

.player-volume-icon-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-player-text);
  opacity: 0.82;
  cursor: pointer;
  transition: opacity 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.player-volume-icon-btn:hover {
  opacity: 1;
  color: var(--color-player-accent);
  background: rgba(var(--color-accent-rgb), 0.1);
}

.player-volume-icon-btn:focus-visible {
  outline: 2px solid var(--color-player-accent);
  outline-offset: 2px;
}

.player-volume-icon-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}

.volume-slider {
  width: 100px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(0, 60, 120, 0.15);
  border-radius: var(--radius-full);
  outline: none;
}

.volume-slider:focus-visible {
  outline: 2px solid var(--color-player-accent);
  outline-offset: 4px;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: var(--radius-full);
  background: var(--color-player-accent);
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 1px 4px rgba(0, 50, 100, 0.2);
}

.volume-slider::-webkit-slider-thumb:hover {
  background: var(--color-player-accent-hover);
}

.volume-slider::-moz-range-track {
  height: 4px;
  background: rgba(0, 60, 120, 0.15);
  border-radius: var(--radius-full);
}

.volume-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: var(--radius-full);
  background: var(--color-player-accent);
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 1px 4px rgba(0, 50, 100, 0.2);
}

.volume-slider::-moz-range-thumb:hover {
  background: var(--color-player-accent-hover);
}

@media (max-width: 768px) {
  .player {
    flex-wrap: nowrap;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
  }
  .player-middle {
    gap: 0;
  }
  .player-show-title {
    font-size: var(--text-sm);
    font-weight: 700;
  }
  .player-show-time {
    font-size: 0.7rem;
  }
  .player-track-line {
    font-size: 0.75rem;
  }
  .player-volume {
    display: none;
  }
  .player-btn {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
  }
}

@media (max-width: 480px) {
  .player-track-line {
    display: none;
  }
  .player-show-time {
    display: none;
  }
}

/* ===== MOBILE: Page sections, contacts, donate ===== */
@media (max-width: 768px) {
  .page-section {
    padding: var(--space-6) var(--space-3);
  }
  .contact-links {
    grid-template-columns: 1fr;
  }
  .contact-item {
    padding: var(--space-3) var(--space-6);
  }
  .donate-options {
    flex-direction: column;
    align-items: stretch;
  }
  .donate-btn {
    width: 100%;
    justify-content: center;
  }
  .nav-links a {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  /* About / Support / Contact — center copy (desktop stays left-aligned via rules above). */
  #page-about .page-title,
  #page-donate .page-title,
  #page-contacts .page-title {
    text-align: center;
  }

  #page-about .page-body,
  #page-donate .page-body,
  #page-contacts .page-body {
    text-align: center;
    margin-inline: auto;
  }

  #page-donate .donate-options {
    align-items: center;
  }

  #page-donate .donate-btn {
    width: min(100%, 22rem);
  }

  #page-contacts .contact-links {
    justify-items: center;
  }

  #page-contacts .contact-item {
    width: min(100%, 22rem);
  }
}

/* ===== PAGE TRANSITIONS ===== */
.page-content {
  animation: fadeIn 0.3s ease-out;
}

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

/* Opacity-only on home: transform on #page-home blurs Chatango in Chromium. */
#page-home.page-content {
  animation-name: fadeInHome;
  animation-duration: 0.18s;
  animation-timing-function: ease-out;
}

@keyframes fadeInHome {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ===== UTILITIES ===== */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}
