@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,300;0,500;0,700;1,700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Bevan&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Vollkorn:wght@400;700&display=swap');

:root {
  --navbar-color: #8688ff;
  --link-anim-color: #ff8686;
}

* {
    /* border: 1px solid black; */
    margin: 0;
    padding: 0;
}

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

html {
  font-size: 10px;
}

body {
  font-size: 1.6rem;

  text-align: center;
}

/* General elements */

a:any-link {
  text-decoration: none;
  color: #111111;
}

h1, h2, h3, h4 {
  font-family: 'Bevan', cursive;
}

p {
  font-family: 'Vollkorn', serif;
}

a {
  font-family: 'Montserrat', sans-serif;
}

/* Navbar */

#navbar {
  position: fixed;
  width: 100%;
  z-index: 1;

  display: flex;

  justify-content: flex-end;

  background-color: var(--navbar-color);
}

@keyframes navbar-a-anim {
  100% {
    background-color: var(--link-anim-color);
  }
}

#navbar > a {
  padding: 15px;

  font-size: 3rem;
  font-weight: bold;
  font-style: italic;

  animation-fill-mode: forwards;
  animation-duration: 0.25s;
}

/* Lesser padding and smaller font for small screens */
@media(max-width: 600px) {
  #navbar > a {
    padding: 5px;
  
    font-size: 2.5rem;
  }
}

#navbar > a:last-child {
  margin-right: 30px;
}

/* Small margin for small screens */
@media(max-width: 600px) {
  #navbar > a:last-child {
    margin-right: 5px;
  }
}

#navbar > a:hover {
  animation-name: navbar-a-anim;
}

main {
  background-color: rgb(225, 225, 255);
}

/* Welcome section */

#welcome-section {
  height: 100vh;

  display: flex;

  flex-direction: column;
  justify-content: center;
  align-items: center;

  background:
    linear-gradient(
      rgba(10, 10, 10, 1) 0%,
      rgba(100, 100, 150, 0.75) 70%,
      rgba(225, 225, 255, 1) 100%),
    url("https://raw.githubusercontent.com/Shadou1/freecodecamp-projects/master/responsive-web-design/Personal%20Portfolio%20Page/welcome_back.png");

  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

#welcome-section > h1 {
  font-size: 5rem;

  text-shadow:
    0px 0px 20px lightsteelblue,
    0px 0px 20px lightsteelblue;
}

@keyframes welcome-p-back-anim {
  100% {
    background-position-x: right;
  }
}

#welcome-section > p {
  font-size: 3rem;

  cursor: help;

  border-bottom: 5px solid black;

  background: linear-gradient(
    45deg,
    rgb(23, 30, 46),
    rgb(169, 181, 206),
    var(--navbar-color),
    var(--link-anim-color),
    rgb(23, 30, 46),
    rgb(169, 181, 206)
  );
  background-size: 500%;

  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;

  animation: welcome-p-back-anim 3s linear infinite;
}

/* Tooltip using ::after */

#welcome-section > p::after {
  /* Utilizing the contents of the info attribute */
  content: attr(info);

  position: absolute;
  width: 500px;
  height: 125px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, 100%);

  color: #eee;

  opacity: 0;
  visibility: hidden;

  animation-duration: 0.5s;
  animation-fill-mode: forwards;
}

/* Various adjustments of the tooltip for the smaller screens */

@media(max-width: 600px) {
  #welcome-section > p::after {
    width: 90%;
    height: 130px;
  }
}

@media(max-height: 550px) {
  #welcome-section > p::after {
    font-size: 2rem;
  }
}

@media(max-height: 350px) {
  #welcome-section > p::after {
    height: 0px;
  }
}

@keyframes p-after-anim {
  100% {
    transform: translate(-50%, 80%);
    opacity: 1;
    visibility: visible;
  }
}

#welcome-section > p:hover::after {
  animation-name: p-after-anim;
}

/* Projects */

#projects {
  margin: 0 auto;

  max-width: 1400px;
}

#projects > p {
  margin: 0 15px;
  margin-bottom: 60px;

  font-size: 3rem;
  font-weight: bold;
}

img {
  width: 100%;
  height: auto;

  background-color: black;
}

.projects-grid {
  margin: 0px 30px;

  display: grid;

  grid-template: 1fr 1fr / 1fr 1fr;
  justify-items: center;

  gap: 30px;
}

/* Only one column on the smaller screens */
@media(max-width: 900px) {
  .projects-grid{
    grid-template-columns: 1fr;
  }
}

@media(max-width: 550px) {
  .projects-grid{
    margin: 0px 10px;
    gap: 10px;
  }
}

.project-tile {
  position: relative;

  max-width: 500px;
  max-height: 600px;

  /* border: 5px solid black; */
}

/* Initially bigger project tile on smaller screens */
@media(max-width: 900px) {
  .project-tile{
    max-width: 600px;
    max-height: 700px;
  }
}

.project-tile > p.about {
  padding: 10px;

  font-size: 2.5rem;

  background-color: black;
  color: #EEE;
}

@keyframes project-tile-info-anim {
  100% {
    opacity: 1;
  }
}

.project-tile > div.info {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  /* padding: 15px; */

  font-size: 3rem;

  background-color: rgba(10, 10, 10, 0.8);
  color: #EEE;

  opacity: 0;

  animation-duration: 0.5s;
  animation-fill-mode: forwards;
}

.project-tile > div.info:hover {
  animation-name: project-tile-info-anim;
}

.project-tile > div.info > p {
  position: absolute;
  width: 90%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Contacts */

#contacts {
  height: 80vh;

  display: flex;
  flex-direction: column;
  justify-content: center;

  background: 
  linear-gradient(
    rgba(225, 225, 255, 1) 0%,
    rgba(100, 100, 150, 0.75) 70%,
    rgba(10, 10, 10, 1) 100%),
  url("https://raw.githubusercontent.com/Shadou1/freecodecamp-projects/master/responsive-web-design/Personal%20Portfolio%20Page/contacts_back.png");

  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

#contacts > p {
  font-size: 3rem;
  font-weight: bold;
}

#contacts-table {
  display: flex;
  flex-direction: row;
  justify-content: center;
  flex-wrap: wrap;
}

#contacts-table > a {
  margin: 30px;

  font-size: 4rem;
  animation-duration: 0.25s;
}

@keyframes contacts-anim {
  50% {
    transform: scale(1.1);
  }
}

#contacts-table > a:hover {
  animation-name: contacts-anim;
}

@media(max-height: 500px) {
  #contacts-table > a {
    font-size: 2rem;
  }
}

/* Footer */

footer {
  padding: 10px;

  background-color: rgba(10, 10, 10, 1);
}

footer > p {
  font-size: 2rem;
  text-align: right;

  color: white;
}

@media(max-width: 550px) {
  footer > p {
    font-size: 1.5rem;
  }
}

footer > p > a:any-link{
  color: white;
  text-decoration: underline;
}