:root {
  --chmsu-green: #057a40;
  --chmsu-dark-green: #184139;
  --chmsu-light-green: #84cda0;
  --chmsu-blue: #064f7c;
  --chmsu-gray: #949599;
}

* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  /* outline: 1px solid #949599; */
  transition-property: padding, margin, background-color, gap;
  transition-duration: 400ms;
}

.wrapper {
  container: wrap-me / inline-size;
  min-height: 100dvh;
  padding: 40px;
  display: flex;
  flex-grow: 1;
  justify-content: center;
  overflow-y: auto;
  background-color: var(--chmsu-light-green);
}

.container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1em;
  max-width: 1600px;
  padding: 40px 120px;
  background-color: white;
  border-radius: 2rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.16), 0 4px 10px rgba(0, 0, 0, 0.23);
  background-image: url(./../images/bg.png);
  background-position: center;
  background-size: cover;
}

.content-box {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex-direction: column;
  gap: 2.5em;
  --size: 1rem;
  --lh: 1em;
  & > * {
    text-wrap: balance;
  }
  h1 {
    font-size: calc(var(--size) * 8);
    line-height: calc(var(--lh) * 1.15);
    color: var(--chmsu-dark-green);
  }
  h3 {
    font-size: calc(var(--size) * 2.5);
    line-height: calc(var(--lh) * 1.25);
    color: color-mix(in srgb, var(--chmsu-gray), black 20%);
    span {
      color: var(--chmsu-green);
    }
  }
  p {
    font-size: calc(var(--size) * 1.25);
    line-height: calc(var(--lh) * 1.5);
    color: var(--chmsu-gray);
    color: color-mix(in srgb, var(--chmsu-gray), black 10%);
  }
  a {
    background-color: var(--chmsu-green);
    color: white;
    padding: 0.75em 1.25em;
    text-decoration: none;
    font-size: calc(var(--size) * 1.25);
    font-weight: 600;
    border-radius: 50px;
    margin-left: -1.25em;
    transition-property: box-shadow, scale, background-color;
    transition-duration: 500ms;
    &:hover {
      box-shadow: 0 4px 10px rgba(0, 0, 0, 0.16), 0 4px 10px rgba(0, 0, 0, 0.23);
      scale: 1.025;
    }
  }
}

.image-box {
  display: grid;
  align-items: center;
  position: relative;
  > img {
    width: 100%;
    height: auto;
    position: relative;
  }
}

.gears {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  --duration: 25s;
  & > div {
    position: relative;
    & > img {
      transition-property: top, left;
      transition-duration: 400ms;
      position: absolute;
      scale: 0.75;
      &:nth-child(1) {
        animation: rotate var(--duration) linear infinite;
        top: -258px;
        left: -133px;
      }
      &:nth-child(2) {
        animation: rotate-reverse var(--duration) linear infinite;
        top: -281px;
        left: -13px;
      }
      &:nth-child(3) {
        animation: rotate var(--duration) linear infinite;
        top: -193px;
        left: 59px;
      }
    }
  }
}

@keyframes rotate {
  0% {
    transform: rotate(0turn);
  }
  30% {
    transform: rotate(3turn);
  }
  31% {
    transform: rotate(3turn);
  }
  32% {
    transform: rotate(2.95turn);
  }
  33% {
    transform: rotate(2.95turn);
  }
  34% {
    transform: rotate(3turn);
  }
  35% {
    transform: rotate(3turn);
  }
  50% {
    transform: rotate(1.5turn);
  }
  60% {
    transform: rotate(0.5turn);
  }
  61% {
    transform: rotate(0.5turn);
  }
  62% {
    transform: rotate(0.6turn);
  }
  63% {
    transform: rotate(0.6turn);
  }
  64% {
    transform: rotate(0.5turn);
  }
  65% {
    transform: rotate(0.5turn);
  }
  93% {
    transform: rotate(3.8turn);
  }
  94% {
    transform: rotate(3.8turn);
  }
  95% {
    transform: rotate(3.9turn);
  }
  98% {
    transform: rotate(3.9turn);
  }
  99% {
    transform: rotate(4turn);
  }
  100% {
    transform: rotate(4turn);
  }
}

@keyframes rotate-reverse {
  0% {
    transform: rotate(0turn);
  }
  30% {
    transform: rotate(-3turn);
  }
  31% {
    transform: rotate(-3turn);
  }
  32% {
    transform: rotate(-2.95turn);
  }
  33% {
    transform: rotate(-2.95turn);
  }
  34% {
    transform: rotate(-3turn);
  }
  35% {
    transform: rotate(-3turn);
  }
  50% {
    transform: rotate(-1.5turn);
  }
  60% {
    transform: rotate(-0.5turn);
  }
  61% {
    transform: rotate(-0.5turn);
  }
  62% {
    transform: rotate(-0.6turn);
  }
  63% {
    transform: rotate(-0.6turn);
  }
  64% {
    transform: rotate(-0.5turn);
  }
  65% {
    transform: rotate(-0.5turn);
  }
  93% {
    transform: rotate(-3.8turn);
  }
  94% {
    transform: rotate(-3.8turn);
  }
  95% {
    transform: rotate(-3.9turn);
  }
  98% {
    transform: rotate(-3.9turn);
  }
  99% {
    transform: rotate(-4turn);
  }
  100% {
    transform: rotate(-4turn);
  }
}

@container wrap-me (max-width: 1250px) {
  .container {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    background-image: none;
  }
  .content-box {
    gap: 1.5em;
    order: 2;
    align-items: center;
    justify-content: flex-start;
    & > * {
      text-align: center;
    }
    a {
      margin-bottom: 2em;
      margin-left: unset;
    }
  }
  .image-box {
    order: 1;
  }
  .gears {
    & > div {
      & > img {
        &:nth-child(1) {
          top: -23vw;
          left: -35vw;
        }
        &:nth-child(2) {
          top: 13vw;
          left: 16vw;
        }
        &:nth-child(3) {
          top: -13vw;
          left: 22vw;
        }
      }
    }
  }
}

@container wrap-me (max-width: 850px) {
  .container {
    padding: 20px;
  }
  .gears {
    display: none;
  }
}

@media screen and (max-width: 600px) {
  .wrapper {
    padding: 0;
  }
  .container {
    padding: 20px;
    border-radius: 0;
  }

  .content-box {
    gap: 1em;
    --size: 1rem;
    --lh: 1em;
    & > * {
      text-wrap: balance;
    }
    h1 {
      font-size: calc(var(--size) * 6);
      line-height: calc(var(--lh) * 1.15);
    }
    h3 {
      font-size: calc(var(--size) * 2);
      line-height: calc(var(--lh) * 1.25);
    }
    p {
      font-size: calc(var(--size) * 1);
      line-height: calc(var(--lh) * 1.5);
    }
    a {
      font-size: calc(var(--size) * 1);
      font-weight: 600;
    }
  }
}
