:root {
  --main-red: #be3144;
  --main-gray: #303841;
  --main-white: #f0f0f0;
  --main-blue: #45567d;
}

*,
*::before,
*::after {
  padding: 0;
  margin: 0;
}

html {
  font-size: 62.5%;
  box-sizing: border-box;
  scroll-behavior: smooth;
}

/* A few media query to set some font sizes at different screen sizes.
 * This helps automate a bit of responsiveness.
 * The trick is to use the rem unit for size values, margin and padding.
 * Because rem is relative to the document font size
 * when we scale up or down the font size on the document
 * it will affect all properties using rem units for the values.
*/

/* I am using the em unit for breakpoints
 * The calculation is the following
 * screen size divided by browser base font size
 * As an example: a breakpoint at 980px
 * 980px / 16px = 61.25em
*/

/* 1200px / 16px = 75em */
@media (max-width: 75em) {
  html {
    font-size: 60%;
  }
}

/* 980px / 16px = 61.25em */
@media (max-width: 61.25em) {
  html {
    font-size: 58%;
  }
}

/* 460px / 16px = 28.75em */
@media (max-width: 28.75em) {
  html {
    font-size: 55%;
  }
}

body {
  font-family: Raleway, sans-serif;
  color: var(--main-white);
}

a,
a:visited,
a:active {
  color: var(--main-white);
  text-decoration: none;
}

ul {
  list-style: none;
}

/* header */

#navbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;

  width: 100%;
  height: 7rem;

  background-color: var(--main-red);
  font-size: 2.2rem;
  letter-spacing: 0.17rem;

  position: fixed;
  top: 0;
}

#navbar a {
  margin-right: 4rem;

  transition: 0.3s;
}

#navbar a:hover {
  color: rgb(0, 0, 0, 0.7);
  text-decoration: dotted;
}

/* welcome section */

#welcome-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1.6rem;

  height: 100vh;
  background: linear-gradient(62deg, #3a3d40 0%, #181719 100%);
  text-align: center;
}

#welcome-section h1 {
  font-size: 6rem;
}

#welcome-section p {
  font-size: 2.4rem;
  font-style: italic;
  color: var(--main-red);
}

/* projects section */

#projects {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6rem;

  min-height: 100vh;
  padding: 10rem 2rem;
  text-align: center;

  background-color: var(--main-blue);
}

#projects h1 {
  font-size: 4rem;
  line-height: 8rem;
  padding: 0 4rem;
  border-bottom: 1px solid var(--main-white);
}

.projects-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  justify-content: center;
  gap: 3.5rem;

  width: 100%;
  max-width: 128rem;
}

.project-tile {
  display: block;

  background-color: var(--main-gray);
  border-radius: 0 0 4px 4px;
}

.project-tile img {
  width: 100%;
  height: calc(100% - 6.3rem);
  max-height: 30rem;
  object-fit: cover;
}

.project-tile h3 {
  font-size: 2rem;
  font-weight: normal;
  padding: 2rem 0;
}

.project-tile .code {
  color: var(--main-gray);

  transition: color 0.3s ease-out;
}

.project-tile:hover .code {
  color: #ff7f50;
}

.show-all-button {
  font-size: 2rem;
  color: var(--main-white);
  padding: 1rem 2rem;
  border: 0;
  border-radius: 4px;
  background-color: var(--main-gray);

  transition: 0.3s ease-out;
}

.show-all-button:hover {
  background-color: var(--main-red);
}

.show-all-button i {
  margin-left: 0.5rem;
  transition: 0.3s ease-out;
}

.show-all-button:hover i {
  transform: translateX(2px);
}

/* contact section */

#contact {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6rem;

  min-height: 90vh;

  text-align: center;
  background-color: var(--main-gray);
}

.text h1 {
  font-size: 6rem;
  line-height: 8rem;
}

.text p {
  font-size: 2rem;
  font-style: italic;
}

.contact-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 3.2rem;
}

.contact-links li {
  font-size: 3rem;

  text-shadow: 2px 2px 1px #1f1f1f;
  transition: 0.3s ease;
}

.contact-links li:hover {
  transform: translateY(6px);
}

@media only screen and (max-width: 60rem) {
  .text h1 {
    font-size: 4rem;
    line-height: 8rem;
  }

  .contact-links {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 3.2rem;
  }
}

/* footer */

footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4rem;

  width: 100%;
  min-height: 10vh;

  border-top: 4px solid var(--main-red);
  background-color: var(--main-gray);
  font-size: 1.6rem;
}

footer p:first-child::before {
  content: "**";
}

@media only screen and (max-width: 60rem) {
  footer p {
    padding: 0 2rem;
  }
}
