@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --purple:      #a855f7;
  --purple-dim:  rgba(168,85,247,0.15);
  --purple-glow: rgba(168,85,247,0.35);
  --bg:          #0a0a0a;
  --bg-2:        #0f1020;
  --glass:       rgba(25,25,25,0.45);
  --glass-border:rgba(30,30,30,0.5);
  --text:        #f1f1f1;
  --muted:       #888;
}

html { scroll-behavior: smooth; }

body {
  background: url('assets/bg.png') center/cover no-repeat;
  color: var(--text);
  font-family: 'Space Grotesk', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  cursor: none;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,0.05), transparent 45%),
    radial-gradient(circle at 78% 8%,  rgba(168,85,247,0.08),  transparent 35%),
    radial-gradient(circle at 50% 120%,rgba(192,132,252,0.05), transparent 45%);
}

/* ─── Enter Overlay ───────────────────────────────── */
#enter-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #0a0a0a;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: none;
  transition: opacity 0.65s ease;
}

#enter-overlay.hiding {
  opacity: 0;
  pointer-events: none;
}

#enter-box {
  text-align: center;
  animation: fadeSlideUp 0.9s cubic-bezier(0.22,1,0.36,1) both;
}

#enter-title {
  font-size: 3.2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #fff 30%, #c084fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 14px;
}

#enter-sub {
  font-size: 0.8rem;
  color: rgba(168,85,247,0.85);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50%       { opacity: 1;   }
}

/* ─── Cursor ──────────────────────────────────────── */
#cursor-dot {
  position: fixed;
  width: 8px;
  height: 8px;
  background: var(--purple);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%,-50%);
  transition: width .2s ease, height .2s ease, background .2s ease;
}

#cursor-ring {
  position: fixed;
  width: 34px;
  height: 34px;
  border: 1.5px solid var(--purple);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%,-50%);
  transition: width .2s ease, height .2s ease, opacity .2s ease, border-color .2s ease;
  opacity: 0.7;
}

body.cursor-hover #cursor-dot  { width:12px; height:12px; background:#fff; }
body.cursor-hover #cursor-ring { width:48px; height:48px; opacity:1; }

/* ─── Orbs ────────────────────────────────────────── */
.orb-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.snow-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.9;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.12;
  animation: orbFloat linear infinite;
}

.orb-1 {
  width:500px; height:500px;
  background: radial-gradient(circle,#a855f7,#6d28d9);
  top:-120px; left:-100px;
  animation-duration:18s;
}
.orb-2 {
  width:380px; height:380px;
  background: radial-gradient(circle,#8b5cf6,#4c1d95);
  bottom:-80px; right:-80px;
  animation-duration:22s; animation-delay:-6s;
}
.orb-3 {
  width:260px; height:260px;
  background: radial-gradient(circle,#e9d5ff,#a855f7);
  top:50%; left:60%;
  animation-duration:14s; animation-delay:-3s;
  opacity:0.10;
}

@keyframes orbFloat {
  0%   { transform: translateY(0)    translateX(0)    scale(1);    }
  25%  { transform: translateY(-30px) translateX(20px) scale(1.04); }
  50%  { transform: translateY(-15px) translateX(-15px)scale(0.97); }
  75%  { transform: translateY(25px)  translateX(10px) scale(1.02); }
  100% { transform: translateY(0)    translateX(0)    scale(1);    }
}

/* ─── Layout ──────────────────────────────────────── */
.page-wrapper {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
}

/* ─── Card ────────────────────────────────────────── */
/*
  IMPORTANT: NO "transform" inside transition here.
  JS controls transform entirely via the tilt loop.
*/
.main-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.04);
  border-radius: 24px;
  padding: 44px 40px 36px;
  width: 100%;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  animation: fadeSlideUp 0.7s cubic-bezier(0.22,1,0.36,1) both;
  /* transform-style needed for 3D children */
  transform-style: preserve-3d;
  /* NO transform in this transition — JS owns it */
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
  will-change: transform;
}

.main-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(120deg,rgba(255,255,255,0.1),transparent 38%);
  opacity: 0.35;
}

.main-card.tilting {
  border-color: rgba(233,213,255,0.32);
  box-shadow:
    0 26px 85px rgba(0,0,0,0.52),
    0 0 38px rgba(168,85,247,0.18),
    inset 0 1px 0 rgba(255,255,255,0.08);
}

@keyframes fadeSlideUp {
  from { opacity:0; transform:translateY(32px) scale(0.97); }
  to   { opacity:1; transform:translateY(0)    scale(1);    }
}

/* ─── Avatar ──────────────────────────────────────── */
.avatar-wrap {
  position: relative;
  animation: fadeSlideUp 0.7s 0.1s cubic-bezier(0.22,1,0.36,1) both;
}

.avatar-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #a855f7, #7c3aed, #c084fc, #a855f7);
  animation: spinRing 4s linear infinite;
  z-index: 0;
}

@keyframes spinRing { to { transform: rotate(360deg); } }

.avatar-inner {
  position: relative;
  z-index: 1;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: #1a1a2e;
  padding: 3px;
}

.avatar-inner img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.status-dot-wrap {
  position: absolute;
  bottom: 4px;
  right: 4px;
  z-index: 2;
}

.status-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2.5px solid #0a0a0a;
  background: #888;
  transition: background 0.4s ease;
}

.status-dot.online  { background:#22c55e; box-shadow:0 0 8px #22c55e88; }
.status-dot.idle    { background:#f59e0b; box-shadow:0 0 8px #f59e0b88; }
.status-dot.dnd     { background:#ef4444; box-shadow:0 0 8px #ef444488; }
.status-dot.offline { background:#6b7280; box-shadow:none; }

/* ─── Profile Info ────────────────────────────────── */
.profile-info {
  text-align: center;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: fadeSlideUp 0.7s 0.18s cubic-bezier(0.22,1,0.36,1) both;
}

.profile-name {
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg,#fff 30%,#c084fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}

.profile-tag {
  font-size: 0.82rem;
  color: var(--purple);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 4px;
  opacity: 0.85;
}

.profile-bio {
  font-size: 0.92rem;
  color: var(--muted);
  margin-top: 10px;
  line-height: 1.6;
  max-width: 300px;
  text-align: center;
}

.lanyard-note {
  margin-top: 8px;
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(168,85,247,0.75);
  text-align: center;
}

/* ─── Divider ─────────────────────────────────────── */
.divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--glass-border), transparent);
}

/* ─── Spotify Card ────────────────────────────────── */
.spotify-card {
  width: 100%;
  background: rgba(30,215,96,0.06);
  border: 1px solid rgba(30,215,96,0.2);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: opacity 0.5s ease, transform 0.5s ease, max-height 0.5s ease;
  overflow: hidden;
}

.spotify-card.hidden {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  max-height: 0;
  padding: 0;
  border-width: 0;
}

.spotify-card.visible {
  opacity: 1;
  transform: translateY(0);
  max-height: 120px;
}

.spotify-art {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: #1a1a2e;
  border: 1px solid rgba(30,215,96,0.15);
}

.spotify-info   { flex:1; min-width:0; }

.spotify-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #1DB954;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 3px;
}

.spotify-song {
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.music-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 24px;
  flex-shrink: 0;
}

.music-bar {
  width: 4px;
  background: #1DB954;
  border-radius: 2px;
  animation: musicPulse 0.8s ease-in-out infinite alternate;
}

.music-bar:nth-child(1) { animation-duration:0.6s; animation-delay:0s;    }
.music-bar:nth-child(2) { animation-duration:0.8s; animation-delay:0.15s; }
.music-bar:nth-child(3) { animation-duration:0.5s; animation-delay:0.3s;  }
.music-bar:nth-child(4) { animation-duration:0.9s; animation-delay:0.1s;  }

@keyframes musicPulse {
  from { height:4px;  }
  to   { height:22px; }
}

/* ─── Links ───────────────────────────────────────── */
.links-grid {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: fadeSlideUp 0.7s 0.32s cubic-bezier(0.22,1,0.36,1) both;
}

.link-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 18px;
  border-radius: 50px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text);
  text-decoration: none;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: none;
  transition: background .25s ease, border-color .25s ease,
              transform .25s ease, box-shadow .25s ease;
  position: relative;
  overflow: hidden;
  user-select: none;
  appearance: none;
  -webkit-appearance: none;
  text-align: left;
}

.link-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,rgba(168,85,247,0.12),transparent);
  opacity: 0;
  transition: opacity .25s ease;
  border-radius: inherit;
}

.link-btn:hover {
  background: rgba(168,85,247,0.12);
  border-color: rgba(168,85,247,0.45);
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(168,85,247,0.25), 0 0 0 1px rgba(168,85,247,0.15);
}

.link-btn:hover::before { opacity:1; }

.link-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(168,85,247,0.2);
}

.link-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  transition: background .25s ease;
}

.link-btn:hover .link-icon {
  background: var(--purple-dim);
  border-color: rgba(168,85,247,0.3);
}

.link-label { flex:1; position:relative; z-index:1; }

.link-arrow {
  color: var(--muted);
  font-size: 0.8rem;
  transition: color .25s ease, transform .25s ease;
  position: relative;
  z-index: 1;
}

.link-btn:hover .link-arrow {
  color: var(--purple);
  transform: translateX(3px);
}

/* ─── Toast ───────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(168,85,247,0.18);
  border: 1px solid rgba(168,85,247,0.4);
  backdrop-filter: blur(16px);
  color: #fff;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 50px;
  opacity: 0;
  pointer-events: none;
  z-index: 9000;
  transition: opacity .3s ease, transform .3s ease;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─── Music Player ────────────────────────────────── */
.music-player {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 8000;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15,15,25,0.65);
  border: 1px solid rgba(168,85,247,0.25);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-radius: 50px;
  padding: 9px 16px 9px 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
  animation: fadeSlideUp 0.7s 0.5s cubic-bezier(0.22,1,0.36,1) both;
  transition: border-color .25s ease, box-shadow .25s ease;
}

.music-player:hover {
  border-color: rgba(168,85,247,0.5);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 20px rgba(168,85,247,0.12);
}

.music-toggle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(168,85,247,0.2);
  border: 1px solid rgba(168,85,247,0.4);
  color: #c084fc;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: none;
  flex-shrink: 0;
  transition: background .2s ease, transform .15s ease;
  padding: 0;
}

.music-toggle:hover  { background:rgba(168,85,247,0.35); transform:scale(1.1); }
.music-toggle:active { transform:scale(0.95); }

.music-player-label {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(192,132,252,0.8);
  white-space: nowrap;
}

.music-volume-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.volume-icon {
  color: rgba(168,85,247,0.7);
  flex-shrink: 0;
}

.volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 72px;
  height: 3px;
  border-radius: 99px;
  background: rgba(168,85,247,0.2);
  outline: none;
  cursor: none;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #a855f7;
  cursor: none;
  border: 2px solid rgba(192,132,252,0.5);
  box-shadow: 0 0 6px rgba(168,85,247,0.5);
  transition: transform .15s ease;
}

.volume-slider::-webkit-slider-thumb:hover { transform:scale(1.25); }
.volume-slider::-moz-range-thumb {
  width:13px; height:13px;
  border-radius:50%;
  background:#a855f7;
  border:2px solid rgba(192,132,252,0.5);
}

/* ─── Footer ──────────────────────────────────────── */
.footer {
  margin-top: 22px;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.2);
  letter-spacing: 0.04em;
  animation: fadeSlideUp 0.7s 0.42s cubic-bezier(0.22,1,0.36,1) both;
}

.footer span { color:var(--purple); opacity:0.7; }

/* ─── Responsive ──────────────────────────────────── */
@media (max-width: 500px) {
  .main-card    { padding:32px 22px 28px; border-radius:20px; }
  .profile-name { font-size:2rem; }
  .link-btn     { padding:12px 15px; font-size:0.88rem; }
  .music-player { bottom:16px; right:16px; padding:8px 12px 8px 8px; }
  .music-player-label { display:none; }
  .volume-slider { width:55px; }
}

/* Disable tilt on touch devices */
@media (hover: none) {
  .main-card { transform: none !important; }
}

/* ─── Scrollbar ───────────────────────────────────── */
::-webkit-scrollbar       { width:6px; }
::-webkit-scrollbar-track { background:transparent; }
::-webkit-scrollbar-thumb { background:rgba(168,85,247,0.3); border-radius:99px; }
