:root {
    color-scheme: dark;
    scroll-padding-top: 6rem;
    --site-bg: #090d18;
    --site-panel: rgba(15, 22, 39, 0.82);
    --site-line: rgba(148, 163, 184, 0.14);
    --site-glow: rgba(99, 102, 241, 0.22);
}

html {
    scroll-behavior: smooth;
    overflow-x: clip;
}

body.bg-grid {
    min-height: 100vh;
    color: #e2e8f0;
    background-color: var(--site-bg);
    background-image:
        radial-gradient(ellipse at 50% -12%, var(--site-glow), transparent 48rem),
        radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.032) 1px, transparent 0);
    background-size: auto, 32px 32px;
}

body.bg-grid > nav:first-of-type:not(.fixed) {
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 0.875rem clamp(0.75rem, 3vw, 1.5rem);
    background: linear-gradient(to bottom, rgba(9, 13, 24, 0.96), rgba(9, 13, 24, 0));
}

body.bg-grid > nav:first-of-type > div {
    border-color: var(--site-line);
    background-color: rgba(12, 17, 31, 0.88);
    box-shadow: 0 16px 46px -32px rgba(0, 0, 0, 0.9);
}

body.bg-grid > nav:first-of-type img {
    transition: transform 180ms ease, opacity 180ms ease;
}

body.bg-grid > nav:first-of-type a:hover img {
    transform: translateY(-1px);
}

body.bg-grid main {
    width: min(100%, 90rem);
    margin-right: auto;
    margin-left: auto;
}

body.bg-grid main > section[id],
body.bg-grid main > div > section[id] {
    scroll-margin-top: 6rem;
}

body.bg-grid .glass-card,
body.bg-grid .glass-nav {
    border-color: var(--site-line);
    border-radius: 1.25rem;
    box-shadow: 0 18px 55px -42px rgba(0, 0, 0, 0.9);
}

body.bg-grid .glass-card {
    background-color: var(--site-panel);
}

body.bg-grid .glass-card:hover {
    border-color: rgba(129, 140, 248, 0.42);
    box-shadow: 0 24px 54px -42px rgba(99, 102, 241, 0.65);
}

body.bg-grid :is(button, input, select, textarea) {
    font: inherit;
}

body.bg-grid :is(button, input, select, textarea):focus-visible,
body.bg-grid a:focus-visible,
body.bg-grid summary:focus-visible {
    outline: 2px solid #a5b4fc;
    outline-offset: 4px;
}

body.bg-grid main button,
body.bg-grid main [role="button"] {
    transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

body.bg-grid > footer {
    width: 100%;
    margin-top: auto;
    border-color: rgba(148, 163, 184, 0.12);
    background: linear-gradient(to bottom, rgba(9, 13, 24, 0), rgba(9, 13, 24, 0.72));
}

body.bg-grid h1,
body.bg-grid h2,
body.bg-grid h3,
body.bg-grid h4 {
    text-wrap: balance;
}

body.bg-grid img {
    max-width: 100%;
}

.site-primary-links {
    display: none;
    align-items: center;
    gap: clamp(0.75rem, 1.5vw, 1.5rem);
    margin-left: auto;
}

.site-primary-links a,
.site-mobile-menu a {
    color: #94a3b8;
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 180ms ease;
}

.site-primary-links a:hover,
.site-mobile-menu a:hover,
.site-primary-links a[aria-current="page"],
.site-mobile-menu a[aria-current="page"] {
    color: #fff;
}

.site-mobile-menu {
    position: relative;
    margin-left: auto;
}

.site-mobile-menu summary {
    display: inline-flex;
    min-height: 2.5rem;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0.875rem;
    border: 1px solid var(--site-line);
    border-radius: 0.75rem;
    color: #e2e8f0;
    font-size: 0.8125rem;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}

.site-mobile-menu summary::-webkit-details-marker {
    display: none;
}

.site-mobile-menu:not([open]) > div {
    display: none;
}

.site-mobile-menu[open] > div {
    position: absolute;
    top: calc(100% + 0.75rem);
    right: 0;
    z-index: 60;
    display: grid;
    min-width: 12rem;
    gap: 0.25rem;
    padding: 0.5rem;
    border: 1px solid var(--site-line);
    border-radius: 1rem;
    background: rgba(12, 17, 31, 0.98);
    box-shadow: 0 18px 45px -24px rgba(0, 0, 0, 0.9);
}

.site-mobile-menu a {
    padding: 0.625rem 0.75rem;
    border-radius: 0.625rem;
}

.site-mobile-menu a:hover {
    background: rgba(255, 255, 255, 0.06);
}

.site-social-links {
    margin-left: 0.75rem;
}

.site-back-to-top {
    position: fixed;
    right: max(1rem, env(safe-area-inset-right));
    bottom: max(1rem, env(safe-area-inset-bottom));
    z-index: 70;
    display: grid;
    width: 2.75rem;
    height: 2.75rem;
    place-items: center;
    border: 1px solid rgba(165, 180, 252, 0.28);
    border-radius: 0.875rem;
    background: rgba(49, 46, 129, 0.92);
    color: #fff;
    font-size: 1.25rem;
    box-shadow: 0 12px 30px -14px rgba(79, 70, 229, 0.8);
    opacity: 0;
    pointer-events: none;
    transform: translateY(0.5rem);
    transition: opacity 180ms ease, transform 180ms ease, background-color 180ms ease;
}

.site-back-to-top[data-visible="true"] {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.site-back-to-top:hover {
    background: rgba(67, 56, 202, 0.98);
}

[data-filter-item][hidden] {
    display: none !important;
}

@media (min-width: 1024px) {
    .site-primary-links {
        display: flex;
    }

    .site-mobile-menu {
        display: none;
    }
}

@media (max-width: 639px) {
    .site-social-links {
        display: none !important;
    }

    body.bg-grid > nav:first-of-type > div {
        gap: 0.5rem;
    }

    body.bg-grid > nav:first-of-type > div > div:last-child > a:not(:last-child) {
        display: none !important;
    }
}

@media (max-width: 640px) {
    body.bg-grid > nav:first-of-type:not(.fixed) {
        padding-top: 0.625rem;
    }

    body.bg-grid main > section[id],
    body.bg-grid main > div > section[id] {
        scroll-margin-top: 5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    body.bg-grid *,
    body.bg-grid *::before,
    body.bg-grid *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
