html,
body {
    height: 100%;
    overflow: hidden;
}

.skills-wheel {
    --orbit-radius: 70vw;

    height: 175vw;
    width: 175vw;
    min-width: 2250px;
    min-height: 2250px;
    background-image: url('../images/Radial_Gradient.png');
    background-size: 100% 100%;
    border-radius: 100%;

    position: fixed;
    top: calc(40vh + (175vw / 2) - 2rem);
    left: 50%;
    transform: translate(-50%, -50%);
    transform-origin: center center;
    animation-name: spin-wheel;
    animation-duration: 1s;
    animation-timing-function: linear;
    animation-fill-mode: both;
    animation-timeline: --skills-scroll;
    animation-range: 0% 100%;
    transition: transform 800ms cubic-bezier(0.22, 1, 0.36, 1);
}

@media (max-width: 1200px) {
    .skills-wheel {
        top: calc(60vh + (2250px / 2) - 20vw); /* Increase the offset as needed */
        --orbit-radius: 90vh;
    }
}

@media (max-width: 500px) {
    .skills-wheel {
        top: calc(50vh + (2250px / 2) - 20vw); /* Increase the offset as needed */
        --orbit-radius: 55em;
    }
}

.skills-wheel:has(.card:focus) {
    animation-name: none;
    animation-timeline: auto;
}

.skills-wheel:has(.card:nth-of-type(1):focus) { transform: translate(-50%, -50%) rotate(0deg); }
.skills-wheel:has(.card:nth-of-type(2):focus) { transform: translate(-50%, -50%) rotate(-40deg); }
.skills-wheel:has(.card:nth-of-type(3):focus) { transform: translate(-50%, -50%) rotate(-80deg); }
.skills-wheel:has(.card:nth-of-type(4):focus) { transform: translate(-50%, -50%) rotate(-120deg); }
.skills-wheel:has(.card:nth-of-type(5):focus) { transform: translate(-50%, -50%) rotate(-160deg); }
.skills-wheel:has(.card:nth-of-type(6):focus) { transform: translate(-50%, -50%) rotate(-200deg); }
.skills-wheel:has(.card:nth-of-type(7):focus) { transform: translate(-50%, -50%) rotate(-240deg); }
.skills-wheel:has(.card:nth-of-type(8):focus) { transform: translate(-50%, -50%) rotate(-280deg); }
.skills-wheel:has(.card:nth-of-type(9):focus) { transform: translate(-50%, -50%) rotate(-320deg); }

body.skills-page {
    display: grid;
    grid-template-rows: auto 1fr;
    overflow: hidden;
}

body.skills-page main {
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-timeline-name: --skills-scroll;
    scroll-timeline-axis: block;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

body.skills-page main::-webkit-scrollbar {
    display: none;
}

body.skills-page main::after {
    content: "";
    display: block;
    height: 400vh;
}

body.skills-page main > h1 {
    position: fixed;
    top: 5.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
}

@keyframes spin-wheel {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    to {
        transform: translate(-50%, -50%) rotate(-359deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .skills-wheel {
        animation: none;
    }
}


.skill {
    position: absolute;
    width: clamp(15em, 25vw, 20em);
    height: clamp(20em, 30vw, 30em);
    transform-origin: center center;
    transform: translate(-50%, -50%) rotate(var(--angle)) translateY(calc(var(--orbit-radius) * -1));
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.skill img {
    width: auto;
    height: clamp(8em, 13vw, 13em);
    object-fit: contain;
    filter: brightness(0) invert(1);
}

h2 {
  font-size: clamp(1em, 1.2vw, 2em);
}

p {
  font-size: clamp(0.75em, 1.2vw, 1.25em);
}

.skills-wheel > .card:nth-of-type(1) { --angle: 0deg; }
.skills-wheel > .card:nth-of-type(2) { --angle: 40deg; }
.skills-wheel > .card:nth-of-type(3) { --angle: 80deg; }
.skills-wheel > .card:nth-of-type(4) { --angle: 120deg; }
.skills-wheel > .card:nth-of-type(5) { --angle: 160deg; }
.skills-wheel > .card:nth-of-type(6) { --angle: 200deg; }
.skills-wheel > .card:nth-of-type(7) { --angle: 240deg; }
.skills-wheel > .card:nth-of-type(8) { --angle: 280deg; }
.skills-wheel > .card:nth-of-type(9) { --angle: 320deg; }