:root {
  color-scheme: dark;
  --ink: #f4f6ff;
  --muted: #b9c7e7;
  --accent: #c7ceff;
  --canvas: #10162e;
  --panel: #1a2243;
  --bar: #151d36;
  --glass: #242e50;
  --line: #bdd0ff30;
  --button: #d1d7ff;
  --button-text: #1c2852;
  --shade: #090d23a0;
  --focus: #ecedff;
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  scroll-behavior: smooth;
  scroll-padding-block: 34px 105px;
}

:root[data-theme="light"] {
  color-scheme: light;
  --ink: #172644;
  --muted: #415675;
  --accent: #364b84;
  --canvas: #e6edf9;
  --panel: #edf2fc;
  --bar: #eff4ff;
  --glass: #f3f5ff;
  --line: #3c558039;
  --button: #354d85;
  --button-text: #fff;
  --shade: #1c346535;
  --focus: #354d85;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  padding-bottom: calc(86px + env(safe-area-inset-bottom));
  background: var(--canvas);
  color: var(--ink);
}

body::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 0 auto;
  height: min(980px, 100%);
  pointer-events: none;
  background:
    radial-gradient(ellipse at 78% 39%, #59477666, transparent 55%),
    radial-gradient(ellipse at 46% -15%, #344982b0, transparent 74%),
    linear-gradient(140deg, #151f3a 10%, #222c56 60%, transparent 92%);
  mask-image: linear-gradient(black 65%, transparent);
}

:root[data-theme="light"] body::before {
  background:
    linear-gradient(110deg, #f5f7ffde, #d4e0f2b0 53%, #c5d2e990),
    url("assets/clouds.webp") center 63% / cover;
}

body, button, select { font-size: 1rem; }
a { color: inherit; text-decoration: none; }
button, select { font-family: inherit; color: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}
.symbols, .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link {
  position: absolute;
  z-index: 4;
  left: 1rem;
  top: 1rem;
  transform: translateY(-180%);
  padding: 10px;
  background: var(--panel);
}
.skip-link:focus { transform: none; }
.icon {
  width: 21px;
  height: 21px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.wrap { width: min(100% - 96px, 1240px); margin-inline: auto; }
.site-header { border-bottom: 1px solid var(--line); }
.header-inner {
  min-height: 88px;
  display: grid;
  align-items: center;
  grid-template-columns: 1fr auto 1fr;
  gap: 22px;
}
.brand { width: 145px; display: block; }
.brand img { display: block; width: 100%; height: auto; }
:root[data-theme="light"] .brand img {
  filter: brightness(0) saturate(100%) invert(26%) sepia(27%) saturate(1428%) hue-rotate(186deg);
}
nav { display: flex; align-items: center; gap: clamp(16px, 3vw, 44px); }
nav a { font-size: .95rem; font-weight: 650; color: var(--muted); }
nav a:hover, nav a:focus-visible { color: var(--ink); }
.theme-button, .volume-toggle, .icon-button {
  border: 1px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  background: var(--panel);
}
.theme-button { justify-self: end; }
.theme-button:hover, .volume-toggle:hover, .icon-button:hover { background: var(--glass); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .93fr);
  gap: clamp(45px, 8vw, 120px);
  align-items: center;
  position: relative;
  padding-block: clamp(54px, 7vw, 100px) clamp(66px, 7vw, 100px);
}
.hero h1 {
  line-height: .99;
  letter-spacing: -.065em;
  font-size: clamp(53px, 6.6vw, 103px);
  margin: 0;
  font-weight: 740;
  text-wrap: balance;
}
.hero h1 em { color: var(--accent); font-style: normal; display: block; }
.hero-content > p:not(.player-note) {
  font-size: clamp(1.04rem, 1.6vw, 1.33rem);
  line-height: 1.56;
  color: var(--muted);
  margin-block: 26px 31px;
  max-width: 410px;
}
.hero-actions { display: flex; gap: 23px; flex-wrap: wrap; align-items: center; }
.primary, .round-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--button);
  color: var(--button-text);
  border: 0;
  font-weight: 750;
}
.primary {
  height: 58px;
  min-width: 183px;
  padding: 0 20px;
  border-radius: 18px;
  box-shadow: 0 12px 38px #5260b237;
}
.primary:hover, .round-play:hover { filter: brightness(1.09); }
.text-button {
  color: var(--accent);
  font-weight: 665;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: .3em;
}
.text-button:hover { text-decoration-color: currentColor; }
.player-note {
  color: var(--muted);
  min-height: 1.3em;
  margin: 12px 0 0;
  font-size: .88rem;
}
.play-mark { display: grid; place-items: center; position: relative; width: 24px; height: 24px; }
[data-state="loading"] .play-mark svg { visibility: hidden; }
[data-state="loading"] .play-mark::after {
  content: "";
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  position: absolute;
  animation: rotate .8s linear infinite;
}
@keyframes rotate { to { transform: rotate(360deg); } }

.hero-media { position: relative; min-width: 0; padding: 0 23px 17px 0; }
.cover-frame {
  position: relative;
  border: 1px solid #e0e6ff42;
  border-radius: clamp(22px, 3.4vw, 42px);
  box-shadow: 0 29px 58px var(--shade), 0 0 52px #7588dc1a;
  overflow: hidden;
  background: #27335c;
}
.station-cover { display: block; width: 100%; height: auto; }
.now-card {
  position: absolute;
  bottom: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 83px;
  width: min(92%, 350px);
  padding: 12px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 19px;
  box-shadow: 0 10px 25px var(--shade);
}
.track-art { border-radius: 11px; object-fit: cover; flex-shrink: 0; }
.track-text { min-width: 0; flex: 1; display: grid; gap: 3px; }
.track-text strong, .track-text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-text strong { font-size: .98rem; }
.track-text span { font-size: .82rem; color: var(--muted); }
.track-text .track-label { color: var(--accent); font-weight: 650; }
.now-card .icon-button { flex: 0 0 37px; width: 37px; height: 37px; }

.station-info {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  align-items: start;
  gap: clamp(32px, 6vw, 90px);
  padding-block: 30px 70px;
  border-top: 1px solid var(--line);
}
.history h2, .about h2 {
  margin: 0 0 16px;
  font-size: clamp(1.65rem, 3vw, 2.55rem);
  letter-spacing: -.035em;
  line-height: 1.05;
}
#history-state { color: var(--muted); }
.history-list { list-style: none; margin: 0; padding: 0; }
.history-list li { border-bottom: 1px solid var(--line); }
.history-track {
  width: 100%;
  display: grid;
  grid-template-columns: 52px 40px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 12px;
  text-align: left;
  border: 0;
  border-radius: 8px;
  padding: 10px 6px 10px 0;
  background: transparent;
}
.history-track:hover { background: var(--panel); }
.history-track time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .9rem; }
.history-track .icon { color: var(--accent); width: 18px; height: 18px; }
.about {
  position: relative;
  min-height: 300px;
  overflow: hidden;
  padding: clamp(22px, 4vw, 40px);
  background: var(--panel);
  border-radius: 25px;
  border: 1px solid var(--line);
  isolation: isolate;
}
.about-clouds {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(var(--panel) 25%, transparent 160%), url("assets/clouds.webp") center / cover;
  opacity: .56;
}
.about p { max-width: 360px; color: var(--muted); line-height: 1.6; margin: 0; }
.about p + p { margin-top: 12px; }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; gap: 14px; padding-block: 22px; font-size: .88rem; }
.site-footer a:hover { color: var(--ink); }

.player-bar {
  position: fixed;
  z-index: 2;
  inset: auto 0 0;
  background: var(--bar);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.player-inner {
  min-height: 78px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
}
.player-track, .sound-controls { display: flex; align-items: center; gap: 12px; min-width: 0; }
.sound-controls { justify-content: end; }
.round-play { width: 49px; height: 49px; padding: 0; border-radius: 50%; }
.quality-control { position: relative; flex-shrink: 0; }
.quality-control::after {
  content: "";
  position: absolute;
  right: 12px;
  top: calc(50% - 4px);
  width: 6px;
  height: 6px;
  transform: rotate(45deg);
  border-bottom: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  pointer-events: none;
}
.quality-control select {
  appearance: none;
  height: 38px;
  padding: 0 28px 0 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 11px;
  font-weight: 630;
  font-size: .85rem;
}
.volume-toggle { width: 36px; height: 36px; flex-shrink: 0; }
.volume-toggle .icon { width: 18px; height: 18px; }
input[type="range"] { accent-color: var(--accent); width: min(8vw, 100px); }

dialog {
  width: min(480px, 100% - 32px);
  max-height: calc(100dvh - 36px);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  color: var(--ink);
}
dialog::backdrop { background: #090f27b0; backdrop-filter: blur(5px); }
.close-dialog { position: absolute; right: 12px; top: 12px; }
.dialog-track { display: flex; align-items: center; gap: 13px; padding-right: 35px; }
.dialog-track h2 { font-size: 1.3rem; margin: 0; overflow-wrap: anywhere; }
.dialog-track p { color: var(--muted); margin: 6px 0 0; }
dialog h3 { margin: 20px 0 8px; font-size: 1rem; }
.song-services { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.song-services a {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 9px 8px;
  border: 1px solid var(--line);
  border-radius: 11px;
  font-size: .89rem;
}
.song-services a:hover { background: var(--glass); }
.song-services img { width: 27px; height: 27px; object-fit: contain; }
.no-script { position: fixed; z-index: 3; bottom: 78px; background: var(--panel); padding: 16px; }

@media (max-width: 950px) {
  .wrap { width: calc(100% - 48px); }
  .hero { gap: clamp(28px, 4vw, 55px); }
}
@media (min-width: 761px) and (max-height: 810px) {
  .hero { padding-block: 44px 62px; }
  .hero h1 { font-size: clamp(49px, 5.5vw, 80px); text-wrap: initial; }
  .hero-media { width: min(100%, 454px); justify-self: end; }
}
@media (max-width: 760px) {
  .wrap { width: calc(100% - 36px); }
  .header-inner { min-height: 72px; gap: 12px; grid-template-columns: 1fr auto; }
  .brand { width: 116px; }
  nav { grid-column: 1 / -1; grid-row: 2; justify-content: space-between; gap: 10px; padding-bottom: 13px; }
  nav a { font-size: .87rem; }
  .theme-button { grid-column: 2; grid-row: 1; width: 39px; height: 39px; }
  .header-inner > .brand, .theme-button { margin-top: 8px; }
  .hero { grid-template-columns: 1fr; padding-block: 33px 38px; gap: 17px; }
  .hero-media { grid-row: 1; width: min(100%, 445px); margin: auto; padding-right: 13px; padding-bottom: 14px; }
  .hero-content { max-width: 445px; margin-inline: auto; width: 100%; }
  .hero h1 { font-size: clamp(44px, 9.8vw, 72px); text-wrap: initial; }
  .hero-content > p:not(.player-note) { margin-block: 13px 18px; line-height: 1.45; }
  .now-card { min-height: 60px; padding: 8px; gap: 8px; width: min(87%, 310px); border-radius: 15px; }
  .now-card .track-art { width: 41px; height: 41px; }
  .now-card .track-text { gap: 1px; }
  .primary { height: 51px; min-width: 146px; padding: 0 13px; border-radius: 14px; }
  .hero-actions { gap: 15px; }
  .station-info { grid-template-columns: 1fr; gap: 33px; padding-block: 25px 35px; }
  .about { min-height: 0; }
  .player-inner { min-height: 66px; width: calc(100% - 26px); grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; }
  .player-track { grid-column: 2; grid-row: 1; gap: 7px; }
  .round-play { grid-column: 1; grid-row: 1; width: 42px; height: 42px; }
  .player-track .track-art { display: none; }
  .sound-controls { grid-column: 3; grid-row: 1; gap: 6px; }
  .sound-controls input[type="range"] { display: none; }
  .quality-control select { padding-left: 8px; }
  .footer-inner { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  :root { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0s !important; transition-duration: 0s !important; }
}
