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

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    line-height: 1.8;
    color: #333;
    scroll-behavior: smooth;
    background: #ffffff;
    overflow-x: hidden;
    scroll-padding-top: 100px;
}

header {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    color: #2c3e50;
    padding: 1.2rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    border-bottom: 1px solid #e0e0e0;
    transition: padding 0.3s ease;
}

header.scrolled {
    padding: 0.6rem 0;
}

header.scrolled .logo img {
    height: 35px;
}

header.scrolled .logo-text-top {
    font-size: 0.6rem;
}

header.scrolled .logo-text-main {
    font-size: 0.85rem;
}

nav {
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2%;
    position: relative;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    align-items: center;
}

nav ul li {
    white-space: nowrap;
}

.theme-switcher {
    display: flex;
    align-items: center;
}

.theme-btn {
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 1.5rem;
    transition: color 0.3s, transform 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.theme-btn:hover {
    color: #2c3e50;
    transform: scale(1.1);
}

/* Темная тема */
body.dark-theme {
    background: #1a1a1a;
    color: #e0e0e0;
}

body.dark-theme header {
    background: rgba(30, 30, 30, 0.98);
    border-bottom: 1px solid #333;
}

body.dark-theme nav a {
    color: #e0e0e0;
}

body.dark-theme nav a:hover {
    color: #fff;
}

body.dark-theme nav a::after {
    background: #888;
}

body.dark-theme .menu-toggle span {
    background: #e0e0e0;
}

body.dark-theme .logo-text-top,
body.dark-theme .logo-text-main {
    color: #e0e0e0;
}

body.dark-theme .lang-btn:hover {
    color: #e0e0e0;
    background: #333;
}

body.dark-theme .theme-btn {
    color: #888;
}

body.dark-theme .theme-btn:hover {
    color: #e0e0e0;
    transform: scale(1.1);
}

body.dark-theme .logo-text-top,
body.dark-theme .logo-text-main {
    color: #fff;
}

body.dark-theme #home {
    color: #e0e0e0;
}

body.dark-theme .home-org-text,
body.dark-theme #home h1 {
    background: rgba(30, 30, 30, 0.95);
    color: #e0e0e0;
}

body.dark-theme #about {
    background: #222;
}

body.dark-theme .about-text {
    color: #ccc;
}

body.dark-theme .about-text a[style*="color: #2c5f99"] {
    color: #6b9bd1 !important;
}

body.dark-theme #history {
    background: #1a1a1a;
}

body.dark-theme h2 {
    color: #e0e0e0;
}

body.dark-theme h2::after {
    background: #555;
}

body.dark-theme .timeline-year {
    color: #6b9bd1;
}

body.dark-theme .timeline-content {
    border-left-color: #6b9bd1;
}

body.dark-theme .timeline-content::before {
    background: #6b9bd1;
    box-shadow: 0 0 0 4px #1a1a1a, 0 0 0 6px #6b9bd1;
}

body.dark-theme .timeline-content h3 {
    color: #e0e0e0;
}

body.dark-theme .timeline-content p {
    color: #aaa;
}

body.dark-theme #projects {
    background: #222;
}

body.dark-theme .project-card {
    background: #2a2a2a;
}

body.dark-theme .project-card:hover {
    background: #333;
}

body.dark-theme .project-card-title {
    color: #6b9bd1;
}

body.dark-theme .project-card-description {
    color: #aaa;
}

body.dark-theme .project-btn {
    background: #6b9bd1;
}

body.dark-theme .project-btn:hover {
    background: #5a8ac0;
}

body.dark-theme .project-details {
    background: #222;
}

body.dark-theme .project-details-content {
    color: #ccc;
}

body.dark-theme .project-details-title {
    color: #6b9bd1;
}

body.dark-theme .project-details-content strong {
    color: #6b9bd1;
}

body.dark-theme .project-details-content a {
    color: #6b9bd1;
}

body.dark-theme .project-close-btn {
    background: #6b9bd1;
}

body.dark-theme .project-close-btn:hover {
    background: #5a8ac0;
}

body.dark-theme #partners {
    background: #222;
}

body.dark-theme .partner-logo {
    background: #2a2a2a;
    border-color: #444;
}

body.dark-theme #gallery-small {
    background: #1a1a1a;
}

body.dark-theme #contact {
    background: #1a1a1a;
}

body.dark-theme .contact-item {
    color: #ccc;
}

body.dark-theme .contact-item strong {
    color: #e0e0e0;
}

body.dark-theme footer {
    background: #222;
    color: #888;
    border-top-color: #333;
}

body.dark-theme .scroll-to-top {
    background: #6b9bd1;
}

body.dark-theme .scroll-to-top:hover {
    background: #5a8ac0;
}

body.dark-theme .image-modal {
    background-color: rgba(0, 0, 0, 0.98);
}

body.dark-theme nav ul {
    background: rgba(30, 30, 30, 0.98);
}

.language-switcher {
    display: flex;
    gap: 0.3rem;
    align-items: center;
}

.language-switcher.desktop {
    display: flex;
}

.language-switcher.mobile {
    display: none;
}

.theme-switcher.desktop {
    display: flex;
}

.theme-switcher.mobile {
    display: none;
}

.lang-btn {
    padding: 0.4rem 0.8rem;
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: 'Segoe UI', sans-serif;
    transition: color 0.3s, background-color 0.3s;
}

.lang-btn:hover {
    color: #2c3e50;
    background: #f5f5f5;
    border-radius: 3px;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
    z-index: 1001;
}

.menu-toggle span {
    width: 28px;
    height: 3px;
    background: #2c3e50;
    transition: transform 0.3s, opacity 0.3s, background-color 0.3s;
    border-radius: 2px;
}

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

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

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

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: slideFromCenter 1.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideFromCenter {
    0% {
        transform: translateX(calc(50vw - 150px));
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

.logo-text {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo a::after {
    display: none;
}

.logo img {
    height: 45px;
    width: auto;
    transition: height 0.3s ease;
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.logo-text-top {
    font-size: 0.7rem;
    font-family: 'Segoe UI', sans-serif;
    opacity: 0.8;
    font-weight: 400;
    color: #666;
    transition: font-size 0.3s ease;
}

.logo-text-main {
    font-size: 0.95rem;
    font-family: 'Segoe UI', sans-serif;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: #2c3e50;
    transition: font-size 0.3s ease;
}

nav a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s;
    font-weight: 500;
    font-size: 1.05rem;
    letter-spacing: 0.5px;
    position: relative;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: #666;
    transition: width 0.3s;
}

nav a:hover {
    color: #000;
}

nav a:hover::after {
    width: 100%;
}

section {
    padding: 6rem 5%;
    max-width: 100%;
    margin: 0 auto;
    overflow-x: hidden;
}

#home {
    background: url('img/DOCUDAYS/47396346562_614b545bbc_o.jpg') center/cover;
    color: #2c3e50;
    min-height: 100vh;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    padding-left: 5%;
    padding-bottom: 8%;
    margin-top: 0;
    position: relative;
}

.home-content {
    position: relative;
    z-index: 1;
    max-width: 700px;
    text-align: left;
}

.home-org-text {
    font-size: 0.75rem;
    font-family: 'Segoe UI', sans-serif;
    font-weight: 500;
    margin-bottom: 0.8rem;
    letter-spacing: 0.3px;
    background: rgba(255, 255, 255, 0.95);
    padding: 0.6rem 1.2rem;
    display: inline-block;
    color: #2c3e50;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

#home h1 {
    font-size: 1.8rem;
    margin-bottom: 0;
    font-weight: 400;
    letter-spacing: 0.5px;
    color: #1a1a1a;
    line-height: 1.5;
    background: rgba(255, 255, 255, 0.95);
    padding: 1.5rem 2rem;
    display: inline-block;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

h2 {
    font-size: 3rem;
    margin-bottom: 3rem;
    color: #2c3e50;
    text-align: center;
    font-weight: 300;
    letter-spacing: 2px;
    position: relative;
    padding-bottom: 1rem;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: #888;
}

#about {
    background: #f5f5f5;
}

.about-content {
    display: block;
    max-width: 100%;
}

.about-image {
    width: 45%;
    height: 500px;
    background: url('img/MAISTERNYA/Warszawa warsztat_DSF1516.jpg') center/cover;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    margin: 0 0 2rem 3rem;
    float: right;
}

.about-text {
    font-size: 1rem;
    line-height: 1.8;
    color: #444;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.about-text p {
    margin-bottom: 1.5rem;
}

.about-text::after {
    content: "";
    display: table;
    clear: both;
}

.gallery-full {
    padding: 0;
    margin: 0;
    background: #000;
}

.gallery-full-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
    max-width: 100%;
}

.gallery-full-item {
    position: relative;
    width: 100%;
    height: 60vh;
    overflow: hidden;
}

.gallery-full-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#history {
    background: white;
    padding: 6rem 5%;
    content-visibility: auto;
    contain-intrinsic-size: auto 800px;
}

.history-content {
    max-width: 1000px;
    margin: 0 auto;
}

.history-timeline {
    position: relative;
    padding-left: 0;
}

.timeline-item {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
    position: relative;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-year {
    font-size: 2rem;
    font-weight: 600;
    color: #2c5f99;
    font-family: 'Georgia', serif;
    text-align: right;
    padding-top: 0.3rem;
}

.timeline-content {
    position: relative;
    padding-left: 2rem;
    border-left: 3px solid #2c5f99;
}

.timeline-content::before {
    content: '';
    position: absolute;
    left: -9px;
    top: 8px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #2c5f99;
    box-shadow: 0 0 0 4px white, 0 0 0 6px #2c5f99;
}

.timeline-content h3 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 0.8rem;
    font-family: 'Georgia', serif;
    font-weight: 600;
}

.timeline-content p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #555;
    font-family: 'Segoe UI', sans-serif;
    margin-bottom: 0.8rem;
}

#gallery-small {
    background: white;
    padding: 0;
    margin: 0;
}

#gallery-small h2 {
    margin-bottom: 3rem;
}

.gallery-small-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    max-width: 100%;
    margin: 0;
}

.gallery-small-item {
    width: 100%;
    height: 300px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

.gallery-small-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Модальное окно для полноэкранного просмотра */
.image-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    align-items: center;
    justify-content: center;
}

.image-modal.active {
    display: flex;
}

.image-modal img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.image-modal-close {
    position: absolute;
    top: 30px;
    right: 40px;
    color: white;
    font-size: 50px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    z-index: 10000;
    line-height: 1;
    user-select: none;
}

.image-modal-close:hover {
    color: #ccc;
}

#projects {
    background: #f5f5f5;
    padding: 6rem 0;
    content-visibility: auto;
    contain-intrinsic-size: auto 1200px;
}

#projects h2 {
    padding: 0 5%;
}

.projects-container {
    width: 100%;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
    margin-top: 3rem;
    padding: 0 5%;
}

@media (min-width: 1350px) {
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 880px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
}

.project-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    will-change: transform;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.project-card-image {
    width: 100%;
    height: 250px;
    background-size: cover;
    background-position: center;
}

.project-card-content {
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.project-card-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c5f99;
    margin-bottom: 1rem;
    font-family: 'Georgia', serif;
}

.project-card-description {
    font-size: 1rem;
    line-height: 1.7;
    color: #555;
    margin-bottom: 1.5rem;
    flex: 1;
    font-family: 'Segoe UI', sans-serif;
}

.project-btn {
    background: #2c5f99;
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
    font-family: 'Segoe UI', sans-serif;
    align-self: flex-start;
}

.project-btn:hover {
    background: #234a7a;
    transform: translateX(5px);
}

.project-btn.active {
    background: #1a3d5f;
}

.project-details {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.5s ease, padding 0.5s ease, margin 0.5s ease, opacity 0.5s ease;
    background: #f9f9f9;
    width: 100%;
    margin: 0;
    opacity: 0;
    padding: 0 5%;
}

.project-details > .project-details-content {
    overflow: hidden;
}

.project-details.active {
    grid-template-rows: 1fr;
    padding: 3rem 5%;
    margin-top: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    opacity: 1;
}

.project-details-content {
    max-width: 1200px;
    margin: 0 auto;
    font-size: 1.05rem;
    line-height: 1.9;
    color: #444;
    font-family: 'Segoe UI', sans-serif;
}

.project-details-title {
    font-size: 2.5rem;
    font-weight: 600;
    color: #2c5f99;
    margin-bottom: 2rem;
    font-family: 'Georgia', serif;
    text-align: center;
}

.project-details-content p {
    margin-bottom: 1.5rem;
}

.project-details-content strong {
    color: #2c5f99;
    font-weight: 600;
}

.project-details-content a {
    color: #2c5f99;
    text-decoration: none;
    font-weight: 600;
}

.project-details-content a:hover {
    text-decoration: underline;
}

.project-close-btn {
    background: #2c5f99;
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-family: 'Segoe UI', sans-serif;
    margin-top: 2rem;
}

/* Sub-detail button and block */
.sub-detail-btn {
    background: transparent;
    color: #2c5f99;
    border: none;
    padding: 0;
    font-size: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.3s;
    font-family: inherit;
    margin-left: 0.3rem;
    text-decoration: none;
}

.sub-detail-btn::after {
    content: ' →';
    transition: transform 0.3s;
    display: inline-block;
}

.sub-detail-btn:hover {
    color: #1a3d5f;
}

.sub-detail-btn:hover::after {
    transform: translateX(3px);
}

.sub-detail-btn.active::after {
    content: ' ↓';
    transform: none;
}

.sub-detail-btn.active {
    color: #1a3d5f;
}

/* Sub-detail gallery */
.sub-detail-gallery {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.sub-detail-gallery img {
    width: 100%;
    height: auto;
    border-radius: 6px;
}

/* Inline images in sub-detail blocks */
.sub-detail-img {
    display: block;
    max-width: 800px;
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem auto;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

@media (max-width: 768px) {
    .sub-detail-img {
        max-width: 100%;
        margin: 1rem 0;
    }
}

@media (max-width: 480px) {
    .sub-detail-img {
        border-radius: 6px;
        margin: 0.8rem 0;
    }
}

/* Poza Euro two-column layout */
.poza-euro-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #ddd;
}

.poza-euro-col h4 {
    color: #2c5f99;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.poza-euro-col p {
    margin-bottom: 0.3rem;
    font-size: 0.95rem;
}

.poza-euro-col ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 1rem;
}

.poza-euro-col li {
    margin-bottom: 0.2rem;
    font-size: 0.95rem;
}

@media (max-width: 768px) {
    .poza-euro-info {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

.sub-detail-block {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.4s ease, opacity 0.4s ease, padding 0.4s ease, margin 0.4s ease, border-color 0.4s ease;
    background: #f0f5fa;
    padding: 0 1.5rem;
    margin-top: 0;
    border-radius: 8px;
    border-left: 4px solid transparent;
    line-height: 1.8;
    opacity: 0;
}

.sub-detail-inner {
    overflow: hidden;
}

.sub-detail-block.active {
    grid-template-rows: 1fr;
    padding: 1.5rem;
    margin-top: 1rem;
    border-left-color: #2c5f99;
    opacity: 1;
}

.sub-detail-block p {
    margin-bottom: 1rem;
}

body.dark-theme .sub-detail-block {
    background: #2a3a4a;
}

body.dark-theme .sub-detail-block.active {
    border-left-color: #6b9bd1;
}

body.dark-theme .sub-detail-btn {
    color: #6b9bd1;
}

body.dark-theme .sub-detail-btn:hover {
    color: #8bb8e8;
}

body.dark-theme .history-more-btn {
    background: #6b9bd1;
    color: #1a1a1a;
}

body.dark-theme .history-more-btn:hover {
    background: #5a8ac0;
}

body.dark-theme .project-details-content a[style*="color: #2c3e50"] {
    color: #6b9bd1 !important;
}

.project-close-btn:hover {
    background: #234a7a;
    transform: translateY(-3px);
}

.project-detail-image {
    width: 100%;
    height: 400px;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    margin: 2rem 0;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.img1 { background-image: url('img/proj/40082058675_1c7bf6e64e_k1-777x482.jpg'); }
.img2 { background-image: url('img/MAISTERNYA/DSC_3235.jpg'); }
.img3 { background-image: url('img/proj/article_9115.jpg'); }
.img4 { background-image: url('img/PROMO/hlon_vadym_lysenko-1.jpg'); }
.img5 { background-image: url('img/POZA_EURO/IMG_6729.jpg'); }
.img6 { background-image: url('img/proj/project-02-777x481.jpg'); }
.img7 { background-image: url('img/proj/project-02-777x481.jpg'); }

#partners {
    background: #f5f5f5;
    padding: 5rem 5%;
    content-visibility: auto;
    contain-intrinsic-size: auto 400px;
}

#partners h2 {
    margin-bottom: 3rem;
}

.partners-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    max-width: 100%;
    margin: 0 auto;
    align-items: center;
    justify-items: center;
}

@media (min-width: 653px) and (max-width: 1333px) {
    .partners-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.partner-logo {
    width: 168px;
    height: 96px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid #e0e0e0;
    display: block;
    text-decoration: none;
}

.partner-logo:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.partner-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 10px;
}

#contact {
    background: #ffffff;
    color: #2c3e50;
    padding: 4rem 5%;
    content-visibility: auto;
    contain-intrinsic-size: auto 300px;
}

.contact-info {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem 3rem;
    font-family: 'Segoe UI', sans-serif;
    text-align: center;
}

.contact-item {
    font-size: 1.05rem;
    line-height: 1.8;
}

.contact-item strong {
    color: #444;
    display: block;
    margin-bottom: 0.6rem;
    font-size: 1.15rem;
}

@media (max-width: 750px) {
    .contact-info {
        grid-template-columns: 1fr;
    }
}

footer {
    background: #f0f0f0;
    color: #666;
    text-align: center;
    padding: 2.5rem;
    font-family: 'Segoe UI', sans-serif;
    letter-spacing: 0.5px;
    border-top: 1px solid #ddd;
}

.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: #2c5f99;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: opacity 0.3s ease, visibility 0.3s ease, background-color 0.3s;
    opacity: 0;
    visibility: hidden;
    z-index: 999;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    background: #234a7a;
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

.scroll-to-top:active {
    transform: translateY(-3px);
}

/* Планшети та менші десктопи */
@media (max-width: 1200px) {
    nav {
        padding: 0 4%;
    }

    .menu-toggle {
        display: flex;
    }

    .language-switcher.desktop {
        display: none;
    }

    .language-switcher.mobile {
        display: flex;
    }

    .theme-switcher.desktop {
        display: none;
    }

    .theme-switcher.mobile {
        display: flex;
    }

    .theme-switcher.mobile .theme-btn {
        font-size: 2rem;
    }

    nav ul {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 70%;
        max-width: 300px;
        background: rgba(255, 255, 255, 0.98);
        flex-direction: column;
        justify-content: center;
        gap: 2rem;
        transition: right 0.4s ease;
        box-shadow: -5px 0 20px rgba(0,0,0,0.1);
        z-index: 999;
    }

    nav ul.active {
        right: 0;
    }

    nav ul li {
        opacity: 0;
        transform: translateX(50px);
        transition: opacity 0.3s ease, transform 0.3s ease;
    }

    nav ul.active li {
        opacity: 1;
        transform: translateX(0);
    }

    nav ul.active li:nth-child(1) { transition-delay: 0.1s; }
    nav ul.active li:nth-child(2) { transition-delay: 0.2s; }
    nav ul.active li:nth-child(3) { transition-delay: 0.3s; }
    nav ul.active li:nth-child(4) { transition-delay: 0.4s; }
    nav ul.active li:nth-child(5) { transition-delay: 0.5s; }
    nav ul.active li:nth-child(6) { transition-delay: 0.6s; }
    nav ul.active li:nth-child(7) { transition-delay: 0.7s; }
    nav ul.active li:nth-child(8) { transition-delay: 0.8s; }

    .project-detail-image {
        height: 300px;
    }

    .project-details-title {
        font-size: 2rem;
    }

    .gallery-full-item {
        height: 50vh;
    }

    .gallery-small-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .gallery-small-item {
        height: 250px;
    }
}

/* Малі планшети */
@media (max-width: 768px) {
    nav {
        padding: 0 4%;
    }

    .about-content {
        display: block;
    }

    .about-image {
        width: 100%;
        height: 280px;
        float: none;
        margin: 0 0 2rem 0;
    }

    .about-text {
        order: 1;
    }

    .menu-toggle {
        display: flex;
    }

    .language-switcher.desktop {
        display: none;
    }

    .language-switcher.mobile {
        display: flex;
    }

    nav ul {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 70%;
        max-width: 300px;
        background: rgba(255, 255, 255, 0.98);
        flex-direction: column;
        justify-content: center;
        gap: 2rem;
        transition: right 0.4s ease;
        box-shadow: -5px 0 20px rgba(0,0,0,0.1);
        z-index: 999;
    }

    nav ul.active {
        right: 0;
    }

    nav ul li {
        opacity: 0;
        transform: translateX(50px);
        transition: opacity 0.3s ease, transform 0.3s ease;
    }

    nav ul.active li {
        opacity: 1;
        transform: translateX(0);
    }

    nav ul.active li:nth-child(1) { transition-delay: 0.1s; }
    nav ul.active li:nth-child(2) { transition-delay: 0.2s; }
    nav ul.active li:nth-child(3) { transition-delay: 0.3s; }
    nav ul.active li:nth-child(4) { transition-delay: 0.4s; }
    nav ul.active li:nth-child(5) { transition-delay: 0.5s; }
    nav ul.active li:nth-child(6) { transition-delay: 0.6s; }
    nav ul.active li:nth-child(7) { transition-delay: 0.7s; }

    .logo-text {
        max-width: 200px;
    }

    .logo-text-top {
        font-size: 0.6rem;
    }

    .logo-text-main {
        font-size: 0.8rem;
    }

    .timeline-item {
        grid-template-columns: 100px 1fr;
        gap: 2rem;
        margin-bottom: 2.5rem;
    }

    .timeline-year {
        font-size: 1.6rem;
    }

    .timeline-content h3 {
        font-size: 1.3rem;
    }

    .timeline-content p {
        font-size: 1rem;
    }

    .gallery-small-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }

    .gallery-small-item {
        height: 200px;
    }

    .project-details.active {
        padding: 2rem 5%;
    }

    .project-detail-image {
        height: 250px;
    }

    .project-details-title {
        font-size: 1.8rem;
    }

    .gallery-full-grid {
        grid-template-columns: 1fr;
    }

    .gallery-full-item {
        height: 40vh;
    }

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

    .gallery-small-item {
        height: 220px;
    }

    #home h1 {
        font-size: 1.5rem;
        padding: 1.2rem 1.5rem;
    }

    .home-org-text {
        font-size: 0.7rem;
        padding: 0.5rem 1rem;
    }

    h2 {
        font-size: 2rem;
    }
}

/* Мобільні телефони */
@media (max-width: 480px) {
    nav {
        padding: 0 5%;
    }

    #home h1 {
        font-size: 1.3rem;
        padding: 1rem 1.2rem;
    }

    .home-org-text {
        font-size: 0.65rem;
        padding: 0.4rem 0.8rem;
    }

    .logo-text {
        max-width: 160px;
    }

    .logo-text-top {
        font-size: 0.5rem;
    }

    .logo-text-main {
        font-size: 0.7rem;
    }

    h2 {
        font-size: 1.7rem;
    }

    .project-detail-image {
        height: 200px;
    }

    .about-image {
        height: 220px;
    }

    .timeline-item {
        grid-template-columns: 80px 1fr;
        gap: 1.5rem;
        margin-bottom: 2rem;
    }

    .timeline-year {
        font-size: 1.3rem;
    }

    .timeline-content {
        padding-left: 1.5rem;
    }

    .timeline-content h3 {
        font-size: 1.1rem;
    }

    .timeline-content p {
        font-size: 0.95rem;
    }

    .gallery-small-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }

    .gallery-small-item {
        height: 150px;
    }

    .project-details.active {
        padding: 1.5rem 3%;
    }

    .project-details-title {
        font-size: 1.5rem;
    }

    .gallery-full-item {
        height: 30vh;
    }

    .gallery-small-grid {
        grid-template-columns: 1fr;
    }

    .gallery-small-item {
        height: 280px;
    }

    .scroll-to-top {
        width: 45px;
        height: 45px;
        bottom: 20px;
        right: 20px;
        font-size: 1.3rem;
    }
}

.project-link {
    text-decoration: none;
    color: inherit;
}

.project-link:hover {
    text-decoration: underline;
}

.photo-single {
    width: 50%;
    border-radius: 8px;
    margin: 2rem auto;
    display: block;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.photo-pair {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0;
}

.photo-pair img {
    height: 450px;
    width: auto;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.photo-pair-small img {
    height: 350px;
    max-width: 45%;
    width: auto;
    object-fit: cover;
}

@media (max-width: 1200px) {
    .photo-pair {
        flex-direction: column;
        align-items: center;
    }

    .photo-pair img {
        height: auto;
        width: 100%;
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .photo-single {
        width: 100%;
    }
}

.catalog-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.catalog-item {
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease;
}

.catalog-item:hover {
    transform: translateY(-5px);
}

.catalog-item img {
    width: 100%;
    max-width: 150px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    margin-bottom: 0.5rem;
}

.catalog-item p {
    font-size: 0.9rem;
    margin: 0;
    font-weight: 500;
}

.history-more-btn {
    display: block;
    margin: 2rem auto;
    padding: 0.8rem 2rem;
    background: #2c5f99;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    transition: background-color 0.3s ease;
}

.history-more-btn:hover {
    background: #234a7a;
}

.history-hidden {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.5s ease, opacity 0.5s ease;
    opacity: 0;
}

.history-hidden-inner {
    overflow: hidden;
}

.history-hidden.active {
    grid-template-rows: 1fr;
    opacity: 1;
}

.history-more-btn.bottom {
    margin-top: 2rem;
}
