/* Creative Linktree Layout & Core Styles - Journey Map Edition */
:root {
  --links-bg: hsl(220 25% 8%); /* Dark starry background */
  --links-bg-alt: hsl(220 20% 12%); /* Dark helper bg */
  --links-surface: rgba(241, 245, 249, 0.96); /* Beautiful light silver-grey card surface */
  --links-surface-solid: hsl(220 12% 92%);
  --links-border: rgba(148, 163, 184, 0.22);
  --links-border-hover: rgba(100, 116, 139, 0.45);
  --links-text: hsl(220 30% 12%); /* Charcoal text inside the card */
  --links-text-secondary: hsl(220 15% 36%);
  --links-text-tertiary: hsl(220 15% 50%);
  --links-primary: hsl(220 25% 15%);
  --links-primary-hover: hsl(220 30% 8%);
  --links-primary-subtle: rgba(15, 23, 42, 0.05);
  --links-accent: hsl(260 20% 50%);
  --links-success: hsl(145 65% 36%);
  --links-card-shadow: 0 20px 50px rgba(0, 0, 0, 0.35), 0 4px 12px rgba(0, 0, 0, 0.15);
  --links-card-shadow-hover: 0 30px 70px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(0, 0, 0, 0.2);
  
  --gradient-text: linear-gradient(135deg, hsl(220 35% 12%) 0%, hsl(220 15% 45%) 100%);
  --gradient-card: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(240, 242, 245, 0.8) 100%);
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
  background: var(--links-bg); /* Dark starry background */
  color: var(--links-text);
  position: relative;
}

#interactiveCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: all;
}

.links-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 500px;
  margin: 2rem auto;
  padding: 1rem;
  box-sizing: border-box;
}

/* ----------------------------------------
   The Iridescent Oil-Slick Wrapper (Flowing rainbow smoke effect)
   ---------------------------------------- */
.card-glow-wrapper {
  position: relative;
  padding: 2px; /* Border thickness */
  border-radius: 24px;
  /* Premium metallic silver border with iridescent rainbow pearl sweep */
  background: linear-gradient(135deg, 
    #ffffff 0%, 
    #cbd5e1 20%, 
    rgba(255, 180, 255, 0.3) 35%, 
    rgba(180, 240, 255, 0.3) 50%, 
    rgba(255, 255, 255, 0.7) 65%, 
    #94a3b8 80%, 
    #cbd5e1 100%
  );
  box-shadow: 
    var(--links-card-shadow),
    0 0 60px rgba(186, 85, 211, 0.08),
    0 0 80px rgba(135, 206, 250, 0.06);
  backdrop-filter: blur(20px);
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease;
  overflow: visible; /* Let floating stars peak out! */
  z-index: 1;
}

/* Slow flowing oil-slick / smoke iridescent glow — does NOT spin */
.card-glow-wrapper::before {
  content: '';
  position: absolute;
  width: 120%;
  height: 120%;
  top: -10%;
  left: -10%;
  background: 
    radial-gradient(ellipse 60% 50% at 15% 20%, rgba(255, 182, 193, 0.55), transparent 60%),
    radial-gradient(ellipse 50% 60% at 85% 25%, rgba(135, 206, 250, 0.5), transparent 60%),
    radial-gradient(ellipse 55% 45% at 50% 80%, rgba(186, 85, 211, 0.45), transparent 55%),
    radial-gradient(ellipse 45% 55% at 20% 70%, rgba(152, 251, 152, 0.4), transparent 55%),
    radial-gradient(ellipse 50% 50% at 80% 75%, rgba(255, 224, 130, 0.4), transparent 55%);
  animation: oilSlickFlow 10s ease-in-out infinite alternate;
  z-index: -2;
  filter: blur(28px);
  opacity: 0.7;
}

/* Flowing oil-slick position shift — smooth, dreamy, no spinning */
@keyframes oilSlickFlow {
  0% {
    transform: translate(0%, 0%) scale(1);
    filter: blur(28px) hue-rotate(0deg);
  }
  33% {
    transform: translate(2%, -1.5%) scale(1.02);
    filter: blur(30px) hue-rotate(15deg);
  }
  66% {
    transform: translate(-1.5%, 2%) scale(0.98);
    filter: blur(26px) hue-rotate(-10deg);
  }
  100% {
    transform: translate(1%, -0.5%) scale(1.01);
    filter: blur(28px) hue-rotate(20deg);
  }
}

/* Holographic radial shine and main surface mask */
.card-glow-wrapper::after {
  content: '';
  position: absolute;
  inset: 2px;
  background: 
    radial-gradient(circle 250px at var(--shine-x, 50%) var(--shine-y, 50%), rgba(255, 255, 255, 0.06), transparent 80%),
    var(--links-surface);
  border-radius: 22px;
  z-index: -1;
  transition: background 0.15s ease;
  /* Subtle inner oil-sheen overlay on the card surface */
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.main-card {
  background: transparent; /* Clear background to reveal the ::after shiny mask beneath */
  border-radius: 22px;
  padding: 2.5rem 1.5rem 1.5rem;
  position: relative;
  z-index: 2;
  overflow: hidden; /* Clip the oil overlay to card bounds */
}

/* Iridescent oil-film overlay — visible rainbow sheen ON the white card surface */
.oil-film-overlay {
  position: absolute;
  inset: 0;
  border-radius: 22px;
  pointer-events: none;
  z-index: 3;
  background:
    radial-gradient(ellipse 70% 40% at 20% 15%, rgba(255, 182, 193, 0.12), transparent 55%),
    radial-gradient(ellipse 50% 55% at 80% 20%, rgba(135, 206, 250, 0.12), transparent 55%),
    radial-gradient(ellipse 55% 50% at 55% 85%, rgba(186, 85, 211, 0.10), transparent 50%),
    radial-gradient(ellipse 45% 40% at 15% 75%, rgba(152, 251, 152, 0.09), transparent 50%),
    radial-gradient(ellipse 40% 45% at 85% 70%, rgba(255, 224, 130, 0.10), transparent 50%);
  animation: oilFilmShift 14s ease-in-out infinite alternate;
  mix-blend-mode: multiply;
  opacity: 0.9;
}

@keyframes oilFilmShift {
  0% {
    transform: translate(0, 0) scale(1);
    filter: hue-rotate(0deg);
  }
  50% {
    transform: translate(3%, -2%) scale(1.03);
    filter: hue-rotate(25deg);
  }
  100% {
    transform: translate(-2%, 1.5%) scale(0.97);
    filter: hue-rotate(-15deg);
  }
}

.controls-bar {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 10px;
  z-index: 10;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.8);
  color: var(--links-text);
  font-size: 0;
  transition: all 0.2s ease;
  border: 1px solid var(--links-border);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  position: relative;
  z-index: 10;
}

.icon-btn svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.icon-btn:hover {
  transform: scale(1.12);
  background: var(--links-primary);
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.25);
  border-color: transparent;
}

/* ----------------------------------------
   Profile Header & 3D Pop-Out Avatar (popping over the edge of the circle)
   ---------------------------------------- */
.profile-header {
  text-align: center;
}

.avatar-wrapper {
  position: relative;
  width: 112px;
  height: 112px;
  margin: 0 auto 1.4rem;
  overflow: visible; /* Let head pop out! */
  perspective: 800px;
}

.avatar-coin {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  cursor: grab;
  user-select: none;
}

.avatar-coin:active {
  cursor: grabbing;
}

.coin-side {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-style: preserve-3d;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.coin-front {
  z-index: 2;
  transform: rotateY(0deg);
}

.coin-back {
  transform: rotateY(180deg);
  z-index: 1;
}

.avatar-glow {
  position: absolute;
  inset: 0px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffffff, #cbd5e1, rgba(255, 180, 255, 0.2), rgba(180, 240, 255, 0.2), #cbd5e1, #ffffff);
  filter: blur(10px);
  opacity: 0.6;
  animation: spin 8s linear infinite;
  z-index: 0;
  pointer-events: none;
}

/* The Background Circle Bezel Rim (Adam's head pops over this) */
.avatar-circle-backdrop,
.avatar-circle-backdrop-back {
  position: absolute;
  bottom: 0;
  left: 5%;
  width: 90%;
  height: 90%;
  border-radius: 50%;
  background: linear-gradient(135deg, hsl(220 20% 6%) 0%, hsl(220 25% 10%) 100%);
  border: 3.5px solid transparent;
  background-image: linear-gradient(hsl(220 25% 8%), hsl(220 25% 8%)), 
                    linear-gradient(135deg, #ffffff 0%, #cbd5e1 20%, #f8fafc 40%, #64748b 60%, #e2e8f0 80%, #94a3b8 100%);
  background-origin: border-box;
  background-clip: content-box, border-box;
  z-index: 1;
  box-shadow: 
    0 0 0 1px rgba(255, 255, 255, 0.15),
    inset 0 4px 10px rgba(0, 0, 0, 0.75),
    0 8px 20px rgba(0, 0, 0, 0.45);
}

/* Transparent cut-out photo of Adam popping dynamically out of bounds */
.avatar-3d-img,
.avatar-3d-img-back {
  position: absolute;
  bottom: 4px;
  left: 50%;
  width: 96%;
  height: 114%;
  object-fit: contain;
  z-index: 2;
  transform: translateX(-50%) scale(1.05);
  transform-origin: bottom center;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.35s ease;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.35));
}

.avatar-wrapper:hover .avatar-3d-img,
.avatar-wrapper:hover .avatar-3d-img-back {
  /* Dynamic 3D Pop Out Lift */
  transform: translateX(-50%) scale(1.16) translateY(-6px);
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.55));
}

/* Clean, static, professional status badge without click pointers */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  background: rgba(52, 211, 153, 0.08);
  color: var(--links-success);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 0.75rem;
  border: 1px solid rgba(52, 211, 153, 0.15);
  user-select: none;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--links-success);
  animation: pulseEffect 1.8s infinite;
}

@keyframes pulseEffect {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.profile-info h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 4px;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.profile-info .tagline {
  color: var(--links-text);
  font-size: 0.96rem;
  font-weight: 600;
  margin: 0;
}

.profile-info .location {
  font-size: 0.78rem;
  color: var(--links-text-secondary);
  margin: 4px 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--links-primary-subtle); border-radius: 99px; }

/* ----------------------------------------
   Responsive Adjustments
   ---------------------------------------- */
@media (max-width: 480px) {
  .links-wrapper { padding: 0.5rem; }
  .main-card { padding: 2.5rem 1rem 1rem; }
}

/* ----------------------------------------
   Rocket Launch Unlocking Screen
   ---------------------------------------- */
.lock-screen-overlay {
  position: fixed;
  inset: 0;
  background: hsl(220 25% 8%); /* Clean solid dark space background for launch transition */
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Transition out smoothly */
  transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
  overflow: hidden;
  /* Hard safety: if JS never fires, remove overlay after 3s */
  animation: overlayFallback 3s forwards;
}

@keyframes overlayFallback {
  0%, 90% { opacity: 1; visibility: visible; }
  100% { opacity: 0; visibility: hidden; pointer-events: none; }
}

.lock-screen-overlay.unlocked {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  animation: none; /* Stop fallback timer — JS took over */
}

/* Rocket image styling: larger size, custom dropshadows, GPU-accelerated */
.flying-rocket {
  position: absolute;
  width: 140px;
  height: 140px;
  object-fit: contain;
  left: calc(50% - 70px);
  /* Start completely below the viewport */
  bottom: -160px;
  opacity: 1;
  z-index: 3;
  filter: drop-shadow(0 4px 15px rgba(0, 0, 0, 0.15)) drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
  /* Begin the ascent immediately — 100% GPU accelerated */
  animation: rocketAscent 1.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: 0.05s;
  will-change: transform;
}

/* GPU-accelerated rocket ascent with natural weaving sway and tangent orientation */
@keyframes rocketAscent {
  0% {
    transform: translate3d(0, 0, 0) rotate(-45deg) scale(0.85);
  }
  25% {
    transform: translate3d(-35px, -35vh, 0) rotate(-49deg) scale(1.1);
  }
  60% {
    transform: translate3d(40px, -75vh, 0) rotate(-41deg) scale(1.1);
  }
  100% {
    transform: translate3d(0, -130vh, 0) rotate(-45deg) scale(0.85);
  }
}

/* Premium white-silver / pearlescent launch particle sparks */
.rocket-spark {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 6px #cbd5e1, 0 0 2px #ffffff;
  pointer-events: none;
  z-index: 99998;
  animation: sparkFade 0.6s ease-out forwards;
}

@keyframes sparkFade {
  0% { transform: translate(0, 0) scale(1.5); opacity: 1; filter: blur(0px); }
  100% { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0; filter: blur(1px); }
}

/* Growing, drifting billowing rocket exhaust smoke clouds */
.rocket-smoke {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.35) 0%, rgba(203, 213, 225, 0.1) 40%, transparent 70%);
  filter: blur(5px);
  pointer-events: none;
  z-index: 99998;
  animation: smokeExpand 0.9s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

@keyframes smokeExpand {
  0% { transform: translate(0, 0) scale(1); opacity: 0.8; }
  100% { transform: translate(var(--dx), var(--dy)) scale(7.5); opacity: 0; }
}
