/* PERFORMANCE FIX: Force visible by default — no blank screen waiting for JS */
.reveal-on-scroll {
    opacity: 1 !important; /* Force visible immediately */
    transform: none !important; /* Remove shift */
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
/* Optional: Only hide if JS is active and ready */
.js-active .reveal-on-scroll.pending-reveal {
    opacity: 0 !important;
    transform: translateY(30px) !important;
}

/* Сброс и базовые настройки */
html {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

*, *::before, *::after {
    box-sizing: inherit;
}

body {
    margin: 0;
    padding: 0;
    background-color: #ecfeff;
    font-family: Tahoma, "Segoe UI", Verdana, "DejaVu Sans", "Lucida Grande", "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    color: #3f3f46;
    line-height: 1.65;
}

/* Заголовки — современный стиль */
h1 {
    font-size: 24px;
    color: #0c4a6e;
    font-weight: bold;
    margin-top: 20px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #0891b2;
}

h2 {
    font-size: 20px;
    color: #0e7490;
    font-weight: bold;
    margin-top: 25px;
    margin-bottom: 12px;
}

h3 {
    font-size: 18px;
    font-weight: bold;
    margin-top: 20px;
    margin-bottom: 10px;
    color: #155e75;
}

h4 {
    font-size: 16px;
    color: #06b6d4;
    font-weight: bold;
    margin: 15px 0 10px;
}

h5 {
    font-size: 14px;
    color: #71717a;
    font-weight: bold;
    margin: 5px 0 12px;
}

/* Текст и списки */
p {
    font-size: 16px;
    color: #3f3f46;
    margin: 0 0 16px;
    line-height: 1.6;
}

li {
    margin-bottom: 6px;
    line-height: 1.6;
}

/* Ссылки */
a {
    color: #0e7490;
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #155e75;
    text-decoration: underline;
}

a:visited {
    color: #0f766e;
}

a.underline,
a.underline:visited {
    text-decoration: underline;
}

/* Специфичные ссылки меню */
a.menu-link,
a.menu-link:visited {
    display: block;
    color: #0c4a6e;
    font-weight: 600;
    padding: 8px 12px 8px 16px;
    border-left: 3px solid #0891b2;
    margin: 4px 0;
    background-color: #cffafe;
    border-radius: 0 4px 4px 0;
    transition: all 0.2s;
    text-decoration: none;
}

a.menu-link:hover {
    color: #155e75;
    border-left-color: #06b6d4;
    background-color: #a5f3fc;
    transform: translateX(4px);
}

/* Заголовки меню */
.menu-heading {
    font-size: 14px;
    color: #fff;
    background-color: #155e75;
    font-weight: bold;
    padding: 8px 12px;
    margin: 10px 0 6px;
    border: none;
    border-radius: 4px;
}

/* Элементы меню */
.menu-item {
    background-color: transparent;
    border: none;
    padding: 0;
    margin: 0;
}

.menu-item:hover {
    background-color: transparent;
}

/* Блоки макета */
.page-frame {
    border: 1px solid #5eead4;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(8, 91, 104, 0.12);
}

.brand-mark {
    background-color: #0c4a6e;
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid #155e75;
}

.brand-mark img {
    display: block;
    border-radius: 8px;
    width: 84px;
    height: 84px;
    max-width: 100%;
}

.masthead .masthead-copy img {
    width: 84px;
    height: 84px;
    display: inline-block !important;
}

.masthead {
    background-color: #0c4a6e;
    color: white;
    padding: 16px;
    text-align: center;
    border-bottom: 1px solid #155e75;
    font-size: 22px;
    font-weight: bold;
    letter-spacing: 0.5px;
}


.rail-menu {
    padding: 20px 0;
    background-color: #cffafe;
    border-right: 1px solid #99f6e4;
    width: 186px;
}

.article-pane {
    background-color: #ffffff;
    padding: 24px;
    border-bottom: none;
    font-size: 16px;
}

.article-pane table {
    margin-bottom: 20px;
    width: 100%;
}

/* Футер */
.page-base {
    padding: 14px;
    font-size: 13px;
    color: #5eead4;
    background-color: #0c4a6e;
    text-align: center;
    border-top: 1px solid #155e75;
}

.page-base a {
    color: #a5f3fc;
    text-decoration: underline;
    font-size: 13px;
}

.page-base a:hover {
    color: #2dd4bf;
}

/* Утилиты */
.lead-line {
    font-size: 18px;
    color: #0e7490;
    font-weight: bold;
}

.note-box {
    background-color: #cffafe;
    padding: 12px;
    border-radius: 6px;
    margin: 10px 0;
}

.is-hidden { display: none; }
.is-shown { display: block; }
.spacer-top { margin-top: 16px; }

a.muted-link,
a.muted-link:visited,
a.muted-link:hover {
    color: #3f3f46;
}

/* Макет */
.site-canvas {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.content-column {
    flex: 1;
    min-width: 300px;
    display: block;
    float: none;
    margin: 0;
}

.gutter-west, .gutter-east {
    display: none;
}

@media screen and (min-width: 1400px) {
    .gutter-west {
        display: block;
        width: 180px;
        padding: 10px;
    }
    .gutter-east {
        display: block;
        width: 180px;
        padding: 10px;
        position: sticky;
        top: 20px;
        align-self: flex-start;
    }
}

/* Cookie banner (оставим как есть, но чуть улучшим) */
.consent-bar {
    background: #cffafe;
    color: #134e4a;
    border: 1px solid #5eead4;
    box-shadow: 0 -4px 14px rgba(8, 91, 104, 0.12);
    font-family: Tahoma, "Segoe UI", Verdana, sans-serif;
    font-size: 14px;
    padding: 12px 16px;
    z-index: 9001;
}

.consent-bar .consent-ok {
    background-color: #0891b2;
    color: #fff;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.consent-bar .consent-ok:hover {
    background-color: #0e7490;
}

.consent-bar a {
    color: #155e75;
    font-weight: bold;
}

/* Анимация баннера */
@keyframes slideUp {
    from { transform: translateY(40px); }
    to { transform: translateY(0); }
}
.consent-bar {
    animation: slideUp 0.6s ease-out;
}
.masthead {
    background-color: #0c4a6e;
    padding: 20px 0;
    text-align: center;
    border-bottom: 3px solid #0891b2;
}

.masthead .masthead-copy {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.masthead h1 {
    margin: 0;
    font-size: 28px;
    color: white;
    font-weight: bold;
    letter-spacing: 1px;
}

.masthead hr {
    border: 0;
    border-top: 1px solid #22d3ee;
    width: 80%;
    margin: 10px auto;
}

.masthead p {
    margin: 0;
    font-size: 16px;
    color: #a5f3fc;
    font-style: italic;
}

/* Floating Download button — fixed bottom-right, stays visible while scrolling */
.dock-get-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: inline-block;
    padding: 12px 24px;
    background: linear-gradient(135deg, #0891b2 0%, #06b6d4 100%);
    color: #fff !important;
    font-weight: bold;
    font-size: 15px;
    text-decoration: none !important;
    border-radius: 8px;
    box-shadow: 0 4px 18px rgba(14, 116, 144, 0.45);
    transition: transform 0.2s, box-shadow 0.2s;
}
.dock-get-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(8, 145, 178, 0.55);
    color: #fff !important;
    text-decoration: none !important;
}
.dock-get-btn:visited {
    color: #fff !important;
}

/* Features section — small thumbnails */
.feature-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 20px 0 24px;
    justify-content: center;
}
.feature-thumb {
    padding: 0;
    border: 2px solid #2dd4bf;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.feature-thumb:hover {
    border-color: #0891b2;
    box-shadow: 0 4px 14px rgba(8, 145, 178, 0.35);
    transform: scale(1.03);
}
.feature-thumb img {
    display: block;
    width: 120px;
    height: 90px;
    object-fit: cover;
    vertical-align: middle;
}

/* Lightbox — full-screen overlay, slide left/right */
.gallery-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}
.gallery-overlay[hidden] {
    display: none !important;
}
.gallery-stage {
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.gallery-stage img {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 4px;
}
.gallery-caption {
    margin: 12px 0 0;
    color: #a5f3fc;
    font-size: 14px;
    text-align: center;
}
.gallery-close {
    position: absolute;
    top: 16px;
    right: 20px;
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s;
}
.gallery-close:hover {
    background: rgba(255, 255, 255, 0.25);
}
.gallery-prev,
.gallery-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s;
}
.gallery-prev { left: 20px; }
.gallery-next { right: 20px; }
.gallery-prev:hover,
.gallery-next:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* Download page — theme preview thumbnails (same style as feature thumbnails) */
.theme-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 20px 0 24px;
    justify-content: center;
}
.theme-thumb {
    padding: 0;
    border: 2px solid #2dd4bf;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.theme-thumb:hover {
    border-color: #0891b2;
    box-shadow: 0 4px 14px rgba(8, 145, 178, 0.35);
    transform: scale(1.03);
}
.theme-thumb img {
    display: block;
    width: 120px;
    height: 90px;
    object-fit: cover;
    vertical-align: middle;
}

.pack-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 20px 0 24px;
    justify-content: center;
}
.pack-thumb {
    padding: 0;
    border: 2px solid #2dd4bf;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.pack-thumb:hover {
    border-color: #0891b2;
    box-shadow: 0 4px 14px rgba(8, 145, 178, 0.35);
    transform: scale(1.03);
}
.pack-thumb img {
    display: block;
    width: 120px;
    height: 90px;
    object-fit: cover;
    vertical-align: middle;
}

/* Home page — Screenshot for the software (small icons, click to enlarge, scroll left/right) */
.shot-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 20px 0 24px;
    justify-content: center;
}
.shot-tile {
    padding: 0;
    border: 2px solid #2dd4bf;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.shot-tile:hover {
    border-color: #0891b2;
    box-shadow: 0 4px 14px rgba(8, 145, 178, 0.35);
    transform: scale(1.03);
}
.shot-tile img {
    display: block;
    width: 120px;
    height: 90px;
    object-fit: cover;
    vertical-align: middle;
}

/* Language Specific Overrides */

/* Chinese: Adjust letter spacing */
html[lang="zh-CN"] body {
    letter-spacing: 0.05em;
}
html[lang="zh-CN"] .rail-menu a {
    letter-spacing: 0.1em;
}

/* Russian: Increase button padding */
html[lang="ru"] .consent-ok,
html[lang="ru"] .dock-get-btn,
html[lang="ru"] .menu-link,
html[lang="ru"] button,
html[lang="ru"] .btn {
    padding-left: 20px !important;
    padding-right: 20px !important;
    padding-top: 12px !important;
    padding-bottom: 12px !important;
}

/* Arabic: RTL Support */
html[lang="ar"] {
    direction: rtl;
    text-align: right;
}
html[lang="ar"] .rail-menu {
    border-right: none;
    border-left: 1px solid #eee;
}
html[lang="ar"] a.menu-link {
    border-left: none;
    border-right: 3px solid #0891b2;
    border-radius: 4px 0 0 4px;
    padding: 8px 16px 8px 12px;
    text-align: right;
}
html[lang="ar"] a.menu-link:hover {
    border-right-color: #06b6d4;
    transform: translateX(-4px);
}
html[lang="ar"] .dock-get-btn {
    right: auto;
    left: 24px;
}
html[lang="ar"] .masthead-copy {
    flex-direction: row-reverse;
}
/* Swap layout for RTL if using flexbox/grid that isn't auto-flipping */
/* Adjust col-side-l/col-side-r if needed, but flex-direction: row-reverse on app-shell might be too much if not careful. */
/* Assuming standard flow, RTL handles most. */


/* Layout wrappers after DOM reshuffle */
.viewport-root {
    min-height: 100%;
}
.rail-stack {
    display: block;
}
.story-body {
    display: block;
}
header.masthead-copy {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}
