:root {
    --bg-color: #101116;
    --text-color: #f5f5f2;
    --muted-color: #b4b5bb;
    --hint-color-1: rgba(255, 107, 107, 0.14);
    --hint-color-2: rgba(72, 219, 251, 0.11);
    --hint-color-3: rgba(165, 94, 234, 0.13);
    --spotlight-size: 52vw;
    --font-primary: 'Outfit', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

html {
    background: var(--bg-color);
}

body {
    min-height: 100vh;
    min-height: 100svh;
    overflow: hidden;
    background: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-primary);
    position: relative;
}

.interactive-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    /* Static third hint */
    background: radial-gradient(circle at 72% 68%, var(--hint-color-3) 0%, transparent 60%);
    /* Keep this as a group opacity. Baking 0.76 into the hint alphas instead
       removes this intermediate render surface, which measures near-identical
       in Chrome but makes Dia pulse continuously after the pointer stops. */
    opacity: 0.76;
    overflow: hidden;
    
    /* CRITICAL: Hardware isolate the entire background container from the rest of the page */
    contain: strict;
    will-change: transform;
    transform: translateZ(0);
}

.interactive-bg::before,
.interactive-bg::after {
    content: '';
    position: absolute;
    /* 200% size centered, so translating up to 50vw/vh in any direction won't reveal edges */
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    pointer-events: none;
    will-change: transform;
}

.interactive-bg::before {
    background: radial-gradient(circle at center, var(--hint-color-1) 0%, transparent var(--spotlight-size));
    transform: translate3d(calc((var(--mouse-x, 18) - 50) * 1vw), calc((var(--mouse-y, 20) - 50) * 1vh), 0);
}

.interactive-bg::after {
    background: radial-gradient(circle at center, var(--hint-color-2) 0%, transparent var(--spotlight-size));
    transform: translate3d(calc((50 - var(--mouse-x, 18)) * 1vw), calc((50 - var(--mouse-y, 20)) * 1vh), 0);
}

.container {
    position: relative;
    z-index: 2;
    width: min(100% - 3rem, 980px);
    min-height: 100vh;
    min-height: 100svh;
    margin-inline: auto;
    padding-block: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    
    /* CRITICAL: Prevent infinite animations from leaking repaints */
    contain: layout paint;
}

.logo-container {
    --logo-size: clamp(4rem, 11.5vw, 7.5rem);
    width: min(100%, 980px);
    height: var(--logo-size);
    display: grid;
    place-items: center;
}

.logo-button {
    --wheel-gap-left: 0.09em;
    --wheel-gap-right: 0.09em;
    --wheel-right-optical-adjustment: 0.095em;
    --left-reveal-wheel-overlap: 0.095em;
    --rest-center-shift: -0.29em;
    --oma-width: 1.81em;
    --mo-width: 1.30em;
    --impact-overshoot: 0.07em;
    --impact-recoil: 0.035em;
    --impact-settle: 0.012em;
    --expanded-scale: 0.94;
    --logo-cycle-duration: 2.75s;
    appearance: none;
    position: relative;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 1.5rem;
    background: transparent;
    color: var(--text-color);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.logo-stage {
    position: absolute;
    inset: 0;
    display: block;
    font-size: var(--logo-size);
    font-weight: 400;
    letter-spacing: -0.045em;
    line-height: 1;
    filter: drop-shadow(0 12px 32px rgba(0, 0, 0, 0.12));
    transform: translateX(var(--rest-center-shift));
    transform-origin: center;
}

.logo-copy,
.logo-reveal {
    position: absolute;
    top: 50%;
    white-space: nowrap;
}

.logo-copy {
    z-index: 1;
    transform: translateY(-52%);
}

.logo-chr {
    right: calc(50% + 0.5em + var(--wheel-gap-left));
}

.logo-ment {
    left: calc(50% + 0.5em + var(--wheel-gap-right) - var(--wheel-right-optical-adjustment));
}

.logo-reveal {
    z-index: 1;
    height: 1em;
    overflow: hidden;
    transform: translateY(-52%);
}

.logo-reveal > span {
    position: absolute;
    top: 0;
    display: block;
}

.logo-oma {
    right: calc(50% + 0.5em + var(--wheel-gap-left));
    width: var(--oma-width);
    overflow: visible;
    clip-path: inset(0 0 0 100%);
}

.logo-oma > span {
    right: 0;
    transform: translateX(100%);
}

.logo-mo {
    left: calc(50% + 0.5em + var(--wheel-gap-right) - var(--wheel-right-optical-adjustment));
    width: var(--mo-width);
    clip-path: inset(0 100% 0 0);
}

.logo-mo > span {
    left: 0;
    transform: translateX(-100%);
}

.logo-wheel {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 50%;
    width: 1em;
    height: 1em;
    overflow: hidden;
    transform: translate(-50%, -50%);
    transform-origin: center;
}

.logo-fallback {
    display: block;
    position: absolute;
    width: min(64%, 620px);
    height: auto;
    top: 50%;
    left: 50%;
    filter: drop-shadow(0 12px 32px rgba(0, 0, 0, 0.12));
    transform: translate(-50%, -50%);
}

.logo-stage,
.js .logo-fallback {
    display: none;
}

.js .logo-stage {
    display: block;
}

.logo-button:hover .logo-wheel {
    filter: brightness(1.08) saturate(1.08);
}

.logo-button:focus-visible {
    outline: 2px solid rgba(245, 245, 242, 0.75);
    outline-offset: 0.25rem;
}

.logo-button.is-animating .logo-stage {
    animation: logo-stage-cycle var(--logo-cycle-duration) linear both;
}

.logo-button.is-animating .logo-wheel {
    animation: wheel-drive var(--logo-cycle-duration) linear both;
}

.logo-button.is-animating .logo-chr {
    animation: chr-cycle var(--logo-cycle-duration) linear both;
}

.logo-button.is-animating .logo-ment {
    animation: ment-cycle var(--logo-cycle-duration) linear both;
}

.logo-button.is-animating .logo-oma {
    animation: oma-mask-cycle var(--logo-cycle-duration) linear both;
}

.logo-button.is-animating .logo-oma > span {
    animation: oma-copy-cycle var(--logo-cycle-duration) linear both;
}

.logo-button.is-animating .logo-mo {
    animation: mo-mask-cycle var(--logo-cycle-duration) linear both;
}

.logo-button.is-animating .logo-mo > span {
    animation: mo-copy-cycle var(--logo-cycle-duration) linear both;
}

@keyframes wheel-drive {
    0%, 4% {
        transform: translate(-50%, -50%) rotate(0deg) scale(1);
        animation-timing-function: cubic-bezier(0.28, 0.18, 0.72, 0.58);
    }
    25% {
        transform: translate(-50%, -50%) rotate(540deg) scale(1);
        animation-timing-function: cubic-bezier(0.35, 0.55, 0.55, 1);
    }
    32% {
        transform: translate(-50%, -50%) rotate(720deg) scale(1);
        animation-timing-function: linear;
    }
    64% {
        transform: translate(-50%, -50%) rotate(720deg) scale(1);
        animation-timing-function: cubic-bezier(0.35, 0, 0.2, 1);
    }
    82% {
        transform: translate(-50%, -50%) rotate(0deg) scale(1.045);
        animation-timing-function: cubic-bezier(0.2, 0.8, 0.25, 1);
    }
    89% {
        transform: translate(-50%, -50%) rotate(10deg) scale(0.985);
        animation-timing-function: cubic-bezier(0.25, 0.7, 0.3, 1);
    }
    94% {
        transform: translate(-50%, -50%) rotate(-3deg) scale(1.005);
        animation-timing-function: cubic-bezier(0.3, 0, 0.2, 1);
    }
    100% { transform: translate(-50%, -50%) rotate(0deg) scale(1); }
}

@keyframes logo-stage-cycle {
    0%, 9% {
        transform: translateX(var(--rest-center-shift)) scale(1);
        animation-timing-function: cubic-bezier(0.22, 0.75, 0.25, 1);
    }
    38%, 67% {
        transform: translateX(0) scale(var(--expanded-scale));
        animation-timing-function: cubic-bezier(0.12, 0.72, 0.18, 1);
    }
    82%, 100% {
        transform: translateX(var(--rest-center-shift)) scale(1);
    }
}

@keyframes chr-cycle {
    0%, 9% {
        transform: translateY(-52%) translateX(0);
        animation-timing-function: cubic-bezier(0.22, 0.75, 0.25, 1);
    }
    38%, 67% {
        transform: translateY(-52%) translateX(calc(-1 * var(--oma-width)));
        animation-timing-function: cubic-bezier(0.12, 0.72, 0.18, 1);
    }
    82% {
        transform: translateY(-52%) translateX(var(--impact-overshoot));
        animation-timing-function: cubic-bezier(0.2, 0.8, 0.25, 1);
    }
    89% {
        transform: translateY(-52%) translateX(calc(-1 * var(--impact-recoil)));
        animation-timing-function: cubic-bezier(0.3, 0, 0.2, 1);
    }
    94% {
        transform: translateY(-52%) translateX(var(--impact-settle));
        animation-timing-function: cubic-bezier(0.3, 0, 0.2, 1);
    }
    100% { transform: translateY(-52%) translateX(0); }
}

@keyframes ment-cycle {
    0%, 9% {
        transform: translateY(-52%) translateX(0);
        animation-timing-function: cubic-bezier(0.22, 0.75, 0.25, 1);
    }
    38%, 67% {
        transform: translateY(-52%) translateX(var(--mo-width));
        animation-timing-function: cubic-bezier(0.12, 0.72, 0.18, 1);
    }
    82% {
        transform: translateY(-52%) translateX(calc(-1 * var(--impact-overshoot)));
        animation-timing-function: cubic-bezier(0.2, 0.8, 0.25, 1);
    }
    89% {
        transform: translateY(-52%) translateX(var(--impact-recoil));
        animation-timing-function: cubic-bezier(0.3, 0, 0.2, 1);
    }
    94% {
        transform: translateY(-52%) translateX(calc(-1 * var(--impact-settle)));
        animation-timing-function: cubic-bezier(0.3, 0, 0.2, 1);
    }
    100% { transform: translateY(-52%) translateX(0); }
}

@keyframes oma-mask-cycle {
    0%, 9% {
        clip-path: inset(
            0
            calc(-1 * var(--left-reveal-wheel-overlap))
            0
            calc(100% + var(--left-reveal-wheel-overlap))
        );
        animation-timing-function: cubic-bezier(0.22, 0.75, 0.25, 1);
    }
    38%, 67% {
        clip-path: inset(0 calc(-1 * var(--left-reveal-wheel-overlap)) 0 0);
        animation-timing-function: cubic-bezier(0.12, 0.72, 0.18, 1);
    }
    82%, 100% {
        clip-path: inset(
            0
            calc(-1 * var(--left-reveal-wheel-overlap))
            0
            calc(100% + var(--left-reveal-wheel-overlap))
        );
    }
}

@keyframes oma-copy-cycle {
    0%, 9% {
        transform: translateX(100%);
        animation-timing-function: cubic-bezier(0.22, 0.75, 0.25, 1);
    }
    38%, 67% {
        transform: translateX(0);
        animation-timing-function: cubic-bezier(0.12, 0.72, 0.18, 1);
    }
    82%, 100% {
        transform: translateX(calc(100% + var(--impact-overshoot)));
    }
}

@keyframes mo-mask-cycle {
    0%, 9% {
        clip-path: inset(0 100% 0 0);
        animation-timing-function: cubic-bezier(0.22, 0.75, 0.25, 1);
    }
    38%, 67% {
        clip-path: inset(0);
        animation-timing-function: cubic-bezier(0.12, 0.72, 0.18, 1);
    }
    82%, 100% { clip-path: inset(0 100% 0 0); }
}

@keyframes mo-copy-cycle {
    0%, 9% {
        transform: translateX(-100%);
        animation-timing-function: cubic-bezier(0.22, 0.75, 0.25, 1);
    }
    38%, 67% {
        transform: translateX(0);
        animation-timing-function: cubic-bezier(0.12, 0.72, 0.18, 1);
    }
    82%, 100% {
        transform: translateX(calc(-100% - var(--impact-overshoot)));
    }
}

h1 {
    max-width: 650px;
    margin-top: clamp(0.875rem, 1.8vh, 1.125rem);
    color: var(--muted-color);
    font-size: clamp(1rem, 2.2vw, 1.35rem);
    font-weight: 300;
    letter-spacing: -0.015em;
    line-height: 1.45;
    text-wrap: balance;
}

.coming-soon {
    margin-top: clamp(2rem, 3vh, 2.25rem);
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    background: linear-gradient(90deg, #f05a67, #e99b16, #21a991, #3d8fd9, #9c59d1);
    background-size: 180% 100%;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    animation: gradient-shift 9s ease-in-out infinite;
}

.color-particle {
    position: fixed;
    z-index: 1;
    border-radius: 50%;
    pointer-events: none;
    animation: float-away 1.5s cubic-bezier(0.2, 0.75, 0.35, 1) forwards;
    box-shadow: 0 0 16px currentColor;
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes float-away {
    0% {
        transform: translate(0, 0) scale(0.4);
        opacity: 0;
    }
    16% {
        transform: translate(calc(var(--drift-x) * 0.18), calc(var(--drift-y) * 0.18)) scale(1);
        opacity: 0.85;
    }
    100% {
        transform: translate(var(--drift-x), var(--drift-y)) scale(0);
        opacity: 0;
    }
}

@media (max-width: 600px) {
    .container {
        width: min(100% - 2rem, 520px);
    }

    .logo-container {
        --logo-size: clamp(3.8rem, 18vw, 4.8rem);
    }

    .logo-button {
        --expanded-scale: 0.62;
    }

    .logo-fallback {
        width: min(100%, 380px);
    }

    h1 {
        max-width: 330px;
        font-size: 1rem;
    }

    .coming-soon {
        margin-top: 1.75rem;
    }
}

@media (max-width: 350px) {
    .logo-button {
        --expanded-scale: 0.60;
    }
}

@media (prefers-reduced-motion: reduce) {
    .coming-soon,
    .color-particle,
    .logo-button.is-animating .logo-stage,
    .logo-button.is-animating .logo-wheel,
    .logo-button.is-animating .logo-copy,
    .logo-button.is-animating .logo-reveal,
    .logo-button.is-animating .logo-reveal > span {
        animation: none;
    }
}
