* { 
    box-sizing: border-box; 
}

:root {
    --text: #2c2c2c;
    --title-text: #f0ece6;
    --muted: #4a4a4a;
    --border: #d6d2cc;
    --sidebar: #f0ece6;
    --sidebar-border: #d6d2cc;
    --accent: #2c2c2c;
    --accent-dark: #1e1e1e;
    --active: #d6d2cc;
    --active-text: #1a1a1a;
    --white: #faf8f6;
    --card-bg: #f0ece6;
    --page-bg: #1e1e1e;
    --heart-color: #e74c3c;
}

body {
    margin: 0;
    font-family: 'Segoe UI', 'Roboto', system-ui, sans-serif;
    color: var(--text);
    background: var(--page-bg);
    font-size: 14px;
}

.layout {
    min-height: 100vh;
    display: flex;
}

/* Sidebar */
.sidebar {
    width: 240px;
    min-width: 240px;
    border-right: 1px solid var(--sidebar-border);
    background: var(--sidebar);
    display: flex;
    flex-direction: column;
    padding: 28px 18px 20px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 10px 28px;
    border-bottom: 1px solid var(--border);
}

.brand-mark {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    background: #2c2c2c;
    color: var(--title-text);
    font-size: 15px;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid #4a4a4a;
}

.brand-name {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--text);
}

.brand-status {
    margin-top: 3px;
    color: var(--muted);
    font-size: 9px;
    letter-spacing: 1.2px;
}

.nav-title {
    margin: 25px 10px 10px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.3px;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.nav a {
    height: 42px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 12px;
    color: var(--text);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .8px;
    border-left: 3px solid transparent;
    border-radius: 6px;
    transition: 0.15s;
}

.nav a:hover {
    background: #e2ded8;
    color: var(--text);
}

.icon {
    width: 16px;
    text-align: center;
    color: var(--muted);
    font-size: 15px;
}

.heart-icon {
    color: var(--heart-color) !important;
}

.sidebar-footer {
    margin-top: auto;
    border-top: 1px solid var(--border);
    padding: 17px 10px 0;
    color: var(--muted);
    font-size: 11px;
}

.online {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.dot {
    width: 7px;
    height: 7px;
    background: #3d8b5c;
    border-radius: 50%;
}

/* Main Content */
.main {
    flex: 1;
    min-width: 0;
    background: var(--white);
}

.content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 32px 64px 70px;
}

/* CSS SPA Routing */
.page-section {
    display: none;
    animation: fadeIn 0.2s ease-in-out;
}

.page-section:target {
    display: block;
}

#home:not(:target) ~ #documentation:not(:target) ~ #donate:not(:target) {
    display: block;
}

:root:not(:has(:target)) #home {
    display: block;
}

.layout:has(#home:target) .nav a[href="#home"],
.layout:has(#documentation:target) .nav a[href="#documentation"],
.layout:has(#donate:target) .nav a[href="#donate"] {
    background: var(--active);
    color: var(--active-text);
    border-left-color: var(--accent-dark);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.eyebrow {
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 10px;
}

h1 {
    margin: 0;
    font-size: 42px;
    line-height: 1.15;
    letter-spacing: -1px;
    font-weight: 400;
    color: var(--text);
}

.intro {
    max-width: 700px;
    margin: 13px 0 17px;
    color: var(--text);
    font-size: 15px;
    line-height: 1.7;
}

.line {
    height: 1px;
    background: var(--border);
    margin-bottom: 22px;
}

.preview {
    height: 555px;
    border: 1px solid var(--border);
    background: #e8e4de;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 12px;
    border-radius: 10px;
    box-shadow: inset 0 1px 3px rgba(255,255,255,0.6);
}

.preview-inner {
    width: 88%;
    height: 76%;
    border: 1px solid var(--border);
    background: var(--white);
    padding: 22px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.preview-bar {
    height: 10px;
    width: 180px;
    background: var(--border);
    margin-bottom: 25px;
    border-radius: 4px;
}

.preview-row {
    height: 9px;
    margin-bottom: 14px;
    background: #e2ded8;
    border-radius: 4px;
}

.preview-row.short { width: 65%; }
.preview-row.medium { width: 82%; }

.section {
    border: 1px solid var(--border);
    padding: 24px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-bg);
    border-radius: 10px;
    margin-top: 20px;
}

.section h2 {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.section p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.buttons {
    display: flex;
    gap: 10px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 18px;
    border: 1px solid var(--border);
    color: var(--text);
    background: var(--white);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    transition: 0.15s;
}

.button.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--title-text);
    border-radius: 30px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.button:hover {
    background: #e2ded8;
}

.button.primary:hover {
    background: var(--accent-dark);
    transform: scale(1.01);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-top: 20px;
}

.info-card {
    border: 1px solid var(--border);
    padding: 22px;
    background: var(--card-bg);
    border-radius: 10px;
    box-shadow: inset 0 1px 2px rgba(255,255,255,0.8);
}

.info-card h3 {
    margin: 0 0 9px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.info-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
    font-size: 12px;
}

/* Additional Documentation Manual Styles */
.doc-manual {
    margin-top: 35px;
}

.doc-manual h2 {
    font-size: 18px;
    margin-top: 30px;
    margin-bottom: 15px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.doc-manual h3 {
    font-size: 14px;
    margin-top: 20px;
    margin-bottom: 10px;
    color: var(--text);
}

.doc-manual ol, .doc-manual ul {
    margin: 8px 0 16px 20px;
    padding: 0;
}

.doc-manual li {
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--text);
    line-height: 1.6;
}

.doc-manual code {
    font-family: monospace;
    background: var(--white);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--border);
    font-size: 12px;
}

.footer {
    margin-top: 55px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 11px;
    display: flex;
    justify-content: space-between;
}

/* Перенесенные стили из inline */
.heart-symbol {
    color: var(--heart-color);
}

.section-donate {
    margin-bottom: 25px;
}

.button-kofi {
    background: #ff5e5b;
    border-color: #ff5e5b;
}

.heart-margin {
    margin-left: 5px;
}

.crypto-container {
    margin-top: 30px;
}

.crypto-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text);
}

.crypto-grid {
    grid-template-columns: repeat(2, 1fr);
    margin-top: 0;
}

.card-centered {
    text-align: center;
}

.card-centered h3 {
    margin-bottom: 12px;
}

.qr-image {
    width: 250px;
    height: 250px;
    border-radius: 8px;
    border: 1px solid var(--border);
    padding: 8px;
    background: var(--white);
    margin: 0 auto 12px;
    display: block;
}

@media (max-width: 800px) {
    .sidebar {
        width: 190px;
        min-width: 190px;
    }

    .content {
        padding: 40px 30px;
    }

    h1 {
        font-size: 34px;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .layout {
        display: block;
    }

    .sidebar {
        width: 100%;
        min-width: 0;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 15px;
    }

    .brand {
        border-bottom: none;
        padding-bottom: 12px;
    }

    .nav-title {
        display: none;
    }

    .nav {
        flex-direction: row;
        overflow-x: auto;
    }

    .nav a {
        white-space: nowrap;
    }

    .sidebar-footer {
        display: none;
    }

    .content {
        padding: 35px 20px;
    }

    .preview {
        height: 280px;
    }

    .section {
        display: block;
    }

    .buttons {
        margin-top: 18px;
    }

    .footer {
        display: block;
    }

    .crypto-grid {
        grid-template-columns: 1fr;
    }
}

/* Fixed Dimension Media Switcher Container */
.preview {
    position: relative;
    width: 100%;
    max-width: 746px;
    height: 534px;
    margin: 0 auto;
    overflow: hidden;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #e8e4de;
}

/* Slide Container */
.switcher-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.switcher-slide.active {
    opacity: 1;
    visibility: visible;
}

/* Video & Image Sizing within 753x541 */
.switcher-slide iframe {
    width: 746px;
    height: 534px;
    border: none;
    border-radius: 9px;
}

.switcher-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Prevents image distortion */
    border-radius: 9px;
    background-color: #1e1e1e;
}

/* Carousel Indicators */
.switcher-indicators {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.5);
    padding: 6px 14px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
}

.switcher-indicators .dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
}

.switcher-indicators .dot.active {
    background: #ffffff;
    transform: scale(1.25);
}

/* Responsive adjustment for screens narrower than 753px */
@media (max-width: 800px) {
    .preview {
        height: auto;
        aspect-ratio: 753 / 541;
    }
    
    .switcher-slide iframe {
        width: 100%;
        height: 100%;
    }
}