/* ===== БАЗОВЫЕ ===== */
* { box-sizing: border-box; }
body {
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
    font-family: 'Roboto', sans-serif;
    background: #0f0f0f;
    color: #ffffff;
    position: relative;
}

/* ===== CANVAS слои ===== */
#stars-canvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: -1;
}
#hex-grid {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    opacity: 0.4;
}
#background {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(45deg, rgba(0, 255, 204, 0.1), rgba(128, 0, 255, 0.1), #000000);
    background-size: 200% 200%;
    animation: holographic 8s ease-in-out infinite;
    z-index: 0;
}
#background::before {
    content: '';
    position: absolute;
    width: 100%; height: 100%;
    background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 255, 204, 0.05) 2px, rgba(0, 255, 204, 0.05) 4px);
    animation: scanLines 4s linear infinite;
}
@keyframes holographic {
    0% { background-position: 0% 0%; }
    50% { background-position: 100% 100%; }
    100% { background-position: 0% 0%; }
}
@keyframes scanLines {
    0% { transform: translateY(0); }
    100% { transform: translateY(-4px); }
}

#matrix-rain {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1;
    opacity: 0.9;
}
#ai-network {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 2;
}
#audio-visualizer {
    position: absolute;
    bottom: 80px;
    left: 0;
    width: 100%;
    height: 120px;
    z-index: 2;
    pointer-events: none;
    opacity: 0.6;
}
#ripple-canvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 6;
    pointer-events: none;
}

/* ===== ЧАСЫ ===== */
.clock-container {
    position: absolute;
    top: 30px;
    right: 30px;
    z-index: 5;
    font-family: 'Roboto', monospace;
    font-size: 2.2rem;
    color: rgba(0, 255, 204, 0.8);
    text-shadow: 0 0 15px rgba(0, 255, 204, 0.6), 0 0 30px rgba(128, 0, 255, 0.3);
    letter-spacing: 3px;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 20px;
    border: 1px solid rgba(0, 255, 204, 0.2);
    border-radius: 5px;
    backdrop-filter: blur(5px);
}

/* ===== ТЕРМИНАЛ ===== */
#terminal {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 5;
    font-family: 'Roboto', monospace;
    font-size: 0.9rem;
    color: rgba(0, 255, 204, 0.7);
    background: rgba(0, 0, 0, 0.6);
    padding: 10px 20px;
    border-left: 3px solid #00ffcc;
    max-width: 60%;
    min-height: 40px;
    border-radius: 0 5px 5px 0;
    backdrop-filter: blur(4px);
    box-shadow: 0 0 20px rgba(0, 255, 204, 0.1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== ОСНОВНОЙ ТЕКСТ ===== */
.text-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    text-align: center;
    cursor: pointer;
}
.text {
    font-size: 4em;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #ffffff;
    display: inline-block;
    position: relative;
    text-shadow: 
        0 0 10px rgba(0, 255, 204, 0.9),
        0 0 20px rgba(0, 255, 204, 0.7),
        0 0 40px rgba(0, 255, 204, 0.5),
        0 0 80px rgba(128, 0, 255, 0.3);
    animation: neonPulse 3s ease-in-out infinite;
}
@keyframes neonPulse {
    0% { text-shadow: 0 0 10px rgba(0,255,204,0.9), 0 0 20px rgba(0,255,204,0.7), 0 0 40px rgba(0,255,204,0.5), 0 0 80px rgba(128,0,255,0.3); }
    50% { text-shadow: 0 0 20px rgba(0,255,204,1), 0 0 40px rgba(0,255,204,0.9), 0 0 80px rgba(0,255,204,0.7), 0 0 120px rgba(128,0,255,0.5); }
    100% { text-shadow: 0 0 10px rgba(0,255,204,0.9), 0 0 20px rgba(0,255,204,0.7), 0 0 40px rgba(0,255,204,0.5), 0 0 80px rgba(128,0,255,0.3); }
}
.text span {
    display: inline-block;
    animation: float 3s ease-in-out infinite;
    color: inherit;
    text-shadow: inherit;
}
.text span:nth-child(1) { animation-delay: 0s; }
.text span:nth-child(2) { animation-delay: 0.2s; }
.text span:nth-child(3) { animation-delay: 0.4s; }
.text span:nth-child(4) { animation-delay: 0.6s; }
.text span:nth-child(5) { animation-delay: 0.8s; }
.text span:nth-child(6) { animation-delay: 1.0s; }
.text span:nth-child(7) { animation-delay: 1.2s; }
.text span:nth-child(8) { animation-delay: 1.4s; }
.text span:nth-child(9) { animation-delay: 1.6s; }
.text span:nth-child(10) { animation-delay: 1.8s; }
.text span:nth-child(11) { animation-delay: 2.0s; }

@keyframes float {
    0% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0); }
}
.text:hover span {
    animation: glitch 0.3s infinite alternate, float 3s ease-in-out infinite;
}
@keyframes glitch {
    0% { transform: translate(0); }
    50% { transform: translate(3px, -3px); }
    100% { transform: translate(-3px, 3px); }
}

.sub-text {
    margin-top: 15px;
    font-size: 0.9rem;
    letter-spacing: 0.3em;
    color: rgba(0, 255, 204, 0.5);
    text-shadow: 0 0 10px rgba(0, 255, 204, 0.2);
    font-weight: 300;
}

/* ===== ЧАСТИЦЫ ===== */
.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    pointer-events: none;
    animation: particleBurst 1.5s ease-out forwards;
    z-index: 10;
}
.particle--cyan { background: rgba(0, 255, 204, 0.8); }
.particle--purple { background: rgba(128, 0, 255, 0.8); }
.particle--white { background: rgba(255, 255, 255, 0.8); }
.particle--matrix1 { background: rgba(0, 255, 204, 0.8); }
.particle--matrix2 { background: rgba(0, 255, 204, 0.6); }
.particle--matrix3 { background: rgba(0, 255, 204, 0.4); }
@keyframes particleBurst {
    0% { opacity: 1; transform: translate(0,0) scale(1); }
    100% { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(0.2); }
}

/* ===== МОДАЛЬНОЕ ОКНО (о проекте) ===== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(8px);
    z-index: 100;
    justify-content: center;
    align-items: center;
}
.modal-overlay.active {
    display: flex;
}
.modal {
    background: #1a1a2e;
    border: 1px solid #00ffcc;
    border-radius: 12px;
    padding: 40px 50px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 0 60px rgba(0, 255, 204, 0.2);
    position: relative;
    text-align: center;
}
.modal h2 {
    font-size: 2.2rem;
    margin-top: 0;
    color: #00ffcc;
    text-shadow: 0 0 20px rgba(0, 255, 204, 0.4);
}
.modal p {
    font-size: 1rem;
    line-height: 1.6;
    color: #ddd;
}
.modal-socials {
    margin-top: 25px;
    display: flex;
    justify-content: center;
    gap: 20px;
}
.modal-socials a {
    color: #fff;
    font-size: 2rem;
    transition: color 0.3s, transform 0.3s;
}
.modal-socials a:hover {
    color: #00ffcc;
    transform: scale(1.2);
}
.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: #aaa;
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.3s;
}
.modal-close:hover {
    color: #00ffcc;
}

/* ===== МОДАЛКА ЧАТА (Giscus) ===== */
.chat-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 101;
    justify-content: center;
    align-items: center;
}
.chat-modal-overlay.active {
    display: flex;
}
.chat-modal-container {
    position: relative;
    width: 90%;
    max-width: 750px;
    max-height: 85vh;
    background: #0f0f0f;
    border: 2px solid #00ffcc;
    border-radius: 12px;
    padding: 20px 25px 25px;
    box-shadow: 0 0 60px rgba(0, 255, 204, 0.2);
    overflow-y: auto;
}
.chat-modal-container::-webkit-scrollbar {
    width: 6px;
}
.chat-modal-container::-webkit-scrollbar-track {
    background: #1a1a2e;
    border-radius: 3px;
}
.chat-modal-container::-webkit-scrollbar-thumb {
    background: #00ffcc;
    border-radius: 3px;
}
.chat-close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: #aaa;
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.3s, transform 0.3s;
    z-index: 10;
}
.chat-close-btn:hover {
    color: #00ffcc;
    transform: rotate(90deg);
}

/* Стили для Giscus внутри модалки */
#giscus-container {
    min-height: 300px;
    padding: 5px 0;
}
/* Тёмная тема Giscus будет применена через параметры */
.giscus {
    background: transparent !important;
}
.giscus-frame {
    background: transparent !important;
}

/* ===== КНОПКА ОТКРЫТИЯ ЧАТА ===== */
.chat-toggle-btn {
    position: fixed;
    bottom: 100px;
    right: 30px;
    z-index: 50;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid #00ffcc;
    background: rgba(0, 255, 204, 0.15);
    color: #00ffcc;
    font-size: 28px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    box-shadow: 0 0 30px rgba(0, 255, 204, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.chat-toggle-btn:hover {
    transform: scale(1.1);
    background: rgba(0, 255, 204, 0.3);
    box-shadow: 0 0 50px rgba(0, 255, 204, 0.5);
}
.chat-toggle-btn i {
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* ===== ФУТЕР ===== */
footer {
    position: fixed;
    bottom: 20px;
    width: 100%;
    text-align: center;
    z-index: 4;
    padding: 10px 0;
    display: flex;
    justify-content: center;
    align-items: center;
}
footer a, footer button {
    color: #ffffff;
    font-size: 1.8em;
    margin: 0 20px;
    opacity: 0;
    animation: fadeIn 1s ease-out forwards;
    text-decoration: none;
    position: relative;
    transition: all 0.3s ease;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}
footer a i, footer button i {
    transition: transform 0.3s ease, color 0.3s ease;
}
footer a::after, footer button::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%) scale(0);
    width: 20px;
    height: 2px;
    background: #00ffcc;
    transition: transform 0.3s ease;
}
footer a:hover::after, footer button:hover::after {
    transform: translateX(-50%) scale(1);
}
footer a:hover, footer button:hover {
    color: #00ffcc;
    transform: scale(1.2);
    text-shadow: 0 0 10px rgba(0, 255, 204, 0.8);
}
@keyframes fadeIn {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* ===== АДАПТИВ ===== */
@media (max-width: 600px) {
    .text { font-size: 1.8em; }
    .sub-text { font-size: 0.6rem; }
    .clock-container { font-size: 1.2rem; padding: 4px 12px; top: 15px; right: 15px; }
    #terminal { font-size: 0.7rem; max-width: 80%; bottom: 10px; left: 10px; padding: 6px 12px; }
    .modal { padding: 25px 20px; }
    footer a, footer button { font-size: 1.4em; margin: 0 10px; }
    .chat-toggle-btn { width: 50px; height: 50px; font-size: 22px; bottom: 80px; right: 20px; }
    .chat-modal-container { padding: 15px; width: 95%; max-height: 80vh; }
    .chat-close-btn { font-size: 1.8rem; top: 5px; right: 10px; }
    #giscus-container { min-height: 250px; }
}
