@import url("./brand.css");

:root {
  color-scheme: dark;
  --border: rgba(223, 196, 255, 0.28);
  --text: var(--brand-text);
  --focus: rgba(223, 196, 255, 0.65);
  --shadow: 0 30px 90px rgba(2, 0, 8, 0.42);
}

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

html {
  color-scheme: dark;
  background: var(--brand-ink);
}

body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  font-family: "Geologica", system-ui, sans-serif;
  color: var(--text);
  background: var(--brand-aura);
  overflow-x: hidden;
  position: relative;
  isolation: isolate;
}

body::before,
body::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: -1;
}

body::before {
  inset: -16%;
  background:
    radial-gradient(
      circle at 14% 14%,
      rgba(223, 196, 255, 0.28),
      transparent 31%
    ),
    radial-gradient(
      circle at 86% 18%,
      rgba(255, 196, 222, 0.22),
      transparent 29%
    ),
    radial-gradient(
      circle at 50% 100%,
      rgba(125, 227, 214, 0.18),
      transparent 34%
    );
  filter: blur(36px);
  opacity: 0.96;
}

body::after {
  inset: auto -190px -260px auto;
  width: 540px;
  height: 540px;
  border: 2px solid rgba(125, 227, 214, 0.28);
  border-radius: 47% 53% 59% 41%;
  transform: rotate(18deg);
  opacity: 0.5;
}

a {
  color: inherit;
}

.page {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: clamp(14px, 4vw, 40px);
  position: relative;
  z-index: 1;
}

.shell {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: clamp(20px, 3vw, 28px);
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid var(--border);
  border-radius: clamp(30px, 4vw, 44px);
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.05), transparent 33%),
    linear-gradient(155deg, rgba(38, 26, 59, 0.98), rgba(18, 13, 31, 0.99));
  box-shadow:
    var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.shell::before,
.shell::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.shell::before {
  inset: auto auto -118px -105px;
  width: 270px;
  height: 270px;
  border: 2px solid rgba(125, 227, 214, 0.26);
  border-radius: 46% 54% 41% 59%;
  background: none;
  transform: rotate(-18deg);
}

.shell::after {
  inset: -96px -84px auto auto;
  width: 238px;
  height: 238px;
  border: 2px solid rgba(255, 196, 222, 0.26);
  border-radius: 58% 42% 53% 47%;
  background: none;
  transform: rotate(24deg);
}

.identity {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 4px;
  align-content: start;
}

.identity__top {
  display: flex;
  align-items: center;
  gap: 22px;
}

.identity__copy {
  min-width: 0;
  display: grid;
  gap: 14px;
  align-content: center;
}

.avatar-shell {
  position: relative;
  width: clamp(112px, 17vw, 148px);
  height: clamp(112px, 17vw, 148px);
  flex-shrink: 0;
}

.avatar-shell::before {
  content: "";
  position: absolute;
  inset: -11px;
  border-radius: 32% 68% 58% 42%;
  background: linear-gradient(
    135deg,
    rgba(223, 196, 255, 0.7),
    rgba(255, 196, 222, 0.64),
    rgba(125, 227, 214, 0.48)
  );
  filter: blur(15px);
  opacity: 0.62;
}

.avatar-frame {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 2px solid rgba(223, 196, 255, 0.68);
  border-radius: 34% 66% 58% 42%;
  background: rgba(255, 250, 255, 0.1);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
}

.avatar {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

.avatar-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: linear-gradient(
    135deg,
    rgba(159, 139, 255, 0.35),
    rgba(255, 139, 184, 0.34)
  );
  color: var(--text);
  font-size: clamp(2.1rem, 4vw, 3rem);
  font-weight: 800;
}

.profile-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 196, 222, 0.52);
  border-radius: 999px;
  background: rgba(255, 196, 222, 0.11);
  color: var(--brand-pink);
  font-family: "Aoudax", "Geologica", sans-serif;
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}

.live-badge__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-pink);
  box-shadow: 0 0 0 5px rgba(255, 196, 222, 0.13);
  animation: pulse 1.8s ease-in-out infinite;
}

h1 {
  font-family: "Aoudax", "Geologica", sans-serif;
  font-size: clamp(3rem, 7.8vw, 4.75rem);
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: -0.055em;
  text-wrap: balance;
  color: var(--brand-text);
  -webkit-text-fill-color: currentColor;
  text-shadow: 0 0 28px rgba(223, 196, 255, 0.18);
}

#profile-name {
  display: inline-block;
  padding-inline-end: 0.12em;
  overflow: visible;
  white-space: nowrap;
  color: transparent;
  background: var(--brand-wordmark-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.actions {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 20px;
  align-content: start;
}

.section {
  display: grid;
  gap: 11px;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.section-head strong {
  color: var(--brand-lavender);
  font-family: "Geologica", system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.tile {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 92px;
  padding: 16px;
  border: 1px solid rgba(223, 196, 255, 0.2);
  border-radius: 22px;
  text-decoration: none;
  color: var(--text);
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.065),
    rgba(255, 255, 255, 0.025)
  );
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  overflow: hidden;
  transition:
    transform 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    background 0.22s ease;
}

.tile::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(223, 196, 255, 0.17),
    rgba(255, 196, 222, 0.09)
  );
  opacity: 0;
  transition: opacity 0.22s ease;
}

.tile:hover,
.tile:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(223, 196, 255, 0.46);
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.tile:hover::before,
.tile:focus-visible::before {
  opacity: 1;
}

.tile:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px var(--focus),
    0 12px 30px rgba(0, 0, 0, 0.28);
}

.tile__icon {
  position: relative;
  z-index: 1;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border: 1px solid
    color-mix(
      in srgb,
      var(--tile-accent, var(--brand-lavender)) 44%,
      transparent
    );
  border-radius: 16px;
  background: color-mix(
    in srgb,
    var(--tile-accent, var(--brand-lavender)) 15%,
    transparent
  );
}

.tile__symbol {
  color: var(--tile-accent, var(--brand-lavender));
  font-family: "Aoudax", "Geologica", sans-serif;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: -0.04em;
}

.tile__copy {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: grid;
  gap: 5px;
}

.tile__title {
  font-family: "Geologica", system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 760;
}

.tile__meta {
  color: var(--brand-muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.tile__arrow {
  position: relative;
  z-index: 1;
  color: var(--brand-lavender);
  font-size: 1.05rem;
  transition:
    transform 0.22s ease,
    color 0.22s ease;
}

.tile:hover .tile__arrow,
.tile:focus-visible .tile__arrow {
  transform: translateX(3px);
  color: var(--text);
}

.tile--wide {
  grid-column: 1 / -1;
}

.tile--twitch {
  --tile-accent: var(--brand-lavender);
  background: linear-gradient(
    145deg,
    rgba(223, 196, 255, 0.16),
    rgba(255, 255, 255, 0.03)
  );
}

.tile--youtube {
  --tile-accent: var(--brand-pink);
  background: linear-gradient(
    145deg,
    rgba(255, 196, 222, 0.15),
    rgba(255, 255, 255, 0.03)
  );
}

.tile--telegram {
  --tile-accent: var(--brand-mint);
  background: linear-gradient(
    145deg,
    rgba(125, 227, 214, 0.14),
    rgba(255, 255, 255, 0.03)
  );
}

.tile--instagram {
  --tile-accent: var(--brand-pink);
  background: linear-gradient(
    145deg,
    rgba(255, 196, 222, 0.14),
    rgba(255, 255, 255, 0.03)
  );
}

.tile--donationalerts {
  --tile-accent: var(--brand-yellow);
  background: linear-gradient(
    145deg,
    rgba(255, 224, 138, 0.14),
    rgba(255, 255, 255, 0.03)
  );
}

.tile--lobby {
  --tile-accent: var(--brand-lavender);
  background: linear-gradient(
    145deg,
    rgba(223, 196, 255, 0.14),
    rgba(255, 255, 255, 0.03)
  );
}

.tile--twitch .tile__icon {
  color: #dbcfff;
  border-color: rgba(145, 70, 255, 0.22);
  background: rgba(145, 70, 255, 0.18);
}

.tile--youtube .tile__icon {
  color: #ffd6db;
  border-color: rgba(255, 0, 0, 0.22);
  background: rgba(255, 0, 0, 0.14);
}

.tile--telegram .tile__icon {
  color: #dff6ff;
  border-color: rgba(38, 165, 228, 0.24);
  background: rgba(38, 165, 228, 0.16);
}

.tile--instagram .tile__icon {
  color: #ffe1ed;
  border-color: rgba(225, 48, 108, 0.24);
  background: rgba(225, 48, 108, 0.16);
}

.tile--donationalerts .tile__icon {
  color: #ffe4c8;
  border-color: rgba(245, 117, 7, 0.22);
  background: rgba(245, 117, 7, 0.14);
}

.tile--lobby .tile__icon {
  color: #dff6ff;
  border-color: rgba(38, 165, 228, 0.24);
  background: rgba(38, 165, 228, 0.16);
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.18);
  }
}

@media (max-width: 640px) {
  .page {
    padding: 12px;
  }

  .shell {
    padding: 18px;
    gap: 18px;
    border-radius: 30px;
  }

  .identity {
    border-bottom: 1px solid rgba(223, 196, 255, 0.2);
    border-radius: 26px 26px 0 0;
    padding-bottom: 18px;
  }

  .identity__top {
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }

  .avatar-shell {
    width: clamp(104px, 28vw, 118px);
    height: clamp(104px, 28vw, 118px);
  }

  .profile-meta {
    width: 100%;
    justify-content: center;
  }

  .tiles {
    grid-template-columns: 1fr;
  }

  .identity__copy {
    gap: 10px;
    width: 100%;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  h1 {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
  }
}

@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;
  }
}
