* {
    margin: 0;
    padding: 0;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: normal;
}

:root {
    --bg: #f4eded;
    --item-color: hsl(from var(--bg) calc(h - 40) calc(s - 70) calc(l - 20));
    --toggle-color: hsl(from var(--bg) calc(h - 90) calc(s - 30) calc(l - 40));
    --pin-color: hsl(from var(--bg) h s calc(l - 80));

    --item-second: hsl(from var(--bg) h calc(s + 80) calc(l - 30));
    --form-bg: hsl(from var(--bg) calc(h + 40) s calc(l - 20));
    --from-gradient: hsl(from var(--bg) calc(h + 70) s calc(l - 30));
    --to-gradient: hsl(from var(--bg) h calc(s + 90) calc(l - 20));
}

:has(input:checked) {
    --bg: #040404;

    --item-color: hsl(from var(--bg) calc(h + 40) calc(s + 70) calc(l + 50));
    --item-second: hsl(from var(--bg) h calc(s - 80) calc(l + 30));
    --pin-color: hsl(from var(--bg) h s calc(l + 80));
    --toggle-color: hsl(from var(--bg) calc(h + 90) calc(s + 30) calc(l + 40));

    .pin {
        position: relative;
        left: 3rem;
        background: #85dfdea8;
    }
}

body {
    background-color: var(--bg);
    transition: background-color 1.3s;
}

#navbar {
    display: flex;
    justify-content: center;
    align-items: center;
    list-style: none;
    gap: 10rem;
    margin-top: 5rem;
}

#navbar>li>a {
    text-decoration: none;
    color: var(--item-color);
    font-size: 1.6rem;
    padding: 0.5rem;
    font-weight: 900;
}

.bar {
    height: 0.4rem;
    border-radius: 2rem;
}

#navbar>li>a:hover+.bar {
    background-color: var(--item-second);
    animation: now 1s forwards;
}

@keyframes now {
    0% {
        width: 0%;
    }

    100% {
        width: 100%;
    }
}

.toggle {
    width: 110px;
    height: 45px;
    background-color: var(--toggle-color);
    border-radius: 3rem;
    cursor: pointer;
}

.pin {
    background-color: var(--pin-color);
    width: 55px;
    height: 40px;
    border-radius: 3rem;
    margin: 1rem 0.1rem;
    position: relative;
    top: 0.14rem;
    transition: all .5s ease-in-out;
}

#tick {
    display: none;
}

.carousel {
    width: 90%;
    margin-top: 6rem;
    overflow: hidden;
}

.track {
    display: flex;
    width: max-content;
    overflow: hidden;
    animation: scroll 10s linear infinite;
}


.track img {
    width: 4rem;
    height: 4rem;
    margin: 0 7rem;
    object-fit: contain;
    cursor: pointer;
    will-change: transform;
}

.carousel:hover .item img {
    filter: grayscale(.8);
}

.item:hover img {
    filter: grayscale(0) !important;
}

@keyframes scroll {
    100% {
        transform: translateX(-50%);
    }
}

.carousel:hover .track {
    animation-play-state: paused;
}

.item {
    width: 100%;
    height: 100%;
}

/* Using scroll snaping effect */
html {
    scroll-snap-type: y proximity;
}

section {
    height: 100vh;
    scroll-snap-align: start;
}

form {
    width: 33rem;
    padding: 3rem;
    padding-right: 4rem;
    height: 30rem;
    border-radius: 1rem;
    margin: auto;
    /* border: 2px solid black; */
    border: none;
    line-height: 1.5rem;
    background-color: var(--form-bg);
    backdrop-filter: blur(20px);
}

input {
    width: 100%;
    height: 1.5rem;
}


input,
textarea {
    outline: none;
    border: none;
    border-radius: 0.5rem;
    padding: 1rem 0.4rem;
    margin: 1rem 0;
    font-size: medium;
}

textarea {
    max-width: 100%;
    min-height: 30%;
    width: 100%;
    height: 5rem;
    overflow: hidden;
}

label {
    margin-bottom: 2rem;
}

button {
    font-size: medium;
    padding: 0.7rem;
    cursor: pointer;
    border: none;
    border-radius: 0.3rem;
}

button:hover {
    scale: 0.95;
}

.project {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3rem;
}

.project:hover .cards img {
    filter: grayscale(0.8);
}

.cards:hover img {
    filter: grayscale(0) !important;
}


.cards:hover {
    scale: 1.06;
}

.cards img {
    object-fit: cover;
    width: 100%;
    height: 100%;
}

.cards {
    width: 15rem;
    height: 15rem;
    background: #fff;
    border-radius: 1rem;
    overflow: hidden;
    cursor: pointer;
}

#about {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    line-height: 5rem;
    /* background: linear-gradient(#30d794, #faf612); */
    background: linear-gradient(45deg, var(--from-gradient), var(--to-gradient));
}

#contact {
    display: flex;
    justify-content: center;
    align-items: center;
}