/* CODE ENTRY GATE — Celestial Manuscript */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
    --gate-blue: #0d1257;
    --gate-saffron: #ff8f00;
    --gate-cream: #fdf6e3;
    --gate-white: #ffffff;
}

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

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

body.gate-body {
    font-family: 'DM Sans', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gate-blue);
    color: var(--gate-cream);
}

.gate-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.gate-bg canvas {
    width: 100%;
    height: 100%;
}

.gate-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(13, 18, 87, 0.3) 0%, rgba(13, 18, 87, 0.7) 50%, rgba(13, 18, 87, 0.95) 100%);
    z-index: 1;
}

.gate-container {
    position: relative;
    z-index: 10;
    text-align: center;
    max-width: 480px;
    width: 90%;
    animation: gateEnter 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes gateEnter {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

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

.gate-lotus {
    width: 80px;
    height: 80px;
    margin: 0 auto 2rem;
    animation: lotusBreath 4s ease-in-out infinite;
}

.gate-lotus svg {
    width: 100%;
    height: 100%;
}

@keyframes lotusBreath {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.08);
        opacity: 1;
    }
}

.gate-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 700;
    color: var(--gate-cream);
    margin-bottom: 0.5rem;
}

.gate-subtitle {
    font-size: clamp(0.85rem, 1.5vw, 1rem);
    color: rgba(253, 246, 227, 0.5);
    font-weight: 300;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 2.5rem;
}

.gate-form {
    position: relative;
    margin-bottom: 1.5rem;
}

.gate-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(253, 246, 227, 0.06);
    border: 2px solid rgba(253, 246, 227, 0.15);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.gate-input-wrap:focus-within {
    border-color: var(--gate-saffron);
    box-shadow: 0 0 0 4px rgba(255, 143, 0, 0.15);
    background: rgba(253, 246, 227, 0.1);
}

.gate-input-wrap.error {
    border-color: #ef5350;
    box-shadow: 0 0 0 4px rgba(239, 83, 80, 0.15);
    animation: shake 0.5s ease;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-8px);
    }

    40% {
        transform: translateX(8px);
    }

    60% {
        transform: translateX(-5px);
    }

    80% {
        transform: translateX(5px);
    }
}

.gate-input {
    flex: 1;
    padding: 1rem 1.25rem;
    background: transparent;
    border: none;
    outline: none;
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    color: var(--gate-cream);
    letter-spacing: 4px;
    text-align: center;
}

.gate-input::placeholder {
    color: rgba(253, 246, 227, 0.3);
    letter-spacing: 2px;
}

.gate-submit {
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--gate-saffron), #e65100);
    border: none;
    color: var(--gate-white);
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.gate-submit:hover {
    background: linear-gradient(135deg, #ffa726, var(--gate-saffron));
}

.gate-submit svg {
    width: 20px;
    height: 20px;
}

.gate-error {
    font-size: 0.85rem;
    color: #ef5350;
    margin-top: 0.75rem;
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.3s ease;
}

.gate-error.visible {
    opacity: 1;
    transform: translateY(0);
}

.gate-hint {
    font-size: 0.8rem;
    color: rgba(253, 246, 227, 0.3);
    margin-top: 2rem;
    letter-spacing: 1px;
}

.gate-hint span {
    color: var(--gate-saffron);
    font-weight: 600;
}

.gate-transition {
    position: fixed;
    inset: 0;
    background: var(--gate-blue);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease;
}

.gate-transition.active {
    opacity: 1;
    visibility: visible;
}

.gate-transition .loader {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(253, 246, 227, 0.1);
    border-top-color: var(--gate-saffron);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.gate-particles {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--gate-saffron);
    border-radius: 50%;
    opacity: 0;
    animation: particleFloat 8s ease-in-out infinite;
}

@keyframes particleFloat {
    0% {
        opacity: 0;
        transform: translateY(100vh) scale(0);
    }

    10% {
        opacity: 0.6;
    }

    90% {
        opacity: 0.3;
    }

    100% {
        opacity: 0;
        transform: translateY(-20vh) scale(1);
    }
}

@media (max-width: 480px) {
    .gate-container {
        width: 92%;
    }

    .gate-lotus {
        width: 60px;
        height: 60px;
    }

    .gate-input {
        padding: 0.85rem 1rem;
        font-size: 0.9rem;
    }
}