/* ==========================================================================
   ChorySong — style.css
   Paleta: czerń + granat, akcent indygo. Design tokens poniżej.
   ========================================================================== */

:root {
  /* Kolory */
  --c-black: #05070C;
  --c-navy-900: #0A1024;
  --c-navy-800: #0E1630;
  --c-navy-700: #161F3D;
  --c-navy-600: #202B52;
  --c-text: #EAF0FF;
  --c-text-muted: #8A93B8;
  --c-text-dim: #5C6488;
  --c-accent: #5B6EF5;
  --c-accent-bright: #7C8CFF;
  --c-accent-dim: rgba(91, 110, 245, 0.18);
  --c-border: rgba(234, 240, 255, 0.08);

  /* Typografia */
  --f-display: 'Unbounded', system-ui, sans-serif;
  --f-body: 'Inter', system-ui, -apple-system, sans-serif;
  --f-mono: 'JetBrains Mono', 'Courier New', monospace;

  /* Layout */
  --max-w: 1160px;
  --player-h: 88px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;

  --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
}

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

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--c-black);
  color: var(--c-text);
  font-family: var(--f-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: var(--player-h);
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--c-accent);
  color: #fff;
  padding: 12px 20px;
  z-index: 999;
  border-radius: 0 0 8px 0;
}
.skip-link:focus {
  left: 0;
}

:focus-visible {
  outline: 2px solid var(--c-accent-bright);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ==========================================================================
   Tło paralaksy — sygnatura strony: warstwowe "góry" waveformu
   ========================================================================== */

.bg-layers {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: radial-gradient(ellipse 120% 80% at 50% -10%, var(--c-navy-800) 0%, var(--c-black) 55%);
}

.layer {
  position: absolute;
  left: -10%;
  width: 120%;
  height: 60vh;
  background-repeat: no-repeat;
  background-size: cover;
  will-change: transform;
}

.layer-1 {
  bottom: -5%;
  height: 45vh;
  background: linear-gradient(180deg, transparent, var(--c-navy-700) 90%);
  clip-path: polygon(0 60%, 8% 45%, 18% 58%, 30% 35%, 42% 55%, 55% 30%, 68% 52%, 80% 38%, 92% 55%, 100% 42%, 100% 100%, 0 100%);
  opacity: 0.55;
  animation: drift-1 26s ease-in-out infinite;
}

.layer-2 {
  bottom: -8%;
  height: 55vh;
  background: linear-gradient(180deg, transparent, var(--c-navy-800) 92%);
  clip-path: polygon(0 70%, 10% 50%, 22% 65%, 35% 42%, 48% 62%, 60% 40%, 74% 60%, 86% 45%, 100% 60%, 100% 100%, 0 100%);
  opacity: 0.7;
  animation: drift-2 34s ease-in-out infinite;
}

.layer-3 {
  bottom: -12%;
  height: 65vh;
  background: linear-gradient(180deg, transparent, #080D1C 95%);
  clip-path: polygon(0 80%, 15% 60%, 28% 75%, 40% 55%, 55% 72%, 70% 50%, 85% 70%, 100% 58%, 100% 100%, 0 100%);
  opacity: 0.9;
  animation: drift-3 42s ease-in-out infinite;
}

@keyframes drift-1 { 0%,100% { transform: translateX(0) translateY(0); } 50% { transform: translateX(-2%) translateY(-1.5%); } }
@keyframes drift-2 { 0%,100% { transform: translateX(0) translateY(0); } 50% { transform: translateX(2.5%) translateY(-1%); } }
@keyframes drift-3 { 0%,100% { transform: translateX(0) translateY(0); } 50% { transform: translateX(-1.5%) translateY(-2%); } }

.grain {
  position: absolute;
  inset: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px clamp(20px, 5vw, 64px);
  backdrop-filter: blur(14px);
  background: linear-gradient(180deg, rgba(5,7,12,0.85), rgba(5,7,12,0.4));
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease-smooth);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--c-accent), var(--c-navy-600));
  position: relative;
  flex-shrink: 0;
}
.logo-mark::after {
  content: "";
  position: absolute;
  inset: 8px;
  background: linear-gradient(180deg, #fff, transparent);
  clip-path: polygon(0 100%, 25% 40%, 50% 80%, 75% 20%, 100% 100%);
  opacity: 0.9;
}

.logo-text {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}
.logo-text em { color: var(--c-accent-bright); font-style: normal; }

.site-nav {
  display: flex;
  gap: clamp(16px, 3vw, 32px);
  font-size: 0.92rem;
  color: var(--c-text-muted);
}
.site-nav a { transition: color 0.2s; }
.site-nav a:hover { color: var(--c-text); }

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: clamp(60px, 12vw, 130px) clamp(20px, 5vw, 64px) 40px;
  min-height: 62vh;
  display: flex;
  align-items: center;
}

.hero-inner {
  max-width: 640px;
  animation: rise-in 0.9s var(--ease-smooth) both;
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.eyebrow {
  font-family: var(--f-mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-accent-bright);
  margin: 0 0 14px;
}

.hero-title {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 6.5vw, 4.4rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
}

.accent-text {
  color: var(--c-accent-bright);
  position: relative;
}

.hero-sub {
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  color: var(--c-text-muted);
  max-width: 480px;
  margin: 0 0 34px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--c-accent);
  color: #fff;
  padding: 15px 26px;
  border-radius: 100px;
  font-weight: 600;
  font-size: 0.96rem;
  transition: transform 0.25s var(--ease-smooth), box-shadow 0.25s var(--ease-smooth), background 0.25s;
  box-shadow: 0 8px 24px -8px rgba(91, 110, 245, 0.55);
}
.btn-primary:hover {
  transform: translateY(-2px);
  background: var(--c-accent-bright);
  box-shadow: 0 12px 30px -6px rgba(91, 110, 245, 0.7);
}
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  padding: 15px 22px;
  color: var(--c-text-muted);
  border: 1px solid var(--c-border);
  border-radius: 100px;
  font-weight: 500;
  font-size: 0.96rem;
  transition: all 0.25s var(--ease-smooth);
}
.btn-ghost:hover {
  color: var(--c-text);
  border-color: var(--c-accent);
  background: var(--c-accent-dim);
}

.hero-wave {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: auto;
  pointer-events: none;
}
.wave-path {
  fill: var(--c-navy-800);
  opacity: 0.5;
}

/* ==========================================================================
   Playlist
   ========================================================================== */

.playlist-section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 40px clamp(20px, 5vw, 64px) 80px;
}

.playlist-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.playlist-header h2 {
  font-family: var(--f-display);
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  margin: 0;
  letter-spacing: -0.01em;
}

.track-count {
  font-family: var(--f-mono);
  color: var(--c-text-dim);
  font-size: 0.85rem;
  margin: 0;
}

.playlist-columns {
  display: grid;
  grid-template-columns: 48px 1fr 160px 70px;
  gap: 16px;
  padding: 0 16px 12px;
  border-bottom: 1px solid var(--c-border);
  font-family: var(--f-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-text-dim);
}

.track-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.track-row {
  display: grid;
  grid-template-columns: 48px 1fr 160px 70px;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  transition: background 0.2s var(--ease-smooth);
  cursor: pointer;
  animation: row-in 0.5s var(--ease-smooth) both;
}

@keyframes row-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.track-row:hover,
.track-row:focus-visible {
  background: var(--c-navy-700);
}

.track-row.is-playing {
  background: var(--c-accent-dim);
}

.track-num {
  font-family: var(--f-mono);
  color: var(--c-text-dim);
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.track-num .play-icon-mini { display: none; }
.track-row:hover .track-num .index-num { display: none; }
.track-row:hover .track-num .play-icon-mini { display: flex; }
.track-row.is-playing .track-num .index-num { display: none; }
.track-row.is-playing .track-num .play-icon-mini {
  display: flex;
  color: var(--c-accent-bright);
}

.bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}
.bars span {
  width: 3px;
  background: var(--c-accent-bright);
  border-radius: 2px;
  animation: bar-bounce 0.9s ease-in-out infinite;
}
.bars span:nth-child(1) { height: 40%; animation-delay: 0s; }
.bars span:nth-child(2) { height: 100%; animation-delay: 0.15s; }
.bars span:nth-child(3) { height: 65%; animation-delay: 0.3s; }
@keyframes bar-bounce {
  0%, 100% { transform: scaleY(0.4); }
  50% { transform: scaleY(1); }
}

.track-titlecell {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.track-cover {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--c-navy-600), var(--c-navy-800));
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.track-cover img { width: 100%; height: 100%; object-fit: cover; }

.track-text { min-width: 0; }
.track-title {
  font-weight: 600;
  font-size: 0.96rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.track-row.is-playing .track-title { color: var(--c-accent-bright); }

.track-artist {
  font-size: 0.83rem;
  color: var(--c-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-album {
  font-size: 0.85rem;
  color: var(--c-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-duration {
  font-family: var(--f-mono);
  font-size: 0.83rem;
  color: var(--c-text-dim);
  text-align: right;
}

.empty-state {
  text-align: center;
  color: var(--c-text-muted);
  padding: 60px 20px;
}

/* ==========================================================================
   About
   ========================================================================== */

.about-section {
  border-top: 1px solid var(--c-border);
  padding: 80px clamp(20px, 5vw, 64px);
}
.about-inner {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}
.about-inner h2 {
  font-family: var(--f-display);
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  margin: 0 0 16px;
}
.about-inner p:last-child {
  color: var(--c-text-muted);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  text-align: center;
  padding: 32px 20px;
  color: var(--c-text-dim);
  font-size: 0.82rem;
}

/* ==========================================================================
   Player bar (dolny pasek — jak w Spotify)
   ========================================================================== */

.player-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--player-h);
  z-index: 50;
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(280px, 2fr) minmax(120px, 1fr);
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  background: rgba(10, 16, 36, 0.88);
  backdrop-filter: blur(18px);
  border-top: 1px solid var(--c-border);
}

.player-track-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.player-cover {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--c-navy-600), var(--c-navy-800));
  flex-shrink: 0;
}
.player-cover img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }

.player-meta { min-width: 0; }
.player-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-artist {
  font-size: 0.78rem;
  color: var(--c-text-muted);
  margin: 2px 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.control-buttons {
  display: flex;
  align-items: center;
  gap: 18px;
}

.ctrl-btn {
  color: var(--c-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, transform 0.2s;
}
.ctrl-btn:hover { color: var(--c-text); transform: scale(1.08); }

.ctrl-btn--play {
  width: 36px;
  height: 36px;
  background: var(--c-text);
  color: var(--c-black);
  border-radius: 50%;
  transition: transform 0.2s var(--ease-smooth), background 0.2s;
}
.ctrl-btn--play:hover { transform: scale(1.06); background: #fff; color: var(--c-black); }

.progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 520px;
}

.time-current, .time-duration {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  color: var(--c-text-dim);
  min-width: 34px;
}
.time-duration { text-align: left; }

.progress-bar {
  position: relative;
  flex: 1;
  height: 14px;
  display: flex;
  align-items: center;
  cursor: pointer;
}
.progress-track {
  position: absolute;
  left: 0; right: 0;
  height: 4px;
  border-radius: 4px;
  background: var(--c-navy-700);
}
.progress-fill {
  position: absolute;
  left: 0;
  height: 4px;
  border-radius: 4px;
  background: var(--c-accent-bright);
  width: 0%;
  transition: width 0.1s linear;
}
.progress-handle {
  position: absolute;
  left: 0%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.15);
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.2s;
}
.progress-bar:hover .progress-handle { opacity: 1; }

.player-volume {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-self: end;
}

.volume-bar {
  position: relative;
  width: 90px;
  height: 14px;
  display: flex;
  align-items: center;
  cursor: pointer;
}
.volume-track {
  position: absolute;
  left: 0; right: 0;
  height: 4px;
  border-radius: 4px;
  background: var(--c-navy-700);
}
.volume-fill {
  position: absolute;
  left: 0;
  height: 4px;
  border-radius: 4px;
  background: var(--c-text-muted);
  width: 80%;
}

/* ==========================================================================
   Responsywność
   ========================================================================== */

@media (max-width: 860px) {
  .player-bar {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    height: auto;
    padding: 10px 14px 14px;
    gap: 8px 12px;
  }
  .player-track-info { grid-column: 1; grid-row: 1; }
  .player-volume { grid-column: 2; grid-row: 1; }
  .player-controls { grid-column: 1 / -1; grid-row: 2; }
  body { padding-bottom: 108px; }

  .playlist-columns { display: none; }
  .track-row {
    grid-template-columns: 32px 1fr 60px;
  }
  .track-album { display: none; }
}

@media (max-width: 600px) {
  .site-nav { display: none; }
  .hero { min-height: 52vh; padding-top: 90px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .btn-primary, .btn-ghost { justify-content: center; text-align: center; }
  .player-volume { display: none; }
  .player-bar { grid-template-columns: 1fr; }
  .player-track-info { grid-row: 1; }
  .player-controls { grid-row: 2; }
  .track-cover { width: 38px; height: 38px; }
  .track-duration { font-size: 0.76rem; }
}

@media (max-width: 380px) {
  .hero-title { font-size: 2rem; }
  .logo-text { font-size: 1rem; }
}
