:root {
    --bg: #0f1419;
    --bg-elevated: #171e27;
    --bg-card: #1c2530;
    --border: #2a3544;
    --text: #e8eef5;
    --text-muted: #9aa8b8;
    --accent: #3d9cf5;
    --accent-soft: rgba(61, 156, 245, 0.15);
    --accent-2: #5ee0b0;
    --danger: #f07178;
    --warning: #e6b450;
    --success: #5ee0b0;
    --radius: 14px;
    --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    --font: "Manrope", system-ui, sans-serif;
    --mono: "JetBrains Mono", monospace;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--font);
    background: radial-gradient(ellipse 120% 80% at 10% -20%, #1a2a42 0%, var(--bg) 55%);
    color: var(--text);
    line-height: 1.6;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.container {
    width: min(1100px, 92vw);
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    background: rgba(15, 20, 25, 0.85);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
}

.logo:hover {
    text-decoration: none;
}

.logo-mark {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), #2563eb);
    font-size: 1.25rem;
    font-weight: 700;
}

.logo-text strong {
    color: var(--accent-2);
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    flex-wrap: wrap;
}

.main-nav a {
    color: var(--text-muted);
    font-weight: 500;
}

.main-nav a:hover,
.main-nav .nav-cabinet {
    color: var(--text);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1.2rem;
    border-radius: 10px;
    border: none;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s, background 0.15s;
}

.btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #2563eb);
    color: #fff;
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.btn-sm {
    padding: 0.45rem 0.9rem;
    font-size: 0.9rem;
}

.btn-block {
    width: 100%;
}

.flash-wrap {
    padding-top: 1rem;
}

.flash {
    padding: 0.85rem 1rem;
    border-radius: 10px;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border);
}

.flash-success {
    background: rgba(94, 224, 176, 0.12);
    border-color: rgba(94, 224, 176, 0.35);
    color: var(--success);
}

.flash-danger {
    background: rgba(240, 113, 120, 0.12);
    border-color: rgba(240, 113, 120, 0.35);
    color: var(--danger);
}

.flash-warning {
    background: rgba(230, 180, 80, 0.12);
    border-color: rgba(230, 180, 80, 0.35);
    color: var(--warning);
}

.flash-info {
    background: var(--accent-soft);
    color: var(--accent);
}

.page-main {
    flex: 1;
    padding-bottom: 4rem;
}

.hero {
    padding: 3rem 0 2rem;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 800px) {
    .hero-grid {
        grid-template-columns: 1fr;
    }
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 700;
    margin: 0 0 0.5rem;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 2.75rem);
    line-height: 1.15;
    margin: 0 0 1rem;
}

.lead {
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 52ch;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.hero-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.hero-card h2 {
    margin-top: 0;
    font-size: 1.1rem;
}

.steps-list {
    margin: 0;
    padding-left: 1.2rem;
    color: var(--text-muted);
}

.steps-list li + li {
    margin-top: 0.5rem;
}

.section {
    padding: 2.5rem 0;
}

.section-alt {
    background: rgba(0, 0, 0, 0.2);
    border-block: 1px solid var(--border);
}

.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.section-head h2 {
    margin: 0;
}

.link-more {
    font-weight: 600;
    white-space: nowrap;
}

.topic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.topic-card {
    display: block;
    padding: 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    transition: border-color 0.2s, transform 0.2s;
}

.topic-card:hover {
    text-decoration: none;
    border-color: var(--accent);
    transform: translateY(-3px);
}

.topic-grade {
    font-size: 0.75rem;
    color: var(--accent-2);
    font-weight: 700;
    text-transform: uppercase;
}

.topic-card h3 {
    margin: 0.5rem 0;
    font-size: 1.05rem;
}

.topic-link {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.topic-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.topic-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
}

.topic-list-item:hover {
    text-decoration: none;
    border-color: var(--accent);
}

.topic-list-item h2 {
    margin: 0 0 0.25rem;
    font-size: 1.15rem;
}

.topic-list-item p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.arrow {
    font-size: 1.25rem;
    color: var(--accent);
}

.page-head {
    padding: 2rem 0 1rem;
}

.page-head h1 {
    margin: 0.5rem 0;
    font-size: clamp(1.75rem, 4vw, 2.25rem);
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.breadcrumbs a {
    color: var(--text-muted);
}

.meta-badge {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 600;
}

.theory-block {
    padding-bottom: 2rem;
}

.section-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.prose h2,
.prose h3 {
    margin-top: 1.5rem;
}

.prose ul,
.prose ol {
    padding-left: 1.25rem;
}

.prose p {
    color: var(--text-muted);
}

.problems-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.problem-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
}

.problem-card header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.problem-num {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
}

.problem-card h3 {
    margin: 0;
    font-size: 1rem;
}

.problem-condition {
    color: var(--text);
    margin-bottom: 0.75rem;
}

.problem-solution {
    margin-top: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    background: rgba(94, 224, 176, 0.08);
    border: 1px solid rgba(94, 224, 176, 0.25);
    color: var(--text-muted);
}

.problem-solution.hidden {
    display: none;
}

.auth-page {
    display: flex;
    justify-content: center;
    padding: 2rem 0 3rem;
}

.auth-card {
    width: min(420px, 100%);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.auth-card h1 {
    margin: 0 0 0.35rem;
}

.auth-sub {
    color: var(--text-muted);
    margin: 0 0 1.5rem;
}

.auth-form label {
    display: block;
    margin-bottom: 1rem;
}

.auth-form label span {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.auth-form input {
    width: 100%;
    padding: 0.7rem 0.85rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font: inherit;
}

.auth-form input:focus {
    outline: 2px solid var(--accent);
    border-color: transparent;
}

.auth-footer {
    margin-top: 1.25rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.card-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.profile-dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.5rem 1.5rem;
    margin: 0;
}

.profile-dl dt {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.profile-dl dd {
    margin: 0;
}

.table-wrap {
    overflow-x: auto;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

.history-table th,
.history-table td {
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.history-table th {
    background: var(--bg-elevated);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.history-table tr:last-child td {
    border-bottom: none;
}

.score-badge {
    font-family: var(--mono);
    font-size: 0.9rem;
    color: var(--accent-2);
}

.empty-hint {
    color: var(--text-muted);
    padding: 1rem 0;
}

.site-footer {
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    margin-top: auto;
    background: rgba(0, 0, 0, 0.25);
}

.footer-inner {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.footer-title {
    margin: 0 0 0.35rem;
    font-weight: 700;
    color: var(--text);
    font-size: 1rem;
}

.footer-note {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.footer-thesis {
    margin: 0;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.5;
    max-width: 52ch;
}

/* ——— Личный кабинет ——— */

.cabinet-hero {
    padding: 2.5rem 0 1.5rem;
    background: linear-gradient(
        135deg,
        rgba(61, 156, 245, 0.12) 0%,
        rgba(94, 224, 176, 0.06) 50%,
        transparent 100%
    );
    border-bottom: 1px solid var(--border);
}

.cabinet-hero-inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1.5rem;
    align-items: center;
}

@media (max-width: 700px) {
    .cabinet-hero-inner {
        grid-template-columns: 1fr;
        text-align: center;
        justify-items: center;
    }
}

.cabinet-avatar {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), #2563eb);
    box-shadow: 0 8px 24px rgba(61, 156, 245, 0.35);
}

.cabinet-hero-text h1 {
    margin: 0.25rem 0 0.35rem;
    font-size: clamp(1.5rem, 4vw, 2rem);
}

.cabinet-hero-text .lead {
    margin: 0;
    font-size: 0.95rem;
}

.cabinet-stat {
    text-align: center;
    padding: 1rem 1.35rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-width: 120px;
}

.cabinet-stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    color: var(--accent-2);
    font-family: var(--mono);
}

.cabinet-stat-label {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.cabinet-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    padding-top: 2rem;
    padding-bottom: 1rem;
}

@media (max-width: 768px) {
    .cabinet-grid {
        grid-template-columns: 1fr;
    }
}

.cabinet-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.cabinet-card:hover {
    border-color: rgba(61, 156, 245, 0.4);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.cabinet-card-head {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
}

.cabinet-card-head h2 {
    margin: 0;
    font-size: 1.1rem;
}

.cabinet-card-icon {
    font-size: 1.25rem;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    background: var(--accent-soft);
    border-radius: 10px;
}

.cabinet-info-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cabinet-info-list li {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.cabinet-info-list li:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.cabinet-info-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.cabinet-info-value {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text);
}

.cabinet-info-date {
    font-family: var(--mono);
    color: var(--accent-2);
}

.cabinet-card-desc {
    margin: 0 0 1.25rem;
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.55;
}

.cabinet-quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.cabinet-quick-link {
    padding: 0.55rem 1rem;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    border: 1px solid transparent;
    transition: background 0.15s, border-color 0.15s;
}

.cabinet-quick-link:hover {
    text-decoration: none;
    background: rgba(61, 156, 245, 0.25);
    border-color: var(--accent);
}

.cabinet-history-section {
    padding-bottom: 3rem;
}

.cabinet-section-head {
    margin-bottom: 1.5rem;
}

.cabinet-section-sub {
    margin: 0.35rem 0 0;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.cabinet-history-table {
    box-shadow: var(--shadow);
}

.history-date {
    font-family: var(--mono);
    color: var(--text-muted);
    white-space: nowrap;
}

.history-grade {
    color: var(--text-muted);
    font-size: 0.88rem;
}

.cabinet-empty {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--bg-card);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}

.cabinet-empty-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.cabinet-empty h3 {
    margin: 0 0 0.5rem;
    font-size: 1.15rem;
}

.cabinet-empty p {
    margin: 0 auto;
    max-width: 36ch;
    color: var(--text-muted);
    font-size: 0.92rem;
}

/* ——— Тема: проверка знаний ——— */

.theory-outline h3 {
    margin-top: 1.35rem;
    margin-bottom: 0.5rem;
    font-size: 1.05rem;
    color: var(--accent);
}

.theory-outline h3:first-child {
    margin-top: 0;
}

.theory-outline ul {
    margin: 0.5rem 0 1rem;
    padding-left: 1.25rem;
    color: var(--text-muted);
}

.topic-checks {
    padding-top: 0.5rem;
    padding-bottom: 1rem;
}

.topic-checks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.topic-check-card {
    display: block;
    padding: 1.35rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    text-decoration: none;
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.topic-check-card:hover {
    text-decoration: none;
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.topic-check-test:hover {
    border-color: var(--accent);
}

.topic-check-control:hover {
    border-color: var(--accent-2);
}

.topic-check-icon {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 0.5rem;
}

.topic-check-card h3 {
    margin: 0 0 0.4rem;
    font-size: 1.05rem;
}

.topic-check-card p {
    margin: 0 0 0.85rem;
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.45;
}

.topic-check-btn {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
}

.topic-check-control .topic-check-btn {
    color: var(--accent-2);
}

.topic-checks-hint {
    margin-top: 1rem;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.badge-count {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.75rem;
    vertical-align: middle;
}

/* ——— Тесты и контрольные ——— */

.quiz-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 720px;
}

.quiz-question-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
}

.quiz-q-num {
    margin: 0 0 0.35rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
}

.quiz-q-text {
    margin: 0 0 1rem;
    font-size: 1.05rem;
    line-height: 1.45;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.quiz-option {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.7rem 0.85rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.quiz-option:hover {
    background: var(--accent-soft);
    border-color: rgba(61, 156, 245, 0.35);
}

.quiz-option input {
    margin-top: 0.2rem;
    accent-color: var(--accent);
}

.quiz-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.quiz-result-card {
    max-width: 480px;
    margin: 0 auto;
    text-align: center;
    padding: 2.5rem 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.quiz-result-score {
    margin: 0;
    font-size: 3rem;
    font-weight: 700;
    font-family: var(--mono);
    color: var(--accent-2);
    line-height: 1;
}

.quiz-result-percent {
    margin: 0.5rem 0 1rem;
    font-size: 1.25rem;
    color: var(--text-muted);
}

.quiz-result-msg {
    margin: 0 0 1.5rem;
    color: var(--text-muted);
}

/* ═══════════════════════════════════════
   Главная страница
   ═══════════════════════════════════════ */

.home-page {
    overflow-x: hidden;
}

.home-hero {
    position: relative;
    padding: 4rem 0 3rem;
    min-height: min(88vh, 720px);
    display: flex;
    align-items: center;
}

.home-hero-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.5;
    animation: orb-float 12s ease-in-out infinite;
}

.orb-1 {
    width: 320px;
    height: 320px;
    background: rgba(61, 156, 245, 0.35);
    top: -80px;
    right: 10%;
}

.orb-2 {
    width: 240px;
    height: 240px;
    background: rgba(94, 224, 176, 0.2);
    bottom: 10%;
    left: -60px;
    animation-delay: -4s;
}

.orb-3 {
    width: 180px;
    height: 180px;
    background: rgba(99, 102, 241, 0.25);
    top: 40%;
    left: 35%;
    animation-delay: -7s;
}

@keyframes orb-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(20px, -25px) scale(1.05); }
}

.float-formula {
    position: absolute;
    font-family: var(--mono);
    font-size: 0.85rem;
    color: rgba(154, 168, 184, 0.35);
    transition: transform 0.2s ease-out;
    user-select: none;
}

.f1 { top: 18%; right: 22%; }
.f2 { top: 55%; right: 8%; font-size: 1rem; }
.f3 { bottom: 25%; left: 12%; }
.f4 { top: 30%; left: 8%; }

.home-hero-inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 3rem;
    align-items: center;
}

@media (max-width: 900px) {
    .home-hero-inner {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .home-hero-actions {
        justify-content: center;
    }
    .home-lead {
        margin-left: auto;
        margin-right: auto;
    }
}

.home-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-2);
    box-shadow: 0 0 12px var(--accent-2);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

.home-title {
    font-size: clamp(2.25rem, 6vw, 3.25rem);
    line-height: 1.1;
    margin: 0 0 1.25rem;
    letter-spacing: -0.02em;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.home-lead {
    max-width: 48ch;
    font-size: 1.08rem;
}

.btn-glow {
    box-shadow: 0 4px 24px rgba(61, 156, 245, 0.4);
}

.btn-glow:hover {
    box-shadow: 0 6px 32px rgba(61, 156, 245, 0.55);
}

/* Атом */
.home-hero-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.atom-card {
    position: relative;
    width: 220px;
    height: 220px;
    display: grid;
    place-items: center;
}

.atom-core {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #7ee8fa, var(--accent));
    box-shadow: 0 0 30px rgba(61, 156, 245, 0.8);
    z-index: 2;
}

.orbit {
    position: absolute;
    border: 1px solid rgba(61, 156, 245, 0.25);
    border-radius: 50%;
    animation: orbit-spin 8s linear infinite;
}

.orbit-1 {
    width: 120px;
    height: 70px;
    transform: rotate(-20deg);
}

.orbit-2 {
    width: 170px;
    height: 100px;
    transform: rotate(40deg);
    animation-duration: 11s;
    animation-direction: reverse;
}

.orbit-3 {
    width: 200px;
    height: 120px;
    transform: rotate(75deg);
    animation-duration: 14s;
}

.atom-card.is-active .orbit {
    animation-duration: 2.5s;
}

.atom-card.is-active .orbit-2 {
    animation-duration: 3.5s;
}

.atom-card.is-active .orbit-3 {
    animation-duration: 4s;
}

.electron {
    position: absolute;
    top: 0;
    left: 50%;
    width: 10px;
    height: 10px;
    margin: -5px 0 0 -5px;
    border-radius: 50%;
    background: var(--accent-2);
    box-shadow: 0 0 10px var(--accent-2);
}

@keyframes orbit-spin {
    from { transform: rotate(var(--orbit-tilt, 0deg)); }
    to { transform: rotate(calc(var(--orbit-tilt, 0deg) + 360deg)); }
}

.orbit-1 { --orbit-tilt: -20deg; }
.orbit-2 { --orbit-tilt: 40deg; }
.orbit-3 { --orbit-tilt: 75deg; }

.atom-caption {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Статистика */
.home-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: -2rem;
    position: relative;
    z-index: 2;
    padding-bottom: 3rem;
}

@media (max-width: 768px) {
    .home-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

.stat-card {
    background: rgba(28, 37, 48, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.35rem 1rem;
    text-align: center;
    transition: border-color 0.2s, transform 0.2s;
}

.stat-card:hover {
    border-color: rgba(61, 156, 245, 0.4);
    transform: translateY(-2px);
}

.stat-num {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    font-family: var(--mono);
    color: var(--accent);
    line-height: 1.2;
}

.stat-label {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Шаги */
.home-steps {
    padding-bottom: 3rem;
}

.home-section-title {
    font-size: clamp(1.5rem, 3vw, 1.85rem);
    margin: 0 0 1.5rem;
    letter-spacing: -0.02em;
}

.steps-interactive {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.65rem;
    margin-bottom: 1rem;
}

@media (max-width: 700px) {
    .steps-interactive {
        grid-template-columns: repeat(2, 1fr);
    }
}

.step-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    padding: 1rem 1.1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-muted);
    font: inherit;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
}

.step-btn:hover {
    border-color: rgba(61, 156, 245, 0.35);
    color: var(--text);
}

.step-btn.active {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--text);
    box-shadow: 0 4px 20px rgba(61, 156, 245, 0.15);
}

.step-num {
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 600;
}

.step-title {
    font-size: 0.9rem;
    font-weight: 600;
}

.step-panel {
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, rgba(61, 156, 245, 0.08), rgba(94, 224, 176, 0.05));
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.step-panel-text {
    margin: 0;
    font-size: 1.02rem;
    color: var(--text-muted);
    line-height: 1.55;
    transition: opacity 0.15s;
}

/* Темы на главной */
.home-topics {
    padding-top: 1rem;
    padding-bottom: 3rem;
}

.home-topics-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.grade-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0.35rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.grade-tab {
    padding: 0.55rem 1.1rem;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.grade-tab:hover {
    color: var(--text);
}

.grade-tab.active {
    background: linear-gradient(135deg, var(--accent), #2563eb);
    color: #fff;
    box-shadow: 0 4px 16px rgba(61, 156, 245, 0.35);
}

.tab-count {
    font-size: 0.75rem;
    padding: 0.1rem 0.45rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.15);
}

.grade-tab:not(.active) .tab-count {
    background: var(--bg-elevated);
    color: var(--text-muted);
}

.grade-panel {
    animation: panel-in 0.35s ease;
}

.grade-panel[hidden] {
    display: none !important;
}

@keyframes panel-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.home-topic-grid {
    gap: 1rem;
}

.home-topic-card {
    position: relative;
    padding: 1.35rem 1.35rem 1.35rem 3.5rem;
    transition: transform 0.15s ease, border-color 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.home-topic-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    opacity: 0;
    transition: opacity 0.2s;
}

.home-topic-card:hover::before {
    opacity: 1;
}

.topic-card-num {
    position: absolute;
    left: 1rem;
    top: 1.25rem;
    font-family: var(--mono);
    font-size: 1.5rem;
    font-weight: 700;
    color: rgba(61, 156, 245, 0.25);
    line-height: 1;
}

.home-topic-card:hover .topic-card-num {
    color: rgba(61, 156, 245, 0.5);
}

.topic-card-meta {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0.35rem 0 0.5rem;
}

.topic-grade.grade-8 {
    color: #a78bfa;
}

.home-see-all {
    display: inline-block;
    margin-top: 1.25rem;
    font-weight: 600;
    font-size: 0.95rem;
}

/* CTA */
.home-cta {
    padding-bottom: 4rem;
}

.home-cta-card {
    text-align: center;
    padding: 2.5rem 2rem;
    border-radius: var(--radius);
    background: linear-gradient(
        135deg,
        rgba(61, 156, 245, 0.15) 0%,
        rgba(94, 224, 176, 0.08) 50%,
        rgba(28, 37, 48, 0.9) 100%
    );
    border: 1px solid rgba(61, 156, 245, 0.3);
    box-shadow: var(--shadow);
}

.home-cta-card h2 {
    margin: 0 0 0.5rem;
    font-size: 1.75rem;
}

.home-cta-card p {
    margin: 0 0 1.5rem;
    color: var(--text-muted);
    max-width: 40ch;
    margin-left: auto;
    margin-right: auto;
}

.home-cta-card .hero-actions {
    justify-content: center;
}

/* Появление при скролле */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    transition-delay: var(--delay, 0s);
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}
