@import url('https://fonts.googleapis.com/css2?family=Audiowide&family=Lalezar&family=Poppins:wght@300&display=swap');

@keyframes spin{
    from{ transform: rotate(0deg);}
    to{ transform: rotate(360deg);}
}


:root{
    --color1: #FF5733;
    --color2: #900C3F;
    --color3: #FFBF00;
    --color4: #2E294E;
    --color5: #C70039;
    --color6: #1167B1;
    --color7: #581845;
    --color8: #4CAF50;
    --color9: #FF7F50;
    --color10: #DFFF00;

    --padding-lr: calc( ( 100vw - 1100px ) / 2 ); 
}

body{
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
}

h1{
    font-family: 'Audiowide', cursive;
    font-weight: normal;
    line-height: 100%;
    margin: 0;
    color: #333;
}

h1 span{
    color: var(--color5);
}

h2, h3{
    font-family: 'Lalezar', cursive;
    font-weight: normal;
    line-height: 140%;
    margin: 0 0 .4em 0;
}

h2{
    text-transform: uppercase;
    color: var(--color7);
}

header{
    background: white;
    border-top: 12px solid #4881B2; 
    box-shadow: 0 0 7px rgba( 127, 127, 127, .4);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header a{
    display: inline-block;
    padding: .5em 1em;
    border-radius: 3px;
    color: white;
    text-decoration: none;
    background: color-mix(in srgb, var(--color2) 85%, black 15% );
}

header a::before{
    content: '➤';
    display: inline-block;
    margin-right: 12px;
    transform: rotateY(180deg);
}

header a:hover{
    background: var(--color2);
}

header,
main{
    padding: 1.3rem var( --padding-lr ); 
}

.gallery{
    padding: 0;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px 20px;
}

.gallery li a{
    color: white;
    text-decoration: none;
    display: block;
    box-sizing: border-box;
    border: 1px solid #EDEDED;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    text-align: center;
    font-size: 1.25rem;
    font-weight: bold;
    transition: .2s linear;
    text-shadow: 0 0 3px black;
}

.gallery li a:hover{
    filter: brightness(1.2);
}
  
.gallery li:nth-child(10n + 1) a { background-color: var(--color1); }
.gallery li:nth-child(10n + 2) a { background-color: var(--color2); }
.gallery li:nth-child(10n + 3) a { background-color: var(--color3); }
.gallery li:nth-child(10n + 4) a { background-color: var(--color4); }
.gallery li:nth-child(10n + 5) a { background-color: var(--color5); }
.gallery li:nth-child(10n + 6) a { background-color: var(--color6); }
.gallery li:nth-child(10n + 7) a { background-color: var(--color7); }
.gallery li:nth-child(10n + 8) a { background-color: var(--color8); }
.gallery li:nth-child(10n + 9) a { background-color: var(--color9); }
.gallery li:nth-child(10n + 10) a { background-color: var(--color10); }


.image-converter{
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}


.image-converter h2{
    text-align: center;
}

.image-converter form p{
    margin: 0;
}

.image-converter form{
    padding: 10px 40px;
    text-align: center;
    background: #fbfbfb;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 1px dashed #dedede;
}

.image-converter form label{
    display: block;
    background: var(--color2);
    color: white;
    padding: .4rem 1rem;
    font-size: .8em;
    margin-bottom: 1.5rem;
}

.image-converter .highlight:not(.uploading){
    background: #efefef;
    filter: blur(1px);
}

.image-converter form input{
    display: none;
}

.image-converter img{
    width: 100%;
    flex: 1;
    object-fit: contain;
    object-position: top center;
}

.image-converter > div{
    display: flex;
    flex-direction: column;
}

.image-converter > div > div{
    text-align: center;
    flex: 1;
    display: flex;
    padding: 10px;
    flex-direction: column;
    color: white;
    justify-content: center;
}

.image-converter > div > div.loading{
    position: relative;
}

.image-converter > div > div.loading::before{
    content: '⥁';
    display: block;
    position: absolute;
    width: 60px;
    font-size: 60px;
    line-height: 60px;
    left: calc( 50% - 30px );
    top: calc( 50% - 30px );
    animation: spin 1s infinite linear;
}

.image-converter > .image-converter-source > div{
    background: var(--color8);
}

.image-converter > .image-converter-result > div{
    background: var(--color6);
}

.image-converter > div > div,
.image-converter form{
    height: 300px;
}