html { scroll-behavior: smooth; }
body {
    font-family: 'Rubik', sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.header {
    padding: 20px 0;
    transition: background-color 0.3s ease;
    position: relative;
}
.avatar-wrapper {
    display: inline-block;
    width: 3cm;
    height: 3cm;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 3px solid rgba(0, 0, 0, 0.15);
    transition: border-color 0.3s ease;
}
.avatar-wrapper a { display: block; width: 100%; height: 100%; }
.avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.header-text { padding-left: 12px; }
.header-title {
    font-size: 1.5rem;
    margin-bottom: 8px;
    font-weight: 400;
    transition: color 0.3s ease;
    text-align: left;
}
.header-title strong { font-weight: 700; }
.header-subtitle {
    font-size: 1rem;
    margin-bottom: 6px;
    opacity: 0.85;
    transition: color 0.3s ease;
    text-align: left;
}
.typewriter {
    font-family: 'Courier New', 'Courier', 'Lucida Console', monospace;
    font-size: 0.95rem;
    line-height: 1.45;
    margin: 10px 0 14px 0;
    padding: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    min-height: 1.45em;
    transition: color 0.3s ease;
    text-align: left;
    opacity: 0.9;
    letter-spacing: 0.02em;
}
.typewriter.is-hidden {
    display: none;
}
.header-description {
    font-size: 0.95rem;
    margin-bottom: 0;
    opacity: 0.75;
    transition: color 0.3s ease;
    text-align: left;
}
.theme-btn {
    position: fixed;
    top: 20px;
    right: 26px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.15);
    background: #000000;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
    padding: 0;
    outline: none;
    z-index: 1000;
    flex-shrink: 0;
}
.theme-btn:hover { transform: scale(1.08); }
.theme-btn:active { transform: scale(0.94); }
.theme-btn .theme-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    display: block;
}

/* Светлая тема: видна луна, солнце скрыто */
body.theme-light .theme-btn .icon-moon { display: block; }
body.theme-light .theme-btn .icon-sun  { display: none !important; }

/* Тёмная тема: видно солнце, луна скрыта */
body.theme-dark .theme-btn .icon-moon { display: none !important; }
body.theme-dark .theme-btn .icon-sun  { display: block; }

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 26px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.15);
    background: #000000;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.2s ease, opacity 0.4s ease, visibility 0.4s ease;
    padding: 0;
    outline: none;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    flex-shrink: 0;
}
.back-to-top.visible { opacity: 1; visibility: visible; }
.back-to-top:hover { transform: scale(1.08); }
.back-to-top:active { transform: scale(0.94); }
.back-to-top svg { width: 24px; height: 24px; flex-shrink: 0; }
.main {
    flex: 1;
    padding: 40px 0;
    transition: background-color 0.3s ease;
}
.nav-link-wrapper {
    margin-bottom: 20px;
    padding-bottom: 0;
}
.nav-link-main {
    font-size: 0.85rem;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease, opacity 0.3s ease;
}
.nav-link-main:hover { opacity: 0.7; text-decoration: underline; }
.main-content { min-height: 300px; }
.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 30px;
    margin-bottom: 16px;
    transition: color 0.3s ease;
}
.section-title:first-of-type { margin-top: 0; }
.content-list {
    list-style-type: disc;
    padding-left: 24px;
    margin-bottom: 30px;
    transition: color 0.3s ease;
}
.content-list li {
    margin-bottom: 12px;
    line-height: 1.6;
    transition: color 0.3s ease;
}
.content-list li:last-child { margin-bottom: 0; }
.content-list strong { font-weight: 600; }
.content-list a {
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease, opacity 0.3s ease;
}
.content-list a:hover { opacity: 0.7; text-decoration: underline; }
.warning-text {
    font-weight: 500;
    transition: color 0.3s ease;
}
.footer {
    padding: 25px 0 20px;
    transition: background-color 0.3s ease, color 0.3s ease;
    margin-top: auto;
}
.footer-line {
    margin-bottom: 4px;
    font-size: 0.85rem;
    transition: color 0.3s ease;
}
.footer-line:last-child { margin-bottom: 0; }
.footer-link {
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease, opacity 0.3s ease;
}
.footer-link:hover { opacity: 0.7; text-decoration: underline; }

/* ========== СВЕТЛАЯ ТЕМА ========== */
body.theme-light { background-color: #ffffff; color: #000000; }
body.theme-light .header { background-color: #ffffff; }
body.theme-light .avatar-wrapper { border-color: rgba(0, 0, 0, 0.15); }
body.theme-light .footer { background-color: #ffffff; color: #000000; }
body.theme-light .footer-link { color: #555555; }
body.theme-light .footer-link:hover { color: #222222; }
body.theme-light .theme-btn {
    background: #000000; color: #ffffff; border-color: rgba(0, 0, 0, 0.3);
}
body.theme-light .theme-btn:hover { border-color: #555555; }
body.theme-light .back-to-top {
    background: #000000; color: #ffffff; border-color: rgba(0, 0, 0, 0.3);
}
body.theme-light .back-to-top:hover { border-color: #555555; }
body.theme-light .nav-link-main { color: #555555; }
body.theme-light .nav-link-main:hover { color: #222222; }
body.theme-light .section-title { color: #000000; }
body.theme-light .content-list { color: #000000; }
body.theme-light .content-list a { color: #555555; }
body.theme-light .content-list a:hover { color: #222222; }
body.theme-light .warning-text { color: #cc0000; }

/* ========== ТЁМНАЯ ТЕМА ========== */
body.theme-dark { background-color: #000000; color: #ffffff; }
body.theme-dark .header { background-color: #000000; }
body.theme-dark .avatar-wrapper { border-color: rgba(255, 255, 255, 0.2); }
body.theme-dark .footer { background-color: #000000; color: #ffffff; }
body.theme-dark .footer-link { color: #aaaaaa; }
body.theme-dark .footer-link:hover { color: #ffffff; }
body.theme-dark .theme-btn {
    background: #ffffff; color: #000000; border-color: rgba(255, 255, 255, 0.3);
}
body.theme-dark .theme-btn:hover { border-color: #aaaaaa; }
body.theme-dark .back-to-top {
    background: #ffffff; color: #000000; border-color: rgba(255, 255, 255, 0.3);
}
body.theme-dark .back-to-top:hover { border-color: #aaaaaa; }
body.theme-dark .nav-link-main { color: #aaaaaa; }
body.theme-dark .nav-link-main:hover { color: #ffffff; }
body.theme-dark .section-title { color: #ffffff; }
body.theme-dark .content-list { color: #ffffff; }
body.theme-dark .content-list a { color: #aaaaaa; }
body.theme-dark .content-list a:hover { color: #ffffff; }
body.theme-dark .warning-text { color: #ff6666; }

/* ========== АДАПТИВНОСТЬ ========== */
@media (max-width: 991px) {
    .avatar-wrapper { width: 2.6cm; height: 2.6cm; }
    .header-text { padding-left: 10px; }
    .header-title { font-size: 1.3rem; }
    .header-subtitle { font-size: 0.95rem; }
    .header-description { font-size: 0.9rem; }
    .theme-btn { top: 16px; right: 24px; width: 44px; height: 44px; }
    .theme-btn .theme-icon { width: 22px; height: 22px; }
    .back-to-top { bottom: 30px; right: 24px; width: 44px; height: 44px; }
    .back-to-top svg { width: 22px; height: 22px; }
}
@media (max-width: 767px) {
    .header { padding: 16px 0; position: relative; }
header .container { padding-left: 20px !important; padding-right: 20px !important; }
.main .container { padding-left: 20px; padding-right: 20px; }
    .avatar-wrapper { width: 2.2cm; height: 2.2cm; margin: 0 auto 12px auto; }
.header-text { padding-left: 20px; padding-right: 20px; }
    .header-title { font-size: 1.1rem; text-align: center; }
    .header-subtitle { font-size: 0.9rem; text-align: left; }
    .header-description { font-size: 0.85rem; text-align: left; }
.typewriter { font-size: 0.85rem; }
    .main { padding: 24px 0; }
    .nav-link-wrapper { margin-bottom: 16px; }
    .section-title { font-size: 1.2rem; margin-top: 24px; margin-bottom: 12px; }
    .content-list { padding-left: 18px; }
    .content-list li { font-size: 0.95rem; margin-bottom: 10px; }
    .footer { padding: 18px 0 16px; }
    .footer-line { font-size: 0.75rem; }
    .theme-btn { top: 16px; right: 20px; width: 40px; height: 40px; }
    .theme-btn .theme-icon { width: 20px; height: 20px; }
    .back-to-top { bottom: 24px; right: 20px; width: 40px; height: 40px; }
    .back-to-top svg { width: 20px; height: 20px; }
}
@media (max-width: 480px) {
header .container { padding-left: 16px !important; padding-right: 16px !important; }
.main .container { padding-left: 16px; padding-right: 16px; }
    .avatar-wrapper { width: 1.8cm; height: 1.8cm; }
    .header-title { font-size: 0.95rem; text-align: center; }
    .header-subtitle { font-size: 0.8rem; text-align: left; }
    .header-description { font-size: 0.75rem; text-align: left; }
	.header-text { padding-left: 16px; padding-right: 16px; }
.typewriter { font-size: 0.75rem; line-height: 1.4; }
    .section-title { font-size: 1.1rem; margin-top: 20px; margin-bottom: 10px; }
    .content-list { padding-left: 14px; }
    .content-list li { font-size: 0.9rem; margin-bottom: 8px; }
    .footer-line { font-size: 0.7rem; }
    .theme-btn { top: 12px; right: 16px; width: 36px; height: 36px; }
    .theme-btn .theme-icon { width: 18px; height: 18px; }
    .back-to-top { bottom: 20px; right: 16px; width: 36px; height: 36px; }
    .back-to-top svg { width: 18px; height: 18px; }
}
@media (min-width: 2000px) {
    .avatar-wrapper { width: 4cm; height: 4cm; }
    .header-text { padding-left: 16px; }
    .header-title { font-size: 2.2rem; }
    .header-subtitle { font-size: 1.4rem; }
    .header-description { font-size: 1.2rem; }
    .section-title { font-size: 2rem; }
    .content-list li { font-size: 1.1rem; }
    .footer-line { font-size: 1.1rem; }
    .theme-btn { top: 28px; right: 32px; width: 64px; height: 64px; }
    .theme-btn .theme-icon { width: 32px; height: 32px; }
    .back-to-top { bottom: 40px; right: 32px; width: 64px; height: 64px; }
    .back-to-top svg { width: 32px; height: 32px; }
}