*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --color-bg: #2a2a2a;
    --color-bg-card: #353535;
    --color-bg-header: #1f1f1f;
    --color-text: #f0f0f0;
    --color-text-muted: #b0b0b0;
    --color-orange: #d97b3d;
    --color-orange-hover: #e88f4f;
    --color-button: #7a7a7a;
    --color-button-hover: #b87a4a;
    --color-border: #4a4a4a;
    --font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --max-width: 960px;
    --header-height: 72px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Главная: баннер + подвал в один экран */
body.page-home {
    min-height: 100dvh;
    height: 100dvh;
    overflow: hidden;
}

body.page-home .hero {
    flex: 1 1 0;
    min-height: 0;
}

body.page-home .main--flush {
    display: none;
}

body.page-home .header,
body.page-home .footer {
    flex-shrink: 0;
}

/* Hero banner — на всю ширину; высота по экрану, кроме главной без текста */
.hero {
    position: relative;
    width: 100%;
    min-height: calc(100vh - var(--header-height));
    min-height: calc(100dvh - var(--header-height));
    background-color: var(--color-bg-header);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: stretch;
}

/* Header */
.header {
    background: var(--color-bg-header);
    border-bottom: 2px solid var(--color-orange);
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
}

.header__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.header__logo {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--color-orange);
    text-decoration: none;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.header__logo:hover {
    color: var(--color-orange-hover);
}

.nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav__link {
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.nav__link:hover,
.nav__link--active {
    color: var(--color-orange);
}

.hero--plain {
    background: linear-gradient(135deg, #1f1f1f 0%, #3a3a3a 100%);
}

.hero__panel {
    position: relative;
    z-index: 1;
    width: 42%;
    max-width: 540px;
    min-height: 100%;
    background: rgba(22, 22, 22, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    padding: 3rem 2.5rem;
}

.hero__panel--plain {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.hero__panel--plain .hero__title,
.hero__panel--plain .hero__text {
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
}

.hero__content {
    text-align: left;
    max-width: 100%;
}

.hero__title {
    font-size: clamp(1.35rem, 2.8vw, 2rem);
    font-weight: 700;
    color: var(--color-orange);
    margin-bottom: 1.25rem;
    line-height: 1.35;
}

.hero__text {
    font-size: clamp(0.95rem, 1.8vw, 1.1rem);
    color: var(--color-text);
    line-height: 1.7;
}

.hero__slides {
    display: none;
}

.hero__slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 1.2s ease-in-out;
}

.hero__slide.is-active {
    opacity: 1;
}

@media (min-width: 769px) {
    .hero--carousel {
        background-image: none !important;
    }

    .hero--carousel .hero__slides {
        display: block;
        position: absolute;
        inset: 0;
        z-index: 0;
    }
}

@media (max-width: 768px) {
    .hero:not(.hero--plain) {
        background-image: var(--hero-mobile-bg) !important;
    }

    .hero__slides {
        display: none !important;
    }
}

/* Main */
.main {
    flex: 1;
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2.5rem 1.5rem 3rem;
}

.main--flush {
    flex: 0 0 auto;
    padding: 0;
    max-width: none;
}

.page {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Cards */
.card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-orange);
    border-radius: 6px;
    padding: 1.75rem 2rem;
}

.card--intro {
    padding: 1rem 2rem;
}

.card--intro .card__title {
    margin-bottom: 0.625rem;
}

.card--intro .card__title:only-child {
    margin-bottom: 0;
}

.card__title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-orange);
    margin-bottom: 1rem;
}

.card__body {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    line-height: 1.75;
}

.card__body p + p {
    margin-top: 0.75rem;
}

.page__empty {
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.95rem;
    padding: 2rem;
}

/* Buttons — серые, при наведении приглушённый оранжевый */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    padding: 0.75rem 1.75rem;
    background: var(--color-button);
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    text-align: center;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.btn:hover {
    background: var(--color-button-hover);
}

.btn--disabled {
    background: #555;
    color: #888;
    cursor: not-allowed;
    pointer-events: none;
    opacity: 0.6;
}

/* Document buttons */
.doc-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

/* Course cards */
.course-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.course-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.course-card__title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text);
}

.course-card__desc {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    line-height: 1.75;
}

.course-card__desc p + p {
    margin-top: 0.75rem;
}

.btn--course {
    align-self: flex-start;
    width: auto;
    min-width: 200px;
    margin-top: 0.25rem;
}

/* Footer */
.footer {
    background: var(--color-bg-header);
    border-top: 1px solid var(--color-border);
    padding: 1.25rem 1.5rem;
    text-align: center;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}

.footer p {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.footer__a11y {
    padding: 0;
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-family: inherit;
    font-size: 0.75rem;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
    transition: color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.footer__a11y:hover {
    color: var(--color-orange);
}

/* Tablet */
@media (max-width: 768px) {
    .header__inner {
        padding: 0 1.25rem;
    }

    .header__logo {
        font-size: 1.75rem;
    }

    .nav {
        gap: 1.25rem;
    }

    .nav__link {
        font-size: 0.8rem;
    }

    .hero__panel {
        width: 100%;
        max-width: none;
        min-height: 100%;
        background: rgba(22, 22, 22, 0.70);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        padding: 2.5rem 2rem;
    }

    .card {
        padding: 1.5rem 1.25rem;
    }

    .card--intro {
        padding: 0.875rem 1.25rem;
    }

    .btn--course {
        width: 100%;
        min-width: 0;
    }
}

/* Mobile */
@media (max-width: 480px) {
    :root {
        --header-height: 60px;
    }

    .header__inner {
        padding: 0 1rem;
        gap: 0.75rem;
    }

    .header__logo {
        font-size: 1.5rem;
    }

    .nav {
        gap: 0.75rem;
    }

    .nav__link {
        font-size: 0.7rem;
    }

    .main {
        padding: 1.5rem 1rem 2rem;
    }

    .hero__panel {
        padding: 2rem 1.25rem;
    }

    .card {
        padding: 1.25rem 1rem;
    }

    .card--intro {
        padding: 0.75rem 1rem;
    }
}

/* Версия для слабовидящих */
html.a11y-mode {
    font-size: 118%;
}

html.a11y-mode body {
    background: #fff;
    color: #000;
}

html.a11y-mode .header {
    background: #fff;
    border-bottom: 3px solid #000;
}

html.a11y-mode .header__logo,
html.a11y-mode .nav__link {
    color: #000;
}

html.a11y-mode .nav__link {
    text-decoration: underline;
    text-underline-offset: 3px;
}

html.a11y-mode .nav__link--active {
    font-weight: 700;
    background: #000;
    color: #fff;
    padding: 0.2rem 0.4rem;
    text-decoration: none;
}

html.a11y-mode .footer__a11y {
    color: #000;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: underline;
}

html.a11y-mode .hero,
html.a11y-mode .hero--plain {
    background-image: none !important;
    background-color: #f5f5f5;
    border-bottom: 3px solid #000;
}

html.a11y-mode .hero__panel,
html.a11y-mode .hero__panel--plain {
    background: #f5f5f5;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

html.a11y-mode .hero__title,
html.a11y-mode .hero__text,
html.a11y-mode .card__title,
html.a11y-mode .course-card__title {
    color: #000;
    text-shadow: none;
}

html.a11y-mode .hero__text,
html.a11y-mode .card__body,
html.a11y-mode .course-card__desc,
html.a11y-mode .page__empty,
html.a11y-mode .footer p {
    color: #000;
}

html.a11y-mode .card,
html.a11y-mode .course-card {
    background: #fff;
    border: 2px solid #000;
    border-left: 6px solid #000;
}

html.a11y-mode .btn {
    background: #000;
    color: #fff;
    border: 2px solid #000;
    font-size: 1.05rem;
    font-weight: 700;
    text-decoration: none;
}

html.a11y-mode .btn:hover {
    background: #333;
}

html.a11y-mode .btn--disabled {
    background: #ccc;
    color: #555;
    border-color: #555;
}

html.a11y-mode .footer {
    background: #fff;
    border-top: 3px solid #000;
}

html.a11y-mode.page-home,
html.a11y-mode body.page-home {
    overflow: hidden;
    height: 100dvh;
    min-height: 100dvh;
}

html.a11y-mode body.page-home .hero {
    flex: 1;
    min-height: 0;
}
