.featurelist-section {
  position: relative;
}

.featurelist {
  list-style: none;
  margin: 0.25rem 0.5rem;
  display: flex;
  flex-direction: column;
}

.featurelist-item {
  position: relative;
  display: flex;
  gap: var(--xs);
  flex-direction: column;
  align-items: center;
  margin-block: var(--xs);
  border-radius: var(--radius-md);
  background-color: hsl(var(--blue) 60% 98%);
  padding: 0.618rem;
  border: 1px solid hsl(var(--blue) 9% 75%);

  &::before {
    content: "";
    position: absolute;
    inset: var(--xs);
    background-image: radial-gradient(hsl(var(--blue) 9% 75%) 1px,
        transparent 1px);
    background-position: 50% 50%;
    background-size: 1.1rem 1.1rem;
  }
}

html.dark .featurelist-item {
  background-color: hsl(var(--blue) 100% 81% / 0.05);
  border-color: hsl(0deg 0% 100% / 0.05);

  &::before {
    background-image: radial-gradient(hsl(0deg 0% 100% / 0.1) 1px,
        transparent 1px);
  }
}

.feature-text {
  margin: var(--sm) 0;
  text-align: center;
  font-size: 1.2em;

  & .feature-title {
    margin-bottom: 0.517rem;
  }

  & .feature-subtitle {
    color: #303030;
  }
}

html.dark .feature-text {
  & .feature-subtitle {
    color: #afafaf;
  }
}

.feature-showcase {
  width: 100%;
  max-height: min-content;
  display: flex;
  justify-content: center;

  & video {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
  }

  & .shiki {
    margin-block: unset;
    width: 100%;
    height: 100%;
    /*font-size: 0.55rem;*/
    box-shadow: var(--shadow-md);
  }

  & .showcase-desktop {
    width: 100%;
    height: 100%;
    display: none;
  }

  & .showcase-mobile {
    width: 100%;
    height: 100%;
  }

  &.cloud {
    overflow: clip;
  }
}

html:not(.dark) .feature-showcase .shiki,
html:not(.dark) .feature-showcase .shiki span {
  background-color: #ffffff;
}

.feature-cloud {
  position: relative;
  margin: auto;
  max-width: 21.5rem;
  height: 100%;
  min-height: 21.5rem;
  margin-bottom: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;

  & .cloud-center {
    position: absolute;
    z-index: 2;
  }

  & .cloud-center img {
    width: 80px;
    height: 80px;
  }

  & .cloud-items-wrapper {
    position: absolute;
    width: 100%;
    height: 100%;
    animation: spin 40s linear infinite;
  }

  & .cloud-item {
    position: absolute;
    left: 50%;
    height: 50%;
    transform-origin: center bottom;
    transform: translateX(-50%);

    &>div {
      transform: rotate(0deg);
      animation: counter-spin 40s linear infinite;

      & .feature-icon {
        width: 80px;
        height: 80px;
      }
    }

    &.wayland {
      transform: translate(-50%, 0) rotate(0deg);
    }

    &.hyprland {
      transform: translate(-50%, 0) rotate(72deg);

      & .feature-icon {
        transform: rotate(-72deg);
      }
    }

    &.pipewire {
      transform: translate(-50%, 0) rotate(144deg);

      & .feature-icon {
        transform: rotate(-144deg);
      }
    }

    &.x-org {
      transform: translate(-50%, 0) rotate(216deg);

      & .feature-icon {
        transform: rotate(-216deg);
      }
    }

    &.sway {
      transform: translate(-50%, 0) rotate(288deg);

      & .feature-icon {
        transform: rotate(-288deg);
      }
    }
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes counter-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(-360deg);
  }
}

@media (min-width: 34rem) {
  .feature-showcase {
    & .showcase-desktop {
      display: unset;
    }

    & .showcase-mobile {
      display: none;
    }
  }
}

@media (min-width: 63rem) {
  .featurelist {
    max-width: 75rem;
    margin: 1rem 1.618rem;
    width: auto;
    align-items: center;
  }

  .feature-text {
    margin: 0 2.218rem;
  }

  .featurelist-item {
    width: 100%;
    padding: 1.217rem;
    justify-content: space-between;
    flex-direction: row;
  }

  .featurelist-item.right {
    flex-direction: row-reverse;
  }

  .feature-showcase {
    height: 22rem;
  }

  .feature-text {
    text-align: left;
  }

  .feature-showcase {
    width: auto;
    aspect-ratio: 16 / 9;

    & video {
      scale: 1;
    }

    & .shiki {
      font-size: 0.93rem;
    }

    .feature-cloud {
      margin-bottom: 0;
    }
  }
}
