@import url("https://fonts.googleapis.com/css2?family=Funnel+Sans:wght@300..800&display=swap");

:root {
  --discord-light: #5865f2;
  --discord-dark: #3138a8;

  --instagram-light: #9b20ec;
  --instagram-extra: #fd1d1d;
  --instagram-dark: #fc9c17;

  --medal-light: #090b04;
  --medal-dark: #424440;

  --youtube-light: #ff1f1f;
  --youtube-dark: #b30000;

  --twitch-light: #9146ff;
  --twitch-dark: #4b188f;

  --github-light: #7a7a7a;
  --github-dark: #303030;

  --telegram-light: #2aabee;
  --telegram-dark: #1375a8;

  --steam-light: #111d2e;
  --steam-dark: #1387b8;

  --spotify-light: #1db954;
  --spotify-dark: #0b6b30;

  --tiktok-light: #01f2e9;
  --tiktok-extra: #111111;
  --tiktok-dark: #fe004d;

  --namemc-light: #2c2c2c;
  --namemc-dark: #272727;

  --modrinth-light: #1ed860;
  --modrinth-dark: #065520;

  --panel-strong: rgba(17, 22, 38, 0.88);
  --text: #f7fbff;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  color-scheme: dark;
}

body {
  min-height: 100dvh;
  overflow-x: hidden;
  background: #000;
  color: var(--text);
  display: grid;
  place-items: center;
  font-family: "Funnel Sans", system-ui, sans-serif;
}

a,
button {
  -webkit-tap-highlight-color: transparent;
}

.container {
  position: relative;
  z-index: 1;
  width: fit-content;
  max-width: calc(100% - 2rem);
  min-height: 100dvh;
  padding: 5rem 0;
  display: grid;
  align-content: center;
  gap: 2.4rem;
}

.profile {
  opacity: 0;
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  text-align: center;
  transform: translateY(20px);
  transition: opacity 0.3s linear, transform 0.45s ease;
  will-change: opacity, transform;
}

.profile img {
  width: 165px;
  height: auto;
  border-radius: 20%;
  border-bottom: 2px solid;
  border-image: linear-gradient(to right, transparent, white, transparent) 1;
}

h1 {
  color: var(--text);
  font-size: 3rem;
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: 0;
  text-shadow: -3px -2px #ae35ff, 3px 2px #2631ff;
}

.links {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.media {
  opacity: 0;
  position: relative;
  width: 86px;
  height: 86px;
  padding: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: 16px;
  border: 0;
  background: rgba(255, 255, 255, 0.035);
  transform: translateY(20px);
  transition: opacity 0.3s linear, transform 0.4s ease, background 0.25s ease;
  will-change: opacity, transform;
}

.media::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--media-light), var(--media-dark));
  opacity: 0;
  transition: opacity 0.25s ease;
}

.media:hover,
.media:focus-visible {
  transform: translateY(-4px) rotate(1deg);
}

.media:hover::before,
.media:focus-visible::before {
  opacity: 0.95;
}

.media:focus-visible {
  outline: 0;
  outline-offset: 3px;
}

.media img,
.popup,
.arrow {
  position: relative;
  z-index: 2;
}

.media img {
  width: 3.35rem;
  height: 3.35rem;
  object-fit: contain;
  filter: drop-shadow(0 12px 16px rgba(0, 0, 0, 0.35));
  transition: transform 0.25s ease;
}

.media:hover img,
.media:focus-visible img {
  transform: translateY(-8px) scale(0.9);
}

a[href="https://namemc.com/xhvsh"] img {
  width: 2.5rem;
  height: 2.5rem;
}

.popup {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  color: #fff;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  white-space: nowrap;
}

.arrow {
  display: none;
}

.media:hover .popup,
.media:focus-visible .popup {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.show {
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 520px) {
  body {
    place-items: start center;
  }

  .container {
    width: clamp(240px, 90%, 460px);
    min-height: auto;
    padding: 3rem 0;
    gap: 2.25rem;
  }

  .links {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .media {
    width: 100%;
    min-height: 72px;
    height: auto;
    padding: 1rem;
    grid-template-columns: 48px 1fr 24px;
    display: grid;
    align-items: center;
    gap: 14px;
    border-radius: 10px;
    background:
      linear-gradient(135deg, var(--media-light), var(--media-dark)),
      var(--panel-strong);
  }

  .media::before {
    opacity: 0;
  }

  .media img {
    width: 42px;
    height: 42px;
  }

  a[href="https://namemc.com/xhvsh"] img {
    width: 42px;
    height: 42px;
  }

  .popup {
    position: static;
    transform: none;
    opacity: 1;
    font-size: clamp(1.28rem, 7vw, 1.55rem);
    font-weight: 900;
    justify-self: start;
  }

  .arrow {
    display: block;
    width: 20px;
    height: 20px;
    justify-self: end;
  }

  .media:hover .popup,
  .media:focus-visible .popup {
    transform: none;
  }
}

@media (max-width: 380px) {
  .container {
    width: min(100% - 20px, 360px);
  }

  h1 {
    font-size: 3rem;
  }

  .popup {
    font-size: 1.18rem;
  }
}
