:root {
  color-scheme: dark;
  --bg: #100c18;
  --surface: #1b1528;
  --surface-hover: #251c35;
  --line: #332744;
  --text: #f7f3fc;
  --muted: #b9aec9;
  --violet: #c4a4ff;
  --primary: #ad86f5;
  --brand: #b891ff;
  --page-width: 1280px;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.6 "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}
body:has(.player:not([hidden])) { padding-bottom: 94px; }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #e0c9ff; outline-offset: 4px; }
.shell { width: min(calc(100% - 80px), var(--page-width)); margin-inline: auto; }
.visually-hidden {
  width: 1px; height: 1px; position: absolute; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%);
}
.skip-link {
  position: absolute; inset: 8px auto auto 8px; padding: 9px 15px;
  z-index: 5; background: var(--surface); transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

.header { background: #130e1d; border-bottom: 1px solid #281e38; }
.header-inner { min-height: 77px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 25px; }
.brand, .header nav, .favorites-button { display: flex; align-items: center; }
.brand { justify-self: start; font-size: 1.52rem; font-weight: 790; letter-spacing: -.066em; line-height: 1; }
.brand-mark {
  width: 34px; height: 34px; margin-right: 10px;
  display: grid; grid-auto-flow: column; place-content: center; align-items: center; gap: 3px;
  background: linear-gradient(145deg, #b992ff, #9464e9);
  border-radius: 10px; box-shadow: 0 4px 20px #a96bff30;
}
.brand-mark i { width: 2px; border-radius: 2px; background: #1d1030; }
.brand-mark i:nth-child(1) { height: 8px; }
.brand-mark i:nth-child(2) { height: 17px; }
.brand-mark i:nth-child(3) { height: 12px; }
.brand-mark i:nth-child(4) { height: 6px; }
.brand-period { color: var(--brand); }
.header nav { gap: 32px; color: var(--muted); font-size: .9rem; font-weight: 640; }
.header nav a { padding-block: 22px; }
.header nav a[aria-current], .header nav a:hover { color: var(--text); }
.favorites-button {
  justify-self: end; gap: 9px; border: 1px solid var(--line); border-radius: 10px;
  color: var(--text); background: transparent; padding: 8px 13px;
  font-size: .9rem; font-weight: 650; white-space: nowrap;
}
.favorites-button:hover, .favorites-button[aria-pressed="true"] { background: var(--surface-hover); border-color: #a789d2; }
.heart-icon { color: var(--violet); font-size: 1.15rem; line-height: 1; }
.favorites-count { font-size: .8125rem; color: var(--violet); }

.hero {
  position: relative; display: flex; align-items: center; min-height: clamp(430px, 41vw, 560px);
  margin-top: 30px; overflow: hidden; border: 1px solid #3b2a55; border-radius: 25px;
  background-color: #180d2d;
  background-image: linear-gradient(90deg, #120b20 3%, #170e26e6 32%, #180c2900 70%), url("/meloseek-site/assets/hero.webp"),
                    radial-gradient(ellipse at 75% 44%, #5d23a1, #1a102b 56%, #100b1c 83%);
  background-position: center; background-size: cover; isolation: isolate;
}
.hero-content { padding: 48px clamp(42px, 6vw, 88px); width: min(100%, 700px); position: relative; }
.hero h1 {
  font-size: clamp(3.6rem, 6.35vw, 6.2rem); font-weight: 810; line-height: .99;
  letter-spacing: -.083em; margin: 0 0 24px;
}
.hero h1 em { color: var(--violet); font-style: normal; }
.hero p { max-width: 34ch; margin: 0 0 29px; color: #e0d3ef; font-size: clamp(1.03rem, 1.6vw, 1.2rem); }
.primary-button, .secondary-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 11px;
  min-height: 48px; padding: 11px 18px; border: 1px solid transparent; border-radius: 10px;
  background: var(--primary); color: #1a102a; font-size: .95rem; font-weight: 750;
}
.primary-button:hover, .secondary-button:hover { background: #d6beff; }
.play-icon {
  display: inline-block; width: 0; height: 0; border-top: 6px solid transparent;
  border-bottom: 6px solid transparent; border-left: 10px solid currentColor; margin-left: 2px;
}
.is-playing .play-icon {
  width: 10px; height: 12px; margin: 0; border: 0; border-inline: 3px solid currentColor;
}

.catalog { margin-top: 47px; scroll-margin-top: 20px; }
.catalog-top { display: flex; justify-content: space-between; align-items: end; gap: 22px; }
.catalog h1, .catalog h2 { margin: 0; font-size: clamp(1.9rem, 4vw, 2.55rem); letter-spacing: -.057em; line-height: 1.14; }
.catalog-top p { color: var(--muted); margin: 8px 0 0; }
.search {
  display: flex; align-items: center; gap: 11px; width: min(100%, 310px); flex-shrink: 0;
  min-height: 44px; padding-inline: 13px; border: 1px solid var(--line); border-radius: 10px;
  color: var(--muted); background: #181122;
}
.search:focus-within { border-color: var(--violet); }
.search input { background: none; border: 0; color: var(--text); width: 100%; min-width: 0; height: 42px; outline: none; }
.search input::placeholder { color: var(--muted); }
.search-icon { width: 13px; height: 13px; border: 1.5px solid currentColor; border-radius: 50%; flex: none; position: relative; }
.search-icon::after { content: ""; width: 6px; height: 1.5px; position: absolute; left: 9px; top: 10px; transform: rotate(45deg); background: currentColor; }
.filters-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 22px 0 20px; scroll-margin-top: 20px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters button {
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 15px;
  min-height: 36px; color: var(--muted); background: #171021; font-size: .9rem; font-weight: 650;
}
.filters button:hover { color: var(--text); border-color: #8563a9; }
.filters button[aria-pressed="true"] { background: #3e285c; color: #efe2ff; border-color: #684b91; }
.results-count { color: var(--muted); flex: none; font-size: .875rem; }
.tracks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.track { min-width: 0; overflow: hidden; border: 1px solid #322641; border-radius: 15px; background: #191224; }
.track:hover { border-color: #795d9b; }
.track-art, .mini-art {
  --a: #a85efa; --b: #351960; --c: #eb8ed3;
  position: relative; overflow: hidden; isolation: isolate;
  background:
    repeating-radial-gradient(ellipse at 66% 52%, transparent 0 15px, #ffffff19 16px 17px, transparent 18px 23px),
    radial-gradient(ellipse at 69% 35%, var(--a), transparent 60%),
    linear-gradient(137deg, var(--b), var(--c));
}
.track-art { aspect-ratio: 1.64; }
.track-art::before {
  content: ""; position: absolute; z-index: -1; width: 62%; aspect-ratio: 1;
  right: 14%; top: 7%; border: 1px solid #ffffff60; border-radius: 46% 54% 60% 40%;
  transform: rotate(-25deg); background: linear-gradient(153deg, #ffffff35, var(--b) 65%, #ffffff10);
  box-shadow: 0 12px 34px #120b2370, inset 0 1px 25px #ffffff26;
}
.art-2 { --a:#f6a5bc; --b:#58243c; --c:#d2797e; }
.art-3 { --a:#73d2ac; --b:#143f3e; --c:#57ad8f; }
.art-4 { --a:#f8b774; --b:#58352d; --c:#a65b36; }
.art-5 { --a:#8fa9ff; --b:#203261; --c:#5c78d3; }
.art-6 { --a:#e68cd8; --b:#49214f; --c:#b054ae; }
.art-7 { --a:#8ed5e8; --b:#204e67; --c:#5f93ba; }
.art-8 { --a:#ddd889; --b:#4c4426; --c:#a7a851; }
.art-2::before, .art-5::before, .art-8::before { border-radius: 50%; transform: translate(0, 3%) scale(.92); }
.art-3::before, .art-6::before { border-radius: 19% 55% 29% 50%; transform: rotate(-35deg); }
.art-4::before, .art-7::before { border-radius: 27% 55% 27% 44%; transform: rotate(33deg) scale(.91); }
.track-favorite, .track-play {
  position: absolute; right: 10px; display: grid; place-items: center; padding: 0;
  border-radius: 50%; box-shadow: 0 3px 12px #160e2c45;
}
.track-favorite {
  top: 10px; width: 37px; height: 37px; color: #fff; background: #170f29d9;
  border: 1px solid #ffffff34; font-size: 1.5rem; line-height: 1;
}
.track-favorite[aria-pressed="true"] { color: #ffd1ed; background: #311d45; }
.track-play { bottom: 10px; width: 43px; height: 43px; border: 0; color: #1b102a; background: #efe2fc; }
.track-play:hover, .track-play.is-playing { background: var(--primary); }
.track-info { padding: 12px 13px 14px; display: flex; justify-content: space-between; align-items: center; gap: 7px; }
.track-info h3 { margin: 0; line-height: 1.3; font-size: 1.03rem; letter-spacing: -.022em; }
.track-genre { margin: 5px 0 0; color: var(--muted); font-size: .875rem; }
.track-duration { color: var(--muted); font-size: .8125rem; font-variant-numeric: tabular-nums; }
.empty-state { text-align: center; padding: 54px 20px; border: 1px dashed var(--line); border-radius: 14px; }
.empty-state h3 { margin: 0; font-size: 1.3rem; }
.empty-state p { margin: 8px 0 18px; color: var(--muted); }
.secondary-button { background: #262039; border-color: #503d6a; color: var(--text); }
.secondary-button:hover { color: #1a102a; }

.footer {
  margin-top: 48px; border-top: 1px solid var(--line); min-height: 98px;
  display: flex; align-items: center; gap: 22px; justify-content: space-between;
  color: var(--muted); font-size: .875rem;
}
.footer-brand { color: var(--text); font-size: 1.27rem; }
.footer-brand .brand-mark { width: 29px; height: 29px; border-radius: 8px; }
.footer > a:last-child:hover { color: var(--text); text-decoration: underline; }

.player {
  position: fixed; z-index: 4; inset: auto 0 0;
  border-top: 1px solid #4b3668;
  background: #1d142b; box-shadow: 0 -8px 28px #0d07198c;
}
.player-inner { min-height: 79px; display: grid; grid-template-columns: minmax(130px, .8fr) auto minmax(100px, 1.2fr) auto; align-items: center; gap: 24px; }
.now-playing { display: flex; align-items: center; gap: 10px; min-width: 0; }
.now-playing > div:last-child { min-width: 0; }
.now-playing strong, .now-playing span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.now-playing strong { font-size: .94rem; }
.now-playing span { color: var(--muted); font-size: .8125rem; }
.mini-art { width: 44px; height: 44px; border-radius: 7px; flex: none; }
.transport { display: flex; align-items: center; gap: 7px; }
.transport button, .player-close {
  display: grid; place-items: center; border: 0; border-radius: 50%; padding: 0;
  background: transparent; color: var(--text); width: 36px; height: 36px;
}
.transport-step:hover, .player-close:hover { background: #403057; }
.transport .player-play { width: 42px; height: 42px; background: var(--primary); color: #1a102a; }
.step-icon { position: relative; width: 13px; height: 11px; }
.step-icon::before { content: ""; position: absolute; left: 0; inset-block: 0; border-block: 5.5px solid transparent; border-left: 8px solid currentColor; }
.step-icon::after { content: ""; position: absolute; right: 0; inset-block: 0; background: currentColor; width: 2px; }
.step-previous { rotate: 180deg; }
.seek { display: grid; grid-template-columns: 2.4em minmax(0, 1fr) 2.4em; align-items: center; gap: 8px; color: var(--muted); font-size: .8125rem; font-variant-numeric: tabular-nums; }
.seek input { width: 100%; accent-color: var(--primary); cursor: pointer; }
.player-close { font-size: 1.45rem; }
.player-status { grid-column: 1/-1; margin: 0 0 9px; color: #ffd3dc; font-size: .9rem; }
@media (max-width: 1000px) {
  .shell { width: min(calc(100% - 48px), var(--page-width)); }
  .tracks { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
  .hero h1 { font-size: clamp(3.3rem, 8vw, 5.5rem); }
}
@media (max-width: 690px) {
  .shell { width: calc(100% - 32px); }
  .header-inner { min-height: 67px; gap: 10px; grid-template-columns: 1fr auto; }
  .header nav { order: 3; grid-column: 1/-1; gap: 25px; }
  .header nav a { padding: 2px 0 11px; }
  .header .brand { font-size: 1.32rem; }
  .brand-mark { width: 29px; height: 29px; }
  .hero {
    margin-top: 19px; min-height: 438px; border-radius: 17px; align-items: end;
    background-size: cover, auto 70%, cover; background-repeat: no-repeat;
    background-position: center, 75% 0, center;
    background-image: linear-gradient(0deg, #120a1f 0%, #140b22f0 29%, #140b2266 62%, #140b2210 100%), url("/meloseek-site/assets/hero.webp"),
                      radial-gradient(ellipse at 76% 23%, #5d23a1, #190f2d 58%);
  }
  .hero-content { padding: 140px 21px 29px; }
  .hero h1 { font-size: clamp(2.85rem, 11.3vw, 4.8rem); margin-bottom: 14px; }
  .hero p { margin-bottom: 20px; }
  .catalog { margin-top: 34px; }
  .catalog-top { display: grid; gap: 13px; }
  .search { width: 100%; }
  .filters-row { flex-wrap: wrap; margin-block: 15px; }
  .filters { gap: 6px; }
  .filters button { min-height: 35px; padding-inline: 10px; }
  .tracks { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
  .track-info { padding: 10px; }
  .track-info h3 { font-size: .96rem; }
  .track-favorite { width: 32px; height: 32px; top: 7px; right: 7px; }
  .track-play { width: 36px; height: 36px; bottom: 7px; right: 7px; }
  .footer { padding-block: 14px; flex-wrap: wrap; margin-top: 34px; gap: 13px; }
  .footer p { order: 3; flex-basis: 100%; margin: 0; }
  body:has(.player:not([hidden])) { padding-bottom: 110px; }
  .player-inner { grid-template-columns: minmax(0, 1fr) auto auto; gap: 5px 9px; padding-block: 6px; }
  .seek { grid-row: 2; grid-column: 1/-1; }
  .transport { gap: 3px; }
  .mini-art { width: 34px; height: 34px; }
  .player-close { width: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

.favorites-button[aria-current="page"] {
  background: var(--surface-hover);
  border-color: #a789d2;
}
.section-page .catalog {
  min-height: 60vh;
  margin-top: clamp(34px, 6vw, 70px);
}
.section-page .catalog h1 {
  font-size: clamp(2.15rem, 5vw, 3.4rem);
}
