:root {
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"],
.content-page {
  --bg: #07111c;
  --bg2: #03080f;
  --text: #ddeeff;
  --muted: #8aa2b7;
  --accent: #7ec8ff;
  --accent-glow: rgba(126, 200, 255, 0.28);
  --btn-bg: rgba(126, 200, 255, 0.10);
  --btn-border: rgba(126, 200, 255, 0.22);
  --rain-color: rgba(126, 200, 255, 0.10);
  --surface: rgba(255, 255, 255, 0.055);
  --line: rgba(255, 255, 255, 0.11);
  --toggle-bg: rgba(255, 255, 255, 0.06);
}

[data-theme="light"] {
  --bg: #e4f0fb;
  --bg2: #cce2f5;
  --text: #0f2033;
  --muted: #486f90;
  --accent: #1a6fb5;
  --accent-glow: rgba(26, 111, 181, 0.22);
  --btn-bg: rgba(26, 111, 181, 0.08);
  --btn-border: rgba(26, 111, 181, 0.24);
  --rain-color: rgba(26, 111, 181, 0.06);
  --surface: rgba(255, 255, 255, 0.52);
  --line: rgba(15, 32, 51, 0.12);
  --toggle-bg: rgba(0, 0, 0, 0.06);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }

body {
  background: linear-gradient(160deg, var(--bg), var(--bg2));
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    108deg,
    var(--rain-color) 0 1.5px,
    transparent 1.5px 20px
  );
  animation: rainfall 12s linear infinite;
  opacity: 0.6;
}

@keyframes rainfall {
  from { transform: translateY(-10%); }
  to { transform: translateY(10%); }
}

a { color: var(--accent); }

.site-header {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px clamp(18px, 4vw, 42px);
  background: linear-gradient(to bottom, rgba(3, 8, 15, 0.74), rgba(3, 8, 15, 0));
}

.brand {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 650;
  text-decoration: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-left: auto;
  margin-right: 62px;
}

.site-nav a,
.site-footer a {
  color: var(--muted);
  font-size: 0.82rem;
  text-decoration: none;
  transition: color 0.2s;
}

.site-nav a:hover,
.site-footer a:hover {
  color: var(--accent);
}

.theme-toggle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--btn-border);
  background: var(--toggle-bg);
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: color 0.3s, background 0.3s, border-color 0.3s;
  backdrop-filter: blur(8px);
}

.theme-toggle:hover { color: var(--accent); }
.theme-toggle svg { width: 18px; height: 18px; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: none; }

.player-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 110px 20px 72px;
  text-align: center;
}

.player-shell h1 {
  margin: 0;
  max-width: 720px;
  font-size: clamp(2.15rem, 5vw, 4.4rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.intro {
  max-width: 610px;
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.play-btn {
  position: relative;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 1.5px solid var(--btn-border);
  background: var(--btn-bg);
  color: var(--accent);
  cursor: pointer;
  display: grid;
  place-items: center;
  backdrop-filter: blur(12px);
  transition: transform 0.2s var(--ease), box-shadow 0.3s var(--ease);
  box-shadow: 0 0 0 0 var(--accent-glow);
}

.play-btn svg { width: 48px; height: 48px; }
.play-btn:hover { transform: scale(1.06); }
.play-btn:active { transform: scale(0.97); }

.play-btn.playing {
  box-shadow:
    0 0 0 12px var(--accent-glow),
    0 0 40px var(--accent-glow);
  animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 10px var(--accent-glow), 0 0 40px var(--accent-glow); }
  50% { box-shadow: 0 0 0 22px transparent, 0 0 60px var(--accent-glow); }
}

.play-btn .icon-pause { display: none; }
.play-btn.playing .icon-play { display: none; }
.play-btn.playing .icon-pause { display: block; }

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.volume-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0.72;
  transition: opacity 0.3s;
}

.volume-wrap:hover { opacity: 1; }
.volume-wrap svg { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0; }
#volume { width: 120px; accent-color: var(--accent); cursor: pointer; }

.content-band {
  position: relative;
  padding: 64px 22px;
  border-top: 1px solid var(--line);
}

.content-band.compact {
  padding-top: 48px;
}

.content-inner {
  width: min(860px, 100%);
  margin: 0 auto;
}

.content-inner h2,
.page-content h1 {
  margin: 0 0 16px;
  color: var(--text);
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  line-height: 1.15;
}

.content-inner p,
.page-content p,
.page-content li {
  color: var(--muted);
  line-height: 1.75;
}

.sound-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.sound-card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 18px;
}

.sound-card h3 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 1rem;
}

.sound-card p { margin: 0; }

.content-page {
  min-height: 100vh;
}

.content-page .site-header {
  position: sticky;
  background: rgba(3, 8, 15, 0.82);
  backdrop-filter: blur(14px);
}

.page-content {
  width: min(760px, calc(100% - 40px));
  margin: 0 auto;
  padding: 72px 0 56px;
}

.page-content h2 {
  margin: 34px 0 10px;
  color: var(--accent);
  font-size: 1.08rem;
}

.contact-box {
  margin: 24px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  word-break: break-word;
}

.site-footer {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 18px;
  padding: 28px 20px 34px;
}

@media (max-width: 620px) {
  .site-header {
    align-items: flex-start;
    gap: 12px;
  }

  .site-nav {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px 14px;
    margin-right: 0;
  }

  .theme-toggle {
    display: none;
  }

  .play-btn { width: 120px; height: 120px; }
  .play-btn svg { width: 40px; height: 40px; }
  .sound-grid { grid-template-columns: 1fr; }
}
