:root {
  color-scheme: dark;
  --panel-width: 580px;
  --link-gap: 14px;
  --page-black: #171717;
  --card-black: #000;
  --white: #fff;
  --muted-white: rgba(255, 255, 255, 0.72);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

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

body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  background: var(--page-black);
  color: var(--white);
}

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

button {
  font: inherit;
}

.page-shell {
  position: relative;
  min-height: 100svh;
}

.profile-panel {
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: var(--panel-width);
  min-height: 100svh;
  margin: 0 auto;
  overflow: hidden;
  background: #000;
}

.background,
.background > div {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.background {
  z-index: -1;
  overflow: hidden;
  background: #000;
}

.background__avatar {
  inset: -5% !important;
  background: url("assets/avatar.webp") center / cover no-repeat;
  filter: blur(50px) saturate(0.95);
  opacity: 0.27;
  transform: scale(1.06);
}

.background__shade {
  background:
    radial-gradient(circle at 52% 18%, rgba(99, 13, 21, 0.05), rgba(0, 0, 0, 0.28) 72%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.25));
}

.background__noise {
  background: url("assets/noise.svg") repeat;
  background-size: 240px 240px;
  mix-blend-mode: overlay;
  opacity: 0.075;
}

.profile-header {
  position: relative;
  display: flex;
  min-height: 245px;
  padding-top: 104px;
  flex-direction: column;
  align-items: center;
}

.profile-avatar {
  display: block;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

h1 {
  margin: 13px 24px 0;
  color: var(--white);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.6px;
  line-height: 1.2;
  text-align: center;
}

.link-card:focus-within {
  outline: 2px solid var(--white);
  outline-offset: 3px;
}

.links {
  display: flex;
  margin-top: 32px;
  padding: 0 var(--link-gap) 16px;
  flex-direction: column;
  gap: var(--link-gap);
}

.link-card {
  position: relative;
  display: grid;
  width: 100%;
  height: 64px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--card-black);
  box-shadow:
    0.3px 0.5px 0.7px rgba(17, 17, 17, 0.02),
    0.9px 1.8px 2.5px rgba(17, 17, 17, 0.027),
    2px 4px 5.5px rgba(17, 17, 17, 0.03),
    4.6px 9.3px 12.8px rgba(17, 17, 17, 0.035);
  transition: transform 160ms ease, filter 160ms ease;
}

.link-card:hover {
  filter: brightness(1.13);
  transform: scale(1.015);
}

.link-card:active {
  transform: scale(0.99);
}

.link-card__main {
  display: grid;
  width: 100%;
  height: 100%;
  padding: 8px 44px 8px;
  place-items: center;
  color: var(--white);
  text-decoration: none;
}

.link-card--with-thumbnail .link-card__main {
  padding-left: 64px;
}

.link-card__thumbnail {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 48px;
  height: 48px;
  border-radius: 5px;
  object-fit: cover;
}

.link-card__title {
  display: -webkit-box;
  overflow: hidden;
  color: var(--white);
  font-size: 15.5px;
  font-weight: 650;
  letter-spacing: -0.35px;
  line-height: 1.08;
  text-align: center;
  text-overflow: ellipsis;
  text-wrap: balance;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.link-card__share {
  position: absolute;
  top: 50%;
  right: 8px;
  display: grid;
  width: 32px;
  height: 40px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: rgba(255, 255, 255, 0.62);
  cursor: pointer;
  transform: translateY(-50%);
  transition: background 150ms ease, color 150ms ease;
}

.link-card__share:hover,
.link-card__share:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  outline: none;
}

.link-card__share span {
  display: block;
  font-size: 20px;
  line-height: 1;
  transform: translateY(-1px);
}

.profile-footer {
  display: flex;
  padding: 48px var(--link-gap) 64px;
  flex-direction: column;
  align-items: center;
}

.profile-footer p {
  margin: 0;
  color: var(--muted-white);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.profile-footer p span {
  padding: 0 4px;
}

.desktop-qr {
  position: fixed;
  right: 48px;
  bottom: 40px;
  display: none;
  width: 140px;
  color: var(--white);
  text-align: center;
}

.desktop-qr p {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
}

.desktop-qr img {
  display: block;
  width: 124px;
  height: 124px;
  margin: 0 auto;
  border: 7px solid var(--white);
  border-radius: 5px;
  background: var(--white);
}

.toast {
  position: fixed;
  z-index: 10;
  bottom: max(24px, env(safe-area-inset-bottom));
  left: 50%;
  max-width: calc(100% - 32px);
  padding: 11px 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(20, 20, 20, 0.94);
  color: var(--white);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 18px);
  transition: opacity 180ms ease, transform 180ms ease;
}

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

@media (min-width: 640px) {
  .profile-panel {
    min-height: calc(100svh - 40px);
    margin-top: 40px;
    border-radius: 24px 24px 0 0;
  }

  .links {
    padding-right: calc(var(--link-gap) * 2);
    padding-left: calc(var(--link-gap) * 2);
  }

  .profile-footer {
    padding-right: calc(var(--link-gap) * 2);
    padding-left: calc(var(--link-gap) * 2);
  }
}

@media (min-width: 1000px) {
  .desktop-qr {
    display: block;
  }
}

@media (max-width: 374px) {
  .link-card__title {
    font-size: 14.5px;
  }
}

@media (max-width: 639px) {
  .link-card--with-thumbnail .link-card__title {
    max-width: 210px;
  }
}

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