* {
  box-sizing: border-box;
}

html {
  --bg: hsl(0, 0%, 85%);
  --ws: whitesmoke;
  --bg-dark: hsl(0, 0%, 5%);
  color: var(--bg-dark);
  --accent: hsl(210, 80%, 60%);
  --shadow: 0 0 0.15rem hsla(0, 0%, 0%, 0.3),
    0 0.1rem 0.25rem hsla(0, 0%, 5%, 0.15);
  --shadow-deep: 0 0.25rem 1rem hsla(210, 20%, 20%, 0.2);
  --colorful: linear-gradient(315deg, #0cbaba 0%, #380036 74%);
  background-color: var(--ws);
  font: 112.5% "Source Sans Pro", sans-serif;
  scroll-behavior: smooth;
  /* fixes navbar covering inline links' anchor points */
  scroll-padding-top: 4em;
}

body {
	margin: 0;
}

h1,
h2 {
  margin: 0;
}

.nav {
  background-color: var(--bg-dark);
  background-image: var(--colorful);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  width: 100%;
  height: 4rem;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  /* fixes blinking cursor overlapping navbar */
  z-index: 1;
}

@media screen and (max-width: 600px) {
  .nav {
    justify-content: center;
  }
}

.nav ul {
  padding-right: 1em;
}

.nav li {
  list-style: none;
  display: inline;
}

.nav-link {
  text-transform: uppercase;
  text-decoration: none;
  color: whitesmoke;
  padding: 0.75em 1.5em 0.75em 1.5em;
  transition: all 0.2s;
}

@media screen and (max-width: 600px) {
  .nav-link {
    margin: 0;
    padding: 0.75em 0.5em 0.75em 0.5em;
  }
}

.nav-link:hover {
  color: var(--bg-dark);
  background-color: var(--ws);
}

.welcome {
  background-image: url("https://unsplash.com/photos/b18TRXc8UPQ/download?force=true&w=1920");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  box-shadow: var(--shadow);
  height: 100vh;
  display: flex;
  margin-top: -4em;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

#name {
  /* hack to trick the eye to see vertically centered text while passing fCC test; I'd prefer to create the same effect by changing .welcome height from `100vh` to `calc(100vh - 4em)` */
  padding-top: 2em;
}

#name,
#title {
  margin: 0;
}

@media screen and (min-width: 600px) {
  #name {
    font-size: 3em;
  }

  #title {
    font-size: 2em;
  }
}

.blink {
  animation: blink 1.5s linear infinite;
}

@keyframes blink {
  0% {
    opacity: 1;
  }
  75% {
    opacity: 1;
  }
  78% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}

.projects {
  background-color: var(--ws);
}

/* common to both */
.section-heading {
  font-weight: normal;
  font-size: 2em;
  text-transform: uppercase;
  text-align: center;
  padding: 0.5em 0;
}

.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(500px, 1fr));
  justify-content: space-evenly;
  column-gap: 2rem;
  row-gap: 2rem;
  padding: 0 5%;
}

.project-tile {
  border: 1px solid var(--bg);
  box-shadow: var(--shadow-deep);
}

@media (max-width: 1000px) {
  .grid-container {
    grid-template-columns: 1fr;
    padding: 0;
  }

  .project-tile {
    border-left: none;
    border-right: none;
  }
}

.project-banner {
  height: 40vh;
  width: 100%;
  background-size: cover;
  background-position: top center;
  background-repeat: no-repeat;
  border-bottom: 1px solid var(--bg);
}

.project-info {
  padding: 0.25em 1em 1em 1em;
}

.project-title {
  font-weight: normal;
  text-transform: uppercase;
  margin: 0.25em 0 0 0;
}

.project-description {
  margin: 0.25em 0 0.5em 0;
}

.button-container {
  display: flex;
  justify-content: center;
}

button {
  background-color: #380036;
  border-radius: 0.5em;
  border: none;
  color: var(--ws);
  text-align: center;
  font-size: 1em;
  padding: 0.35em 0.5em;
  transition: all 0.2s;
  margin: 0 0.25em;
}

button:hover {
  background-color: #0cbaba;
}

.contact {
  margin-top: 2rem;
}

@media screen and (max-width: 1000px) {
  .contact .button-container {
    flex-direction: column;
    align-items: center;
  }
}

.contact-button {
  font-size: 1.5em;
}

.footer {
  margin-top: 2rem;
  padding: 0 2.5em;
  background: var(--colorful);
  height: 4rem;
  color: var(--ws);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

@media screen and (max-width: 600px) {
  .footer {
    padding: 0 1em;
  }

  .footer p {
    flex-grow: 1;
  }
}

.footer p:nth-child(2) {
  text-align: right;
}

.footer a {
  color: var(--ws);
}
