#stars {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    pointer-events: none;
}

:root {
    --bg: #090B14;
    --surface: #121A2A;

    --text: #F8FAFC;
    --muted: #A4AEC3;

    --accent: #8B5CF6;
    --accent2: #38BDF8;

    --radius: 18px;
}

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

html {
    scroll-behavior: smooth;
    min-height: 100%;
}

body {
    min-height: 100vh;

    display: flex;
    flex-direction: column;

    font-family: "Space Grotesk", sans-serif;

    background: #090B14;
    color: white;

    overflow-x: hidden;
    position: relative;

    transition:
        opacity .45s ease,
        transform .45s ease,
        filter .45s ease;
}

body.page-leave {
    opacity: 0;
    transform: scale(1.03);
    filter: blur(8px);
}

header {
    position: sticky;
    top: 0;

    z-index: 999;
    width: 100%;

    backdrop-filter: blur(12px);
    background: rgba(9,11,20,.75);

    border-bottom: 1px solid rgba(255,255,255,.05);
}

.navbar {
    max-width: 1200px;
    margin: auto;

    padding: 20px;

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

.logo {
    display: flex;
    align-items: center;

    gap: 12px;

    font-size: 30px;
    font-weight: 700;
    letter-spacing: 2px;

    text-decoration: none;
    color: white;
}

.logo-star {
    font-size: 22px;
    margin-top: -1px;
}

.logo-text {
    display: block;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    color: var(--muted);
    text-decoration: none;
    transition: .3s;
}

.nav-links a:hover {
    color: white;
}

.hero {
    min-height: 90vh;

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

    text-align: center;
    padding: 40px;
}

.hero-content {
    max-width: 900px;
}

.hero h1 {
    font-size: 68px;
    line-height: 1.1;
    margin-bottom: 35px;
}

.hero h2 {
    font-size: 30px;
    font-weight: 500;
    margin-bottom: 20px;
}

.hero p {
    color: var(--muted);
    font-size: 20px;
    line-height: 1.8;
}

.hero-description {
    margin-top: 18px;

    color: var(--muted);
    font-size: 20px;
    line-height: 1.8;
}


/* MAIN */

main {
    flex: 1;

    max-width: 1250px;
    width: 100%;

    margin: auto;

    padding: 90px 40px 120px;
}

main h2 {
    font-size: 30px;
    margin-bottom: 18px;
    font-weight: 700;
}

.search-section {
    display: flex;
    justify-content: center;
    margin-bottom: 35px;
}

#search {
    width: 620px;

    padding: 20px 28px;

    border: none;
    border-radius: 999px;

    background: var(--surface);
    color: white;

    outline: none;
    font-size: 19px;
}

.filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;

    gap: 18px;
    margin-bottom: 60px;
}

.filters button {
    padding: 14px 26px;

    font-size: 17px;

    border: none;
    border-radius: 999px;

    background: var(--surface);
    color: white;

    cursor: pointer;
    transition: .3s;
}

.filters button:hover {
    background: var(--accent);
}

.random {
    display: flex;
    justify-content: center;

    margin-bottom: 80px;
}

.random button {
    padding: 15px 28px;

    font-size: 17px;

    border: none;
    border-radius: 999px;

    cursor: pointer;

    background: linear-gradient(
        135deg,
        var(--accent),
        var(--accent2)
    );

    color: white;
    font-weight: 600;
}

.featured {
    width: 100%;
    margin: 0 0 80px;
}

.featured .card {
    min-height: 190px;
    width: 100%;
    padding: 40px;
}

.articles {
    display: grid;
    grid-template-columns: repeat(
        auto-fit,
        minmax(340px, 1fr)
    );

    gap: 24px;
}

.articles h2,
#article-count {
    grid-column: 1 / -1;
}

.card {
    background: rgba(18,26,42,.88);

    border: 1px solid rgba(255,255,255,.05);
    border-radius: 22px;

    padding: 20px;
    min-height: 155px;

    display: flex;
    flex-direction: column;

    transition: .35s;
    cursor: pointer;
}

.card:hover {
    transform: translateY(-6px);

    border-color: rgba(139,92,246,.35);

    box-shadow:
        0 14px 36px rgba(0,0,0,.35),
        0 0 24px rgba(139,92,246,.08);
}

.card a {
    text-decoration: none;
    color: inherit;
}

.card-link {
    display: flex;
    flex-direction: column;

    height: 100%;

    color: inherit;
    text-decoration: none;
}

.card h3 {
    font-size: 22px;
    line-height: 1.25;

    margin: 10px 0;
}

.card p {
    font-size: 15px;
    line-height: 1.7;

    color: var(--muted);

    margin-bottom: 26px;
}

.card small {
    margin-top: auto;

    color: #9E7CFF;

    font-size: 13px;
    font-weight: 700;

    text-transform: uppercase;
    letter-spacing: 1px;
}

.card-icon {
    font-size: 26px;
    margin-bottom: 8px;
}


/* FOOTER */

.footer {
    width: 100%;

    margin-top: 0;

    padding: 70px 20px 60px;

    text-align: center;
    color: var(--muted);
}

.footer-divider {
    width: 100%;
    max-width: 1200px;

    height: 1px;

    margin: 0 auto 50px;

    background: rgba(255,255,255,.08);
}

.footer-tagline {
    color: var(--muted);

    font-size: 17px;

    margin-bottom: 36px;
}

.footer-links {
    display: flex;

    justify-content: center;
    gap: 34px;

    flex-wrap: wrap;

    margin-bottom: 36px;
}

.footer-links a {
    color: var(--muted);

    text-decoration: none;

    transition: .3s;
}

.footer-links a:hover {
    color: white;
}

.footer-copy {
    color: #8c95a7;

    font-size: 14px;

    margin-bottom: 12px;
}


/* MOBILE */

@media (max-width: 768px) {

    .navbar {
        padding: 16px 18px;
        gap: 12px;
    }

    .logo {
        font-size: 24px;
        gap: 8px;
        letter-spacing: 1px;
    }

    .logo-star {
        font-size: 18px;
    }

    .nav-links {
        gap: 12px;
    }

    .nav-links a {
        font-size: 14px;
    }

    .hero {
        min-height: 62vh;
        padding: 20px 18px 35px;
    }

    .hero-content {
        width: 100%;
        max-width: 100%;
    }

    .hero h1 {
        max-width: 360px;

        margin: 0 auto 20px;

        font-size: 32px;
        line-height: 1.12;

        letter-spacing: -0.5px;
    }

    .hero h2 {
        font-size: 17px;
        line-height: 1.45;

        margin-bottom: 14px;
    }

    .hero p,
    .hero-description {
        font-size: 16px;
        line-height: 1.55;
    }

    main {
        flex: 1;

        padding: 25px 18px 70px;
    }

    main h2 {
        font-size: 26px;
        line-height: 1.25;

        margin-bottom: 18px;
    }

    .search-section {
        margin-bottom: 20px;
    }

    #search {
        width: 100%;

        padding: 15px 19px;

        font-size: 16px;
    }

    .filters {
        gap: 8px;
        margin-bottom: 30px;
    }

    .filters button {
        padding: 10px 15px;
        font-size: 14px;
    }

    .random {
        margin-bottom: 45px;
    }

    .random button {
        width: 100%;
        max-width: 360px;

        padding: 14px 20px;

        font-size: 15px;
    }

    .featured {
        margin-bottom: 50px;
    }

    .featured .card {
        min-height: 160px;
        padding: 24px 20px;
    }

    .articles {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .card {
        padding: 20px;
        min-height: 145px;

        border-radius: 18px;
    }

    .card-icon {
        font-size: 27px;
        margin-bottom: 8px;
    }

    .card h3 {
        font-size: 20px;
        line-height: 1.25;

        margin: 10px 0;
    }

    .card p {
        font-size: 15px;
        line-height: 1.6;

        margin-bottom: 22px;
    }

    .card small {
        font-size: 13px;
    }

    .footer {
        margin-top: 0;

        padding: 45px 18px 40px;
    }

    .footer-divider {
        margin-bottom: 35px;
    }

    .footer-tagline {
        font-size: 15px;
        line-height: 1.5;

        margin-bottom: 28px;
    }

    .footer-links {
        gap: 18px;

        margin-bottom: 28px;
    }

    .footer-links a {
        font-size: 14px;
    }

    .footer-copy {
        font-size: 12px;
    }
}

@media (max-width: 360px) {

    .hero h2 {
        font-size: 16px;
    }
}