/* ==========================================================================
   editor-splash.css
   Анимация-заставка перед открытием модального окна "Редактор".
   ========================================================================== */

/* --------------------------------------------------------------------------
   Оверлей
   -------------------------------------------------------------------------- */

.editor-splash-overlay {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;

    /* Тёмный фон — глубокий, почти чёрный, без ярких вспышек */
    background:
            radial-gradient(ellipse at 50% 45%,
            #0a0f14 0%,
            #060809 55%,
            #000000 100%);

    opacity: 0;
    visibility: hidden;
    transition: opacity 0.45s ease, visibility 0.45s ease;

    pointer-events: none;
    overflow: hidden;
}

.editor-splash-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.editor-splash-overlay.leaving {
    opacity: 0;
    visibility: visible;
}

/* Светлая тема — светлый фон */
body.light-theme .editor-splash-overlay {
    background:
            radial-gradient(ellipse at 50% 40%, #eef4ff 0%, #dde6f0 60%, #ffffff 100%);
}

/* Блокировка прокрутки страницы */
body.modal-open-splash {
    overflow: hidden !important;
}

/* --------------------------------------------------------------------------
   Декоративный фон: сетка и свечение
   -------------------------------------------------------------------------- */

.editor-splash-bg-grid {
    position: absolute;
    inset: -20%;
    background-image:
            linear-gradient(rgba(183, 255, 105, 0.03) 1px, transparent 1px),
            linear-gradient(90deg, rgba(183, 255, 105, 0.03) 1px, transparent 1px);
    background-size: 52px 52px;
    background-position: center;
    transform: perspective(700px) rotateX(62deg) scale(1.7);
    transform-origin: center;
    animation: editor-splash-grid-drift 22s linear infinite;
    pointer-events: none;
    opacity: 0.35;
}

@keyframes editor-splash-grid-drift {
    from { background-position: 0 0, 0 0; }
    to   { background-position: 0 52px, 52px 0; }
}

/* Тёмная тема — приглушённое свечение без пульсации */
.editor-splash-bg-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 720px;
    height: 720px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle,
    rgba(123, 215, 221, 0.06) 0%,
    rgba(183, 255, 105, 0.03) 25%,
    rgba(0, 0, 0, 0.00) 65%);
    filter: blur(20px);
    pointer-events: none;
    /* 🎯 Убираем пульсацию — оставляем статичное свечение */
    opacity: 1;
}

body.light-theme .editor-splash-bg-glow {
    background: radial-gradient(circle,
    rgba(72, 0, 150, 0.14) 0%,
    rgba(47, 111, 122, 0.08) 30%,
    rgba(72, 0, 150, 0.00) 70%);
    filter: blur(10px);
    animation: editor-splash-glow-pulse 3s ease-in-out infinite;
}

@keyframes editor-splash-glow-pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1.0); opacity: 0.85; }
    50%      { transform: translate(-50%, -50%) scale(1.12); opacity: 1; }
}

/* --------------------------------------------------------------------------
   Контент
   -------------------------------------------------------------------------- */

.editor-splash-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0 24px;
    max-width: 900px;
    width: 100%;
    user-select: none;
}

/* --------------------------------------------------------------------------
   Строка 1: заголовок "MASMDV от ХАНДЫФАР"
   -------------------------------------------------------------------------- */

.editor-splash-title {
    margin: 0;
    padding: 0;
    font-family: 'Source Code Pro', 'Consolas', 'Monaco', monospace;
    font-size: clamp(2.2rem, 6vw, 4.2rem);
    font-weight: 900;
    letter-spacing: 0.06em;
    line-height: 1.1;
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: baseline;
    white-space: nowrap;
}

/* Каждая буква заголовка */
.editor-splash-title-char {
    display: inline-block;
    opacity: 0;
    transform: translateY(28px) rotateX(-40deg);

    /* 🎯 Тёмная тема: сдержанный белый с мягким свечением */
    color: #E8E8E8;
    text-shadow:
            0 0 6px rgba(183, 255, 105, 0.18),
            0 1px 1px rgba(0, 0, 0, 0.6);

    animation: editor-splash-char-in 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Ключевые буквы — мягкий зелёный акцент */
.editor-splash-title-char.is-accent {
    color: #B7FF69;
    text-shadow:
            0 0 8px rgba(183, 255, 105, 0.45),
            0 0 18px rgba(183, 255, 105, 0.15),
            0 1px 1px rgba(0, 0, 0, 0.6);
}

.editor-splash-title-char.is-space {
    width: 0.4em;
}

@keyframes editor-splash-char-in {
    0% {
        opacity: 0;
        transform: translateY(28px) rotateX(-40deg) scale(0.85);
    }
    60% {
        opacity: 1;
    }
    100% {
        opacity: 1;
        transform: translateY(0) rotateX(0) scale(1);
    }
}

body.light-theme .editor-splash-title-char {
    color: #000000;
    text-shadow:
            0 0 8px rgba(72, 0, 150, 0.3),
            0 0 18px rgba(72, 0, 150, 0.15);
}

body.light-theme .editor-splash-title-char.is-accent {
    color: #480096;
    text-shadow:
            0 0 10px rgba(72, 0, 150, 0.5),
            0 0 24px rgba(72, 0, 150, 0.3),
            0 0 40px rgba(72, 0, 150, 0.15);
}

/* --------------------------------------------------------------------------
   Строка 2: слоган
   -------------------------------------------------------------------------- */

.editor-splash-subtitle {
    margin: 22px 0 0 0;
    padding: 0;
    font-family: 'Source Code Pro', 'Consolas', 'Monaco', monospace;
    font-size: clamp(0.95rem, 2vw, 1.25rem);
    font-weight: 500;
    letter-spacing: 0.02em;

    /* 🎯 Тёмная тема: чуть приглушённый серо-белый */
    color: rgba(220, 220, 220, 0.75);

    opacity: 0;
    transform: translateY(14px);
    animation: editor-splash-fade-up 0.7s ease-out 1.1s forwards;
}

body.light-theme .editor-splash-subtitle {
    color: rgba(0, 0, 0, 0.75);
}

@keyframes editor-splash-fade-up {
    0%   { opacity: 0; transform: translateY(14px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------------------------
   Разделитель
   -------------------------------------------------------------------------- */

.editor-splash-divider {
    margin: 28px 0 22px 0;
    width: 0;
    height: 1px;

    /* 🎯 Тёмная тема: сдержанный градиент, без яркой неоновой линии */
    background: linear-gradient(90deg,
    transparent 0%,
    rgba(183, 255, 105, 0.35) 50%,
    transparent 100%);

    animation: editor-splash-divider-in 0.8s ease-out 1.6s forwards;
}

body.light-theme .editor-splash-divider {
    background: linear-gradient(90deg,
    transparent 0%,
    rgba(72, 0, 150, 0.5) 50%,
    transparent 100%);
}

@keyframes editor-splash-divider-in {
    0%   { width: 0; opacity: 0; }
    100% { width: min(420px, 70%); opacity: 1; }
}

/* --------------------------------------------------------------------------
   Строка 3: автор
   -------------------------------------------------------------------------- */

.editor-splash-author {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;

    opacity: 0;
    transform: translateY(12px);
    animation: editor-splash-fade-up 0.7s ease-out 2.0s forwards;
}

.editor-splash-author-label {
    font-family: 'Source Code Pro', 'Consolas', 'Monaco', monospace;
    font-size: clamp(0.65rem, 1.2vw, 0.78rem);
    font-weight: 600;
    letter-spacing: 0.35em;
    text-transform: uppercase;

    /* 🎯 Тёмная тема: приглушённый зелёный, без яркого неона */
    color: rgba(183, 255, 105, 0.6);
}

body.light-theme .editor-splash-author-label {
    color: rgba(72, 0, 150, 0.7);
}

.editor-splash-author-name {
    font-family: 'Source Code Pro', 'Consolas', 'Monaco', monospace;
    font-size: clamp(1rem, 2vw, 1.35rem);
    font-weight: 700;
    letter-spacing: 0.02em;

    /* 🎯 Тёмная тема: спокойный светлый, без двойного голубого свечения */
    color: #F0F0F0;
    text-shadow:
            0 0 6px rgba(123, 215, 221, 0.15),
            0 1px 1px rgba(0, 0, 0, 0.5);
}

body.light-theme .editor-splash-author-name {
    color: #000000;
    text-shadow:
            0 0 8px rgba(47, 111, 122, 0.25),
            0 0 16px rgba(47, 111, 122, 0.1);
}

/* --------------------------------------------------------------------------
   Адаптация под мобильные
   -------------------------------------------------------------------------- */

@media (max-width: 768px) {
    .editor-splash-title {
        font-size: clamp(1.5rem, 7vw, 2.6rem);
        letter-spacing: 0.02em;
        flex-wrap: wrap;
        white-space: normal;
    }

    .editor-splash-subtitle {
        font-size: clamp(0.8rem, 3.4vw, 1rem);
        padding: 0 8px;
        line-height: 1.35;
    }

    .editor-splash-author-label {
        letter-spacing: 0.25em;
    }

    .editor-splash-author-name {
        font-size: clamp(0.9rem, 3.6vw, 1.15rem);
    }

    .editor-splash-divider {
        margin: 22px 0 18px 0;
    }

    .editor-splash-bg-grid {
        background-size: 36px 36px;
        opacity: 0.25;
    }

    .editor-splash-bg-glow {
        width: 420px;
        height: 420px;
    }
}

@media (max-width: 480px) {
    .editor-splash-title {
        font-size: clamp(1.3rem, 7.5vw, 2rem);
    }

    .editor-splash-subtitle {
        font-size: 0.82rem;
    }

    .editor-splash-author-name {
        font-size: 0.95rem;
    }
}

/* Уважаем настройку "уменьшить анимацию" */
@media (prefers-reduced-motion: reduce) {
    .editor-splash-bg-grid {
        animation: none;
    }

    .editor-splash-bg-glow {
        animation: none;
    }

    .editor-splash-title-char {
        animation-duration: 0.2s;
    }
}
