:root {
  --bg: #0b0c0e;
  --text: #f2f3f4;
  --muted: rgba(225, 227, 230, 0.62);
  --line: rgba(255, 255, 255, 0.11);
  --glass: rgba(17, 18, 20, 0.76);
  --radius-card: 32px;
  --radius-control: 20px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--bg);
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

button,
a {
  font: inherit;
}

.scene,
.scene__image,
.scene__shade,
.scene__grain,
.scene__rain {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.scene {
  z-index: -2;
  overflow: hidden;
  background: var(--bg);
}

.scene__image {
  inset: -7%;
  background-image: url("assets/avatar.jpg");
  background-position: center 42%;
  background-size: cover;
  filter: blur(8px) grayscale(0.58) saturate(0.45) brightness(0.32);
  transform: scale(1.08);
  animation: background-breathe 18s ease-in-out infinite alternate;
}

.scene__shade {
  background:
    linear-gradient(180deg, rgba(9, 10, 12, 0.4) 0%, rgba(9, 10, 12, 0.72) 54%, rgba(7, 8, 10, 0.94) 100%),
    radial-gradient(circle at 50% 20%, transparent 0%, rgba(8, 9, 11, 0.72) 82%);
}

.scene__rain {
  inset: -45% -20%;
  background-image: linear-gradient(
    to bottom,
    transparent 0%,
    transparent 38%,
    rgba(224, 230, 236, 0.42) 43%,
    rgba(224, 230, 236, 0.08) 58%,
    transparent 62%,
    transparent 100%
  );
  background-size: 100% 150px;
  -webkit-mask-image: repeating-linear-gradient(to right, transparent 0 31px, #000 31px 32px, transparent 32px 69px);
  mask-image: repeating-linear-gradient(to right, transparent 0 31px, #000 31px 32px, transparent 32px 69px);
  opacity: 0.16;
  transform: rotate(3deg);
  animation: rain-fall 2.2s linear infinite;
}

.scene__rain--near {
  background-size: 100% 210px;
  -webkit-mask-image: repeating-linear-gradient(to right, transparent 0 53px, #000 53px 54px, transparent 54px 113px);
  mask-image: repeating-linear-gradient(to right, transparent 0 53px, #000 53px 54px, transparent 54px 113px);
  opacity: 0.1;
  animation-duration: 3.1s;
  animation-delay: -1.4s;
}

.scene__grain {
  opacity: 0.09;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.page {
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  place-items: center;
  padding: max(28px, env(safe-area-inset-top)) 18px max(28px, env(safe-area-inset-bottom));
}

.profile-card {
  position: relative;
  width: min(100%, 470px);
  padding: 34px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-card);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.042), transparent 30%),
    var(--glass);
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.54),
    inset 0 1px 0 rgba(255, 255, 255, 0.055);
  isolation: isolate;
  animation: card-enter 700ms cubic-bezier(0.2, 0.75, 0.22, 1) both;
}

@supports ((-webkit-backdrop-filter: blur(24px)) or (backdrop-filter: blur(24px))) {
  .profile-card {
    -webkit-backdrop-filter: blur(24px) saturate(1.25);
    backdrop-filter: blur(24px) saturate(1.25);
  }
}

.profile-card__shine {
  position: absolute;
  z-index: -1;
  top: -190px;
  left: 50%;
  width: 380px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.075), transparent 70%);
  transform: translateX(-50%);
}

.card-weather {
  position: absolute;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
}

.card-weather::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 10% 16%, rgba(191, 112, 43, 0.11), transparent 23%),
    radial-gradient(circle at 92% 76%, rgba(142, 77, 31, 0.08), transparent 24%),
    linear-gradient(145deg, rgba(194, 122, 54, 0.06), transparent 36%);
}

.card-weather__rain {
  position: absolute;
  inset: -45%;
  background-image: linear-gradient(
    to bottom,
    transparent 0%,
    transparent 35%,
    rgba(231, 234, 237, 0.42) 40%,
    rgba(231, 234, 237, 0.07) 56%,
    transparent 61%,
    transparent 100%
  );
  background-size: 100% 120px;
  -webkit-mask-image: repeating-linear-gradient(to right, transparent 0 24px, #000 24px 25px, transparent 25px 57px);
  mask-image: repeating-linear-gradient(to right, transparent 0 24px, #000 24px 25px, transparent 25px 57px);
  opacity: 0.17;
  transform: rotate(3deg);
  animation: rain-fall 1.9s linear infinite;
}

.autumn-leaf {
  position: absolute;
  top: -12%;
  left: var(--leaf-x);
  z-index: 1;
  font-size: var(--leaf-size);
  opacity: var(--leaf-opacity);
  filter: saturate(0.72) sepia(0.14);
  animation: leaf-drift var(--leaf-duration) linear infinite;
  animation-delay: var(--leaf-delay);
  will-change: transform;
}

.autumn-leaf--one {
  --leaf-x: 8%;
  --leaf-size: 22px;
  --leaf-opacity: 0.42;
  --leaf-duration: 13s;
  --leaf-delay: -4s;
}

.autumn-leaf--two {
  --leaf-x: 79%;
  --leaf-size: 19px;
  --leaf-opacity: 0.34;
  --leaf-duration: 16s;
  --leaf-delay: -11s;
}

.autumn-leaf--three {
  --leaf-x: 92%;
  --leaf-size: 16px;
  --leaf-opacity: 0.28;
  --leaf-duration: 18s;
  --leaf-delay: -2s;
}

.autumn-leaf--four {
  --leaf-x: 23%;
  --leaf-size: 14px;
  --leaf-opacity: 0.24;
  --leaf-duration: 20s;
  --leaf-delay: -15s;
}

.profile,
.links,
.wallet {
  position: relative;
  z-index: 2;
}

.profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.avatar-ring {
  position: relative;
  width: 116px;
  height: 116px;
  margin-bottom: 18px;
  padding: 3px;
  border-radius: 50%;
  background: linear-gradient(145deg, #f0f1f2, #757a81 55%, #2b2d31);
  box-shadow:
    0 16px 38px rgba(0, 0, 0, 0.42),
    0 0 0 1px rgba(255, 255, 255, 0.08);
}

.avatar-ring::after {
  content: "";
  position: absolute;
  inset: -8px;
  z-index: -1;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: inherit;
}

.avatar {
  display: block;
  width: 100%;
  height: 100%;
  border: 3px solid #17191c;
  border-radius: 50%;
  object-fit: cover;
  object-position: 52% 46%;
}

.eyebrow {
  margin: 0 0 5px;
  color: rgba(215, 218, 222, 0.62);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.18em;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 8vw, 2.65rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.36);
}

.bio {
  max-width: 390px;
  margin: 13px 0 26px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.58;
}

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

.link-button {
  --accent: 205, 208, 212;
  --icon-color: 205, 208, 212;
  position: relative;
  display: grid;
  grid-template-columns: 46px 1fr 24px;
  align-items: center;
  min-height: 70px;
  padding: 10px 15px 10px 11px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: var(--radius-control);
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease;
}

.link-button::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background: linear-gradient(105deg, rgba(var(--accent), 0.07), transparent 55%);
  transition: opacity 180ms ease;
}

.link-button__icon {
  position: relative;
  z-index: 1;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(var(--icon-color), 0.28);
  border-radius: 14px;
  color: rgb(var(--icon-color));
  background: rgba(var(--icon-color), 0.11);
}

.link-button--twitch {
  --icon-color: 169, 112, 255;
}

.link-button--telegram {
  --icon-color: 42, 171, 238;
}

.link-button--donate {
  --icon-color: 255, 103, 76;
}

.link-button__icon svg {
  width: 23px;
  height: 23px;
  fill: currentColor;
}

.link-button__copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 3px;
  min-width: 0;
  padding-left: 11px;
}

.link-button__copy strong {
  overflow: hidden;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.012em;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-button__copy small {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.1;
}

.link-button__arrow {
  position: relative;
  z-index: 1;
  color: rgba(255, 255, 255, 0.48);
  font-size: 1.2rem;
  transition: transform 180ms ease, color 180ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .link-button:hover {
    border-color: rgba(var(--accent), 0.45);
    background: rgba(255, 255, 255, 0.085);
    box-shadow: 0 12px 28px rgba(var(--accent), 0.1);
    transform: translateY(-2px);
  }

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

  .link-button:hover .link-button__arrow {
    color: #fff;
    transform: translate(2px, -2px);
  }
}

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

.link-button:focus-visible,
.copy-button:focus-visible {
  outline: 3px solid rgba(210, 214, 219, 0.44);
  outline-offset: 3px;
}

.wallet {
  margin-top: 18px;
  padding: 19px 4px 0;
  border-top: 1px solid var(--line);
}

.wallet__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 13px;
}

.wallet__kicker {
  display: block;
  margin-bottom: 3px;
  color: rgba(200, 204, 209, 0.56);
  font-size: 0.67rem;
  font-weight: 750;
  letter-spacing: 0.15em;
}

.wallet h2 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.1;
}

.network-badge {
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: rgba(237, 239, 241, 0.72);
  background: rgba(255, 255, 255, 0.045);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.08em;
}

.wallet__address-row {
  display: grid;
  gap: 11px;
}

.wallet code {
  display: block;
  padding: 3px 1px;
  overflow-wrap: anywhere;
  border: 0;
  color: rgba(255, 255, 255, 0.74);
  background: transparent;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.55;
  user-select: all;
}

.copy-button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  color: rgba(245, 246, 247, 0.9);
  background: rgba(255, 255, 255, 0.055);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 700;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.copy-button svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.copy-button:hover {
  border-color: rgba(255, 255, 255, 0.24);
  background-color: rgba(255, 255, 255, 0.09);
}

.copy-button:active {
  transform: scale(0.98);
}

.copy-button[data-copied="true"] {
  border-color: rgba(255, 255, 255, 0.34);
  color: #fff;
}

.wallet__note {
  margin: 11px 0 0;
  color: rgba(221, 233, 244, 0.51);
  font-size: 0.74rem;
  line-height: 1.4;
  text-align: center;
}

.toast {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  max-width: calc(100vw - 32px);
  padding: 11px 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: #f4f5f6;
  background: rgba(17, 18, 20, 0.9);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.34);
  opacity: 0;
  transform: translate(-50%, 14px);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  font-size: 0.87rem;
  font-weight: 650;
  white-space: nowrap;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@keyframes card-enter {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes background-breathe {
  from {
    transform: scale(1.08) translate3d(-0.5%, -0.5%, 0);
  }
  to {
    transform: scale(1.12) translate3d(0.7%, 0.7%, 0);
  }
}

@keyframes rain-fall {
  from {
    background-position: 0 -210px;
  }
  to {
    background-position: 0 210px;
  }
}

@keyframes leaf-drift {
  0% {
    transform: translate3d(0, -30px, 0) rotate(0deg);
  }
  35% {
    transform: translate3d(28px, 310px, 0) rotate(135deg);
  }
  70% {
    transform: translate3d(-18px, 620px, 0) rotate(285deg);
  }
  100% {
    transform: translate3d(18px, 920px, 0) rotate(430deg);
  }
}

@media (max-width: 520px) {
  .page {
    align-items: start;
    padding-right: 12px;
    padding-left: 12px;
  }

  .profile-card {
    padding: 26px 18px 20px;
    border-radius: 28px;
  }

  .avatar-ring {
    width: 104px;
    height: 104px;
  }

  .bio {
    margin-bottom: 22px;
  }

  .link-button {
    min-height: 67px;
  }

  .wallet {
    padding: 17px 0 0;
  }
}

@media (max-width: 360px) {
  .profile-card {
    padding-right: 14px;
    padding-left: 14px;
  }

  .link-button {
    grid-template-columns: 42px 1fr 20px;
    padding-right: 12px;
    padding-left: 9px;
  }

  .link-button__icon {
    width: 39px;
    height: 39px;
  }

  .link-button__copy {
    padding-left: 9px;
  }
}

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