:root { color-scheme: dark; }

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: "Roboto", system-ui, -apple-system, Segoe UI, Arial, sans-serif;
    background: var(--page-bg-color);
    color: rgba(255,255,255,.92);
}

.app { min-height: 100vh; }

/* Sticky header */
.site-header {
    background: var(--header-bg-color);
    box-shadow: 0 10px 30px rgba(0,0,0,.25);
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.logo-wrap img {
    display: block;
    width: auto;
    max-height: 56px;
    max-width:100%;
}


/* Menu alignment */
.navbar-nav {
    display: flex;
    justify-content: center; /* Центрируем пункты меню */
    gap: 20px; /* Отступы между элементами */
}

.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
    padding: 8px 16px;
    border-radius: 0; /* Убираем радиус для прямых углов */
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus {
    color: var(--primary-color); /* Цвет при наведении */
    background: transparent; /* Без фона при наведении */
}

/* Make anchors land nicely under sticky header */
.scroll-target { scroll-margin-top: 96px; }

/* Buttons */
.btn-pill { border-radius: 999px; }
.btn { transition: transform .12s ease, filter .12s ease; }
.btn:hover { transform: translateY(-1px); filter: brightness(1.05); }

.btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--primary-color);
    --bs-btn-border-color: var(--primary-color);
    --bs-btn-hover-color:#fff;
    --bs-btn-hover-bg: var(--primary-color-hover);
    --bs-btn-hover-border-color: var(--primary-color-hover);
    --bs-btn-focus-shadow-rgb: 49, 132, 253;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--primary-color-hover);
    --bs-btn-active-border-color: var(--primary-color-hover);
    --bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: var(--primary-color);
    --bs-btn-disabled-border-color: var(--primary-color);
}

.btn-secondary {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--secondary-color);
    --bs-btn-border-color: var(--secondary-color);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--secondary-color-hover);
    --bs-btn-hover-border-color: var(--secondary-color-hover);
    --bs-btn-focus-shadow-rgb: 130, 138, 145;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--secondary-color-hover);
    --bs-btn-active-border-color: var(--secondary-color-hover);
    --bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: var(--secondary-color);
    --bs-btn-disabled-border-color: var(--secondary-color);
}

.btn-pulse {
    background-color: var(--secondary-color);
    color: #fff;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.table-primary {
    --bs-table-color: #fff;
    --bs-table-bg: var(--primary-color);
    --bs-table-border-color: var(--primary-color);
    --bs-table-striped-bg: var(--primary-color);
    --bs-table-striped-color: #fff;
    --bs-table-active-bg: var(--primary-color);
    --bs-table-active-color: #fff;
    --bs-table-hover-bg: var(--primary-color-hover);
    --bs-table-hover-color: #fff;
    color: var(--bs-table-color);
    border-color: var(--bs-table-border-color);
}

.table-primary td{
    color: #fff!important;
}

.table td p{
    color: inherit;
    margin-bottom: 0;
}

.table tr.table-primary p{
    font-size: 1.1rem;
}

/* Hero */
.hero {
    position: relative;
    min-height: 400px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
.hero-overlay {
    position: absolute;
    inset: 0;
    background:
            radial-gradient(1200px 600px at 20% 10%, rgba(59,130,246,.28), transparent 60%),
            radial-gradient(900px 500px at 90% 30%, rgba(168,85,247,.22), transparent 55%),
            linear-gradient(to bottom, rgba(0,0,0,.45), rgba(0,0,0,.70));
}
.hero-inner {
    position: relative;
    z-index: 1;
    padding: 56px 12px;
    display: grid;
    place-items: center;
}
.hero-card {
    max-width: 860px;
    padding: 28px;
    border-radius: 18px;
    background: rgba(17,24,39,.55);
    border: 1px solid rgba(255,255,255,.14);
    backdrop-filter: blur(8px);
}
.text-white-75 { color: rgba(255,255,255,.75) !important; }

/* Content cards */
.content-card {
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255, 0.1);
    border-radius: 10px;
    backdrop-filter: blur(8px);
    box-shadow: 0px 4px 6px rgba(255,255,255, 0.1);
}

.author-card{
    background: var(--primary-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    backdrop-filter: blur(8px);
    box-shadow: 0px 4px 6px rgba(255, 255, 255, 0.1);
}

.section-title {
    font-weight: 700;
    letter-spacing: .2px;
}

/* Article typography */
.article h2,
.article h3 { margin-top: 1.6rem; }

.article h2 { font-size: 1.8rem; }
.article h3 { font-size: 1.5rem; color: rgba(255,255,255,.88); }

.article *{ color: rgba(255,255,255,1); }

/* Accordion */
.accordion-item {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: var(--bs-accordion-border-radius) !important; /* Использую переменную Bootstrap */
    overflow: hidden;
    backdrop-filter: blur(5px);
}

.accordion-button {
    background: var(--primary-color);
    color: rgba(255, 255, 255, 0.92) !important;
    border: none;
    border-radius: var(--bs-accordion-border-radius-inner) !important;
    padding: 12px;
    transition: background 0.3s ease, color 0.3s ease;
}

.accordion-button:not(.collapsed) {
    background: var(--primary-color);
    box-shadow:none!important;
}

.accordion-body {
    background: var(--page-bg-color);
    color: rgba(255, 255, 255, 0.85);
    padding: 1rem;
    border-radius: var(--bs-accordion-border-radius-inner) !important;
    backdrop-filter: blur(5px);
}

.toc-list a {
    display: block;
    padding: 8px 10px;
    border-radius: 10px;
    color: rgba(255,255,255,.85);
    text-decoration: none;
    transition: background 0.3s ease, color 0.3s ease;
}
.toc-list a:hover { background: rgba(255,255,255,.08); color: #fff; }
.toc-level-3 { padding-left: 18px !important; opacity: .95; }

/* FAQ accordion same as TOC */
.accordion-item {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 16px; /* Оставляем красивое закругление */
    overflow: hidden;
}

.accordion-button {
    background: var(--primary-color);
    color: rgba(255, 255, 255, 0.92) !important;
    border: none;
    border-radius: 16px;  /* Оставляем радиус как у TOC */
    padding: 12px;
    transition: background 0.3s ease, color 0.3s ease;
}

.accordion-body {
    background: var(--page-bg-color);
    color: rgba(255, 255, 255, 0.85);
    padding: 1rem;
    border-radius: 16px; /* Радиус у тела аккордеона */
}

/* Inline banner inside content */
.inline-banner {
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,.12);
    background:
            radial-gradient(700px 300px at 10% 20%, rgba(34,197,94,.18), transparent 55%),
            radial-gradient(800px 400px at 90% 40%, rgba(59,130,246,.18), transparent 60%),
            rgba(255,255,255,.03);
    backdrop-filter: blur(5px);
    position: relative;
    min-height: 200px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.inline-banner::before{
    content: '';
    display:block;
    position: absolute;
    top:0; left:0;
    width:100%; bottom:0;
    background:transparent;
}

/* Author */
.author-photo {
    width: 96px;
    height: 96px;
    border-radius: 16px; /* same “medium” rounding vibe */
    object-fit: cover;
    border: 1px solid rgba(255,255,255,.14);
}

/* Footer */
.site-footer { background: var(--footer-bg-color); border-top: 1px solid rgba(255,255,255,.08); }
.footer-top { border-bottom: 1px solid rgba(255,255,255,.08); }
.footer-title { font-weight: 700; }
.footer-link { color: rgba(255,255,255,.72); text-decoration: none; }
.footer-link:hover { color: #fff; text-decoration: underline; }

/* Offcanvas hover helper */
.hover-white:hover { color: #fff !important; }

/* Scroll to top */
.to-top {
    position: fixed;
    right: 16px;
    bottom: 16px;
    width: 44px;
    height: 44px;
    padding: 0;
    display: grid;
    place-items: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity .15s ease, transform .15s ease, visibility .15s ease;
    z-index: 1055; /* above content */
}
.to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Mobile tweaks */
@media (max-width: 991.98px) {
    .hero { min-height:300px; }
    .hero-inner { padding: 42px 12px; }
    .hero-card { padding: 20px; border-radius: 16px; }
    .scroll-target { scroll-margin-top: 88px; }
    .logo-wrap{ max-width:80%; }
    .inline-banner::before{
        background:rgba(0,0,0,0.1);
    }
}
