/* Базовые строгие стили */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: "Montserrat", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background-color: #f3f4f6;
    color: #1f2933;
}

/* Шапка */
.header {
    background-color: #ffffff;
    border-bottom: 1px solid #d8dde3;
}

.header-inner {
    max-width: 1040px;
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.name {
    margin: 0;
    font-size: 1.5rem;
    letter-spacing: 0.03em;
}

.role {
    margin: 4px 0 0;
    font-size: 0.95rem;
    color: #6b7280;
}

/* Кнопка переключения темы (светлая/тёмная) */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    background-color: #ffffff;
    color: #111827;
    cursor: pointer;
    padding: 0;
    margin-left: 4px;
}

.theme-toggle-icon {
    font-size: 1.1rem;
    line-height: 1;
}

/* Отображение иконок солнца/луны в зависимости от темы */
.theme-toggle .icon-sun {
    display: inline;
}

.theme-toggle .icon-moon {
    display: none;
}

/* В светлой теме показываем иконку "луна" как переключатель на тёмную тему */
body.theme-light .theme-toggle .icon-sun {
    display: none;
}

body.theme-light .theme-toggle .icon-moon {
    display: inline;
}

/* В тёмной теме показываем иконку "солнце" как переключатель на светлую тему */
body.theme-dark .theme-toggle {
    border-color: #4b5563;
    background-color: #111827;
    color: #e5e7eb;
}

body.theme-dark .theme-toggle .icon-sun {
    display: inline;
}

body.theme-dark .theme-toggle .icon-moon {
    display: none;
}

.theme-toggle:hover {
    border-color: #4b5563;
}

body.theme-dark .theme-toggle:hover {
    border-color: #9ca3af;
}

.contact-link {
    font-size: 0.9rem;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid #4b5563;
    color: #111827;
    text-decoration: none;
    white-space: nowrap;
}

.contact-link:hover {
    background-color: #111827;
    color: #ffffff;
}

/* Основная раскладка */
.layout {
    max-width: 1040px;
    margin: 20px auto 32px;
    padding: 0 20px;
    display: grid;
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    gap: 32px;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Фото */
.photo-block {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 16px;
    border: 1px solid #d8dde3;
}

.photo {
    width: 100%;
    border-radius: 6px;
    display: block;
}

/* Обо мне */
.about {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 16px 18px;
    border: 1px solid #d8dde3;
}

.section-title {
    margin: 0 0 8px;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 600;
    color: #6b7280;
}

.about p {
    margin: 0 0 8px;
    font-size: 0.95rem;
}

/* Проекты с раскрытием групп */
.projects {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.projects .section-title {
    margin-bottom: 4px;
}

.projects-group {
    background-color: #ffffff;
    border-radius: 8px;
    border: 1px solid #d8dde3;
    padding: 0;
}

.projects-summary {
    list-style: none;
    cursor: pointer;
    padding: 12px 16px;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.projects-summary::-webkit-details-marker {
    display: none;
}

.summary-title {
    font-size: 0.95rem;
    font-weight: 600;
}

.summary-hint {
    font-size: 0.8rem;
    color: #9ca3af;
}

.projects-group[open] .projects-summary {
    border-bottom: 1px solid #e5e7eb;
}

.projects-group-body {
    padding: 12px 16px 14px;
}

.project-card {
    padding: 4px 0;
}

.project-title {
    margin: 0 0 4px;
    font-size: 1rem;
}

.project-description {
    margin: 0 0 6px;
    font-size: 0.95rem;
}

.project-meta {
    margin: 0 0 6px;
    font-size: 0.85rem;
    color: #6b7280;
}

.project-link {
    font-size: 0.9rem;
    color: #1f2933;
    text-decoration: none;
    border-bottom: 1px solid #6b7280;
}

.project-link:hover {
    color: #111827;
    border-bottom-color: #111827;
}

/* Подвал */
.footer {
    border-top: 1px solid #d8dde3;
    background-color: #ffffff;
    text-align: center;
    padding: 12px 16px;
    font-size: 0.85rem;
    color: #6b7280;
}

/* Тёмная тема: переопределение цветов */
body.theme-dark {
    background-color: #05070a;
    color: #e5e7eb;
}

body.theme-dark .header {
    background-color: #0b1120;
    border-bottom-color: #1f2937;
}

body.theme-dark .role {
    color: #9ca3af;
}

body.theme-dark .contact-link {
    border-color: #9ca3af;
    color: #e5e7eb;
}

body.theme-dark .contact-link:hover {
    background-color: #e5e7eb;
    color: #020617;
}

body.theme-dark .layout {
    /* фон страницы уже тёмный, карточки остаются светлее */
}

body.theme-dark .photo-block,
body.theme-dark .about,
body.theme-dark .projects-group {
    background-color: #020617;
    border-color: #1f2937;
}

body.theme-dark .section-title {
    color: #9ca3af;
}

body.theme-dark .project-meta {
    color: #9ca3af;
}

body.theme-dark .project-link {
    color: #93c5fd;
    border-bottom-color: #93c5fd;
}

body.theme-dark .project-link:hover {
    color: #bfdbfe;
    border-bottom-color: #bfdbfe;
}

body.theme-dark .footer {
    background-color: #020617;
    border-top-color: #1f2937;
    color: #6b7280;
}

/* Адаптивность */
@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 24px;
    }
}


