/* Основные настройки и Переменные */
:root {
    --text-color: #000000;
    --text-logo-color: #000000;
    --text-nav-color: rgba(0, 0, 0, 1);
    --text-nav-h-color: #ffffff;
    --bg-primary: #dedede;
    --bg-secondary: #ffffff;
    --bg-navbar: rgba(255, 255, 255, 0.5);
    --bg-hover: rgba(0, 0, 0, 0.1);
    --bg-knopka: #eee;
    --bg-section: #fafafa;
    --bg-intro: #e8e8e8;
    --bg-highlight: #e8f4fc;
    --bg-footer: #757c7e;
    --bg-footer-border: #2d3436;
    --border-color: #ccc;
    --border-intro: #7e7e7e;
    --border-highlight: #3498db;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --shadow-nav: rgba(0, 0, 0, 0.2);
    --shadow-dropdown: rgba(0, 0, 0, 0.2);
    --slider-bg-transparent: rgba(255, 255, 255, 0.3);
    --characteristics-bg: rgba(0, 0, 0, 0.2);
    --hr-color: #333;
}

.dark-theme {
    --text-color: #32b25f;
    --text-logo-color: #ffffff;
    --text-nav-color: #ffffff;
    --text-nav-h-color: #000000;
    --bg-primary: #1a1a1a;
    --bg-secondary: #121212;
    --bg-navbar: rgba(0, 0, 0, 0.7);
    --bg-hover: rgba(255, 255, 255, 0.1);
    --bg-knopka: #333;
    --bg-section: #1e1e1e;
    --bg-intro: #2d2d2d;
    --bg-highlight: #2d3f26;
    --bg-footer: #2d3436;
    --bg-footer-border: #1a1a1a;
    --border-color: #444;
    --border-intro: #555;
    --border-highlight: #628754;
    --shadow-color: rgba(0, 0, 0, 0.5);
    --shadow-nav: rgba(0, 0, 0, 0.4);
    --shadow-dropdown: rgba(0, 0, 0, 0.4);
    --slider-bg-transparent: rgba(0, 0, 0, 0.3);
    --characteristics-bg: rgba(255, 255, 255, 0.1);
    --hr-color: #007013;
}

@media (prefers-color-scheme: dark) {
    :root:not(.dark-theme) {
        --text-color: #000000;
        --text-logo-color: rgba(0, 0, 0, 0.9);
        --text-nav-color: rgba(0, 0, 0, 1);
        --text-nav-h-color: #ffffff;
        --bg-primary: #dedede;
        --bg-secondary: #ffffff;
        --bg-navbar: rgba(255, 255, 255, 0.5);
        --bg-hover: rgba(0, 0, 0, 0.1);
        --bg-knopka: #eee;
        --bg-section: #fafafa;
        --bg-intro: #e8e8e8;
        --bg-highlight: #e8f4fc;
        --bg-footer: #757c7e;
        --bg-footer-border: #2d3436;
        --border-color: #ccc;
        --border-intro: #7e7e7e;
        --border-highlight: #3498db;
        --shadow-color: rgba(0, 0, 0, 0.3);
        --shadow-nav: rgba(0, 0, 0, 0.2);
        --shadow-dropdown: rgba(0, 0, 0, 0.2);
        --slider-bg-transparent: rgba(255, 255, 255, 0.3);
        --characteristics-bg: rgba(0, 0, 0, 0.2);
        --hr-color: #333;
    }
}

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

html {
    scroll-behavior: smooth;
}

body {
    line-height: 1.6;
    position: relative;
    background: var(--bg-primary);
    background-attachment: fixed;
    background-image: url("backgrounds/bg.jpg");
    font-family: 'Segoe UI', 'Verdana', sans-serif;
    transition: background-color 0.3s, color 0.3s;
}

.dark-theme body {
    background-image: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    background-image: url("backgrounds/bg_2.jpg");
    background-size: 1500px;
    font-family: Cascadia Code, Cascadia Mono, Arial;
}

.maket {
    max-width: 1500px;
    background-color: var(--bg-secondary);
    margin: 0 auto;
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Навигация и Меню */
.navbar {
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
    background: var(--bg-navbar);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 0 0 15px 15px;
    box-shadow: 0 8px 32px 0 var(--shadow-nav);
    border: 1px solid rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    padding: 1rem 2rem;
    position: fixed;
    left: 0;
    right: 0;
    z-index: 1000;
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    transition: background-color 0.3s;
}

.logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-logo-color);
    transition: color 0.3s;
    text-decoration: none;
    flex-shrink: 0;
}

.logo:hover {
    text-decoration: underline;
}

.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    margin-left: auto;
}

.nav-links li {
    margin-left: 20px;
    position: relative;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-nav-color);
    font-size: 1.1rem;
    transition: color 0.3s;
    display: block;
    padding: 8px 0;
}

.nav-links li:hover {
    border-radius: 8px;
    background-color: var(--bg-hover);
}

.dropdown-content {
    display: none;
    position: absolute;
    background: var(--bg-secondary);
    min-width: 180px;
    box-shadow: 0px 8px 16px 0px var(--shadow-dropdown);
    z-index: 1001;
    top: 100%;
    left: 0;
    padding: 10px 0;
    border-radius: 4px;
    overflow: hidden;
    transition: opacity 0.3s;
}

.dropdown-content li {
    margin: 0;
    display: block;
}

.dropdown-content li a {
    color: var(--text-nav-color);
    padding: 10px 20px;
}

.dropdown-content li a:hover {
    background-color: var(--bg-hover);
    border-radius: 8px;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dark-theme .dropdown-content {
    background: #2d2d2d;
}

.dark-theme .dropdown-content li a {
    color: #e0e0e0;
}

.theme-btn {
    background-color: var(--bg-knopka);
    width: 35px;
    height: 35px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    padding: 0;
    transition: all 0.3s ease;
    color: var(--text-nav-color);
    border: none;
    border-radius: 15px;
    margin-left: 20px;
}

.theme-btn:hover {
    background-color: var(--bg-hover);
    transform: scale(1.1);
    border: 2px solid var(--border-color);
    border-radius: 15px;
}

.theme-btn:active {
    transform: scale(0.95);
}

.dark-theme .theme-btn {
    color: var(--text-nav-color);
}

.dark-theme .theme-btn:hover {
    background-color: var(--bg-hover);
}

.hamburger {
    display: none;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.3);
    border: none;
    padding: 5px;
    border-radius: 3px;
    border: 1px solid var(--border-color);
    box-shadow: 5px 5px 15px var(--shadow-color);
    transition: background-color 0.3s;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: var(--bg-secondary);
    transition: 0.3s;
}

/* Прогресс-бар */
#progress_bar_cont {
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    z-index: 2000;
    background: transparent;
    pointer-events: none;
}

#progress {
    background-color: rgba(42, 157, 234, 0.9);
    height: 4px;
    width: 0%;
    transition: width 0.1s linear;
    box-shadow: 0 0 10px rgba(42, 157, 234, 0.5);
}

.dark-theme #progress {
    background-color: rgba(0, 220, 0, 0.8);
    box-shadow: 0 0 10px rgba(0, 220, 0, 0.5);
}

/* Основной Контент и Типография */
.main-content {
    background-color: var(--bg-section);
    color: var(--text-color);
    padding: 2rem;
    min-height: 400px;
    margin-top: 90px;
    flex: 1;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 5px 5px 15px var(--shadow-color);
    transition: background-color 0.3s, color 0.3s;
}

h1 {
    color: var(--text-color);
    font-size: 2.5em;
    margin-bottom: 10px;
    transition: color 0.3s;
}

h2 {
    color: var(--text-color);
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    margin-top: 30px;
    transition: color 0.3s, border-color 0.3s;
}

.p {
    color: var(--text-color);
    margin: 0 auto;
    font-size: 1.2rem;
    width: 83%;
    transition: color 0.3s;
}

.p2 {
    font-size: 1.1rem;
    transition: color 0.3s;
    color: var(--text-color);
}

.main_p {
    color: var(--text-color);
    font-size: 2.3rem;
    font-weight: bold;
    margin: 0 auto;
    text-align: center;
    transition: color 0.3s;
}

.a2 {
    color: var(--text-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.a2:hover {
    color: var(--border-highlight);
    border-bottom: 1px solid var(--border-highlight);
}

.ul {
    padding-left: 20px;
    margin: 15px 0;
    color: var(--text-color);
}

.li {
    font-size: 1.1rem;
    margin-bottom: 8px;
    padding-left: 5px;
    color: var(--text-color);
    transition: color 0.3s;
}

.intro {
    background-color: var(--bg-intro);
    padding: 20px;
    border-left: 4px solid var(--border-intro);
    border-radius: 5px;
    margin: 20px 0;
    transition: background-color 0.3s, border-color 0.3s;
}

.section {
    margin-bottom: 30px;
}

.highlight {
    background-color: var(--bg-highlight);
    padding: 20px;
    border-radius: 5px;
    margin: 25px 0;
    border-left: 4px solid var(--border-highlight);
    transition: background-color 0.3s, border-color 0.3s;
}

.hr {
    width: 300px;
    height: 4px;
    border-radius: 6px;
    margin: 0 auto;
    background-color: var(--hr-color);
    transition: background-color 0.3s;
}

.photo_main_section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background-color: var(--bg-section);
    padding: 2rem;
    margin-top: 90px;
    flex: 1;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 5px 5px 15px var(--shadow-color);
    transition: background-color 0.3s;
}

.h {
    margin: 0 auto;
    position: relative;
}

.photo_main_img {
    float: left;
    margin-left: 40px;
    height: 500px;
}

.photo {
    height: 250px;
    border-radius: 100%;
    float: left;
    margin-right: 15px;
    transition: border-radius 0.3s;
    border: 0px solid var(--border-color);
    box-shadow: 5px 5px 15px var(--shadow-color);
}

.photo:hover {
    border-radius: 5%;
    transition: border-radius 0.3s;
}

.photo_basic {
    border-radius: 5px;
    box-shadow: 0 4px 12px var(--shadow-color);
    border: 1px solid var(--border-color);
    margin: 0 15px;
}

.photo-alt-container {
    float: left;
    width: 180px;
    height: 250px;
    margin-right: 25px;
    margin-bottom: 15px;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.photo-alt {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease-in-out;
    animation: alternateImages 10s infinite;
}

.photo-alt:last-child {
    animation-delay: 5s;
    opacity: 0;
}

.dop_container {
    background-color: var(--bg-section);
    color: var(--text-color);
    padding: 1rem;
    min-height: 280px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 5px 5px 15px var(--shadow-color);
    transition: background-color 0.3s, color 0.3s;
}

/* Кнопки и Формы */
.button {
    display: inline-block;
    padding: 12px 28px;
    background: linear-gradient(135deg, #2a9dea, #1d6fa5);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.1rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.h .button {
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
    margin-top: 25px !important;
    width: fit-content !important;
}

.button:hover {
    background: linear-gradient(135deg, #1d6fa5, #2a9dea);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(42, 157, 234, 0.3);
}

.button:active {
    transform: translateY(0);
}

.dark-theme .button {
    background: linear-gradient(135deg, #00c853, #007013);
}

.dark-theme .button:hover {
    background: linear-gradient(135deg, #007013, #00c853);
    box-shadow: 0 5px 15px rgba(0, 200, 83, 0.3);
}

.form-input-custom {
    width: 100%;
    padding: 12px;
    margin-top: 5px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-color);
    font-family: inherit;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-input-custom:focus {
    outline: none;
    border-color: var(--border-highlight);
    box-shadow: 0 0 8px var(--border-highlight);
}

.form-label {
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 8px;
    display: block;
}

/* Слайдеры */
.slider-container {
    position: relative;
    width: 100%;
    height: 335px;
    margin-top: 10px;
    overflow: hidden;
    background-color: var(--bg-section);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 5px 5px 15px var(--shadow-color);
}

.slider-container_2 {
    position: relative;
    width: 100%;
    height: 500px;
    margin-top: 5px;
    overflow: hidden;
    background-color: var(--slider-bg-transparent);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 5px 5px 15px var(--shadow-color);
}

.slide {
    display: none;
    width: 100%;
    max-height: 100%;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    text-align: center;
    border-radius: 8px;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.slide_2 {
    display: none;
    width: 100%;
    max-height: 100%;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    text-align: center;
    border-radius: 8px;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.slide.active-slide {
    display: flex;
    opacity: 1;
    z-index: 1;
    animation: fade 1.5s;
}

.slide_2.active-slide_2 {
    display: flex;
    opacity: 1;
    z-index: 1;
    animation: fade 1.5s;
}

.photo_slide {
    max-height: 600px;
    transform: translate(100px, 0);
    transition: transform 0.3s ease-in-out;
}

.slide:hover .photo_slide {
    transform: translateX(-50px);
    transition: transform 0.3s ease-in-out;
}

.characteristics {
    position: relative;
    display: inline-block;
    background-color: var(--characteristics-bg);
    padding: 10px;
    border-radius: 15px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    pointer-events: none;
    z-index: 10;
    color: var(--text-color);
}

.slide:hover .characteristics {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.prev-btn, .next-btn,
.prev-btn_2, .next-btn_2 {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -22px;
    color: white;
    font-weight: bold;
    font-size: 18px;
    border: none;
    background-color: rgba(0, 0, 0, 0.5);
    transition: 0.3s ease;
    z-index: 100;
    border-radius: 4px;
}

.next-btn { right: 10px; }
.prev-btn { left: 10px; }
.next-btn_2 { right: 10px; }
.prev-btn_2 { left: 10px; }

.prev-btn:hover, .next-btn:hover,
.prev-btn_2:hover, .next-btn_2:hover {
    background-color: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

/* Интерактивные элементы и SVG */
.main-grid {
    display: flex;
    flex-direction: row;
    gap: 50px;
    align-items: flex-start;
}

.content-text {
    flex: 1;
    min-width: 0;
}

.pc-interactive-wrapper {
    position: relative;
    width: 100%;
    max-width: 600px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    box-shadow: 5px 5px 15px var(--shadow-color);
    flex: 0 0 45%;
}

.pc-interactive-wrapper:hover {
    border-radius: 10px;
    border: 1px solid var(--border-highlight);
    box-shadow: 5px 5px 15px var(--shadow-color);
}

.pc-base-img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    box-shadow: 5px 5px 15px var(--shadow-color);
}

.pc-base-img:hover {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 10px;
    border: 1px solid var(--border-highlight);
    box-shadow: 5px 5px 15px var(--shadow-color);
}

.pc-svg-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
}

.part-link {
    pointer-events: all;
    outline: none;
}

.part-shape {
    fill: rgba(255, 255, 255, 0);
    stroke: white;
    stroke-width: 0;
    transition: all 0.25s ease-out;
    transform-origin: center;
}

.part-link:hover .part-shape:not(.mb-full-body) {
    stroke-width: 4px;
    fill: rgba(255, 255, 255, 0.15);
    transform: scale(1.03);
}

.mb-trigger, .edge-trigger {
    fill: rgba(255, 255, 255, 0);
    cursor: pointer;
}

.case-group:hover .case-full-body {
    stroke-width: 5px;
    stroke: rgba(255, 255, 255, 0.8);
    fill: rgba(255, 255, 255, 0.05);
}

.mb-group:hover .mb-full-body {
    stroke-width: 5px;
    fill: rgba(255, 255, 255, 0.1);
}

.fan-group:hover .part-shape {
    stroke-width: 3px;
    fill: rgba(255, 255, 255, 0.08);
}

/* Инфоблоки и Подсказки */
.info {
    margin: 20px 0;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background-color: var(--bg-section);
    box-shadow: 0 4px 12px var(--shadow-color);
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.2s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.info:hover {
    border-color: var(--border-highlight);
    box-shadow: 0 6px 15px var(--shadow-color);
}

.info h1 {
    margin: 0;
    padding: 20px 25px;
    font-size: 1.4rem;
    color: var(--text-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: none;
    background: transparent;
    transition: background-color 0.3s ease;
}

.info h1::after {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    border-right: 2px solid var(--text-color);
    border-bottom: 2px solid var(--text-color);
    transform: rotate(45deg);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin-left: 15px;
    opacity: 0.7;
}

.info.opened {
    border-color: var(--border-highlight);
    cursor: default;
}

.info.opened h1::after {
    transform: rotate(-135deg);
    border-color: var(--border-highlight);
}

.info .content-wrapper {
    display: none;
    padding: 0 25px 25px 25px;
    color: var(--text-color);
    line-height: 1.6;
    opacity: 0;
}

.info.opened .content-wrapper {
    display: block;
    animation: slideDownFade 0.4s ease forwards;
    opacity: 1;
}

.info.target-flash {
    animation: highlight-blink 1s ease-in-out;
}

.hint-section {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    margin: 40px 0 0 0;
}

.hint-item {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.hint-btn-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 5px;
}

.hint-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--bg-highlight);
    border: 2px solid var(--border-highlight);
    color: var(--text-color);
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, transform 0.2s ease;
    flex-shrink: 0;
    outline: none;
}

.hint-btn:hover {
    background-color: var(--bg-hover);
    transform: scale(1.05);
}

.hint-btn.active {
    background-color: var(--bg-intro);
    border-color: var(--border-intro);
}

.hint-line {
    flex: 1;
    height: 2px;
    background-color: var(--border-color);
    opacity: 0.5;
}

.hint-content {
    max-height: 0;
    overflow: hidden;
    background-color: var(--bg-highlight);
    border-radius: 8px;
    border: 1px solid transparent;
    transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    margin-top: 0;
}

.hint-content.active {
    min-height: 440px;
    opacity: 1;
    border-color: var(--border-highlight);
    margin-top: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.hint-content-inner {
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-color);
}

.hint-content-inner strong {
    color: var(--text-color);
    display: block;
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.content-below-hints {
    transition: margin-top 0.3s ease;
}

/* Симуляторы (Тьюринг, Квант) и Результаты */
.turing-app-container {
    background: var(--bg-section);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 40px;
    margin: 30px 0;
}

.turing-app-container:hover {
    border: 1px solid var(--border-highlight);
}

.turing-visual-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    transition: gap 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.scanner-body {
    background: #f39c12;
    color: #fff;
    padding: 12px 25px;
    border-radius: 10px;
    font-weight: bold;
    box-shadow: 0 10px 20px rgba(243,156,18,0.2);
}

.state-badge { font-size: 0.8rem; font-weight: normal; opacity: 0.9; }

.tape-viewport {
    width: 100%;
    max-width: 500px;
    background: #1a1c20;
    border: 3px solid #333;
    border-radius: 50px;
    overflow: hidden;
    padding: 5px;
}

.tape-track { display: flex; transition: transform 0.5s ease; justify-content: center; }

.cell {
    min-width: 50px; height: 50px;
    background: white; color: black;
    display: flex; align-items: center; justify-content: center;
    border-right: 1px solid #ddd;
    font-weight: bold; font-family: monospace;
}

.cell.active { background: #ffeb3b; color: #000; scale: 1.1; z-index: 2; }

.logic-unit {
    background: #2c3e50; color: white;
    padding: 15px 30px; border-radius: 15px;
    text-align: center; border-bottom: 4px solid #1a252f;
}

.highlight-val { color: #f39c12; font-weight: bold; }

.step-cards {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px; margin-top: 20px;
}

.s-card {
    background: var(--bg-section); padding: 15px;
    border-radius: 12px; border: 1px solid var(--border-color);
    transition: 0.3s;
}

.s-card.active { border-color: #f39c12; background: rgba(243,156,18,0.05); }

.s-num {
    width: 30px; height: 30px; background: #f39c12; color: white;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    margin-bottom: 10px; font-weight: bold;
}

.quantum-simulator {
    background: var(--bg-section);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 40px;
    margin: 30px 0;
    text-align: center;
    box-shadow: 0 4px 15px var(--shadow-color);
}

.qubit-stage {
    display: flex;
    justify-content: center;
    gap: 50px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.bit-box, .qubit-box {
    width: auto;
    padding: 20px;
    border-radius: 15px;
    border: 2px solid var(--border-color);
    background: var(--bg-secondary);
    transition: all 0.3s ease;
}

.state-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    color: white;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.bit-0 .state-circle { background: #e74c3c; box-shadow: 0 0 15px rgba(231, 76, 60, 0.5); }
.bit-1 .state-circle { background: #27ae60; box-shadow: 0 0 15px rgba(39, 174, 96, 0.5); }

.qubit-superposition .state-circle {
    background: linear-gradient(135deg, #e74c3c, #8e44ad, #27ae60);
    background-size: 400% 400%;
    animation: qubit-spin 2s ease infinite;
    filter: blur(1px);
    color: transparent;
}

.qubit-measured-0 .state-circle { background: #e74c3c; transform: scale(1.1); }
.qubit-measured-1 .state-circle { background: #27ae60; transform: scale(1.1); }

.probability-bar {
    height: 6px;
    background: #ddd;
    border-radius: 3px;
    margin-top: 10px;
    overflow: hidden;
    position: relative;
}

.prob-fill {
    height: 100%;
    background: #8e44ad;
    width: 50%;
    transition: width 0.3s;
}

.q-logs {
    font-family: monospace;
    color: var(--text-color);
    margin-top: 15px;
    min-height: 1.6em;
}

#result_area {
    animation: slideUp 0.5s ease-out;
    border: 2px solid var(--border-highlight);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Футер и Кнопка наверх */
.footer {
    background-color: var(--bg-footer);
    color: white;
    text-align: center;
    padding: 1.5rem;
    margin-top: 10px;
    border-radius: 8px 8px 0 0;
    border: 0px solid var(--border-color);
    box-shadow: 5px 5px 15px var(--shadow-color);
    border-top: 5px solid var(--bg-footer-border);
    transition: background-color 0.3s;
}

.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: rgba(0,0,0,0.6);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: all 0.3s ease;
    z-index: 999;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    text-decoration: none;
}

.dark-theme .scroll-top {
    background-color: rgba(0,0,0,0.9);
}

.scroll-top:hover {
    opacity: 1;
    background-color: rgba(0,0,0,0.8);
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.dark-theme .scroll-top:hover {
    background-color: #000000;
}

.scroll-top:focus {
    outline: 2px solid var(--border-color);
    outline-offset: 2px;
}

/* Анимации */
@keyframes fade {
    from {opacity: .4}
    to {opacity: 1}
}

@keyframes slideFade {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideDownFade {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes highlight-blink {
    0% {
        background-color: var(--bg-section);
        box-shadow: 0 4px 12px var(--shadow-color);
    }
    30% {
        background-color: var(--bg-highlight);
        transform: scale(1.02);
        box-shadow: 0 6px 20px var(--shadow-color);
    }
    100% {
        background-color: var(--bg-section);
        transform: scale(1);
        box-shadow: 0 4px 12px var(--shadow-color);
    }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes qubit-spin {
    0% { background-position: 0% 50%; transform: rotate(0deg); }
    50% { background-position: 100% 50%; transform: rotate(180deg); }
    100% { background-position: 0% 50%; transform: rotate(360deg); }
}

@keyframes alternateImages {
    0%, 45% { opacity: 1; }
    50%, 95% { opacity: 0; }
    100% { opacity: 1; }
}

/* Адаптивность (Mobile) */
@media screen and (max-width: 768px) {
    .navbar {
        padding: 0.8rem 1rem;
        max-width: calc(100% - 30px);
        left: 15px;
        right: 15px;
        width: auto;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0;
        position: fixed;
    }

    .theme-btn {
        margin-left: 0;
        position: absolute;
        width: 40px;
        height: 40px;
        left: 0;
        z-index: 1002;
    }

    .logo {
        position: relative;
        transform: none;
        flex-grow: 0;
        text-align: center;
        font-size: 1.3rem;
        white-space: nowrap;
        margin: 0;
        z-index: 1001;
    }

    .hamburger {
        display: block;
        position: absolute;
        width: 40px;
        height: 40px;
        right: 0;
        z-index: 1002;
    }

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

    .dark-theme .scroll-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 22px;
        background-color: rgba(0, 0, 0, 0.9);
    }

    .dark-theme .hamburger {
        display: block;
        background-color: #555;
    }

    .photo_main_img {
        float: left;
        margin-left: 40px;
        height: 250px;
    }

    .hr {
        width: 120px;
        height: 2px;
    }

    .h {
        display: block;
        margin: 0 auto;
        width: 100%;
    }

    .main_p {
        color: var(--text-color);
        font-size: 1.2rem;
        font-weight: bold;
    }

    .photo_basic {
        float: none !important;
        margin: 0 !important;
    }

    .photo_main_section {
        display: block;
        background-color: var(--bg-secondary);
        padding: 2rem;
        margin-top: 80px;
        flex: 1;
        border-radius: 8px;
        border: 1px solid var(--border-color);
        box-shadow: 5px 5px 15px var(--shadow-color);
    }

    .p {
        color: var(--text-color);
        font-size: 0.6rem;
    }

    .nav-links {
        position: fixed;
        top: 70px;
        left: 15px;
        right: 15px;
        width: calc(100% - 30px);
        background-color: var(--bg-footer-border);
        flex-direction: column;
        align-items: center;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease-out;
        padding: 0;
        border-radius: 0 0 8px 8px;
        z-index: 999;
    }

    .nav-links li {
        margin: 0;
        width: 100%;
        text-align: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-links li:last-child {
        border-bottom: none;
    }

    .nav-links a {
        color: var(--text-nav-h-color);
        padding: 15px;
    }

    .nav-links.active {
        max-height: 1000px;
        padding: 10px 0;
    }

    .dropdown-content {
        position: static;
        display: none;
        width: 100%;
        box-shadow: none;
        background-color: #444;
        border-radius: 0;
        padding: 0;
    }

    .dropdown.active .dropdown-content {
        display: block;
    }

    .dropdown-content li a {
        color: var(--text-nav-h-color);
        padding: 10px 30px;
        text-align: left;
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }
    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .dark-theme .dropdown {
        color: #e0e0e0;
    }

    .dark-theme .dropdown-content {
        background: #2d2d2d;
    }

    .dark-theme .nav-links a {
        color: #ffffff !important;
    }

    .dark-theme .dropdown-content li a {
        color: #ffffff !important;
    }

    .slider-container {
        position: relative;
        width: 100%;
        height: 200px;
        overflow: hidden;
        background-color: var(--bg-section);
        margin-top: 8px;
        border-radius: 8px;
        border: 1px solid var(--border-color);
        box-shadow: 5px 5px 15px var(--shadow-color);
    }

    .slider-container_2 {
        display: none;
    }

    .slide {
        display: none;
    }

    ul {
        font-size: 10pt;
    }

    .characteristics {
        position: relative;
        display: inline-block;
        background-color: var(--characteristics-bg);
        padding: 5px;
        border-radius: 2px;
        opacity: 0;
        transform: translateY(10px);
        transition: opacity 0.6s ease, transform 0.6s ease;
        pointer-events: none;
        z-index: 10;
    }

    .photo_slide {
        max-height: 300px;
        transform: translate(50px, 0);
        transition: transform 0.3s ease-in-out;
    }

    .button {
        display: block;
        margin: 20px auto 0 auto;
        width: 100%;
        max-width: 280px;
        padding: 14px 24px;
        font-size: 1rem;
    }

    .slide.active-slide {
        display: flex;
        animation: fade 1.5s;
    }

    .main-content {
        margin-top: 80px;
        padding: 1.5rem;
    }

    .main-grid {
        display: flex;
        flex-direction: column;
    }

    .content-text {
        order: 1;
    }

    .pc-interactive-wrapper {
        order: 2;
        flex: 0 0 100%;
        max-width: 100%;
        margin-top: 20px;
    }

    .pc-base-img {
        width: 100%;
        height: auto;
    }

    .hint-section {
        flex-direction: column;
        gap: 20px;
    }

    .hint-btn {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }

    .hint-content.active {
        padding: 16px;
        max-height: 250px;
    }

    .info {
        margin-top: 8px;
        padding: 1.5rem;
    }

    .footer {
        margin-top: 8px;
    }

    h1 {
        font-size: 2em;
    }

    .nav-links .theme-btn {
        border-color: var(--text-nav-h-color);
        color: var(--text-nav-h-color);
    }
}

/* Адаптивность (Tablet) */
@media screen and (min-width: 769px) and (max-width: 1124px) {
    .navbar {
        padding: 0.7rem 0.8rem;
        max-width: calc(100% - 40px);
        left: 20px;
        right: 20px;
        width: auto;
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);
        justify-content: space-between;
        gap: 5px;
        min-height: 60px;
    }

    .logo {
        font-size: 1rem;
        flex-shrink: 0;
        white-space: nowrap;
        max-width: 180px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .nav-links {
        gap: 4px;
        justify-content: flex-end;
        flex-shrink: 1;
        flex-grow: 1;
        margin-left: 10px;
        min-width: 0;
    }

    .nav-links li {
        margin-left: 4px;
        flex-shrink: 1;
        min-width: 0;
    }

    .nav-links a {
        font-size: 0.85rem;
        padding: 4px 6px;
        white-space: nowrap;
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .nav-links li a {
        font-size: 0.82rem;
        letter-spacing: -0.2px;
    }

    .dropdown-content {
        min-width: 140px;
        font-size: 0.8rem;
    }

    .dropdown-content li a {
        padding: 8px 12px;
        font-size: 0.85rem;
        white-space: nowrap;
        overflow: visible;
        text-overflow: clip;
        max-width: none;
        color: var(--text-nav-color);
        position: relative;
    }

    .theme-btn {
        width: 34px;
        height: 34px;
        font-size: 1rem;
        flex-shrink: 0;
        margin-left: 5px;
    }

    .maket {
        padding: 0 20px;
    }

    .photo_main_img {
        height: 300px;
        margin-left: 15px;
        max-width: calc(100% - 30px);
    }

    .photo_main_section {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 15px;
        padding: 1rem;
        margin-top: 75px;
    }

    .main_p {
        font-size: 1.3rem;
        line-height: 1.2;
    }

    .p {
        font-size: 0.9rem;
        width: 100%;
        line-height: 1.4;
    }

    .button {
        display: block;
        margin: 20px auto 0 auto;
        width: 100%;
        max-width: 300px;
        padding: 14px 28px;
        font-size: 0.7rem;
    }

    .slider-container {
        height: 200px;
    }

    .slider-container_2 {
        height: 300px;
    }

    .photo_slide {
        max-height: 320px;
        max-width: 100%;
        transform: translate(30px, 0);
    }

    .characteristics {
        padding: 5px 6px;
        font-size: 0.75rem;
        max-width: 160px;
    }

    .slide:hover .photo_slide {
        transform: translateX(-15px);
    }

    .main-content {
        padding: 1rem;
        margin-top: 75px;
        font-size: 0.9rem;
    }

    h1 {
        font-size: 1.6em;
        margin-bottom: 10px;
    }

    h2 {
        font-size: 1.3em;
        margin-top: 18px;
        padding-bottom: 5px;
    }

    .hint-section {
        gap: 12px;
        margin-top: 20px;
    }

    .hint-btn {
        width: 38px;
        height: 38px;
        font-size: 15px;
    }

    .hint-content.active {
        min-height: 260px;
        padding: 10px;
    }

    .hint-content-inner {
        font-size: 0.8rem;
        line-height: 1.4;
    }

    .info {
        padding: 1rem;
        font-size: 0.9rem;
    }

    .footer {
        padding: 0.7rem;
        font-size: 0.8rem;
    }

    .scroll-top {
        bottom: 18px;
        right: 18px;
        width: 42px;
        height: 42px;
        font-size: 19px;
    }

    .hr {
        width: 130px;
        height: 2px;
    }

    .li, .p2, .intro, .highlight {
        font-size: 0.85rem;
    }
}