:root {
  --bg: #0a0a0f;
  --pink: #ff2bd6;
  --purple: #7c3cff;
  --cyan: #00f5ff;
  --text: #fff6ff;
  --muted: #b8a9c9;
}

* {
  box-sizing: border-box;
}

html {
  background: #050814;
}

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  overflow-x: hidden;
  background-image:
    linear-gradient(rgba(5, 8, 20, 0.45), rgba(5, 8, 20, 0.58)),
    url("img/bg.png");
  background-position:
    center center,
    center center;
  background-size:
    auto,
    cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--text);
  font-family: "Press Start 2P", system-ui, sans-serif;
  transform: scale(1.01);
  transition: transform 20s ease-in-out;
  animation: bgDrift 20s ease-in-out infinite alternate;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(ellipse at center, rgba(0, 245, 255, 0.16), transparent 62%),
    repeating-linear-gradient(
      96deg,
      transparent 0 18px,
      rgba(0, 245, 255, 0.14) 18px 20px,
      transparent 20px 42px,
      rgba(255, 43, 214, 0.12) 42px 44px,
      transparent 44px 68px
    ),
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.04) 0,
      rgba(255, 255, 255, 0.04) 1px,
      transparent 1px,
      transparent 4px
    ),
    linear-gradient(rgba(0, 245, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 43, 214, 0.03) 1px, transparent 1px);
  background-position:
    center 86%,
    center 88%,
    0 0,
    0 0,
    0 0;
  background-size:
    min(58vw, 420px) 24vh,
    min(62vw, 460px) 26vh,
    auto,
    28px 28px,
    28px 28px;
  background-repeat:
    no-repeat,
    no-repeat,
    repeat,
    repeat,
    repeat;
  mix-blend-mode: screen;
  opacity: 0.5;
  animation: waterShimmer 14s ease-in-out infinite alternate;
}

body::after {
  content: "";
  position: fixed;
  inset: -80px 0 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(rgba(255, 246, 255, 0.65) 1px, transparent 1px),
    radial-gradient(rgba(0, 245, 255, 0.45) 1px, transparent 1px);
  background-position:
    0 0,
    28px 44px;
  background-size:
    88px 88px,
    134px 134px;
  opacity: 0.25;
  animation: starsDrift 64s linear infinite;
}

#particles-js {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: auto;
  opacity: 1;
  mix-blend-mode: normal;
}

#particles-js canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.profile {
  width: min(100% - 32px, 500px);
  position: relative;
  z-index: 2;
  padding: 40px 0;
  text-align: center;
}

.avatar-frame {
  width: 124px;
  height: 124px;
  margin: 0 auto 28px;
  display: grid;
  place-items: center;
  border: 3px solid rgba(0, 245, 255, 0.78);
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 43, 214, 0.2), rgba(0, 245, 255, 0.14));
  box-shadow:
    0 0 18px rgba(0, 245, 255, 0.65),
    0 0 38px rgba(255, 43, 214, 0.34),
    inset 0 0 22px rgba(124, 60, 255, 0.5);
  animation: pulse 3s infinite ease-in-out;
}

.avatar {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

h1 {
  margin: 0 0 32px;
  color: var(--text);
  font-size: clamp(1.05rem, 5vw, 1.65rem);
  line-height: 1.5;
  text-shadow:
    0 0 7px rgba(255, 43, 214, 0.95),
    0 0 16px rgba(124, 60, 255, 0.8),
    0 0 28px rgba(0, 245, 255, 0.48);
}

.links {
  display: grid;
  gap: 16px;
}

.link-button {
  --button-hue: 0deg;
  width: 100%;
  min-height: 58px;
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: flex-start;
  overflow: hidden;
  padding: 18px 20px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: linear-gradient(135deg, var(--pink), var(--purple) 52%, var(--cyan));
  box-shadow:
    0 0 14px rgba(255, 43, 214, 0.3),
    0 8px 28px rgba(0, 0, 0, 0.36);
  color: var(--text);
  font-size: 0.72rem;
  line-height: 1.45;
  text-decoration: none;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.36);
  filter: hue-rotate(var(--button-hue));
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease,
    filter 180ms ease;
}

.link-button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    transparent,
    rgba(255, 255, 255, 0.25),
    transparent
  );
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.link-button:nth-child(1) {
  --button-hue: 0deg;
}

.link-button:nth-child(2) {
  --button-hue: 10deg;
}

.link-button:nth-child(3) {
  --button-hue: 20deg;
}

.link-button:nth-child(4) {
  --button-hue: 30deg;
}

.link-button:nth-child(5) {
  --button-hue: 40deg;
}

.icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  transform: scale(1.25);
  filter: drop-shadow(0 0 8px rgba(0, 245, 255, 0.7));
  image-rendering: pixelated;
}

.icon,
.link-button span {
  position: relative;
  z-index: 1;
}

.link-button span {
  flex: 1;
  text-align: left;
}

.link-button:hover,
.link-button:focus-visible {
  border-color: rgba(255, 255, 255, 0.58);
  box-shadow:
    0 0 16px rgba(0, 245, 255, 0.82),
    0 0 34px rgba(255, 43, 214, 0.52),
    0 10px 34px rgba(0, 0, 0, 0.42);
  filter: hue-rotate(var(--button-hue)) saturate(1.15);
  transform: scale(1.03) translateY(-2px);
}

.link-button:hover::after {
  opacity: 1;
}

.link-button:active {
  transform: scale(0.97);
}

.link-button:focus-visible {
  outline: 3px solid rgba(0, 245, 255, 0.95);
  outline-offset: 4px;
}

.error {
  margin: 0;
  color: var(--muted);
  font-size: 0.65rem;
  line-height: 1.7;
}

@keyframes bgDrift {
  from {
    background-position:
      center center,
      center center;
  }

  to {
    background-position:
      center center,
      calc(50% + 40px) calc(50% + 20px);
  }
}

@keyframes waterShimmer {
  from {
    background-position:
      center 86%,
      center 88%,
      0 0,
      0 0,
      0 0;
  }

  to {
    background-position:
      center 88%,
      calc(50% + 60px) 88%,
      0 16px,
      0 0,
      0 0;
  }
}

@keyframes starsDrift {
  from {
    transform: translate3d(0, 0, 0);
  }

  to {
    transform: translate3d(60px, -140px, 0);
  }
}

@keyframes pulse {
  0%,
  100% {
    box-shadow:
      0 0 18px rgba(0, 245, 255, 0.65),
      0 0 38px rgba(255, 43, 214, 0.34),
      inset 0 0 22px rgba(124, 60, 255, 0.5);
  }

  50% {
    box-shadow:
      0 0 26px rgba(0, 245, 255, 0.9),
      0 0 52px rgba(255, 43, 214, 0.6),
      inset 0 0 22px rgba(124, 60, 255, 0.5);
  }
}

@media (max-width: 420px) {
  .profile {
    width: min(100% - 24px, 500px);
    padding: 28px 0;
  }

  .avatar-frame {
    width: 108px;
    height: 108px;
    margin-bottom: 24px;
  }

  .avatar {
    width: 90px;
    height: 90px;
  }

  .link-button {
    min-height: 54px;
    padding-inline: 14px;
    font-size: 0.62rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  body,
  body::before,
  body::after {
    animation: none !important;
  }

  #particles-js {
    display: none;
  }
}
