/* ========== 1) Сброс отступов и базовые стили ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background: radial-gradient(circle at center, #0d1117, #1a202c, #000000);
    color: #e2e8f0;

    /*  Убираем justify-content: space-between и padding-bottom */
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    text-align: center;
    overflow-x: hidden;
    position: relative;
}

/* ========== 2) Новый контейнер content-wrapper центрирует содержимое ========== */
.content-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;  /* выровнять по вертикали */
    align-items: center;      /* выровнять по горизонтали */
    flex: 1;                  /* взять всё доступное пространство, чтобы "оттянуть" футер вниз */
}

/* ========== 3) Частицы (оставляем без изменений) ========== */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #e2e8f0;
    border-radius: 50%;
    animation: float 7s infinite linear;
    opacity: 0;
    will-change: transform, opacity;
}

@keyframes float {
    0% {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(calc(-50vw + 100px));
        opacity: 0;
    }
}

/* ========== 4) Заголовок (title) ========== */
#main-title {
    position: relative;
    font-size: 5em;
    /* margin-top: 1em;   -- убираем, потому что позиция теперь задаётся content-wrapper */
    z-index: 1;
    opacity: 0;
    animation: fadeInTitle 1.5s ease-in-out forwards;
    transition: transform 0.3s ease;
    cursor: default;
}

#main-title:hover {
    transform: scale(1.05);
}

@keyframes fadeInTitle {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ========== 5) Подзаголовок (subtitle) ========== */
#subtitle {
    position: relative;
    font-size: 1.5em;
    margin-top: 0.5em;
    color: #718096;
    height: 1.2em; /* Чтобы не «дергалось» при смене длины текста */
    overflow: hidden;
    border-right: 2px solid #718096;
    white-space: nowrap;
    letter-spacing: 0.05em;
    z-index: 1;
}

/* Мерцание курсора справа в подзаголовке */
@keyframes blinkCursor {
    0%, 100% { border-color: transparent; }
    50%      { border-color: #718096; }
}

/* ========== 6) Футер ========== */
footer {
    width: 100%;
    padding: 1em 0;
    font-size: 1em;
    color: #718096;
    z-index: 1;
    background: rgba(0, 0, 0, 0.2);
    position: relative;
    /* Если вы хотите, чтобы футер «прилипал» к низу, когда контент небольшой, 
       можно оставить flex-контейнер в теле. content-wrapper возьмёт всё свободное 
       место, а футер автоматически ляжет внизу. */
}

/* Ссылки внутри футера */
footer .contacts {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1em;
}

footer a {
    color: #718096;
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 0.9em;
}

footer a:hover {
    color: #e2e8f0;
}

/* ========== 7) Частицы-клик (не меняем) ========== */
.cursor-particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: rgba(226, 232, 240, 0.7);
    border-radius: 50%;
    pointer-events: none;
    animation: cursorFade 0.8s forwards;
    z-index: 0;
}

@keyframes cursorFade {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(2);
    }
}

/* ========== 8) Адаптивные стили ========== */
@media (max-width: 768px) {
    #main-title {
        font-size: 3em;
    }
    #subtitle {
        font-size: 1.2em;
    }
    footer {
        padding: 0.8em 0;
    }
    footer a {
        font-size: 0.8em;
    }
}
