/* ============================================================
   index.css — VSM startup / intro screen
   Shared brand tokens (--cyber, --space) match the banner/crest
   reference art. Reuse these vars on every other VSM page so the
   whole site reads as one identity.
   ============================================================ */

:root {
    --bg: #0b0c14;
    --cyber: #4da6ff;
    --cyber2: #2980d4;
    --space: #a78bfa;
    --space2: #7c3aed;
    --lilly: #ff6eb4;
    --army: #6b7a4a;
    --text: #f3f6ff;
    --muted: #8891b8;
    --border: rgba(140, 150, 220, 0.18);
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    width: 100%;
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: 'Rajdhani', sans-serif;
    overflow: hidden;
    position: relative;
}

/* ── custom cursor (shared VSM pattern — port to every page) ── */
@media (pointer: fine) {

    body,
    a,
    button {
        cursor: none;
    }
}

#cursor {
    position: fixed;
    width: 10px;
    height: 10px;
    background: var(--cyber);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 16px var(--cyber);
    mix-blend-mode: screen;
}

#cursorRing {
    position: fixed;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(140, 150, 220, 0.4);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: width 0.2s ease, height 0.2s ease, border-color 0.2s ease;
}

/* ── background canvas (circuit + stars, drawn in Scripts/index.js) ── */
#bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    animation: fadeIn 1.4s ease both;
}

.vignette {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: radial-gradient(ellipse 70% 60% at 50% 50%, transparent 45%, rgba(0, 0, 0, 0.75) 100%);
}

/* ── corner brackets ── */
.bracket {
    position: fixed;
    width: 60px;
    height: 60px;
    z-index: 5;
    pointer-events: none;
    opacity: 0;
    animation: fadeIn 1s ease 0.1s forwards;
}

.bracket svg {
    width: 100%;
    height: 100%;
}

.bracket.tl {
    top: 32px;
    left: 32px;
}

.bracket.tr {
    top: 32px;
    right: 32px;
    transform: scaleX(-1);
}

.bracket.bl {
    bottom: 32px;
    left: 32px;
    transform: scaleY(-1);
}

.bracket.br {
    bottom: 32px;
    right: 32px;
    transform: scale(-1, -1);
}

/* ── shared keyframes ── */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── IDLE STAGE ── */
#idle {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    transition: opacity 0.6s ease, transform 0.8s var(--ease);
}

#idle.leaving {
    opacity: 0;
    transform: scale(0.97);
}

.eyebrow {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.85rem;
    letter-spacing: 0.5em;
    color: var(--muted);
    text-transform: uppercase;
    opacity: 0;
    animation: fadeUp 0.9s var(--ease) 0.2s forwards;
}

.wordmark-row {
    display: flex;
    align-items: center;
    gap: clamp(16px, 3vw, 36px);
}

/* ── flank ticks: spin/scale in after the wordmark lands ── */
.flank-tick {
    width: clamp(20px, 3vw, 34px);
    height: clamp(20px, 3vw, 34px);
    clip-path: polygon(50% 0%, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0% 50%, 39% 39%);
    opacity: 0;
    animation: tickIn 0.9s var(--ease) forwards;
}

.flank-tick.l,
.flank-tick.r {
    animation-delay: 1s;
}

.flank-tick.li,
.flank-tick.o {
    animation-delay: 1.15s;
}

@keyframes tickIn {
    from {
        opacity: 0;
        transform: scale(0.2) rotate(-90deg);
    }

    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.flank-tick.l {
    background: linear-gradient(160deg, #fff 15%, var(--cyber) 100%);
    filter: drop-shadow(0 0 8px rgba(77, 166, 255, 0.7));
}

.flank-tick.r {
    background: linear-gradient(160deg, #fff 15%, var(--space) 100%);
    filter: drop-shadow(0 0 8px rgba(167, 139, 250, 0.7));
}

.flank-tick.o {
    background: linear-gradient(160deg, #fff 15%, var(--army) 100%);
    filter: drop-shadow(0 0 8px rgba(107, 122, 74, 0.7));
}

.flank-tick.li {
    background: linear-gradient(160deg, #fff 15%, var(--lilly) 100%);
    filter: drop-shadow(0 0 8px rgba(255, 110, 180, 0.7));
}

/* ── wordmark: letters rise out of masks, glow fades in after ── */
.wordmark {
    display: flex;
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: clamp(4rem, 14vw, 9rem);
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--text);
}

.mask {
    display: block;
    overflow: hidden;
    padding: 0.04em 0.02em;
}

.ch {
    display: block;
    transform: translateY(110%);
    animation: rise 1.1s var(--ease) forwards;
    transition: text-shadow 0.9s ease;
}

.mask:nth-child(1) .ch {
    animation-delay: 0.45s;
}

.mask:nth-child(2) .ch {
    animation-delay: 0.6s;
}

.mask:nth-child(3) .ch {
    animation-delay: 0.75s;
}

@keyframes rise {
    to {
        transform: translateY(0);
    }
}

/* added by JS once the last letter lands, so the glow isn't clipped */
.wordmark.revealed .mask {
    overflow: visible;
}

.wordmark.revealed .ch {
    text-shadow: -4px 0 26px rgba(77, 166, 255, 0.35), 4px 0 26px rgba(167, 139, 250, 0.35);
}

/* ── underline draws out ── */
.underline {
    width: min(70vw, 460px);
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--cyber) 30%, var(--space) 70%, transparent);
    opacity: 0.7;
    transform: scaleX(0);
    animation: draw 1.2s var(--ease) 1.2s forwards;
}

@keyframes draw {
    to {
        transform: scaleX(1);
    }
}

.tagline {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.35em;
    color: var(--muted);
    text-transform: uppercase;
    opacity: 0;
    animation: fadeUp 0.9s var(--ease) 1.7s forwards;
}

/* ── enter button ── */
#enterBtn {
    position: relative;
    margin-top: 10px;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: rgba(140, 150, 220, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: fadeIn 0.9s ease 2.2s forwards;
    transition: border-color 0.25s ease, background 0.25s ease, transform 0.15s ease;
}

#enterBtn:hover {
    border-color: rgba(140, 150, 220, 0.5);
    background: rgba(140, 150, 220, 0.1);
    transform: scale(1.04);
}

#enterBtn:active {
    transform: scale(0.97);
}

#enterBtn:focus-visible {
    outline: 2px solid var(--cyber);
    outline-offset: 4px;
}

.enter-ring {
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 1px solid rgba(77, 166, 255, 0.25);
    animation: ringPulse 2.4s ease-out 2.4s infinite;
}

@keyframes ringPulse {
    0% {
        opacity: 0.9;
        transform: scale(0.9);
    }

    100% {
        opacity: 0;
        transform: scale(1.35);
    }
}

.enter-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.6rem;
    letter-spacing: 0.15em;
    color: var(--text);
    text-transform: uppercase;
}

.enter-label i {
    font-size: 1.4rem;
    color: var(--cyber);
}

.enter-hint {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.68rem;
    letter-spacing: 0.3em;
    color: var(--muted);
    text-transform: uppercase;
    opacity: 0;
    animation: fadeUp 0.9s var(--ease) 2.5s forwards;
}

.blink-cursor {
    display: inline-block;
    animation: blink 1s step-end infinite;
    color: var(--cyber);
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* ── page-leave curtain (wipes up, then redirect) ── */
#curtain {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: var(--bg);
    transform: translateY(100%);
    pointer-events: none;
    transition: transform 0.9s var(--ease);
}

#curtain.active {
    transform: translateY(0);
}

/* ── reduced motion: everything just appears, no movement ── */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-delay: 0s !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (max-width: 600px) {
    .bracket {
        width: 40px;
        height: 40px;
    }

    .bracket.tl,
    .bracket.tr {
        top: 18px;
    }

    .bracket.bl,
    .bracket.br {
        bottom: 18px;
    }

    .bracket.tl,
    .bracket.bl {
        left: 18px;
    }

    .bracket.tr,
    .bracket.br {
        right: 18px;
    }
}