/* ========================================
   CSS-переменные
   ======================================== */
:root {
    --primary: #B8D935;
    --bg: #07100B;
    --btn-hover: #B8D935;
    --btn-text-hover: #07100B;
}

/* ========================================
   Сброс и базовые стили
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg);
    color: var(--primary);
    font-family: 'Press Start 2P', cursive;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
    padding: 20px;
}

/* ========================================
   3D-сетка на фоне
   ======================================== */
.grid-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(184, 217, 53, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(184, 217, 53, 0.1) 1px, transparent 1px);
    background-size: 40px 40px;
    transform: perspective(500px) rotateX(60deg) scale(2);
    transform-origin: top center;
    animation: grid-move 20s linear infinite;
    z-index: -2;
    opacity: 0.4;
    pointer-events: none;
}

@keyframes grid-move {
    0% {
        transform: perspective(500px) rotateX(60deg) scale(2) translateY(0);
    }
    100% {
        transform: perspective(500px) rotateX(60deg) scale(2) translateY(40px);
    }
}

/* ========================================
   Эффект скан-линий
   ======================================== */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0),
        rgba(255, 255, 255, 0) 50%,
        rgba(0, 0, 0, 0.2) 50%,
        rgba(0, 0, 0, 0.2)
    );
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 10;
}

/* ========================================
   Контейнер
   ======================================== */
.container {
    text-align: center;
    z-index: 2;
    max-width: 800px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 auto;
}

/* ========================================
   Шапка
   ======================================== */
.header {
    width: 100%;
    margin-bottom: 40px;
}

/* ========================================
   Аватар
   ======================================== */
.avatar-wrapper {
    position: relative;
    margin-bottom: 30px;
}

.avatar {
    width: 160px;
    height: auto;
    image-rendering: pixelated;
    filter: drop-shadow(0 0 15px rgba(184, 217, 53, 0.4));
    animation: float 3s ease-in-out infinite;
    border: 4px solid var(--primary);
    background: #000;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* ========================================
   Заголовок с глитч-эффектом
   ======================================== */
.system-title {
    font-size: 1.2rem;
    margin-bottom: 20px;
    text-transform: uppercase;
    position: relative;
    display: inline-block;
    line-height: 1.5;
}

.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg);
}

.glitch::before {
    left: 2px;
    text-shadow: -1px 0 #ff00c1;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -1px 0 #00fff9;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim2 5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% { clip: rect(12px, 9999px, 5px, 0); }
    5% { clip: rect(80px, 9999px, 90px, 0); }
    100% { clip: rect(60px, 9999px, 70px, 0); }
}

@keyframes glitch-anim2 {
    0% { clip: rect(65px, 9999px, 100px, 0); }
    5% { clip: rect(10px, 9999px, 20px, 0); }
    100% { clip: rect(30px, 9999px, 50px, 0); }
}

/* ========================================
   Навигация (пиксельный стиль кнопок)
   ======================================== */
.nav {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.nav-link {
    display: inline-block;
    text-decoration: none;
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 12px 16px;
    font-size: 0.7rem;
    text-transform: uppercase;
    transition: all 0.2s;
    background: transparent;
    position: relative;
    box-shadow: 4px 4px 0px rgba(184, 217, 53, 0.3);
    font-family: 'Press Start 2P', cursive;
}

.nav-link:hover,
.nav-link.active {
    background: var(--btn-hover);
    color: var(--btn-text-hover);
    box-shadow: 2px 2px 0px rgba(184, 217, 53, 0.5);
    transform: translate(2px, 2px);
    text-decoration: none;
}

.nav-link:active {
    transform: translate(4px, 4px);
    box-shadow: none;
}

/* ========================================
   Блок статуса
   ======================================== */
.status-box {
    border: 2px solid var(--primary);
    padding: 20px;
    background: rgba(7, 16, 11, 0.9);
    box-shadow: 5px 5px 0px rgba(184, 217, 53, 0.2);
    margin-bottom: 30px;
    width: 100%;
}

.status-text {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #fff;
    min-height: 3em;
    margin-bottom: 10px;
    display: inline;
}

/* ========================================
   Мигающий курсор
   ======================================== */
.cursor-box {
    display: inline-block;
    width: 12px;
    height: 12px;
    background-color: var(--primary);
    margin-left: 8px;
    vertical-align: middle;
    animation: heartbeat 1.5s infinite;
    box-shadow: 0 0 8px var(--primary);
}

@keyframes heartbeat {
    0% { transform: scale(1); opacity: 1; }
    20% { transform: scale(1.3); opacity: 0.8; }
    40% { transform: scale(1); opacity: 1; }
    60% { transform: scale(1.3); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

/* ========================================
   Основные секции
   ======================================== */
.main {
    width: 100%;
}

section {
    margin-bottom: 40px;
}

.section-title {
    font-size: 0.9rem;
    margin-bottom: 20px;
    text-transform: uppercase;
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
    padding-bottom: 10px;
    display: inline-block;
}

/* ========================================
   Блок контента (стиль терминала)
   ======================================== */
.content-box {
    border: 2px solid var(--primary);
    padding: 20px;
    background: rgba(7, 16, 11, 0.9);
    box-shadow: 5px 5px 0px rgba(184, 217, 53, 0.2);
    margin-bottom: 20px;
    text-align: left;
}

.content-box p {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    line-height: 1.8;
    color: #fff;
    margin: 10px 0;
}

.content-box .highlight {
    color: var(--primary);
    font-weight: bold;
}

/* ========================================
   Сетка сертификатов
   ======================================== */
.cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    width: 100%;
}

.cert-card {
    border: 2px solid var(--primary);
    background: rgba(7, 16, 11, 0.9);
    box-shadow: 5px 5px 0px rgba(184, 217, 53, 0.2);
    overflow: hidden;
    transition: all 0.2s;
}

.cert-card:hover {
    box-shadow: 3px 3px 0px rgba(184, 217, 53, 0.4);
    transform: translate(2px, 2px);
}

.cert-image-wrapper {
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-bottom: 2px solid var(--primary);
}

.cert-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: opacity 0.2s;
}

.cert-image:hover {
    opacity: 0.8;
}

.cert-info {
    padding: 15px;
    text-align: center;
}

.cert-info h3 {
    font-size: 0.7rem;
    color: var(--primary);
    margin-bottom: 15px;
    text-transform: uppercase;
}

/* ========================================
   Пиксельные кнопки
   ======================================== */
.pixel-btn {
    display: inline-block;
    text-decoration: none;
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 12px 16px;
    font-size: 0.7rem;
    text-transform: uppercase;
    transition: all 0.2s;
    background: transparent;
    position: relative;
    box-shadow: 4px 4px 0px rgba(184, 217, 53, 0.3);
    font-family: 'Press Start 2P', cursive;
    cursor: pointer;
}

.pixel-btn:hover {
    background: var(--btn-hover);
    color: var(--btn-text-hover);
    box-shadow: 2px 2px 0px rgba(184, 217, 53, 0.5);
    transform: translate(2px, 2px);
    text-decoration: none;
}

.pixel-btn:active {
    transform: translate(4px, 4px);
    box-shadow: none;
}

/* ========================================
   Сетка навыков
   ======================================== */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    width: 100%;
}

.skill-card {
    border: 2px solid var(--primary);
    padding: 15px;
    background: rgba(7, 16, 11, 0.9);
    box-shadow: 4px 4px 0px rgba(184, 217, 53, 0.2);
    transition: all 0.2s;
}

.skill-card:hover {
    box-shadow: 2px 2px 0px rgba(184, 217, 53, 0.4);
    transform: translate(2px, 2px);
}

.skill-card h3 {
    font-size: 0.6rem;
    color: var(--primary);
    margin-bottom: 10px;
    text-transform: uppercase;
}

.skill-card p {
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
    color: #fff;
    line-height: 1.6;
}

/* ========================================
   Сетка команд
   ======================================== */
.commands-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    width: 100%;
}

.command-card {
    border: 2px solid var(--primary);
    padding: 12px;
    background: rgba(7, 16, 11, 0.9);
    box-shadow: 3px 3px 0px rgba(184, 217, 53, 0.2);
    text-align: center;
    transition: all 0.2s;
}

.command-card:hover {
    box-shadow: 1px 1px 0px rgba(184, 217, 53, 0.4);
    transform: translate(2px, 2px);
}

.command-card code {
    display: block;
    font-family: 'Courier New', monospace;
    font-size: 0.65rem;
    color: var(--primary);
    margin-bottom: 8px;
    background: #000;
    padding: 5px;
}

.command-card p {
    font-family: 'Courier New', monospace;
    font-size: 0.6rem;
    color: #fff;
}

/* ========================================
   Список модулей
   ======================================== */
.module-card {
    border: 2px solid var(--primary);
    margin-bottom: 15px;
    background: rgba(7, 16, 11, 0.9);
    box-shadow: 4px 4px 0px rgba(184, 217, 53, 0.2);
}

.module-header {
    display: flex;
    gap: 10px;
    padding: 12px 15px;
    border-bottom: 2px solid var(--primary);
    align-items: center;
    flex-wrap: wrap;
}

.module-badge {
    background: var(--primary);
    color: var(--bg);
    padding: 4px 8px;
    font-size: 0.55rem;
    text-transform: uppercase;
    font-family: 'Press Start 2P', cursive;
}

.module-title {
    color: var(--primary);
    font-size: 0.65rem;
    text-transform: uppercase;
    font-family: 'Press Start 2P', cursive;
}

.module-topics {
    list-style: none;
    padding: 15px;
}

.module-topics li {
    font-family: 'Courier New', monospace;
    font-size: 0.65rem;
    color: #fff;
    padding: 6px 0;
    border-bottom: 1px dashed rgba(184, 217, 53, 0.3);
}

.module-topics li:last-child {
    border-bottom: none;
}

.module-topics li::before {
    content: "> ";
    color: var(--primary);
}

/* ========================================
   Ссылки на соцсети
   ======================================== */
.social-links {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    width: 100%;
    margin-top: 30px;
}

/* ========================================
   Подвал
   ======================================== */
.footer {
    text-align: center;
    padding: 30px 0;
    margin-top: 40px;
    border-top: 2px solid var(--primary);
    width: 100%;
}

.footer p {
    font-family: 'Courier New', monospace;
    font-size: 0.65rem;
    color: #fff;
    margin: 8px 0;
}

.footer a {
    color: var(--primary);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* ========================================
   Модальное окно
   ======================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(7, 16, 11, 0.95);
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.modal-image {
    max-width: 100%;
    max-height: 90vh;
    border: 4px solid var(--primary);
    box-shadow: 0 0 20px rgba(184, 217, 53, 0.4);
}

.modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    font-size: 30px;
    color: var(--primary);
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Press Start 2P', cursive;
}

.modal-close:hover {
    color: #fff;
    text-shadow: 0 0 10px var(--primary);
}

/* ========================================
   Строки с информацией (страница деталей)
   ======================================== */
.info-row {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px dashed rgba(184, 217, 53, 0.3);
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    width: 150px;
    flex-shrink: 0;
    color: var(--primary);
}

.info-value {
    color: #fff;
}

.info-value a {
    color: var(--primary);
    text-decoration: none;
}

.info-value a:hover {
    text-decoration: underline;
}

/* ========================================
   Адаптивные стили
   ======================================== */
@media (max-width: 600px) {
    .avatar {
        width: 140px;
    }

    .system-title {
        font-size: 0.9rem;
    }

    .status-box {
        padding: 15px;
    }

    .status-text {
        font-size: 0.8rem;
    }

    .social-links {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .pixel-btn,
    .nav-link {
        width: 100%;
        max-width: 250px;
        text-align: center;
        padding: 15px;
    }

    .cert-grid {
        grid-template-columns: 1fr;
    }

    .info-row {
        flex-direction: column;
        gap: 5px;
    }

    .info-label {
        width: 100%;
    }

    .module-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}
