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

:root {
  /* Dynamic Variables Fallbacks (Overridden by JS) */
  --bg-color-1: #0f172a;
  --bg-color-2: #1e1b4b;
  --bg-color-3: #312e81;

  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-hover: rgba(255, 255, 255, 0.12);

  --text-main: #f8fafc;
  --text-muted: #cbd5e1;

  --glow-1: #8b5cf6;
  --glow-2: #3b82f6;
  --glow-3: #10b981;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Montserrat', sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100vh;
  color: var(--text-main);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 3rem 1.5rem;
  position: relative;
  overflow-x: hidden;
  background: linear-gradient(-45deg, var(--bg-color-1), var(--bg-color-2), var(--bg-color-3), var(--bg-color-1));
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
}

@keyframes gradientBG {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

/* Floating Ambient Shapes */
.shape {
  position: absolute;
  filter: blur(80px);
  z-index: 0;
  border-radius: 50%;
  animation: float 10s infinite ease-in-out alternate;
  opacity: 0.6;
}

.shape-1 {
  width: 350px;
  height: 350px;
  background: var(--glow-1);
  top: 10%;
  left: 15%;
  animation-delay: 0s;
}

.shape-2 {
  width: 400px;
  height: 400px;
  background: var(--glow-2);
  bottom: 0%;
  right: 10%;
  animation-delay: -5s;
}

@keyframes float {
  0% {
    transform: translate(0, 0) scale(1);
  }

  100% {
    transform: translate(30px, 50px) scale(1.1);
  }
}

/* Main Container */
.container {
  width: 100%;
  max-width: 540px;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 10;
}

/* Header / Profile */
.profile {
  text-align: center;
  margin-bottom: 2.5rem;
  animation: slideDown 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
  opacity: 0;
  transform: translateY(-20px);
}

@keyframes slideDown {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.avatar-container {
  position: relative;
  width: 130px;
  height: 130px;
  margin: 0 auto 1.5rem auto;
}

.avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid transparent;
  background-clip: padding-box;
  position: relative;
  z-index: 2;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s ease;
}

.avatar-container:hover .avatar {
  transform: scale(1.05);
}

/* Glowing Rotating Avatar Ring */
.avatar-container::before {
  content: '';
  position: absolute;
  top: -6px;
  right: -6px;
  bottom: -6px;
  left: -6px;
  background: linear-gradient(45deg, var(--glow-1), var(--glow-2), var(--glow-3), var(--glow-1));
  background-size: 200% 200%;
  border-radius: 50%;
  z-index: 1;
  /* Made the spin slower and glowPulse longer for a much smoother effect */
  animation: spin 5s linear infinite, glowPulse 3s ease-in-out infinite alternate;
}

.avatar-container::after {
  content: '';
  position: absolute;
  top: -6px;
  left: -6px;
  bottom: -6px;
  right: -6px;
  background: linear-gradient(45deg, var(--glow-1), var(--glow-2), var(--glow-3));
  border-radius: 50%;
  z-index: 0;
  filter: blur(20px);
  opacity: 0.8;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
    background-position: 0% 50%;
  }

  100% {
    transform: rotate(360deg);
    background-position: 100% 50%;
  }
}

@keyframes glowPulse {
  0% {
    opacity: 0.7;
  }

  100% {
    opacity: 1;
  }
}

.name {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
  text-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.bio {
  font-size: 1.1rem;
  color: var(--text-muted);
  font-weight: 400;
  line-height: 1.6;
  max-width: 90%;
  margin: 0 auto;
}

/* Links Section */
.links-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.link-card {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 1.25rem 1.5rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  text-decoration: none;
  color: var(--text-main);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(30px);
  animation: slideUpFade 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

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

.link-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.08), transparent);
  transform: skewX(-20deg);
  transition: left 0.6s ease;
}

.link-card:hover {
  transform: translateY(-6px) scale(1.02);
  background: var(--glass-hover);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3), 0 0 20px rgba(139, 92, 246, 0.2);
}

.link-card:hover::before {
  left: 200%;
}

.link-image-container {
  margin-right: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.2);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.link-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.5s ease;
}

.link-card:hover .link-image-container {
  transform: scale(1.1) rotate(4deg);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  border-color: rgba(255, 255, 255, 0.6);
}

.link-card:hover .link-image {
  transform: scale(1.15);
}

.link-text-container {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  justify-content: center;
  gap: 0.2rem;
  padding-right: 0.5rem;
}

.link-title {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.link-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.3;

  /* Truncate to exactly 2 lines (max) */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.9;
}

.link-arrow {
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.3s ease;
  font-size: 1.1rem;
}

.link-card:hover .link-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* Footer / Socials */
.social-container {
  display: flex;
  gap: 1.75rem;
  margin-top: 3.5rem;
  opacity: 0;
  animation: slideUpFade 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
  animation-delay: 1.2s;
}

.social-link {
  color: var(--text-muted);
  font-size: 1.75rem;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
}

.social-link:hover {
  color: var(--text-main);
  background: var(--glass-hover);
  transform: translateY(-5px) scale(1.15);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2), 0 0 15px rgba(255, 255, 255, 0.2);
}

/* Responsiveness */
@media (max-width: 480px) {
  .name {
    font-size: 1.75rem;
  }

  .bio {
    font-size: 1rem;
  }

  .link-card {
    padding: 1.1rem 1.25rem;
  }

  .link-title {
    font-size: 1.05rem;
  }

  .link-image-container {
    width: 40px;
    height: 40px;
    margin-right: 1rem;
    border-radius: 10px;
  }
}