:root {
  --header-height: 61px;
  --text-color: rgba(255,255,255,1);
  --color2: #222;
  --text-glow: 0.3;
  --border-glow: 0.5;
}

html {
  box-sizing: border-box;
  font-family: monospace;
  font-weight: bold;
  color: var(--text-color);
  scroll-behavior: smooth;
}

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

/* Header ======================== */

#navbar {
  width: 100vw;
  height: var(--header-height);
  position: fixed;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: black;
  box-shadow: 0 0 2px rgba(255,255,255,var(--border-glow));
}

#nav-left {
  display: flex;
  align-items: center;
}

#header-img {
  width: 41px;
  height: 40px;
  margin-left: 15px;
  filter: invert(1) brightness(2);
}

#logo {
  font-size: 27px;
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: -3px;
  margin-left: 5px;
  padding-bottom: 2px;
}

#nav-right {
  display: flex;
  align-items: center;
}

.nav-link {
  padding: 20px;
  font-size: 15px;
  color: var(--text-color);
  text-decoration: none;
  text-shadow: 0 0 10px rgba(255,255,255,var(--text-glow));
}

.nav-link:hover {
  background-color: #111;
  clip-path: polygon(
    15px 0%,
    calc(100% - 0px) 0%,
    100% calc(100% - 15px),
    calc(100% - 15px) 100%,
    0px 100%,
    0% 15px
  );
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 1);
  cursor: pointer;
  filter: grayscale(0%);
}

.nav-link:active {
  background-color: #222;
  transform: scale(0.95);
}

/* Global ======================== */

section {
  background-color: black;
  min-height: 100vh;
}

h1 {
  font-size: 35px;
  text-align: center;
  text-shadow: 0 0 10px rgba(255,255,255,var(--text-glow));
}

h2 {
  text-align: center;
  padding: 17px;
  margin-top: var(--header-height);
  font-size: 30px;
  text-shadow: 0 0 10px rgba(255,255,255,var(--text-glow));
}

/* Home ========================== */

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

#welcome-section p {
  font-size: 16px;
  margin-top: 17px;
  margin-bottom: 100px;
  font-weight: normal;
  text-shadow: 0 0 5px rgba(255,255,255,var(--text-glow));
}

#arrow-link {
  width: 30px;
  height: 38px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  margin-top: calc(100vh - 60px);
}

#arrow-link:hover #arrows-wrapper{
  cursor: pointer;
}

#arrow-link:hover > div > div {
  animation: none;
}

#arrow-link:active #arrows-wrapper{
  transform: scale(1.05);
  filter: brightness(2);
}

#arrows-wrapper {
  width: 30px;
  height: 38px;
  display: flex;
  justify-content: center;
}

#arrow-container1 {
  height: 24px;
  width: 24px;
  display: flex;
  justify-content: center;
  position: absolute;
  animation: flicker1 1.5s linear infinite;
}

#arrow-container2 {
  height: 24px;
  width: 24px;
  display: flex;
  justify-content: center;
  position: absolute;
  margin-top: 8px;
  animation: flicker2 1.5s linear infinite;
}

#arrow-container3 {
  height: 24px;
  width: 24px;
  display: flex;
  justify-content: center;
  position: absolute;
  margin-top: 16px;
  animation: flicker3 1.5s linear infinite;
}

#arrow1, #arrow2, #arrow3 {
  width: 24px;
  height: 24px;
  max-width: 24px;
  max-height: 24px;
  filter: invert(1) brightness(2);
  position: absolute;
}

#arrow-blur1, #arrow-blur2, #arrow-blur3 {
  width: 24px;
  height: 24px;
  max-width: 24px;
  max-height: 24px;
  filter: invert(1) brightness(0.5) blur(2px);
  position: absolute;
  z-index: 0;
}

/* Projects ====================== */

#projects {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.tiles-wrapper {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  padding: 2rem;
  width: 85%;
  margin: 0 auto;
}

.project-tile {
  background-color: black;
  filter: grayscale(100%);
}

.project-tile:hover {
  background-color: #111;
  clip-path: polygon(
    50px 0%,
    calc(100% - 0px) 0%,
    100% calc(100% - 50px),
    calc(100% - 50px) 100%,
    0px 100%,
    0% 50px
  );
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
  cursor: pointer;
  filter: grayscale(0%);
}

.project-tile:active {
  transform: scale(0.98);
  background-color: #222;
}

.project-tile a {
  text-decoration: none;
  color: var(--text-color);
}

img:not(#header-img) {
  width: 100%;
}

.project-label {
  padding: 10px;
  display: flex;
  text-align: center;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  text-shadow: 0 0 10px rgba(255,255,255,var(--text-glow));
}

/* Contact ======================= */

#contact {
  display: flex;
  flex-direction: column;
}

#contact-header {
  text-align: center;
  width: 100%;
}

.profile-links {
  margin-top: auto;
  margin-bottom: auto;
  display: flex;
  justify-content: space-evenly;
  gap: 1rem;
}

#profile-link {
  padding: 10px 10px;
  position: relative;
  color: var(--text-color);
  text-decoration: none;
  font-size: 20px;
  text-shadow: 0 0 10px rgba(255,255,255,var(--text-glow));
  box-shadow: 0 0 1px rgba(255,255,255,var(--border-glow));
}

#profile-link:hover {
  background-color: #111;
  clip-path: polygon(
    15px 0%,
    calc(100% - 0px) 0%,
    100% calc(100% - 15px),
    calc(100% - 15px) 100%,
    0px 100%,
    0% 15px
  );
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
}

#profile-link:active {
  background-color: #222;
  transform: scale(0.95);
}

/* Footer ======================== */

footer {
  min-height: 60px;
  padding-top: 10px;
  padding-bottom: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: black;
  box-shadow: 0 0 2px rgba(255,255,255,var(--border-glow));
  text-shadow: 0 0 0px rgba(255,255,255,var(--text-glow));
  color: #333;
  font-weight: normal;
  font-size: 10px;
  text-align: center;
}

footer a {
  color: #555;
}

/* Responsiveness & Keyframes ==== */

@media only screen and (max-width: 1024px) {
  .tiles-wrapper {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media only screen and (max-width: 600px) {
  .tiles-wrapper {
    grid-template-columns: 1fr;
  }
}

@media only screen and (max-width: 540px) {
  #nav-right {
    flex-direction: column;
    align-items: flex-end;
    margin-left: 30px;
    margin-right: 10px;
  }
  .nav-link {
    font-size: 10px;
    padding: 2px 5px;
    text-shadow: 0 0 5px rgba(255,255,255,var(--text-glow));
  }
  .nav-link:hover {
    clip-path: polygon(
      5px 0%,
      calc(100% - 0px) 0%,
      100% calc(100% - 5px),
      calc(100% - 5px) 100%,
      0px 100%,
      0% 5px
    );
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 1);
  }
}

@keyframes flicker1 {
  0% {
    filter: brightness(0);
  }
  10% {
    filter: brightness(0);
  }
  20% {
    filter: brightness(1);
  }
  40% {
    filter: brightness(1);
  }
  80% {
    filter: brightness(0);
  }
  100% {
    filter: brightness(0);
  }
}

@keyframes flicker2 {
  0% {
    filter: brightness(0);
  }
  20% {
    filter: brightness(0);
  }
  30% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1);
  }
  90% {
    filter: brightness(0);
  }
  100% {
    filter: brightness(0);
  }
}

@keyframes flicker3 {
  0% {
    filter: brightness(0);
  }
  30% {
    filter: brightness(0);
  }
  40% {
    filter: brightness(1);
  }
  60% {
    filter: brightness(1);
  }
  100% {
    filter: brightness(0);
  }
}
