:root {
    color-scheme: light;
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-soft: #f7f9fb;
    --ink: #101418;
    --ink-soft: #2c343b;
    --muted: #68727c;
    --muted-strong: #47515a;
    --line: #e6ebf0;
    --line-strong: #d8e0e8;
    --accent: #253b73;
    --accent-dark: #162344;
    --accent-soft: #eef2ff;
    --gold: #c89b3c;
    --gold-soft: #fff7e6;
    --warn: #a23d33;
    --ok: #35625c;
    --radius: 8px;
    --shadow-soft: 0 18px 55px rgba(20, 35, 47, 0.08);
    --shadow-lift: 0 22px 70px rgba(20, 35, 47, 0.13);
    --gradient-line: linear-gradient(90deg, rgba(37, 59, 115, 0.3), rgba(200, 155, 60, 0.36), rgba(103, 80, 164, 0.2));
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    background: var(--bg);
    text-size-adjust: 100%;
}

body {
    margin: 0;
    background:
        linear-gradient(180deg, rgba(247, 249, 251, 0.92) 0, rgba(255, 255, 255, 0) 420px),
        var(--bg);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.62;
    letter-spacing: 0;
    text-rendering: optimizeLegibility;
}

a {
    color: inherit;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible {
    outline: 3px solid rgba(37, 59, 115, 0.25);
    outline-offset: 3px;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(255, 255, 255, 0.88);
    border-bottom: 1px solid rgba(230, 235, 240, 0.95);
    backdrop-filter: blur(18px);
}

.site-header::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 1px;
    background: var(--gradient-line);
    opacity: 0.75;
}

.site-header-inner,
.page,
.footer-grid,
.footer-bottom {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
}

.header-top {
    min-height: 78px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.brand,
.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand {
    flex: 0 0 auto;
}

.brand-mark {
    position: relative;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background:
        linear-gradient(#ffffff, #ffffff) padding-box,
        linear-gradient(135deg, #162344, #c89b3c 56%, #6750a4) border-box;
    border: 1px solid transparent;
    color: var(--accent-dark);
    box-shadow: 0 16px 34px rgba(37, 59, 115, 0.16);
    overflow: hidden;
}

.brand-mark::after {
    content: "";
    position: absolute;
    inset: auto 6px 5px 6px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), var(--gold));
}

.brand-mark span {
    position: relative;
    z-index: 1;
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 700;
    font-size: 28px;
    line-height: 1;
}

.brand-text {
    display: grid;
    line-height: 1.05;
}

.brand-text strong,
.footer-brand {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 25px;
    letter-spacing: 0;
}

.brand-text small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.site-search,
.hero-search {
    display: flex;
    gap: 10px;
}

.site-search {
    margin-left: auto;
    width: min(440px, 42vw);
}

input[type="search"],
input[type="text"],
input[type="email"],
textarea {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px 14px;
    background: #fff;
    color: var(--ink);
    font: inherit;
    box-shadow: inset 0 1px 0 rgba(20, 35, 47, 0.03);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input[type="search"]:focus,
input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
    border-color: rgba(37, 59, 115, 0.55);
    box-shadow: 0 0 0 4px rgba(37, 59, 115, 0.08);
}

textarea {
    resize: vertical;
}

button,
.section-heading a {
    border: 0;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--accent-dark), var(--accent));
    color: #fff;
    padding: 12px 17px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 14px 26px rgba(37, 59, 115, 0.18);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

button:hover,
.section-heading a:hover {
    background: linear-gradient(135deg, #0b4541, var(--accent-dark));
    box-shadow: 0 18px 34px rgba(37, 59, 115, 0.24);
    transform: translateY(-1px);
}

.menu-toggle {
    display: none;
}

.nav {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 0 14px;
}

.nav-link {
    position: relative;
    color: var(--muted-strong);
    text-decoration: none;
    padding: 8px 11px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 850;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent-dark);
    background: var(--accent-soft);
}

.page {
    padding: 28px 0 70px;
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 26px;
}

.breadcrumbs a {
    color: var(--muted-strong);
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--accent-dark);
}

.hero,
.page-header {
    position: relative;
    padding: 66px 0 58px;
}

.hero::before,
.page-header::before {
    content: "";
    position: absolute;
    left: 0;
    right: auto;
    bottom: 18px;
    width: min(640px, 72vw);
    height: 1px;
    background: var(--gradient-line);
}

.hero-copy,
.article,
.page-header {
    max-width: 820px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-dark);
    font-weight: 900;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.1em;
    margin: 0 0 12px;
}

.eyebrow::before {
    content: "";
    width: 28px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), var(--gold));
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1,
h2,
h3 {
    color: var(--ink);
    letter-spacing: 0;
}

h1 {
    max-width: 12ch;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(44px, 6vw, 74px);
    line-height: 1.02;
    margin-bottom: 18px;
}

.page-header h1,
.article h1 {
    max-width: 15ch;
    font-size: clamp(38px, 5vw, 62px);
}

h2 {
    font-size: 26px;
    line-height: 1.18;
}

h3 {
    line-height: 1.2;
}

.hero p,
.page-header p,
.lead {
    color: var(--muted-strong);
    font-size: 20px;
    line-height: 1.55;
}

.hero-search {
    position: relative;
    margin-top: 30px;
    max-width: 690px;
    padding: 7px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.hero-search input[type="search"] {
    border-color: transparent;
    box-shadow: none;
}

.section {
    margin-top: 48px;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.section-heading h2 {
    margin-bottom: 0;
}

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

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

.entry-card,
.category-list a,
.compact-list a,
.answer-box,
details,
.source-item,
.contact-form,
.contact-note {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 1px 0 rgba(20, 35, 47, 0.03);
}

.entry-card,
.category-list a,
.compact-list a,
.source-item,
.contact-form,
.contact-note {
    position: relative;
}

.entry-card::before,
.category-list a::before,
.compact-list a::before,
.source-item::before,
.contact-note::before {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    top: -1px;
    height: 2px;
    border-radius: 999px;
    background: var(--gradient-line);
    opacity: 0;
    transition: opacity 0.18s ease;
}

.entry-card {
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.entry-card:hover,
.category-list a:hover,
.compact-list a:hover {
    transform: translateY(-2px);
    border-color: rgba(37, 59, 115, 0.22);
    box-shadow: var(--shadow-lift);
}

.entry-card:hover::before,
.category-list a:hover::before,
.compact-list a:hover::before,
.source-item:hover::before {
    opacity: 1;
}

.entry-card a,
.category-list a,
.compact-list a {
    display: block;
    min-height: 100%;
    padding: 20px;
    text-decoration: none;
}

.entry-card span,
.compact-list span,
.category-list span,
.category-list em {
    color: var(--muted);
    font-size: 14px;
}

.entry-card span,
.category-list em {
    font-weight: 800;
}

.entry-card h3 {
    margin: 8px 0;
    font-size: 22px;
}

.entry-card p,
.compact-list span,
.category-list span {
    margin: 0;
}

.two-column {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(310px, 0.82fr);
    gap: 30px;
    align-items: start;
}

.category-list,
.compact-list {
    display: grid;
    gap: 13px;
}

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

.category-list strong,
.compact-list strong {
    display: block;
    margin-bottom: 5px;
}

.article-header {
    margin-bottom: 34px;
}

.answer-box {
    position: relative;
    overflow: hidden;
    padding: 22px;
    margin: 24px 0;
    background:
        linear-gradient(135deg, rgba(233, 246, 243, 0.96), rgba(255, 247, 230, 0.72)),
        #fff;
    box-shadow: var(--shadow-soft);
}

.answer-box::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--accent), var(--gold));
}

.answer-box span {
    display: block;
    color: var(--accent-dark);
    font-weight: 900;
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.answer-box strong {
    display: block;
    margin-top: 4px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 36px;
    line-height: 1.15;
}

.answer-box p {
    margin: 7px 0 0;
    color: var(--muted);
}

.article-section {
    margin-top: 36px;
}

.prose {
    color: var(--ink-soft);
    font-size: 18px;
    line-height: 1.75;
}

.variant-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.variant {
    border-radius: 999px;
    padding: 8px 13px;
    background: #fff;
    border: 1px solid var(--line);
    font-weight: 800;
}

.variant.correct {
    color: var(--ok);
    background: #f1f6f5;
    border-color: #d8e6e3;
}

.variant.incorrect {
    color: var(--warn);
    background: #fff0ed;
    border-color: #f4d0ca;
    text-decoration: line-through;
}

.example-list {
    display: grid;
    gap: 10px;
    padding: 0;
    list-style: none;
}

.example-list li {
    border-left: 4px solid var(--line);
    background: #fff;
    padding: 13px 15px;
    border-radius: 0 var(--radius) var(--radius) 0;
    box-shadow: 0 10px 28px rgba(20, 35, 47, 0.05);
}

.example-list li.correct {
    border-left-color: var(--ok);
}

.example-list li.incorrect {
    border-left-color: var(--warn);
    color: var(--muted);
}

details {
    padding: 17px 18px;
    margin-bottom: 10px;
}

summary {
    cursor: pointer;
    font-weight: 850;
}

.sources ul {
    padding-left: 20px;
}

.source-list {
    display: grid;
    gap: 14px;
    max-width: 820px;
}

.source-item {
    padding: 20px;
}

.source-item h2 {
    font-size: 22px;
    margin-bottom: 8px;
}

.source-item p {
    color: var(--muted);
    margin-bottom: 8px;
}

.source-item span {
    color: var(--accent-dark);
    font-weight: 850;
    font-size: 14px;
}

.ad-slot {
    display: block;
    width: 100%;
    min-height: 90px;
    margin: 28px 0;
}

.ad-slot-home_top,
.ad-slot-category_top {
    margin: 12px 0 34px;
}

.article .ad-slot {
    max-width: 820px;
}

.contact-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.6fr);
    gap: 30px;
    align-items: start;
}

.contact-form,
.contact-note {
    padding: 24px;
}

.contact-form {
    display: grid;
    gap: 16px;
}

.contact-form label {
    display: grid;
    gap: 6px;
    font-weight: 850;
}

.field-invalid {
    color: var(--warn);
}

.field-invalid input,
.field-invalid textarea {
    border-color: rgba(162, 61, 51, 0.72);
    box-shadow: 0 0 0 3px rgba(162, 61, 51, 0.08);
}

.form-required-note {
    margin: -2px 0 0;
    color: var(--warn);
    font-size: 14px;
    font-weight: 750;
}

.hp-field {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.notice {
    border-radius: var(--radius);
    padding: 14px 16px;
}

.notice ul {
    margin: 8px 0 0;
    padding-left: 20px;
}

.notice.success {
    background: #f1f6f5;
    color: var(--ok);
}

.notice.error {
    background: #fff0ed;
    color: var(--warn);
}

.empty-state {
    padding: 24px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    color: var(--muted);
    background: var(--surface-soft);
}

.site-footer {
    position: relative;
    background:
        linear-gradient(135deg, rgba(37, 59, 115, 0.18), rgba(200, 155, 60, 0.12)),
        #11171c;
    color: #eef4f2;
    padding: 46px 0 24px;
}

.site-footer::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 1px;
    background: var(--gradient-line);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 30px;
    position: relative;
}

.site-footer a {
    color: inherit;
    text-decoration: none;
}

.site-footer a:hover {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.site-footer nav {
    display: grid;
    gap: 8px;
}

.site-footer h2 {
    color: #ffffff;
    font-size: 16px;
    margin-bottom: 4px;
}

.site-footer p,
.footer-bottom {
    color: #bac8c4;
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding-top: 18px;
}

.footer-link-button {
    background: transparent;
    color: #eef4f2;
    border: 0;
    padding: 0;
    font: inherit;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    box-shadow: none;
}

.footer-link-button:hover {
    background: transparent;
    box-shadow: none;
    transform: none;
}

.cookie-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    width: min(980px, calc(100% - 32px));
    margin: 0 auto;
    padding: 18px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lift);
}

.cookie-banner h2,
.cookie-panel h2 {
    font-size: 20px;
    margin-bottom: 6px;
}

.cookie-banner p,
.cookie-panel p {
    margin-bottom: 8px;
    color: var(--muted);
}

.cookie-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.button.secondary,
button.secondary {
    background: var(--surface-soft);
    color: var(--accent-dark);
    border: 1px solid var(--line);
    box-shadow: none;
}

.button.secondary:hover,
button.secondary:hover {
    background: var(--accent-soft);
    transform: translateY(-1px);
}

.cookie-panel {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(16, 20, 24, 0.45);
}

.cookie-panel-inner {
    position: relative;
    width: min(620px, 100%);
    max-height: calc(100vh - 36px);
    overflow: auto;
    padding: 25px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lift);
}

.cookie-close {
    position: absolute;
    top: 14px;
    right: 14px;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    background: var(--surface-soft);
    color: var(--accent-dark);
    border: 1px solid var(--line);
    box-shadow: none;
    font-size: 24px;
    line-height: 1;
}

.cookie-close:hover {
    box-shadow: none;
}

.cookie-choice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 0;
    border-top: 1px solid var(--line);
}

.cookie-choice strong,
.cookie-choice small {
    display: block;
}

.cookie-choice small {
    color: var(--muted);
}

@media (max-width: 920px) {
    .entry-grid,
    .two-column,
    .category-list-large,
    .contact-layout,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .entry-grid {
        gap: 14px;
    }
}

@media (max-width: 820px) {
    .site-header-inner,
    .page,
    .footer-grid,
    .footer-bottom {
        width: min(100% - 28px, 1180px);
    }

    .header-top {
        flex-wrap: wrap;
        gap: 12px;
        padding: 14px 0;
    }

    .brand-text strong {
        font-size: 22px;
    }

    .menu-toggle {
        display: inline-grid;
        gap: 4px;
        margin-left: auto;
        padding: 10px;
        width: 42px;
        height: 42px;
        place-content: center;
    }

    .menu-toggle span {
        display: block;
        width: 20px;
        height: 2px;
        background: currentColor;
    }

    .site-search {
        order: 3;
        width: 100%;
        margin-left: 0;
    }

    .nav {
        display: none;
        flex-direction: column;
        align-items: stretch;
    }

    .site-header.is-menu-open .nav,
    .nav.is-open {
        display: flex;
    }

    .hero,
    .page-header {
        padding: 42px 0;
    }

    h1 {
        font-size: clamp(40px, 12vw, 58px);
    }

    .hero-search {
        flex-direction: column;
        padding: 0;
        border: 0;
        box-shadow: none;
    }

    .hero-search input[type="search"] {
        border-color: var(--line);
        box-shadow: inset 0 1px 0 rgba(20, 35, 47, 0.03);
    }

    .cookie-banner,
    .footer-bottom {
        align-items: flex-start;
        flex-direction: column;
    }

    .cookie-actions {
        justify-content: flex-start;
    }
}
