:root {
  color-scheme: dark;
  --outer-background: #475151;
  --profile-background: #2e3939;
  --link-gap: 14px;
  --profile-width: 580px;
  --link-text: #888888;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--outer-background); }
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  color: #fff;
  background: var(--outer-background);
  font-family: Lato, Arial, sans-serif;
}

button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }
.site-shell { min-height: 100svh; padding-block-start: 40px; background: rgba(0, 0, 0, 0.2); }
.profile-frame {
  position: relative;
  width: min(100%, var(--profile-width));
  min-height: calc(100svh - 40px);
  margin-inline: auto;
  overflow: hidden;
  border-radius: 24px 24px 0 0;
  background: var(--profile-background);
  box-shadow: 0 24px 32px rgba(0, 0, 0, 0.15);
}
.top-actions { position: absolute; z-index: 5; top: 14px; right: 28px; left: 28px; display: flex; justify-content: space-between; }
.top-action {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(20, 24, 24, 0.42);
  backdrop-filter: blur(10px);
}
.top-action i { font-size: 15px; }
.share-action { cursor: pointer; transition: transform 0.2s ease, background 0.2s ease; }
.share-action:hover { background: rgba(20, 24, 24, 0.72); transform: scale(1.05); }
.profile-header { position: relative; z-index: 1; display: flex; align-items: center; flex-direction: column; }
.photo-layer {
  position: absolute;
  z-index: -1;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--profile-width);
  overflow: hidden;
  border-radius: 24px 24px 0 0;
  background: var(--profile-background);
}
.photo-layer img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 44%; filter: saturate(0.88) contrast(1.04); }
.photo-fade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(46, 57, 57, 0) 45%, rgba(46, 57, 57, 0.22) 57%, rgba(46, 57, 57, 0.84) 79%, var(--profile-background) 100%);
}
.photo-space { width: 100%; height: 500px; }
.profile-name { margin: 0; color: #fff; font-size: 24px; font-weight: 700; line-height: 28.8px; text-align: center; }
.profile-description {
  width: 100%;
  margin: 4px 0 0;
  padding-inline: 42px;
  color: #fff;
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  text-align: center;
  text-wrap: balance;
}
.social-row { display: flex; min-height: 48px; align-items: center; justify-content: center; margin-block-start: 8px; }
.social-row a {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: #fff;
  text-decoration: none;
  transition: transform 0.18s ease, opacity 0.18s ease;
}
.social-row a:hover { opacity: 0.72; transform: translateY(-2px); }
.social-row i { font-size: 18px; }
.links-container { position: relative; z-index: 2; display: flex; flex-direction: column; gap: var(--link-gap); margin-block-start: 32px; padding: 0 28px 16px; }
.link-row {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 64px;
  grid-template-columns: 64px 1fr 64px;
  align-items: center;
  border-radius: 32px;
  color: var(--link-text);
  text-decoration: none;
  background: #fff;
  transform: translateZ(0);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  will-change: transform, opacity;
}
.link-row:hover { transform: scale(1.015); box-shadow: 0 8px 18px rgba(0, 0, 0, 0.14); }
.link-logo, .link-menu { display: grid; height: 64px; place-items: center; }
.link-logo i { font-size: 19px; }
.link-menu i { font-size: 17px; }
.link-label { overflow: hidden; font-size: 16px; font-weight: 400; line-height: 19.2px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.profile-footer {
  display: flex;
  min-height: 128px;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  padding: 34px 28px 22px;
  color: rgba(255, 255, 255, 0.68);
  background: linear-gradient(180deg, rgba(46, 57, 57, 0), rgba(8, 12, 12, 0.9));
  font-size: 10px;
  text-align: center;
}
.profile-footer p { margin: 0; }
.copy-toast {
  position: fixed;
  z-index: 10;
  left: 50%;
  bottom: 20px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 15px;
  border-radius: 999px;
  color: #fff;
  background: rgba(18, 23, 23, 0.92);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.24);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.copy-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 579px) {
  .site-shell { padding-block: 0 12px; background: var(--outer-background); }
  .profile-frame { min-height: calc(100svh - 12px); border-radius: 0 0 24px 24px; box-shadow: none; }
  .top-actions { top: 14px; right: 14px; left: 14px; }
  .photo-layer { height: 100vw; border-radius: 0; }
  .photo-space { height: calc(100vw - 80px); }
  .profile-description { padding-inline: 42px; }
  .links-container { padding-inline: 14px; }
}

@media (max-width: 380px) {
  .profile-name { font-size: 22px; line-height: 27px; }
  .profile-description { padding-inline: 28px; font-size: 14px; line-height: 21px; }
  .links-container { margin-block-start: 26px; }
  .link-row { grid-template-columns: 56px 1fr 56px; }
}

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