/* Основные переменные задают минималистичный стиль старого синего чертежа. */
:root {
    --blueprint-bg: #f4f0e8;
    --blueprint-paper: #fffdf8;
    --blueprint-ink: #153c63;
    --blueprint-line: rgba(86, 101, 116, 0.16);
    --blueprint-grid: rgba(125, 105, 76, 0.055);
    --blueprint-soft: rgba(21, 60, 99, 0.055);
    --blueprint-muted: #64717c;
}

/* Фон имитирует тонкую чертежную сетку без тяжелых декоративных элементов. */
body {
    min-height: 100vh;
    color: var(--blueprint-ink);
    background-color: var(--blueprint-bg);
    background-image:
        linear-gradient(var(--blueprint-grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--blueprint-grid) 1px, transparent 1px);
    background-size: 42px 42px;
    font-family: Arial, Helvetica, sans-serif;
    letter-spacing: 0;
}

/* Контейнер ограничивает ширину контента на полноразмерном экране. */
.blueprint-container {
    width: min(1180px, calc(100% - 72px));
    margin-inline: auto;
    padding-inline: 0;
}

/* Шапка закрепляет навигацию визуально, но не мешает дальнейшим изменениям дизайна. */
.site-header {
    border-bottom: 1px solid var(--blueprint-line);
    background: rgba(244, 240, 232, 0.94);
    backdrop-filter: blur(8px);
}

.navbar {
    padding-block: 18px;
}

.navbar-brand {
    display: inline-flex;
    align-items: center;
    padding-block: 0;
    color: var(--blueprint-ink);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.brand-emblem {
    width: 54px;
    height: 34px;
    object-fit: contain;
    opacity: 0.82;
    filter: saturate(0.86);
}

.navbar-brand:hover .brand-emblem,
.navbar-brand:focus .brand-emblem {
    opacity: 0.95;
    filter: saturate(1);
}

.nav-link {
    color: var(--blueprint-muted);
    font-size: 0.92rem;
}

.nav-link:hover,
.nav-link:focus {
    color: var(--blueprint-ink);
}

/* Основная область страницы оставляет достаточно воздуха вокруг технического контента. */
.blueprint-main {
    min-height: calc(100vh - 145px);
    padding-block: 44px 58px;
}

/* Hero-блок сразу объясняет назначение сайта без маркетинговой страницы. */
.hero-section {
    max-width: 900px;
    padding-block: 46px 42px;
    border-bottom: 1px solid var(--blueprint-line);
}

.technical-label {
    margin-bottom: 10px;
    color: var(--blueprint-muted);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1 {
    max-width: 920px;
    margin: 0;
    color: var(--blueprint-ink);
    font-size: clamp(1.35rem, 1.9vw, 2.1rem);
    font-weight: 700;
    line-height: 1.18;
}

.hero-title {
    font-size: clamp(1.6rem, 2.5vw, 2.35rem);
}

.lead,
.page-heading p {
    margin-top: 20px;
    color: var(--blueprint-muted);
    font-size: 1.06rem;
    line-height: 1.6;
}

.home-intro {
    max-width: 820px;
    margin-top: 24px;
    color: #254967;
}

.home-intro p {
    margin: 0 0 14px;
    font-size: 1.02rem;
    line-height: 1.68;
}

.home-intro a {
    color: #1b658f;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.blueprint-action-link {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 7px 12px;
    color: var(--blueprint-ink);
    background: rgba(255, 253, 248, 0.88);
    border: 1px solid var(--blueprint-line);
    border-radius: 4px;
    font-weight: 700;
    text-decoration: none;
}

.blueprint-action-link:hover,
.blueprint-action-link:focus {
    color: #fff;
    background: var(--blueprint-ink);
    text-decoration: none;
}

.feedback-form {
    margin-top: 26px;
}

.feedback-form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.feedback-form label {
    display: grid;
    gap: 7px;
    color: var(--blueprint-ink);
    font-size: 0.86rem;
    font-weight: 700;
}

.feedback-form input,
.feedback-form textarea {
    width: 100%;
    min-height: 42px;
    padding: 9px 11px;
    color: var(--blueprint-ink);
    background: rgba(255, 253, 248, 0.92);
    border: 1px solid var(--blueprint-line);
    border-radius: 4px;
    font: inherit;
    font-weight: 400;
}

.feedback-form textarea {
    min-height: 170px;
    resize: vertical;
}

.feedback-question {
    margin-top: 18px;
}

.feedback-submit {
    margin-top: 18px;
}

.errorlist {
    margin: 0;
    padding-left: 0;
    color: #9d1d22;
    font-size: 0.82rem;
    font-weight: 700;
    list-style: none;
}

.form-message {
    margin: 20px 0;
    padding: 12px 14px;
    border: 1px solid var(--blueprint-line);
    border-radius: 4px;
    font-weight: 700;
}

.form-message-success {
    color: #205b38;
    background: rgba(225, 245, 232, 0.9);
}

.form-message-error {
    color: #9d1d22;
    background: rgba(255, 235, 235, 0.9);
}

/* Сетка разделов рассчитана на полноразмерный экран, но сохраняет базовую адаптивность. */
.section-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
    margin-top: 32px;
}

/* Карточки выглядят как элементы чертежа и подходят для будущих списков материалов. */
.blueprint-card {
    display: flex;
    min-height: 170px;
    flex-direction: column;
    justify-content: space-between;
    padding: 22px;
    color: var(--blueprint-ink);
    text-decoration: none;
    background: rgba(255, 253, 248, 0.88);
    border: 1px solid var(--blueprint-line);
    border-radius: 4px;
}

.blueprint-card:hover {
    background: var(--blueprint-paper);
    border-color: rgba(21, 60, 99, 0.34);
}

.blueprint-card h2,
.blueprint-card strong {
    margin: 0;
    font-size: 1.12rem;
    font-weight: 700;
    line-height: 1.28;
}

.blueprint-card p,
.blueprint-card span {
    margin: 0;
    color: var(--blueprint-muted);
}

.card-index {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* Заголовок внутренних страниц проще hero, чтобы страницы были удобны для наполнения. */
.page-heading {
    padding-bottom: 28px;
    border-bottom: 1px solid var(--blueprint-line);
}

.content-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 32px;
}

/* Empty-state показывает согласованную заглушку under development. */
.empty-state {
    padding: 28px;
    color: var(--blueprint-muted);
    background: rgba(255, 255, 255, 0.66);
    border: 1px dashed var(--blueprint-line);
    border-radius: 4px;
}

/* Страница статьи использует более узкую колонку, чтобы длинный технический текст было удобно читать. */
.article-shell {
    max-width: 980px;
    padding: 34px 38px 44px;
    background: rgba(255, 253, 248, 0.82);
    border: 1px solid rgba(86, 101, 116, 0.11);
    border-radius: 4px;
}

.article-header {
    padding-bottom: 24px;
    border-bottom: 1px solid var(--blueprint-line);
}

.article-header h1 {
    font-size: clamp(1.45rem, 2.2vw, 2.15rem);
    line-height: 1.16;
}

.article-header p {
    max-width: 780px;
    margin-top: 18px;
    color: var(--blueprint-muted);
    font-size: 1.03rem;
    line-height: 1.6;
}

.article-content {
    margin-top: 30px;
    padding-bottom: 40px;
}

.article-content h2 {
    margin-top: 36px;
    margin-bottom: 14px;
    color: var(--blueprint-ink);
    font-size: 1.36rem;
    font-weight: 700;
    text-transform: none;
}

.article-content h3 {
    margin-top: 28px;
    margin-bottom: 10px;
    color: var(--blueprint-ink);
    font-size: 1.08rem;
    font-weight: 700;
}

.article-content p {
    margin-bottom: 16px;
    color: #254967;
    font-size: 1rem;
    line-height: 1.7;
}

.article-content a {
    color: #1b658f;
    font-weight: 700;
    font-size: 1em;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.article-content a:hover,
.article-content a:focus {
    color: var(--blueprint-ink);
}

.article-content strong {
    color: var(--blueprint-ink);
    font-weight: 700;
}

.article-content code {
    padding: 2px 5px;
    color: var(--blueprint-ink);
    background: rgba(255, 253, 248, 0.9);
    border: 1px solid var(--blueprint-line);
    border-radius: 3px;
    font-size: 0.92em;
}

.article-content ul,
.article-content ol {
    margin: 18px 0 22px;
    padding-left: 1.25rem;
    color: #254967;
}

.article-content li {
    margin-bottom: 10px;
    line-height: 1.65;
}

.article-content .article-note {
    margin: 22px 0;
    padding: 16px 18px;
    color: var(--blueprint-ink);
    background: rgba(255, 253, 248, 0.82);
    border-left: 4px solid #4aa6c7;
}

.article-content figure {
    margin: 28px 0;
    padding: 12px;
    background: rgba(255, 253, 248, 0.9);
    border: 1px solid var(--blueprint-line);
    border-radius: 4px;
}

.article-content figure.article-image-sized {
    width: min(100%, var(--image-width));
    margin-inline: auto;
}

.article-content img {
    display: block;
    width: 100%;
    height: auto;
}

.article-content figcaption {
    margin-top: 10px;
    color: var(--blueprint-muted);
    font-size: 0.96rem;
    line-height: 1.5;
}

.article-content table {
    width: 100%;
    margin: 24px 0;
    background: rgba(255, 253, 248, 0.92);
    border-collapse: collapse;
    table-layout: fixed;
}

.article-content table.article-table-sized {
    width: min(100%, var(--table-width));
}

.article-content td,
.article-content th {
    padding: 7px 10px;
    color: #254967;
    border: 1px solid var(--blueprint-line);
    line-height: 1.38;
    overflow-wrap: anywhere;
    white-space: normal;
    vertical-align: top;
}

.article-content .math-block {
    margin: 26px 0;
    padding: 16px 18px;
    overflow-x: auto;
    color: var(--blueprint-ink);
    background: rgba(255, 253, 248, 0.86);
    border: 1px solid var(--blueprint-line);
    border-radius: 4px;
}

/* Футер завершает страницу и дублирует статус стартовой версии. */
.site-footer {
    border-top: 1px solid var(--blueprint-line);
    color: var(--blueprint-muted);
    font-size: 0.9rem;
    background: rgba(244, 240, 232, 0.72);
}

.site-footer a {
    color: var(--blueprint-muted);
    font-weight: 700;
    text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus {
    color: var(--blueprint-ink);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.site-footer .blueprint-container {
    display: flex;
    justify-content: space-between;
    padding-block: 18px;
}

/* Минимальная адаптивность нужна, чтобы сайт не ломался при уменьшении окна. */
@media (max-width: 1100px) {
    .section-grid,
    .content-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .blueprint-container {
        width: min(100% - 28px, 1180px);
    }

    .blueprint-main {
        padding-block: 34px;
    }

    h1 {
        font-size: clamp(1.45rem, 8vw, 2.2rem);
    }

    .hero-title {
        font-size: clamp(1.6rem, 9vw, 2.4rem);
    }

    .article-shell {
        padding: 24px 18px 32px;
    }

    .article-header h1 {
        font-size: clamp(1.45rem, 8vw, 2.25rem);
    }

    .section-grid,
    .content-list {
        grid-template-columns: 1fr;
    }

    .feedback-form-grid {
        grid-template-columns: 1fr;
    }

    .site-footer .blueprint-container {
        gap: 8px;
        flex-direction: column;
    }
}
