/* Importing fonts from google fonts */
@import url('https://fonts.googleapis.com/css2?family=Josefin+Sans:ital,wght@0,100..700;1,100..700&display=swap');

/* Reset */
*{
    margin: 0;
    padding: 0;
    border: none;
    box-sizing: border-box;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 3px;
    height: 3px;
    border-radius: 20px;
    border: none;
}

::-webkit-scrollbar-track {
    background:#101010;
}

::-webkit-scrollbar-thumb {
    border-radius: 20px;
    border: 3px solid #bbb;
    background:var(--primary);
    border-radius:999px;
}

button,
img,
.projects-elements,
.selected,
.dropdown-list li{
    transition:.35s;
}

/* Background blur glow effect */
body::before{
    content:"";
    position:fixed;
    width:500px;
    height:500px;
    background:#8B5CF620;
    border-radius:50%;
    filter:blur(170px);
    top:-180px;
    left:-180px;
    z-index:1;
}

body::after{
    content:"";
    position:fixed;
    width:500px;
    height:500px;
    background:#6d28d950;
    background:#8B5CF620;
    border-radius:50%;
    filter:blur(170px);
    bottom:-20px;
    right:-10px;
    z-index: 0;
}

body{
    height: 100vh;
    width: 100vw;
    color: white;
    display: grid;
    grid-template-rows: auto 1fr;
    background: 
    radial-gradient(circle at top left,
    rgba(139,92,246,.12),
    transparent 35%),

    radial-gradient(circle at bottom right,
    rgba(192,132,252,.08),
    transparent 35%),

    var(--bg);
    overflow-x: hidden;
    font-family: "Josefin Sans", serif;
}

/* Navigation */
.top-nav {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 998;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom:1px solid transparent;
    transition:background .4s ease, border-color .4s ease, backdrop-filter .4s ease;
}

.nav-container {
    width: 97%;
    margin: 0 auto;
    padding: 1rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.home-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    transition: var(--transition-smooth);
    color: var(--text-muted);
}

.home-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--glass-glow);
}

.nav-title {
    letter-spacing: 2px;
    font-size: 1rem;
    font-family:"JetBrains Mono",monospace;
    color:var(--mist);
    display: block;
}

/* Menu bar (Hamburger menu) */
.menu-btn{
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    transition: var(--transition-smooth);
    color: var(--text-muted);
    cursor: pointer;
}

.menu-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--glass-glow);
}

.menu {
    font-size: 20px;
}

.mobile-menu{
    position:fixed;
    top:0;
    right:-100%;
    width:280px;
    height:100vh;
    background:rgba(10,10,15,.9);
    backdrop-filter:blur(20px);
    border-left:1px solid rgba(255,255,255,.1);
    display:flex;
    flex-direction:column;
    padding:100px 35px;
    gap:28px;
    transition:.4s ease;
    z-index:1000;
    font-family:"Inter",sans-serif;
    line-height:1.6;
}

.mobile-menu.active{
    right:0;
}

.mobile-menu a{
    color: #ffffff;
    text-decoration:none;
    font-size:18px;
    transition:.3s;
}

.mobile-menu a:hover{
    color:var(--amethyst);
    transform:translateX(6px);
}

.active-page::after {
    color: var(--amethyst);
    content: " ‹";
}

.close-btn{
    position:absolute;
    top:25px;
    right:25px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    transition: var(--transition-smooth);
    color: var(--text-muted);
    cursor: pointer;
}

.close-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--glass-glow);
}

.close {
    font-size: 20px;
}

.overlay{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.45);
    opacity:0;
    visibility:hidden;
    transition:.3s;
    z-index:999;
}

.overlay.active{
    opacity:1;
    visibility:visible;
}

/* Main section */
.container-elements {
    display: grid;
    grid-template-rows: auto 1fr;
    overflow-y: hidden;
    height: 100%;
    width: 100%;
    background: transparent;
}

.dropdown {
    display: flex;
    position: relative;
    margin: 0 20px 5px 20px;
}

.sort {
    display: flex;
    justify-content: end;
    width: 100%;
}

.selected {
    cursor: pointer;
    padding: 10px;
    width: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 1.5s ease forwards;
    background:rgba(255,255,255,.05);
    backdrop-filter:blur(15px);
    border:1px solid var(--border);
    border-radius:14px;
    transition:.35s;
    margin: 5px 0 0px 0;
}

.selected:hover{
    border-color:var(--primary);
    box-shadow: 0 0 20px rgba(139,92,246,.2);
    .arrow {
        filter: drop-shadow(0 0 5px rgba(255, 255, 255, 1));
    }
    .order {
        filter: drop-shadow(0 0 5px rgba(255, 255, 255, 1));
    }
}

.dropdown-list {
    position: absolute;
    top: 100%;
    right: 0;
    list-style: none;
    z-index: 100;
    display: none;
    animation: fadeIn 0.5s ease forwards;
    opacity: 0;
    background:#15151E;
    border-radius:14px;
    overflow:hidden;
    border:1px solid var(--border);
    border-top: none;
}

.dropdown-list li {
    width: 120px;
    padding: 10px;
    display: flex;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid rgb(255, 255, 255, 0.2);
    transition:.3s;
}

.dropdown-list li:last-child {
    border-bottom: none;
}

.dropdown-list li:hover {
    filter: drop-shadow(0 0 5px rgba(139,92,246, 1));
    background:var(--primary);
    color:white;
}

.show {
    display: block;
}

.projects {
    overflow-y: auto;
    overflow-x: hidden;
    /* max-height: calc(100vh - 100px); */
    display:  grid;
    grid-template-columns: repeat(auto-fit, minmax(min(350px, 100%), 1fr));
    gap:28px;
    padding:25px;
    margin:0;
    z-index: 1;
    background: transparent;
}

/* Project cards */
.projects-elements {
    margin: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 10px;
    position: relative;
    opacity: 0;
    animation: scaleUpXY 1s ease forwards;
    animation-delay: calc(0.2s * var(--i));
    background:rgba(255,255,255,.04);
    border:1px solid var(--border);
    backdrop-filter:blur(18px);
    border-radius:24px;
    transition:
        transform .35s,
        box-shadow .35s,
        border-color .35s;
}

.projects-elements:hover{
    transform: translateZ(-10px);
    border-color:var(--primary);
    box-shadow: 0 20px 45px rgba(139,92,246,.18);

}

.reveal {
    animation: none;
    animation-delay: 0.2s;
    opacity: 0;
}

.reveal-delay {
    animation: scaleUpXY 1s ease forwards;
    animation-delay: calc(0.2s * var(--i));
}

.in-view {
    animation: scaleUpXY 1s ease forwards;
}

.projects-elements img {
    width: 100%;
    margin: 10px;
    border-radius: 10px;

    margin:0;
    transition:.5s;
}

.project-name {
    font-size:22px;
    font-weight:700;
    margin-top:18px;
}

.projects-elements p {
    font-weight: 200;
    margin: 10px;
    color:var(--text2);
    line-height:1.8;
}

.hover-div {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    background-color: #222;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(8,8,10,.2),rgba(8,8,10,.88));
    backdrop-filter:blur(6px);
    transition:.35s;
}

.hover-div a {
    text-decoration: none;
}

.hover-button {
    background-color: white;
    color: black;
    width: 120px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
    background:var(--primary);
    color:white;
    border-radius:999px;
    font-weight:600;
    transition:.35s;
    z-index: 2;
}

.hover-button:hover{
    background:var(--primary-light);
    transform:translateY(-3px);
    box-shadow:
        0 0 25px
        rgba(139,92,246,.45);
}

.show-hover {
    opacity: 1;
}

/* Animations */

/* Slide down animation */
@keyframes slideDown {
    0% {
        transform: translateY(-50px);
        opacity: 0;
    }
    100% {
        transform: translateY(0px);
        opacity: 1;
    }
}

.slideDown {
    animation: slideDown 1s ease forwards;
}

/* Fade in animation */
@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

.fadeIn {
    animation: fadeIn 1s ease forwards;
}

/* Fade out animation */
@keyframes fadeOut {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

.fadeOut {
    animation: fadeOut 1s ease forwards;
}

.fadeOut7 {
    animation: fadeOut 0.7s ease forwards;
}

/* Reveal scale up animation */
@keyframes scaleUpXY {
    from { 
        opacity: 0;
        scale: 0.4;
        transform: translateX(-150px) translateY(-150px);
    }
    to {
        opacity: 1;
        scale: 1;
        transform: translateX(0px);
        transform: translateY(0px);
    }
}

/* Responsive */
@media (max-width: 1199px) {
    .nav-container {
        padding: 0.6rem 0;
        width: 90%;
    }

    .home {
        font-size: 15px;
    }

    .container-elements {
        font-size: 20px;
    }

    .selected {
        width: 150px;
    }

    .dropdown-list li {
        width: 150px;
    }

    .project-name {
        font-size: 24px;
    }

    .projects-elements p {
        line-height: 24px;
    }

    .projects {
        margin: 15px;
    }
}

@media (max-width: 991px) {
    .nav-container {
        padding: 0.6rem 0;
        width: 90%;
    }

    .home {
        font-size: 15px;
    }

    .container-elements {
        font-size: 18px;
    }

    .selected {
        width: 140px;
    }

    .dropdown-list li {
        width: 140px;
    }
}

@media (max-width: 768px)  {
    .projects-elements:nth-child(n+3) {
        animation-timeline: view();
        animation-range: entry 0% cover 30%;
    }
}

@media (max-width: 599px) {
    .nav-container {
        padding: 0.6rem 0;
        width: 90%;
    }

    .home {
        font-size: 15px;
    }

    .selected {
        width: 140px;
    }

    .dropdown-list li {
        width: 140px;
    }

    .projects-elements p {
        font-size: 14px;
    }
}

@media (max-width: 399px) {
    .nav-container {
        padding: 0.5rem 0;
        width: 95%;
    }

    .nav-title {
        font-size: 0.8rem;
    }

    .container-elements {
        font-size: 12px;
    }

    .projects {
        grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
        margin: 10px;
    }

    .projects-elements p {
        font-size: 14px;
    }
}

@media (max-width: 300px) {
    .nav-container {
        padding: 0.5rem 0;
        width: 95%;
    }

    .nav-title {
        font-size: 0.8rem;
    }

    .selected {
        width: 24px;
        height: auto;
        font-size: 8px;
        padding: 5px;
    }

    .dropdown-list li {
        width: 24px;
        font-size: 8px;
        padding: 5px;
    }

    .projects {
        margin: 5px;
        width: 100%;
        overflow-x: hidden;
    }

    .projects-elements {
        margin: 5px;
        padding: 5px;
        width: 100%;
    }

    .projects-elements img {
        width: 100%;
        margin: 2px;
    }

    .projects-elements p {
        line-height: 14px;
        font-size: 10px;
        margin: 5px;
    }

    .project-name {
        font-size: 12px;
        margin: 5px;
    }
}

@media (max-width: 199px) {
    .nav-container {
        padding: 0.5rem 0;
        width: 95%;
    }

    .nav-title {
        font-size: 0.8rem;
    }

    .selected {
        width: 20px;
        font-size: 5px;
        padding: 3px;
    }

    .dropdown-list li {
        width: 20px;
        font-size: 5px;
        padding: 3px;
    }

    .projects-elements {
        width: 90%;
    }

    .projects-elements p {
        line-height: 10px;
        font-size: 5px;
        margin: 3px;
    }

    .project-name {
        font-size: 10px;
        margin: 3px;
    }
}