/* ============================================================
   ROOT & RESET
   ============================================================ */
:root {
  --bg-deep:        #030912;
  --bg-glass:       rgba(8, 20, 40, 0.55);
  --bg-glass-hover: rgba(10, 26, 52, 0.72);
  --border-glass:   rgba(0, 200, 255, 0.12);
  --border-hover:   rgba(0, 200, 255, 0.30);
  --cyan:           #00c8ff;
  --cyan-dim:       rgba(0, 200, 255, 0.18);
  --cyan-glow:      rgba(0, 200, 255, 0.40);
  --cyan-soft:      rgba(0, 180, 230, 0.08);
  --green-online:   #3ddc84;
  --discord-color:  #5865f2;
  --text-primary:   #e8f4ff;
  --text-secondary: rgba(180, 215, 240, 0.65);
  --text-muted:     rgba(140, 185, 220, 0.45);
  --font-main:      'Space Grotesk', system-ui, sans-serif;
  --font-mono:      'JetBrains Mono', 'Courier New', monospace;
  --radius-card:    18px;
  --radius-pill:    999px;
  --blur-glass:     16px;
  --transition:     all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transition-fast:all 0.18s ease;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-main);
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  cursor: none; /* overridden for touch */
}

/* Default cursor for touch devices */
@media (hover: none), (pointer: coarse) {
  body { cursor: auto; }
}

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

/* ============================================================
   CUSTOM CURSOR  (desktop / pointer device only)
   ============================================================ */
@media (hover: hover) and (pointer: fine) {
  .cursor-dot {
    position: fixed;
    top: 0; left: 0;
    width: 6px; height: 6px;
    background: var(--cyan);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: transform 0.08s ease, width 0.2s ease, height 0.2s ease, opacity 0.2s ease;
    box-shadow: 0 0 8px var(--cyan);
  }

  .cursor-ring {
    position: fixed;
    top: 0; left: 0;
    width: 30px; height: 30px;
    border: 1.5px solid rgba(0, 200, 255, 0.5);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: transform 0.12s ease, width 0.25s ease, height 0.25s ease, border-color 0.25s ease;
  }

  .cursor-dot.hovering {
    width: 10px; height: 10px;
    background: #fff;
    box-shadow: 0 0 12px var(--cyan);
  }

  .cursor-ring.hovering {
    width: 44px; height: 44px;
    border-color: var(--cyan);
  }

  .cursor-glow {
    position: fixed;
    top: 0; left: 0;
    width: 280px; height: 280px;
    pointer-events: none;
    z-index: 1;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(0,180,255,0.07) 0%, transparent 70%);
    border-radius: 50%;
    transition: opacity 0.3s ease;
  }
}

@media (hover: none), (pointer: coarse) {
  .cursor-dot, .cursor-ring, .cursor-glow { display: none; }
}

/* ============================================================
   CLICK RIPPLE
   ============================================================ */
.click-ripple {
  position: fixed;
  width: 32px; height: 32px;
  border: 1.5px solid rgba(0,200,255,0.6);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9997;
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  transition: none;
}
.click-ripple.active {
  animation: rippleOut 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes rippleOut {
  0%   { transform: translate(-50%,-50%) scale(0);  opacity: 0.8; }
  100% { transform: translate(-50%,-50%) scale(2.8); opacity: 0; }
}

/* ============================================================
   BACKGROUND
   ============================================================ */
.background-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.bg-image {
  position: absolute;
  inset: -4%;          /* extra space for parallax movement */
  width: 108%;
  height: 108%;
  background-image: url('assets/background.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  will-change: transform;
  transition: transform 0.12s linear;
}

.bg-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      180deg,
      rgba(3, 9, 18, 0.55) 0%,
      rgba(4, 12, 26, 0.45) 40%,
      rgba(5, 15, 32, 0.62) 100%
    );
}

.bg-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    transparent 30%,
    rgba(3, 9, 18, 0.70) 100%
  );
}

/* ============================================================
   PARTICLES
   ============================================================ */
.particles-canvas {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.6;
}

/* ============================================================
   ENTER OVERLAY
   ============================================================ */
.enter-overlay {
  position: fixed;
  inset: 0;
  z-index: 8000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(3, 9, 18, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: fadeIn 0.4s ease;
}

.enter-overlay.hidden {
  animation: fadeOut 0.5s ease forwards;
  pointer-events: none;
}

.enter-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 0 20px;
}

.enter-icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--cyan-dim);
  border: 1px solid var(--border-glass);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  color: var(--cyan);
  animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 20px var(--cyan-glow); }
  50%       { box-shadow: 0 0 40px var(--cyan-glow), 0 0 80px rgba(0,200,255,0.15); }
}

.enter-title {
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-primary);
}

.enter-sub {
  font-size: 0.9rem;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  max-width: 280px;
}

.enter-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 36px;
  background: linear-gradient(135deg, rgba(0,200,255,0.18) 0%, rgba(0,140,200,0.1) 100%);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-pill);
  color: var(--cyan);
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: var(--transition);
}
.enter-btn:hover {
  background: rgba(0,200,255,0.28);
  box-shadow: 0 0 30px var(--cyan-glow);
  transform: translateY(-2px);
}

.enter-skip {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-main);
  font-size: 0.82rem;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: color 0.2s;
}
.enter-skip:hover { color: var(--text-secondary); }

/* ============================================================
   MAIN WRAPPER
   ============================================================ */
.main-wrapper {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: clamp(48px, 10vw, 88px) 20px 48px;
  gap: clamp(28px, 5vw, 40px);
  opacity: 0;
  animation: fadeInUp 0.9s 0.3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

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

/* ============================================================
   PROFILE SECTION
   ============================================================ */
.profile-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
}

/* --- Avatar --- */
.avatar-wrapper {
  position: relative;
  width: clamp(100px, 24vw, 128px);
  height: clamp(100px, 24vw, 128px);
  animation: scaleIn 0.8s 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes scaleIn {
  from { transform: scale(0.7); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.avatar-ring-outer {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    rgba(0,200,255,0.6) 90deg,
    transparent 180deg,
    rgba(0,200,255,0.3) 270deg,
    transparent 360deg
  );
  animation: rotateSlow 8s linear infinite;
}

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

.avatar-img {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(0, 200, 255, 0.25);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s ease;
  background: var(--bg-glass);
}
.avatar-img:hover {
  transform: scale(1.04);
  box-shadow: 0 0 40px rgba(0,200,255,0.35);
}

.avatar-glow {
  position: absolute;
  inset: -16px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,180,255,0.18) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
  animation: pulseGlow 3s ease-in-out infinite;
}

/* --- Name --- */
.name-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.profile-name {
  font-size: clamp(2rem, 7vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, #e8f4ff 0%, #a0d8ef 45%, var(--cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}

.badges-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  background: var(--cyan-soft);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: rgba(160, 220, 255, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: var(--transition-fast);
  list-style: none;
}
.badge:hover {
  border-color: var(--border-hover);
  background: var(--cyan-dim);
  color: var(--cyan);
}
.badge i { font-size: 0.65rem; }

/* --- Typewriter --- */
.description-wrapper {
  min-height: 1.7em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.typewriter-text {
  font-family: var(--font-mono);
  font-size: clamp(0.85rem, 2.8vw, 1.05rem);
  font-weight: 300;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.typewriter-cursor {
  font-family: var(--font-mono);
  font-size: clamp(0.85rem, 2.8vw, 1.05rem);
  color: var(--cyan);
  animation: blink 1s step-end infinite;
  margin-left: 1px;
  line-height: 1;
}

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

/* ============================================================
   CARDS SECTION
   ============================================================ */
.cards-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 400px;
}

/* ============================================================
   GLASS CARD BASE
   ============================================================ */
.glass-card {
  position: relative;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-card);
  backdrop-filter: blur(var(--blur-glass));
  -webkit-backdrop-filter: blur(var(--blur-glass));
  overflow: hidden;
  cursor: default;
  transition: var(--transition);
  animation: slideUpFade 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
  transform-style: preserve-3d;
  will-change: transform;
}

.discord-card { animation-delay: 0.55s; }
.github-card  { animation-delay: 0.70s; }

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

.glass-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-glass-hover);
  box-shadow: 0 12px 48px rgba(0,0,0,0.35), 0 0 24px rgba(0,200,255,0.08);
}

/* 3D tilt shine overlay */
.card-tilt-shine {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-card);
  pointer-events: none;
  z-index: 10;
  background: radial-gradient(circle at 50% 0%, rgba(255,255,255,0.06) 0%, transparent 60%);
  transition: opacity 0.3s ease;
  opacity: 0;
}
.glass-card:hover .card-tilt-shine { opacity: 1; }

.card-inner {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 18px 20px;
  position: relative;
  z-index: 2;
}

/* Subtle top glow accent */
.card-glow-accent {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--cyan) 50%, transparent 100%);
  opacity: 0.3;
  transition: opacity 0.3s;
}
.glass-card:hover .card-glow-accent { opacity: 0.7; }

.github-accent {
  background: linear-gradient(90deg, transparent 0%, rgba(200,200,200,0.6) 50%, transparent 100%);
}

/* Card icons */
.card-icon-wrap {
  flex-shrink: 0;
  width: 48px; height: 48px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0,200,255,0.06);
  border: 1px solid var(--border-glass);
  display: flex; align-items: center; justify-content: center;
}

.card-server-icon {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.card-icon-fallback {
  font-size: 22px;
  color: var(--discord-color);
}

.github-icon-wrap {
  font-size: 26px;
  color: rgba(220,220,220,0.8);
  background: rgba(140,140,140,0.08);
  border-color: rgba(140,140,140,0.15);
}

/* Card content */
.card-content {
  flex: 1;
  min-width: 0;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 5px;
}

.card-platform-icon {
  font-size: 0.8rem;
  opacity: 0.6;
}
.discord-icon { color: var(--discord-color); }
.github-icon  { color: rgba(200,200,200,0.7); }

.card-title {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.meta-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.members-dot { background: rgba(150,180,210,0.5); }
.online-dot  { background: var(--green-online); box-shadow: 0 0 6px var(--green-online); }
.online-count{ color: var(--green-online); }

.meta-sep { color: var(--text-muted); }

.github-handle {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.card-ext-arrow {
  margin-left: auto;
  font-size: 0.7rem;
  color: var(--text-muted);
  transition: color 0.2s, transform 0.2s;
}
.github-card:hover .card-ext-arrow {
  color: var(--cyan);
  transform: translate(2px, -2px);
}

/* github card cursor */
.github-card { cursor: pointer; }

/* ============================================================
   SOCIAL LINKS
   ============================================================ */
.social-links {
  display: flex;
  align-items: center;
  gap: 14px;
  animation: fadeIn 0.7s 0.85s both;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--cyan-soft);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  font-size: 1.05rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: var(--transition);
}
.social-link:hover {
  background: var(--cyan-dim);
  border-color: var(--border-hover);
  color: var(--cyan);
  transform: translateY(-3px) scale(1.08);
  box-shadow: 0 8px 24px rgba(0,200,255,0.2);
}
.social-link:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

/* ============================================================
   STATS ROW
   ============================================================ */
.stats-row {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.82rem;
  color: var(--text-muted);
  animation: fadeIn 0.7s 1s both;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.stat-icon { font-size: 0.9rem; }

.stat-value {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-label { color: var(--text-muted); }
.stat-sep   { color: var(--text-muted); opacity: 0.5; }

/* ============================================================
   MUSIC CONTROL
   ============================================================ */
.music-control {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.music-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  font-size: 1rem;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.music-btn:hover {
  border-color: var(--border-hover);
  color: var(--cyan);
  box-shadow: 0 0 20px rgba(0,200,255,0.2);
}
.music-btn:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.music-icon-wrap { display: flex; align-items: center; justify-content: center; }
.music-icon-wrap.playing { animation: spinSlow 4s linear infinite; }

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

/* Music bars animation */
.music-bars {
  display: none;
  align-items: flex-end;
  gap: 2.5px;
  height: 16px;
}
.music-bars.active { display: flex; }
.music-icon-wrap.hidden { display: none; }

.music-bars span {
  width: 3px;
  background: var(--cyan);
  border-radius: 2px;
  animation: barDance 0.8s ease-in-out infinite alternate;
}
.music-bars span:nth-child(1) { height: 6px;  animation-delay: 0s; }
.music-bars span:nth-child(2) { height: 12px; animation-delay: 0.15s; }
.music-bars span:nth-child(3) { height: 8px;  animation-delay: 0.3s; }
.music-bars span:nth-child(4) { height: 14px; animation-delay: 0.45s; }

@keyframes barDance {
  from { transform: scaleY(0.4); }
  to   { transform: scaleY(1.1); }
}

/* Music popup */
.music-popup {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  pointer-events: none;
  transition: max-height 0.4s ease, opacity 0.3s ease;
  min-width: 200px;
}
.music-popup.open {
  max-height: 160px;
  opacity: 1;
  pointer-events: all;
}

.music-popup-inner {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.music-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.music-info i { color: var(--cyan); }

.music-track-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.music-controls-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mc-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--cyan-soft);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  font-size: 0.75rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition-fast);
  flex-shrink: 0;
}
.mc-btn:hover { border-color: var(--border-hover); color: var(--cyan); }
.mc-btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

.mc-volume-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.mc-volume {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 3px;
  border-radius: 2px;
  background: var(--border-glass);
  outline: none;
  cursor: pointer;
}
.mc-volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--cyan);
  cursor: pointer;
  box-shadow: 0 0 6px var(--cyan-glow);
}
.mc-volume::-moz-range-thumb {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--cyan);
  border: none;
  cursor: pointer;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 480px) {
  .main-wrapper {
    padding: 40px 16px 60px;
    gap: 24px;
  }

  .cards-section { max-width: 100%; }

  .card-inner { padding: 15px 16px; gap: 12px; }

  .music-control {
    bottom: 16px;
    right: 16px;
  }
}

@media (min-width: 768px) {
  .cards-section {
    max-width: 440px;
  }
}

/* ============================================================
   ACCESSIBILITY: reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .avatar-ring-outer { animation: none; }
  .typewriter-cursor { animation: none; opacity: 1; }
}

/* ============================================================
   FOCUS VISIBLE
   ============================================================ */
:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 4px;
}
