/* ==========================================================================
   Antigravity Linktree Portal - Stylesheet
   Theme: Zero-Gravity Space glassmorphic portal
   ========================================================================== */

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

/* Reset and Core Variables */
:root {
  --bg-dark: #040613;
  --bg-gradient: radial-gradient(circle at 50% 30%, #0d1235 0%, #040613 100%);
  
  /* Glassmorphism Variables */
  --panel-glass: rgba(10, 14, 38, 0.45);
  --card-glass: rgba(18, 24, 58, 0.35);
  --card-hover-glass: rgba(28, 36, 82, 0.6);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.22);
  
  /* Neon Accents */
  --neon-violet: #8b5cf6;
  --neon-violet-glow: rgba(139, 92, 246, 0.45);
  --neon-cyan: #06b6d4;
  --neon-cyan-glow: rgba(6, 182, 212, 0.45);
  --neon-pink: #ec4899;
  --neon-pink-glow: rgba(236, 72, 153, 0.45);
  --neon-emerald: #10b981;
  --neon-emerald-glow: rgba(16, 185, 129, 0.45);
  --neon-amber: #f59e0b;
  --neon-amber-glow: rgba(245, 158, 11, 0.45);

  /* Typography */
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  
  /* Text */
  --text-primary: #f3f4f6;
  --text-secondary: #e5e7eb;
  --text-muted: #9ca3af;
  --text-dark: #1f2937;

  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

/* Base Document Styles */
body {
  font-family: var(--font-body);
  background: var(--bg-dark);
  background-image: var(--bg-gradient);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  padding: 2rem 1rem;
  position: relative;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(4, 6, 19, 0.8);
}
::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.3);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(139, 92, 246, 0.6);
}

/* Starfield Background Layer */
#starfield {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
}

/* Dynamic Ambient Glows */
.ambient-glow {
  position: absolute;
  width: 50vw;
  height: 50vw;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(100px);
  opacity: 0.12;
  z-index: 1;
}
.glow-violet {
  top: -10%;
  left: -10%;
  background: var(--neon-violet);
}
.glow-cyan {
  bottom: -10%;
  right: -10%;
  background: var(--neon-cyan);
}

/* ==========================================================================
   Layout Containers
   ========================================================================== */

/* Main Dashboard Card Wrapper */
.portal-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 680px;
  background: var(--panel-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: 28px;
  padding: 3rem 2.5rem;
  box-shadow: 0 24px 64px -12px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 2.2rem;
  transition: border-color var(--transition-slow), box-shadow var(--transition-slow);
}

.portal-card::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  bottom: -1px;
  border-radius: 28px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.01) 50%, rgba(139,92,246,0.15) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: -1;
}

/* ==========================================================================
   Header Profile Section
   ========================================================================== */
header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
}

/* Header Action Buttons (Zero-Gravity Toggle) */
.header-actions {
  position: absolute;
  top: -10px;
  right: -10px;
  display: flex;
  gap: 0.5rem;
}

.gravity-toggle-btn {
  background: var(--card-glass);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 0.5rem 0.9rem;
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all var(--transition-normal);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.gravity-toggle-btn i {
  font-size: 0.8rem;
  transition: transform var(--transition-normal);
}

.gravity-toggle-btn:hover {
  background: var(--card-hover-glass);
  border-color: var(--neon-cyan);
  color: var(--text-primary);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.25);
  transform: translateY(-1px);
}

.gravity-toggle-btn.active {
  background: rgba(6, 182, 212, 0.15);
  border-color: var(--neon-cyan);
  color: var(--text-primary);
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.4);
}

.gravity-toggle-btn.active i {
  transform: rotate(180deg);
  color: var(--neon-cyan);
}

/* Avatar Core Ring */
.avatar-container {
  position: relative;
  margin-bottom: 1.2rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.avatar-ring {
  position: absolute;
  width: 106px;
  height: 106px;
  border-radius: 50%;
  border: 1.5px dashed rgba(6, 182, 212, 0.5);
  animation: rotate-dashed 20s linear infinite;
}

.avatar-ring-outer {
  position: absolute;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  border: 1px solid rgba(139, 92, 246, 0.25);
  animation: pulse-ring 4s ease-in-out infinite;
}

.avatar-img {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border-glass);
  z-index: 2;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  transition: transform var(--transition-normal), border-color var(--transition-normal);
}

.avatar-container:hover .avatar-img {
  transform: scale(1.05) rotate(3deg);
  border-color: rgba(6, 182, 212, 0.4);
}

/* Title & Subtitle */
.profile-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
  background: linear-gradient(135deg, #ffffff 0%, #a5b4fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--neon-emerald);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.status-dot {
  width: 6px;
  height: 6px;
  background: var(--neon-emerald);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--neon-emerald);
  animation: pulse-glow 2s infinite;
}

.profile-bio {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 440px;
  line-height: 1.5;
}

/* ==========================================================================
   Interactive Links Section
   ========================================================================== */
.links-grid {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

/* Link Card Base Styling */
.link-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.4rem;
  background: var(--card-glass);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  text-decoration: none;
  color: var(--text-secondary);
  transition: all var(--transition-normal);
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.link-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--neon-violet);
  transition: width var(--transition-normal);
  z-index: 2;
}

.link-card-content {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  z-index: 3;
}

.link-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  color: var(--text-primary);
  transition: all var(--transition-normal);
}

.link-card i.link-icon {
  font-size: 1.15rem;
}

.link-text-container {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  text-align: left;
}

.link-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.link-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.link-arrow {
  font-size: 0.95rem;
  color: var(--text-muted);
  transition: transform var(--transition-normal), color var(--transition-normal);
  z-index: 3;
}

/* Badges on Links */
.link-badge {
  position: absolute;
  top: 10px;
  right: 40px;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  z-index: 3;
}

.badge-new {
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: var(--neon-cyan);
}

.badge-hot {
  background: rgba(236, 72, 153, 0.15);
  border: 1px solid rgba(236, 72, 153, 0.3);
  color: var(--neon-pink);
}

/* Hover States & Custom Accent Coloring */
.link-card:hover {
  background: var(--card-hover-glass);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.link-card:hover .link-arrow {
  transform: translateX(4px);
  color: var(--text-primary);
}

/* Custom border glow left edge on link categories */
.link-code::before { background: var(--neon-cyan); }
.link-code:hover { box-shadow: 0 0 15px rgba(6, 182, 212, 0.15); border-color: rgba(6, 182, 212, 0.3); }
.link-code:hover .link-icon-wrapper { border-color: var(--neon-cyan); color: var(--neon-cyan); box-shadow: 0 0 10px rgba(6, 182, 212, 0.3); }

.link-docs::before { background: var(--neon-violet); }
.link-docs:hover { box-shadow: 0 0 15px rgba(139, 92, 246, 0.15); border-color: rgba(139, 92, 246, 0.3); }
.link-docs:hover .link-icon-wrapper { border-color: var(--neon-violet); color: var(--neon-violet); box-shadow: 0 0 10px rgba(139, 92, 246, 0.3); }

.link-community::before { background: var(--neon-pink); }
.link-community:hover { box-shadow: 0 0 15px rgba(236, 72, 153, 0.15); border-color: rgba(236, 72, 153, 0.3); }
.link-community:hover .link-icon-wrapper { border-color: var(--neon-pink); color: var(--neon-pink); box-shadow: 0 0 10px rgba(236, 72, 153, 0.3); }

.link-github::before { background: #f3f4f6; }
.link-github:hover { box-shadow: 0 0 15px rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.3); }
.link-github:hover .link-icon-wrapper { border-color: #f3f4f6; color: #f3f4f6; box-shadow: 0 0 10px rgba(255, 255, 255, 0.2); }

/* ==========================================================================
   Native Sponsor Spotlight (Ad Space)
   ========================================================================== */
.sponsor-deck {
  border-top: 1px solid var(--border-glass);
  padding-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sponsor-title {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sponsor-title::after {
  content: '';
  flex-grow: 1;
  height: 1px;
  background: linear-gradient(to right, var(--border-glass), transparent);
}

.sponsor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.sponsor-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card-glass);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  transition: all var(--transition-normal);
  height: 100%;
}

.sponsor-img-container {
  width: 100%;
  height: 110px;
  overflow: hidden;
  position: relative;
  background: rgba(0, 0, 0, 0.2);
}

.sponsor-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow) ease-out;
}

.sponsor-tag {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(4, 6, 19, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid var(--border-glass);
  font-size: 0.55rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  z-index: 2;
}

.sponsor-details {
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex-grow: 1;
  text-align: left;
}

.sponsor-name {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sponsor-name i {
  font-size: 0.72rem;
  opacity: 0.5;
  transition: opacity var(--transition-normal), transform var(--transition-normal);
}

.sponsor-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Sponsor Hover States */
.sponsor-card:hover {
  background: var(--card-hover-glass);
  transform: translateY(-2px);
  border-color: var(--border-hover);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.sponsor-card:hover .sponsor-img {
  transform: scale(1.04);
}

.sponsor-card:hover .sponsor-name i {
  opacity: 1;
  color: var(--neon-cyan);
  transform: translate(1px, -1px);
}

/* ==========================================================================
   Footer Section
   ========================================================================== */
footer {
  border-top: 1px solid var(--border-glass);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.footer-brand {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: color var(--transition-normal);
}

.footer-brand:hover {
  color: var(--neon-cyan);
}

.footer-links {
  display: flex;
  gap: 1rem;
}

.footer-link {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition-normal);
}

.footer-link:hover {
  color: var(--text-primary);
}

/* ==========================================================================
   Interactive Keyframe Animations
   ========================================================================== */
@keyframes rotate-dashed {
  100% { transform: rotate(360deg); }
}

@keyframes pulse-ring {
  0%, 100% { transform: scale(1); opacity: 0.25; }
  50% { transform: scale(1.06); opacity: 0.45; }
}

@keyframes pulse-glow {
  0%, 100% { transform: scale(1); box-shadow: 0 0 8px rgba(16, 185, 129, 0.5); }
  50% { transform: scale(1.15); box-shadow: 0 0 16px rgba(16, 185, 129, 0.8); }
}

/* Float Staggering Utilities */
.float-delayed-1 {
  animation: float-base 8s ease-in-out infinite;
}
.float-delayed-2 {
  animation: float-base 9s ease-in-out infinite;
  animation-delay: 1.8s;
}
.float-delayed-3 {
  animation: float-base 7.5s ease-in-out infinite;
  animation-delay: 3.2s;
}
.float-delayed-4 {
  animation: float-base 10s ease-in-out infinite;
  animation-delay: 0.7s;
}

@keyframes float-base {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-6px); }
}

/* ==========================================================================
   Zero-Gravity Simulation (JS-Driven Active Mode Styles)
   ========================================================================== */
.portal-card.zero-gravity-active {
  box-shadow: 0 32px 80px rgba(6, 182, 212, 0.12);
  border-color: rgba(6, 182, 212, 0.2);
}

/* When Zero-Gravity is active, we disable standard hover transitions for links
   to allow JavaScript coordinates to take precedence seamlessly */
.portal-card.zero-gravity-active .link-card {
  transition: border-color var(--transition-normal), background var(--transition-normal);
  cursor: grab;
}

.portal-card.zero-gravity-active .link-card:active {
  cursor: grabbing;
}

/* ==========================================================================
   Responsive Viewports (Mobile & Tablet Optimization)
   ========================================================================== */
@media (max-width: 640px) {
  body {
    padding: 1rem 0.5rem;
  }
  
  .portal-card {
    padding: 2.2rem 1.4rem;
    gap: 1.8rem;
    border-radius: 20px;
  }
  
  .portal-card::before {
    border-radius: 20px;
  }

  .header-actions {
    position: static;
    margin-top: -0.5rem;
    margin-bottom: 0.8rem;
    justify-content: center;
  }

  .profile-title {
    font-size: 1.65rem;
  }

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

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

  .link-subtitle {
    font-size: 0.75rem;
  }

  .sponsor-grid {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }

  .sponsor-img-container {
    height: 120px;
  }

  footer {
    flex-direction: column;
    gap: 0.8rem;
    text-align: center;
  }
}
