:root {
    --bg-color: #f3f5f7;
    --card-bg: #ffffff;
    --text-color: #1a2430;
    --muted: #5a6570;
    --primary: #203850;
    --primary-hover: #162838;
    --btn-bg: #203850;
    --btn-hover: #162838;
    --btn-text: #ffffff;
    --danger: #b42318;
    --border: #d4dae0;
    --radius: 12px;
    --shadow: 0 4px 16px rgba(32, 56, 80, 0.08);
    --wrap: 1100px;
}

html.dark {
    --bg-color: #10161c;
    --card-bg: #1a2430;
    --text-color: #e6edf2;
    --muted: #9aa8b4;
    --primary: #9ec0d4;
    --primary-hover: #b5d0df;
    --btn-bg: #203850;
    --btn-hover: #2d5270;
    --btn-text: #ffffff;
    --danger: #f07178;
    --border: #2c3a48;
    --shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    background: var(--bg-color);
    color: var(--text-color);
    font-family: "Montserrat", sans-serif;
    line-height: 1.6;
    transition: background 0.25s ease, color 0.25s ease;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: var(--primary);
}

a:focus-visible,
button:focus-visible,
.theme-toggle:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}

.museum-wrap {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 1rem 1.25rem 2.5rem;
}

.museum-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.75rem 0 1.25rem;
}

.museum-header__brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.museum-logo {
    display: block;
}

.museum-logo img {
    display: block;
    max-height: 80px;
    width: auto;
}

.museum-header__actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.language-switcher {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.language-switcher a {
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--text-color);
    background: var(--card-bg);
    font-weight: 500;
    font-size: 0.9rem;
    transition: 0.2s ease;
}

.language-switcher a:hover,
.language-switcher a.active {
    background: var(--btn-bg);
    color: var(--btn-text);
    border-color: var(--btn-bg);
}

.museum-back {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    text-decoration: none;
    font-weight: 500;
    background: var(--btn-bg);
    color: var(--btn-text);
    padding: 8px 16px;
    border-radius: var(--radius);
    transition: background 0.2s ease;
}

.museum-back:hover {
    background: var(--btn-hover);
    color: var(--btn-text);
}

.theme-toggle {
    cursor: pointer;
    font-size: 1.25rem;
    color: var(--text-color);
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.theme-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.museum-title {
    font-size: 1.7rem;
    font-weight: 700;
    text-align: center;
    margin: 0.5rem 0 1.75rem;
}

.museum-lead {
    text-align: center;
    color: var(--muted);
    max-width: 640px;
    margin: -1rem auto 2rem;
}

.museum-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.museum-card {
    background: var(--card-bg);
    color: var(--text-color);
    text-decoration: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid transparent;
    padding: 1.75rem 1.4rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

a.museum-card:hover,
.museum-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
}

.museum-card--center {
    text-align: center;
}

.museum-card i.card-icon,
.museum-card .card-icon {
    font-size: 2.4rem;
    color: var(--primary);
    margin-bottom: 0.7rem;
    display: block;
}

.museum-card .icon-circle {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.7rem;
}

.museum-card .title,
.museum-card h3 {
    font-weight: 600;
    font-size: 1.1rem;
    margin: 0;
    color: var(--text-color);
}

.museum-btn,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    background: var(--btn-bg);
    color: var(--btn-text);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
    font-family: inherit;
    font-size: 0.95rem;
    transition: background 0.2s ease;
}

.museum-btn:hover,
.button:hover {
    background: var(--btn-hover);
    color: var(--btn-text);
}

.museum-btn--ghost {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.museum-btn--ghost:hover {
    background: var(--primary);
    color: #fff;
}

.museum-btn--danger,
.button.is-danger {
    background: var(--danger);
}

.museum-btn--info,
.button.is-info {
    background: #2d5270;
}

.prose-card,
.oneBlock,
.twoBlock,
.project-box,
.profile-card,
.person-card,
.media-card,
.student-card,
.teacher-card,
.veteran-card,
.card-style {
    background: var(--card-bg);
    color: var(--text-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

.person-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.person-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    overflow: hidden;
    padding: 0 0 1.25rem;
}

.person-card img,
.person-card .image img {
    width: 100%;
    height: 240px;
    object-fit: cover;
}

.person-card h3,
.person-card .name {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 1rem 1rem 0.75rem;
}

.profile-card {
    margin-bottom: 1.25rem;
}

.profile-card__row {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}

.profile-card img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.profile-card ul {
    padding-left: 1.1rem;
}

.student-grid,
.teacher-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    align-items: stretch;
}

.student-card,
.teacher-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-height: 100%;
    padding: 1.35rem 1.15rem 1.15rem;
}

.student-card .student-img,
.teacher-card .teacher-card__img {
    width: 132px;
    height: 168px;
    object-fit: cover;
    object-position: center top;
    border-radius: 16px;
    background: var(--bg-color);
    box-shadow: 0 8px 18px rgba(32, 56, 80, 0.12);
}

.student-card__name,
.teacher-card__name {
    margin: 0.95rem 0 0.45rem;
    font-size: 1.05rem;
    font-weight: 650;
    line-height: 1.3;
}

.student-card__group {
    margin: 0;
    flex: 1;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.4;
}

.student-card__group span {
    display: block;
    margin-bottom: 0.15rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.student-card__btn,
.teacher-card__btn {
    width: 100%;
    margin-top: 1rem;
    font-size: 0.9rem;
    line-height: 1.25;
    text-align: center;
}

.teacher-card__meta {
    width: 100%;
    flex: 1;
    color: var(--text-color);
    font-size: 0.92rem;
    line-height: 1.4;
}

.teacher-card__meta p {
    margin: 0 0 0.75rem;
}

.teacher-card__meta p:last-child {
    margin-bottom: 0;
}

.teacher-card__meta span {
    display: block;
    margin-bottom: 0.15rem;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.museum-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 1rem;
}

.museum-modal.active,
.museum-modal.is-active {
    display: flex;
}

.museum-modal__card {
    background: var(--card-bg);
    color: var(--text-color);
    padding: 1.5rem;
    border-radius: var(--radius);
    width: 90%;
    max-width: 640px;
    max-height: 85vh;
    overflow: auto;
}

.museum-modal__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.museum-modal__close {
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 1.4rem;
    cursor: pointer;
}

.achievement-item {
    background: var(--bg-color);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 10px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.timeline {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 820px;
    margin: 0 auto;
    padding-left: 2.4rem;
}

.timeLine-item {
    position: relative;
}

.timeLine-item:not(:last-child)::after {
    content: "";
    position: absolute;
    left: calc(-2.4rem + 6px);
    top: calc(1.15rem + 7px);
    bottom: calc(-1rem - 1.15rem - 7px);
    width: 2px;
    background: rgba(32, 56, 80, 0.28);
}

html.dark .timeLine-item:not(:last-child)::after {
    background: rgba(158, 192, 212, 0.4);
}

.timeLine-item::before {
    content: "";
    position: absolute;
    left: -2.4rem;
    top: 1.15rem;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 3px solid var(--btn-bg);
    box-shadow: 0 0 0 4px var(--bg-color);
    z-index: 1;
}

.timeLine-item__card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.timeLine-item__card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
}

.timeLine-item__head {
    padding: 0.95rem 1.2rem 0.15rem;
    background: linear-gradient(180deg, rgba(32, 56, 80, 0.06), transparent 100%);
}

html.dark .timeLine-item__head {
    background: linear-gradient(180deg, rgba(158, 192, 212, 0.08), transparent 100%);
}

.timeLine-item__year {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 4.6rem;
    padding: 0.28rem 0.7rem;
    border-radius: 10px;
    background: var(--btn-bg);
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.03em;
    line-height: 1.3;
}

.timeLine-item__text {
    margin: 0;
    padding: 0.75rem 1.2rem 1.15rem;
    font-size: 0.95rem;
    line-height: 1.55;
}

.timeline-footer {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 0 1.2rem 1.15rem;
}

.timeline-add {
    max-width: 820px;
    margin: 1.25rem auto 0;
    padding-left: 2.4rem;
}

.notification {
    padding: 1rem;
    border-radius: var(--radius);
    background: #d4edda;
    color: #155724;
    margin-bottom: 1.25rem;
}

html.dark .notification {
    background: #1e3a2f;
    color: #b7ebc6;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
    align-items: start;
}

.gallery-tile {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    cursor: pointer;
    padding: 0;
    border: none;
    text-align: left;
    font: inherit;
    color: inherit;
    width: 100%;
}

.gallery-tile img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.gallery-tile p {
    margin: 0;
    padding: 0.75rem 1rem 1rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.gallery-tile p:empty {
    display: none;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.media-card {
    position: relative;
    padding-top: 1.75rem;
}

.media-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary);
    border-radius: var(--radius) var(--radius) 0 0;
}

.media-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.media-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-item {
    background: var(--card-bg);
    box-shadow: var(--shadow);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
}

.stat-item h3 {
    margin: 0;
    color: var(--primary);
    font-size: 1.8rem;
}

.stat-item p {
    margin: 0.4rem 0 0;
    color: var(--muted);
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.video-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

.video-thumb {
    width: 100%;
    height: 170px;
    object-fit: cover;
    background: var(--border);
    display: block;
}

.video-info {
    padding: 1rem;
}

.video-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.video-tags .tag {
    background: var(--primary);
    color: #fff;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.75rem;
}

.filters input,
.filters select {
    padding: 0.65rem 0.9rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text-color);
    font-family: inherit;
    font-size: 1rem;
    min-width: 220px;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--muted);
}

.developer {
    text-align: center;
    font-size: 0.9rem;
    color: var(--muted);
    margin: 1.5rem auto 2rem;
}

.developer a {
    text-decoration: none;
    color: inherit;
}

.developer a:hover {
    text-decoration: underline;
}

.twoBlockGrid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: flex-start;
}

.twoBlockGrid img {
    max-width: 280px;
    border-radius: var(--radius);
    object-fit: cover;
}

.twoBlockGrid .text {
    flex: 1;
    min-width: 220px;
}

.specialty-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.15rem;
    align-items: stretch;
}

.specialty-card {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.specialty-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
}

.specialty-card__head {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1.1rem 1.15rem 0.95rem;
    background:
        linear-gradient(180deg, rgba(32, 56, 80, 0.06), transparent 100%);
}

html.dark .specialty-card__head {
    background: linear-gradient(180deg, rgba(158, 192, 212, 0.08), transparent 100%);
}

.specialty-card__icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--btn-bg);
    color: #fff;
    font-size: 1.2rem;
}

.specialty-card__title {
    margin: 0.15rem 0 0;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: 0.01em;
    text-wrap: balance;
}

.specialty-card__body {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    flex: 1;
    padding: 0.15rem 1.15rem 1.15rem;
}

.specialty-label {
    margin: 0 0 0.4rem;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.specialty-quals {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.specialty-quals li {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    padding: 0.5rem 0.6rem;
    border-radius: 10px;
    background: var(--bg-color);
}

.specialty-code {
    flex-shrink: 0;
    margin-top: 0.05rem;
    padding: 0.12rem 0.4rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--primary);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.4;
}

.specialty-qual {
    font-size: 0.9rem;
    line-height: 1.35;
}

.specialty-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.specialty-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    background: rgba(32, 56, 80, 0.08);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.35;
}

html.dark .specialty-chip {
    background: rgba(158, 192, 212, 0.14);
}

.specialty-demand {
    padding-top: 0.85rem;
    border-top: 1px solid var(--border);
}

.specialty-demand p:last-child {
    margin: 0;
    color: var(--text-color);
    font-size: 0.9rem;
    line-height: 1.5;
}

.specialty-fallback {
    margin: 0;
    color: var(--text-color);
    font-size: 0.92rem;
    line-height: 1.5;
}

.lightbox-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
}

.lightbox-content {
    display: block;
    margin: 5% auto auto;
    max-width: 90%;
    max-height: 80%;
    border-radius: 8px;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

.lightbox-close { top: 20px; right: 30px; }
.lightbox-prev { top: 50%; left: 30px; transform: translateY(-50%); }
.lightbox-next { top: 50%; right: 30px; transform: translateY(-50%); }

.label-new {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #ff3860;
    color: #fff;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    z-index: 2;
}

@media (max-width: 700px) {
    .museum-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .profile-card__row,
    .twoBlockGrid {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .museum-title {
        font-size: 1.35rem;
    }

    .timeline,
    .timeline-add {
        padding-left: 0;
    }

    .timeLine-item::before,
    .timeLine-item::after {
        display: none;
    }
}
