:root {
  --page-bg: #313132;
  --page-text: #ffffff;
  --muted-text: rgba(255, 255, 255, 0.76);
  --button-bg: #ffffff;
  --button-text: #222222;
  --button-radius: 5px;
  --focus: #d6b778;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--page-bg);
}

body {
  min-height: 100%;
  margin: 0;
  background: var(--page-bg);
  color: var(--page-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

a {
  color: inherit;
}

.page-shell {
  width: min(100%, 520px);
  margin: 0 auto;
  padding: 30px 18px 40px;
}

.profile {
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
}

.avatar {
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 50%;
  background: #242425 center / cover no-repeat;
  color: #ffffff;
  font-size: 38px;
  font-weight: 700;
}

h1 {
  max-width: 100%;
  margin: 8px 0 0;
  font-size: 23px;
  line-height: 1.18;
  font-weight: 700;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.profile p {
  max-width: 35rem;
  margin: 0;
  color: var(--muted-text);
  font-size: 14px;
}

.button-list {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.main-link {
  min-height: 47px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 11px 16px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--button-radius);
  background: var(--button-bg);
  color: var(--button-text);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: transform 150ms ease, background-color 150ms ease, color 150ms ease;
}

.main-link.secondary {
  background: transparent;
  color: var(--page-text);
}

.main-link:hover,
.main-link:focus-visible {
  transform: translateY(-1px);
}

.main-link:focus-visible,
.social:focus-visible,
.grid-item:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.social-list {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 22px 0 24px;
}

.social {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
}

.social-email {
  font-size: 22px;
  font-weight: 600;
}

.social-youtube::before {
  content: "";
  width: 0;
  height: 0;
  margin-left: 3px;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 12px solid #ffffff;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
}

.grid-item {
  position: relative;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  background: #242425;
  color: #ffffff;
  text-decoration: none;
}

.grid-item img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 180ms ease, filter 180ms ease;
}

.grid-item span {
  position: absolute;
  inset: auto 0 0;
  display: block;
  padding: 22px 7px 7px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0));
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
  opacity: 0;
  transition: opacity 150ms ease;
}

.grid-item:hover img,
.grid-item:focus-visible img {
  transform: scale(1.025);
  filter: brightness(0.86);
}

.grid-item:hover span,
.grid-item:focus-visible span {
  opacity: 1;
}

.grid-item.image-failed {
  display: grid;
  place-items: end start;
  padding: 8px;
  background: #242425;
}

.grid-item.image-failed img {
  display: none;
}

.grid-item.image-failed span {
  position: static;
  padding: 0;
  background: none;
  opacity: 1;
}

@media (min-width: 720px) {
  .page-shell {
    width: min(100%, 620px);
    padding-top: 42px;
  }

  .grid {
    gap: 4px;
  }

  .profile p {
    font-size: 15px;
  }
}
