/*
 * Link Building Page - 2027 Design Trends Implementation
 * Combines: Canvas mesh, glassmorphism, bold typography, dark-first, organic shapes
 * Inspired by: apmix.ai + modern web design trends
 */

/* ==========================================
   1. AI-GENERATED & DYNAMIC CONTENT
   Custom properties for dynamic theming
   ========================================== */
:root {
  /* Enhanced deep dark backgrounds (3-6% lightness) */
  --surface-00: #05070C;
  --surface-01: #0A0D12;
  --surface-02: #0F131C;
  --surface-03: #161D2B;
  --surface-04: #1E2636;
  
  /* Luminous accent (cyan for data/tech) */
  --accent-glow: #38BDF8;
  --accent-glow-rgb: 56, 189, 248;
  --accent-soft: #6EE7B7;
  
  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  
  /* Typography - Variable font weights */
  --font-display: 800;
  --font-bold: 700;
  --font-medium: 500;
  
  /* Fluid spacing */
  --space-fluid-sm: clamp(1rem, 2vw, 1.5rem);
  --space-fluid-md: clamp(2rem, 4vw, 4rem);
  --space-fluid-lg: clamp(4rem, 8vw, 8rem);
  
  /* Animation */
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================
   2. DARK MODE FIRST - Deep Backgrounds
   Default to dark theme for link-building
   ========================================== */
.page-link-building {
  background: var(--surface-00);
  color: #e8f0eb;
  position: relative;
  overflow-x: hidden;
}

.page-link-building .page-hero {
  position: relative;
  padding: clamp(3rem, 8vw, 6rem) 0;
  background: linear-gradient(180deg, var(--surface-01) 0%, var(--surface-00) 100%);
}

/* ==========================================
   3. CANVAS MESH BACKGROUND (apmix.ai style)
   Interactive particle mesh with mouse tracking
   ========================================== */
.hero-canvas-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  mask-image: linear-gradient(to bottom, #000 60%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000 60%, transparent 100%);
  z-index: 0;
}

.hero-canvas-container canvas {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0.6;
}

/* Animated gradient overlay */
.hero-gradient-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(56, 189, 248, 0.08) 0%,
    transparent 70%
  );
  animation: pulse-gradient 8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes pulse-gradient {
  0%, 100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.1);
  }
}

/* ==========================================
   4. GLASSMORPHISM & LAYERED DEPTH
   Backdrop blur with transparent overlays
   ========================================== */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  box-shadow: var(--glass-shadow),
              inset 0 1px 1px rgba(255, 255, 255, 0.1);
  transition: all 0.4s var(--ease-smooth);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 100%
  );
  opacity: 0;
  transition: opacity 0.4s var(--ease-smooth);
}

.glass-card:hover {
  transform: translateY(-8px);
  border-color: rgba(56, 189, 248, 0.3);
  box-shadow: 0 16px 48px rgba(56, 189, 248, 0.2),
              var(--glass-shadow);
}

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

/* ==========================================
   5. BOLD TYPOGRAPHY & VARIABLE FONTS
   Oversized display fonts with fluid scaling
   ========================================== */
.page-link-building h1 {
  font-size: clamp(2.5rem, 8vw, 6rem);
  font-weight: var(--font-display);
  line-height: 1.05;
  letter-spacing: -0.04em;
  background: linear-gradient(
    135deg,
    #ffffff 0%,
    #a0afa3 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: clamp(1rem, 3vw, 2rem);
  position: relative;
  z-index: 1;
}

/* Kinetic typography - text that reacts */
.page-link-building h1 span {
  display: inline-block;
  transition: transform 0.3s var(--ease-spring);
}

.page-link-building h1:hover span {
  transform: translateY(-4px);
}

.page-link-building h1 span:nth-child(2n) {
  color: var(--accent-glow);
  -webkit-text-fill-color: var(--accent-glow);
}

.hero-lead {
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.6;
  color: #a0afa3;
  max-width: 42em;
  font-weight: var(--font-medium);
  position: relative;
  z-index: 1;
}

/* ==========================================
   6. MICRO-INTERACTIONS & ADVANCED ANIMATIONS
   Physics-based interactions and scroll triggers
   ========================================== */

/* Magnetic button effect */
.btn-magnetic {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  padding: clamp(0.875rem, 2vw, 1.25rem) clamp(1.5rem, 3vw, 2.5rem);
  background: linear-gradient(135deg, var(--accent-glow) 0%, #0ea5e9 100%);
  color: var(--surface-00);
  border-radius: 999px;
  border: none;
  font-weight: var(--font-bold);
  font-size: clamp(0.875rem, 1.5vw, 1rem);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s var(--ease-smooth), box-shadow 0.2s;
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.3);
}

.btn-magnetic::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #ffffff 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s;
}

.btn-magnetic:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(56, 189, 248, 0.5);
}

.btn-magnetic:hover::before {
  opacity: 0.2;
}

.btn-magnetic:active {
  transform: translateY(0);
}

/* Arrow animation */
.btn-magnetic svg {
  width: 20px;
  height: 20px;
  transition: transform 0.3s var(--ease-spring);
}

.btn-magnetic:hover svg {
  transform: translateX(4px);
}

/* ==========================================
   7. ORGANIC SHAPES & FLUID GRIDS
   Bento box layout with curved borders
   ========================================== */
.guide-flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: clamp(1rem, 3vw, 2rem);
  padding: var(--space-fluid-md) 0;
}

.guide-panel {
  background: var(--surface-02);
  border-radius: 32px;
  padding: clamp(2rem, 4vw, 3rem);
  position: relative;
  overflow: hidden;
  transition: all 0.4s var(--ease-smooth);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Blob shapes */
.guide-panel::after {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  background: radial-gradient(
    circle,
    rgba(56, 189, 248, 0.15) 0%,
    transparent 70%
  );
  border-radius: 50%;
  top: -150px;
  right: -150px;
  transition: transform 0.6s var(--ease-smooth);
  pointer-events: none;
}

.guide-panel:hover::after {
  transform: scale(1.5) translate(-20px, 20px);
}

.guide-panel:hover {
  transform: translateY(-4px);
  border-color: rgba(56, 189, 248, 0.2);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

/* Icon wells with glow */
.guide-ico {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--surface-03), var(--surface-04));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  position: relative;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.2);
}

.guide-ico svg {
  width: 32px;
  height: 32px;
  color: var(--accent-glow);
  filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.6));
}

/* Number badges */
.guide-num {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: var(--font-bold);
  letter-spacing: 0.1em;
  color: var(--accent-glow);
  margin-bottom: 0.5rem;
  opacity: 0.8;
}

/* ==========================================
   8. LAYERED DEPTH WITH SHADOWS
   Multiple shadow layers for depth
   ========================================== */
.card-elevated {
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.2),
    0 4px 8px rgba(0, 0, 0, 0.15),
    0 8px 16px rgba(0, 0, 0, 0.1),
    0 16px 32px rgba(0, 0, 0, 0.05);
}

.card-elevated:hover {
  box-shadow:
    0 2px 6px rgba(56, 189, 248, 0.15),
    0 8px 16px rgba(56, 189, 248, 0.1),
    0 16px 32px rgba(56, 189, 248, 0.05),
    0 32px 64px rgba(0, 0, 0, 0.2);
}

/* ==========================================
   9. SCROLL-TRIGGERED ANIMATIONS
   Fade-in and slide animations on scroll
   ========================================== */
.fade-in-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s var(--ease-smooth),
              transform 0.8s var(--ease-smooth);
}

.fade-in-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger animation delays */
.fade-in-up:nth-child(1) { transition-delay: 0.1s; }
.fade-in-up:nth-child(2) { transition-delay: 0.2s; }
.fade-in-up:nth-child(3) { transition-delay: 0.3s; }
.fade-in-up:nth-child(4) { transition-delay: 0.4s; }

/* ==========================================
   10. PERFORMANCE-FIRST & ACCESSIBILITY
   GPU-accelerated, reduced motion support
   ========================================== */

/* Force GPU acceleration */
.glass-card,
.guide-panel,
.btn-magnetic {
  will-change: transform;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .btn-magnetic:hover,
  .glass-card:hover,
  .guide-panel:hover {
    transform: none;
  }
}

/* Focus visible for keyboard navigation */
.btn-magnetic:focus-visible,
.glass-card:focus-visible {
  outline: 3px solid var(--accent-glow);
  outline-offset: 4px;
}

/* ==========================================
   RESPONSIVE DESIGN
   Mobile-first with fluid scaling
   ========================================== */
@media (max-width: 768px) {
  .guide-flow {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .guide-panel {
    border-radius: 24px;
    padding: 2rem 1.5rem;
  }
  
  .page-link-building h1 {
    font-size: clamp(2rem, 12vw, 3rem);
  }
  
  .hero-lead {
    font-size: 1rem;
  }
  
  .btn-magnetic {
    padding: 1rem 1.5rem;
    width: 100%;
    justify-content: center;
  }
}

/* ==========================================
   CUSTOM CURSOR (PREMIUM INTERACTION)
   Custom cursor with magnetic effect
   ========================================== */
.custom-cursor {
  width: 20px;
  height: 20px;
  border: 2px solid var(--accent-glow);
  border-radius: 50%;
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.2s, height 0.2s, border-color 0.2s;
  mix-blend-mode: difference;
}

.custom-cursor.is-hover {
  width: 60px;
  height: 60px;
  border-color: rgba(56, 189, 248, 0.5);
}

/* Hide default cursor on interactive elements */
.page-link-building .btn-magnetic,
.page-link-building .glass-card,
.page-link-building a {
  cursor: none;
}

/* ==========================================
   NEON GLOW EFFECTS
   Accent highlights with glow
   ========================================== */
.glow-text {
  color: var(--accent-glow);
  text-shadow: 0 0 20px rgba(56, 189, 248, 0.6),
               0 0 40px rgba(56, 189, 248, 0.4),
               0 0 60px rgba(56, 189, 248, 0.2);
  animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% {
    opacity: 1;
    text-shadow: 0 0 20px rgba(56, 189, 248, 0.6),
                 0 0 40px rgba(56, 189, 248, 0.4),
                 0 0 60px rgba(56, 189, 248, 0.2);
  }
  50% {
    opacity: 0.8;
    text-shadow: 0 0 30px rgba(56, 189, 248, 0.8),
                 0 0 50px rgba(56, 189, 248, 0.6),
                 0 0 70px rgba(56, 189, 248, 0.3);
  }
}

/* Live indicator pulse (like apmix.ai) */
.status-dot {
  position: relative;
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--accent-glow);
  border-radius: 50%;
}

.status-dot::before {
  content: '';
  position: absolute;
  inset: -4px;
  border: 2px solid var(--accent-glow);
  border-radius: 50%;
  animation: ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
  opacity: 0.75;
}

@keyframes ping {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  75%, 100% {
    transform: scale(2);
    opacity: 0;
  }
}
