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

body {
    font-family: "NimbusMonoPS", serif;
    font-size: 18px;
    transition: background-color 0.3s, color 0.3s;
}

body.dark-theme {
    background-color: #050d1a;
    color: #ffffff;
}

body.light-theme {
    background-color: #ffffff;
    color: #000000;
}

.foreground {
    width: 100%;
    height: auto;
    display: block;
    margin: 0;
    padding: 0;
}

.container {
    width: 100%;
    padding: 0;
    margin: 0;
}

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    z-index: 1000;
    transition: background-color 0.3s, box-shadow 0.3s;
}

body.light-theme .navbar {
    background-color: #f0f0f0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-bottom: 2px solid #ddd;
}

body.dark-theme .navbar {
    background-color: #051428;
    box-shadow: 0 2px 10px rgba(255, 255, 255, 0.1);
    border-bottom: 2px solid #0d2847;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: inherit;
}

.logo {
    width: 60px;
    height: 60px;
    border-radius: 15%;
    overflow: hidden;
    flex-shrink: 0;
}

.logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.org-name {
    font-size: 28px;
    font-weight: bold;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.theme-toggle {
    display: flex;
    gap: 10px;
    align-items: center;
}

.theme-toggle span {
    font-weight: bold;
}

@font-face {
    font-family: "NimbusMonoPS";
    src: url("NimbusMonoPS-Regular.otf") format("opentype");
}

.theme-btn {
    padding: 8px 16px;
    border: 2px solid;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-family: "NimbusMonoPS", serif;
    transition: all 0.3s;
}


body.light-theme .theme-btn {
    border-color: #000;
    background-color: transparent;
    color: #000;
}

body.light-theme .theme-btn.active {
    background-color: #000;
    color: #fff;
}

body.dark-theme .theme-btn {
    border-color: #fff;
    background-color: transparent;
    color: #fff;
}

body.dark-theme .theme-btn.active {
    background-color: #fff;
    color: #000;
}

.theme-btn:hover {
    transform: scale(1.05);
}

.container {
    margin-top: 80px;
    position: relative;
    overflow: hidden;
}

.container::before {
    content: '';
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        repeating-linear-gradient(
            0deg,
            rgba(0, 255, 0, 0.03) 0px,
            rgba(0, 255, 0, 0.03) 1px,
            transparent 1px,
            transparent 2px
        ),
        repeating-linear-gradient(
            90deg,
            rgba(0, 255, 0, 0.03) 0px,
            rgba(0, 255, 0, 0.03) 1px,
            transparent 1px,
            transparent 2px
        );
    pointer-events: none;
    z-index: 1;
    animation: matrix-flicker 0.15s infinite;
}

.container > * {
    position: relative;
    z-index: 2;
}

.footer {
    padding: 40px;
    text-align: center;
    margin-top: 50px;
    transition: background-color 0.3s, border-top 0.3s;
}

body.light-theme .footer {
    background-color: #f0f0f0;
    border-top: 2px solid #ddd;
}

body.dark-theme .footer {
    background-color: #051428;
    border-top: 2px solid #0d2847;
}

.info-section {
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
}

.info-text {
    font-size: 18px;
    text-align: justify;
    line-height: 1.6;
    margin-bottom: 15px;
    color: inherit;
}

.download-btn {
    display: block;
    width: 100%;
    padding: 15px;
    background-color: #007bff;
    color: white;
    text-align: center;
    text-decoration: none;
    font-size: 18px;
    border-radius: 5px;
    transition: background-color 0.3s;
    box-sizing: border-box;
    margin-top: 20px;
}

.download-btn:hover {
    background-color: #0056b3;
}

.dark-theme .download-btn {
    background-color: #0056b3;
}

.dark-theme .download-btn:hover {
    background-color: #003d82;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.copyright {
    margin-bottom: 20px;
    font-size: 16px;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 15%;
    text-decoration: none;
    transition: all 0.3s;
    font-weight: bold;
    font-size: 18px;
}

body.light-theme .social-links a {
    background-color: #e0e0e0;
    color: #000;
    border: 2px solid #000;
}

body.dark-theme .social-links a {
    background-color: #555;
    color: #fff;
    border: 2px solid #fff;
}

.social-links a:hover {
    transform: scale(1.15);
}

/*Сетка с проектами*/
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(clamp(120px, 20vw, 250px), 1fr));
    gap: 20px;
    padding: 20px;
    max-width: 100%;
    margin: 0 auto;
}

.grid-item {
    aspect-ratio: 1 / 1.3;
    overflow: hidden;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.grid-item:hover {
    transform: scale(1.05);
}

.grid-item a {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    text-decoration: none;
    color: inherit;
}

.grid-image {
    width: 100%;
    height: 75%;
    object-fit: cover;
}

.grid-title {
    width: 100%;
    height: 25%;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: clamp(12px, 3vw, 24px);
    background-color: rgba(0, 0, 0, 0.2);
    word-wrap: break-word;
    overflow: hidden;
}

.header-text {
    padding: 28px;
}

body.light-theme .grid-image {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

body.dark-theme .grid-image {
    box-shadow: 0 4px 8px rgba(255, 255, 255, 0.2);
}

ul {
    list-style: none;
    padding-left: 0;
}

ul li {
    margin-bottom: 10px;
}

ul li::before {
    content: ">";
    margin-right: 10px;
    color: #0088cc;
    font-size: 18px;
}

table {
    text-align: center;
    border-collapse: collapse;
}

table td, table th {
    text-align: center;
    padding: 4px;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
}

.comparison-table th,
.comparison-table td {
    border: 1px solid;
    padding: 8px;
}

@media (max-width: 600px) {
    .navbar {
        flex-direction: column;
        height: auto;
        padding: 15px 20px;
        gap: 10px;
    }

    .navbar-left,
    .navbar-right {
        width: 100%;
        justify-content: center;
        margin: 10px 0;
    }

    .logo {
        width: 50px;
        height: 50px;
    }

    .org-name {
        font-size: 22px;
    }

    .container {
        margin-top: 160px;
    }
}

@media (max-width: 400px) {
    .navbar {
        padding: 10px;
    }

    .navbar-right {
        flex-direction: column;
        gap: 10px;
    }

    .theme-toggle {
        flex-direction: column;
    }

    .theme-btn {
        padding: 6px 12px;
        font-size: 14px;
    }
}
