/* ============================================================
   GETHER.FM — „KRWAWY REAKTOR"
   czerń + krwawa czerwień · Unbounded / Archivo / JetBrains Mono
   ============================================================ */

:root {
  --void: #060407;
  --panel: #0e0a0d;
  --panel-2: #150d11;
  --blood: #ff2038;
  --crimson: #8f0f1d;
  --ember: #ff6a3d;
  --bone: #f2eae4;
  --muted: #93868a;
  --line: rgba(255, 32, 56, 0.16);
  --beat: 0; /* 0..1 — pisane z JS w rytmie basu */
  --dock-h: 92px;
  --font-display: 'Unbounded', sans-serif;
  --font-body: 'Archivo', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--void);
  color: var(--bone);
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--blood); color: var(--void); }
.mono { font-family: var(--font-mono); }
.hidden { display: none !important; }

/* --- warstwy tła --- */
#bg-canvas {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}
.grain {
  position: fixed; inset: -50%; z-index: 3; pointer-events: none;
  opacity: 0.05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain-shift 0.9s steps(4) infinite;
}
@keyframes grain-shift {
  0% { transform: translate(0, 0); } 25% { transform: translate(-2%, 1%); }
  50% { transform: translate(1%, -2%); } 75% { transform: translate(-1%, 2%); } 100% { transform: translate(0, 0); }
}
.glow-follow {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(600px circle at 70% 20%, rgba(143, 15, 29, 0.22), transparent 65%);
  opacity: calc(0.6 + var(--beat) * 0.4);
  transition: opacity 0.12s linear;
}

/* pulsowanie całej strony w rytmie basu */
main, .site-head { position: relative; z-index: 2; }

/* --- nagłówek --- */
.site-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(180deg, rgba(6, 4, 7, 0.92), rgba(6, 4, 7, 0.75));
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--bone); }
.brand-mark {
  font-family: var(--font-display); font-weight: 900; font-size: 22px;
  width: 42px; height: 42px; display: grid; place-items: center;
  background: var(--blood); color: var(--void);
  clip-path: polygon(0 0, 100% 0, 100% 72%, 72% 100%, 0 100%);
  box-shadow: 0 0 calc(12px + var(--beat) * 26px) rgba(255, 32, 56, 0.7);
}
.brand-word { font-family: var(--font-display); font-weight: 700; letter-spacing: 0.08em; font-size: 15px; }
.brand-dot { color: var(--blood); }
.head-tools { display: flex; align-items: center; gap: 14px; }
.search {
  background: var(--panel); border: 1px solid var(--line); color: var(--bone);
  font-family: var(--font-mono); font-size: 13px;
  padding: 10px 14px; width: clamp(120px, 22vw, 260px);
  outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
.search:focus { border-color: var(--blood); box-shadow: 0 0 0 2px rgba(255, 32, 56, 0.25); }
.admin-link {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.2em;
  color: var(--muted); text-decoration: none; border: 1px solid transparent;
  padding: 10px 12px; transition: all 0.2s;
}
.admin-link:hover { color: var(--blood); border-color: var(--line); }

/* --- hero --- */
.hero {
  padding: clamp(48px, 9vh, 110px) clamp(16px, 4vw, 48px) 30px;
  position: relative;
}
.hero::before {
  content: 'GETHER';
  position: absolute; right: -0.08em; top: 0;
  font-family: var(--font-display); font-weight: 900;
  font-size: clamp(90px, 19vw, 300px); line-height: 0.8;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 32, 56, calc(0.14 + var(--beat) * 0.25));
  pointer-events: none; user-select: none;
  writing-mode: vertical-rl; text-orientation: mixed;
  max-height: 100%; overflow: hidden;
}
.hero-over {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.5em;
  color: var(--blood); margin-bottom: 18px;
}
.hero-title {
  font-family: var(--font-display); font-weight: 900;
  font-size: clamp(38px, 7.5vw, 104px); line-height: 0.95;
  text-transform: uppercase; letter-spacing: -0.01em;
}
.hero-title em {
  font-style: normal; color: transparent;
  -webkit-text-stroke: 2px var(--blood);
  text-shadow: 0 0 calc(18px + var(--beat) * 40px) rgba(255, 32, 56, 0.35);
}
.hero-sub { color: var(--muted); margin-top: 18px; font-size: 15px; max-width: 46ch; }

/* wejściówki */
.reveal { animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.reveal:nth-child(2) { animation-delay: 0.08s; }
.reveal:nth-child(3) { animation-delay: 0.16s; }
.reveal:nth-child(4) { animation-delay: 0.24s; }
@keyframes rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }

/* --- chipsy roczników --- */
.year-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 34px; }
.year-chips button {
  font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.12em;
  background: transparent; color: var(--muted);
  border: 1px solid var(--line); padding: 10px 18px; cursor: pointer;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  transition: all 0.2s;
}
.year-chips button:hover { color: var(--bone); border-color: var(--blood); }
.year-chips button.on {
  background: var(--blood); color: var(--void); border-color: var(--blood);
  box-shadow: 0 0 18px rgba(255, 32, 56, 0.5);
  font-weight: 700;
}

/* --- grid albumów --- */
.albums-wrap { padding: 26px clamp(16px, 4vw, 48px) calc(var(--dock-h) + 60px); }
.albums {
  display: grid; gap: 22px;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}
.album-card {
  position: relative; cursor: pointer; border: 1px solid var(--line);
  background: var(--panel);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
  transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1), border-color 0.25s, box-shadow 0.25s;
  animation: rise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.album-card:hover {
  transform: translateY(-6px) scale(1.015);
  border-color: rgba(255, 32, 56, 0.55);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(255, 32, 56, 0.18);
}
.album-card.playing-now { border-color: var(--blood); box-shadow: 0 0 26px rgba(255, 32, 56, 0.35); }
.card-cover-box { position: relative; aspect-ratio: 1; overflow: hidden; background: var(--panel-2); }
.card-cover-box img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  filter: saturate(0.9) contrast(1.05);
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1), filter 0.3s;
}
.album-card:hover .card-cover-box img { transform: scale(1.07); filter: saturate(1.15); }
.card-cover-box::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(200deg, transparent 55%, rgba(255, 32, 56, 0.18));
  mix-blend-mode: screen; opacity: 0; transition: opacity 0.3s;
}
.album-card:hover .card-cover-box::after { opacity: 1; }
.no-cover {
  width: 100%; height: 100%; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 900; font-size: 54px;
  color: var(--crimson); background: repeating-linear-gradient(135deg, var(--panel-2) 0 14px, var(--panel) 14px 28px);
}
.card-play {
  position: absolute; right: 12px; bottom: 12px; width: 46px; height: 46px;
  border: none; background: var(--blood); color: var(--void); font-size: 17px;
  cursor: pointer; display: grid; place-items: center;
  clip-path: polygon(0 0, 100% 0, 100% 70%, 70% 100%, 0 100%);
  opacity: 0; transform: translateY(8px); transition: all 0.25s;
}
.album-card:hover .card-play { opacity: 1; transform: none; }
.card-play:hover { box-shadow: 0 0 22px rgba(255, 32, 56, 0.8); }
.card-meta { padding: 14px 16px 16px; }
.card-year {
  font-family: var(--font-mono); font-size: 11px; color: var(--blood);
  letter-spacing: 0.25em;
}
.card-title {
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  margin-top: 6px; line-height: 1.25; text-transform: uppercase;
}
.card-artist { color: var(--muted); font-size: 13px; margin-top: 4px; }
.card-tracks { font-family: var(--font-mono); font-size: 11px; color: var(--muted); margin-top: 8px; }
.empty { color: var(--muted); text-align: center; padding: 70px 0; font-family: var(--font-mono); }

/* --- slide-over albumu --- */
.panel-backdrop {
  position: fixed; inset: 0; background: rgba(4, 2, 4, 0.7); backdrop-filter: blur(3px);
  z-index: 30; opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.panel-backdrop.open { opacity: 1; pointer-events: auto; }
.album-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 31;
  width: min(480px, 94vw);
  background: linear-gradient(160deg, var(--panel-2), var(--panel) 60%);
  border-left: 1px solid var(--line);
  transform: translateX(105%);
  transition: transform 0.38s cubic-bezier(0.2, 0.8, 0.2, 1);
  overflow-y: auto; padding: 26px 26px calc(var(--dock-h) + 30px);
}
.album-panel.open { transform: none; box-shadow: -30px 0 80px rgba(0, 0, 0, 0.6); }
.panel-close {
  position: absolute; top: 14px; right: 16px; z-index: 2;
  background: none; border: 1px solid var(--line); color: var(--muted);
  width: 38px; height: 38px; font-size: 20px; cursor: pointer; transition: all 0.2s;
}
.panel-close:hover { color: var(--blood); border-color: var(--blood); transform: rotate(90deg); }
.panel-head { display: flex; gap: 20px; align-items: flex-end; margin-bottom: 24px; }
.panel-cover-box { position: relative; width: 150px; flex: none; }
.panel-cover { width: 150px; height: 150px; object-fit: cover; display: block;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px)); }
.big-play {
  position: absolute; right: -14px; bottom: -14px; width: 52px; height: 52px;
  background: var(--blood); color: var(--void); border: none; font-size: 18px;
  cursor: pointer; clip-path: polygon(0 0, 100% 0, 100% 70%, 70% 100%, 0 100%);
  transition: box-shadow 0.2s, transform 0.2s;
}
.big-play:hover { box-shadow: 0 0 26px rgba(255, 32, 56, 0.8); transform: scale(1.06); }
.panel-year { color: var(--blood); font-size: 12px; letter-spacing: 0.3em; }
.panel-title { font-family: var(--font-display); font-weight: 900; font-size: 24px; text-transform: uppercase; line-height: 1.1; margin-top: 6px; }
.panel-artist { color: var(--muted); margin-top: 6px; }
.panel-count { color: var(--muted); font-size: 11px; margin-top: 8px; }

.tracklist { list-style: none; counter-reset: trk; }
.tracklist li {
  counter-increment: trk;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 10px; cursor: pointer; border-bottom: 1px solid rgba(255, 32, 56, 0.08);
  transition: background 0.15s, padding-left 0.15s;
}
.tracklist li::before {
  content: counter(trk, decimal-leading-zero);
  font-family: var(--font-mono); font-size: 12px; color: var(--muted); width: 24px;
}
.tracklist li:hover { background: rgba(255, 32, 56, 0.07); padding-left: 16px; }
.tracklist li.now { background: rgba(255, 32, 56, 0.12); }
.tracklist li.now::before { content: '▶'; color: var(--blood); }
.trk-title { flex: 1; font-size: 14px; font-weight: 500; }
.trk-time { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.eq {
  display: none; align-items: flex-end; gap: 2px; height: 14px; margin-right: 2px;
}
.tracklist li.now .eq { display: inline-flex; }
.eq i { width: 3px; background: var(--blood); animation: eqb 0.8s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: 0.2s; } .eq i:nth-child(3) { animation-delay: 0.4s; }
@keyframes eqb { 0%, 100% { height: 4px; } 50% { height: 14px; } }

/* --- IMMERSJA --- */
.immersion {
  position: fixed; inset: 0; z-index: 50; background: var(--void);
  opacity: 0; pointer-events: none; transition: opacity 0.4s;
}
.immersion.open { opacity: 1; pointer-events: auto; }
#viz-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.imm-ui { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; padding: clamp(16px, 3vw, 40px); pointer-events: none; }
.imm-top, .imm-bottom { pointer-events: auto; }
.imm-top { display: flex; justify-content: space-between; align-items: center; }
.viz-modes { display: flex; gap: 8px; }
.viz-modes button, .imm-close {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.2em;
  background: rgba(6, 4, 7, 0.6); border: 1px solid var(--line); color: var(--muted);
  padding: 9px 14px; cursor: pointer; transition: all 0.2s; backdrop-filter: blur(4px);
}
.viz-modes button:hover, .imm-close:hover { color: var(--bone); border-color: var(--blood); }
.viz-modes button.on { background: var(--blood); color: var(--void); border-color: var(--blood); font-weight: 700; }
.imm-bottom { text-align: center; padding-bottom: 2vh; }
.imm-album { color: var(--blood); font-size: 12px; letter-spacing: 0.4em; }
.imm-title {
  font-family: var(--font-display); font-weight: 900;
  font-size: clamp(22px, 4.6vw, 56px); text-transform: uppercase;
  margin: 10px 0 18px; line-height: 1.05;
  text-shadow: 0 0 calc(10px + var(--beat) * 50px) rgba(255, 32, 56, 0.5);
}
.imm-controls { display: flex; gap: 14px; justify-content: center; }
.imm-controls button {
  background: rgba(6, 4, 7, 0.55); border: 1px solid var(--line); color: var(--bone);
  width: 54px; height: 54px; font-size: 19px; cursor: pointer; backdrop-filter: blur(4px);
  transition: all 0.2s;
}
.imm-controls button:hover { border-color: var(--blood); box-shadow: 0 0 18px rgba(255, 32, 56, 0.45); }
#imm-play { background: var(--blood); color: var(--void); border-color: var(--blood); }

/* --- dock --- */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: linear-gradient(180deg, rgba(14, 10, 13, 0.94), rgba(6, 4, 7, 0.98));
  border-top: 1px solid var(--line); backdrop-filter: blur(14px);
  animation: dock-in 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes dock-in { from { transform: translateY(100%); } to { transform: none; } }
.dock-seek { position: relative; height: 14px; margin-top: -7px; }
input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; background: transparent; cursor: pointer;
}
#seek { position: absolute; inset: 0; }
input[type="range"]::-webkit-slider-runnable-track {
  height: 4px; background: linear-gradient(90deg, var(--blood) var(--fill, 0%), rgba(255, 32, 56, 0.15) var(--fill, 0%));
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px;
  background: var(--bone); border: 2px solid var(--blood); border-radius: 50%;
  box-shadow: 0 0 10px rgba(255, 32, 56, 0.8);
  opacity: 0; transition: opacity 0.2s;
}
input[type="range"]:hover::-webkit-slider-thumb { opacity: 1; }
input[type="range"]::-moz-range-track {
  height: 4px; background: rgba(255, 32, 56, 0.15);
}
input[type="range"]::-moz-range-progress { height: 4px; background: var(--blood); }
input[type="range"]::-moz-range-thumb {
  width: 12px; height: 12px; background: var(--bone); border: 2px solid var(--blood); border-radius: 50%;
}
.dock-row {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: 16px; padding: 12px clamp(14px, 3vw, 34px) 16px; min-height: var(--dock-h);
}
.dock-now { display: flex; align-items: center; gap: 14px; min-width: 0; }
.dock-cover-box { position: relative; width: 56px; height: 56px; flex: none; }
#dock-cover {
  width: 56px; height: 56px; object-fit: cover; display: block;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
  box-shadow: 0 0 calc(6px + var(--beat) * 18px) rgba(255, 32, 56, 0.55);
}
#dock-viz { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen; }
.dock-titles { min-width: 0; }
.dock-title { font-family: var(--font-display); font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: uppercase; }
.dock-sub { color: var(--muted); font-size: 11px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock-controls { display: flex; align-items: center; gap: 6px; }
.dock-controls button, .dock-side button {
  background: none; border: none; color: var(--bone); font-size: 17px;
  width: 42px; height: 42px; cursor: pointer; display: grid; place-items: center;
  transition: color 0.2s, transform 0.1s, text-shadow 0.2s;
}
.dock-controls button:hover { color: var(--blood); text-shadow: 0 0 12px rgba(255, 32, 56, 0.8); }
.dock-controls button:active { transform: scale(0.9); }
.dock-controls button.on { color: var(--blood); text-shadow: 0 0 10px rgba(255, 32, 56, 0.9); }
.play-main {
  background: var(--blood) !important; color: var(--void) !important;
  width: 52px !important; height: 52px !important; font-size: 19px !important;
  clip-path: polygon(0 0, 100% 0, 100% 70%, 70% 100%, 0 100%);
  box-shadow: 0 0 calc(10px + var(--beat) * 22px) rgba(255, 32, 56, 0.65);
}
.dock-side { display: flex; align-items: center; gap: 12px; justify-content: flex-end; }
.time { font-size: 11px; color: var(--muted); white-space: nowrap; }
#volume { width: 90px; }
#btn-immersion { color: var(--blood); font-size: 20px; }
#btn-immersion:hover { text-shadow: 0 0 16px var(--blood); }

/* --- mobile --- */
@media (max-width: 720px) {
  .hero::before { display: none; }
  .search { width: 110px; }
  /* Chowamy tylko czas i głośność — #btn-immersion (◉) musi zostać, to jedyne wejście do wizualizera na telefonie. */
  .dock-row { grid-template-columns: auto 1fr auto; }
  .dock-side .time, .dock-side #volume { display: none; }
  .dock-side { gap: 0; }
  .dock-now { order: 1; }
  .dock-controls { order: 2; justify-content: flex-end; }
  .dock-side { order: 3; }
  .albums { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
  .panel-head { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
