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

:root {
  --black: #050505;
  --white: #f0ede8;
  --dim: #6b6760;
  --gold: #c9a84c;
  --gold-glow: #ffd700;
  --red: #c0392b;
  --card-bg: rgba(10, 10, 10, 0.72);
  --border: rgba(201, 168, 76, 0.22);
  --mono: monospace;
  --sans: "Montserrat", sans-serif;
}

html,
body {
  width: 100%;
  height: 100%;
  background: var(--black);
  color: var(--white);
  font-family: var(--sans);
  overflow: hidden;
}

/* ── NOISE OVERLAY ── */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  opacity: 0.35;
}

/* ── SPARKLE CANVAS ── */
#sparkle-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
}

/* ── BG ── */
#bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: var(--black);
  transition: opacity 1.2s ease;
}
#bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.4s ease;
}
#bg-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(5, 5, 5, 0.55) 0%,
    rgba(5, 5, 5, 0.25) 40%,
    rgba(5, 5, 5, 0.75) 100%
  );
}

/* ── ENTER SCREEN ── */
#enter-screen {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--black);
  cursor: pointer;
  transition:
    opacity 0.9s ease,
    visibility 0.9s ease;
}
#enter-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.enter-title {
  font-family: var(--sans);
  font-size: clamp(3.5rem, 10vw, 7rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--white);
  line-height: 1;
  text-align: center;
}
.enter-title span {
  color: var(--gold);
}
.enter-sub {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  color: var(--dim);
  margin-top: 2rem;
  text-transform: uppercase;
  animation: blink-cursor 1.1s step-end infinite;
}
@keyframes blink-cursor {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

/* scanline sweep on enter screen */
#enter-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(255, 255, 255, 0.013) 2px,
    rgba(255, 255, 255, 0.013) 4px
  );
  pointer-events: none;
}

/* ── MAIN CONTENT ── */
#main {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 1s ease 0.4s;
  pointer-events: none;
}
#main.visible {
  opacity: 1;
  pointer-events: auto;
}

/* ── CARD ── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 2.4rem 2.8rem 2.2rem;
  width: min(420px, 92vw);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  position: relative;
  overflow: hidden;
}

/* gold shimmer top edge */
.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--gold) 40%,
    var(--gold-glow) 60%,
    transparent 100%
  );
  opacity: 0.6;
}

/* ── HEADER ── */
.card-header {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  margin-bottom: 1.4rem;
}
.avatar-wrap {
  position: relative;
  flex-shrink: 0;
}
.avatar-wrap::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 14px;
  background: conic-gradient(
    var(--gold) 0deg,
    transparent 60deg,
    var(--gold) 120deg,
    transparent 180deg,
    var(--gold) 240deg,
    transparent 300deg,
    var(--gold) 360deg
  );
  z-index: -1;
  rotate: 80deg;
  opacity: 0.7;
}
.avatar {
  width: 78px;
  height: 78px;
  border-radius: 12px;
  object-fit: cover;
  display: block;
  position: relative;
  z-index: 1;
  background: #1a1a1a; /* placeholder until image loads */
}

.card-identity {
}
.handle {
  font-family: var(--sans);
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--white);
}
.bio {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--dim);
  margin-top: 0.45rem;
  letter-spacing: 0.02em;
  line-height: 1.6;
}
.bio .highlight {
  color: var(--gold);
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

/* ── DIVIDER ── */
.divider {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--border) 30%,
    var(--border) 70%,
    transparent
  );
  margin: 1.4rem 0;
}

/* ── LINKS ── */
.links {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.link-btn {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.72rem 1.1rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.03);
  color: var(--white);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  transition:
    background 0.18s,
    border-color 0.18s,
    transform 0.15s,
    box-shadow 0.18s;
  position: relative;
  overflow: hidden;
}
.link-btn:hover {
  cursor: pointer;
}
.link-btn::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 3px 0 0 3px;
  background: var(--link-color, var(--gold));
  transform: scaleY(0);
  transition: transform 0.18s ease;
  transform-origin: center;
}
.link-btn:hover::before {
  transform: scaleY(1);
}
.link-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
  transform: translateX(4px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}
.link-btn:active {
  transform: translateX(2px) scale(0.99);
}

.link-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
  font-size: 16px;
}
.link-label {
  flex: 1;
}
.link-meta {
  font-size: 0.68rem;
  color: var(--dim);
  letter-spacing: 0.06em;
}

/* ── FOOTER ── */
.card-footer {
  margin-top: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.64rem;
  color: var(--dim);
  letter-spacing: 0.1em;
}
.footer-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.5;
  animation: pulse-dot 2.4s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%,
  100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 0.9;
    transform: scale(1.4);
  }
}

/* ── MUSIC BAR ── */
#music-bar {
  position: fixed;
  bottom: 1.6rem;
  right: 1.6rem;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(10, 10, 10, 0.8);
  border: 1px solid var(--border);
  border-radius: 40px;
  padding: 0.5rem 0.9rem;
  backdrop-filter: blur(12px);
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 0.6s ease 1.2s,
    transform 0.6s ease 1.2s,
    background 0.2s;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--dim);
  letter-spacing: 0.08em;
  user-select: none;
}
#music-bar.visible {
  opacity: 1;
  transform: translateY(0);
}
#music-bar:hover {
  background: rgba(20, 20, 20, 0.95);
  color: var(--white);
}
.music-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}
.music-bar-line {
  width: 3px;
  border-radius: 2px;
  background: var(--gold);
  animation: bar-dance 0.8s ease-in-out infinite;
  transform-origin: bottom;
}
.music-bar-line:nth-child(1) {
  height: 6px;
  animation-delay: 0s;
}
.music-bar-line:nth-child(2) {
  height: 10px;
  animation-delay: 0.15s;
}
.music-bar-line:nth-child(3) {
  height: 14px;
  animation-delay: 0.3s;
}
.music-bar-line:nth-child(4) {
  height: 8px;
  animation-delay: 0.1s;
}
.music-bar-line.paused {
  animation-play-state: paused;
}
@keyframes bar-dance {
  0%,
  100% {
    transform: scaleY(0.3);
  }
  50% {
    transform: scaleY(1);
  }
}

/* ── GLITCH HOVER on handle ── */
@keyframes glitch-1 {
  0%,
  94%,
  100% {
    clip-path: none;
    transform: none;
  }
  95% {
    clip-path: polygon(0 20%, 100% 20%, 100% 40%, 0 40%);
    transform: translate(-3px, 0);
  }
  97% {
    clip-path: polygon(0 60%, 100% 60%, 100% 80%, 0 80%);
    transform: translate(3px, 0);
  }
}
.handle:hover {
  animation: glitch-1 3s ease-in-out infinite;
  cursor: default;
}

/* ── RESPONSIVE ── */
@media (max-width: 480px) {
  .card {
    padding: 1.8rem 1.6rem 1.6rem;
  }
  .handle {
    font-size: 1.4rem;
  }
}

