@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@200..1000&display=swap');

* {
  box-sizing: border-box;
}

body {
  font-family: 'Nunito Sans', sans-serif;
  margin: 0;
}

#logo {
  color: #222;
  font-size: 26px;
}

ul {
  list-style-type: none;
  padding: 0;
}

a {
  text-decoration: none;
  color: #999;
}

.upper {
  text-transform: uppercase;
  font-weight: 800;
}

/* nav links */
.project {
  font-weight: 200;
  font-size: 16px;
}

.project a {
  line-height: 20px;
  transition: color 0.2s ease;
}

.project a:hover,
.project a:focus {
  color: #222;
}

#anactive {
	color: #222;
	transition: color 0.2s ease;
}

#anactive:hover, #anactive:focus{
	color: #999;
}

#active a {
	color: #222;
}

/* overlay cards */
.overlay {
  position: relative;
  width: 100%;
  max-width: 100%;
}

.cover {
  width: 100%;
  aspect-ratio: 1 / 1; /* keeps square ratio */
  object-fit: cover;
  display: block;
}

.middle {
  opacity: 0;
  transition: 0.15s ease;
  position: absolute;
  background-color: rgba(255,255,255,0.9);
  inset: 5%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.overlay:hover .middle,
.overlay:focus .middle {
  opacity: 0.8;
}

.text {
  color: #000;
  font-size: clamp(24px, 6vw, 55px);
  max-width: 90%;
  text-align: center;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-transform: uppercase;
}

h1 {
	text-transform: uppercase;
	font-weight: 400;
}

p {
	font-size: 14px;
	color: #222;
}
.piece {
	padding-bottom: 40px;
}
img.piece {
	display: block;
	max-width: 90%;
	margin: 0 auto;
}

#scroll {
  padding: 45px 0;
  transition: color 0.2s ease;
}

#scroll:hover,
#scroll:focus {
  color: #222;
}

/* mobile */
header {
  padding: 30px 0;
  text-align: center;
}

#menuToggle {
  position: absolute;
  top: 20px;
  right: 25px;
  font-size: 30px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  color: #000;
}

#menuToggle:focus {
  outline: 2px solid #007AFF;
  outline-offset: 4px;
}

.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: #fff;
  z-index: 999;
  display: none;
  justify-content: center;
  align-items: center;
}

.mobile-menu.active {
  display: flex;
}

.mobile-menu-content {
  text-align: center;
}

.mobile-menu a {
  display: block;
  font-size: 28px;
  padding: 15px 0;
}

.closebtn {
  position: absolute;
  top: 20px;
  right: 25px;
  font-size: 40px;
  color: #000;
}

main {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Tablet */
@media (min-width: 768px) {
  .home main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "web-dev graphic-design"
      "uiux ."
      "scroll scroll";
    justify-items: stretch;
  }

  #card-1 { grid-area: web-dev; }
  #card-2 { grid-area: graphic-design; }
  #card-3 { grid-area: uiux; }

  .cover {
    max-width: 100%;
    height: auto;
  }
  #scroll {
	grid-area: scroll;
	transition: color 0.2s ease;
	line-height: 20px;
	padding: 45px 0;
}
}

/* Desktop */
@media (min-width: 992px) {
  #wrapper {
    display: grid;
    grid-template-columns: 20% 2fr;
		margin: 0 2% 0 5%;
  }

  #container-sidebar {
    grid-column: 1 / 2;
    text-align: center;
		padding-right: 18%;
  }

  header {
    padding: 50px 0;
  }

  #container-main {
    grid-column: 2 / 3;
    text-align: center;
	}
	
  .overlay {
		width: 100%;
    aspect-ratio: 1 / 1;
  }

  .cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .text {
    font-size: clamp(32px, 5vw, 55px);
    max-width: 90%;
  }

  /* Remove mobile menu buttons */
  #menuToggle,
  .mobile-menu .closebtn {
    display: none;
  }

  .mobile-menu {
    position: static;
    width: auto;
    height: auto;
    display: block;
    background: none;
  }

  .mobile-menu a {
    padding-bottom: 10px;
    font-size: 16px;
		padding-top: 0;
  }
	a.upper {
		padding-bottom: 20px;
		font-size: 12px;
	}
	p {
	font-size: 18px;
	}
}