:root {
  --page-background: #050505;
  --accent: #d080b6;
  --text-color: #f7f5f6;
  --button-text: #1f1720;
  --muted-text: rgba(247, 245, 246, 0.78);
  --card-width: 430px;
  --button-width: 268px;
  color-scheme: dark;
  font-family: Arial, "Helvetica Neue", Helvetica, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  display: grid;
  place-items: center;
  background: var(--page-background);
  color: var(--text-color);
}

button,
a {
  font: inherit;
}

.page-shell {
  width: 100%;
  max-width: var(--card-width);
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  background: var(--page-background);
}

.bio-card {
  width: 100%;
  min-height: inherit;
  padding: max(98px, env(safe-area-inset-top)) 28px max(26px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--page-background);
}

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

.profile-name {
  max-width: 100%;
  margin: 0;
  color: var(--accent);
  font-size: clamp(2.15rem, 10vw, 2.5rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
}

.profile-profession {
  margin: 15px 0 0;
  color: var(--text-color);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.avatar-frame {
  width: 180px;
  height: 180px;
  margin-top: 18px;
  padding: 2px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
}

.profile-avatar {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  object-position: center 36%;
  background: #f4efed;
}

.primary-links {
  width: min(100%, var(--button-width));
  margin-top: 26px;
  display: grid;
  gap: 8px;
}

.primary-link {
  width: 100%;
  min-height: 39px;
  margin: 0;
  padding: 8px 18px;
  display: grid;
  place-items: center;
  appearance: none;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--accent);
  color: var(--button-text);
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  transition:
    transform 160ms ease,
    filter 160ms ease,
    box-shadow 160ms ease;
}

.primary-link:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(208, 128, 182, 0.2);
}

.primary-link:active {
  transform: translateY(0) scale(0.985);
}

.primary-link:focus-visible,
.social-link:focus-visible {
  outline: 3px solid var(--text-color);
  outline-offset: 3px;
}

.social-links {
  width: 100%;
  margin-top: 39px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.social-link {
  width: 42px;
  height: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  appearance: none;
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: 50%;
  background: #f8f8f7;
  color: var(--accent);
  cursor: pointer;
  font-size: 1.16rem;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.24);
  transition:
    transform 160ms ease,
    color 160ms ease,
    background 160ms ease;
}

.social-link:hover {
  background: var(--accent);
  color: var(--button-text);
  transform: translateY(-3px);
}

.social-link:active {
  transform: translateY(0) scale(0.94);
}

.footer-text {
  margin: 20px 0 0;
  color: var(--muted-text);
  font-size: 0.75rem;
  line-height: 1.5;
}

.edit-toast {
  position: fixed;
  z-index: 10;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom));
  width: max-content;
  max-width: calc(100vw - 40px);
  padding: 11px 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(38, 33, 37, 0.96);
  color: #fff;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.35);
  font-size: 0.82rem;
  line-height: 1.35;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 14px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

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

.noscript-message {
  position: fixed;
  inset: auto 20px 20px;
  margin: 0;
  padding: 12px;
  border-radius: 8px;
  background: #fff;
  color: #111;
  text-align: center;
}

@media (min-width: 700px) {
  body {
    padding: 0;
    background: var(--page-background);
  }

  .page-shell {
    width: 100%;
    max-width: none;
    min-height: 100vh;
    min-height: 100svh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .bio-card {
    --button-width: 320px;
    min-height: 100vh;
    min-height: 100svh;
    padding: 56px 32px;
    justify-content: center;
  }

  .profile-name {
    font-size: clamp(2.5rem, 4vw, 3.25rem);
  }

  .avatar-frame {
    width: 190px;
    height: 190px;
  }

  .primary-link {
    min-height: 44px;
  }

  .social-links {
    margin-top: 34px;
  }
}

@media (max-height: 720px) {
  .bio-card {
    padding-top: max(34px, env(safe-area-inset-top));
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }

  .avatar-frame {
    width: 150px;
    height: 150px;
    margin-top: 14px;
  }

  .primary-links {
    margin-top: 20px;
    gap: 7px;
  }

  .primary-link {
    min-height: 40px;
    padding-block: 8px;
  }

  .social-links {
    margin-top: 26px;
  }
}

@media (max-width: 360px) {
  .bio-card {
    padding-inline: 22px;
  }

  .profile-name {
    font-size: 2rem;
  }

  .profile-profession {
    font-size: 0.9rem;
  }

  .social-links {
    gap: 8px;
  }

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

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