/* ==========================================================================
   TOKENS — change the whole theme from here.
   ========================================================================== */
:root {
  /* Base surfaces */
  --bg-void: #08080a;
  --bg-elevated: #121214;
  --bg-card: rgba(20, 20, 22, 0.55);
  --bg-card-hover: rgba(30, 30, 33, 0.72);

  /* Monochrome accent system */
  --mono-strong: #9a9aa0;
  --mono-bright: #f5f5f7;
  --mono-soft: #c7c7cd;
  --mono-line: rgba(255, 255, 255, 0.14);
  --mono-line-strong: rgba(255, 255, 255, 0.34);
  --mono-glow: rgba(255, 255, 255, 0.16);
  --mono-glow-soft: rgba(255, 255, 255, 0.07);

  /* Text */
  --text-primary: #f2f2f4;
  --text-muted: #9c9ca3;
  --text-faint: #64646b;

  /* Status */
  --status-online: #3ddc84;

  /* Type */
  --font-display: "Space Grotesk", "Manrope", sans-serif;
  --font-body: "Manrope", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  /* Layout */
  --column-width: 420px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --radius-round: 999px;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 180ms;
  --dur-med: 420ms;
  --dur-slow: 900ms;
}

/* ==========================================================================
   RESET
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg-void);
  color: var(--text-primary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

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

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

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

p {
  margin: 0;
}

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

/* ==========================================================================
   BACKGROUND ATMOSPHERE
   ========================================================================== */
#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.atmosphere {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  filter: blur(4px);
}

.atmosphere--top {
  top: -30%;
  left: 50%;
  width: 1100px;
  height: 900px;
  transform: translateX(-50%);
  background: radial-gradient(
    ellipse at center,
    var(--mono-glow) 0%,
    var(--mono-glow-soft) 38%,
    transparent 70%
  );
  animation: atmosphere-pulse-top 11s ease-in-out infinite alternate;
}

.atmosphere--corner {
  bottom: -20%;
  left: -15%;
  width: 700px;
  height: 700px;
  background: radial-gradient(
    ellipse at center,
    var(--mono-glow-soft) 0%,
    transparent 65%
  );
  animation: atmosphere-pulse-corner 15s ease-in-out infinite alternate;
  animation-delay: -4s;
}

@keyframes atmosphere-pulse-top {
  0% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.65;
  }
}

@keyframes atmosphere-pulse-corner {
  0% {
    opacity: 0.4;
  }
  50% {
    opacity: 0.9;
  }
  100% {
    opacity: 0.5;
  }
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 220px 220px;
}

/* Thin diagonal mesh texture layered over the blobs, echoing a woven
   screen-door pattern rather than plain noise. */
.mesh {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: repeating-linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.6) 0px,
    rgba(255, 255, 255, 0.6) 1px,
    transparent 1px,
    transparent 7px
  );
}

/* ==========================================================================
   DRIFTING BLOBS — soft monochrome shapes that slowly wander the viewport.
   ========================================================================== */
.blob-field {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 68%);
  filter: blur(60px);
  will-change: transform;
}

.blob--a {
  width: 46vw;
  height: 46vw;
  max-width: 560px;
  max-height: 560px;
  top: -14%;
  left: 4%;
  opacity: 0.22;
  animation: blob-drift-a 13s var(--ease-out) infinite alternate;
}

.blob--b {
  width: 34vw;
  height: 34vw;
  max-width: 440px;
  max-height: 440px;
  top: 34%;
  left: 58%;
  opacity: 0.14;
  animation: blob-drift-b 16s var(--ease-out) infinite alternate;
  animation-delay: -5s;
}

.blob--c {
  width: 50vw;
  height: 50vw;
  max-width: 620px;
  max-height: 620px;
  top: 62%;
  left: -14%;
  opacity: 0.1;
  animation: blob-drift-c 19s var(--ease-out) infinite alternate;
  animation-delay: -9s;
}

.blob--d {
  width: 26vw;
  height: 26vw;
  max-width: 340px;
  max-height: 340px;
  top: 2%;
  left: 68%;
  opacity: 0.08;
  animation: blob-drift-d 10s var(--ease-out) infinite alternate;
  animation-delay: -2s;
}

@keyframes blob-drift-a {
  0% {
    transform: translate(0, 0) scale(0.94);
    opacity: 0.2;
  }
  50% {
    transform: translate(7vw, 8vh) scale(1.12);
    opacity: 0.58;
  }
  100% {
    transform: translate(-5vw, 4vh) scale(0.98);
    opacity: 0.24;
  }
}

@keyframes blob-drift-b {
  0% {
    transform: translate(0, 0) scale(0.92);
    opacity: 0.12;
  }
  50% {
    transform: translate(-8vw, -6vh) scale(1.05);
    opacity: 0.4;
  }
  100% {
    transform: translate(4vw, 7vh) scale(0.96);
    opacity: 0.16;
  }
}

@keyframes blob-drift-c {
  0% {
    transform: translate(0, 0) scale(0.94);
    opacity: 0.08;
  }
  50% {
    transform: translate(6vw, -9vh) scale(1.08);
    opacity: 0.3;
  }
  100% {
    transform: translate(-6vw, -3vh) scale(0.96);
    opacity: 0.1;
  }
}

@keyframes blob-drift-d {
  0% {
    transform: translate(0, 0) scale(0.92);
    opacity: 0.06;
  }
  50% {
    transform: translate(-6vw, 6vh) scale(1.14);
    opacity: 0.26;
  }
  100% {
    transform: translate(5vw, -4vh) scale(0.98);
    opacity: 0.08;
  }
}

/* ==========================================================================
   LAYOUT
   ========================================================================== */
.page {
  position: relative;
  z-index: 2;
  max-width: var(--column-width);
  margin: 0 auto;
  padding: 72px 20px 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ==========================================================================
   PROFILE
   ========================================================================== */
.profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  animation: profile-in var(--dur-slow) var(--ease-out) forwards;
}

@keyframes profile-in {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.profile__avatar-wrap {
  position: relative;
  width: 92px;
  height: 92px;
  margin-bottom: 18px;
}

.profile__avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--mono-line-strong);
  box-shadow: 0 0 0 6px var(--mono-glow-soft), 0 0 32px -6px var(--mono-glow);
  background: var(--bg-elevated);
}

.profile__status {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--status-online);
  border: 3px solid var(--bg-void);
}

.profile__status[data-status="away"] {
  background: #d9a441;
}

.profile__status[data-status="offline"] {
  background: var(--text-faint);
}

.profile__name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.verified-badge {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  transform: translateY(1px);
}

.verified-badge svg {
  width: 100%;
  height: 100%;
}

.profile__handle {
  margin-top: 4px;
  font-size: 0.85rem;
  color: var(--mono-soft);
  font-weight: 500;
}

.profile__bio {
  margin-top: 14px;
  max-width: 300px;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-muted);
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   FLOATING QUEUE PANEL — bottom-left, above the fixed player bar
   ========================================================================== */
.queue-panel {
  position: fixed;
  left: 20px;
  bottom: 92px;
  width: 220px;
  max-height: 240px;
  overflow-y: auto;
  z-index: 40;
  padding: 10px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--mono-line);
  backdrop-filter: blur(14px);
  opacity: 0;
  animation: fade-up var(--dur-slow) var(--ease-out) forwards;
  animation-delay: 120ms;
}

.queue-panel__label {
  margin: 2px 4px 8px;
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  font-weight: 600;
}

.queue-panel__list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.queue-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  opacity: 0.55;
  transition: background var(--dur-fast) var(--ease-out), opacity var(--dur-fast) var(--ease-out);
}

.queue-item:hover,
.queue-item:focus-visible {
  background: rgba(255, 255, 255, 0.06);
  opacity: 0.85;
}

.queue-item--current {
  opacity: 1;
  background: rgba(255, 255, 255, 0.05);
}

.queue-item__art {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  object-fit: cover;
  background: var(--bg-elevated);
  border: 1px solid var(--mono-line);
  flex-shrink: 0;
}

.queue-item__text {
  min-width: 0;
  text-align: left;
}

.queue-item__title {
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-item__artist {
  font-size: 0.66rem;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   PLAYER — fixed full-width bar, bottom of viewport
   ========================================================================== */
.player {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: none;
  z-index: 50;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 24px;
  border-radius: 0;
  border: none;
  border-top: 1px solid var(--mono-line);
  background: rgba(12, 12, 14, 0.86);
  backdrop-filter: blur(16px);
}

.player__art-wrap {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-elevated);
  border: 1px solid var(--mono-line);
}

.player__art {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.player__meta {
  flex-shrink: 0;
  width: 190px;
  min-width: 0;
}

.player__title {
  font-size: 0.84rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player__artist {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.player__transport {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.player__progress {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-faint);
  letter-spacing: 0.01em;
}

.player__progress-track {
  position: relative;
  flex: 1;
  height: 3px;
  border-radius: var(--radius-round);
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.player__progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(90deg, var(--mono-strong), var(--mono-bright));
  border-radius: var(--radius-round);
  transition: width 240ms linear;
}

.player__volume {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 110px;
  color: var(--text-faint);
}

.player__volume-icon svg {
  width: 16px;
  height: 16px;
  display: block;
}

.player__volume-slider {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 3px;
  border-radius: var(--radius-round);
  background: linear-gradient(
    to right,
    var(--mono-bright) 0%,
    var(--mono-bright) var(--vol-pct, 10%),
    rgba(255, 255, 255, 0.12) var(--vol-pct, 10%),
    rgba(255, 255, 255, 0.12) 100%
  );
  outline: none;
  cursor: pointer;
}

.player__volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--mono-bright);
  cursor: pointer;
  border: none;
}

.player__volume-slider::-moz-range-thumb {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--mono-bright);
  cursor: pointer;
  border: none;
}

.player__volume-slider::-moz-range-track {
  height: 3px;
  border-radius: var(--radius-round);
  background: transparent;
}

.player__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--text-muted);
  transition: color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out);
}

.player__btn svg {
  width: 16px;
  height: 16px;
}

.player__btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.player__btn:active {
  transform: scale(0.92);
}

.player__btn--play {
  width: 36px;
  height: 36px;
  color: var(--bg-void);
  background: var(--mono-bright);
}

.player__btn--play svg {
  width: 15px;
  height: 15px;
}

.player__btn--play:hover {
  background: #ffffff;
  color: var(--bg-void);
}

.player__btn--spotify {
  flex-shrink: 0;
  color: var(--text-faint);
}

.player__btn--spotify:hover {
  color: var(--mono-bright);
  background: rgba(255, 255, 255, 0.06);
}

.player__note {
  position: fixed;
  left: 24px;
  bottom: 66px;
  z-index: 51;
  max-width: 320px;
  font-size: 0.68rem;
  color: var(--text-faint);
  line-height: 1.4;
  background: rgba(12, 12, 14, 0.9);
  border: 1px solid var(--mono-line);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   CONTACT PILL
   ========================================================================== */
.contact-pill {
  margin-top: 20px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 16px;
  border-radius: var(--radius-round);
  background: var(--bg-card);
  border: 1px solid var(--mono-line);
  font-size: 0.78rem;
  color: var(--text-muted);
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}

.contact-pill:hover {
  background: var(--bg-card-hover);
  border-color: var(--mono-line-strong);
}

.contact-pill strong {
  color: var(--text-primary);
  font-weight: 700;
}

.contact-pill__icon svg {
  width: 14px;
  height: 14px;
  display: block;
}

/* the real Spotify iFrame API embed. Spotify's SDK replaces #spotify-mount
   with its own iframe, so the hiding rules live on this OUTER wrapper,
   which is never touched by that swap. It must stay in the layout and
   rendered (not display:none) for playback + events to work reliably. */
.spotify-mount-wrap {
  width: 100%;
  max-width: var(--column-width);
  height: 1px;
  overflow: hidden;
  opacity: 0;
  margin: 0;
  pointer-events: none;
}

.spotify-mount-wrap iframe {
  border: 0;
}

/* ==========================================================================
   LINK CARDS
   ========================================================================== */
.links {
  width: 100%;
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.link-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--mono-line);
  opacity: 0;
  transform: translateY(10px);
  animation: card-in var(--dur-med) var(--ease-out) forwards;
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}

@keyframes card-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.link-card:hover,
.link-card:focus-visible {
  background: var(--bg-card-hover);
  border-color: var(--mono-line-strong);
  box-shadow: 0 0 28px -10px var(--mono-glow);
  transform: translateY(-1px);
}

.link-card__icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  color: var(--mono-soft);
}

.link-card__icon svg {
  width: 19px;
  height: 19px;
}

.link-card__text {
  flex: 1;
  min-width: 0;
}

.link-card__title {
  font-size: 0.92rem;
  font-weight: 600;
}

.link-card__subtitle {
  margin-top: 1px;
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-card__arrow {
  flex-shrink: 0;
  width: 17px;
  height: 17px;
  color: var(--text-faint);
  transition: transform var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}

.link-card:hover .link-card__arrow {
  transform: translateX(3px);
  color: var(--mono-bright);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer {
  margin-top: 34px;
  font-size: 0.72rem;
  color: var(--text-faint);
  opacity: 0;
  animation: fade-up var(--dur-slow) var(--ease-out) forwards;
  animation-delay: 480ms;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 480px) {
  .page {
    padding: 44px 16px 36px;
    max-width: 100%;
  }

  .atmosphere--top {
    width: 700px;
    height: 600px;
    top: -22%;
  }

  .profile__avatar-wrap {
    width: 80px;
    height: 80px;
  }

  .xmb-queue {
    height: 66px;
  }

  .xmb-slot--prev {
    left: 4%;
  }

  .xmb-slot--next {
    left: 96%;
  }

  .xmb-slot--current .xmb-slot__art {
    width: 50px;
    height: 50px;
  }

  .player {
    padding: 8px 12px;
    gap: 8px;
  }

  .player__meta {
    width: 100px;
  }

  .player__volume,
  .queue-panel {
    display: none;
  }
}

@media (min-width: 720px) {
  .atmosphere--top {
    width: 1300px;
    height: 1000px;
  }
}

/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .profile,
  .queue-panel,
  .link-card,
  .footer {
    opacity: 1;
    transform: none;
  }
}
