@font-face {
  font-family: Altroned;
  src: url(./assets/fonts/altroned-trial/ALTRONED\ Trial.otf);
}

@font-face {
  font-family: Monoton;
  src: url(./assets/fonts/Monoton/Monoton-Regular.ttf);
}

@font-face {
  font-family: Delight;
  src: url(./assets/fonts/Delight/Web-TT/Delight-Medium.ttf);
}

@font-face {
  font-family: Delight-light;
  src: url(./assets/fonts/Delight/Web-TT/Delight-Light.ttf);
}

:root {
  --primary-color: #3bd26c;
  --secundary-color: #0ff;
  --background-color: #222;
  --text-white: #ffffff;

  --neon-Blue: 0 0 5px #fff, 0 0 10px #fff, 0 0 20px #fff, 0 0 40px #0ff,
    0 0 80px #0ff, 0 0 90px #0ff, 0 0 100px #0ff, 0 0 150px #0ff;
  --neon-Purple: 0 0 5px #fff, 0 0 10px #a0f, 0 0 20px #a0f, 0 0 40px #a0f,
    0 0 80px #a0f, 0 0 100px #a0f, 0 0 150px #a0f;

  --border-radius-small: 4px;
}

html {
  scroll-behavior: smooth;
  scrollbar-color: var(--secundary-color) #222;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  width: 100dvw;
  font-family: Delight, Helvetica, sans-serif;
  background-color: var(--background-color);
  color: var(--text-white);
  overflow-x: hidden;
  scroll-behavior: smooth;
}

/* /////////////////////////////////////////////////////// */
/* /////////////////////// Header //////////////////////// */
/* /////////////////////////////////////////////////////// */

#hamburger {
  position: fixed;
  top: 3rem;
  left: 3rem;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1001;
  padding: 0;
}

#hamburger span {
  display: block;
  height: 3px;
  width: 100%;
  background-color: var(--secundary-color);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform-origin: center;
}

/* Transform to 'X' */
#hamburger.active span:nth-child(1) {
  transform: translateY(1.35em) rotate(45deg);
  background-color: red;
}

#hamburger.active span:nth-child(2) {
  opacity: 0;
}

#hamburger.active span:nth-child(3) {
  transform: translateY(-1.35em) rotate(-45deg);
  background-color: red;
}

/* Nav menu */
#navMenu {
  width: fit-content;
  position: fixed;
  top: 6.5rem;
  left: 3rem;
  background: #111;
  border-radius: var(--border-radius-small);
  padding: 3rem 2rem;
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 99;
}

#navMenu ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

#navMenu li {
  margin: 2rem 0;
}

#navMenu a {
  all: unset;
  text-decoration: none;
  color: white;
  font-size: 1.5rem;
}

#navMenu a:hover {
  text-decoration: underline;
}

#navMenu.active {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

header {
  a {
    position: relative;
    text-decoration: none;
    color: var(--text-white);

    width: 100dvw;
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    margin: 9em auto 0 auto;
    z-index: 20;
  }

  p {
    width: 80%;
    text-align: start;
  }

  hr {
    border: 1px solid white;
    box-shadow: var(--neon-Blue);
    width: 50%;
  }

  a > span:first-of-type {
    display: flex;
    align-items: center;
    height: 3px;

    p {
      color: var(--text-white);
      font-family: "Monoton", cursive;
      font-size: clamp(1.5rem, 5vw, 8rem);
      text-shadow: var(--neon-Blue);
      font-weight: 400;
      line-height: 2em;
      letter-spacing: 8px;
      width: fit-content;
    }

    hr {
      width: 100px;
    }
  }

  #bottomLine {
    margin-top: -1em;
    width: 37rem;
  }

  div {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    width: 37rem;

    p {
      font-family: Altroned;
      font-size: 0.8em;
      width: 100%;
    }

    p:last-of-type {
      grid-area: 1 / 2 / 2 / 3;
      text-align: end;
    }
  }
}

h1 {
  text-align: center;
  font-family: "Monoton", cursive;
  font-size: clamp(1.5rem, 5vw, 8rem);
  text-shadow: var(--neon-Blue);
  font-weight: 400;
  line-height: 2em;
  letter-spacing: 8px;
}

h2 {
  width: 70%;
  font-family: Delight;
  font-size: 3em;
  margin: 0 auto 1em auto;
}

.flicker-slow {
  animation: flicker 3s linear infinite;
}

.flicker-fast {
  animation: flicker 1s linear infinite alternate;
}

@keyframes flicker {
  0%,
  19.999%,
  22%,
  62.999%,
  64%,
  64.999%,
  70%,
  100% {
    opacity: 0.99;
  }
  20%,
  21.999%,
  63%,
  63.999%,
  65%,
  69.999% {
    opacity: 0.4;
  }
}

@media (max-width: 768px) {
  #hamburger {
    top: 1rem;
    left: 1rem;
    width: 2rem;
    height: 2rem;
  }

  #hamburger.active span:nth-child(1) {
    transform: translateY(1.1em) rotate(45deg);
  }

  #hamburger.active span:nth-child(3) {
    transform: translateY(-1.1em) rotate(-45deg);
  }

  #navMenu {
    top: 4rem;
    left: 1rem;
    padding: 2rem 1rem;
  }

  header {
    width: 100dvw;
  }

  header a {
    width: 100%;
    font-size: 1.2rem;
    flex-direction: column;
    margin: 4em 0 0 0;
  }

  header img {
    width: 30%;
    margin: 1rem auto;
  }

  header div {
    width: 80%;
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  header div p {
    text-align: flex-start;
    font-size: 0.7em;
  }

  header #bottomLine {
    width: 80%;
    margin-top: 1em;
  }
}

/* /////////////////////////////////////////////////////// */
/* ///////////////////////// Main //////////////////////// */
/* /////////////////////////////////////////////////////// */

main {
  width: 100%;
}

main hr {
  border: 1px solid white;
  box-shadow: var(--neon-Blue);
  width: 70%;
  margin: 6em auto;
}

canvas {
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  display: block;
  z-index: -1;
  filter: blur(4px);
}

p {
  font-family: delight-light, Helvetica, sans-serif;
}

.date {
  width: 70%;
  margin: 8em auto 1em auto;

  p {
    font-size: 0.8em;
  }
}

@media (max-width: 768px) {
  main hr {
    width: 60%;
  }

  .date {
    width: 100%;
    margin: 1em auto 1em auto;
  }

  h2 {
    width: 80%;
    font-size: 2em;
  }
}

/* /////////////////////////////////////////////////////// */
/* ///////////////////// Over Mij //////////////////////// */
/* /////////////////////////////////////////////////////// */

#overMij {
  width: 70%;
  margin: 4em auto;
  display: flex;
  align-items: flex-start;
  height: 100%;
  position: relative;
  gap: 5%;
  justify-content: space-evenly;
  scroll-margin-top: 200px;

  a {
    text-decoration: none;
    color: var(--text-white);
  }

  a:hover {
    text-decoration: underline;
  }

  > p {
    font-size: 1.3em;
    width: 30%;
  }

  p a {
    color: var(--secundary-color);
    text-transform: uppercase;
  }

  div {
    align-items: flex-start;
    width: 25%;

    h2 {
      font-size: 2em;
      width: 100%;
      margin: 0 0 1em 0;
      text-decoration: underline;
    }

    li {
      display: flex;
      gap: 1em;
      margin: 1em 0;
    }

    a {
      font-size: 1em;
    }
  }
}

.aboutImage {
  grid-area: 1 / 1 / 2 / 2;
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  justify-content: center;
  width: 30dvw;
  height: 40dvh;

  svg {
    position: absolute;
    height: 400px;
    z-index: 1;
    opacity: 0.5;
  }
}

.cartoonTom {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  height: 100%;

  img {
    position: absolute;
    height: 400px;
    z-index: 2;
  }

  img:nth-of-type(2) {
    position: absolute;
    z-index: 3;
    height: 128px;
    margin-left: 8.9em;
    margin-top: 2.7em;
    animation: RockArm 2s ease-in-out infinite alternate;
    transform-origin: center bottom;
    animation-delay: -1s;
  }
}

@keyframes RockArm {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(10deg);
  }
}

@media (max-width: 768px) {
  #overMij {
    flex-direction: column;
    align-items: center;
    gap: 2em;
    width: 80%;
    margin: 2em auto;
  }

  #overMij > p,
  #overMij div {
    text-align: center;
    width: 100%;
    font-size: 1em;
  }

  .aboutImage {
    grid-area: 1 / 1 / 2 / 2;
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-content: center;
    justify-content: center;
    width: 30dvw;
    height: 40dvh;

    svg {
      position: absolute;
      height: 300px;
      z-index: 1;
      opacity: 0.5;
    }
  }

  .cartoonTom img {
    height: 250px;
  }

  .cartoonTom img:nth-of-type(2) {
    margin-left: 5em;
    margin-top: 2em;
    height: 80px;
  }
}
/* /////////////////////////////////////////////////////// */
/* //////////////////// Weekly Nerds ///////////////////// */
/* /////////////////////////////////////////////////////// */

#weeklyNerds {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(3, 1fr);
  grid-column-gap: 1em;
  grid-row-gap: 4em;
  justify-content: space-evenly;
  align-items: flex-start;
  width: 70%;
  margin: 0 auto;
  scroll-margin-top: 200px;

  hr {
    height: 200px;
    width: 1px;
    margin: auto 0;
  }

  article {
    width: 100%;

    display: flex;
    flex-direction: column;
    align-items: left;
    margin: 0 auto;
    color: var(--text-white);
    text-decoration: none;

    h2 {
      order: 3;
      font-size: 1.2em;
      margin: 0;
    }

    h3 {
      order: 2;
      font-size: 0.6em;
      margin: 8px 0;
    }

    img {
      order: 1;
      width: 100%;
      aspect-ratio: 16 / 9;
      object-fit: cover;

      margin: 0 auto;
      border-radius: var(--border-radius-small);
    }
  }

  article:hover img {
    /* transform: scale(1.1); */
    border: 10px solid transparent;
    border-radius: var(--border-radius-small);
    cursor: pointer;
  }
}

#nerdPopover {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70dvw;
  height: 80vh;
  overflow-y: auto;
  padding: 2em;
  background-color: #222;
  color: white;
  z-index: 9999;
  display: none;
  border-radius: var(--border-radius-small);

  h1 {
    all: unset;
    font-family: Delight;
    font-size: 2em;
    color: var(--text-white);
    margin: 1em 0;
    width: 100%;
  }

  h2,
  h3 {
    margin: 1em 0 0.2em 0;
    font-size: 1.5em;
  }

  h4 {
    margin: 1em 0;
    font-size: 1em;
  }

  img {
    width: 40%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: var(--border-radius-small);
    margin-bottom: 1em;
  }

  a {
    color: var(--secundary-color);
  }

  pre {
    background-color: #222;
    padding: 1em;
    border-radius: var(--border-radius-small);
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
  }
}

#nerdOverlay {
  position: fixed;
  top: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.7);
  width: 100vw;
  height: 100vh;
  z-index: 9998;
  display: none;
}

.no-scroll {
  overflow: hidden;
  height: 100vh; /* prevents scroll caused by tall elements */
}

@media (max-width: 768px) {
  #weeklyNerds {
    grid-template-columns: 1fr;
    grid-row-gap: 2em;
  }

  #weeklyNerds article img {
    width: 100%;
  }

  #nerdPopover {
    width: 90vw;
    height: 90vh;
    padding: 1em;
  }

  #nerdPopover img {
    width: 100%;
  }
}

/* /////////////////////////////////////////////////////// */
/* ////////////////////// Projects /////////////////////// */
/* /////////////////////////////////////////////////////// */

#projecten {
  width: 70%;
  margin: 0 auto;

  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2em;
  scroll-margin-top: 200px;

  img {
    cursor: pointer;
    height: 20dvw;
    aspect-ratio: 1/1;
    object-fit: cover;
    border-radius: var(--border-radius-small);
  }
}

.popover {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  display: none;
}

.popover iframe {
  width: 100%;
  height: 100%;
  border-radius: var(--border-radius-small);
  border: none;
}

.popover.phone {
  width: 400px;
  aspect-ratio: 9 / 16;
}

.popover.desktop {
  width: 70dvw;
  aspect-ratio: 16 / 9;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9998;
  display: none;
}

.close-btn {
  position: absolute;
  top: -35px;
  left: -35px;
  font-size: 18px;
  border-radius: var(--border-radius-small);
  cursor: pointer;
  background: crimson;
  color: white;
  border: none;
  padding: 4px 8px;
  z-index: 10000;
}

@media (max-width: 768px) {
  #projecten img {
    width: 80%;
    height: auto;
  }

  .popover.desktop,
  .popover.phone {
    width: 90vw;
    height: auto;
    aspect-ratio: auto;
  }

  .close-btn {
    top: -20px;
    left: -20px;
    font-size: 14px;
  }
}

/* /////////////////////////////////////////////////////// */
/* ///////////////////// Reflectie /////////////////////// */
/* /////////////////////////////////////////////////////// */

#reflectie {
  width: 70%;
  margin: 4em auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1em;

  scroll-margin-top: 200px;

  article {
    width: 49%;
    padding: 1em;
  }

  .leerdoel {
    width: 100%;
  }

  h2 {
    width: 100%;
    font-size: 2em;
    margin: 3em 0 1em 0;
  }

  h3 {
    font-size: 1.5em;
    margin: 0 0 1em 0;
  }
  h4 {
    font-size: 1.2em;
    margin: 1em 0 0.2em 0;
  }
}

@media (max-width: 768px) {
  #reflectie {
    width: 90%;
  }

  #reflectie article {
    width: 100%;
    padding: 0.5em;
  }

  #reflectie h2 {
    font-size: 1.5em;
  }

  #reflectie h3 {
    font-size: 1.2em;
  }

  #reflectie h4 {
    font-size: 1em;
  }
}
