:root {
    --primary: #bffb52;
    --primary-dark: #101010;
    --primary-light: #edfd99;
    --accent: #f59e0b;
    --accent-hover: #d97706;
    --bg: #f8fafc;
    --bg-card: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --success: #22c55e;
    --error: #ef4444;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --radius: 12px;
}


* { box-sizing: border-box; margin: 0; padding: 0; }

@font-face {
    font-family: "Jost__normal";
    src: url("fonts/Jost-VariableFont_wght.ttf");
    font-style: normal;
}

@font-face {
    font-family: "Jost__italic";
    src: url("fonts/Jost-Italic-VariableFont_wght.ttf");
    font-style: italic;
}
body {
    font-family: 'Jost__normal', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* === Контейнер === */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* === Хедер === */
.header {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: white;
    padding: 1rem 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #101010;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: var(--accent);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* === Герой-секция === */
.hero {
    text-align: center;
    padding: 3rem 1rem;
    background: white;
    margin-bottom: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.hero h1 {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    margin-bottom: 1rem;
    color: var(--primary-dark);
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* === Категории === */
.category-section {
    margin-bottom: 3rem;
}

.category-title {
    font-size: 1.5rem;
    color: var(--primary-dark);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--accent);
    display: inline-block;
}

/* === Карточки уроков === */
.lessons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.lesson-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.lesson-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.lesson-card-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
    font-weight: bold;
}

.lesson-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lesson-card-body {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.lesson-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.lesson-card-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    flex: 1;
}

.lesson-card-meta {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 500;
}

/* === Страница урока === */
.lesson-header {
    background: white;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.lesson-title {
    font-size: 2rem;
    color: var(--primary-dark);
    margin-bottom: 1rem;
}

.lesson-meta {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

/* === Видео плеер === */
.video-wrapper {
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
    margin: 1.5rem 0;
    box-shadow: var(--shadow-lg);
}

.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* === Контент урока === */
.lesson-content {
    background: white;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    line-height: 1.8;
}

.lesson-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
}

/* === Задания === */
.tasks-section h3 {
    color: var(--primary-dark);
    margin: 2rem 0 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
}

.task-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.task-header {
    background: var(--primary-light);
    padding: 1rem 1.5rem;
    font-weight: 600;
    color: var(--primary-dark);
    border-bottom: 1px solid var(--border);
}

.task-body {
    padding: 1.5rem;
}

.task-question {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.task-question img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 0.5rem 0;
}

/* === Поле ответа === */
.answer-group {
    display: flex;
    gap: 0.75rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.answer-input {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.answer-input:focus {
    outline: none;
    border-color: var(--primary);
}

.answer-input.is-valid {
    border-color: var(--success);
    background: #f0fdf4;
}

.answer-input.is-invalid {
    border-color: var(--error);
    background: #fef2f2;
}

.btn-check {
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: #101010;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-check:hover {
    background: var(--primary-dark);
    color: white;
}

.btn-check:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* === Фидбек === */
.feedback {
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    margin-top: 0.5rem;
}

.feedback.success {
    background: #dcfce7;
    color: #166534;
}

.feedback.error {
    background: #fee2e2;
    color: #991b1b;
}

/* === Спойлер с решением === */
.spoiler-toggle {
    background: none;
    border: none;
    color: #101010;
    font-weight: 500;
    cursor: pointer;
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.spoiler-toggle:hover {
    color: var(--primary-dark);
}

.spoiler-content {
    display: none;
    padding: 1.25rem;
    background: var(--bg);
    border-radius: 8px;
    margin-top: 1rem;
    border-left: 4px solid var(--accent);
}

.spoiler-content.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.spoiler-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 0.5rem 0;
}

/* === Футер === */
/*  .footer {
    background: var(--text);
    color: white;
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
}

.footer a {
    color: var(--accent);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}
*/

footer.footer {
    display: flex;
    justify-content: center;
    background: #101010;
    height: auto;
}

.footer-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 3px;

    & a,
    span,
    p {
        color: #bffb52;
        text-transform: uppercase;
        font-weight: 500;
        font-size: clamp(0.625rem, 0.5611rem + 0.3409vw, 0.8125rem);
    }

    & a {
        transition: 0.3s ease;
    }

    & .info {
        display: flex;
        justify-content: space-between;
        padding: 40px 25px 25px 0px;
        flex-wrap: wrap;

        & .left-block__info {
            display: flex;
            gap: 36px;

            & nav.links {
                display: flex;
                flex-direction: column;
                gap: 9px;

                & a {
                    color: var(--color-black);
                    pointer-events: none;
                }

                & a:hover {
                    color: white;
                }
            }

            & a.youtube {
                margin-left: 11px;
                display: flex;
                position: relative;
                height: 100%;
                cursor: pointer;

                &::before {
                    width: 59px;
                    height: 39px;
                    position: absolute;
                    content: "";
                    top: 55%;
                    left: 50%;
                    transform: translate(-50%, -50%);
                    background-image: url(img/youtube-btn__footer.png);
                    background-position: center;
                    background-repeat: no-repeat;
                    background-size: cover;
                    z-index: 2;
                }

                &::after {
                    transition: 0.3s ease-in-out;
                    opacity: 0;
                    width: 40px;
                    height: 30px;
                    position: absolute;
                    content: "";
                    top: 55%;
                    left: 50%;
                    transform: translate(-50%, -50%);
                    background: #ff0000;
                    z-index: 1;
                    border-radius: 8px;
                }

                &:hover::after {
                    opacity: 1;
                }
            }

            & .contacts {
                display: flex;
                flex-direction: column;
                height: 100%;
                align-items: center;
                position: relative;

                & .block-links {
                    display: flex;
                    position: absolute;
                    gap: 9px;
                    top: 55%;
                    transform: translateY(-25%);

                    & a {
                        width: 26px;
                        height: 25px;
                        background-position: center;
                        background-repeat: no-repeat;
                        background-size: cover;
                        position: relative;

                        &::after {
                            transition: 0.3s ease-in-out;
                            opacity: 0;
                            content: "";
                            position: absolute;
                            top: 50%;
                            left: 50%;
                            transform: translate(-50%, -50%);
                            width: 90%;
                            height: 90%;
                            border-radius: 8px;
                            z-index: -1;
                        }

                        &:hover::after {
                            opacity: 1;
                        }
                    }

                    & .vk {
                        background-image: url(img/vk-btn__footer.png);

                        &::after {
                            background: #0077ff;
                        }
                    }

                    & .tg {
                        background-image: url(img/tg-btn__footer.png);

                        &::after {
                            background: #37aee2;
                        }
                    }
                }
            }
        }

        & .right-block__info {
            display: flex;
            flex-direction: column;
            font-style: normal;
            line-height: 144.587%;
            width: 160px;
        }
    }

    & .docs {
        position: relative;
        display: flex;
        padding: 25px 0px 28px 0px;
        gap: 23px;
        flex-wrap: wrap;
        white-space: nowrap;

        & a:hover {
            color: white;
        }

        &::before {
            position: absolute;
            content: "";
            opacity: 0.5;
            background: var(--color-green);
            border-radius: 49px;
            width: 100%;
            height: 3px;
            top: -3px;
        }
    }
}
/* === Адаптивность === */
@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .hero {
        padding: 2rem 1rem;
    }

    .lessons-grid {
        grid-template-columns: 1fr;
    }

    .lesson-header,
    .lesson-content,
    .task-body {
        padding: 1.25rem;
    }

    .answer-group {
        flex-direction: column;
    }

    .btn-check {
        width: 100%;
    }
}

/* === Утилиты === */
.text-primary { color: var(--primary); }
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.fw-bold { font-weight: 600; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-2 { margin-top: 1rem; }
.d-none { display: none; }


/* === Навигационное меню === */
.nav-wrapper {
    background: white;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 60px; /* После хедера */
    z-index: 90;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
}

/* Десктопное меню */
.nav-menu {
    display: flex;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

.nav-link {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
}

.nav-link:hover,
.nav-link.active {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.nav-link.active {
    font-weight: 600;
}

/* Кнопка гамбургер (мобильная) */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-toggle span {
    width: 24px;
    height: 3px;
    background: var(--text);
    border-radius: 2px;
    transition: 0.3s;
}

/* Мобильное меню */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 100%;
        left: 0;
        background: white;
        border-bottom: 1px solid var(--border);
        padding: 1rem 0;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }

    .nav-menu.show {
        display: flex;
    }

    .nav-link {
        padding: 0.75rem 1.5rem;
        border-radius: 0;
    }

    .nav-link:hover,
    .nav-link.active {
        background: var(--primary-light);
    }
}

/* Анимация гамбургера */
.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}
.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Изображения в заданиях */
.task-image {
    margin: 1rem 0;
    text-align: center;
}

.task-image img {
    border: 1px solid var(--border);
    background: white;
    padding: 0.5rem;
}

.task-image figcaption {
    color: var(--text-muted);
    font-style: italic;
}

/* Адаптивность */
@media (max-width: 768px) {
    .task-image img {
        max-height: 300px !important;
    }
}