.docs-page {
    position: relative;
    min-height: 100vh;
    padding: 36px;
    color: #c9c0b8;
    background:
        radial-gradient(circle at 62% 8%, rgba(160, 0, 0, 0.28), transparent 34%),
        radial-gradient(circle at 82% 72%, rgba(120, 0, 0, 0.16), transparent 30%),
        #050505;
    overflow: hidden;
}

.docs-page::before {
    content: "";
    position: absolute;
    inset: 0;

    background:
        linear-gradient(rgba(255, 0, 0, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 0, 0, 0.025) 1px, transparent 1px);

    background-size: 80px 80px;
    opacity: 0.35;
    pointer-events: none;

    animation: docs-grid-move 18s linear infinite;
}

@keyframes docs-grid-move {
    from {
        background-position: 0 0, 0 0;
    }

    to {
        background-position: 80px 80px, 80px 80px;
    }
}

.docs-page::after {
    content: "";
    position: absolute;
    top: -120px;
    right: 420px;

    width: 620px;
    height: 620px;

    background: url("/static/img/docs/bg-red-circle.png") center / contain no-repeat;
    opacity: 0.22;

    filter:
        drop-shadow(0 0 45px rgba(255, 0, 0, 0.35))
        blur(0.2px);

    pointer-events: none;

    animation: docs-sigil-breathe 7s ease-in-out infinite;
}

@keyframes docs-sigil-breathe {
    0%, 100% {
        opacity: 0.18;
        transform: scale(1);
    }

    50% {
        opacity: 0.32;
        transform: scale(1.035);
    }
}

@media (prefers-reduced-motion: reduce) {
    .docs-page::before,
    .docs-page::after,
    .docs-card::after {
        animation: none;
        transition: none;
    }
}


.docs-hero,
.docs-layout {
    position: relative;
    z-index: 1;
}

/* HERO */

.docs-hero {
    display: grid;
    grid-template-columns: minmax(360px, 1fr) 460px;
    gap: 32px;
    min-height: 330px;
    margin-bottom: 34px;
    border-bottom: 1px solid rgba(180, 0, 0, 0.25);
}

.docs-hero-content {
    padding-top: 32px;
}

.docs-title-row {
    display: flex;
    align-items: center;
    gap: 20px;
}

.docs-cross {
    color: #a40000;
    font-size: 34px;
    text-shadow: 0 0 14px rgba(255, 0, 0, 0.65);
}

.docs-title-row h1 {
    margin: 0;
    color: #bdb2a8;
    font-size: clamp(42px, 6vw, 76px);
    line-height: 0.95;
    letter-spacing: 3px;
    text-transform: uppercase;
    text-shadow:
        0 0 10px rgba(255, 0, 0, 0.16),
        3px 3px 0 rgba(0, 0, 0, 0.75);
}

.docs-subtitle {
    max-width: 620px;
    margin: 18px 0 54px;
    color: #8d8580;
    font-size: 17px;
    line-height: 1.55;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

/* SEARCH */

.docs-search-form {
    position: relative;
    max-width: 520px;
}

.docs-search-icon {
    position: absolute;
    top: 50%;
    left: 18px;
    color: #b00000;
    font-size: 30px;
    transform: translateY(-50%);
    pointer-events: none;
}

.docs-search {
    width: 100%;
    height: 56px;
    padding: 0 18px 0 64px;
    color: #d5cbc2;
    background: rgba(5, 5, 5, 0.72);
    border: 1px solid rgba(180, 0, 0, 0.42);
    outline: none;
    font-size: 15px;
    letter-spacing: 1px;
    box-shadow:
        inset 0 0 26px rgba(255, 0, 0, 0.04),
        0 0 18px rgba(255, 0, 0, 0.05);
}

.docs-search:focus {
    border-color: rgba(255, 0, 0, 0.85);
    box-shadow:
        inset 0 0 28px rgba(255, 0, 0, 0.08),
        0 0 22px rgba(255, 0, 0, 0.18);
}

/* HERO IMAGE */

.docs-hero-art {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.docs-book {
    width: 380px;
    height: 310px;
    background: url("/static/img/docs/book.png") center / contain no-repeat;
    opacity: 0.95;
    filter:
        drop-shadow(0 0 24px rgba(255, 0, 0, 0.6))
        drop-shadow(0 0 80px rgba(255, 0, 0, 0.28));
}

/* LAYOUT */

.docs-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 0px;
}

.docs-main {
    min-width: 0;
}

.section-title {
    margin: 0 0 22px;
    color: #cf0000;
    font-size: 24px;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    text-shadow: 0 0 14px rgba(255, 0, 0, 0.3);
}

/* CARDS */

.docs-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(370px, 1fr));
    gap: 22px;
}

.docs-card {
    position: relative;
    display: block;
    min-height: 170px;
    padding: 26px;
    overflow: hidden;

    background:
        linear-gradient(135deg, rgba(16, 16, 16, 0.88), rgba(4, 4, 4, 0.92)),
        radial-gradient(circle at top left, rgba(170, 0, 0, 0.16), transparent 45%);

    border: 1px solid rgba(170, 0, 0, 0.46);

    box-shadow:
        inset 0 0 24px rgba(255, 0, 0, 0.035),
        0 0 0 1px rgba(0, 0, 0, 0.55);

    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.docs-card::before {
    content: "";
    position: absolute;
    inset: 8px;
    border: 1px solid rgba(255, 0, 0, 0.055);
    pointer-events: none;
}

.docs-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 0, 0, 0.82);
    box-shadow:
        inset 0 0 28px rgba(255, 0, 0, 0.06),
        0 0 26px rgba(255, 0, 0, 0.13);
}

.docs-card h3 {
    margin: 0 0 12px;
    color: #bdb2a8;
    font-size: 22px;
    line-height: 1.05;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.docs-card p {
    margin: 0 0 12px;
    color: #918984;
    font-size: 15px;
    line-height: 1.45;
}

.docs-card a {
    color: #cf0000;
    font-size: 15px;
    font-weight: 800;
    text-decoration: none;
}

.docs-card a:hover {
    color: #ff1e1e;
}

.docs-card::after {
    content: "";
    position: absolute;

    right: -20px;
    bottom: -20px;

    width: 160px;
    height: 160px;

    background-position: center;
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 1;
    filter: drop-shadow(0 0 20px rgba(255, 0, 0, 0.25));

    pointer-events: none;
}

.docs-card > * {
    position: relative;
    z-index: 1;
}

.docs-card:hover::after {
    opacity: 1;
    transform: scale(1.1);
    transition: 0.3s;
}

/* ICONS */

.docs-icon {
    width: 100px;
    height: 100px;
    align-self: center;
    background-position: center;
    background-size: contain;
    background-repeat: no-repeat;
    filter:
        drop-shadow(0 0 10px rgba(255, 0, 0, 0.55))
        drop-shadow(0 0 24px rgba(255, 0, 0, 0.22));
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.docs-card:hover .docs-icon {
    transform: scale(1.08);
    opacity: 1;
}

.docs-card.icon-start::after {
    background-image: url("/static/img/docs/icons/start.png");
}

.docs-card.icon-confessions::after {
    background-image: url("/static/img/docs/icons/confessions.png");
}

.docs-card.icon-services::after {
    background-image: url("/static/img/docs/icons/services.png");
}

.docs-card.icon-archives::after {
    background-image: url("/static/img/docs/icons/archives.png");
}

.docs-card.icon-community::after {
    background-image: url("/static/img/docs/icons/community.png");
}

.docs-card.icon-api::after {
    background-image: url("/static/img/docs/icons/api.png");
}

/* BOTTOM */

.docs-bottom-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 22px;
    margin-top: 28px;
}

.docs-popular,
.docs-question,
.docs-toc,
.docs-warning {
    background:
        linear-gradient(145deg, rgba(14, 14, 14, 0.86), rgba(3, 3, 3, 0.94)),
        radial-gradient(circle at top right, rgba(160, 0, 0, 0.12), transparent 42%);
    border: 1px solid rgba(170, 0, 0, 0.42);
    box-shadow: inset 0 0 28px rgba(255, 0, 0, 0.035);
}

.docs-popular {
    padding: 22px;
    
}

.docs-popular-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.docs-popular-header h3,
.docs-question h3,
.docs-toc h3,
.docs-warning h3 {
    margin: 0;
    color: #bdb2a8;
    font-size: 22px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.docs-popular-header a {
    color: #cf0000;
    font-size: 13px;
    text-decoration: none;
}

.docs-popular ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.docs-popular li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 9px 0;
    border-bottom: 1px solid rgba(170, 0, 0, 0.18);
}

.docs-popular li::before {
    content: "◆";
    flex: 0 0 auto;
    color: #cf0000;
    font-size: 10px;
}

.docs-popular li a {
    flex: 1;
    color: #a9a09a;
    text-decoration: none;
}

.docs-popular li a:hover {
    color: #ff1e1e;
}

.docs-popular li span {
    color: #756f6b;
    font-size: 13px;
}

/* QUESTION */

.docs-question {
    padding: 26px;
}

.docs-question p {
    margin: 18px 0 28px;
    color: #928985;
    line-height: 1.55;
}

.docs-question-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    padding: 0 34px;
    color: #cf0000;
    border: 1px solid rgba(255, 0, 0, 0.55);
    text-decoration: none;
    font-weight: 900;
    letter-spacing: 1px;
    background: rgba(8, 0, 0, 0.35);
    transition: 0.2s ease;
}

.docs-question-btn:hover {
    color: #ff2424;
    border-color: rgba(255, 0, 0, 0.95);
    box-shadow: 0 0 22px rgba(255, 0, 0, 0.14);
}

/* SIDEBAR */

.docs-sidebar {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.docs-toc {
    padding: 24px;
}

.docs-toc h3 {
    margin-bottom: 18px;
    color: #d00000;
}

.docs-toc ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.docs-toc li {
    position: relative;
    padding: 5px 0 5px 24px;
    color: #8f8781;
    font-size: 14px;
    line-height: 1.35;
}

.docs-toc li::before {
    content: "›";
    position: absolute;
    left: 6px;
    color: rgba(180, 0, 0, 0.7);
}

.docs-toc .toc-main {
    margin-top: 10px;
    color: #b9afa7;
    font-weight: 900;
}

.docs-toc .toc-main::before {
    content: "◇";
    left: 0;
    color: #cf0000;
}

/* WARNING */

.docs-warning {
    position: relative;
    min-height: 260px;
    padding: 24px;
    overflow: hidden;
}

.docs-warning h3 {
    color: #d00000;
    margin-bottom: 70px;
}

.docs-warning p {
    position: relative;
    z-index: 1;
    max-width: 190px;
    color: #9b928c;
    line-height: 1.55;
}

.docs-warning::after {
    content: "";
    position: absolute;
    right: -36px;
    bottom: 20px;
    width: 230px;
    height: 230px;
    background: url("/static/img/docs/skull.png") center / contain no-repeat;
    filter: drop-shadow(0 0 24px rgba(255, 0, 0, 0.25));
}

/* ADAPTIVE */

@media (max-width: 1250px) {
    .docs-hero {
        grid-template-columns: 1fr 330px;
    }

    .docs-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .docs-book {
        width: 300px;
    }
}

@media (max-width: 980px) {
    .docs-page {
        padding: 24px;
    }

    .docs-hero {
        grid-template-columns: 1fr;
    }

    .docs-hero-art {
        display: none;
    }

    .docs-layout {
        grid-template-columns: 1fr;
    }

    .docs-sidebar {
        order: -1;
    }

    .docs-bottom-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 680px) {
    .docs-page {
        padding: 18px;
    }

    .docs-title-row {
        gap: 10px;
    }

    .docs-cross {
        display: none;
    }

    .docs-grid {
        grid-template-columns: 1fr;
    }

    .docs-card {
        grid-template-columns: 64px 1fr;
        padding: 18px;
    }

    .docs-icon {
        width: 58px;
        height: 58px;
    }

    .docs-popular li {
        align-items: flex-start;
        flex-wrap: wrap;
    }
}

.docs-legal-section {
    margin-top: 34px;
}

.docs-legal-grid {
    display: flex;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.docs-legal-card {
    display: block;
    min-height: 150px;
    min-width: 280px;
    padding: 22px;
    text-decoration: none;

    background:
        linear-gradient(145deg, rgba(14, 14, 14, 0.88), rgba(3, 3, 3, 0.96)),
        radial-gradient(circle at top right, rgba(160, 0, 0, 0.14), transparent 42%);

    border: 1px solid rgba(170, 0, 0, 0.42);
    box-shadow: inset 0 0 24px rgba(255, 0, 0, 0.035);

    transition: 0.2s ease;
}

.docs-legal-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 0, 0, 0.82);
    box-shadow:
        inset 0 0 28px rgba(255, 0, 0, 0.06),
        0 0 24px rgba(255, 0, 0, 0.13);
}

.docs-legal-card h3 {
    margin: 0 0 12px;
    color: #bdb2a8;
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.docs-legal-card p {
    margin: 0;
    color: #8f8781;
    font-size: 14px;
    line-height: 1.45;
}

@media (max-width: 1250px) {
    .docs-legal-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .docs-legal-grid {
        grid-template-columns: 1fr;
    }
}

.doc-article {
    position: relative;
    z-index: 1;
    max-width: 1100px;
    margin: 40px auto;
    padding: 42px;

    background:
        linear-gradient(145deg, rgba(14, 14, 14, 0.92), rgba(3, 3, 3, 0.98)),
        radial-gradient(circle at top right, rgba(160, 0, 0, 0.14), transparent 42%);

    border: 1px solid rgba(170, 0, 0, 0.42);

    box-shadow:
        inset 0 0 32px rgba(255, 0, 0, 0.035),
        0 0 60px rgba(0, 0, 0, 0.75);
}

/* Убираем кашу от inline */
.doc-article h1 {
    margin-bottom: 18px;
    font-size: clamp(34px, 5vw, 60px);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.doc-article h2 {
    margin-top: 32px;
    margin-bottom: 12px;
}

.doc-article p,
.doc-article li {
    line-height: 1.7;
}

/* Разделители */
.separator {
    margin: 26px 0;
    height: 1px;
    background: linear-gradient(
        to right,
        transparent,
        rgba(255, 0, 0, 0.4),
        transparent
    );
}

/* Ссылки */
.doc-article .link {
    color: #cf0000;
}

.doc-article .link:hover {
    color: #ff2a2a;
}

.legal-document {
    position: relative;
    z-index: 1;

    max-width: 1120px;
    margin: 40px auto;
    padding: 42px;

    background:
        linear-gradient(145deg, rgba(14, 14, 14, 0.94), rgba(3, 3, 3, 0.98)),
        radial-gradient(circle at top right, rgba(160, 0, 0, 0.16), transparent 42%);

    border: 1px solid rgba(170, 0, 0, 0.45);

    box-shadow:
        inset 0 0 34px rgba(255, 0, 0, 0.04),
        0 0 60px rgba(0, 0, 0, 0.75);
}

.legal-document::before {
    content: "";
    position: absolute;
    inset: 10px;
    border: 1px solid rgba(255, 0, 0, 0.06);
    pointer-events: none;
}

.legal-back {
    display: inline-block;
    margin-bottom: 28px;

    color: #cf0000;
    font-weight: 900;
    text-decoration: none;
    letter-spacing: 0.8px;
}

.legal-back:hover {
    color: #ff2424;
    text-shadow: 0 0 12px rgba(255, 0, 0, 0.45);
}

.legal-document h1 {
    margin: 0 0 24px;
    font-size: clamp(34px, 5vw, 58px);
    line-height: 1.05;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 18px rgba(255, 0, 0, 0.18);
}

.legal-document h2 {
    margin-top: 34px;
    margin-bottom: 14px;

    font-size: 24px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.legal-document h3 {
    margin-top: 26px;
    margin-bottom: 12px;
    font-size: 19px;
    text-transform: uppercase;
}

.legal-document p,
.legal-document li {
    color: #b6aca5;
    font-size: 16px;
    line-height: 1.75;
}

.legal-document ul,
.legal-document ol {
    margin-bottom: 22px;
    padding-left: 26px;
}

.legal-document li {
    margin-bottom: 10px;
}

.legal-document b,
.legal-document strong {
    color: #d6ccc4;
}

.legal-document .link {
    color: #cf0000;
    text-decoration: none;
    border-bottom: 1px solid rgba(207, 0, 0, 0.35);
}

.legal-document .link:hover {
    color: #ff2424;
    border-bottom-color: rgba(255, 36, 36, 0.8);
}

.legal-document .separator {
    margin: 30px 0;
    height: 1px;

    background: linear-gradient(
        to right,
        transparent,
        rgba(255, 0, 0, 0.45),
        transparent
    );
}

@media (max-width: 780px) {
    .legal-document {
        margin: 20px auto;
        padding: 24px;
    }

    .legal-document h1 {
        font-size: 32px;
    }

    .legal-document h2 {
        font-size: 21px;
    }

    .legal-document p,
    .legal-document li {
        font-size: 15px;
    }
}