/* Базовые настройки и поддержка безопасных зон (для челок, вырезов и складных экранов) */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-left: env(safe-area-inset-left, 0px);
    --safe-area-right: env(safe-area-inset-right, 0px);
    --primary-color: #00ff88;
}

body {
    font-family: 'Inter', sans-serif;
    color: #ffffff;
    overflow-x: hidden;
    background-color: #000;
    min-height: 100vh;
    min-height: -webkit-fill-available; /* Фикс для высоты на iOS Safari */
}

html {
    height: -webkit-fill-available;
}

/* Контейнер фонового видео - решает проблемы на мобильных */
.video-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
}

#bg-video {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Идеальное масштабирование под любые пропорции экрана */
    transform: translate(-50%, -50%);
}

.video-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.4) 100%);
    z-index: -1;
}

/* Основной контейнер с поддержкой safe-areas и нестандартных экранов */
.container {
    display: flex;
    flex-direction: row;
    min-height: 100vh;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: calc(40px + var(--safe-area-top)) calc(40px + var(--safe-area-right)) calc(40px + var(--safe-area-bottom)) calc(40px + var(--safe-area-left));
    gap: 40px;
    align-items: center;
}

/* Боковая панель с размытием (Glassmorphism) */
.glass-sidebar {
    flex: 0 0 320px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 28px 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.counter-box {
    text-align: center;
    background: rgba(0, 0, 0, 0.4);
    padding: 14px;
    border-radius: 12px;
    margin-top: 8px;
    border: 1px solid rgba(0, 255, 136, 0.15);
}

.count-number {
    display: block;
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--primary-color);
    text-shadow: 0 0 15px rgba(0, 255, 136, 0.4);
}

.count-label {
    font-size: 0.75rem;
    color: #a0a0a0;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.tech-stack h3, .social-links h3 {
    margin-bottom: 10px;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    color: #e0e0e0;
}

.tech-stack ul {
    list-style: none;
}

.tech-stack li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: #cccccc;
    font-size: 0.85rem;
}

.tech-stack li:last-child {
    border-bottom: none;
}

/* Стильные кнопки-пилюли в стиле референса */
.social-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pill-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 11px 20px;
    background: #0066cc;
    border-radius: 50px;
    color: #ffffff;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.2px;
    box-shadow: 0 4px 15px rgba(0, 102, 204, 0.3);
    transition: all 0.25s ease;
}

.pill-btn svg {
    stroke: #ffffff;
    flex-shrink: 0;
}

.pill-btn:hover {
    background: #0077ed;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 119, 237, 0.4);
}

.pill-btn:active {
    transform: translateY(0);
}

/* Основной контент */
.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.content h1 {
    font-size: clamp(2.5rem, 5vw, 4.5rem); /* Динамический размер шрифта под любые экраны */
    line-height: 1.15;
    margin-bottom: 15px;
    font-weight: 700;
}

.highlight {
    color: var(--primary-color);
    text-shadow: 0 0 20px rgba(0, 255, 136, 0.2);
}

.subtitle {
    font-size: clamp(1.2rem, 2.5vw, 2rem);
    color: #cccccc;
    margin-bottom: 30px;
    min-height: 45px;
    font-weight: 400;
}

.about-me {
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 35px;
    border-radius: 24px;
    border-left: 4px solid var(--primary-color);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-left: 4px solid var(--primary-color);
    max-width: 800px;
}

.about-me p {
    font-size: clamp(0.95rem, 1.5vw, 1.1rem);
    line-height: 1.7;
    margin-bottom: 20px;
    color: #e0e0e0;
}

.about-me p:last-child {
    margin-bottom: 0;
}

/* --- Адаптивный дизайн под разные экраны --- */

/* Планшеты и небольшие ноутбуки (горизонтальные и вертикальные) */
@media (max-width: 1100px) {
    .container {
        gap: 30px;
        padding: calc(30px + var(--safe-area-top)) calc(30px + var(--safe-area-right)) calc(30px + var(--safe-area-bottom)) calc(30px + var(--safe-area-left));
    }
    .glass-sidebar {
        flex: 0 0 260px;
    }
}

/* Планшеты в портретной ориентации и смартфоны */
@media (max-width: 900px) {
    .container {
        flex-direction: column-reverse; /* Контент сверху, сайдбар уходит вниз */
        justify-content: flex-start;
        align-items: stretch;
        gap: 30px;
        overflow-y: auto;
    }
    
    .glass-sidebar {
        flex: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        padding: 25px;
        gap: 20px;
    }

    .stats, .tech-stack, .social-links {
        width: 100%;
    }

    .tech-stack ul {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .tech-stack li {
        padding: 4px 0;
        border-bottom: none;
        font-size: 0.85rem;
    }

    .tech-stack h3, .social-links h3 {
        margin-bottom: 8px;
    }

    .counter-box {
        margin-top: 5px;
        padding: 10px;
    }

    .count-number {
        font-size: 2rem;
    }

    .social-buttons {
        flex-direction: row;
    }

    .pill-btn {
        flex: 1;
        justify-content: center;
    }
}

/* Смартфоны (вертикальные экраны и узкие дисплеи) */
@media (max-width: 600px) {
    .container {
        padding: calc(20px + var(--safe-area-top)) calc(15px + var(--safe-area-right)) calc(20px + var(--safe-area-bottom)) calc(15px + var(--safe-area-left));
        gap: 20px;
    }

    .glass-sidebar {
        padding: 20px;
        gap: 16px;
    }

    .tech-stack ul {
        grid-template-columns: 1fr;
    }

    .social-buttons {
        flex-direction: column;
    }

    .about-me {
        padding: 25px 20px;
        border-radius: 16px;
    }
}

/* Ультраширокие экраны */
@media (min-width: 1900px) {
    .container {
        max-width: 1600px;
    }
    .content h1 {
        font-size: 5rem;
    }
}

/* Анимации */
.fade-in { animation: fadeIn 1.2s ease forwards; }
.slide-up { animation: slideUp 1.2s ease forwards; opacity: 0; }
.hidden-element { animation: slideRight 1s ease forwards; opacity: 0; }

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideRight {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}