/*
* ayushsplaining index V1.0
* Copyright 2022, Ayush Mukherjee
* Free to use under the MIT license.
* 11/22/2022
*/


/* Table of contents
––––––––––––––––––––––––––––––––––––––––––––––––––
- Variables
- Typography
- Components
- Layout
- Utilities
- Media Queries
*/


/* Variables
–––––––––––––––––––––––––––––––––––––––––––––––––– */


/* Typography
–––––––––––––––––––––––––––––––––––––––––––––––––– */
.title {
    font-family: var(--ff-heading);
    font-size: clamp(2.5rem, 8vw + 1rem, 9rem);
    font-weight: 500;
    color: var(--color-primary);
    text-align: center;
    text-transform: lowercase;
}

.theme {
    font-family: var(--ff-text);
    font-size: clamp(0.75rem, 2.5vw + 0.25rem, 3rem);
    color: var(--color-primary-light);
    text-transform: uppercase;
    text-decoration: none;
}


/* Components
–––––––––––––––––––––––––––––––––––––––––––––––––– */
body {
    background-color: var(--color-bg);
}

.social>svg{
    fill: var(--color-primary-light);
    width: 30px;
    height: 30px;
}

.background-img>img {
    width: clamp(12.5vw, 50vw, 50rem);
}

.rotator {
    display: flex;
    align-items: center;
    justify-content: center;
    width: clamp(3rem, 12vw, 12rem);
    aspect-ratio: 1;
}

.rotator>img {
    width: 60%;
}


/* Layout
–––––––––––––––––––––––––––––––––––––––––––––––––– */
main {
    margin: 15px;
}

.titlecloud {
    margin-inline: auto;
}

.title,
.background-img {
    margin: clamp(3rem, 20vh + 1rem, 10rem) 0 0 0;
}

.themes,
.socials {
    display: flex;
    flex-grow: 1;
    gap: 1rem;
    align-items: center;
    justify-content: center;
}

.background-img {
    position: absolute;
    inset: 0;
    margin-inline: auto;
}

.background-img {
    z-index: -10;
}

.background-img>img {
    display: block;
    margin-inline: auto;
    translate: -8vw;
}

.rotator {
    position: absolute;
    inset: 0;
    margin-inline: auto;
    translate: calc(50% + 24vw) calc(50% + 24vh);
    scale: -1 1;
    z-index: -2;
}

.socials {
    margin: 5rem;
}


/* Utilities
–––––––––––––––––––––––––––––––––––––––––––––––––– */
.theme:focus {
    color: var(--color-primary);
}

.social:focus>svg {
    fill: var(--color-primary);
}


/* Media Queries
–––––––––––––––––––––––––––––––––––––––––––––––––– */
@media(min-width: 900px) {
    .titlecloud,
    .background-img {
        max-width: var(--max-viewport-width);
    }

    .titlecloud {
        position: relative;
    }

    .themes {
        display: initial;
    }

    .theme {
        position: absolute;
        left: 50%;
        text-transform: lowercase;
    }
    
    .theme:nth-child(1) {
        top: clamp(0vh, 9%, 3.5vh);
        translate: clamp(-29vw, -240%, -5vw);
    }

    .theme:nth-child(2) {
        bottom: clamp(0vh, 9%, 3.5vh);
        translate: clamp(-18vw, -300%, -5vw);
    }

    .theme:nth-child(3) {
        top: clamp(0vh, 9%, 3.5vh);
        translate: -80%;
    }

    .theme:nth-child(4) {
        bottom: clamp(0vh, 9%, 3.5vh);
        translate: 20%;
    }

    .theme:nth-child(5) {
        top: clamp(0vh, 9%, 3.5vh);
        translate: clamp(5vw, 180%, 25vw);
    }

    .theme {
        transition: color var(--transition-delay-short) ease-out;
    }
    
    .theme:hover,
    .theme:focus-visible {
        color: var(--color-primary);
    }
    
    @keyframes rotation {100% {rotate: 1turn}}
    .rotator>img {
        animation: rotation var(--transition-delay-long) infinite linear;
    }

    .social>svg {
        transition: fill var(--transition-delay-short) ease-out;
    }

    .social:hover>svg,
    .social:focus-visible>svg {
        fill: var(--color-primary);
    }
}
