/* =============================================================
   MATERIAL DESIGN 3 — ПОЛНЫЙ СТИЛЬ ДЛЯ ОГЭ ИНФОРМАТИКА
   -------------------------------------------------------------
   Современная дизайн-система Google (Material Design 3)
   Цвет: Google Blue
   ============================================================= */

/* =============================================================
   1. ПЕРЕМЕННЫЕ — ЦВЕТОВАЯ СИСТЕМА M3
   ============================================================= */

:root {
    /* ----- Primary Colors (Основные) ----- */
    --md-sys-color-primary: #0061a4;
    --md-sys-color-on-primary: #ffffff;
    --md-sys-color-primary-container: #d1e4ff;
    --md-sys-color-on-primary-container: #001d36;

    /* ----- Secondary Colors (Вторичные) ----- */
    --md-sys-color-secondary: #54606f;
    --md-sys-color-on-secondary: #ffffff;
    --md-sys-color-secondary-container: #d8e4f6;
    --md-sys-color-on-secondary-container: #111d2a;

    /* ----- Tertiary Colors (Третичные) ----- */
    --md-sys-color-tertiary: #6b5778;
    --md-sys-color-on-tertiary: #ffffff;
    --md-sys-color-tertiary-container: #f2daff;
    --md-sys-color-on-tertiary-container: #251431;

    /* ----- Error Colors (Ошибки) ----- */
    --md-sys-color-error: #ba1a1a;
    --md-sys-color-on-error: #ffffff;
    --md-sys-color-error-container: #ffdad6;
    --md-sys-color-on-error-container: #410002;

    /* ----- Neutral Colors (Нейтральные) ----- */
    --md-sys-color-background: #fdfcff;
    --md-sys-color-on-background: #1a1c1e;
    --md-sys-color-surface: #fdfcff;
    --md-sys-color-surface-container-lowest: #ffffff;
    --md-sys-color-surface-container-low: #f7f9fc;
    --md-sys-color-surface-container: #f1f5f9;
    --md-sys-color-surface-container-high: #e9edf4;
    --md-sys-color-surface-container-highest: #e3e8ef;
    --md-sys-color-on-surface: #1a1c1e;
    --md-sys-color-surface-variant: #dfe2eb;
    --md-sys-color-on-surface-variant: #43474e;
    --md-sys-color-outline: #73777f;
    --md-sys-color-outline-variant: #c3c6cf;

    /* ----- Surface Tints ----- */
    --md-sys-color-surface-tint: #0061a4;
    --md-sys-color-inverse-surface: #2f3133;
    --md-sys-color-inverse-on-surface: #f1f1f3;
    --md-sys-color-inverse-primary: #9ecaff;

    /* ----- Shadows ----- */
    --md-sys-color-shadow: #000000;
    --md-sys-color-scrim: #000000;

    /* ----- Elevation Shadows (Уровни возвышения) ----- */
    --md-sys-elevation-0: none;
    --md-sys-elevation-1: 0px 1px 2px rgba(0, 0, 0, 0.3), 0px 1px 3px 1px rgba(0, 0, 0, 0.15);
    --md-sys-elevation-2: 0px 1px 2px rgba(0, 0, 0, 0.3), 0px 2px 6px 2px rgba(0, 0, 0, 0.15);
    --md-sys-elevation-3: 0px 4px 8px 3px rgba(0, 0, 0, 0.15), 0px 1px 3px rgba(0, 0, 0, 0.3);
    --md-sys-elevation-4: 0px 6px 10px 4px rgba(0, 0, 0, 0.15), 0px 2px 3px rgba(0, 0, 0, 0.3);
    --md-sys-elevation-5: 0px 8px 12px 6px rgba(0, 0, 0, 0.15), 0px 4px 4px rgba(0, 0, 0, 0.3);

    /* ----- Border Radius (Скругления) ----- */
    --md-sys-shape-corner-none: 0px;
    --md-sys-shape-corner-extra-small: 4px;
    --md-sys-shape-corner-small: 8px;
    --md-sys-shape-corner-medium: 12px;
    --md-sys-shape-corner-large: 16px;
    --md-sys-shape-corner-extra-large: 28px;
    --md-sys-shape-corner-full: 9999px;

    /* ----- Typography (Типографика) ----- */
    --md-sys-typescale-font-family: 'Roboto', 'Segoe UI', system-ui, -apple-system, sans-serif;

    --md-sys-typescale-display-large-size: 3.5625rem;
    --md-sys-typescale-display-large-weight: 400;
    --md-sys-typescale-display-large-line-height: 4rem;
    --md-sys-typescale-display-large-tracking: -0.02em;

    --md-sys-typescale-display-medium-size: 2.8125rem;
    --md-sys-typescale-display-medium-weight: 400;
    --md-sys-typescale-display-medium-line-height: 3.25rem;
    --md-sys-typescale-display-medium-tracking: 0px;

    --md-sys-typescale-display-small-size: 2.25rem;
    --md-sys-typescale-display-small-weight: 400;
    --md-sys-typescale-display-small-line-height: 2.75rem;
    --md-sys-typescale-display-small-tracking: 0px;

    --md-sys-typescale-headline-large-size: 2rem;
    --md-sys-typescale-headline-large-weight: 400;
    --md-sys-typescale-headline-large-line-height: 2.5rem;
    --md-sys-typescale-headline-large-tracking: 0px;

    --md-sys-typescale-headline-medium-size: 1.75rem;
    --md-sys-typescale-headline-medium-weight: 400;
    --md-sys-typescale-headline-medium-line-height: 2.25rem;
    --md-sys-typescale-headline-medium-tracking: 0px;

    --md-sys-typescale-headline-small-size: 1.5rem;
    --md-sys-typescale-headline-small-weight: 400;
    --md-sys-typescale-headline-small-line-height: 2rem;
    --md-sys-typescale-headline-small-tracking: 0px;

    --md-sys-typescale-title-large-size: 1.375rem;
    --md-sys-typescale-title-large-weight: 500;
    --md-sys-typescale-title-large-line-height: 1.75rem;
    --md-sys-typescale-title-large-tracking: 0px;

    --md-sys-typescale-title-medium-size: 1rem;
    --md-sys-typescale-title-medium-weight: 500;
    --md-sys-typescale-title-medium-line-height: 1.5rem;
    --md-sys-typescale-title-medium-tracking: 0.009375rem;

    --md-sys-typescale-title-small-size: 0.875rem;
    --md-sys-typescale-title-small-weight: 500;
    --md-sys-typescale-title-small-line-height: 1.25rem;
    --md-sys-typescale-title-small-tracking: 0.00625rem;

    --md-sys-typescale-body-large-size: 1rem;
    --md-sys-typescale-body-large-weight: 400;
    --md-sys-typescale-body-large-line-height: 1.5rem;
    --md-sys-typescale-body-large-tracking: 0.03125rem;

    --md-sys-typescale-body-medium-size: 0.875rem;
    --md-sys-typescale-body-medium-weight: 400;
    --md-sys-typescale-body-medium-line-height: 1.25rem;
    --md-sys-typescale-body-medium-tracking: 0.015625rem;

    --md-sys-typescale-body-small-size: 0.75rem;
    --md-sys-typescale-body-small-weight: 400;
    --md-sys-typescale-body-small-line-height: 1rem;
    --md-sys-typescale-body-small-tracking: 0.025rem;

    --md-sys-typescale-label-large-size: 0.875rem;
    --md-sys-typescale-label-large-weight: 500;
    --md-sys-typescale-label-large-line-height: 1.25rem;
    --md-sys-typescale-label-large-tracking: 0.00625rem;

    --md-sys-typescale-label-medium-size: 0.75rem;
    --md-sys-typescale-label-medium-weight: 500;
    --md-sys-typescale-label-medium-line-height: 1rem;
    --md-sys-typescale-label-medium-tracking: 0.03125rem;

    --md-sys-typescale-label-small-size: 0.6875rem;
    --md-sys-typescale-label-small-weight: 500;
    --md-sys-typescale-label-small-line-height: 1rem;
    --md-sys-typescale-label-small-tracking: 0.03125rem;

    /* ----- Spacing (Отступы) ----- */
    --md-sys-spacing-xs: 4px;
    --md-sys-spacing-sm: 8px;
    --md-sys-spacing-md: 16px;
    --md-sys-spacing-lg: 24px;
    --md-sys-spacing-xl: 32px;
    --md-sys-spacing-2xl: 40px;
    --md-sys-spacing-3xl: 48px;
    --md-sys-spacing-4xl: 64px;
    --md-sys-spacing-5xl: 80px;

    /* ----- Motion (Анимации) ----- */
    --md-sys-motion-duration-short1: 50ms;
    --md-sys-motion-duration-short2: 100ms;
    --md-sys-motion-duration-short3: 150ms;
    --md-sys-motion-duration-short4: 200ms;
    --md-sys-motion-duration-medium1: 250ms;
    --md-sys-motion-duration-medium2: 300ms;
    --md-sys-motion-duration-medium3: 350ms;
    --md-sys-motion-duration-medium4: 400ms;
    --md-sys-motion-duration-long1: 450ms;
    --md-sys-motion-duration-long2: 500ms;
    --md-sys-motion-duration-extra-long1: 600ms;
    --md-sys-motion-duration-extra-long2: 700ms;

    --md-sys-motion-easing-linear: cubic-bezier(0, 0, 1, 1);
    --md-sys-motion-easing-standard: cubic-bezier(0.2, 0, 0, 1);
    --md-sys-motion-easing-standard-decelerate: cubic-bezier(0, 0, 0, 1);
    --md-sys-motion-easing-standard-accelerate: cubic-bezier(0.3, 0, 1, 1);
    --md-sys-motion-easing-emphasized: cubic-bezier(0.2, 0, 0, 1);
    --md-sys-motion-easing-emphasized-decelerate: cubic-bezier(0.05, 0.7, 0.1, 1);
    --md-sys-motion-easing-emphasized-accelerate: cubic-bezier(0.3, 0, 0.8, 0.15);

    /* ----- Difficulty Colors (Цвета сложности) ----- */
    --color-easy: #2e7d32;
    --color-easy-bg: #e8f5e9;
    --color-medium: #ef6c00;
    --color-medium-bg: #fff3e0;
    --color-hard: #c62828;
    --color-hard-bg: #ffebee;

    /* ----- State Layers ----- */
    --md-sys-state-hover: rgba(0, 0, 0, 0.04);
    --md-sys-state-focus: rgba(0, 0, 0, 0.08);
    --md-sys-state-pressed: rgba(0, 0, 0, 0.12);
    --md-sys-state-dragged: rgba(0, 0, 0, 0.16);
}

/* =============================================================
   2. ТЁМНАЯ ТЕМА (DARK THEME)
   ============================================================= */

[data-theme="dark"] {
    --md-sys-color-primary: #9ecaff;
    --md-sys-color-on-primary: #003258;
    --md-sys-color-primary-container: #00497d;
    --md-sys-color-on-primary-container: #d1e4ff;

    --md-sys-color-secondary: #bcc7db;
    --md-sys-color-on-secondary: #263140;
    --md-sys-color-secondary-container: #3d4958;
    --md-sys-color-on-secondary-container: #d8e4f6;

    --md-sys-color-tertiary: #d7bfe4;
    --md-sys-color-on-tertiary: #3b2a48;
    --md-sys-color-tertiary-container: #534060;
    --md-sys-color-on-tertiary-container: #f2daff;

    --md-sys-color-error: #ffb4ab;
    --md-sys-color-on-error: #690005;
    --md-sys-color-error-container: #93000a;
    --md-sys-color-on-error-container: #ffdad6;

    --md-sys-color-background: #1a1c1e;
    --md-sys-color-on-background: #e3e2e6;
    --md-sys-color-surface: #1a1c1e;
    --md-sys-color-surface-container-lowest: #0e0f13;
    --md-sys-color-surface-container-low: #1d2024;
    --md-sys-color-surface-container: #212429;
    --md-sys-color-surface-container-high: #2b2f33;
    --md-sys-color-surface-container-highest: #363a3f;
    --md-sys-color-on-surface: #e3e2e6;
    --md-sys-color-surface-variant: #43474e;
    --md-sys-color-on-surface-variant: #c3c6cf;
    --md-sys-color-outline: #8d9199;
    --md-sys-color-outline-variant: #43474e;

    --md-sys-color-surface-tint: #9ecaff;
    --md-sys-color-inverse-surface: #e3e2e6;
    --md-sys-color-inverse-on-surface: #2f3133;
    --md-sys-color-inverse-primary: #0061a4;

    --md-sys-elevation-1: 0px 1px 3px 1px rgba(0, 0, 0, 0.4), 0px 1px 2px rgba(0, 0, 0, 0.6);
    --md-sys-elevation-2: 0px 2px 6px 2px rgba(0, 0, 0, 0.4), 0px 1px 2px rgba(0, 0, 0, 0.6);
    --md-sys-elevation-3: 0px 4px 8px 3px rgba(0, 0, 0, 0.4), 0px 1px 3px rgba(0, 0, 0, 0.6);
    --md-sys-elevation-4: 0px 6px 10px 4px rgba(0, 0, 0, 0.4), 0px 2px 3px rgba(0, 0, 0, 0.6);
    --md-sys-elevation-5: 0px 8px 12px 6px rgba(0, 0, 0, 0.4), 0px 4px 4px rgba(0, 0, 0, 0.6);

    --color-easy: #81c784;
    --color-easy-bg: rgba(76, 175, 80, 0.2);
    --color-medium: #ffb74d;
    --color-medium-bg: rgba(255, 152, 0, 0.2);
    --color-hard: #e57373;
    --color-hard-bg: rgba(244, 67, 54, 0.2);

    --md-sys-state-hover: rgba(255, 255, 255, 0.04);
    --md-sys-state-focus: rgba(255, 255, 255, 0.08);
    --md-sys-state-pressed: rgba(255, 255, 255, 0.12);
    --md-sys-state-dragged: rgba(255, 255, 255, 0.16);
}

/* =============================================================
   3. БАЗОВЫЕ СТИЛИ (BASE STYLES)
   ============================================================= */

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: 80px;
}

body {
    font-family: var(--md-sys-typescale-font-family);
    font-size: var(--md-sys-typescale-body-large-size);
    font-weight: var(--md-sys-typescale-body-large-weight);
    line-height: var(--md-sys-typescale-body-large-line-height);
    letter-spacing: var(--md-sys-typescale-body-large-tracking);
    background-color: var(--md-sys-color-background);
    color: var(--md-sys-color-on-background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-standard),
                color var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-standard);
    overflow-x: hidden;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 500;
    line-height: 1.2;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

/* =============================================================
   4. КОНТЕЙНЕР (CONTAINER)
   ============================================================= */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--md-sys-spacing-lg);
    position: relative;
    z-index: 1;
}

/* =============================================================
   5. ШАПКА (HEADER)
   ============================================================= */

.header {
    background-color: var(--md-sys-color-surface);
    box-shadow: var(--md-sys-elevation-2);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-standard);
}

.header.scrolled {
    box-shadow: var(--md-sys-elevation-3);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--md-sys-spacing-md) 0;
    min-height: 64px;
}

/* Логотип */
.logo {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-md);
    text-decoration: none;
    color: var(--md-sys-color-on-surface);
}

.logo-icon {
    font-size: 2rem;
    transition: transform var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-emphasized);
    display: inline-block;
}

.logo:hover .logo-icon {
    transform: scale(1.15) rotate(-8deg);
}

.logo-text {
    font-family: var(--md-sys-typescale-font-family);
    font-size: var(--md-sys-typescale-title-large-size);
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--md-sys-color-on-surface);
    background: linear-gradient(135deg, var(--md-sys-color-primary) 0%, #4d79ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Навигация */
.nav-links {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-lg);
    list-style: none;
}

.nav-links a {
    color: var(--md-sys-color-on-surface-variant);
    font-size: var(--md-sys-typescale-label-large-size);
    font-weight: var(--md-sys-typescale-label-large-weight);
    letter-spacing: var(--md-sys-typescale-label-large-tracking);
    padding: var(--md-sys-spacing-sm) var(--md-sys-spacing-md);
    border-radius: var(--md-sys-shape-corner-full);
    transition: all var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
    position: relative;
}

.nav-links a:hover {
    color: var(--md-sys-color-primary);
    background-color: var(--md-sys-state-hover);
}

.nav-links a.active {
    color: var(--md-sys-color-primary);
    background-color: var(--md-sys-color-primary-container);
}

/* Переключатель темы */
.theme-toggle {
    background-color: var(--md-sys-color-surface-container-high);
    border: none;
    border-radius: var(--md-sys-shape-corner-full);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-emphasized);
    color: var(--md-sys-color-on-surface-variant);
    box-shadow: var(--md-sys-elevation-1);
}

.theme-toggle:hover {
    box-shadow: var(--md-sys-elevation-2);
    transform: scale(1.05);
    background-color: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-primary);
}

.theme-toggle:active {
    transform: scale(0.95);
    box-shadow: var(--md-sys-elevation-1);
}

.theme-icon {
    width: 22px;
    height: 22px;
}

.moon-icon {
    display: none;
}

[data-theme="dark"] .sun-icon {
    display: none;
}

[data-theme="dark"] .moon-icon {
    display: block;
}

/* Бургер-меню */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: var(--md-sys-color-surface-container-high);
    border: none;
    border-radius: var(--md-sys-shape-corner-small);
    cursor: pointer;
    padding: var(--md-sys-spacing-sm);
    box-shadow: var(--md-sys-elevation-1);
    transition: all var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
}

.menu-toggle:hover {
    background-color: var(--md-sys-color-primary-container);
}

.menu-toggle span {
    display: block;
    width: 22px;
    height: 2.5px;
    background: var(--md-sys-color-on-surface);
    border-radius: var(--md-sys-shape-corner-full);
    transition: all var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-standard);
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* =============================================================
   6. ГЕРОЙ (HERO SECTION)
   ============================================================= */

.hero {
    padding: var(--md-sys-spacing-4xl) 0 var(--md-sys-spacing-3xl);
    text-align: center;
    background: linear-gradient(135deg, var(--md-sys-color-primary-container) 0%, var(--md-sys-color-surface) 100%);
    border-radius: 0 0 var(--md-sys-shape-corner-extra-large) var(--md-sys-shape-corner-extra-large);
    margin-bottom: var(--md-sys-spacing-3xl);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(0, 97, 164, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(77, 121, 255, 0.06) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero-content {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--md-sys-spacing-sm);
    padding: var(--md-sys-spacing-sm) var(--md-sys-spacing-lg);
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-full);
    font-size: var(--md-sys-typescale-label-large-size);
    font-weight: var(--md-sys-typescale-label-large-weight);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--md-sys-color-primary);
    margin-bottom: var(--md-sys-spacing-lg);
    box-shadow: var(--md-sys-elevation-1);
    transition: all var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
}

.hero-badge:hover {
    box-shadow: var(--md-sys-elevation-2);
    transform: translateY(-2px);
}

.hero-title {
    font-family: var(--md-sys-typescale-font-family);
    font-size: clamp(2rem, 6vw, var(--md-sys-typescale-display-large-size));
    font-weight: 400;
    line-height: var(--md-sys-typescale-display-large-line-height);
    letter-spacing: var(--md-sys-typescale-display-large-tracking);
    color: var(--md-sys-color-on-background);
    margin-bottom: var(--md-sys-spacing-md);
}

.hero-title .highlight {
    font-weight: 600;
    background: linear-gradient(135deg, var(--md-sys-color-primary) 0%, #4d79ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: var(--md-sys-typescale-body-large-size);
    color: var(--md-sys-color-on-surface-variant);
    max-width: 650px;
    margin: 0 auto var(--md-sys-spacing-xl);
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: var(--md-sys-spacing-md);
    flex-wrap: wrap;
    margin-bottom: var(--md-sys-spacing-2xl);
}

/* Статистика */
.hero-stats {
    display: flex;
    justify-content: center;
    gap: var(--md-sys-spacing-lg);
    flex-wrap: wrap;
    margin-top: var(--md-sys-spacing-xl);
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--md-sys-spacing-xs);
    padding: var(--md-sys-spacing-md) var(--md-sys-spacing-lg);
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-large);
    box-shadow: var(--md-sys-elevation-1);
    min-width: 110px;
    transition: all var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-emphasized);
}

.stat:hover {
    transform: translateY(-4px);
    box-shadow: var(--md-sys-elevation-2);
}

.stat-number {
    font-size: var(--md-sys-typescale-headline-large-size);
    font-weight: 600;
    color: var(--md-sys-color-primary);
    line-height: 1;
    background: linear-gradient(135deg, var(--md-sys-color-primary) 0%, #4d79ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: var(--md-sys-typescale-label-medium-size);
    font-weight: var(--md-sys-typescale-label-medium-weight);
    letter-spacing: var(--md-sys-typescale-label-medium-tracking);
    color: var(--md-sys-color-on-surface-variant);
    text-transform: uppercase;
}

/* =============================================================
   7. СЕКЦИИ (SECTIONS)
   ============================================================= */

.tasks-section,
.features-section,
.section {
    padding: var(--md-sys-spacing-3xl) 0;
}

.section-title,
.section-heading {
    font-family: var(--md-sys-typescale-font-family);
    font-size: var(--md-sys-typescale-headline-large-size);
    font-weight: var(--md-sys-typescale-headline-large-weight);
    color: var(--md-sys-color-on-background);
    margin-bottom: var(--md-sys-spacing-xl);
    text-align: center;
    letter-spacing: -0.01em;
}

.section-header {
    text-align: center;
    max-width: 600px;
    margin: 0 auto var(--md-sys-spacing-2xl);
}

.section-emoji {
    font-size: 3.5rem;
    display: inline-block;
    margin-bottom: var(--md-sys-spacing-md);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.05));
}

.section-heading::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--md-sys-color-primary), #4d79ff);
    border-radius: var(--md-sys-shape-corner-full);
    margin: var(--md-sys-spacing-sm) auto 0;
}

.section-label {
    display: inline-block;
    font-size: var(--md-sys-typescale-label-medium-size);
    font-weight: var(--md-sys-typescale-label-medium-weight);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--md-sys-color-primary);
    margin-bottom: var(--md-sys-spacing-xs);
}

.section-description {
    font-size: var(--md-sys-typescale-body-large-size);
    color: var(--md-sys-color-on-surface-variant);
    line-height: 1.7;
}

/* =============================================================
   8. СЕТКА ЗАДАНИЙ (TASKS GRID)
   ============================================================= */

.tasks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--md-sys-spacing-lg);
}

.task-card {
    background-color: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-large);
    box-shadow: var(--md-sys-elevation-1);
    padding: var(--md-sys-spacing-lg);
    transition: all var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-emphasized);
    cursor: pointer;
    border: 1px solid var(--md-sys-color-outline-variant);
    display: flex;
    flex-direction: column;
    gap: var(--md-sys-spacing-sm);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: var(--md-sys-color-on-surface);
}

.task-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--md-sys-color-primary), #4d79ff);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-standard);
}

.task-card:hover {
    box-shadow: var(--md-sys-elevation-3);
    transform: translateY(-6px);
    border-color: var(--md-sys-color-primary);
}

.task-card:hover::before {
    transform: scaleX(1);
}

.task-card:active {
    transform: translateY(-2px);
    box-shadow: var(--md-sys-elevation-2);
}

.task-number {
    font-family: var(--md-sys-typescale-font-family);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--md-sys-color-primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--md-sys-spacing-xs);
    opacity: 0.7;
    transition: opacity var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
}

.task-card:hover .task-number {
    opacity: 1;
}

.task-title {
    font-family: var(--md-sys-typescale-font-family);
    font-size: var(--md-sys-typescale-title-large-size);
    font-weight: var(--md-sys-typescale-title-large-weight);
    color: var(--md-sys-color-on-surface);
    line-height: 1.4;
    margin-bottom: var(--md-sys-spacing-xs);
}

.task-description {
    font-family: var(--md-sys-typescale-font-family);
    font-size: var(--md-sys-typescale-body-medium-size);
    color: var(--md-sys-color-on-surface-variant);
    line-height: 1.6;
    flex-grow: 1;
    margin-bottom: var(--md-sys-spacing-sm);
}

.task-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--md-sys-spacing-xs);
}

.task-difficulty {
    display: inline-flex;
    align-items: center;
    padding: var(--md-sys-spacing-xs) var(--md-sys-spacing-md);
    border-radius: var(--md-sys-shape-corner-full);
    font-family: var(--md-sys-typescale-font-family);
    font-size: var(--md-sys-typescale-label-medium-size);
    font-weight: var(--md-sys-typescale-label-medium-weight);
    letter-spacing: var(--md-sys-typescale-label-medium-tracking);
    text-transform: uppercase;
    margin-top: var(--md-sys-spacing-sm);
    align-self: flex-start;
    transition: all var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
}

.difficulty-easy {
    background-color: var(--color-easy-bg);
    color: var(--color-easy);
}

.difficulty-medium {
    background-color: var(--color-medium-bg);
    color: var(--color-medium);
}

.difficulty-hard {
    background-color: var(--color-hard-bg);
    color: var(--color-hard);
}

.task-date {
    font-size: var(--md-sys-typescale-label-small-size);
    color: var(--md-sys-color-on-surface-variant);
}

/* =============================================================
   9. СЕТКА ПРЕИМУЩЕСТВ (FEATURES GRID)
   ============================================================= */

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--md-sys-spacing-lg);
}

.feature-card {
    background-color: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-large);
    box-shadow: var(--md-sys-elevation-1);
    padding: var(--md-sys-spacing-xl);
    text-align: center;
    transition: all var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-emphasized);
    border: 1px solid var(--md-sys-color-outline-variant);
}

.feature-card:hover {
    box-shadow: var(--md-sys-elevation-3);
    transform: translateY(-6px);
    border-color: var(--md-sys-color-primary);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: var(--md-sys-spacing-md);
    display: inline-block;
    transition: transform var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-emphasized);
}

.feature-card:hover .feature-icon {
    transform: scale(1.15) rotate(-5deg);
}

.feature-card h4 {
    font-family: var(--md-sys-typescale-font-family);
    font-size: var(--md-sys-typescale-title-medium-size);
    font-weight: var(--md-sys-typescale-title-medium-weight);
    color: var(--md-sys-color-on-surface);
    margin-bottom: var(--md-sys-spacing-sm);
}

.feature-card p {
    font-family: var(--md-sys-typescale-font-family);
    font-size: var(--md-sys-typescale-body-medium-size);
    color: var(--md-sys-color-on-surface-variant);
    line-height: 1.6;
}

/* =============================================================
   10. CTA СЕКЦИЯ
   ============================================================= */

.cta-section {
    text-align: center;
    padding: var(--md-sys-spacing-2xl) var(--md-sys-spacing-lg);
    background: linear-gradient(135deg, var(--md-sys-color-primary-container) 0%, var(--md-sys-color-surface-container) 100%);
    border-radius: var(--md-sys-shape-corner-extra-large);
    box-shadow: var(--md-sys-elevation-2);
    margin: var(--md-sys-spacing-2xl) 0;
    transition: all var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-standard);
}

.cta-section:hover {
    box-shadow: var(--md-sys-elevation-3);
}

.cta-section h2 {
    font-size: var(--md-sys-typescale-headline-medium-size);
    font-weight: var(--md-sys-typescale-headline-medium-weight);
    color: var(--md-sys-color-on-surface);
    margin-bottom: var(--md-sys-spacing-sm);
}

.cta-section h2 strong {
    color: var(--md-sys-color-primary);
}

.cta-section p {
    font-size: var(--md-sys-typescale-body-large-size);
    color: var(--md-sys-color-on-surface-variant);
    max-width: 500px;
    margin: 0 auto var(--md-sys-spacing-lg);
    line-height: 1.6;
}

.cta-actions {
    display: flex;
    justify-content: center;
    gap: var(--md-sys-spacing-md);
    flex-wrap: wrap;
}

/* =============================================================
   11. КНОПКИ (BUTTONS)
   ============================================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--md-sys-spacing-sm);
    padding: 0 var(--md-sys-spacing-lg);
    height: 40px;
    border: none;
    border-radius: var(--md-sys-shape-corner-full);
    font-family: var(--md-sys-typescale-font-family);
    font-size: var(--md-sys-typescale-label-large-size);
    font-weight: var(--md-sys-typescale-label-large-weight);
    letter-spacing: var(--md-sys-typescale-label-large-tracking);
    text-decoration: none;
    cursor: pointer;
    transition: all var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.97);
}

.btn-filled,
.btn-primary {
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    box-shadow: var(--md-sys-elevation-1);
}

.btn-filled:hover,
.btn-primary:hover {
    box-shadow: var(--md-sys-elevation-2);
    background-color: #005591;
}

.btn-tonal {
    background-color: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
}

.btn-tonal:hover {
    box-shadow: var(--md-sys-elevation-1);
}

.btn-outlined {
    background-color: transparent;
    color: var(--md-sys-color-primary);
    border: 1px solid var(--md-sys-color-outline);
}

.btn-outlined:hover {
    background-color: var(--md-sys-state-hover);
}

.btn-text {
    background-color: transparent;
    color: var(--md-sys-color-primary);
    padding: 0 var(--md-sys-spacing-md);
}

.btn-text:hover {
    background-color: var(--md-sys-state-hover);
}

.btn-elevated {
    background-color: var(--md-sys-color-surface);
    color: var(--md-sys-color-primary);
    box-shadow: var(--md-sys-elevation-1);
}

.btn-elevated:hover {
    box-shadow: var(--md-sys-elevation-2);
}

.btn-glass {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--md-sys-color-on-surface);
    box-shadow: var(--md-sys-elevation-1);
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.3);
    box-shadow: var(--md-sys-elevation-2);
}

.btn-small {
    height: 32px;
    padding: 0 var(--md-sys-spacing-md);
    font-size: var(--md-sys-typescale-label-medium-size);
}

.btn-large {
    height: 48px;
    padding: 0 var(--md-sys-spacing-xl);
    font-size: var(--md-sys-typescale-label-large-size);
}

/* =============================================================
   12. ФУТЕР (FOOTER)
   ============================================================= */

.footer {
    background-color: var(--md-sys-color-surface-container);
    padding: var(--md-sys-spacing-xl) 0;
    margin-top: var(--md-sys-spacing-4xl);
    border-top: 1px solid var(--md-sys-color-outline-variant);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--md-sys-spacing-md);
}

.footer-text {
    font-family: var(--md-sys-typescale-font-family);
    font-size: var(--md-sys-typescale-body-medium-size);
    color: var(--md-sys-color-on-surface-variant);
}

.footer-links {
    display: flex;
    gap: var(--md-sys-spacing-lg);
    flex-wrap: wrap;
}

.footer-links a {
    font-family: var(--md-sys-typescale-font-family);
    font-size: var(--md-sys-typescale-body-medium-size);
    color: var(--md-sys-color-on-surface-variant);
    padding: var(--md-sys-spacing-xs) var(--md-sys-spacing-sm);
    border-radius: var(--md-sys-shape-corner-small);
    transition: all var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
}

.footer-links a:hover {
    color: var(--md-sys-color-primary);
    background-color: var(--md-sys-state-hover);
}

/* =============================================================
   13. СТРАНИЦЫ ЗАДАНИЙ (TASK PAGES)
   ============================================================= */

/* Прогресс-бар */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--md-sys-color-primary), #4d79ff);
    z-index: 2000;
    transition: width 0.1s ease-out;
    box-shadow: 0 0 10px rgba(0, 97, 164, 0.4);
    border-radius: 0 0 var(--md-sys-shape-corner-small) 0;
}

/* Хлебные крошки */
.breadcrumbs {
    padding: var(--md-sys-spacing-md) 0;
    font-size: var(--md-sys-typescale-body-medium-size);
    color: var(--md-sys-color-on-surface-variant);
}

.breadcrumbs a {
    color: var(--md-sys-color-primary);
    text-decoration: none;
    transition: color var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
    display: inline-flex;
    align-items: center;
    gap: var(--md-sys-spacing-xs);
    padding: var(--md-sys-spacing-xs) var(--md-sys-spacing-sm);
    border-radius: var(--md-sys-shape-corner-small);
}

.breadcrumbs a:hover {
    color: var(--md-sys-color-primary);
    background-color: var(--md-sys-state-hover);
}

.breadcrumbs .separator {
    margin: 0 var(--md-sys-spacing-sm);
    opacity: 0.4;
}

/* Герой задания */
.task-hero {
    background: linear-gradient(135deg, var(--md-sys-color-primary-container) 0%, var(--md-sys-color-surface) 100%);
    padding: var(--md-sys-spacing-4xl) 0;
    text-align: center;
    border-radius: 0 0 var(--md-sys-shape-corner-extra-large) var(--md-sys-shape-corner-extra-large);
    margin-bottom: var(--md-sys-spacing-2xl);
    position: relative;
    overflow: hidden;
}

.task-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(0, 97, 164, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.task-hero-content {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    padding: 0 var(--md-sys-spacing-lg);
}

.task-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--md-sys-spacing-sm);
    padding: var(--md-sys-spacing-sm) var(--md-sys-spacing-lg);
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-full);
    font-size: var(--md-sys-typescale-label-large-size);
    font-weight: var(--md-sys-typescale-label-large-weight);
    color: var(--md-sys-color-primary);
    margin-bottom: var(--md-sys-spacing-lg);
    box-shadow: var(--md-sys-elevation-1);
    transition: all var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
}

.task-badge:hover {
    box-shadow: var(--md-sys-elevation-2);
    transform: translateY(-2px);
}

.task-hero-title,
.task-title-page {
    font-family: var(--md-sys-typescale-font-family);
    font-size: clamp(1.75rem, 5vw, var(--md-sys-typescale-display-large-size));
    font-weight: 400;
    color: var(--md-sys-color-on-background);
    margin-bottom: var(--md-sys-spacing-md);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.task-hero-title .highlight,
.task-title-page .highlight {
    font-weight: 600;
    background: linear-gradient(135deg, var(--md-sys-color-primary) 0%, #4d79ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.task-hero-subtitle,
.task-subtitle {
    font-size: clamp(var(--md-sys-typescale-body-large-size), 2.5vw, var(--md-sys-typescale-title-large-size));
    color: var(--md-sys-color-on-surface-variant);
    line-height: 1.6;
}

/* Основной контент */
.content-section {
    padding: var(--md-sys-spacing-2xl) 0;
}

.task-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 var(--md-sys-spacing-lg);
}

/* Вводная карточка */
.intro-card {
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-extra-large);
    padding: var(--md-sys-spacing-2xl);
    box-shadow: var(--md-sys-elevation-2);
    max-width: 800px;
    margin: 0 auto var(--md-sys-spacing-xl);
    transition: all var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-standard);
    border: 1px solid var(--md-sys-color-outline-variant);
}

.intro-card:hover {
    box-shadow: var(--md-sys-elevation-3);
}

.intro-card p {
    font-size: var(--md-sys-typescale-body-large-size);
    line-height: 1.7;
    color: var(--md-sys-color-on-surface);
    margin-bottom: var(--md-sys-spacing-md);
}

.intro-card strong {
    color: var(--md-sys-color-primary);
    font-weight: 600;
}

.intro-card .quote {
    background: var(--md-sys-color-primary-container);
    border-left: 3px solid var(--md-sys-color-primary);
    padding: var(--md-sys-spacing-md) var(--md-sys-spacing-lg);
    border-radius: var(--md-sys-shape-corner-medium);
    margin: var(--md-sys-spacing-lg) 0;
    font-style: italic;
    color: var(--md-sys-color-on-primary-container);
}

/* Секционные карточки */
.section-card {
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-large);
    padding: var(--md-sys-spacing-xl);
    margin-bottom: var(--md-sys-spacing-lg);
    box-shadow: var(--md-sys-elevation-1);
    border: 1px solid var(--md-sys-color-outline-variant);
    transition: all var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-standard);
}

.section-card:hover {
    box-shadow: var(--md-sys-elevation-2);
}

.section-card h3 {
    font-family: var(--md-sys-typescale-font-family);
    font-size: var(--md-sys-typescale-headline-medium-size);
    font-weight: var(--md-sys-typescale-headline-medium-weight);
    color: var(--md-sys-color-on-surface);
    margin-bottom: var(--md-sys-spacing-md);
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-sm);
}

.section-card p,
.section-card li {
    font-family: var(--md-sys-typescale-font-family);
    font-size: var(--md-sys-typescale-body-large-size);
    color: var(--md-sys-color-on-surface-variant);
    line-height: 1.7;
    margin-bottom: var(--md-sys-spacing-sm);
}

.section-card ul {
    padding-left: var(--md-sys-spacing-lg);
    margin: var(--md-sys-spacing-md) 0;
}

.section-card li {
    margin-bottom: var(--md-sys-spacing-xs);
    position: relative;
}

.section-card li::marker {
    color: var(--md-sys-color-primary);
}

/* =============================================================
   14. ПРАВИЛА И ТИПЫ (RULES & TYPES)
   ============================================================= */

.rules-grid,
.types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--md-sys-spacing-xl);
    margin: var(--md-sys-spacing-xl) 0;
}

.rule-card,
.type-card {
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-extra-large);
    padding: var(--md-sys-spacing-xl);
    box-shadow: var(--md-sys-elevation-1);
    transition: all var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-emphasized);
    border: 1px solid var(--md-sys-color-outline-variant);
}

.rule-card:hover,
.type-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--md-sys-elevation-3);
    border-color: var(--md-sys-color-primary);
}

.rule-card:active,
.type-card:active {
    transform: translateY(-2px);
    box-shadow: var(--md-sys-elevation-2);
}

.rule-icon,
.type-icon {
    font-size: 3rem;
    margin-bottom: var(--md-sys-spacing-md);
    display: inline-block;
    transition: transform var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-emphasized);
}

.rule-card:hover .rule-icon,
.type-card:hover .type-icon {
    transform: scale(1.15) rotate(-5deg);
}

.rule-title,
.type-title {
    font-size: var(--md-sys-typescale-title-large-size);
    font-weight: 600;
    color: var(--md-sys-color-on-surface);
    margin-bottom: var(--md-sys-spacing-md);
}

.rule-description,
.type-description {
    font-size: var(--md-sys-typescale-body-large-size);
    color: var(--md-sys-color-on-surface-variant);
    line-height: 1.6;
    margin-bottom: var(--md-sys-spacing-md);
}

/* =============================================================
   15. АЛФАВИТ (ALPHABET)
   ============================================================= */

.alphabet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: var(--md-sys-spacing-sm);
    margin: var(--md-sys-spacing-lg) 0;
}

.alphabet-item {
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-medium);
    padding: var(--md-sys-spacing-sm);
    text-align: center;
    box-shadow: var(--md-sys-elevation-1);
    transition: all var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-emphasized);
    cursor: pointer;
    border: 1px solid var(--md-sys-color-outline-variant);
}

.alphabet-item:hover {
    transform: scale(1.05);
    box-shadow: var(--md-sys-elevation-2);
    border-color: var(--md-sys-color-primary);
}

.alphabet-item:active {
    transform: scale(0.95);
    box-shadow: var(--md-sys-elevation-1);
}

.alphabet-letter {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--md-sys-color-on-surface);
    display: block;
}

.alphabet-number {
    font-size: 0.7rem;
    color: var(--md-sys-color-on-surface-variant);
    display: block;
    margin-top: 2px;
}

.alphabet-item.highlight {
    background: linear-gradient(135deg, var(--md-sys-color-primary), #4d79ff);
    box-shadow: var(--md-sys-elevation-2), 0 0 20px rgba(0, 97, 164, 0.3);
    border-color: transparent;
}

.alphabet-item.highlight .alphabet-letter,
.alphabet-item.highlight .alphabet-number {
    color: var(--md-sys-color-on-primary);
}

/* =============================================================
   16. ТАБЛИЦЫ КОДИРОВОК (ENCODING TABLE)
   ============================================================= */

.encoding-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: var(--md-sys-spacing-md) 0;
    border-radius: var(--md-sys-shape-corner-large);
    overflow: hidden;
    box-shadow: var(--md-sys-elevation-1);
    background: var(--md-sys-color-surface);
}

.encoding-table th {
    background: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    padding: var(--md-sys-spacing-md);
    text-align: center;
    font-weight: 600;
    font-size: var(--md-sys-typescale-label-large-size);
    letter-spacing: var(--md-sys-typescale-label-large-tracking);
}

.encoding-table td {
    background: var(--md-sys-color-surface);
    padding: var(--md-sys-spacing-md);
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    color: var(--md-sys-color-on-surface);
    text-align: center;
    font-family: 'Courier New', monospace;
    font-weight: 500;
    font-size: var(--md-sys-typescale-body-medium-size);
}

.encoding-table tr:last-child td {
    border-bottom: none;
}

.encoding-table tr:hover td {
    background: var(--md-sys-color-surface-container-low);
}

/* =============================================================
   17. ПОШАГОВЫЕ ИНСТРУКЦИИ (STEPS)
   ============================================================= */

.steps-container {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    padding-left: 20px;
}

.steps-container::before {
    content: '';
    position: absolute;
    left: 30px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--md-sys-color-primary), #4d79ff);
    border-radius: var(--md-sys-shape-corner-full);
    opacity: 0.3;
}

.step-card {
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-extra-large);
    padding: var(--md-sys-spacing-xl);
    margin-bottom: var(--md-sys-spacing-lg);
    margin-left: 70px;
    box-shadow: var(--md-sys-elevation-1);
    position: relative;
    transition: all var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-emphasized);
    border: 1px solid var(--md-sys-color-outline-variant);
}

.step-card:hover {
    transform: translateX(6px);
    box-shadow: var(--md-sys-elevation-3);
    border-color: var(--md-sys-color-primary);
}

.step-number {
    position: absolute;
    left: -70px;
    top: var(--md-sys-spacing-xl);
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--md-sys-color-primary), #4d79ff);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--md-sys-color-on-primary);
    box-shadow: var(--md-sys-elevation-2), 0 6px 16px rgba(0, 97, 164, 0.4);
    transition: all var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-emphasized);
}

.step-card:hover .step-number {
    transform: scale(1.1) rotate(5deg);
    box-shadow: var(--md-sys-elevation-3), 0 8px 20px rgba(0, 97, 164, 0.5);
}

.step-title {
    font-size: var(--md-sys-typescale-title-large-size);
    font-weight: 600;
    color: var(--md-sys-color-on-surface);
    margin-bottom: var(--md-sys-spacing-md);
}

.step-description {
    font-size: var(--md-sys-typescale-body-large-size);
    color: var(--md-sys-color-on-surface-variant);
    line-height: 1.6;
    margin-bottom: var(--md-sys-spacing-md);
}

/* =============================================================
   18. ПРИМЕРЫ (EXAMPLES)
   ============================================================= */

.examples-container {
    display: flex;
    flex-direction: column;
    gap: var(--md-sys-spacing-xl);
    max-width: 1000px;
    margin: var(--md-sys-spacing-xl) auto;
}

.example-card {
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-extra-large);
    overflow: hidden;
    box-shadow: var(--md-sys-elevation-1);
    transition: all var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-emphasized);
    border: 1px solid var(--md-sys-color-outline-variant);
}

.example-card:hover {
    box-shadow: var(--md-sys-elevation-3);
    border-color: var(--md-sys-color-primary);
}

.example-header {
    padding: var(--md-sys-spacing-lg) var(--md-sys-spacing-xl);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
    user-select: none;
    background: var(--md-sys-color-surface);
}

.example-header:hover {
    background: var(--md-sys-state-hover);
}

.example-title {
    font-size: var(--md-sys-typescale-title-large-size);
    font-weight: 500;
    color: var(--md-sys-color-on-surface);
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-md);
    flex-wrap: wrap;
}

.example-difficulty {
    display: inline-block;
    padding: var(--md-sys-spacing-xs) var(--md-sys-spacing-md);
    border-radius: var(--md-sys-shape-corner-full);
    font-size: var(--md-sys-typescale-label-medium-size);
    font-weight: var(--md-sys-typescale-label-medium-weight);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--md-sys-color-surface-container-high);
    color: var(--md-sys-color-primary);
}

.example-toggle {
    width: 40px;
    height: 40px;
    background: var(--md-sys-color-surface-container-high);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--md-sys-color-on-surface);
    font-size: 1.5rem;
    transition: all var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-emphasized);
    box-shadow: var(--md-sys-elevation-1);
    flex-shrink: 0;
}

.example-card.open .example-toggle {
    transform: rotate(45deg);
    background: linear-gradient(135deg, var(--md-sys-color-primary), #4d79ff);
    color: var(--md-sys-color-on-primary);
    box-shadow: var(--md-sys-elevation-2);
}

.example-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.example-card.open .example-content {
    max-height: 5000px;
}

.example-body {
    padding: var(--md-sys-spacing-xl);
    border-top: 1px solid var(--md-sys-color-outline-variant);
}

.example-task {
    background: var(--md-sys-color-primary-container);
    border-left: 3px solid var(--md-sys-color-primary);
    padding: var(--md-sys-spacing-md) var(--md-sys-spacing-lg);
    border-radius: var(--md-sys-shape-corner-medium);
    margin-bottom: var(--md-sys-spacing-lg);
    font-style: italic;
    color: var(--md-sys-color-on-primary-container);
    line-height: 1.6;
}

.example-task strong {
    color: var(--md-sys-color-primary);
    font-style: normal;
}

.solution-step {
    padding: var(--md-sys-spacing-md) 0;
    border-bottom: 1px dashed var(--md-sys-color-outline-variant);
    display: flex;
    gap: var(--md-sys-spacing-md);
    align-items: flex-start;
}

.solution-step:last-child {
    border-bottom: none;
}

.step-emoji {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.solution-text {
    flex-grow: 1;
    color: var(--md-sys-color-on-surface-variant);
    line-height: 1.6;
}

.solution-text strong {
    color: var(--md-sys-color-on-surface);
    font-weight: 600;
}

.solution-text .symbol-list {
    margin: var(--md-sys-spacing-sm) 0;
    padding-left: var(--md-sys-spacing-lg);
}

.solution-text .symbol-list li {
    margin-bottom: var(--md-sys-spacing-xs);
}

.code-block {
    background: var(--md-sys-color-surface-container-lowest);
    border-radius: var(--md-sys-shape-corner-medium);
    padding: var(--md-sys-spacing-md);
    font-family: 'Courier New', monospace;
    font-size: var(--md-sys-typescale-body-medium-size);
    color: var(--md-sys-color-primary);
    margin: var(--md-sys-spacing-sm) 0;
    border-left: 3px solid var(--md-sys-color-primary);
    word-break: break-all;
    overflow-x: auto;
    box-shadow: var(--md-sys-elevation-1);
}

/* =============================================================
   19. БЛОК ОТВЕТА (ANSWER BOX)
   ============================================================= */

.answer-box {
    background: linear-gradient(135deg, var(--md-sys-color-primary), #4d79ff);
    color: var(--md-sys-color-on-primary);
    padding: var(--md-sys-spacing-lg);
    border-radius: var(--md-sys-shape-corner-large);
    text-align: center;
    font-size: var(--md-sys-typescale-title-large-size);
    font-weight: 700;
    margin-top: var(--md-sys-spacing-lg);
    box-shadow: var(--md-sys-elevation-2), 0 0 30px rgba(0, 97, 164, 0.3);
    animation: pulseAnswer 2s ease-in-out infinite;
}

@keyframes pulseAnswer {
    0%, 100% {
        transform: scale(1);
        box-shadow: var(--md-sys-elevation-2), 0 0 30px rgba(0, 97, 164, 0.3);
    }
    50% {
        transform: scale(1.02);
        box-shadow: var(--md-sys-elevation-3), 0 0 40px rgba(0, 97, 164, 0.5);
    }
}

/* =============================================================
   20. СПИСОК СИМВОЛОВ (SYMBOL LIST)
   ============================================================= */

.symbol-list {
    list-style: none;
    margin: var(--md-sys-spacing-sm) 0;
}

.symbol-list li {
    padding: var(--md-sys-spacing-xs) 0;
    padding-left: var(--md-sys-spacing-xl);
    position: relative;
    color: var(--md-sys-color-on-surface-variant);
    font-size: var(--md-sys-typescale-body-large-size);
    line-height: 1.6;
}

.symbol-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--md-sys-color-primary);
    font-weight: 600;
}

/* =============================================================
   21. ИНФОРМАЦИОННЫЕ БЛОКИ (INFO BOX)
   ============================================================= */

.info-box {
    background: var(--md-sys-color-primary-container);
    border-radius: var(--md-sys-shape-corner-medium);
    padding: var(--md-sys-spacing-md) var(--md-sys-spacing-lg);
    margin: var(--md-sys-spacing-md) 0;
    color: var(--md-sys-color-on-primary-container);
    font-weight: 500;
    border-left: 3px solid var(--md-sys-color-primary);
    box-shadow: var(--md-sys-elevation-1);
}

.info-box strong {
    color: var(--md-sys-color-primary);
}

/* =============================================================
   22. БЛОК ФОРМУЛ (FORMULA BOX)
   ============================================================= */

.formula-box {
    background: var(--md-sys-color-surface-container-lowest);
    border-radius: var(--md-sys-shape-corner-medium);
    padding: var(--md-sys-spacing-md) var(--md-sys-spacing-lg);
    margin: var(--md-sys-spacing-md) 0;
    font-family: 'Courier New', monospace;
    font-size: var(--md-sys-typescale-body-large-size);
    font-weight: 500;
    color: var(--md-sys-color-primary);
    box-shadow: var(--md-sys-elevation-1);
    text-align: center;
    border: 1px solid var(--md-sys-color-outline-variant);
}

/* =============================================================
   23. СЕТКА СЛОВ (WORD LIST)
   ============================================================= */

.word-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: var(--md-sys-spacing-sm);
    margin: var(--md-sys-spacing-md) 0;
}

.word-item {
    background: var(--md-sys-color-surface);
    padding: var(--md-sys-spacing-sm) var(--md-sys-spacing-md);
    border-radius: var(--md-sys-shape-corner-medium);
    font-size: var(--md-sys-typescale-body-medium-size);
    color: var(--md-sys-color-on-surface-variant);
    box-shadow: var(--md-sys-elevation-1);
    text-align: center;
    transition: all var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-emphasized);
    border: 1px solid var(--md-sys-color-outline-variant);
}

.word-item:hover {
    box-shadow: var(--md-sys-elevation-2);
    transform: scale(1.03);
    border-color: var(--md-sys-color-primary);
}

.word-item.answer {
    background: linear-gradient(135deg, var(--md-sys-color-primary), #4d79ff);
    color: var(--md-sys-color-on-primary);
    box-shadow: var(--md-sys-elevation-2), 0 0 20px rgba(0, 97, 164, 0.3);
    font-weight: 700;
    transform: scale(1.05);
    border-color: transparent;
}

/* =============================================================
   24. ЛОВУШКИ (TRAPS)
   ============================================================= */

.traps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--md-sys-spacing-xl);
    margin: var(--md-sys-spacing-xl) 0;
}

.trap-card {
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-extra-large);
    padding: var(--md-sys-spacing-xl);
    box-shadow: var(--md-sys-elevation-1);
    border-left: 4px solid var(--md-sys-color-error);
    transition: all var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-emphasized);
    position: relative;
    overflow: hidden;
    border-top: 1px solid var(--md-sys-color-outline-variant);
    border-right: 1px solid var(--md-sys-color-outline-variant);
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.trap-card::before {
    content: '⚠️';
    position: absolute;
    top: -20px;
    right: -20px;
    font-size: 5rem;
    opacity: 0.05;
}

.trap-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--md-sys-elevation-3);
}

.trap-card:active {
    transform: translateY(-2px);
    box-shadow: var(--md-sys-elevation-2);
}

.trap-title {
    font-size: var(--md-sys-typescale-title-large-size);
    font-weight: 700;
    color: var(--md-sys-color-error);
    margin-bottom: var(--md-sys-spacing-md);
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-sm);
}

.trap-description {
    font-size: var(--md-sys-typescale-body-large-size);
    color: var(--md-sys-color-on-surface-variant);
    line-height: 1.6;
    margin-bottom: var(--md-sys-spacing-md);
}

.trap-solution {
    background: var(--md-sys-color-primary-container);
    padding: var(--md-sys-spacing-md);
    border-radius: var(--md-sys-shape-corner-medium);
    color: var(--md-sys-color-on-primary-container);
    font-weight: 500;
    font-size: var(--md-sys-typescale-body-medium-size);
    border-left: 3px solid var(--md-sys-color-primary);
    box-shadow: var(--md-sys-elevation-1);
}

.trap-solution strong {
    color: var(--md-sys-color-primary);
}

/* =============================================================
   25. ЧЕК-ЛИСТ (CHECKLIST)
   ============================================================= */

.checklist {
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-extra-large);
    padding: var(--md-sys-spacing-2xl);
    max-width: 700px;
    margin: var(--md-sys-spacing-xl) auto;
    box-shadow: var(--md-sys-elevation-2);
    border: 1px solid var(--md-sys-color-outline-variant);
}

.checklist-title {
    font-size: var(--md-sys-typescale-title-large-size);
    font-weight: 600;
    color: var(--md-sys-color-on-surface);
    margin-bottom: var(--md-sys-spacing-lg);
    text-align: center;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-md);
    padding: var(--md-sys-spacing-md);
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-medium);
    margin-bottom: var(--md-sys-spacing-sm);
    cursor: pointer;
    transition: all var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
    box-shadow: var(--md-sys-elevation-1);
    user-select: none;
    border: 1px solid var(--md-sys-color-outline-variant);
}

.checklist-item:hover {
    box-shadow: var(--md-sys-elevation-2);
    transform: translateX(4px);
    border-color: var(--md-sys-color-primary);
}

.checklist-item.checked {
    background: var(--md-sys-color-primary-container);
    border-color: var(--md-sys-color-primary);
}

.checklist-item.checked .checklist-text {
    text-decoration: line-through;
    opacity: 0.6;
}

.checklist-checkbox {
    width: 28px;
    height: 28px;
    border: 2px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-small);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-emphasized);
    background: var(--md-sys-color-surface);
    box-shadow: var(--md-sys-elevation-1);
}

.checklist-item.checked .checklist-checkbox {
    background: linear-gradient(135deg, var(--md-sys-color-primary), #4d79ff);
    border-color: var(--md-sys-color-primary);
    transform: scale(1.1);
    box-shadow: var(--md-sys-elevation-2);
}

.checklist-checkbox::after {
    content: '✓';
    color: var(--md-sys-color-on-primary);
    font-weight: 700;
    font-size: 1.2rem;
    opacity: 0;
    transform: scale(0);
    transition: all var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-emphasized);
}

.checklist-item.checked .checklist-checkbox::after {
    opacity: 1;
    transform: scale(1);
}

.checklist-text {
    flex-grow: 1;
    color: var(--md-sys-color-on-surface);
    font-size: var(--md-sys-typescale-body-large-size);
    transition: all var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
}

/* =============================================================
   26. КАРТОЧКИ ПАМЯТИ (MEMORY CARDS)
   ============================================================= */

.memory-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--md-sys-spacing-xl);
    max-width: 1000px;
    margin: var(--md-sys-spacing-xl) auto;
}

.memory-card {
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-extra-large);
    padding: var(--md-sys-spacing-xl);
    box-shadow: var(--md-sys-elevation-1);
    transition: all var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-emphasized);
    border: 1px solid var(--md-sys-color-outline-variant);
}

.memory-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--md-sys-elevation-3);
    border-color: var(--md-sys-color-primary);
}

.memory-card:active {
    transform: translateY(-2px);
    box-shadow: var(--md-sys-elevation-2);
}

.memory-title {
    font-size: var(--md-sys-typescale-title-large-size);
    font-weight: 600;
    color: var(--md-sys-color-primary);
    margin-bottom: var(--md-sys-spacing-lg);
    text-align: center;
}

/* =============================================================
   27. СЕКЦИЯ УСПЕХА (SUCCESS SECTION)
   ============================================================= */

.success-section {
    background: linear-gradient(135deg, var(--md-sys-color-primary-container) 0%, var(--md-sys-color-surface) 100%);
    padding: var(--md-sys-spacing-4xl) 0;
    text-align: center;
    margin-top: var(--md-sys-spacing-3xl);
    box-shadow: var(--md-sys-elevation-2);
    border-radius: var(--md-sys-shape-corner-extra-large) var(--md-sys-shape-corner-extra-large) 0 0;
    position: relative;
    overflow: hidden;
}

.success-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(0, 97, 164, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.success-content {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    padding: 0 var(--md-sys-spacing-lg);
}

.success-emoji {
    font-size: 4.5rem;
    display: inline-block;
    margin-bottom: var(--md-sys-spacing-lg);
    animation: floatEmoji 3s ease-in-out infinite;
}

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

.success-title {
    font-size: clamp(var(--md-sys-typescale-headline-medium-size), 5vw, var(--md-sys-typescale-display-small-size));
    font-weight: 400;
    color: var(--md-sys-color-on-background);
    margin-bottom: var(--md-sys-spacing-md);
}

.success-title .highlight {
    font-weight: 600;
    background: linear-gradient(135deg, var(--md-sys-color-primary), #4d79ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.success-text {
    font-size: var(--md-sys-typescale-body-large-size);
    color: var(--md-sys-color-on-surface-variant);
    line-height: 1.6;
    margin-bottom: var(--md-sys-spacing-xl);
}

/* =============================================================
   28. НАВИГАЦИОННЫЕ КНОПКИ (NAV BUTTONS)
   ============================================================= */

.nav-buttons {
    display: flex;
    justify-content: space-between;
    gap: var(--md-sys-spacing-md);
    max-width: 1000px;
    margin: var(--md-sys-spacing-2xl) auto 0;
    flex-wrap: wrap;
    padding: 0 var(--md-sys-spacing-lg);
}

.nav-button {
    flex: 1;
    min-width: 200px;
    padding: var(--md-sys-spacing-lg) var(--md-sys-spacing-xl);
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-extra-large);
    text-decoration: none;
    color: var(--md-sys-color-on-surface);
    box-shadow: var(--md-sys-elevation-1);
    transition: all var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-emphasized);
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-md);
    border: 1px solid var(--md-sys-color-outline-variant);
}

.nav-button:hover {
    transform: translateY(-4px);
    box-shadow: var(--md-sys-elevation-3);
    border-color: var(--md-sys-color-primary);
}

.nav-button:active {
    transform: translateY(-1px);
    box-shadow: var(--md-sys-elevation-2);
}

.nav-button-icon {
    font-size: 2rem;
}

.nav-button-text {
    display: flex;
    flex-direction: column;
}

.nav-button-label {
    font-size: var(--md-sys-typescale-label-small-size);
    color: var(--md-sys-color-on-surface-variant);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 2px;
}

.nav-button-title {
    font-size: var(--md-sys-typescale-title-medium-size);
    font-weight: 600;
    color: var(--md-sys-color-primary);
}

/* =============================================================
   29. КНОПКА "НАВЕРХ" (BACK TO TOP)
   ============================================================= */

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 52px;
    height: 52px;
    background: var(--md-sys-color-surface);
    border: none;
    border-radius: 50%;
    color: var(--md-sys-color-primary);
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--md-sys-elevation-2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.8);
    transition: all var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-emphasized);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--md-sys-color-outline-variant);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.back-to-top:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: var(--md-sys-elevation-3);
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
}

.back-to-top:active {
    transform: scale(0.95);
    box-shadow: var(--md-sys-elevation-2);
}

/* =============================================================
   30. АНИМАЦИИ (ANIMATIONS)
   ============================================================= */

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

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

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

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

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.animate-fade-in {
    animation: fadeIn var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-standard);
}

.animate-slide-up {
    animation: slideUp var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-standard);
}

.animate-scale-in {
    animation: scaleIn var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-standard);
}

/* =============================================================
   31. АДАПТИВНОСТЬ (RESPONSIVE)
   ============================================================= */

/* Планшеты */
@media (max-width: 992px) {
    .hero-stats {
        gap: var(--md-sys-spacing-md);
    }

    .stat {
        min-width: 100px;
        padding: var(--md-sys-spacing-md);
    }

    .tasks-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .rules-grid,
    .types-grid,
    .traps-grid {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    }
}

/* Мобильные */
@media (max-width: 768px) {
    .container {
        padding: 0 var(--md-sys-spacing-md);
    }

    .header-content {
        min-height: 56px;
        padding: var(--md-sys-spacing-sm) 0;
    }

    .menu-toggle {
        display: flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--md-sys-color-surface);
        flex-direction: column;
        padding: var(--md-sys-spacing-md);
        gap: var(--md-sys-spacing-sm);
        box-shadow: var(--md-sys-elevation-3);
        border-bottom: 1px solid var(--md-sys-color-outline-variant);
        border-radius: 0 0 var(--md-sys-shape-corner-medium) var(--md-sys-shape-corner-medium);
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links a {
        padding: var(--md-sys-spacing-sm) 0;
        font-size: var(--md-sys-typescale-body-large-size);
        width: 100%;
    }

    .hero {
        padding: var(--md-sys-spacing-2xl) 0;
    }

    .hero-title {
        font-size: var(--md-sys-typescale-headline-large-size);
    }

    .hero-subtitle {
        font-size: var(--md-sys-typescale-body-medium-size);
        margin-bottom: var(--md-sys-spacing-md);
    }

    .hero-actions {
        flex-direction: column;
        align-items: center;
        gap: var(--md-sys-spacing-sm);
    }

    .btn {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }

    .hero-stats {
        flex-direction: row;
        flex-wrap: wrap;
        gap: var(--md-sys-spacing-sm);
    }

    .stat {
        flex: 1;
        min-width: 80px;
        padding: var(--md-sys-spacing-sm);
    }

    .stat-number {
        font-size: var(--md-sys-typescale-headline-small-size);
    }

    .section {
        padding: var(--md-sys-spacing-xl) 0;
    }

    .section-header {
        margin-bottom: var(--md-sys-spacing-lg);
    }

    .section-heading,
    .section-title {
        font-size: var(--md-sys-typescale-headline-medium-size);
    }

    .tasks-grid {
        grid-template-columns: 1fr;
        gap: var(--md-sys-spacing-md);
    }

    .task-card {
        padding: var(--md-sys-spacing-md);
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: var(--md-sys-spacing-md);
    }

    .feature-card {
        padding: var(--md-sys-spacing-lg);
    }

    .feature-icon {
        font-size: 2.5rem;
    }

    .rules-grid,
    .types-grid,
    .traps-grid {
        grid-template-columns: 1fr;
        gap: var(--md-sys-spacing-md);
    }

    .cta-section {
        padding: var(--md-sys-spacing-lg);
        margin: var(--md-sys-spacing-lg) 0;
    }

    .cta-actions {
        flex-direction: column;
        align-items: center;
    }

    .footer {
        padding: var(--md-sys-spacing-md) 0;
        margin-top: var(--md-sys-spacing-xl);
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: var(--md-sys-spacing-sm);
    }

    .footer-links {
        flex-direction: column;
        gap: var(--md-sys-spacing-sm);
    }

    /* Задания */
    .steps-container::before {
        left: 20px;
    }

    .step-card {
        margin-left: 50px;
    }

    .step-number {
        left: -50px;
        width: 48px;
        height: 48px;
        font-size: 1.5rem;
    }

    .example-header {
        padding: var(--md-sys-spacing-md);
    }

    .example-title {
        font-size: var(--md-sys-typescale-title-medium-size);
        flex-wrap: wrap;
    }

    .alphabet-grid {
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    }

    .nav-buttons {
        flex-direction: column;
        padding: 0 var(--md-sys-spacing-md);
    }

    .nav-button {
        width: 100%;
    }

    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 48px;
        height: 48px;
        font-size: 1.2rem;
    }

    .word-list {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    }

    .memory-section {
        grid-template-columns: 1fr;
    }

    .intro-card {
        padding: var(--md-sys-spacing-lg);
    }

    .section-card {
        padding: var(--md-sys-spacing-lg);
    }

    .checklist {
        padding: var(--md-sys-spacing-lg);
    }
}

/* Очень маленькие экраны */
@media (max-width: 480px) {
    .hero-title {
        font-size: var(--md-sys-typescale-headline-small-size);
    }

    .logo-text {
        font-size: 1rem;
    }

    .hero-stats {
        gap: var(--md-sys-spacing-xs);
    }

    .stat-number {
        font-size: var(--md-sys-typescale-title-large-size);
    }

    .stat-label {
        font-size: 0.65rem;
    }

    .btn {
        max-width: 100%;
    }

    .steps-container::before {
        display: none;
    }

    .step-card {
        margin-left: 0;
    }

    .step-number {
        position: relative;
        left: 0;
        top: 0;
        margin-bottom: var(--md-sys-spacing-md);
    }

    .example-body {
        padding: var(--md-sys-spacing-md);
    }

    .solution-step {
        flex-direction: column;
        gap: var(--md-sys-spacing-xs);
    }

    .alphabet-grid {
        grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    }

    .alphabet-letter {
        font-size: 1rem;
    }

    .task-hero-title,
    .task-title-page {
        font-size: var(--md-sys-typescale-headline-medium-size);
    }

    .rule-card,
    .type-card,
    .trap-card,
    .memory-card {
        padding: var(--md-sys-spacing-lg);
    }
}

/* =============================================================
   32. ДОСТУПНОСТЬ (ACCESSIBILITY)
   ============================================================= */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

*:focus-visible {
    outline: 2px solid var(--md-sys-color-primary);
    outline-offset: 2px;
    border-radius: var(--md-sys-shape-corner-small);
}

/* =============================================================
   33. СКРОЛЛБАР (SCROLLBAR)
   ============================================================= */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--md-sys-color-surface-container);
    border-radius: var(--md-sys-shape-corner-full);
}

::-webkit-scrollbar-thumb {
    background: var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--md-sys-color-primary);
}

/* =============================================================
   34. ВЫДЕЛЕНИЕ ТЕКСТА (TEXT SELECTION)
   ============================================================= */

::selection {
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
}

/* =============================================================
   35. ПЕЧАТЬ (PRINT)
   ============================================================= */

@media print {
    .header,
    .footer,
    .hero-actions,
    .cta-section,
    .menu-toggle,
    .back-to-top,
    .progress-bar,
    .nav-buttons,
    .theme-toggle {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .task-card,
    .feature-card,
    .stat,
    .rule-card,
    .type-card,
    .trap-card,
    .memory-card,
    .example-card,
    .intro-card,
    .checklist,
    .task-hero,
    .section-card,
    .step-card {
        background: white !important;
        box-shadow: none !important;
        border: 1px solid #ccc !important;
        break-inside: avoid;
    }

    .encoding-table th,
    .encoding-table td {
        background: white !important;
        border: 1px solid #ccc !important;
    }

    .alphabet-item {
        background: white !important;
        border: 1px solid #ccc !important;
    }

    .answer-box {
        background: #e0e5ec !important;
        color: black !important;
    }

    a {
        color: black !important;
        text-decoration: underline !important;
    }
}