:root {
  --accent: #ffffff;
  --accent2: #71717a;
  --bg: #050505;
  --text: #f4f4f5;
  --text-dim: #a1a1aa;
  --beat: 0; /* 0..1, driven by JS on every beat */
}

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

html, body { height: 100%; }

body {
  font-family: "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  align-items: safe center;
  justify-content: center;
  perspective: 900px;
}

/* subtle ambient grey glow behind everything */
body::before {
  content: "";
  position: fixed;
  inset: -30%;
  background:
    radial-gradient(45% 45% at 30% 25%, rgba(255, 255, 255, 0.05), transparent 70%),
    radial-gradient(45% 45% at 70% 75%, rgba(255, 255, 255, 0.04), transparent 70%);
  animation: drift 20s ease-in-out infinite alternate;
}

@keyframes drift {
  from { transform: translate(-2%, -2%) scale(1); }
  to   { transform: translate(2%, 3%) scale(1.06); }
}

/* ---------- visualizer canvas ---------- */
#viz {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* ---------- hidden youtube player ---------- */
#yt-holder {
  position: fixed;
  bottom: 0;
  right: 0;
  width: 1px;
  height: 1px;
  opacity: 0.01;
  overflow: hidden;
  pointer-events: none;
}

/* ---------- enter overlay ---------- */
#enter-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  cursor: pointer;
  transition: opacity 0.6s ease, visibility 0.6s;
}

#enter-overlay.gone { opacity: 0; visibility: hidden; }

#enter-text {
  font-size: clamp(1.1rem, 3vw, 1.6rem);
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--text);
  animation: pulse 2.2s ease-in-out infinite;
  user-select: none;
}

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

/* ---------- card ---------- */
#card {
  position: relative;
  z-index: 2;
  width: min(92vw, 440px);
  margin: 2.5rem 0;
  padding: 2.4rem 2rem 1.6rem;
  border-radius: 22px;
  text-align: center;
  background: rgba(10, 10, 12, 0.6);
  border: 1px solid rgba(255, 255, 255, calc(0.1 + var(--beat) * 0.12));
  box-shadow:
    0 0 calc(30px + var(--beat) * 30px) rgba(255, 255, 255, calc(0.06 + var(--beat) * 0.1)),
    0 20px 60px rgba(0, 0, 0, 0.6);
  transform-style: preserve-3d;
  transition: opacity 0.8s ease, translate 0.8s ease;
  will-change: transform;
}

#card.blur {
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

#card.hidden {
  opacity: 0;
  translate: 0 16px;
}

/* children lifted slightly for the 3D tilt depth effect */
#card > * { transform: translateZ(24px); }

/* ---------- avatar ---------- */
.avatar-wrap {
  width: 108px;
  height: 108px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 0 calc(14px + var(--beat) * 26px)
    rgba(255, 255, 255, calc(0.25 + var(--beat) * 0.45));
  scale: calc(1 + var(--beat) * 0.045);
  transition: scale 0.09s ease-out;
}

#avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: #111;
}

/* ---------- name & bio ---------- */
#name {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

#name.gradient {
  background: linear-gradient(90deg, #fff, #777, #fff);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shine 5s linear infinite;
}

@keyframes shine {
  to { background-position: 200% 0; }
}

#bio {
  margin-top: 0.4rem;
  min-height: 1.4em;
  color: var(--text-dim);
  font-size: 0.95rem;
}

.caret {
  animation: blink 1s steps(1) infinite;
  color: var(--accent);
  font-weight: 600;
}

@keyframes blink { 50% { opacity: 0; } }

/* ---------- socials ---------- */
#socials {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.9rem;
  margin-top: 1.2rem;
}

#socials a {
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  transition: color 0.2s, transform 0.2s, filter 0.2s;
}

#socials a:hover {
  color: var(--accent);
  transform: translateY(-3px);
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.8));
}

#socials svg { width: 24px; height: 24px; }

/* ---------- nav + pages ---------- */

#nav {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1.15rem;
}

#nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

#nav a:hover { color: var(--text); }

#nav a.active {
  color: var(--text);
  border-bottom-color: rgba(255, 255, 255, 0.55);
}

.view { display: none; }

.view.active {
  display: block;
  animation: view-in 0.35s ease;
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.page-para {
  margin-top: 1.2rem;
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text-dim);
  text-align: left;
}

/* ---------- about + works ---------- */

#about {
  margin-top: 1.25rem;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-dim);
}

.works-section {
  margin-top: 1.4rem;
  text-align: left;
}

.works-section h2 {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-dim);
  margin-bottom: 0.55rem;
}

.work {
  display: block;
  padding: 0.6rem 0.85rem;
  margin-bottom: 0.5rem;
  border-left: 2px solid rgba(255, 255, 255, 0.22);
  border-radius: 0 10px 10px 0;
  background: rgba(255, 255, 255, 0.035);
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

a.work:hover {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(3px);
}

.work-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.work-desc {
  margin-top: 0.15rem;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--text-dim);
}

/* ---------- link buttons ---------- */
#links {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 1.3rem;
}

#links:empty { margin-top: 0; }

#links a {
  display: block;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s, background 0.2s;
}

#links a:hover {
  border-color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

/* ---------- meta row ---------- */
#meta {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.4rem;
  font-size: 0.78rem;
  color: var(--text-dim);
  opacity: 0.85;
}

#track { letter-spacing: 0.02em; }

#track, #views {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.mi {
  width: 14px;
  height: 14px;
  fill: currentColor;
  flex-shrink: 0;
}

/* ---------- sparkle cursor (off by default, toggle in config) ---------- */
.sparkle {
  position: fixed;
  z-index: 50;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  pointer-events: none;
  animation: sparkle-fade 0.7s ease-out forwards;
}

@keyframes sparkle-fade {
  to {
    opacity: 0;
    transform: translateY(10px) scale(0.2);
  }
}

@media (max-width: 480px) {
  #card { padding: 2rem 1.4rem 1.4rem; }
}
