/* ============================================================
   LAMA WORLDS — LINKS + PROCEDURAL SPACE BG
   ============================================================ */

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

html, body {
  overflow: hidden !important;
  height: 100%;
  overscroll-behavior: none;
  touch-action: none;
}

:root {
  --lw-bg: #010307;
  --lw-text: #d6f3ff;
  --lw-card: rgba(6, 12, 22, 0.55);
  --lw-border: rgba(120, 200, 255, 0.35);
  --lw-glow: rgba(66, 226, 255, 0.55);
  --look-x: 0px;
  --look-y: 0px;
  --veil-top: rgba(0, 0, 0, 0.12);
  --veil-mid: transparent;
  --veil-bottom: rgba(0, 0, 0, 0.35);
}

body.light {
  --lw-bg: #060e18;
  --lw-text: #0a2333;
  --lw-card: rgba(255, 255, 255, 0.55);
  --lw-border: rgba(20, 60, 90, 0.18);
  --lw-glow: rgba(40, 140, 200, 0.45);
  --veil-top: rgba(8, 20, 36, 0.15);
  --veil-mid: transparent;
  --veil-bottom: rgba(4, 12, 22, 0.4);
}

body {
  margin: 0;
  background: var(--lw-bg);
  color: var(--lw-text);
  font-family: 'Orbitron', sans-serif;
}

/* === PROCEDURAL SPACE CANVAS === */
#space-sim {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: var(--lw-bg);
}

#space {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  transform: translate3d(var(--look-x), var(--look-y), 0);
  will-change: transform;
}

.space-veil {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    radial-gradient(ellipse 70% 50% at 50% 38%, var(--veil-mid), transparent 68%),
    linear-gradient(180deg, var(--veil-top) 0%, transparent 30%, transparent 55%, var(--veil-bottom) 100%);
  pointer-events: none;
}

/* === CONTENT === */
main {
  position: relative;
  z-index: 5;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 60px;
  perspective: 900px;
}

.linktree-container {
  width: 90%;
  max-width: 440px;
  background: var(--lw-card);
  border: 1px solid var(--lw-border);
  padding: 2.2rem 2rem;
  border-radius: 24px;
  backdrop-filter: blur(18px) saturate(160%);
  text-align: center;
  box-shadow:
    0 0 30px rgba(66, 226, 255, 0.18),
    inset 0 0 25px rgba(66, 226, 255, 0.08);
  animation: fadeIn 1s ease forwards;
  transform-style: preserve-3d;
  will-change: transform;
}

body.light .linktree-container {
  box-shadow:
    0 12px 36px rgba(30, 80, 120, 0.12),
    inset 0 0 18px rgba(255, 255, 255, 0.35);
}

.avatar-wrapper {
  position: relative;
  width: 120px;
  height: 120px;
  margin: auto;
}

.logo {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 20px rgba(66, 226, 255, 0.7);
}

.avatar-glow {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 50px rgba(66, 226, 255, 0.5);
  animation: pulse 3s infinite alternate;
}

.neon-title {
  margin-top: 1.2rem;
  font-size: 1.8rem;
  background: linear-gradient(90deg, #39baff, #8fe8ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 10px #42e2ff, 0 0 20px #42e2ff80;
}

body.light .neon-title {
  background: linear-gradient(90deg, #1a6fa8, #3aa0d0);
  -webkit-background-clip: text;
  background-clip: text;
  text-shadow: none;
}

.subtitle {
  opacity: 0.8;
  margin-bottom: 1.6rem;
  font-size: 0.95rem;
}

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

.links a {
  padding: 1rem;
  min-height: 3.4rem;
  box-sizing: border-box;
  border: 1px solid var(--lw-border);
  border-radius: 14px;
  background: rgba(20, 40, 60, 0.45);
  backdrop-filter: blur(10px);
  text-decoration: none;
  color: var(--lw-text);
  font-weight: 700;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: 0.25s ease;
  white-space: nowrap;
  -webkit-font-smoothing: antialiased;
  transform: translateZ(0);
  backface-visibility: hidden;
}

body.light .links a {
  background: rgba(255, 255, 255, 0.55);
}

.links a:hover {
  transform: translateZ(0) translateY(-3px);
  border-color: var(--lw-glow);
  box-shadow: 0 0 15px var(--lw-glow);
}

.links a i {
  font-size: 1.15rem;
  width: 1.35em;
  flex-shrink: 0;
  line-height: 1;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--lw-card);
  border: 1px solid var(--lw-border);
  backdrop-filter: blur(10px);
  color: var(--lw-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  z-index: 20;
  transition: 0.25s ease;
}

#theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 0 15px var(--lw-glow);
}

footer {
  margin-top: 2rem;
  font-size: 0.85rem;
  opacity: 0.75;
  text-align: center;
}

footer a {
  color: inherit;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  from { box-shadow: 0 0 20px rgba(66, 226, 255, 0.4); }
  to   { box-shadow: 0 0 50px rgba(66, 226, 255, 0.8); }
}

@media (prefers-reduced-motion: reduce) {
  #space { transform: none; }
  .avatar-glow,
  .linktree-container { animation: none; }
}

@media (max-width: 540px), (pointer: coarse) {
  html, body {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    height: auto;
    min-height: 100%;
    touch-action: pan-y;
    overscroll-behavior: contain;
  }

  #space {
    transform: none;
    will-change: auto;
  }

  main {
    perspective: none;
    padding-top: 48px;
    padding-bottom: 40px;
    align-items: flex-start;
  }

  .linktree-container {
    padding: 1.6rem 1.4rem;
    margin-top: 20px;
    width: 94%;
    transform: none !important;
    will-change: auto;
    backdrop-filter: blur(10px) saturate(130%);
    box-shadow:
      0 0 18px rgba(66, 226, 255, 0.1),
      inset 0 0 14px rgba(66, 226, 255, 0.05);
  }

  body.light .linktree-container {
    box-shadow:
      0 8px 24px rgba(30, 80, 120, 0.1),
      inset 0 0 12px rgba(255, 255, 255, 0.25);
  }

  .avatar-glow {
    animation: none;
    box-shadow: 0 0 28px rgba(66, 226, 255, 0.35);
  }

  .links a {
    backdrop-filter: blur(6px);
    transition: none;
  }

  .links a:hover {
    transform: none;
  }

  .neon-title { font-size: 1.45rem; }
  .subtitle { font-size: 0.85rem; }
  .links a { font-size: 0.9rem; padding: 0.85rem; }

  #theme-toggle {
    width: 46px;
    height: 46px;
    top: 12px;
    right: 12px;
  }

  .avatar-wrapper {
    width: 95px;
    height: 95px;
  }
}
