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

@keyframes header-animation {
  0% {
    background-position: 0 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0 50%;
  }
}

html {
  font-family: system-ui, sans-serif;
  font-size: 20px;
  line-height: 1.5;
}

@supports (font-size: clamp(0px, 0vw, 0px)) {
  html {
    font-size: clamp(18px, 1vw, 22px);
  }
}

body {
  margin: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent,
    transparent 10px,
    #f8f8f8 10px,
    #f8f8f8 20px
  );
}

header {
  display: flex;
  align-items: center;
  background: linear-gradient(
    235deg,
    rgb(28 117 188 / 70%) 0,
    rgb(238 42 123 / 70%)
  );
  background-size: 200% 200%;
  animation: header-animation 5s ease infinite;
  padding-block: 10px 80px;
  border-radius: 0 3vw;

  .avatar {
    width: 200px;
    margin-inline: 10vw 10px;
  }

  .bio {
    color: white;

    .line-one,
    .line-two,
    .line-three {
      margin: 0;
    }

    .line-two {
      font-size: smaller;
    }

    .line-three {
      font-size: larger;
    }
  }
}

.posts {
  --max-width: 50vw;
  --margin-left-right: auto;

  margin: -105px var(--margin-left-right) 0;
  max-width: var(--max-width);

  h1 {
    display: inline-block;
    color: white;
    border: 2px dotted white;
    padding: 0 10px;
    border-radius: 0 15px;
    margin-block-end: 50px;
  }

  .post-item {
    &:not(:last-child) {
      margin-bottom: 80px;
    }

    .header {
      margin: 0;
    }

    .description-link {
      color: inherit;
      text-decoration: none;
    }
  }
}

.post {
  max-width: 800px;
  margin: 0 auto 200px;

  .secondary-header {
    margin-top: 70px;
  }

  img {
    width: 100%;
  }
}

time {
  color: #8b8b8b;
  font-size: 80%;
}

.back-arrow {
  display: block;
  font-size: 36px;
  text-decoration: none;
  color: inherit;
  margin: 30px 0 0 40px;
}

@media (prefers-reduced-motion) {
  header {
    animation: none;
  }
}

@media screen and (width <= 400px) {
  header {
    flex-direction: column;

    .avatar {
      margin-inline: 0;
    }
  }

  .posts {
    --max-width: none;
    --margin-left-right: 10px;
  }

  .back-arrow {
    margin: 10px 0 0;
  }
}

footer {
  margin-block-start: 300px;
  border-top: 1px solid #ccc;
  font-size: 70%;
  text-align: center;
  padding-top: 20px;
}

.contact-me-icon {
  vertical-align: middle;
  margin-left: 5px;
}

.flaticon-attribution {
  margin-left: 10px;
}
