/* ---------- Reset / base ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* the `hidden` attribute is a low-priority "presentational hint" in the HTML
   spec, so any later display rule (even a plain `img { display: block }`
   reset) silently wins over it unless we force it back here. */
[hidden] { display: none !important; }

html, body {
  width: 100%;
  height: 100%;
  background: #050505;
  overflow: hidden;
  font-family: 'VT323', monospace;
}

body.home-active {
  overflow-y: auto;
}

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

/* ---------- Particles ---------- */
#particles-js {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* ---------- Splash ---------- */
.splash {
  position: fixed;
  inset: 0;
  z-index: 5;
  background: transparent;
}

.splash-content {
  position: absolute;
  inset: 0;
  transition: opacity 0.8s ease, filter 0.8s ease, transform 0.8s ease;
}

/* ---------- Background layers ---------- */
.bg-layer {
  position: absolute;
  inset: -4%;
  width: 108%;
  height: 108%;
  background-size: cover;
  background-position: center;
  pointer-events: none;
}

.bg-nebula {
  background-image: url('assets/background-nebula.png');
  opacity: 0.5;
  filter: brightness(0.9) contrast(1.05);
  animation: nebulaDrift 46s ease-in-out infinite;
}

.bg-grid {
  background-image: url('assets/texture-grid.png');
  opacity: 0.35;
}

.bg-chalkboard {
  background-image: url('assets/texture-chalkboard.png');
  opacity: 0.4;
}

.bg-grain {
  background-image: url('assets/texture-grain.png');
  opacity: 0.35;
  animation: grainFlicker 6s ease-in-out infinite;
}

@keyframes nebulaDrift {
  0%   { transform: scale(1.05) translate(0, 0); }
  50%  { transform: scale(1.12) translate(-1.2%, 1%); }
  100% { transform: scale(1.05) translate(0, 0); }
}

@keyframes grainFlicker {
  0%, 100% { opacity: 0.3; }
  45%      { opacity: 0.18; }
  50%      { opacity: 0.42; }
  55%      { opacity: 0.22; }
}

.vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 38%, rgba(0,0,0,0.55) 78%, rgba(0,0,0,0.92) 100%);
}

/* ---------- Corner ornaments ---------- */
.corner {
  position: absolute;
  width: clamp(90px, 11vw, 190px);
  height: auto;
  z-index: 3;
  opacity: 0.92;
  filter: drop-shadow(0 0 14px rgba(190, 110, 230, 0.35));
}

.corner-tl { top: 3vh;  left: 3vw;  animation: floatCorner 7.5s ease-in-out infinite; }
.corner-tr { top: 3vh;  right: 3vw; animation: floatCorner 8.5s ease-in-out infinite; animation-delay: -2.4s; }
.corner-bl { bottom: 3vh; left: 3vw;  animation: floatCorner 9s ease-in-out infinite; animation-delay: -4.8s; }
.corner-br { bottom: 3vh; right: 3vw; animation: floatCorner 8s ease-in-out infinite; animation-delay: -1.2s; }

@keyframes floatCorner {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-14px) rotate(-2deg); }
}

/* ---------- Click to enter button ---------- */
.enter-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 4;
  background: none;
  border: none;
  cursor: pointer;
  padding: 2rem 3rem;
  animation: enterBob 5s ease-in-out infinite;
}

@keyframes enterBob {
  0%, 100% { transform: translate(-50%, -50%) translateY(0); }
  50%      { transform: translate(-50%, -50%) translateY(-8px); }
}

.enter-img {
  width: clamp(260px, 34vw, 620px);
  filter: drop-shadow(0 0 22px rgba(216, 122, 255, 0.55)) drop-shadow(0 0 46px rgba(255, 105, 210, 0.3));
  transition: filter 0.25s ease, transform 0.25s ease;
}

.enter-img--r,
.enter-img--b {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  mix-blend-mode: screen;
  pointer-events: none;
}

.enter-img--r { filter: brightness(1.4) sepia(1) saturate(10) hue-rotate(285deg); }
.enter-img--b { filter: brightness(1.4) sepia(1) saturate(10) hue-rotate(160deg); }

.enter-btn:hover .enter-img--base {
  filter: drop-shadow(0 0 30px rgba(216, 122, 255, 0.85)) drop-shadow(0 0 60px rgba(255, 105, 210, 0.5)) brightness(1.12);
  transform: scale(1.035);
}

/* idle glitch burst, triggered by JS toggling .glitching */
.enter-btn.glitching .enter-img--r {
  opacity: 0.55;
  animation: glitchJitterR 0.28s steps(2, end) infinite;
}
.enter-btn.glitching .enter-img--b {
  opacity: 0.5;
  animation: glitchJitterB 0.34s steps(2, end) infinite;
}
.enter-btn.glitching .enter-img--base {
  animation: glitchJitterBase 0.22s steps(2, end) infinite;
}

@keyframes glitchJitterR {
  0%   { transform: translate(0, 0); clip-path: inset(0 0 60% 0); }
  50%  { transform: translate(4px, -2px); clip-path: inset(40% 0 20% 0); }
  100% { transform: translate(-3px, 1px); clip-path: inset(10% 0 55% 0); }
}
@keyframes glitchJitterB {
  0%   { transform: translate(0, 0); clip-path: inset(50% 0 5% 0); }
  50%  { transform: translate(-4px, 2px); clip-path: inset(5% 0 65% 0); }
  100% { transform: translate(3px, -1px); clip-path: inset(30% 0 30% 0); }
}
@keyframes glitchJitterBase {
  0%, 100% { transform: translate(0, 0); }
  50%      { transform: translate(1px, -1px); }
}

/* intense burst on click */
.enter-btn.glitching-intense .enter-img--r {
  opacity: 0.75;
  animation: glitchJitterR 0.09s steps(2, end) infinite;
}
.enter-btn.glitching-intense .enter-img--b {
  opacity: 0.7;
  animation: glitchJitterB 0.11s steps(2, end) infinite;
}
.enter-btn.glitching-intense .enter-img--base {
  animation: glitchJitterBase 0.07s steps(2, end) infinite;
}

/* ---------- Transition effects ---------- */
.flash {
  position: fixed;
  inset: 0;
  z-index: 8;
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.9), rgba(216,122,255,0.5) 40%, transparent 75%);
  opacity: 0;
  pointer-events: none;
}

.shutter {
  position: fixed;
  inset: 0;
  z-index: 9;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

body.entering .flash {
  animation: flashPulse 0.4s ease-out forwards;
}

@keyframes flashPulse {
  0%   { opacity: 0; }
  35%  { opacity: 1; }
  100% { opacity: 0; }
}

body.entering .splash-content {
  transform: scale(1.18);
  filter: blur(10px) brightness(1.3);
  opacity: 0;
  transition-delay: 0.1s;
}

body.entering .shutter {
  opacity: 1;
  transition-delay: 0.25s;
}

body.reveal .shutter {
  opacity: 0;
}

/* ---------- Home ---------- */
.home {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.home.hidden {
  display: none;
}

.home-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
}

.home-bg .bg-nebula,
.home-bg .bg-chalkboard { opacity: 0.4; }
.home-bg .bg-grid { opacity: 0.28; }
.home-bg .bg-grain { opacity: 0.22; }

/* ---------- Sidebar (Yung Jub / Dave2Shiesty / Events / Contact) ---------- */
.sidebar {
  position: fixed;
  top: clamp(1.5rem, 4vh, 3rem);
  left: clamp(1.25rem, 3vw, 3rem);
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: clamp(1.75rem, 4vh, 3.25rem);
}

.sidebar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  opacity: 0;
  transform: translateY(14px);
  transition: transform 0.35s ease, filter 0.35s ease;
}

.home.visible .sidebar-item {
  animation: sidebarIn 0.7s ease forwards;
  animation-delay: calc(var(--i) * 0.1s + 0.15s);
}

@keyframes sidebarIn {
  to { opacity: 1; transform: translateY(0); }
}

.sidebar-avatar {
  width: clamp(58px, 6.4vw, 92px);
  height: clamp(58px, 6.4vw, 92px);
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15), 0 0 18px rgba(216, 122, 255, 0.25);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.sidebar-avatar--icon {
  background: #111;
  padding: 2px;
}

.sidebar-label {
  height: clamp(14px, 1.5vw, 20px);
  width: auto;
  filter: drop-shadow(0 0 6px rgba(216, 122, 255, 0.5));
  transition: filter 0.3s ease;
}

.sidebar-item:hover .sidebar-avatar {
  transform: translateY(-4px) scale(1.06);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35), 0 0 26px rgba(216, 122, 255, 0.6);
}

.sidebar-item:hover .sidebar-label {
  filter: drop-shadow(0 0 12px rgba(255, 105, 210, 0.85));
}

.sidebar-item:active .sidebar-avatar {
  transform: translateY(-1px) scale(0.98);
}

/* ---------- Center brand block ---------- */
.brand {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 2;
  transform: translate(-50%, -50%);
  text-align: center;
  opacity: 0;
  transition: opacity 0.8s ease 0.2s;
}

.home.visible .brand {
  opacity: 1;
  animation: brandFloat 6s ease-in-out infinite;
  animation-delay: 0.9s;
}

@keyframes brandFloat {
  0%, 100% { transform: translate(-50%, -50%) translateY(0); }
  50%      { transform: translate(-50%, -50%) translateY(-12px); }
}

.brand-inner {
  display: inline-block;
  /* transform here is driven live by Rythm.js (rythm-shake), see script.js */
}

.brand-logo {
  width: clamp(240px, 28vw, 460px);
  height: auto;
  filter: drop-shadow(0 0 26px rgba(216, 122, 255, 0.45));
}

.brand-tagline {
  margin-top: 0.4rem;
  font-family: 'VT323', monospace;
  font-size: clamp(1.1rem, 1.6vw, 1.6rem);
  letter-spacing: 0.08em;
  color: #f2f2f2;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.25);
}

/* ---------- Corner stack: player docked above the live clock ---------- */
.corner-stack {
  position: fixed;
  right: clamp(1.25rem, 3vw, 3rem);
  bottom: clamp(1.25rem, 3vh, 3rem);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: clamp(0.9rem, 2vh, 1.5rem);
}

/* ---------- Live clock ---------- */
.clock {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
  font-family: 'VT323', monospace;
  color: #f5f5f5;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
  opacity: 0;
  transition: opacity 0.8s ease 0.6s;
}

.home.visible .clock {
  opacity: 1;
}

.clock-day  { font-size: clamp(1.3rem, 2vw, 1.9rem); }
.clock-date { font-size: clamp(1.1rem, 1.7vw, 1.6rem); opacity: 0.85; }
.clock-time { font-size: clamp(1.1rem, 1.7vw, 1.6rem); opacity: 0.85; }

/* ---------- Draggable "program" windows ---------- */
.windows-layer {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

.drag-window {
  position: absolute;
  width: clamp(280px, 30vw, 380px);
  pointer-events: auto;
  background: #212121;
  border: 3px solid #ff70fd;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 0 26px rgba(255, 112, 253, 0.45), 0 24px 60px rgba(0, 0, 0, 0.65);
  opacity: 0;
  transform: scale(0.9) translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.drag-window.open {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.drag-window.dragging {
  transition: none;
  cursor: grabbing;
}

.drag-titlebar {
  height: 42px;
  background: #1a1a1a;
  border-bottom: 3px solid #ff70fd;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.7rem 0 0.9rem;
  cursor: grab;
  touch-action: none;
}

.drag-title {
  font-family: 'VT323', monospace;
  font-size: 1.3rem;
  letter-spacing: 0.05em;
  color: #fff;
}

.drag-close {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.2s ease, transform 0.2s ease;
}

.drag-close img {
  width: 15px;
  height: 15px;
}

.drag-close:hover {
  background: rgba(255, 112, 253, 0.18);
  transform: scale(1.12);
}

.drag-body {
  position: relative;
  min-height: 240px;
  padding: 2.4rem 1.5rem 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.drag-bg-texture {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: url('assets/texture-chalkboard.png'), url('assets/texture-grain.png');
  background-size: cover, cover;
  background-position: center, center;
  opacity: 0.5;
  pointer-events: none;
}

.drag-body-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
  animation: dragTextFloat 5s ease-in-out infinite;
}

@keyframes dragTextFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

.drag-text {
  font-family: 'VT323', monospace;
  font-size: 1.2rem;
  line-height: 1.55;
  letter-spacing: 0.02em;
  color: #f2f2f2;
}

.social-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.social-link svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.social-link:hover {
  background: #ff70fd;
  color: #1a1a1a;
  transform: scale(1.1);
  box-shadow: 0 0 16px rgba(255, 112, 253, 0.6);
}

.drag-watermark {
  position: absolute;
  left: 0.9rem;
  bottom: 0.6rem;
  z-index: 1;
  font-family: 'VT323', monospace;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  color: #fff;
  opacity: 0.75;
}

.drag-cross-accent {
  position: absolute;
  right: 0.6rem;
  bottom: 0.4rem;
  z-index: 1;
  width: 44px;
  height: auto;
  opacity: 0.85;
  filter: drop-shadow(0 0 8px rgba(255, 112, 253, 0.35));
  pointer-events: none;
  animation: floatCorner 8s ease-in-out infinite;
}

/* ---------- Events window: flyer + ticket link ---------- */
.drag-body--event {
  flex-direction: column;
  align-items: stretch;
  min-height: 0;
  padding: 1rem 1rem 1.6rem;
  gap: 0.9rem;
}

.event-flyer {
  position: relative;
  z-index: 1;
  width: 100%;
  display: block;
  border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.event-ticket-btn {
  position: relative;
  z-index: 1;
  display: block;
  text-align: center;
  font-family: 'VT323', monospace;
  font-size: 1.2rem;
  letter-spacing: 0.05em;
  color: #1a1a1a;
  background: #ff70fd;
  border-radius: 999px;
  padding: 0.55rem 1rem;
  text-decoration: none;
  box-shadow: 0 0 16px rgba(255, 112, 253, 0.5);
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.event-ticket-btn:hover {
  background: #ff8bfd;
  transform: scale(1.03);
  box-shadow: 0 0 24px rgba(255, 112, 253, 0.75);
}

.drag-body--event .drag-cross-accent {
  top: 0.5rem;
  bottom: auto;
  right: 0.5rem;
  width: 32px;
}

/* ---------- Music player (draggable, docked bottom-left) ---------- */
.player {
  position: relative;
  z-index: 9;
  width: clamp(220px, 20vw, 270px);
  background: #1a1a1a;
  border: 3px solid #ff70fd;
  border-radius: 18px;
  overflow: hidden;
  padding: 0.85rem 0.85rem 0.9rem;
  box-shadow: 0 0 22px rgba(255, 112, 253, 0.4), 0 20px 46px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease, box-shadow 0.3s ease;
  cursor: grab;
  touch-action: none;
}

.player-bg-texture {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: url('assets/texture-chalkboard.png'), url('assets/texture-grain.png');
  background-size: cover, cover;
  background-position: center, center;
  opacity: 0.35;
  pointer-events: none;
}

.player > *:not(.player-bg-texture) {
  position: relative;
  z-index: 1;
}

.home.visible .player {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.5s;
}

.player.dragging {
  cursor: grabbing;
  transition: box-shadow 0.3s ease;
}

.player-art-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  background: #0d0d0d;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.player-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.25s ease;
}

.player-meta {
  margin-top: 0.65rem;
  text-align: center;
  font-family: 'VT323', monospace;
  color: #f5f5f5;
  line-height: 1.2;
}

.player-artist {
  font-size: 1.35rem;
  letter-spacing: 0.03em;
}

.player-title {
  font-size: 1.1rem;
  opacity: 0.8;
}

.player-progress-track {
  position: relative;
  margin-top: 0.7rem;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  cursor: pointer;
}

.player-progress-fill {
  position: absolute;
  inset: 0;
  width: 0%;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
  pointer-events: none;
}

.player-progress-handle {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 8px rgba(255, 112, 253, 0.8);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.player-time-row {
  display: flex;
  justify-content: space-between;
  margin-top: 0.35rem;
  font-family: 'VT323', monospace;
  font-size: 0.95rem;
  color: #e8e8e8;
  opacity: 0.85;
}

.player-controls-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.6rem;
}

.player-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.player-next {
  position: relative;
}

.icon-play {
  width: 15px;
  height: auto;
  margin-left: 2px; /* optically center the triangle's point */
}

.icon-pause {
  position: relative;
  width: 14px;
  height: 16px;
}

.icon-pause:not([hidden]) {
  display: inline-block;
}

.icon-pause::before,
.icon-pause::after {
  content: '';
  position: absolute;
  top: 0;
  width: 4px;
  height: 16px;
  background: #fff;
}

.icon-pause::before { left: 1px; }
.icon-pause::after { left: 9px; }

.icon-skip-wrap {
  position: relative;
  display: inline-block;
  width: 19px;
  height: 14px;
}

.icon-skip {
  position: absolute;
  top: 50%;
  width: 11px;
  height: auto;
  transform: translateY(-50%);
}

.icon-skip--back { left: 0; }
.icon-skip--front { left: 8px; }

.player-play {
  width: 42px;
  height: 42px;
  background: #ff70fd;
  box-shadow: 0 0 14px rgba(255, 112, 253, 0.6);
}

.player-btn:hover {
  transform: scale(1.08);
  background: rgba(255, 255, 255, 0.16);
}

.player-play:hover {
  background: #ff8bfd;
}

.player-cross {
  position: absolute;
  right: 0;
  bottom: -4px;
  width: 34px;
  height: auto;
  opacity: 0.85;
  pointer-events: none;
  filter: drop-shadow(0 0 8px rgba(255, 112, 253, 0.35));
  animation: floatCorner 8s ease-in-out infinite;
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .sidebar { gap: 1.2rem; }
  .clock { align-items: flex-end; }
  .drag-window { width: min(88vw, 340px); }
  .player { width: min(60vw, 230px); }
}

@media (max-width: 600px) {
  .corner { width: clamp(64px, 22vw, 120px); }
  .enter-img { width: clamp(220px, 78vw, 420px); }

  /* the sidebar (left), brand logo (center) and player (right) are all
     independently fixed-positioned — at narrow widths there isn't room for
     all three at their desktop sizes, so shrink each enough to clear */
  .sidebar { gap: 0.85rem; }
  .sidebar-avatar { width: 44px; height: 44px; }
  .sidebar-label { height: 11px; }

  .brand-logo { width: clamp(150px, 46vw, 300px); }
  .brand-tagline { font-size: 0.85rem; }

  .corner-stack { gap: 0.6rem; }
  .player { width: min(38vw, 190px); padding: 0.6rem 0.6rem 0.7rem; }
  .player-artist { font-size: 1.1rem; }
  .player-title { font-size: 0.9rem; }
}
