html {
    min-width: 320px;
    min-height: 100%;
    background: #000;
}

body {
    width: 100%;
    min-height: 200svh;
    height: auto;
    display: block;
    overflow-x: hidden;
    overflow-y: auto;
    scroll-snap-type: none;
}

.intro-screen {
    position: fixed;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100svh;
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
}

.intro-screen > center:first-child h1 {
    margin: 0;
    padding-top: clamp(6px, 1.2vh, 14px);
    font-size: clamp(1.3rem, 5.35vw, 4.8rem);
    letter-spacing: clamp(0.1rem, 0.5vw, 0.45rem);
    line-height: 0.95;
    white-space: nowrap;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    text-rendering: geometricPrecision;
}

.intro-screen > center:first-child,
.intro-screen > center:last-of-type {
    position: relative;
    z-index: 3;
    contain: paint;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.intro-screen > center:last-of-type {
    padding: 0 0 clamp(6px, 1.2vh, 14px);
}

.intro-screen > center:last-of-type h2 {
    margin: 0;
    padding-top: 0;
    line-height: 0.95;
    font-weight: 400;
    font-size: clamp(1.55rem, 4.2vw, 3rem);
    letter-spacing: clamp(0.12rem, 0.48vw, 0.38rem);
    -webkit-font-smoothing: antialiased;
    text-rendering: geometricPrecision;
}

.intro-screen > center:last-of-type p {
    margin: 0;
    font-size: clamp(1rem, 2.5vh, 1.5rem);
    line-height: 1.05;
    font-weight: 400;
    letter-spacing: 0.075rem;
    -webkit-font-smoothing: antialiased;
    text-rendering: geometricPrecision;
}

.intro-screen > center:last-of-type a {
    color: inherit;
    text-decoration: none;
}

.intro-screen > center:last-of-type a:hover,
.intro-screen > center:last-of-type a:focus-visible {
    color: #54fcfc;
    text-decoration: underline;
    text-underline-offset: 0.14em;
}

.signal-stage {
    position: relative;
    width: 100%;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.mobile-blur-echo {
    display: none;
}

.canvas-stack {
    position: relative;
    flex: none;
    width: auto;
    height: min(100%, 38.4vw);
    max-width: 100%;
    aspect-ratio: 250 / 96;
    overflow: hidden;
    background: #000;
    cursor: default;
    touch-action: none;
    contain: layout paint style;
    isolation: isolate;
}

.canvas-stack.webgl-ready {
    cursor: default;
}

.canvas-stack canvas {
    position: absolute;
    left: 0;
    display: block;
    width: 100%;
    margin: 0;
}

#canvas {
    top: 0;
    z-index: 1;
    height: 83.333333%;
}

#point-canvas {
    inset: 0;
    z-index: 2;
    height: 100%;
    image-rendering: auto;
    pointer-events: none;
    visibility: hidden;
}

.canvas-stack.webgl-ready #canvas {
    visibility: hidden;
}

.canvas-stack.webgl-ready #point-canvas {
    visibility: visible;
}

.work-flight {
    position: fixed;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100svh;
    min-height: 440px;
    overflow: hidden;
    background: #01040a;
    isolation: isolate;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#work-canvas {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    image-rendering: auto;
    touch-action: pan-y;
}

.sound-toggle {
    position: fixed;
    right: clamp(10px, 1.5vw, 22px);
    bottom: clamp(10px, 1.7vh, 18px);
    z-index: 8;
    padding: 6px 8px;
    border: 1px solid rgba(84, 252, 252, 0.34);
    background: rgba(0, 5, 16, 0.72);
    color: #54fcfc;
    font: 400 clamp(0.92rem, 1.5vw, 1.1rem)/1 'VT323', monospace;
    letter-spacing: 0.08em;
    cursor: pointer;
    opacity: 0.74;
}

.sound-toggle:hover,
.sound-toggle:focus-visible,
.sound-toggle[aria-pressed="true"] {
    border-color: rgba(84, 252, 252, 0.86);
    color: #fff;
    opacity: 1;
    outline: none;
}

@media (hover: none), (pointer: coarse) {
    .canvas-stack {
        cursor: auto;
    }

    .mobile-blur-echo {
        position: absolute;
        inset: 0;
        z-index: 4;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        pointer-events: none;
        mix-blend-mode: screen;
        transform: translateZ(0);
    }

    .mobile-blur-echo__line {
        position: relative;
        flex: none;
        color: transparent;
        font: 400 clamp(5rem, 26vw, 9rem)/0.82 'VT323', monospace;
        letter-spacing: 0.035em;
        white-space: nowrap;
        opacity: 0.58;
        text-shadow:
            0 0 14px rgba(0, 86, 255, 0.96),
            0 0 34px rgba(0, 124, 255, 0.72),
            0 0 68px rgba(0, 196, 255, 0.34);
        transform: translate3d(-3%, 1%, 0) scale(1.06);
        animation: mobile-blur-drift 13s ease-in-out infinite alternate;
    }
}

@keyframes mobile-blur-drift {
    from {
        transform: translate3d(-5%, -1.5%, 0) scale(1.06);
    }
    to {
        transform: translate3d(5%, 1.5%, 0) scale(1.1);
    }
}

@media (hover: none) and (pointer: coarse) and (orientation: portrait) {
    .canvas-stack {
        transform: scale(3.1);
        transform-origin: center;
    }

    .sound-toggle {
        bottom: clamp(82px, 10svh, 96px);
    }
}

@media (hover: none) and (pointer: coarse) and (orientation: landscape) {
    .intro-screen {
        grid-template-rows: 0 minmax(0, 1fr) 0;
    }

    .intro-screen > center:first-child {
        position: absolute;
        inset: 0 0 auto;
    }

    .intro-screen > center:last-of-type {
        position: absolute;
        inset: auto 0 0;
    }

    .signal-stage {
        height: 100svh;
    }

    .canvas-stack {
        height: min(100svh, 38.4vw);
        max-width: none;
    }
}

@media (max-height: 520px) {
    .intro-screen > center:first-child h1 {
        font-size: clamp(1.2rem, 4.6vw, 2.5rem);
        letter-spacing: clamp(0.1rem, 0.52vw, 0.3rem);
    }

    .intro-screen > center:last-of-type h2 {
        font-size: clamp(1.6rem, 8vh, 2.4rem);
    }

    .intro-screen > center:last-of-type p {
        font-size: clamp(0.9rem, 4vh, 1.15rem);
    }
}

@media (prefers-reduced-motion: reduce) {
    #point-canvas {
        display: none;
    }
}
