/* Shared cinematic background and scroll motion for public pages and the dashboard. */
body.site-motion-page {
    position: relative;
    isolation: isolate;
    background: transparent !important;
    --site-scroll-progress: 0;
    --site-background-offset: 0px;
    --site-particle-offset: 0px;
}

body.site-motion-page::before,
body.site-motion-page::after {
    position: fixed;
    inset: -14vh -3vw;
    content: "";
    pointer-events: none;
}

body.site-motion-page::before {
    z-index: -2;
    background-image: linear-gradient(120deg, #08060d9c, #09070d88 48%, #08060db3), var(--dashboard-background-image, url("/dashboard-gaming-background.png"));
    background-position: center 50%, center calc(50% + var(--site-background-offset));
    background-size: cover, auto 140%;
    background-repeat: no-repeat, no-repeat;
    filter: blur(max(10px, var(--dashboard-background-blur, 0px)));
    opacity: .86;
    transform: scale(1.015);
    transition: opacity .3s ease;
    will-change: background-position;
}

body.site-motion-page::after {
    z-index: -1;
    background-image:
        radial-gradient(circle, #fff4ffdc 0 1.4px, transparent 2.7px),
        radial-gradient(circle, #d5b5ffd0 0 1.2px, transparent 2.6px),
        radial-gradient(ellipse 42% 36% at 17% 12%, #a34ce52e 0, transparent 78%),
        radial-gradient(ellipse 44% 42% at 85% 76%, #6540b52a 0, transparent 80%);
    background-position: 0 0, 110px 80px, 0 0, 100% 100%;
    background-size: 210px 178px, 292px 238px, 165% 160%, 165% 160%;
    opacity: .72;
    transform: translate3d(0, var(--site-particle-offset), 0);
    animation: site-ambient-drift 18s ease-in-out infinite alternate;
    will-change: background-position, transform;
}

/* The public site uses softer light so the content and the hero artwork set the focus. */
body.site-motion-page.home-page:not(.server-selection),
body.site-motion-page:has(.hub-shell) {
    background: #090610 !important;
}

body.site-motion-page.home-page:not(.server-selection)::before,
body.site-motion-page:has(.hub-shell)::before {
    inset: -18vh -10vw;
    background:
        radial-gradient(ellipse 30% 44% at 21% 40%, #683a9b42, transparent 77%),
        radial-gradient(ellipse 44% 42% at 77% 28%, #49237c56, transparent 77%),
        radial-gradient(ellipse 37% 31% at 67% 71%, #22235446, transparent 80%);
    filter: none;
    opacity: 1;
    transform: translate3d(0, var(--site-background-offset), 0);
    will-change: transform;
}

body.site-motion-page.home-page:not(.server-selection)::after,
body.site-motion-page:has(.hub-shell)::after {
    opacity: .34;
    background-image:
        radial-gradient(circle, #e6c9ffaf 0 1px, transparent 1.8px),
        radial-gradient(circle, #b183ff8c 0 .7px, transparent 1.6px);
}

body.site-motion-page.dashboard-page::before,
body.site-motion-page.home-page.server-selection::before {
    background-image:
        radial-gradient(ellipse at 75% 16%, #481e6b5a, transparent 53%),
        linear-gradient(125deg, #090611c9, #0a0611a6 46%, #050307de),
        var(--dashboard-background-image, url("/dashboard-gaming-background.png"));
    background-position: center, center, center calc(50% + var(--site-background-offset));
    background-size: cover, cover, auto 140%;
    filter: blur(max(13px, var(--dashboard-background-blur, 0px)));
}

body.site-motion-page.dashboard-page::after,
body.site-motion-page.home-page.server-selection::after {
    opacity: .43;
    background-image:
        radial-gradient(circle, #efdcffb0 0 1px, transparent 1.9px),
        radial-gradient(circle, #b286ffb0 0 .8px, transparent 1.8px),
        radial-gradient(ellipse 42% 36% at 17% 12%, #a34ce52e 0, transparent 78%),
        radial-gradient(ellipse 44% 42% at 85% 76%, #6540b52a 0, transparent 80%);
}

.site-motion-page .hub-nav {
    min-height: 66px;
    height: auto;
    margin-top: 16px;
    padding: 12px 17px;
    border: 1px solid #caa3ff26;
    border-radius: 17px;
    background: #100c18df;
    box-shadow: 0 12px 36px #0503086b;
    backdrop-filter: blur(20px);
}

@keyframes site-ambient-drift {
    from { background-position: 0 0, 110px 80px, 0 0, 100% 100%; }
    to { background-position: 230px -150px, -250px 190px, 100% 45%, 0 55%; }
}

body.site-motion-page.dashboard-page[data-ambient-motion="off"]::before { background-position: center; opacity: .32; }
body.site-motion-page.dashboard-page[data-ambient-motion="off"]::after { opacity: 0; animation: none; }
body.dashboard-page[data-ambient-motion="off"].site-motion-ready [data-site-reveal] { opacity: 1 !important; translate: 0 0; transition: none; }

body.site-motion-page.site-motion-ready [data-site-reveal] {
    opacity: 0;
    translate: 0 26px;
    transition: opacity .72s cubic-bezier(.2,.7,.2,1), translate .72s cubic-bezier(.2,.7,.2,1);
    transition-delay: var(--site-reveal-delay, 0ms);
}

body.site-motion-page.site-motion-ready [data-site-reveal].site-motion-visible {
    opacity: 1;
    translate: 0 0;
}

body.site-motion-page.site-motion-ready [data-site-reveal]:focus-within { opacity: 1; translate: 0 0; }

.site-entry[hidden] { display: none !important; }
.site-entry {
    position: fixed;
    z-index: 20000;
    inset: 0;
    display: none;
    place-items: center;
    overflow: hidden;
    padding: 24px;
    background: #000;
    opacity: 1;
    transition: opacity .68s cubic-bezier(.2,.7,.2,1), visibility .68s;
}
html.site-lobby-enabled .site-entry:not([hidden]) { display: grid; }

.site-entry::before,
.site-entry::after { display: none; }

.site-entry.is-leaving { visibility: hidden; opacity: 0; }
.site-entry-card { position: relative; z-index: 1; display: grid; justify-items: center; width: min(100%, 390px); text-align: center; }
.site-entry-mark { width: 78px; height: 78px; margin-bottom: 22px; border: 1px solid #d6a4ff5c; border-radius: 24px; box-shadow: 0 0 0 10px #b76cff0a, 0 12px 55px #a34ce34a; object-fit: cover; animation: site-entry-breathe 1.8s ease-in-out infinite; }
.site-entry-kicker { color: #d8a8ff; font-size: 10px; font-weight: 850; letter-spacing: .2em; }
.site-entry-card h2 { margin: 13px 0 8px; color: #fbf7ff; font-size: clamp(26px, 5vw, 35px); letter-spacing: -.045em; }
.site-entry-card p { margin: 0; color: #c2b3cf; font-size: 13px; }
.site-entry-track { width: min(100%, 260px); height: 4px; margin-top: 24px; overflow: hidden; border-radius: 99px; background: #ffffff16; }
.site-entry-track span { display: block; width: 40%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #9e4ae5, #e2bdff); box-shadow: 0 0 16px #bd78fb99; animation: site-entry-progress 1.15s ease-in-out infinite; }
.site-entry-skip { margin-top: 18px; padding: 7px 10px; border: 0; background: transparent; color: #b9a6c9; font: inherit; font-size: 11px; cursor: pointer; }
.site-entry-skip:hover { color: #fff; }

@keyframes site-entry-breathe { 0%,100% { transform: translateY(0) scale(1); box-shadow: 0 0 0 10px #b76cff0a, 0 12px 55px #a34ce34a; } 50% { transform: translateY(-5px) scale(1.035); box-shadow: 0 0 0 15px #b76cff0a, 0 16px 65px #a34ce365; } }
@keyframes site-entry-progress { from { transform: translateX(-120%); } to { transform: translateX(270%); } }

.member-portal {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 28px;
    margin: 0 0 72px;
    padding: clamp(24px, 4vw, 40px);
    overflow: hidden;
    border: 1px solid #c98aff35;
    border-radius: 24px;
    background: linear-gradient(120deg, #17111ee8, #110c18c9 62%, #261638cf);
    box-shadow: 0 24px 80px #0003, inset 0 1px #ffffff10;
    backdrop-filter: blur(18px) saturate(125%);
}
.member-portal[data-site-reveal] { transition-delay: .08s; }
.member-portal::after { position: absolute; top: -90px; right: 8%; width: 260px; height: 260px; border: 1px solid #d6a4ff1b; border-radius: 50%; box-shadow: 0 0 0 22px #d6a4ff08, 0 0 0 48px #d6a4ff05; content: ""; pointer-events: none; }
.member-portal-copy { position: relative; z-index: 1; max-width: 700px; }
.member-portal-copy .eyebrow { margin-bottom: 12px; }
.member-portal-copy h2 { margin: 0 0 12px; font-size: clamp(24px, 4vw, 36px); letter-spacing: -.045em; }
.member-portal-copy p { max-width: 650px; margin: 0; color: #b9adbf; font-size: 13px; line-height: 1.8; }
.member-portal-action { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 46px; padding: 0 18px; border: 1px solid #d9b7fa66; border-radius: 14px; background: linear-gradient(135deg, #9f4de0, #6327a0); box-shadow: 0 10px 28px #8a35c933; color: #fff; font-size: 12px; font-weight: 800; text-decoration: none; transition: transform .2s ease, box-shadow .2s ease; }
.member-portal-action:hover { transform: translateY(-2px); box-shadow: 0 14px 34px #8a35c955; }
.member-portal-action:focus-visible,.site-entry-skip:focus-visible { outline: 2px solid #e4c2ff; outline-offset: 3px; }

@media (max-width: 700px) {
    body.site-motion-page::before, body.site-motion-page::after { inset: -8vh -8vw; }
    .member-portal { grid-template-columns: 1fr; gap: 20px; margin-bottom: 54px; border-radius: 19px; }
    .member-portal-action { justify-self: start; }
}

@media (max-width: 420px) {
    .site-entry-mark { width: 68px; height: 68px; border-radius: 20px; }
    .member-portal { padding: 22px 18px; }
}

@media (prefers-reduced-motion: reduce) {
    body.site-motion-page::before { background-position: center 50% !important; }
    body.site-motion-page::after { animation: none !important; }
    body.site-motion-page.site-motion-ready [data-site-reveal] { opacity: 1 !important; translate: 0 0; transition: none; }
    .site-entry-mark, .site-entry-track span { animation: none !important; }
    .site-entry { transition: none !important; }
    html.site-lobby-enabled .site-entry { display: none !important; }
}
