:root {
  --cream:    #f0ebe0;
  --cream-70: rgba(240, 235, 224, 0.7);
  --cream-45: rgba(240, 235, 224, 0.45);
  --cream-22: rgba(240, 235, 224, 0.22);
  --gold:     #c9a96e;
  --ink:      #060509;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body { font-family: 'DM Mono', monospace; color: var(--cream); background: var(--ink); }

.bg {
  position: fixed; inset: 0;
  background: url("images/bg3.png") center / cover no-repeat;
  z-index: 0;
}
.bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(6, 5, 9, 0.08)  0%,
    rgba(6, 5, 9, 0.08)  15%,
    rgba(6, 5, 9, 0.42)  50%,
    rgba(6, 5, 9, 0.77)  77%,
    rgba(6, 5, 9, 0.97)  100%
  );
}

.grain {
  position: fixed; inset: 0; z-index: 3; pointer-events: none; opacity: 0.038;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat; background-size: 256px 256px;
}

.stage {
  position: relative; z-index: 2;
  min-height: 100vh;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 0 clamp(1.5rem, 6vw, 5rem) clamp(2.75rem, 5vh, 4.5rem);
}
.left, .right { display: flex; flex-direction: column; }

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

.name {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic; font-weight: 300;
  font-size: clamp(4.75rem, 13vw, 10.5rem);
  line-height: 0.9; letter-spacing: -0.025em; color: var(--cream);
  margin-bottom: 0.22em;
  opacity: 0; animation: rise 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.05s forwards;
}

.tagline {
  font-size: clamp(0.62rem, 1.1vw, 0.72rem); font-weight: 300;
  letter-spacing: 0.14em; color: var(--cream-45);
  margin-bottom: 0.75rem;
  opacity: 0; animation: rise 1s cubic-bezier(0.16, 1, 0.3, 1) 0.32s forwards;
}

.player {
  margin-top: 0.5rem;
  margin-bottom: 2rem;
  max-width: 220px;
  opacity: 0; animation: rise 1s cubic-bezier(0.16, 1, 0.3, 1) 0.44s forwards;
}

.cassette-wrap {
  display: block; cursor: pointer;
  user-select: none; -webkit-tap-highlight-color: transparent;
}
.cassette-wrap:not(.playing):hover { filter: brightness(1.08); }
.tape-svg { display: block; width: 100%; height: auto; }

.reel-l { transform-origin: 80px 93px; }
.reel-r { transform-origin: 140px 93px; }
@keyframes spin-cw  { to { transform: rotate( 360deg); } }
@keyframes spin-ccw { to { transform: rotate(-360deg); } }
.playing .reel-l { animation: spin-ccw 2.8s linear infinite; }
.playing .reel-r { animation: spin-cw  3.4s linear infinite; }

@keyframes tape-scroll { to { stroke-dashoffset: -6; } }
.playing .tape-strip {
  stroke-dasharray: 3 3;
  animation: tape-scroll 0.3s linear infinite;
}

@keyframes pulse-icon {
  0%, 100% { opacity: 1;    transform: scale(1);    }
  50%       { opacity: 0.6; transform: scale(1.06); }
}
.play-icon {
  animation: pulse-icon 2s ease-in-out infinite;
  transform-box: fill-box; transform-origin: center;
  transition: opacity 0.4s ease;
}
.playing .play-icon { opacity: 0; animation: none; }

@keyframes ping-ring {
  0%   { transform: scale(1);   opacity: 0.6; }
  100% { transform: scale(1.9); opacity: 0;   }
}
.play-ring circle {
  transform-box: fill-box; transform-origin: center;
  animation: ping-ring 2s ease-out infinite;
}
.playing .play-ring { display: none; }

#prevBtn, #nextBtn { transition: opacity 0.2s; }
#prevBtn:hover, #nextBtn:hover { opacity: 0.5; }

@keyframes hint-fade-out {
  0%, 55% { opacity: 1; }
  100%     { opacity: 0; }
}
.play-hint {
  font-size: 0.44rem; letter-spacing: 0.28em; font-weight: 300;
  color: var(--cream-45); text-align: center;
  margin-top: 5px; margin-bottom: -12px;
  pointer-events: none; text-transform: lowercase;
  animation: hint-fade-out 4s ease forwards;
}
.play-hint.hidden { display: none; }

@keyframes cassette-glow {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(201, 169, 110, 0.10)); }
  50%       { filter: drop-shadow(0 0 14px rgba(201, 169, 110, 0.30)); }
}
.playing.cassette-wrap { animation: cassette-glow 3s ease-in-out infinite; }

#replaySvgBtn { transition: opacity 0.2s; }
#replaySvgBtn:hover { opacity: 0.55; }

.progress-wrap {
  height: 2px; background: var(--cream-22); border-radius: 1px;
  margin-top: 10px; cursor: col-resize;
}
.progress-wrap:hover { background: rgba(240, 235, 224, 0.3); }
.progress-bar {
  height: 100%; width: 0%; background: var(--gold);
  border-radius: 1px; pointer-events: none;
}

.track-meta {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 7px;
}
.track-name-wrap {
  display: flex; align-items: center; gap: 4px;
  overflow: hidden; max-width: 148px;
}
.track-name, .track-time {
  font-size: 0.52rem; letter-spacing: 0.1em;
  color: var(--cream-22); font-weight: 300;
  transition: color 0.4s ease;
}
.track-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player.playing .track-name { color: var(--cream-45); }

.eq {
  display: inline-flex; align-items: flex-end; gap: 1.5px;
  height: 7px; flex-shrink: 0;
  opacity: 0; transition: opacity 0.5s ease;
}
.eq i {
  display: block; width: 1.5px; height: 100%;
  background: var(--gold); border-radius: 1px;
  transform-origin: bottom; transform: scaleY(0.15);
  animation-play-state: paused;
}
@keyframes eq-bar {
  0%   { transform: scaleY(0.15); }
  100% { transform: scaleY(1);    }
}
.eq i:nth-child(1) { animation: eq-bar 0.65s ease-in-out 0s    infinite alternate; }
.eq i:nth-child(2) { animation: eq-bar 0.45s ease-in-out 0.1s  infinite alternate; }
.eq i:nth-child(3) { animation: eq-bar 0.75s ease-in-out 0.22s infinite alternate; }
.eq i:nth-child(4) { animation: eq-bar 0.55s ease-in-out 0.08s infinite alternate; }
.player.playing .eq         { opacity: 1; }
.player.playing .eq i       { animation-play-state: running; }

.links {
  list-style: none; display: flex; flex-wrap: wrap; gap: 0.45rem 2rem;
  margin-bottom: 2.25rem;
  opacity: 0; animation: rise 1s cubic-bezier(0.16, 1, 0.3, 1) 0.58s forwards;
}
.social-github { margin-top: 0.35rem; }

.links a {
  font-size: clamp(0.7rem, 1.2vw, 0.8rem); font-weight: 400;
  letter-spacing: 0.06em; line-height: 1;
  color: var(--cream-70); text-decoration: none;
  position: relative; padding-bottom: 3px;
  display: inline-flex; align-items: center; gap: 0.38em;
  transition: color 0.3s ease;
}
.links a::after {
  content: ''; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--gold); transform: scaleX(0); transform-origin: left center;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.links a:hover            { color: var(--cream); }
.links a:hover::after     { transform: scaleX(1); }

.social-github    a:hover  { color: var(--cream); }
.social-instagram a:hover  { opacity: 0.78; }
.social-linkedin  a:hover  { color: #4d9de0; }
.social-github    a::after { background: var(--cream-70); }
.social-instagram a::after { background: #dc2743; }
.social-linkedin  a::after { background: #0a66c2; }

.links a svg { width: 0.9em; height: 0.9em; flex-shrink: 0; }
.social-github   a svg { width: 0.85em; height: 0.85em; }
.social-linkedin a svg { margin-top: 0.08em; }

.aside {
  font-size: clamp(0.6rem, 1vw, 0.68rem); font-weight: 300; font-style: italic;
  color: var(--cream-22); letter-spacing: 0.04em;
  opacity: 0; animation: rise 1s cubic-bezier(0.16, 1, 0.3, 1) 0.78s forwards;
}
.aside a { color: inherit; text-decoration: underline; text-underline-offset: 3px; transition: color 0.2s ease; }
.aside a:hover { color: var(--cream-45); }

@media (min-width: 900px) {
  .stage {
    flex-direction: row; align-items: flex-end;
    justify-content: flex-start;
    column-gap: clamp(3rem, 6vw, 7rem);
  }
  .left { flex: 0 0 auto; }
  .name { font-size: clamp(7rem, 14vw, 15rem); margin-bottom: 0.18em; }
  .tagline { margin-bottom: 0; }
  .player { margin-top: 1rem; margin-bottom: 0; }
  .right {
    flex: 1;
    border-left: 1px solid rgba(240, 235, 224, 0.1);
    padding-left: clamp(3rem, 5vw, 6rem);
  }
  .links { flex-direction: column; gap: 0.2rem 0; margin-bottom: 2rem; }
  .row-break { display: none !important; }
  .social-github { margin-top: 0.75rem; }
}

@media (max-width: 539px) {
  .links { gap: 0.55rem 1.5rem; }
}
