/* ==========================
   RESET
========================== */

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

html {
    scroll-behavior: smooth;
}

body {

    --bg: #09090b;
    --surface: #111827;
    --surface-2: #1f2937;

    --text: #f9fafb;
    --text2: #9ca3af;

    --primary: #3b82f6;
    --primary2: #60a5fa;

    --border: #2d3748;

    --shadow:
        0 15px 35px rgba(0, 0, 0, .35);

    background: var(--bg);

    color: var(--text);

    font-family:
        Inter,
        system-ui,
        sans-serif;

}

/* ==========================
LIGHT
========================== */

body.theme-light {

    --bg: #f4f7fb;

    --surface: #ffffff;

    --surface-2: #f8fafc;

    --text: #111827;

    --text2: #6b7280;

    --border: #e5e7eb;

    --shadow:
        0 15px 30px rgba(0, 0, 0, .08);

}

/* ==========================
PAGE
========================== */

.page {

    width: min(1300px, 92%);

    margin: auto;

    padding: 45px 0 80px;

}

/* ==========================
HEADER
========================== */

.page-header {

    display: flex;

    flex-direction: column;

    align-items: center;

    text-align: center;

    gap: 18px;

}

.back-btn {

    align-self: flex-start;

    display: flex;

    gap: 10px;

    align-items: center;

    color: var(--text);

    text-decoration: none;

    background: var(--surface);

    border: 1px solid var(--border);

    padding: 11px 20px;

    border-radius: 40px;

    transition: .3s;

}

.back-btn:hover {

    border-color: var(--primary);

    transform: translateY(-2px);

}

.small-title {

    color: var(--primary);

    text-transform: uppercase;

    letter-spacing: 3px;

    font-size: .9rem;

}

.title-area h1 {

    font-size: clamp(2.3rem, 6vw, 4rem);

    margin-top: 8px;

    margin-bottom: 12px;

}

.subtitle {

    max-width: 720px;

    color: var(--text2);

    line-height: 1.8;

}

/* ==========================
STATS
========================== */

.stats {

    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 20px;

    margin: 60px 0;

}

.stat-card {

    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: 18px;

    padding: 28px;

    text-align: center;

    transition: .35s;

}

.stat-card:hover {

    transform: translateY(-5px);

    border-color: var(--primary);

}

.stat-card span {

    display: block;

    font-size: 2.2rem;

    font-weight: 700;

}

.stat-card small {

    color: var(--text2);

}

/* ==========================
SEARCH
========================== */

.toolbar {

    margin-bottom: 30px;

}

.search-box {

    display: flex;

    align-items: center;

    gap: 15px;

    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: 14px;

    padding: 15px 20px;

}

.search-box input {

    flex: 1;

    border: none;

    background: none;

    outline: none;

    color: var(--text);

    font-size: 1rem;

}

.search-box i {

    color: var(--text2);

}

/* ==========================
FILTER
========================== */

.filter-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;

    flex-wrap: nowrap;

    gap: 8px;

    overflow-x: auto;
    -webkit-overflow-scrolling: touch;

    margin-bottom: 45px;
    padding: 0 10px;
}

.filter-wrapper::-webkit-scrollbar {
    display: none;
}

.filter-btn {
    flex: 0 0 auto;

    white-space: nowrap;

    padding: 8px 14px;
    /* ↓ smaller size */
    font-size: 12px;
    /* ↓ mobile friendly */

    border-radius: 999px;
}

.filter-btn {

    border: none;

    cursor: pointer;

    padding: 13px 24px;

    border-radius: 999px;

    background: var(--surface);

    color: var(--text2);

    border: 1px solid var(--border);

    transition: .3s;

    font-size: .95rem;

}

.filter-btn i {

    margin-right: 8px;

}

.filter-btn:hover {

    color: white;

    background: var(--primary);

    border-color: var(--primary);

}

.filter-btn.active {

    background: var(--primary);

    color: white;

    border-color: var(--primary);

}




/* ==========================
GRID
========================== */

.projects-grid {

    display: grid;

    grid-template-columns:

        repeat(auto-fit, minmax(320px, 1fr));

    gap: 28px;

}

/* ==========================
PROJECT CARD
========================== */

.project-card {

    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: 22px;

    overflow: hidden;

    transition: .35s;

    display: flex;

    flex-direction: column;

}

.project-card:hover {

    transform: translateY(-8px);

    box-shadow: var(--shadow);

    border-color: var(--primary);

}

.card-top {

    padding: 24px 24px 12px;

    display: flex;

    justify-content: space-between;

    align-items: flex-start;

    gap: 15px;

}

.project-icon {

    width: 60px;

    height: 60px;

    border-radius: 18px;

    display: grid;

    place-items: center;

    background: rgba(59, 130, 246, .12);

    color: var(--primary);

    font-size: 1.4rem;

}

.category {

    padding: 8px 14px;

    border-radius: 999px;

    font-size: .78rem;

    font-weight: 600;

}

.category.cyber {

    background: rgba(16, 185, 129, .15);

    color: #10b981;

}

.category.web {

    background: rgba(59, 130, 246, .15);

    color: #60a5fa;

}

.card-body {

    padding: 0 24px 24px;

    flex: 1;

    display: flex;

    flex-direction: column;

}

.card-body h3 {

    font-size: 1.35rem;

    margin-bottom: 14px;

}

.card-body p {

    color: var(--text2);

    line-height: 1.7;

    margin-bottom: 22px;

}

/* ==========================
TECH STACK
========================== */

.tech-stack {

    display: flex;

    flex-wrap: wrap;

    gap: 10px;

    margin-bottom: 24px;

}

.tech {

    background: var(--surface-2);

    border: 1px solid var(--border);

    border-radius: 999px;

    padding: 7px 14px;

    font-size: .78rem;

}

/* ==========================
BUTTONS
========================== */

.card-actions {

    margin-top: auto;

    display: flex;

    gap: 12px;

}

.btn {

    flex: 1;

    text-decoration: none;

    display: flex;

    justify-content: center;

    align-items: center;

    gap: 8px;

    padding: 12px;

    border-radius: 12px;

    transition: .3s;

    font-weight: 600;

}

.btn-primary {

    background: var(--primary);

    color: white;

}

.btn-primary:hover {

    background: #2563eb;

}

.btn-secondary {

    border: 1px solid var(--border);

    color: var(--text);

}

.btn-secondary:hover {

    border-color: var(--primary);

}

/* ==========================
EMPTY
========================== */

.empty-state {

    display: none;

    text-align: center;

    padding: 90px 20px;

}

.empty-state i {

    font-size: 4rem;

    color: var(--primary);

    margin-bottom: 20px;

}

.empty-state h3 {

    margin-bottom: 10px;

}

.empty-state p {

    color: var(--text2);

}

/* ==========================
FOOTER
========================== */

footer {

    margin-top: 70px;

    text-align: center;

    border-top: 1px solid var(--border);

    padding-top: 35px;

}

.home-btn {

    display: inline-flex;

    gap: 10px;

    align-items: center;

    text-decoration: none;

    padding: 14px 24px;

    border-radius: 50px;

    background: var(--primary);

    color: white;

    margin-bottom: 25px;

    transition: .3s;

}

.home-btn:hover {

    transform: translateY(-3px);

}

footer p {

    color: var(--text2);

    font-size: .9rem;

}

/* ==========================
ANIMATION
========================== */

.project-card {

    opacity: 0;

    transform: translateY(30px);

    animation: fadeUp .55s forwards;

}

@keyframes fadeUp {

    to {

        opacity: 1;

        transform: none;

    }

}

/* ==========================
SCROLLBAR
========================== */

::-webkit-scrollbar {

    width: 10px;

}

::-webkit-scrollbar-thumb {

    background: var(--primary);

    border-radius: 30px;

}

::-webkit-scrollbar-track {

    background: transparent;

}

/* ==========================
RESPONSIVE
========================== */

@media(max-width:900px) {

    .stats {

        grid-template-columns: 1fr;

    }

}

@media(max-width:700px) {

    .page {

        width: 94%;

    }

    .filter-wrapper {

        justify-content: flex-start;

        overflow: auto;

        padding-bottom: 8px;

    }

    .filter-wrapper::-webkit-scrollbar {

        display: none;

    }

    .card-actions {

        flex-direction: column;

    }

    .project-icon {

        width: 55px;

        height: 55px;

    }

    .title-area h1 {

        font-size: 2.4rem;

    }

    .subtitle {

        font-size: .95rem;

    }

}

@media(max-width:480px) {

    .card-top {

        padding: 20px;

    }

    .card-body {

        padding: 0 20px 20px;

    }

    .search-box {

        padding: 13px 15px;

    }

    .stat-card {

        padding: 22px;

    }

}

/* --------------------------------- navbar --------------------------------- */
.top-navbar {

    position: fixed;
    top: 0;
    left: 0;
    width: 100%;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 12px 20px;

    background: rgba(10, 10, 11, 0.6);
    backdrop-filter: blur(12px);

    border-bottom: 1px solid var(--border);

    z-index: 1000;
}

/* page offset */
.page {
    padding-top: 70px;
}

/* -------------------------------- preloader ------------------------------- */

#preloader {
    position: fixed;
    inset: 0;
    background: #0f1117;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

#preloader.hide {
    opacity: 0;
    visibility: hidden;
}

/* ---------------------------- .loader animation --------------------------- */
/* From Uiverse.io by cosnametv */
.loader {
    --color: #a5a5b0;
    --size: 70px;
    width: var(--size);
    height: var(--size);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
}

.loader span {
    width: 100%;
    height: 100%;
    background-color: var(--color);
    animation: keyframes-blink 0.6s alternate infinite linear;
}

.loader span:nth-child(1) {
    animation-delay: 0ms;
}

.loader span:nth-child(2) {
    animation-delay: 200ms;
}

.loader span:nth-child(3) {
    animation-delay: 300ms;
}

.loader span:nth-child(4) {
    animation-delay: 400ms;
}

.loader span:nth-child(5) {
    animation-delay: 500ms;
}

.loader span:nth-child(6) {
    animation-delay: 600ms;
}

@keyframes keyframes-blink {
    0% {
        opacity: 0.3;
        transform: scale(0.5) rotate(5deg);
    }

    50% {
        opacity: 1;
        transform: scale(1);
    }
}