:root {
    color-scheme: dark;
    --splash-bg: #04110d;
    --splash-ink: #f2f8f5;
    --splash-muted: #9eb4aa;
    --splash-emerald: #087f5b;
    --splash-emerald-bright: #2fd5a1;
    --splash-line: rgba(191, 237, 220, 0.16);
    --splash-glass: rgba(8, 27, 21, 0.58);
    --splash-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--splash-bg);
}

body {
    overflow: hidden;
    font-family: "Outfit", sans-serif;
    color: var(--splash-ink);
}

button,
a {
    font: inherit;
}

button {
    border: 0;
}

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

.splash-page {
    position: relative;
    width: 100%;
    min-height: 100svh;
    overflow: hidden;
    isolation: isolate;
    background:
        radial-gradient(circle at 50% 43%, rgba(20, 146, 104, 0.28), transparent 24%),
        radial-gradient(circle at 50% 70%, rgba(6, 42, 31, 0.58), transparent 52%),
        linear-gradient(145deg, #03100d 0%, #072019 48%, #04120e 100%);
    transition: opacity 720ms ease, transform 900ms var(--splash-ease), filter 900ms var(--splash-ease);
}

.splash-page::before {
    content: "";
    position: absolute;
    z-index: 0;
    top: 28%;
    left: 50%;
    width: min(58vw, 680px);
    height: min(38vw, 420px);
    pointer-events: none;
    border-radius: 50%;
    background:
        radial-gradient(circle, rgba(170, 255, 230, 0.18) 0%, rgba(47, 213, 161, 0.14) 24%, rgba(8, 127, 91, 0.07) 48%, transparent 72%);
    filter: blur(28px);
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.86);
    animation: diamondGlowFlicker 5.8s ease-in-out infinite;
}

.splash-page::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 30;
    opacity: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 50% 35%, rgba(182, 250, 225, 0.28), transparent 34%),
        linear-gradient(180deg, rgba(242, 249, 246, 0.08) 0%, rgba(247, 251, 249, 0.76) 62%, rgba(255, 255, 255, 0.96) 100%);
    transition: opacity 720ms ease;
}

.splash-page.is-handing-off {
    opacity: 0;
    transform: scale(1.015);
    filter: saturate(0.92) brightness(1.04);
}

.splash-page.is-handing-off::after {
    opacity: 1;
}

#elysiumSplashCanvas {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 900ms ease;
}

.splash-page.is-three-ready #elysiumSplashCanvas {
    opacity: 1;
}

.splash-ambient {
    position: absolute;
    z-index: 0;
    inset: 15% 10% auto;
    height: 56%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(28, 205, 149, 0.2), rgba(8, 60, 45, 0.08) 44%, transparent 70%);
    filter: blur(30px);
    opacity: 0;
    transform: scale(0.55);
    animation: ambientAwake 2.4s var(--splash-ease) 0.18s forwards;
}

.splash-grain {
    position: absolute;
    z-index: 2;
    inset: -40%;
    pointer-events: none;
    opacity: 0.045;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
    animation: grainShift 0.28s steps(2) infinite;
}

.splash-nav {
    position: fixed;
    z-index: 20;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px clamp(22px, 4vw, 64px);
    pointer-events: none;
}

.splash-brand,
.skip-intro-btn {
    pointer-events: auto;
}

.splash-brand {
    display: inline-flex;
    align-items: center;
    gap: 13px;
}

.splash-brand-mark {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 14px;
    background: rgba(240, 255, 249, 0.92);
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.24);
}

.splash-brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.splash-brand > span:last-child {
    display: grid;
    gap: 1px;
}

.splash-brand strong {
    font-size: 1rem;
    letter-spacing: 0.03em;
}

.splash-brand small {
    color: var(--splash-muted);
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.skip-intro-btn {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid var(--splash-line);
    border-radius: 999px;
    background: rgba(4, 20, 15, 0.58);
    color: var(--splash-ink);
    backdrop-filter: blur(18px);
    cursor: pointer;
    transition: transform 250ms ease, border-color 250ms ease, background 250ms ease;
}

.skip-intro-btn:hover {
    transform: translateY(-2px);
    border-color: rgba(77, 225, 173, 0.44);
    background: rgba(9, 55, 40, 0.72);
}

.intro-overlay {
    position: absolute;
    z-index: 7;
    top: 50%;
    left: 50%;
    width: min(940px, calc(100% - 40px));
    text-align: center;
    transform: translate(-50%, -50%);
    pointer-events: none;
    transition: opacity 800ms ease, transform 1000ms var(--splash-ease), visibility 800ms ease;
}

.intro-kicker {
    margin: 0 0 20px;
    color: var(--splash-emerald-bright);
    font-size: clamp(0.75rem, 1vw, 0.9rem);
    font-weight: 600;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    opacity: 0;
    animation: introRise 900ms var(--splash-ease) 0.55s forwards;
}

.intro-overlay h1 {
    max-width: 900px;
    margin: 0 auto;
    font-size: clamp(2.7rem, 7vw, 6.8rem);
    font-weight: 500;
    line-height: 0.94;
    letter-spacing: -0.065em;
    text-wrap: balance;
    opacity: 0;
    animation: introRise 1100ms var(--splash-ease) 0.8s forwards;
}

.intro-status {
    margin: 28px 0 0;
    color: var(--splash-muted);
    font-size: 0.86rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0;
    animation: introRise 900ms var(--splash-ease) 1.1s forwards;
}

.splash-page.is-diamond-entering .intro-overlay {
    opacity: 0.2;
    transform: translate(-50%, -58%) scale(0.94);
}

.splash-page.is-zooming .intro-overlay {
    opacity: 0;
    visibility: hidden;
}

.splash-page.is-orbiting .intro-overlay {
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -62%) scale(0.9);
}

.impact-burst {
    display: none;
}

.splash-page.is-impacting .impact-burst {
    animation: none;
}

.splash-progress {
    position: fixed;
    z-index: 20;
    right: clamp(22px, 4vw, 64px);
    bottom: 30px;
    left: clamp(22px, 4vw, 64px);
    height: 1px;
    overflow: hidden;
    background: rgba(209, 242, 229, 0.12);
    transition: opacity 500ms ease;
}

.splash-progress span {
    display: block;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--splash-emerald), #6df0c1);
    box-shadow: 0 0 16px rgba(56, 221, 163, 0.7);
}

.splash-page.is-three-fallback::before {
    content: "";
    position: absolute;
    z-index: 1;
    top: 46%;
    left: 50%;
    width: min(38vw, 420px);
    aspect-ratio: 1;
    border: 1px solid rgba(85, 232, 179, 0.18);
    transform: translate(-50%, -50%) rotate(45deg);
    background: linear-gradient(145deg, rgba(73, 235, 176, 0.08), rgba(1, 9, 6, 0.3));
    box-shadow: 0 0 130px rgba(22, 190, 132, 0.16);
}

@keyframes ambientAwake {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes grainShift {
    0% {
        transform: translate3d(-2%, -1%, 0);
    }
    50% {
        transform: translate3d(2%, 1%, 0);
    }
    100% {
        transform: translate3d(0, -2%, 0);
    }
}

@keyframes introRise {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes impactPulse {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.2);
    }
    30% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(18);
    }
}

@keyframes diamondGlowFlicker {
    0%, 56%, 100% {
        opacity: 0.14;
        transform: translate(-50%, -50%) scale(0.86);
    }

    62% {
        opacity: 0.46;
        transform: translate(-50%, -50%) scale(1.02);
    }

    68% {
        opacity: 0.24;
        transform: translate(-50%, -50%) scale(0.94);
    }

    72% {
        opacity: 0.38;
        transform: translate(-50%, -50%) scale(1);
    }

    80% {
        opacity: 0.16;
        transform: translate(-50%, -50%) scale(0.9);
    }
}

@media (max-width: 860px) {
    .splash-nav {
        padding: 18px;
    }

    .splash-brand small {
        display: none;
    }
}

@media (max-width: 540px) {
    .splash-brand-mark {
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }

    .skip-intro-btn {
        min-height: 40px;
        padding: 0 14px;
        font-size: 0.8rem;
    }

    .intro-overlay h1 {
        font-size: clamp(2.55rem, 14vw, 4rem);
    }

    .intro-kicker {
        letter-spacing: 0.16em;
    }
}

@media (max-width: 768px) {
    .intro-overlay {
        width: min(100% - 28px, 720px);
    }

    .intro-kicker {
        font-size: 0.7rem;
        letter-spacing: 0.16em;
    }

    .intro-overlay h1 {
        font-size: clamp(2rem, 11vw, 3.35rem);
        line-height: 1.02;
        letter-spacing: -0.05em;
        padding: 0 4px;
        overflow-wrap: anywhere;
    }

    .intro-status {
        margin-top: 22px;
        font-size: 0.78rem;
        line-height: 1.5;
        letter-spacing: 0.1em;
    }

    .splash-brand strong {
        font-size: 0.92rem;
    }

    .skip-intro-btn {
        font-size: 0.78rem;
    }
}

@media (max-width: 480px) {
    .splash-nav {
        padding: 14px;
    }

    .intro-overlay {
        width: min(100% - 24px, 640px);
    }

    .intro-overlay h1 {
        font-size: clamp(1.75rem, 10.5vw, 2.55rem);
        line-height: 1.04;
    }

    .intro-status {
        font-size: 0.72rem;
        letter-spacing: 0.08em;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
