:root {
    --bg-deep: #050d1a;
    --bg-navy: #0f233e;
    --bg-navy-light: #1b3a5c;
    --accent: #0099ff;
    --accent-soft: rgba(0,153,255,.16);
    --white: #ffffff;
    --text-muted: #8ba0bd;
    --text-faint: #4a5f7d;
    --ease: cubic-bezier(.16,.8,.28,1);
}

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

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    background: radial-gradient(ellipse 190% 140% at 50% 34%, rgba(0,153,255,.42) 0%, rgba(0,153,255,.20) 32%, rgba(0,153,255,.06) 58%, rgba(0,153,255,0) 82%), radial-gradient(ellipse 130% 90% at 50% 20%, var(--bg-navy) 0%, var(--bg-deep) 62%, #030710 100%);
    color: var(--white);
    font-family: 'Inter',-apple-system,sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

canvas#trail {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.scene {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8vh 24px calc(12vh + 68px);
}

/* ---------- Brand block ---------- */
.brand-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 1.05s var(--ease), margin 1.05s var(--ease);
    margin-top: 0;
}

.eyebrow {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'IBM Plex Mono',monospace;
    font-size: 11px;
    letter-spacing: .22em;
    color: var(--text-muted);
    margin-bottom: 38px;
    opacity: 0;
    animation: fadeUp .9s var(--ease) .15s forwards;
}

.eyebrow-mark {
    width: 6px;
    height: 6px;
    background: var(--accent);
    flex-shrink: 0;
    animation: dotBreathe 2.8s ease-in-out infinite;
}

@keyframes dotBreathe {
    0%,100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: .55;
        transform: scale(1.25);
    }
}

.mark-btn {
    appearance: none;
    -webkit-appearance: none;
    forced-color-adjust: none;
    background: transparent;
    background-color: transparent;
    border: none;
    cursor: pointer;
    padding: 22px;
    border-radius: 24px;
    display: flex;
    position: relative;
    outline-offset: 6px;
    opacity: 0;
    --tx: 0px;
    --ty: 0px;
    --ms: 1;
    animation: fadeUp 1s var(--ease) .3s forwards;
    transition: transform .35s cubic-bezier(.2,.8,.3,1);
    transform: translate(var(--tx), var(--ty)) scale(var(--ms));
}

    .mark-btn:active {
        transform: translate(var(--tx), var(--ty)) scale(.96);
    }

    .mark-btn:focus-visible {
        outline: 1.5px solid var(--accent);
    }

.mark-glow {
    position: absolute;
    inset: -40px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-soft) 0%, rgba(0,153,255,0) 70%);
    opacity: .7;
    filter: blur(6px);
    transition: opacity .6s var(--ease), transform .6s var(--ease);
    pointer-events: none;
}

.mark-btn:hover .mark-glow {
    opacity: 1;
    transform: scale(1.12);
}

.mark-grid {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, 34px);
    grid-template-rows: repeat(3, 34px);
    gap: 14px;
    forced-color-adjust: none;
}

    .mark-grid .cell {
        width: 34px;
        height: 34px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mark-grid .sq {
        width: 100%;
        height: 100%;
        background: var(--white);
        transition: transform .6s var(--ease), background .3s;
    }

        .mark-grid .sq.accent {
            width: 52%;
            height: 52%;
            background: var(--accent);
            animation: accentBreathe 3.4s ease-in-out infinite;
        }

@keyframes accentBreathe {
    0%,100% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(0,153,255,0);
    }

    50% {
        transform: scale(1.12);
        box-shadow: 0 0 10px rgba(0,153,255,.5);
    }
}

body.rippling .mark-grid .sq {
    animation: markPulse 1.2s var(--ease);
}

    body.rippling .mark-grid .sq.accent {
        animation: markPulse 1.2s var(--ease);
    }

.mark-grid .cell:nth-child(1) .sq {
    animation-delay: 0s;
}

.mark-grid .cell:nth-child(2) .sq {
    animation-delay: .03s;
}

.mark-grid .cell:nth-child(3) .sq {
    animation-delay: .06s;
}

.mark-grid .cell:nth-child(4) .sq {
    animation-delay: .09s;
}

.mark-grid .cell:nth-child(5) .sq {
    animation-delay: .06s;
}

.mark-grid .cell:nth-child(6) .sq {
    animation-delay: .09s;
}

@keyframes markPulse {
    30% {
        transform: scale(.88);
    }

    55% {
        transform: scale(1.08);
    }

    100% {
        transform: scale(1);
    }
}

.wordmark {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

    .wordmark span {
        color: var(--accent);
    }

.tagline {
    margin-top: 38px;
    font-family: 'IBM Plex Mono',monospace;
    font-size: 13.5px;
    color: var(--text-muted);
    text-align: center;
    max-width: 420px;
    line-height: 1.7;
    letter-spacing: .01em;
    opacity: 0;
    animation: fadeUp 1s var(--ease) .45s forwards;
    transition: opacity .5s var(--ease), height .5s var(--ease), margin .5s var(--ease);
}

.hint {
    margin-top: 46px;
    font-family: 'IBM Plex Mono',monospace;
    font-size: 10.5px;
    letter-spacing: .2em;
    color: var(--text-faint);
    text-transform: uppercase;
    opacity: 0;
    animation: hintPulse 2.6s ease-in-out .8s infinite;
    transition: opacity .4s var(--ease), height .4s var(--ease), margin .4s var(--ease);
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes hintPulse {
    0%,100% {
        opacity: .35;
    }

    50% {
        opacity: .85;
    }
}

/* ---------- Ripple rings ---------- */
.ripple-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--accent);
    transform: translate(-50%,-50%) scale(1);
    opacity: 0;
    pointer-events: none;
    z-index: 2;
}

body.rippling .ripple-ring {
    animation: ripple 1.6s var(--ease) forwards;
}

.ripple-ring:nth-child(1) {
    animation-delay: 0s;
}

.ripple-ring:nth-child(2) {
    animation-delay: .16s;
}

.ripple-ring:nth-child(3) {
    animation-delay: .32s;
}

@keyframes ripple {
    0% {
        transform: translate(-50%,-50%) scale(1);
        opacity: .55;
    }

    100% {
        transform: translate(-50%,-50%) scale(26);
        opacity: 0;
    }
}

/* ---------- Opened state ---------- */
body.opened .brand-wrap {
    margin-top: 0;
    transform: scale(.82);
}

body.opened .tagline {
    opacity: 0;
    height: 0;
    margin-top: 0;
    overflow: hidden;
}

body.opened .hint {
    opacity: 0;
    animation: none;
    pointer-events: none;
    height: 0;
    margin-top: 0;
    overflow: hidden;
}

/* ---------- Options ---------- */
.options {
    display: flex;
    gap: 20px;
    margin-top: 0;
    max-width: 760px;
    width: 100%;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height .85s var(--ease), margin-top .85s var(--ease);
}

body.opened .options {
    margin-top: 58px;
    max-height: 420px;
    opacity: 1;
}

.option {
    flex: 1;
    text-decoration: none;
    color: var(--white);
    background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,0));
    border: 1px solid rgba(255,255,255,.09);
    border-left: 2px solid var(--accent);
    border-radius: 4px;
    padding: 26px 26px 28px;
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .7s var(--ease), transform .7s var(--ease), border-color .35s, background .35s;
}

body.opened .option {
    opacity: 1;
    transform: translateY(0);
}

    body.opened .option:nth-child(1) {
        transition-delay: .35s;
    }

    body.opened .option:nth-child(2) {
        transition-delay: .48s;
    }

.option:hover {
    border-color: rgba(255,255,255,.18);
    border-left-color: var(--accent);
    background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.01));
}

.option:focus-visible {
    outline: 1.5px solid var(--accent);
    outline-offset: 3px;
}

.option-title {
    font-family: 'Space Grotesk',sans-serif;
    font-weight: 600;
    font-size: 19px;
    letter-spacing: .01em;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

    .option-title .arrow {
        color: var(--accent);
        font-size: 16px;
        transition: transform .35s var(--ease);
    }

.option:hover .option-title .arrow {
    transform: translateX(4px);
}

.option-body {
    margin-top: 12px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-muted);
}

.site-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    padding: 15px 30px;
    background: rgba(8,17,31,.68);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255,255,255,.07);
    font-family: 'IBM Plex Mono',monospace;
    font-size: 10.5px;
    letter-spacing: .09em;
    color: var(--text-faint);
    text-transform: uppercase;
}

    .site-footer .copyright {
        white-space: nowrap;
    }

    .site-footer nav {
        display: flex;
        gap: 22px;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

        .site-footer nav a {
            color: var(--text-muted);
            text-decoration: none;
            white-space: nowrap;
            transition: color .25s var(--ease);
        }

            .site-footer nav a:hover {
                color: var(--accent);
            }

            .site-footer nav a:focus-visible {
                outline: 1.5px solid var(--accent);
                outline-offset: 3px;
            }

@media (max-width:760px) {
    .site-footer {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 9px;
        padding: 13px 20px;
    }

        .site-footer nav {
            justify-content: center;
            gap: 11px 16px;
        }
}

@media (max-width:640px) {
    .options {
        flex-direction: column;
    }

    .mark-grid {
        grid-template-columns: repeat(2, 28px);
        grid-template-rows: repeat(3, 28px);
        gap: 11px;
    }

    .wordmark {
        letter-spacing: .03em;
    }

    .scene {
        padding-bottom: calc(10vh + 130px);
        padding-top: 5vh;
    }

    body.opened .brand-wrap {
        transform: scale(.68);
    }

    body.opened .options {
        margin-top: 22px;
    }

    .option {
        padding: 18px 20px 20px;
    }

    .option-title {
        font-size: 17px;
    }

    .option-body {
        font-size: 13px;
        margin-top: 8px;
    }
}

@media (max-width:400px) {
    .scene {
        padding-bottom: calc(2vh + 320px);
        padding-top: 1.5vh;
    }

    body.opened .brand-wrap {
        transform: scale(.34);
    }

    body.opened .options {
        margin-top: 6px;
        gap: 6px;
    }

    .option {
        padding: 9px 13px 10px;
    }

    .option-title {
        font-size: 13px;
    }

    .option-body {
        font-size: 11px;
        margin-top: 3px;
        line-height: 1.35;
    }

    .site-footer {
        font-size: 8.5px;
        padding: 8px 13px;
        gap: 5px;
    }

        .site-footer nav {
            gap: 5px 10px;
        }
}

@media (max-height:600px) and (max-width:640px) {
    .scene {
        padding-bottom: calc(1vh + 260px);
        padding-top: 1vh;
    }

    body.opened .brand-wrap {
        transform: scale(.28);
    }

    body.opened .options {
        margin-top: 3px;
        gap: 5px;
    }

    .option {
        padding: 7px 11px 8px;
    }

    .option-title {
        font-size: 12.5px;
    }

    .option-body {
        font-size: 10.5px;
        margin-top: 2px;
        line-height: 1.3;
    }

    .site-footer {
        font-size: 8px;
        padding: 6px 11px;
        gap: 4px;
    }

        .site-footer nav {
            gap: 4px 8px;
        }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .2s !important;
    }

    canvas#trail {
        display: none;
    }
}
