:root {
    --background: #f4f6ef;
    --surface: #eef1e8;
    --surface-strong: #e4e8dc;

    --text: #20251f;
    --muted: #777f74;
    --line: #252c24;

    --accent: #b8ff34;
    --accent-dark: #83bd14;
    --danger: #ff6b6b;

    --max-width: 1180px;
    --header-height: 76px;

    --font-main: "Courier New", "Lucida Console", monospace;
}

/* =========================================================
   RESET
   ========================================================= */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;

    color: var(--text);
    background-color: var(--background);

    font-family: var(--font-main);
    font-size: 16px;
    line-height: 1.6;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;

    background-image:
        linear-gradient(rgba(32, 37, 31, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(32, 37, 31, 0.035) 1px, transparent 1px);

    background-size: 24px 24px;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;

    background:
        linear-gradient(var(--accent), var(--accent)) 5% 16% / 5px 5px no-repeat,
        linear-gradient(var(--accent), var(--accent)) 8% 20% / 5px 5px no-repeat,
        linear-gradient(var(--accent), var(--accent)) 91% 18% / 5px 5px no-repeat,
        linear-gradient(var(--accent), var(--accent)) 94% 13% / 5px 5px no-repeat,
        linear-gradient(var(--line), var(--line)) 3% 79% / 4px 4px no-repeat,
        linear-gradient(var(--line), var(--line)) 96% 84% / 4px 4px no-repeat;

    opacity: 0.5;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

/* =========================================================
   HEADER
   Поддерживает и старые, и восстановленные классы.
   ========================================================= */

.site-header {
    width: min(calc(100% - 48px), var(--max-width));
    min-height: var(--header-height);
    margin: 0 auto;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;

    border-bottom: 1px solid rgba(32, 37, 31, 0.28);
}

.site-logo,
.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;

    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.12em;
}

.site-logo__dot {
    width: 9px;
    height: 9px;
    display: inline-block;

    background: var(--accent);
    border: 1px solid var(--line);
    box-shadow: 3px 3px 0 var(--line);
}

.site-nav,
.site-header nav {
    display: flex;
    align-items: center;
    gap: 24px;

    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.site-nav a,
.site-header nav a {
    position: relative;
    color: var(--muted);

    transition:
        color 160ms ease,
        transform 160ms ease;
}

.site-nav a::after,
.site-header nav a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 100%;
    bottom: -7px;
    height: 2px;

    background: var(--accent);
    transition: right 160ms ease;
}

.site-nav a:hover,
.site-header nav a:hover {
    color: var(--text);
    transform: translateY(-2px);
}

.site-nav a:hover::after,
.site-header nav a:hover::after {
    right: 0;
}

/* =========================================================
   COMMON PAGE LAYOUT
   ========================================================= */

main {
    min-height: calc(100vh - var(--header-height));
}

.page-screen,
.dashboard-screen,
.courses-screen,
.course-screen,
.practice-screen {
    padding-bottom: 1px;
}

.page-heading,
.article-header {
    width: min(calc(100% - 48px), var(--max-width));
    margin: 0 auto;
    padding: 92px 0 44px;
}

.section-number {
    margin: 0 0 18px;

    color: var(--accent-dark);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.page-heading h1,
.article-header h1,
.article-card h1 {
    margin: 0;
    max-width: 980px;

    font-family: var(--font-display);
    font-size: clamp(42px, 7vw, 88px);
    line-height: 0.95;
    letter-spacing: -0.06em;
    text-transform: uppercase;
}

.page-heading > p:last-child {
    max-width: 720px;
    margin: 24px 0 0;

    color: var(--muted);
    font-size: 17px;
}

.page-bottom-actions {
    width: min(calc(100% - 48px), var(--max-width));
    margin: 0 auto;
    padding: 0 0 80px;
}

.page-bottom-actions a,
.loading-back-link,
.result-next-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 48px;
    padding: 0 16px;

    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: 5px 5px 0 var(--line);

    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;

    transition:
        transform 140ms ease,
        box-shadow 140ms ease;
}

.page-bottom-actions a:hover,
.loading-back-link:hover,
.result-next-button:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 var(--line);
}

/* =========================================================
   FLASH
   ========================================================= */

.flash-list {
    position: fixed;
    top: 92px;
    right: 24px;
    z-index: 20;

    display: grid;
    gap: 10px;
}

.flash-message,
.flash {
    min-width: 260px;
    padding: 14px 16px;

    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: 5px 5px 0 var(--line);

    font-size: 13px;
    text-transform: uppercase;
}

.flash-message--success,
.flash--success {
    border-left: 7px solid var(--accent);
}

.flash-message--error,
.flash--error {
    border-left: 7px solid var(--danger);
}

/* =========================================================
   HOME
   ========================================================= */

.home-screen,
.hero {
    position: relative;
    min-height: calc(100vh - var(--header-height));
    overflow: hidden;

    display: grid;
    place-items: center;

    padding: 48px 24px;
}

.home-screen__content {
    position: relative;
    z-index: 2;

    display: flex;
    flex-direction: column;
    align-items: center;

    text-align: center;
}

.home-title,
.hero h1 {
    position: relative;
    margin: 0;

    color: #9ba19a;

    font-family: var(--font-display);
    font-size: clamp(44px, 9vw, 118px);
    font-weight: 700;
    line-height: 0.9;
    letter-spacing: -0.07em;
    text-transform: uppercase;

    transition:
        color 180ms ease,
        transform 180ms ease,
        letter-spacing 180ms ease,
        text-shadow 180ms ease;
}

.home-title:hover,
.hero h1:hover {
    color: var(--text);
    transform: translateY(-6px);
    letter-spacing: -0.05em;

    text-shadow:
        3px 0 0 rgba(184, 255, 52, 0.8),
        -3px 0 0 rgba(32, 37, 31, 0.14);
}

.home-divider {
    width: min(560px, 70vw);
    margin: 34px 0 22px;

    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 14px;
}

.home-divider span {
    height: 1px;
    background: rgba(32, 37, 31, 0.34);
}

.home-divider i {
    width: 10px;
    height: 10px;

    background: var(--accent);
    border: 1px solid var(--line);
    transform: rotate(45deg);
}

.home-subtitle,
.hero__text {
    margin: 0;
    max-width: 620px;

    color: var(--muted);
    font-size: clamp(13px, 1.4vw, 17px);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 52px;
    margin-top: 28px;
    padding: 0 18px;

    border: 1px solid var(--line);
    background: var(--accent);
    box-shadow: 5px 5px 0 var(--line);

    font-size: 12px;
    font-weight: 700;
}

/* =========================================================
   LOGIN
   ========================================================= */

.login-screen {
    min-height: calc(100vh - var(--header-height));
    display: grid;
    place-items: center;

    padding: 60px 24px;
}

.login-panel,
.login-card {
    width: min(100%, 560px);
    padding: 42px;

    background: rgba(244, 246, 239, 0.9);
    border: 1px solid var(--line);
    box-shadow: 10px 10px 0 var(--accent);
}

.login-panel h1,
.login-card h1 {
    margin: 0 0 34px;

    font-family: var(--font-display);
    font-size: clamp(34px, 6vw, 62px);
    line-height: 0.95;
    letter-spacing: -0.05em;
    text-transform: uppercase;
}

.login-form {
    display: grid;
    gap: 12px;
}

.login-form label {
    margin-top: 8px;

    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.login-form input {
    width: 100%;
    min-height: 54px;
    padding: 0 16px;

    color: var(--text);
    background: transparent;

    border: 1px solid var(--line);
    border-radius: 0;
    outline: none;

    transition:
        background 150ms ease,
        box-shadow 150ms ease,
        transform 150ms ease;
}

.login-form input:focus {
    background: var(--surface);
    box-shadow: 5px 5px 0 var(--accent);
    transform: translate(-2px, -2px);
}

.login-form button {
    min-height: 56px;
    margin-top: 18px;
    padding: 0 18px;

    color: var(--text);
    background: var(--accent);

    border: 1px solid var(--line);
    border-radius: 0;
    box-shadow: 5px 5px 0 var(--line);

    font-weight: 700;
    letter-spacing: 0.08em;
}

.login-hint {
    margin: 26px 0 0;
    color: var(--muted);
    font-size: 12px;
}

/* =========================================================
   DASHBOARD / COURSES
   ========================================================= */

.courses-banner {
    width: min(calc(100% - 48px), var(--max-width));
    min-height: 54px;
    margin: 0 auto;
    padding: 0 16px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    border: 1px solid var(--line);
    background: var(--accent);

    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.available-courses-list,
.course-list,
.article-list {
    width: min(calc(100% - 48px), var(--max-width));
    margin: 0 auto 48px;

    border-top: 1px solid var(--line);
}

.available-course,
.course-row,
.article-row {
    min-height: 112px;
    padding: 20px 8px;

    display: grid;
    align-items: center;
    gap: 24px;

    border-bottom: 1px solid var(--line);

    transition:
        padding 150ms ease,
        background 150ms ease;
}

.available-course {
    grid-template-columns: 70px 1fr 50px;
}

.course-row {
    grid-template-columns: 70px 1fr auto 50px;
}

.article-row {
    grid-template-columns: 70px 1fr auto 50px;
}

.available-course:hover,
.course-row:hover,
.article-row:hover {
    padding-left: 22px;
    padding-right: 22px;
    background: var(--accent);
}

.available-course__number,
.course-row__index,
.course-row > span:first-child,
.article-row__number,
.article-row > span:first-child {
    color: var(--muted);
    font-size: 13px;
}

.available-course h3,
.course-row__content h2,
.course-row > div h2,
.article-row h2 {
    margin: 0;

    font-family: var(--font-display);
    font-size: clamp(22px, 3vw, 36px);
    line-height: 1;
    letter-spacing: -0.04em;
    text-transform: uppercase;
}

.available-course p,
.course-row__content p,
.course-row > div p {
    margin: 10px 0 0;
    color: var(--muted);
}

.available-course__arrow,
.course-row__arrow,
.article-row__arrow,
.available-course > span:last-child,
.course-row > b,
.article-row > b {
    font-size: 30px;
    line-height: 1;
    text-align: right;
}

.course-row__status,
.course-row > strong,
.article-read-badge,
.article-complete-state {
    display: inline-block;
    padding: 6px 9px;

    border: 1px solid var(--line);
    background: var(--surface);

    color: var(--text);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.article-read-badge,
.article-complete-state {
    background: var(--accent);
}

.dashboard-grid,
.course-sections {
    width: min(calc(100% - 48px), var(--max-width));
    margin: 24px auto 0;
    padding: 0 0 96px;

    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.dashboard-card,
.course-section-card {
    position: relative;
    min-height: 250px;
    padding: 28px;

    display: flex;
    flex-direction: column;
    justify-content: space-between;

    background: rgba(238, 241, 232, 0.72);
    border: 1px solid var(--line);

    transition:
        background 160ms ease,
        transform 160ms ease,
        box-shadow 160ms ease;
}

.dashboard-card:hover,
.course-section-card:hover {
    background: var(--accent);
    transform: translate(-5px, -5px);
    box-shadow: 8px 8px 0 var(--line);
}

.dashboard-card h2,
.course-section-card h2 {
    margin: 0 0 10px;

    font-family: var(--font-display);
    font-size: clamp(28px, 4vw, 46px);
    line-height: 1;
    letter-spacing: -0.04em;
    text-transform: uppercase;
}

.dashboard-card p,
.course-section-card p {
    margin: 0;
    max-width: 440px;
    color: var(--muted);
}

.dashboard-card b,
.course-section-card b,
.dashboard-card__arrow,
.course-section-card__arrow {
    align-self: flex-end;
    font-size: 40px;
    line-height: 1;
}

/* =========================================================
   COURSE PROGRESS
   ========================================================= */

.course-progress-line,
.practice-progress {
    width: min(calc(100% - 48px), var(--max-width));
    margin: 0 auto 24px;

    border: 1px solid var(--line);
    background: rgba(238, 241, 232, 0.62);
}

.course-progress-line,
.practice-progress__header {
    min-height: 52px;
    padding: 0 16px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.practice-progress__header {
    border-bottom: 1px solid var(--line);
}

.practice-progress__squares {
    padding: 16px;

    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.practice-square {
    min-height: 96px;

    display: grid;
    place-items: center;

    border: 1px solid var(--line);
    background: var(--surface);

    font-size: 30px;
    font-weight: 700;

    transition:
        transform 150ms ease,
        box-shadow 150ms ease;
}

a.practice-square:hover {
    transform: translate(-3px, -3px);
    box-shadow: 6px 6px 0 var(--line);
}

.practice-square--correct {
    background: var(--accent);
}

.practice-square--wrong {
    color: #fff;
    background: var(--danger);
}

.practice-square--empty {
    color: var(--muted);
}

.restart-practice-form {
    width: min(calc(100% - 48px), var(--max-width));
    margin: 0 auto 32px;
}

.restart-practice-form button,
.understood-button {
    min-height: 52px;
    padding: 0 18px;

    border: 1px solid var(--line);
    background: var(--accent);
    box-shadow: 5px 5px 0 var(--line);

    font-weight: 700;
}

/* =========================================================
   ARTICLES
   ========================================================= */

.article-screen {
    padding-bottom: 1px;
}

.article-card {
    width: min(calc(100% - 48px), 860px);
    margin: 72px auto 48px;
    padding: 42px;

    border: 1px solid var(--line);
    background: rgba(238, 241, 232, 0.76);
}

.article-card h1 {
    margin-bottom: 30px;
}

.article-card > p:not(.section-number) {
    margin: 0 0 28px;

    font-size: clamp(17px, 2vw, 21px);
    line-height: 1.8;
}

/* =========================================================
   PRACTICE LOADING
   ========================================================= */

.practice-loading-screen,
.practice-result-screen {
    min-height: calc(100vh - var(--header-height));
    padding: 72px 24px;

    display: grid;
    place-items: center;
}

.practice-loading-box,
.practice-result-card {
    width: min(100%, 820px);
    padding: 42px;

    border: 1px solid var(--line);
    background: rgba(244, 246, 239, 0.92);
    box-shadow: 10px 10px 0 var(--accent);

    animation: loading-box-appear 500ms ease both;
}

.practice-loading-box h1,
.practice-result-card h1 {
    margin: 0 0 20px;

    font-family: var(--font-display);
    font-size: clamp(38px, 7vw, 72px);
    line-height: 0.95;
    letter-spacing: -0.04em;
    text-transform: uppercase;
}

.loading-counter {
    margin: 34px 0 18px;

    display: flex;
    align-items: baseline;
    gap: 12px;
}

.loading-counter span {
    display: inline-block;
    min-width: 120px;

    font-size: clamp(58px, 10vw, 108px);
    line-height: 1;

    transform-origin: center;

    animation:
        timer-pulse 1s ease-in-out infinite,
        timer-glitch 4s steps(1) infinite;
}

.loading-counter small {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.loading-line {
    position: relative;
    width: 100%;
    height: 12px;
    overflow: hidden;

    border: 1px solid var(--line);
}

.loading-line::before {
    content: "";
    position: absolute;
    inset: 0;

    background:
        repeating-linear-gradient(
            90deg,
            transparent 0,
            transparent 18px,
            rgba(32, 40, 32, 0.08) 18px,
            rgba(32, 40, 32, 0.08) 19px
        );
}

.loading-line span {
    position: relative;
    display: block;

    width: 32%;
    height: 100%;

    background: var(--accent);
    animation: loading-move 1.1s linear infinite;
}

#loading-status {
    min-height: 24px;
    margin: 18px 0 30px;

    animation: status-blink 1.4s ease-in-out infinite;
}

/* =========================================================
   PRACTICE CARD — DIALOGUE + SCENARIO
   ========================================================= */

.practice-single-card {
    width: min(calc(100% - 48px), var(--max-width));
    margin: 0 auto 48px;

    overflow: hidden;

    border: 1px solid var(--line);
    background: rgba(238, 241, 232, 0.76);

    animation: practice-card-appear 500ms ease both;
}

.dialog {
    padding: 24px;

    display: grid;
    gap: 18px;
}

.dialog-message {
    width: min(68%, 720px);
    padding: 16px 18px;

    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: 4px 4px 0 var(--line);

    opacity: 0;
    animation: practice-item-appear 450ms ease forwards;
}

.dialog-message--employee {
    margin-left: auto;
    background: var(--accent);
}

.dialog-message__sender,
.scenario-card > span,
.scenario-header,
.answer-label,
.practice-answer-form > label {
    display: block;
    margin-bottom: 10px;

    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.dialog-message p {
    margin: 0;
}

.dialog-message:nth-child(1) { animation-delay: 80ms; }
.dialog-message:nth-child(2) { animation-delay: 160ms; }
.dialog-message:nth-child(3) { animation-delay: 240ms; }
.dialog-message:nth-child(4) { animation-delay: 320ms; }
.dialog-message:nth-child(5) { animation-delay: 400ms; }
.dialog-message:nth-child(6) { animation-delay: 480ms; }
.dialog-message:nth-child(7) { animation-delay: 560ms; }

.scenario-card {
    padding: 34px;

    border: 0;
    background: transparent;

    opacity: 0;
    animation: practice-item-appear 450ms 120ms ease forwards;
}

.scenario-card > span {
    margin-bottom: 18px;
}

.scenario-card p,
.scenario-description {
    margin: 0;
    max-width: 920px;

    font-size: clamp(17px, 2vw, 22px);
    line-height: 1.75;
    white-space: pre-line;
}

.practice-answer-form {
    padding: 24px 28px 28px;

    display: grid;
    gap: 16px;

    border-top: 1px solid var(--line);
    background: rgba(244, 246, 239, 0.72);
}

.classification-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.classification-options label {
    display: block;

    cursor: pointer;
    opacity: 0;
    animation: answer-option-appear 400ms ease forwards;
}

.classification-options label:nth-child(1) { animation-delay: 180ms; }
.classification-options label:nth-child(2) { animation-delay: 260ms; }
.classification-options label:nth-child(3) { animation-delay: 340ms; }

.classification-options input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.classification-options span {
    min-height: 68px;
    padding: 12px 16px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid var(--line);
    background: var(--surface);

    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-align: center;
    text-transform: uppercase;

    transition:
        background 160ms ease,
        transform 160ms ease,
        box-shadow 160ms ease;
}

.classification-options label:hover span {
    transform: translateY(-3px);
    box-shadow: 4px 4px 0 var(--line);
}

.classification-options input:checked + span {
    background: var(--accent);
    transform: translateY(-2px);
    box-shadow: 4px 4px 0 var(--line);
}

.practice-answer-form button,
.practice-submit-btn {
    width: 100%;
    min-height: 62px;
    padding: 0 18px;

    border: 1px solid var(--line);
    background: var(--accent);
    box-shadow: 5px 5px 0 var(--line);

    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;

    transition:
        transform 150ms ease,
        box-shadow 150ms ease;
}

.practice-answer-form button:hover,
.practice-submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 7px 7px 0 var(--line);
}

.practice-answer-form button:active,
.practice-submit-btn:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 var(--line);
}

/* =========================================================
   PRACTICE RESULT / REVIEW
   ========================================================= */

.practice-result-card--wrong {
    box-shadow: 10px 10px 0 var(--danger);
}

.result-status {
    font-size: 16px;
}

.result-explanation,
.result-action,
.practice-final-score {
    margin-top: 26px;
    padding: 20px;

    border: 1px solid var(--line);
}

.result-explanation span,
.result-action span,
.practice-final-score span,
.review-answer span {
    display: block;
    margin-bottom: 10px;

    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.practice-final-score strong {
    display: block;
    font-size: 42px;
}

.review-answer {
    padding: 24px;

    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;

    border-top: 1px solid var(--line);
}

.review-answer div {
    padding: 15px;
    border: 1px solid var(--line);
}

.review-answer p {
    grid-column: 1 / -1;
}

/* =========================================================
   EMPTY / NOT FOUND
   ========================================================= */

.empty-state,
.not-found-panel {
    width: min(calc(100% - 48px), var(--max-width));
    margin: 0 auto 96px;
    padding: 48px;

    border: 1px solid var(--line);
    background: rgba(238, 241, 232, 0.62);
}

.empty-state h2,
.not-found-panel h1 {
    margin: 26px 0 14px;

    font-family: var(--font-display);
    font-size: clamp(32px, 5vw, 62px);
    line-height: 0.95;
    letter-spacing: -0.04em;
    text-transform: uppercase;
}

/* =========================================================
   ANIMATIONS
   ========================================================= */

@keyframes loading-move {
    from {
        transform: translateX(-110%);
    }

    to {
        transform: translateX(330%);
    }
}

@keyframes timer-pulse {
    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.035);
        opacity: 0.78;
    }
}

@keyframes timer-glitch {
    0%,
    92%,
    100% {
        text-shadow: none;
    }

    93% {
        text-shadow:
            3px 0 0 var(--accent),
            -3px 0 0 var(--danger);
    }

    94% {
        text-shadow:
            -2px 0 0 var(--accent),
            2px 0 0 var(--danger);
    }

    95% {
        text-shadow: none;
    }
}

@keyframes status-blink {
    0%,
    100% {
        opacity: 0.45;
    }

    50% {
        opacity: 1;
    }
}

@keyframes loading-box-appear {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes practice-card-appear {
    from {
        opacity: 0;
        transform: translateY(22px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes practice-item-appear {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes answer-option-appear {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 900px) {
    .classification-options {
        grid-template-columns: 1fr;
    }

    .dialog-message {
        width: 86%;
    }
}

@media (max-width: 760px) {
    :root {
        --header-height: auto;
    }

    .site-header {
        width: min(calc(100% - 28px), var(--max-width));
        padding: 18px 0;

        align-items: flex-start;
        flex-direction: column;
    }

    .site-nav,
    .site-header nav {
        width: 100%;
        gap: 16px;
        flex-wrap: wrap;
    }

    .page-heading,
    .article-header {
        width: min(calc(100% - 28px), var(--max-width));
        padding-top: 60px;
    }

    .courses-banner,
    .available-courses-list,
    .course-list,
    .article-list,
    .dashboard-grid,
    .course-sections,
    .course-progress-line,
    .practice-progress,
    .practice-single-card,
    .page-bottom-actions,
    .restart-practice-form {
        width: min(calc(100% - 28px), var(--max-width));
    }

    .dashboard-grid,
    .course-sections,
    .review-answer {
        grid-template-columns: 1fr;
    }

    .available-course,
    .course-row,
    .article-row {
        grid-template-columns: 42px 1fr 30px;
        gap: 14px;
    }

    .course-row {
        grid-template-columns: 42px 1fr;
    }

    .course-row > strong,
    .course-row > b {
        grid-column: 2;
    }

    .practice-progress__squares {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .practice-loading-box,
    .practice-result-card,
    .login-panel,
    .login-card,
    .article-card {
        padding: 28px 22px;
    }

    .loading-counter span {
        min-width: 90px;
    }

    .scenario-card,
    .practice-answer-form,
    .dialog {
        padding: 20px;
    }

    .review-answer p {
        grid-column: auto;
    }
}

@media (max-width: 460px) {
    .site-nav,
    .site-header nav {
        font-size: 11px;
    }

    .page-heading h1,
    .article-header h1,
    .article-card h1 {
        font-size: 38px;
    }

    .dashboard-card,
    .course-section-card {
        min-height: 220px;
    }

    .available-course,
    .course-row,
    .article-row {
        gap: 12px;
    }

    .course-row p,
    .available-course p {
        display: none;
    }
}
/* Более тонкие буквы */

body,
button,
input,
textarea,
select {
    font-weight: 400;
}

.site-logo,
.logo,
.site-nav,
.site-header nav,
.section-number,
.courses-banner,
.course-progress-line,
.practice-progress__header,
.available-course,
.course-row,
.article-row,
.practice-answer-form,
.classification-options span {
    font-weight: 400;
}

.page-heading h1,
.article-header h1,
.article-card h1,
.home-title,
.hero h1,
.dashboard-card h2,
.course-section-card h2,
.available-course h3,
.course-row h2,
.article-row h2,
.practice-loading-box h1,
.practice-result-card h1 {
    font-weight: 400;
}


/* Главный экран — строго по центру */

.home-screen,
.hero {
    min-height: calc(100vh - var(--header-height));

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 24px;
}

.home-screen__content,
.hero > div {
    width: 100%;
    max-width: 1000px;

    margin: 0 auto;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    text-align: center;

    transform: translateY(-20px);
}

.home-title,
.hero h1 {
    margin: 0;
    text-align: center;
}

.home-subtitle,
.hero__text {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.primary-button {
    margin-left: auto;
    margin-right: auto;
}

/* =========================================================
   RESET ALL PROGRESS
   ========================================================= */

.reset-progress-section {
    width: min(calc(100% - 48px), var(--max-width));
    margin: 0 auto 90px;
    padding: 22px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;

    border: 1px solid var(--line);
    background: rgba(238, 241, 232, 0.72);
}

.reset-progress-section__text span {
    display: block;
    margin-bottom: 7px;

    color: var(--muted);

    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.reset-progress-section__text p {
    max-width: 650px;
    margin: 0;

    color: var(--muted);
    font-size: 13px;
}

.reset-progress-section form {
    flex-shrink: 0;
}

.reset-progress-section button {
    min-height: 50px;
    padding: 0 18px;

    border: 1px solid var(--line);
    background: transparent;
    box-shadow: 4px 4px 0 var(--line);

    color: var(--text);

    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;

    cursor: pointer;

    transition:
        color 150ms ease,
        background 150ms ease,
        transform 150ms ease,
        box-shadow 150ms ease;
}

.reset-progress-section button:hover {
    color: #ffffff;
    background: var(--danger);
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 var(--line);
}

.reset-progress-section button:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 var(--line);
}


@media (max-width: 760px) {
    .reset-progress-section {
        width: min(calc(100% - 28px), var(--max-width));

        align-items: stretch;
        flex-direction: column;
    }

    .reset-progress-section button {
        width: 100%;
    }
}

