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

/* ===== CSS Variables ===== */
:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --glass-bg: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-hover: rgba(255, 255, 255, 0.08);
  --text-primary: #f0f2f5;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --accent-1: #6366f1;
  --accent-2: #8b5cf6;
  --accent-3: #a78bfa;
  --gradient-main: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);
  --gradient-bg: radial-gradient(ellipse at 20% 50%, rgba(99, 102, 241, 0.12) 0%, transparent 50%),
                 radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
                 radial-gradient(ellipse at 50% 80%, rgba(167, 139, 250, 0.08) 0%, transparent 50%);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.15);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ===== Animated Background ===== */
.bg-effects {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.bg-effects::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-bg);
  animation: bgShift 20s ease-in-out infinite alternate;
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  animation: orbFloat 15s ease-in-out infinite;
}

.bg-orb:nth-child(1) {
  width: 400px;
  height: 400px;
  background: rgba(99, 102, 241, 0.15);
  top: -100px;
  left: -100px;
  animation-duration: 18s;
}

.bg-orb:nth-child(2) {
  width: 350px;
  height: 350px;
  background: rgba(139, 92, 246, 0.12);
  bottom: -50px;
  right: -80px;
  animation-duration: 22s;
  animation-delay: -5s;
}

.bg-orb:nth-child(3) {
  width: 250px;
  height: 250px;
  background: rgba(167, 139, 250, 0.1);
  top: 50%;
  left: 60%;
  animation-duration: 16s;
  animation-delay: -8s;
}

@keyframes bgShift {
  0% { opacity: 1; }
  100% { opacity: 0.7; transform: scale(1.05); }
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -40px) scale(1.1); }
  50% { transform: translate(-20px, 20px) scale(0.95); }
  75% { transform: translate(40px, 30px) scale(1.05); }
}

/* ===== Noise Texture Overlay ===== */
.bg-effects::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' 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.03'/%3E%3C/svg%3E");
  opacity: 0.4;
}

/* ===== Main Container ===== */
.main-container {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 60px 24px 80px;
}

/* ===== Hero / Profile Section ===== */
.hero {
  text-align: center;
  margin-bottom: 48px;
  animation: fadeInUp 0.8s ease-out;
}

.avatar-wrapper {
  position: relative;
  display: inline-block;
  margin-bottom: 28px;
}

.avatar-ring {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  padding: 4px;
  background: var(--gradient-main);
  animation: ringPulse 4s ease-in-out infinite;
  box-shadow: var(--shadow-glow);
}

.avatar-ring img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--bg-primary);
  display: block;
}

.status-dot {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
  background: #22c55e;
  border: 3px solid var(--bg-primary);
  border-radius: 50%;
  animation: statusPulse 2s ease-in-out infinite;
}

@keyframes ringPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(99, 102, 241, 0.2); }
  50% { box-shadow: 0 0 40px rgba(99, 102, 241, 0.35); }
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(0.9); }
}

.hero h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 8px;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero .subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 400;
  letter-spacing: 0.02em;
}

/* ===== Section Titles ===== */
.section-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-bottom: 16px;
  padding-left: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--glass-border), transparent);
}

/* ===== Social Links Grid ===== */
.social-section {
  margin-bottom: 40px;
  animation: fadeInUp 0.8s ease-out 0.15s both;
}

.social-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.social-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-primary);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.social-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.03));
  opacity: 0;
  transition: var(--transition);
}

.social-card:hover {
  background: var(--glass-hover);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.social-card:hover::before {
  opacity: 1;
}

.social-card:hover .social-icon {
  transform: scale(1.1);
}

.social-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
  transition: var(--transition);
}

.social-icon.gravatar { background: rgba(26, 159, 228, 0.15); color: #1a9fe4; }
.social-icon.discord { background: rgba(88, 101, 242, 0.15); color: #5865F2; }
.social-icon.twitter { background: rgba(255, 255, 255, 0.08); color: #e7e9ea; }
.social-icon.bluesky { background: rgba(32, 139, 254, 0.15); color: #208bfe; }

.social-info {
  min-width: 0;
}

.social-name {
  font-weight: 500;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.social-handle {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== Project Cards ===== */
.projects-section {
  margin-bottom: 40px;
  animation: fadeInUp 0.8s ease-out 0.3s both;
}

.project-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.project-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-primary);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.project-card::after {
  content: '→';
  position: absolute;
  right: 20px;
  color: var(--text-muted);
  font-size: 1.1rem;
  transition: var(--transition);
  opacity: 0;
  transform: translateX(-8px);
}

.project-card:hover {
  background: var(--glass-hover);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.project-card:hover::after {
  opacity: 1;
  transform: translateX(0);
}

.project-emoji {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  transition: var(--transition);
}

.project-card:hover .project-emoji {
  transform: scale(1.1);
  background: rgba(99, 102, 241, 0.18);
}

.project-info {
  min-width: 0;
  padding-right: 28px;
}

.project-name {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.project-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ===== Friends Section ===== */
.friends-section {
  margin-bottom: 40px;
  animation: fadeInUp 0.8s ease-out 0.45s both;
}

.friends-grid {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  flex-direction: column;
}

.friend-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-primary);
  transition: var(--transition);
  flex: 1;
  min-width: 200px;
  overflow: hidden;
}

.friend-card img {
  max-width: 100%;
  max-height: 120px;
  object-fit: contain;
}

.full-image {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: auto;
  min-height: unset;
}

.full-image img {
  width: 100% !important;
  height: auto !important;
  max-height: 60px !important;
  object-fit: contain;
  margin-bottom: 4px;
  flex-shrink: 0;
  display: block;
}

.full-image img[style*="display: none"] {
  display: none !important;
  margin: 0 !important;
}

.full-image .friend-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0;
  padding: 0;
  line-height: 1.4;
}

.full-image div {
  width: 100%;
}

.friend-card:hover {
  background: var(--glass-hover);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.friend-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--glass-border);
  flex-shrink: 0;
  transition: var(--transition);
}

.friend-card:hover .friend-avatar {
  border-color: var(--accent-3);
}

.friend-name {
  font-weight: 500;
  font-size: 0.9rem;
}

.friend-note {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding-top: 32px;
  border-top: 1px solid var(--glass-border);
  animation: fadeInUp 0.8s ease-out 0.6s both;
}

.footer p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer .heart {
  color: #ef4444;
  display: inline-block;
  animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.15); }
  30% { transform: scale(1); }
  45% { transform: scale(1.1); }
}

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

/* ===== Responsive ===== */
@media (max-width: 560px) {
  .main-container {
    padding: 40px 16px 60px;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .social-grid {
    grid-template-columns: 1fr;
  }

  .avatar-ring {
    width: 110px;
    height: 110px;
  }

  .friends-grid {
    flex-direction: column;
  }

  .friend-card {
    min-width: unset;
  }
}

/* ===== JS Enabled Animations Override ===== */
.js-enabled .hero,
.js-enabled .social-section,
.js-enabled .projects-section,
.js-enabled .friends-section,
.js-enabled .footer {
  animation: none !important;
}

.js-enabled .avatar-ring,
.js-enabled .hero h1,
.js-enabled .hero .subtitle,
.js-enabled .section-title,
.js-enabled .social-card,
.js-enabled .project-card,
.js-enabled .friend-card,
.js-enabled .footer {
  opacity: 0;
}

img.emoji {
  height: 1.5em;
  margin: 0 0.1em;
  vertical-align: -0.3em;
}
