/* =========================
   Links Page Styles
   Linktree-style with branding
   ========================= */

/* Reset main container padding for full-bleed hero */
body.links #main.links-main {
  padding: 0;
  max-width: none;
}

/* Hero Section */
.links-hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  padding: 50px 0 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
  margin: 0;
  width: 100%;
}

.links-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="%236c2bd9" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="%233b82f6" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="%236c2bd9" opacity="0.05"/><circle cx="10" cy="60" r="0.5" fill="%233b82f6" opacity="0.05"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  opacity: 0.3;
  animation: grain 8s steps(10) infinite;
}

.links-hero::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
  animation: shimmer 3s ease-in-out infinite;
}

@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-5%, -10%); }
  20% { transform: translate(-15%, 5%); }
  30% { transform: translate(7%, -25%); }
  40% { transform: translate(-5%, 25%); }
  50% { transform: translate(-15%, 10%); }
  60% { transform: translate(15%, 0%); }
  70% { transform: translate(0%, 15%); }
  80% { transform: translate(3%, 35%); }
  90% { transform: translate(-10%, 10%); }
}

@keyframes shimmer {
  0% { transform: translateX(-100%) skewX(-15deg); }
  100% { transform: translateX(200%) skewX(-15deg); }
}

.links-hero .wrap {
  position: relative;
  z-index: 1;
  max-width: var(--container-max, 1200px);
  margin: 0 auto;
  padding: 0 var(--container-pad, 24px);
}

/* Profile Image */
.profile-image-wrapper {
  position: relative;
  display: inline-block;
  margin-bottom: 16px;
}

.profile-image {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.3);
  object-fit: cover;
  position: relative;
  z-index: 2;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  animation: profileFloat 3s ease-in-out infinite;
}

.profile-image-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 70%);
  animation: glowPulse 2s ease-in-out infinite;
  z-index: 1;
}

@keyframes profileFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.6; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 0.8; transform: translate(-50%, -50%) scale(1.1); }
}

/* Hero Text */
.links-hero h1 {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 800;
  color: #fff;
  margin: 0 0 12px 0;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
  animation: titleGlow 3s ease-in-out infinite;
}

@keyframes titleGlow {
  0%, 100% { text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3), 0 0 30px rgba(255, 255, 255, 0.1); }
  50% { text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3), 0 0 40px rgba(255, 255, 255, 0.2); }
}

.hero-subtitle {
  font-size: clamp(14px, 1.8vw, 18px);
  color: rgba(255, 255, 255, 0.9);
  margin: 0 0 20px 0;
  font-weight: 400;
}

.hero-divider {
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  margin: 0 auto;
  border-radius: 2px;
  animation: expandLine 1s ease-out;
}

@keyframes expandLine {
  0% { width: 0; opacity: 0; }
  100% { width: 60px; opacity: 1; }
}

/* Floating particles */
.links-hero .particle {
  position: absolute;
  width: 6px;
  height: 6px;
  background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0.2) 70%, transparent 100%);
  border-radius: 50%;
  animation: float 8s ease-in-out infinite, pulse 2s ease-in-out infinite;
  box-shadow: 0 0 10px rgba(255,255,255,0.5);
}

.links-hero .particle:nth-child(1) { top: 20%; left: 10%; animation-delay: 0s; animation-duration: 6s; }
.links-hero .particle:nth-child(2) { top: 60%; left: 20%; animation-delay: 1s; animation-duration: 8s; width: 8px; height: 8px; }
.links-hero .particle:nth-child(3) { top: 30%; left: 80%; animation-delay: 2s; animation-duration: 7s; }
.links-hero .particle:nth-child(4) { top: 70%; left: 70%; animation-delay: 3s; animation-duration: 9s; width: 5px; height: 5px; }
.links-hero .particle:nth-child(5) { top: 40%; left: 50%; animation-delay: 4s; animation-duration: 6.5s; width: 10px; height: 10px; }
.links-hero .particle:nth-child(6) { top: 15%; left: 60%; animation-delay: 0.5s; animation-duration: 7.5s; }
.links-hero .particle:nth-child(7) { top: 80%; left: 40%; animation-delay: 1.5s; animation-duration: 8.5s; width: 7px; height: 7px; }
.links-hero .particle:nth-child(8) { top: 50%; left: 15%; animation-delay: 2.5s; animation-duration: 6s; }
.links-hero .particle:nth-child(9) { top: 25%; left: 85%; animation-delay: 3.5s; animation-duration: 9s; width: 9px; height: 9px; }
.links-hero .particle:nth-child(10) { top: 65%; left: 55%; animation-delay: 4.5s; animation-duration: 7s; }

@keyframes float {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(20px, -30px) rotate(90deg); }
  50% { transform: translate(-15px, -50px) rotate(180deg); }
  75% { transform: translate(-25px, -20px) rotate(270deg); }
}

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

/* Links Container */
.links-container {
  padding: 40px var(--container-pad, 24px) 20px;
  max-width: 600px;
  margin: 0 auto;
}

/* Reduce footer spacing on links page */
body.links .site-footer {
  margin-top: 40px;
}

.links-wrapper {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Link Cards */
.link-item {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s ease-out forwards;
}

.link-item:nth-child(1) { animation-delay: 0.1s; }
.link-item:nth-child(2) { animation-delay: 0.2s; }
.link-item:nth-child(3) { animation-delay: 0.3s; }
.link-item:nth-child(4) { animation-delay: 0.4s; }

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

.link-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: var(--surface);
  border: 2px solid var(--grey-300);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text);
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.link-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transition: left 0.5s ease;
}

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

.link-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: 0 8px 24px rgba(108, 43, 217, 0.2);
}

.link-card:active {
  transform: translateY(-2px);
}

/* Link Icon */
.link-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--primary-weak);
  color: var(--primary);
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.link-card-linkedin .link-icon {
  background: linear-gradient(135deg, #0077b5 0%, #00a0dc 100%);
  color: #fff;
}

.link-card-newsletter .link-icon {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: #fff;
}

.link-card:hover .link-icon {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 4px 12px rgba(108, 43, 217, 0.3);
}

/* Link Content */
.link-content {
  flex: 1;
  min-width: 0;
}

.link-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 4px 0;
  color: var(--text);
  transition: color 0.3s ease;
}

.link-card:hover .link-title {
  color: var(--primary);
}

.link-description {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
  line-height: 1.4;
}

/* Link Arrow */
.link-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--grey-300);
  transition: all 0.3s ease;
  flex-shrink: 0;
}

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

/* Ripple Effect */
.link-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(108, 43, 217, 0.3);
  transform: scale(0);
  pointer-events: none;
  transition: transform 0.6s ease, opacity 0.6s ease;
}

.link-card:active .link-ripple {
  transform: scale(4);
  opacity: 0;
}

/* Responsive */
@media (max-width: 640px) {
  .links-hero {
    padding: 40px 0 30px;
  }

  .profile-image {
    width: 80px;
    height: 80px;
  }

  .profile-image-glow {
    width: 100px;
    height: 100px;
  }

  .links-container {
    padding: 30px var(--container-pad, 24px) 20px;
  }

  .link-card {
    padding: 16px 20px;
  }

  .link-icon {
    width: 44px;
    height: 44px;
  }

  .link-title {
    font-size: 16px;
  }

  .link-description {
    font-size: 13px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .links-hero .particle,
  .profile-image,
  .profile-image-glow,
  .link-card,
  .link-icon,
  .link-arrow {
    animation: none !important;
    transition: none !important;
  }

  .link-card:hover {
    transform: none;
  }

  .link-item {
    opacity: 1;
    transform: none;
    animation: none;
  }
}