/* ===== SOUNDSCAPES PAGE ===== */

.sc-main {
  position: relative;
  min-height: 100vh;
  padding: 2rem 0 5rem;
}

#scCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.18;
  transition: opacity 1s;
}

.sc-main .container { position: relative; z-index: 1; }

/* ---- Mix-mode toggle ---- */
.sc-mixmode {
  max-width: 900px;
  margin: 0 auto 1.4rem;
}

.sc-mixmode-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.9rem 1.2rem;
  cursor: pointer;
}

.sc-mixmode-text { display: flex; flex-direction: column; gap: 0.2rem; }
.sc-mixmode-text strong { font-size: 0.95rem; }
.sc-mixmode-hint { font-size: 0.78rem; color: var(--muted); }

.sc-switch {
  flex-shrink: 0;
  width: 44px;
  height: 24px;
  border-radius: 100px;
  background: var(--surface2);
  border: 1px solid var(--border);
  position: relative;
  transition: background var(--transition), border-color var(--transition);
}
.sc-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform var(--transition), background var(--transition);
}
.sc-switch.active { background: var(--accent); border-color: var(--accent); }
.sc-switch.active::after { transform: translateX(20px); background: #fff; }
.sc-switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- Grid ---- */
.sc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.2rem;
  max-width: 900px;
  margin: 0 auto;
}

/* ---- Card ---- */
.sc-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.25s;
}

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

.sc-card.playing {
  border-color: rgba(139,124,248,0.5);
  box-shadow: 0 0 24px rgba(139,124,248,0.18);
}

.sc-card-bg {
  position: absolute;
  inset: 0;
  opacity: 0.07;
  transition: opacity 0.8s;
  background-size: cover;
  background-position: center;
}

.sc-card.playing .sc-card-bg { opacity: 0.14; }

.sc-bg-forest   { background: radial-gradient(ellipse at 30% 50%, #2d6a4f, #0d2818); }
.sc-bg-ocean    { background: radial-gradient(ellipse at 50% 70%, #0077b6, #03045e); }
.sc-bg-rain     { background: radial-gradient(ellipse at 50% 20%, #4a6fa5, #1a2744); }
.sc-bg-night    { background: radial-gradient(ellipse at 50% 50%, #1b1f3b, #05050f); }
.sc-bg-mountain { background: radial-gradient(ellipse at 50% 30%, #6a7b9a, #2c3e55); }

.sc-card-content {
  position: relative;
  z-index: 1;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.sc-card-icon { font-size: 2rem; }
.sc-card-name { font-family: var(--font-serif); font-size: 1.3rem; }
.sc-card-desc { font-size: 0.82rem; color: var(--muted); line-height: 1.55; }

.sc-card-controls {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: 0.4rem;
}

.sc-vol-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.sc-vol-label {
  font-size: 0.72rem;
  color: var(--muted);
  flex-shrink: 0;
}

.sc-vol {
  flex: 1;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ---- Level bars ---- */
.sc-level-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 16px;
  opacity: 0;
  transition: opacity 0.4s;
}

.sc-card.playing .sc-level-bars { opacity: 1; }

.sc-level-bars span {
  flex: 1;
  border-radius: 2px;
  background: var(--accent);
  height: 4px;
  animation: scBar 0.8s ease-in-out infinite alternate;
}

.sc-level-bars span:nth-child(1) { animation-delay: 0s;    animation-duration: 0.70s; }
.sc-level-bars span:nth-child(2) { animation-delay: 0.15s; animation-duration: 0.90s; }
.sc-level-bars span:nth-child(3) { animation-delay: 0.05s; animation-duration: 0.65s; }
.sc-level-bars span:nth-child(4) { animation-delay: 0.25s; animation-duration: 0.80s; }
.sc-level-bars span:nth-child(5) { animation-delay: 0.10s; animation-duration: 0.75s; }

@keyframes scBar {
  from { height: 3px;  }
  to   { height: 14px; }
}

/* ---- Footer ---- */
.sc-footer {
  max-width: 600px;
  margin: 2rem auto 0;
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
}

@media (max-width: 560px) {
  .sc-grid { grid-template-columns: 1fr; }
}
