:root {
  color-scheme: dark;
  --page: #636c71;
  --page-dark: #555d61;
  --ink: #fff;
  --muted: #c1c1c8;
  --accent: #ff9900;
  --link-active: #0099ff;
  --line: rgba(255, 255, 255, 0.76);
  --header-height: 136px;
  --section-height: 48px;
  --player-height: 82px;
  --panel-offset: 0%;
  --city-position: 15%;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
}

html {
  background: var(--page);
}

body {
  position: relative;
  margin: 0;
  overflow: hidden;
  background:
    linear-gradient(180deg, #52595d 0, var(--page) 22%, #687176 78%, #586065 100%);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(1rem, 0.88rem + 0.35vw, 1.15rem);
  line-height: 1.5;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 8px 12px;
  transform: translateY(-150%);
  background: #222;
}

.skip-link:focus {
  transform: none;
}

.site-header {
  position: fixed;
  z-index: 20;
  top: 0;
  right: 0;
  left: 0;
  height: var(--header-height);
  padding: 12px max(20px, calc((100vw - 1540px) / 2));
}

.brand {
  display: block;
  width: 364px;
  height: 118px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.brand img {
  display: block;
  width: 344px;
  height: 113px;
  filter: blur(0.2px);
  image-rendering: auto;
  object-fit: contain;
  object-position: left center;
}

.stage {
  position: fixed;
  z-index: 2;
  top: var(--header-height);
  right: max(20px, calc((100vw - 1540px) / 2));
  bottom: var(--player-height);
  left: max(20px, calc((100vw - 1540px) / 2));
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: 20px;
  background: transparent;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.28),
    0 1px 3px rgba(0, 0, 0, 0.24);
  touch-action: pan-y;
  isolation: isolate;
}

.stage::before {
  content: none;
}

.stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: #777d7f;
}

.is-safari .stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: url("city-panorama.jpg") no-repeat;
  background-size: cover;
  background-position: var(--city-position) center;
  filter: grayscale(1) contrast(1.04);
  transform: scale(1.005) translateZ(0);
  animation: city-breathe 12s ease-in-out infinite alternate;
  backface-visibility: hidden;
}

.city-panorama {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--city-position) center;
  filter: grayscale(1) contrast(1.04);
  transform: scale(1.005);
  animation: city-breathe 12s ease-in-out infinite alternate;
}

.stage-fade {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.86) 0%,
      rgba(0, 0, 0, 0.58) 14%,
      rgba(0, 0, 0, 0.24) 32%,
      rgba(255, 255, 255, 0) 68%
    );
}

.is-safari .city-panorama {
  opacity: 0;
}

/* ponytail: transitions enabled only after first paint — firing one on
   initial load (direct #hash) blanks the isolated .stage in WebKit */
.is-ready .city-panorama {
  transition: object-position 1100ms cubic-bezier(0.2, 0.72, 0.2, 1);
}

.is-ready.is-safari .stage::before {
  transition: background-position 1100ms cubic-bezier(0.2, 0.72, 0.2, 1);
}

@keyframes city-breathe {
  from { filter: grayscale(1) contrast(1.02) brightness(0.96); }
  to { filter: grayscale(1) contrast(1.07) brightness(1.02); }
}

.panel-track {
  position: relative;
  z-index: 3;
  display: flex;
  width: 600%;
  height: calc(100% - var(--section-height));
  transform: translate3d(var(--panel-offset), 0, 0);
  will-change: transform;
}

.is-ready .panel-track {
  transition: transform 780ms cubic-bezier(0.22, 0.78, 0.2, 1);
}

.panel {
  display: grid;
  width: 16.6666667%;
  height: 100%;
  flex: 0 0 16.6666667%;
  place-items: center;
  overflow: hidden;
  padding: clamp(18px, 4vw, 48px);
}

.panel:not(.is-active) .content-card {
  opacity: 0;
  transform: translateX(36px);
}

.panel.is-active .content-card {
  animation: card-in 560ms 260ms both;
}

@keyframes card-in {
  from { opacity: 0; transform: translateX(36px); }
  to { opacity: 1; transform: translateX(0); }
}

.content-card {
  width: min(520px, 100%);
  max-height: 88%;
  overflow: auto;
  padding: 22px 26px;
  border: 1px solid transparent;
  background: transparent;
  box-shadow: none;
  color: #f7f7f7;
  font-size: 1rem;
  line-height: 1.6;
  scrollbar-width: none;
  -ms-overflow-style: none;
  backdrop-filter: none;
}

.content-card::-webkit-scrollbar,
.lyrics-scroll::-webkit-scrollbar,
.credits-scroll::-webkit-scrollbar {
  display: none;
}

.content-card h1,
.content-card h2 {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 1.15rem;
  font-weight: normal;
  text-align: center;
}

.content-card h3 {
  color: var(--muted);
  font-size: 1rem;
  font-weight: normal;
}

.content-card p {
  margin: 0 0 13px;
}

.wide-card {
  width: min(900px, 100%);
  height: min(88%, 560px);
  max-height: 88%;
}

.section-bar {
  position: fixed;
  z-index: 20;
  right: max(20px, calc((100vw - 1540px) / 2));
  bottom: var(--player-height);
  left: max(20px, calc((100vw - 1540px) / 2));
  display: grid;
  height: var(--section-height);
  grid-template-columns: 0 1fr 0;
  align-items: stretch;
  border-right: 0;
  border-top: 0;
  border-bottom: 0;
  border-left: 0;
  border-radius: 0 0 18px 18px;
  background: transparent;
}

.section-nav {
  display: grid;
  min-width: 0;
  grid-column: 2;
  grid-template-columns: repeat(5, 1fr) 1.75fr;
  align-items: stretch;
}

.section-nav button {
  position: relative;
  min-width: 0;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-size: clamp(0.95rem, 0.82rem + 0.25vw, 1.15rem);
  text-transform: lowercase;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  transition: color 160ms ease;
}

.section-nav button:hover,
.section-nav button.is-active {
  color: var(--link-active);
}

.section-nav .download-nav {
  color: var(--accent);
  font-size: clamp(1rem, 0.86rem + 0.3vw, 1.2rem);
}

.section-nav .download-nav:hover,
.section-nav .download-nav.is-active {
  color: var(--link-active);
}

.nav-arrow {
  display: none;
  border: 0;
  background: transparent;
  color: white;
  cursor: pointer;
  font-size: 2rem;
}

.nav-arrow-left {
  grid-column: 1;
}

.nav-arrow-right {
  grid-column: 3;
}

.lyrics-arrow {
  display: none;
}

.lyrics-layout {
  display: grid;
  height: calc(100% - 53px);
  grid-template-columns: 180px 1fr;
  gap: 20px;
  min-height: 0;
}

.song-index {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  border-right: 1px solid rgba(255, 255, 255, 0.18);
  padding-right: 18px;
}

.song-index button {
  padding: 6px 0;
  border: 0;
  background: transparent;
  color: white;
  cursor: pointer;
  font-size: 0.95rem;
  text-align: left;
}

.song-index button:hover,
.song-index button.is-active {
  color: var(--link-active);
}

.lyrics-scroll,
.credits-scroll {
  min-height: 0;
  overflow: auto;
  padding-right: 14px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.lyric h3 {
  margin-top: 0;
  font-size: 1.15rem;
}

.lyric[dir="rtl"] {
  text-align: right;
}

.credits-card {
  display: flex;
  flex-direction: column;
}

.credits-scroll {
  min-height: 0;
  overflow-y: auto;
  text-align: center;
}

.credits-scroll p {
  break-inside: avoid;
  color: #dfe1e0;
  font-size: 0.9rem;
}

.credits-scroll strong {
  color: white;
  font-weight: normal;
}

.contact-card {
  width: min(540px, 100%);
}

.contact-note {
  margin: 24px 0 0;
  color: #f7f7f7;
  font-size: clamp(1.05rem, 0.92rem + 0.35vw, 1.35rem);
  text-align: center;
}

.contact-note a {
  color: var(--link-active);
  text-decoration: none;
}

.contact-note a:hover {
  color: #fff;
}

.links-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.links-card h3 {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 0.9rem;
}

.links-card p {
  font-size: 0.9rem;
  line-height: 1.7;
}

.links-card a {
  color: #ccc;
  text-decoration: none;
}

.links-card a:hover {
  color: var(--link-active);
}

.download-card {
  width: min(420px, 100%);
  font-size: 1rem;
}

.download-layout {
  display: grid;
  grid-template-columns: minmax(150px, 0.95fr) minmax(0, 1.2fr);
  gap: 22px;
  align-items: center;
}

.download-artwork {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.24),
    inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.download-copy {
  min-width: 0;
}

.download-copy > a {
  display: block;
  margin: 12px 0;
  color: white;
  text-decoration: none;
}

.download-copy > a:hover {
  color: var(--link-active);
}

.download-copy > a span {
  color: var(--accent);
}

.player {
  position: fixed;
  z-index: 30;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  height: var(--player-height);
  grid-template-columns: minmax(220px, 0.9fr) auto minmax(240px, 1.2fr) minmax(100px, 0.4fr) auto;
  gap: clamp(14px, 2.5vw, 36px);
  align-items: center;
  padding: 0 max(20px, calc((100vw - 1540px) / 2));
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(44, 49, 53, 0.86);
  box-shadow:
    0 -12px 30px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.player button {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.player-track {
  display: grid;
  min-width: 0;
  grid-template-columns: 24px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 8px;
  padding: 0;
  text-align: left;
}

.player-track > span:nth-child(2) {
  min-width: 0;
}

.player-track strong,
.player-track small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-track strong {
  font-size: 0.95rem;
  font-weight: normal;
}

.player-track small,
.player-index {
  color: rgba(255, 255, 255, 0.52);
  font-size: 0.75rem;
}

.player-track b {
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: normal;
}

.player-toggle-icon {
  display: block;
  justify-self: end;
  width: 16px;
  height: 16px;
  color: var(--accent);
  flex: none;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 3px;
}

.player-controls button {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 0;
}

.player-controls button:hover {
  color: white;
}

.player-controls .play-pause {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 50%;
  color: white;
}

.player-icon {
  display: block;
  width: 16px;
  height: 16px;
  flex: none;
  fill: currentColor;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-pause {
  display: none;
}

.player[data-state="playing"] .icon-play {
  display: none;
}

.player[data-state="playing"] .icon-pause {
  display: block;
}

.player-volume button {
  overflow: hidden;
}

.player-icon-volume {
  width: 17px;
  height: 17px;
}

.player-progress {
  display: grid;
  min-width: 0;
  grid-template-columns: 30px minmax(90px, 1fr) 30px;
  gap: 8px;
  align-items: center;
  color: rgba(255, 255, 255, 0.52);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  min-width: 0;
  width: 100%;
  height: 3px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.player-volume {
  display: flex;
  align-items: center;
  gap: 5px;
}

.player-volume button {
  width: 30px;
  padding: 0;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.7rem;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  white-space: nowrap;
}

.footer-links > span,
.footer-links > a:last-child {
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.75rem;
}

.footer-links a:last-child {
  text-decoration: none;
  text-transform: uppercase;
}

.footer-links a:last-child:hover {
  color: var(--link-active);
}

.footer-links img {
  display: block;
  width: 50px;
  height: 16px;
}

.playlist-drawer {
  position: absolute;
  bottom: calc(var(--player-height) - 1px);
  left: max(20px, calc((100vw - 1540px) / 2));
  width: min(390px, calc(100vw - 40px));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
  background: rgba(44, 49, 53, 0.72);
  box-shadow:
    0 -12px 30px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px) saturate(110%);
  -webkit-backdrop-filter: blur(10px) saturate(110%);
  overflow: hidden;
}

.playlist-drawer[hidden] {
  display: none;
}

.playlist-drawer ol {
  margin: 0;
  padding: 6px 0;
  list-style: none;
}

.playlist-drawer button {
  display: grid;
  width: 100%;
  min-height: 32px;
  grid-template-columns: 36px 1fr;
  align-items: center;
  padding: 0 12px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  text-align: left;
}

.playlist-drawer button span {
  color: rgba(255, 255, 255, 0.34);
  font-size: 0.75rem;
}

.playlist-drawer button:hover,
.playlist-drawer button.is-active {
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

.playlist-drawer button.is-active span {
  color: var(--link-active);
}

.noscript {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  background: var(--page);
}

@media (max-width: 1050px) {
  .player {
    grid-template-columns: minmax(190px, 0.8fr) auto minmax(200px, 1fr) auto;
  }

  .player-volume {
    display: none;
  }

  .footer-links > span {
    display: none;
  }
}

@media (max-width: 720px) {
  :root {
    --header-height: 102px;
    --section-height: 45px;
    --player-height: 116px;
  }

  .site-header {
    padding: 3px 14px 0;
  }

  .brand {
    width: 270px;
    height: 94px;
  }

  .brand img {
    width: 260px;
    height: 86px;
  }

  .stage {
    right: 10px;
    left: 10px;
    border-radius: 14px;
  }

  .panel {
    padding: 14px;
  }

  .content-card,
  .wide-card {
    width: 100%;
    height: auto;
    max-height: 92%;
    padding: 18px;
  }

  .section-bar {
    right: 10px;
    left: 10px;
    grid-template-columns: 32px minmax(0, 1fr) 32px;
    border-radius: 0 0 12px 12px;
  }

  .nav-arrow {
    display: block;
    width: 30px;
    height: 30px;
    margin: auto;
    margin-inline: 0;
    border: 1px solid rgba(255, 255, 255, 0.26);
    border-radius: 999px;
    background: rgba(18, 18, 18, 0.28);
    color: rgba(255, 255, 255, 0.96);
    line-height: 1;
    text-align: center;
    font-size: 1.05rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.16);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition:
      transform 160ms ease,
      background-color 160ms ease,
      border-color 160ms ease;
  }

  .nav-arrow:hover,
  .nav-arrow:focus-visible {
    background: rgba(33, 33, 33, 0.4);
    border-color: rgba(255, 255, 255, 0.38);
    transform: scale(1.04);
  }

  .section-nav {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    padding: 0 14px;
  }

  .section-nav::-webkit-scrollbar {
    display: none;
  }

  .section-nav button {
    min-width: 88px;
    flex: 0 0 auto;
    padding: 0 12px;
    font-size: 1rem;
  }

  .section-nav .download-nav {
    min-width: 155px;
    font-size: 1.05rem;
  }

  .lyrics-layout {
    display: block;
    height: auto;
  }

  .song-index {
    display: flex;
    flex-direction: row;
    gap: 12px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    padding: 0 0 10px;
    scrollbar-width: none;
  }

  .song-index button {
    min-width: max-content;
  }

  .lyrics-scroll {
    max-height: 45vh;
    padding-top: 14px;
  }

  .credits-scroll {
    max-height: none;
    overflow: visible;
    columns: 1;
    padding-right: 0;
  }

  .contact-card form,
  .links-grid {
    grid-template-columns: 1fr;
  }

  .contact-card label:nth-child(3),
  .contact-card label:nth-child(4) {
    grid-column: auto;
  }

  .links-grid {
    gap: 8px;
  }

  .lyrics-layout {
    position: relative;
    padding-inline: clamp(28px, 7vw, 42px);
  }

  .lyrics-arrow {
    position: absolute;
    top: 12px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(255, 255, 255, 0.26);
    border-radius: 999px;
    background: rgba(18, 18, 18, 0.28);
    color: rgba(255, 255, 255, 0.96);
    cursor: pointer;
    font-size: 1.05rem;
    line-height: 1;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.16);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition:
      transform 160ms ease,
      background-color 160ms ease,
      border-color 160ms ease;
  }

  .lyrics-arrow-left {
    left: 0;
    transform: translateX(-50%);
  }

  .lyrics-arrow-right {
    right: 0;
    transform: translateX(50%);
  }

  .lyrics-arrow:hover,
  .lyrics-arrow:focus-visible {
    background: rgba(33, 33, 33, 0.4);
    border-color: rgba(255, 255, 255, 0.38);
    transform: translateX(var(--arrow-shift, 0)) scale(1.04);
  }

  .lyrics-arrow-left:hover,
  .lyrics-arrow-left:focus-visible {
    --arrow-shift: -50%;
  }

  .lyrics-arrow-right:hover,
  .lyrics-arrow-right:focus-visible {
    --arrow-shift: 50%;
  }

  .player {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-rows: 54px 38px 20px;
    gap: 0 8px;
    padding: 4px 12px 6px;
  }

  .player-track {
    grid-column: 1;
    grid-row: 1;
  }

  .player-controls {
    grid-column: 2;
    grid-row: 1;
  }

  .player-controls button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    white-space: nowrap;
  }

  .player-progress {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .footer-links {
    grid-column: 1 / -1;
    grid-row: 3;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 4px 8px;
    width: 100%;
    text-align: center;
  }

  .footer-links > span {
    display: none;
  }

  .footer-links a:last-child {
    flex-basis: 100%;
    text-align: center;
  }

  .playlist-drawer {
    right: 12px;
    left: 12px;
    width: auto;
  }
}

@media (max-width: 380px) {
  .player {
    gap: 0 4px;
  }

  .player-controls button {
    width: 27px;
  }

  .player-controls .play-pause {
    width: 36px;
    height: 36px;
  }

  .footer-links a[rel="license"] {
    display: none;
  }

  .download-layout {
    display: flex;
    flex-direction: column-reverse;
    gap: 14px;
  }

  .download-artwork {
    width: min(100%, 280px);
    margin: 0 auto;
  }

  .download-copy > a {
    margin-left: 20px;
  }
}

@media (max-height: 650px) and (min-width: 721px) {
  :root {
    --header-height: 86px;
    --player-height: 72px;
    --section-height: 42px;
  }

  .site-header {
    padding-top: 1px;
  }

  .brand,
  .brand img {
    height: 76px;
  }

  .brand img {
    width: 220px;
  }

  .content-card {
    max-height: 92%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
