@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&family=Rubik:wght@400;600&display=swap');
:root {
    --hue: 223;
    --bg: hsl(var(--hue), 90%, 95%);
    --fg: hsl(var(--hue), 90%, 5%);
    --trans-dur: 0.3s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Rubik', sans-serif !important;
    font-weight: 500;
}

::-webkit-scrollbar {
  width: 5px;
}

/* Track */
::-webkit-scrollbar-track {
  box-shadow: inset 0 0 2px grey; 
  border-radius: 10px;
}
 
/* Handle */
::-webkit-scrollbar-thumb {
  background: #920bffe8; 
  border-radius: 10px;
}

/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
  background: #920bffcd; 
}

body {
    background-color: rgb(1, 5, 20);
    color: white;
    overflow-x: hidden;
}

button:disabled,
button[disabled] {
    border: 1px solid gray;
    background-color: rgba(255, 255, 255, 0.077);
    color: gray;
    cursor: auto;
}

.container {
    width: 1000px;
    max-width: 80%;
    padding: 1.2rem;
    border-radius: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: 0 auto;
    text-align: center;
    min-height: 100dvh;
}

.container::before {
    content: '';
    width: 406px;
    height: 400px;
    position: fixed;
    top: -4rem;
    left: -4rem;
    background-color: #ffbebe;
    filter: blur(80px);
    z-index: -1;
    opacity: 40%;
}

.container::after {
    content: '';
    width: 406px;
    height: 400px;
    position: fixed;
    bottom: -4rem;
    right: -4rem;
    background-color: #befffc;
    filter: blur(80px);
    z-index: -1;
    opacity: 40%;
}

video {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
    z-index: -2;
    scale: 1.3;
    opacity: 10%;
}

form {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80%;
}

form input {
    width: 100%;
    padding: 1rem;
    border: 1px solid;
    border-radius: 10px 0 0 10px;
    color: white;
    border-right: none;
    background-color: transparent;
}

form input::placeholder {
    color: white;
}

form button {
    color: white;
    border-radius: 0 10px 10px 0;
    border-left: none;
    padding: 1rem 2rem;
    background: #7224b1;
    border: 1px solid whitesmoke;
    cursor: pointer;
}

.desc {
    margin: 0.6rem;
    max-width: 650px;
    width: 120%;
    line-height: 1.5rem;
}

.result {
    margin-top: 10px;
    width: 100%;
    padding: 10px 0 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: 1rem 0 2rem 0;
}

#image-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 10px;
    max-width: 80%;
}

#image-grid img {
    max-width: 100%;
    border-radius: 1rem;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all .4s ease;
}

#image-grid img:hover {
    border-color: whitesmoke;
    box-shadow: 0 0 15px white;
}

footer {
    color: white;
    position: fixed;
    width: 100%;
    bottom: 0;
    left: 0;
    padding: 1.2rem;
    background: rgba(0, 0, 0, 0.274);
    overflow: hidden;
}

footer a {
    text-decoration: none;
    font-weight: 700;
    color: white;
}


/* Responsive For Small Device's */

@media screen and (max-width: 500px) {
    #image-grid {
        grid-template-columns: repeat(1, 1fr);
        max-width: 100%;
    }
    form {
        width: 100%;
        flex-direction: column;
    }
    form input {
        border: 1px solid white;
        border-radius: 10px 10px 0px 0px;
    }
    form button {
        border-radius: 0px 0px 10px 10px;
        width: 100%;
        border: 1px solid whitesmoke;
    }
}


/* Loading Page */

.loaded {
    opacity: 0;
    visibility: hidden;
}

#splash {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100dvh;
    background: #010412;
    overflow: hidden;
    width: 100%;
    position: absolute;
    inset: 0;
    z-index: 99999999999999;
    transition: all .4s ease;
    -webkit-transition: all .4s ease;
    -moz-transition: all .4s ease;
    -ms-transition: all .4s ease;
    -o-transition: all .4s ease;
}

.ip {
    width: 16em;
    height: 8em;
}

.ip__track {
    stroke: hsl(var(--hue), 90%, 90%);
    transition: stroke var(--trans-dur);
}

.ip__worm1,
.ip__worm2 {
    animation: worm1 1s linear infinite;
}

.ip__worm2 {
    animation-name: worm2;
}


/* Dark theme */

@media (prefers-color-scheme: dark) {
     :root {
        --bg: hsl(var(--hue), 90%, 5%);
        --fg: hsl(var(--hue), 90%, 95%);
    }
    .ip__track {
        stroke: hsl(var(--hue), 90%, 15%);
    }
}


/* Animation */

@keyframes worm1 {
    from {
        stroke-dashoffset: 0;
    }
    50% {
        animation-timing-function: steps(1);
        stroke-dashoffset: -358;
    }
    50.01% {
        animation-timing-function: linear;
        stroke-dashoffset: 358;
    }
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes worm2 {
    from {
        stroke-dashoffset: 358;
    }
    50% {
        stroke-dashoffset: 0;
    }
    to {
        stroke-dashoffset: -358;
    }
}
