*,
*:before,
*:after {
  box-sizing: border-box;
}

body,
hgroup,
div,
section,
header,
footer,
main {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
}

h1,
h2,
h3,
h4,
h5,
h6,
p {
  margin: 0;
  padding: 0;
}

body {
  --color-accent: #fb7c7c;
  --color-text: #444444;
  --color-header-text: light-dark(#383838, #fff);
}

body {
  color-scheme: light dark;
  background-color: light-dark(#fffdfe, #303030);
  padding: 30px;
  justify-content: center;
  font-family: Domine;
  color: var(--color-text);
}

main {
  gap: 20px;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

header {
  a {
    text-decoration: none;
    color: unset;
  }
  h2 {
    color: var(--color-accent);
    font-size: 24px;
    font-weight: 600;
    width: min-content;
    text-wrap: nowrap;

    &:hover {
      background-image: url("data:image/svg+xml;charset=utf8,%3Csvg id='squiggle-link' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:ev='http://www.w3.org/2001/xml-events' viewBox='0 0 20 4'%3E%3Cstyle type='text/css'%3E.squiggle{animation:shift .5s linear infinite;}@keyframes shift {from {transform:translateX(0);}to {transform:translateX(-20px);}}%3C/style%3E%3Cpath fill='none' stroke='%23fb7c7c' stroke-width='2' class='squiggle' d='M0,3.5 c 5,0,5,-3,10,-3 s 5,3,10,3 c 5,0,5,-3,10,-3 s 5,3,10,3'/%3E%3C/svg%3E");
      background-position: 0 100%;
      background-size: auto 6px;
      background-repeat: repeat-x;
      text-decoration: none;
    }
  }
  h1 {
    font-size: 48px;
    font-weight: 300;
    color: var(--color-header-text);
  }
}

#bento {
  width: 100%;
  aspect-ratio: 16/9;
  display: grid;
  grid-template-rows: repeat(6, 1fr);
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.item {
  display: flex;
  flex-direction: column;
  background-color: #fff4f3;
  border-radius: 10px;
  border: 1px solid #fbc9c9;
  overflow: hidden;
  text-decoration: none;
  position: relative;
  color: var(--color-text);

  transition: transform 0.3s ease-in-out, box-shadow 0.5s ease-in-out;
  &:hover {
    box-shadow: 0px 0px 15px #fb7c7c9a;
    transform: scale(1.03);
  }
}

#puzzles {
  grid-column: span 3;
  grid-row: span 4;
  background-color: #fedcdc;

  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 0 24px;

  .left {
    grid-row: 1;
    gap: 16px;
    justify-content: center;
    img {
      width: 60%;
      aspect-ratio: 1;
      height: unset;
    }
  }

  .right {
    grid-column: span 2;
    justify-content: flex-end;
    padding-bottom: 24px;
    gap: 16px;
    h2 {
      font-family: Domine;
      font-weight: normal;
      font-size: 60px;
      line-height: 0.9;
    }
    p {
      font-size: 16px;
      text-decoration: none;
      color: var(--color-accent);
    }
  }

  .puzzle-img {
    transform: rotate(9deg);
    transition: transform 1.5s;
  }

  .robot-img {
    transform: rotate(-9deg);
    transition: transform 1.5s;
  }

  &:hover {
    .puzzle-img {
      transform: rotate(-9deg);
    }

    .robot-img {
      transform: rotate(9deg);
    }
  }
}

#resume {
  grid-row: span 2;
  justify-content: flex-end;
  padding: 16px;
  flex-direction: row;

  img {
    position: absolute;
    transform: rotate(17deg);
    top: 60px;
    left: -20px;
    width: 220px;
    z-index: 20;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    transition: top 1.5s;
  }

  h2 {
    z-index: 40;
    font-size: 20px;
    line-height: 1.2;
  }

  &:hover {
    img {
      top: 10px;
    }
  }
}

#trees {
  grid-row: span 4;
  background-color: #fedcdc;
  text-align: center;
  font-size: 18px;
  align-items: center;
  justify-content: center;
  gap: 16px;

  .pill {
    width: 80%;
    background-color: var(--color-accent);
    padding: 24px;
    border-radius: 15%;
    transition: transform 1.5s;
  }

  &:hover {
    .pill {
      transform: scale(0.9);
    }
  }
}

#interview {
  grid-row: span 2;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 16px;

  h2 {
    font-size: 22px;
  }

  svg {
    stroke: var(--color-text);
    transition: stroke 1.5s, transform 1.2s;
  }

  &:hover {
    svg {
      stroke: var(--color-accent);
      transform: scale(1.5);
    }
  }
}

#docs {
  grid-row: span 2;
  padding: 16px;
  align-items: center;
  justify-content: space-between;

  .pill {
    transition: background-color 2s;
    background-color: var(--color-accent);
    color: white;
    text-align: center;
    text-wrap: nowrap;
    font-size: 10px;
    line-height: 1.5;
    padding: 16px;
    border-radius: 16px;
  }

  @media (min-width: 1200px) {
    .pill {
      font-size: 14px;
    }
  }

  img {
    width: 25%;
  }

  &:hover {
    .pill {
      background-color: var(--color-text);
      color: var(--color-accent);
    }
  }
}

#sonnet {
  grid-row: span 2;
  text-align: center;
  padding: 12px 8px;

  h2 {
    z-index: 40;
  }

  img {
    position: absolute;
    transform: rotate(-20deg);
    width: 180px;
    top: 60px;
    right: -20px;
    transition: top 1.5s;
    z-index: 20;
  }

  &:hover {
    img {
      top: 40px;
    }
  }

  h2 {
    font-size: 22px;
  }
  .target {
    font-size: 16px;
  }
}

@media (max-width: 1200px) {
  header h1 {
    font-size: 36px;
  }

  #puzzles .right h2 {
    font-size: 48px;
  }
}

@media (max-width: 800px) {
  body {
    padding: 20px 10px;
  }

  header {
    h2 {
      font-size: 20px;
    }
    h1 {
      font-size: 50px;
    }
  }
  #bento {
    width: 100%;
    display: flex;
    gap: 12px;
  }

  .item {
    min-height: 160px;
  }

  #resume {
    align-items: center;
    padding: 20px 20px;
    justify-content: space-around;
    text-align: center;
    img {
      position: unset;
      transform: rotate(-3deg);
      width: 140px;
      box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    }
  }

  #trees {
    grid-template-columns: 1;
    padding: 10px 0;
    .pill {
      width: 70px;
      height: 120px;
      position: relative;

      img {
        position: relative;
        left: -20px;
        height: 100px;
        width: 60px;
      }
    }
  }

  #puzzles {
    padding: 20px;
  }

  #puzzles .right h2 {
    font-size: 36px;
  }

  #docs {
    gap: 20px;
  }

  #sonnet {
    justify-content: center;
    img {
      transform: rotate(0);
      right: 20px;
      width: 140px;
    }
  }

  #puzzles .right h2 {
    font-size: 28px;
  }
}
