* {
  box-sizing: border-box;
}

html {
  min-width: 240px;
  background: #160e29;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  isolation: isolate;
  color: #000; /* цвет самого текста */
  font-family: "Times New Roman", serif; /* шрифт текста */
  font-size: 1.7rem; /* размер текста */
  text-align: center; /* текст по центру */
  -webkit-text-stroke: 0.5px #9933ff; /* тонкий фиолетовый контур */
}

/* задний фон сайта */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: #160e29 url("back2.png") center / cover no-repeat;
  animation: background-drift 18s ease-in-out infinite alternate; /* плавное движение фона */
}

/* карточка исполнителя */
main {
  width: min(760px, 100%); /* ширина карточки */
  min-height: 100vh;
  min-height: 100svh;
  margin-inline: auto;
  padding: 28px 24px 32px;
  background:
    linear-gradient(#0c091733, #0c091766), /* лёгкое затемнение */
    url("back3.png") center / 100% 100% no-repeat; /* фото под карточкой */
}

/* имя исполнителя */
h1 {
  margin: 0 0 26px;
  font-size: 2em;
  line-height: 1.25;
  overflow-wrap: anywhere;
  animation: enter 900ms ease-out both;
}

/* аватар */
.avatar {
  display: block;
  width: 300px; /* размер аватара */
  max-width: 100%;
  height: auto;
  aspect-ratio: 1;
  margin-inline: auto;
  box-shadow: 0 0 28px #a54eff33; /* свечение вокруг картинки */
  animation: enter 1s 100ms ease-out both,
    avatar-float 6s 1.1s ease-in-out infinite;
}

p {
  margin: 24px 0;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

main > p {
  animation: enter 900ms 200ms ease-out both;
}

main > p + p {
  animation-delay: 300ms;
}

h2 {
  margin: 26px 0 14px;
  font-size: 1.5em;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

nav {
  animation: enter 900ms 400ms ease-out both;
}

nav p {
  margin: 8px 0;
}

/* ссылки */
a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  color: #8000ff;
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
  -webkit-text-stroke: 0.5px #9933ff;
  transition: color 180ms ease, text-shadow 180ms ease,
    transform 180ms ease, background-color 180ms ease;
}

nav a {
  min-width: 60px;
  min-height: 52px;
  padding: 10px 14px;
  color: #a653ff;
  text-decoration: none;
}

/* иконки соцсетей */
.social-icon {
  display: block;
  width: 28px; /* размер иконки */
  height: 28px;
  flex-shrink: 0;
  fill: #080410; /* заливка иконок */
  stroke: currentColor; /* контур в цвет ссылки */
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 4px #9933ff88);
  transition: filter 180ms ease;
}

nav a:hover .social-icon,
nav a:focus-visible .social-icon {
  filter: drop-shadow(0 0 7px #b56aff);
}

a:focus-visible {
  outline: 2px solid #e7cfff;
  outline-offset: 5px;
  border-radius: 3px;
}

/* эффект при наведении мышки */
@media (hover: hover) {
  a:hover {
    color: #fff;
    text-shadow: 0 0 14px #b65aff;
    transform: translateY(-2px);
  }
}

a:active {
  transform: scale(0.95);
  color: #fff;
}

/* оформление для телефона */
@media (max-width: 700px) {
  main {
    width: 100%;
    padding: max(24px, env(safe-area-inset-top))
      max(20px, env(safe-area-inset-right))
      max(28px, env(safe-area-inset-bottom))
      max(20px, env(safe-area-inset-left));
    background-size: 100% 100%, cover;
  }

  body {
    font-size: 1.4rem;
  }

  h1 {
    margin-bottom: 24px;
    font-size: clamp(1.5rem, 5.6vw, 2.4rem);
  }

  .avatar {
    width: min(280px, 76vw);
  }

  p {
    margin: 20px 0;
  }

  nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    max-width: 380px;
    margin-inline: auto;
  }

  h2 {
    grid-column: 1 / -1;
    margin: 16px 0 4px;
    font-size: 1.2em;
  }

  nav p {
    margin: 0;
  }

  nav a {
    width: 100%;
    min-width: 0;
    min-height: 52px;
    border: 1px solid #b77bff55;
    border-radius: 6px;
    background: #140c2b99;
  }
}

/* плавное появление элементов */
@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* лёгкое покачивание аватара */
@keyframes avatar-float {
  0%, 100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-6px);
  }
}

/* медленное приближение фона */
@keyframes background-drift {
  from {
    transform: scale(1);
    opacity: 0.8;
  }

  to {
    transform: scale(1.045);
    opacity: 1;
  }
}

/* отключаем анимации, если это выбрано в настройках устройства */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
