:root {
    --color-primary: #001f3f;
    --color-secondary: #003d7a;
    --color-accent: #0074d9;
    --color-bg: #f0f4f8;
    --color-text: #1a2430;
    --color-text-light: #4a5563;
    --color-border: #c5d0dc;
    --color-paper: #ffffff;
    --mci-header-h: 72px;
    --mci-page-w: 1120px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 28px;
    --font-h: "Playfair Display", Georgia, serif;
    --font-b: "Source Sans 3", "Source Sans Pro", sans-serif;
}

@media (max-width: 768px) {
    :root { --mci-header-h: 64px; }
}

[hidden] { display: none !important; }

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    max-width: 100%;
    overflow-x: hidden;
}

html { scroll-padding-top: var(--mci-header-h); }

body {
    padding-top: var(--mci-header-h);
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-b);
    line-height: 1.6;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(90deg, rgba(0, 31, 63, 0.03) 1px, transparent 1px),
        linear-gradient(rgba(0, 31, 63, 0.03) 1px, transparent 1px);
    background-size: 24px 24px;
}

img, video, iframe {
    max-width: 100%;
    height: auto;
}

a { color: var(--color-secondary); }
a:hover { color: var(--color-accent); }

h1, h2, h3 {
    font-family: var(--font-h);
    line-height: 1.25;
    color: var(--color-primary);
}

.mci-container {
    max-width: var(--mci-page-w);
    margin: 0 auto;
    padding: 0 20px;
}

.mci-container--flush { padding: 0; }

.mci-measure {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 20px 48px;
}

.mci-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-lg);
}

.mci-u-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

.mci-u-kicker {
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-size: 0.78rem;
    color: var(--color-secondary);
    margin: 0 0 12px;
}

.mci-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    min-height: var(--mci-header-h);
    background: var(--color-bg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-bottom: 2px solid var(--color-primary);
}

.mci-header a,
.mci-header a:visited { color: #001f3f; }

.mci-header__row {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--mci-header-h);
}

.mci-header__logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: block;
}

.mci-header__logo img {
    width: 180px;
    height: auto;
    display: block;
}

.mci-nav {
    display: flex;
    gap: 18px;
    align-items: center;
}

.mci-nav--west { margin-right: auto; }
.mci-nav--east { margin-left: auto; }

.mci-nav__a {
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    border-bottom: 2px solid transparent;
    padding: 6px 0;
}

.mci-nav__a:hover,
.mci-nav__a.is-active {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
}

.mci-burger,
.mci-overlay,
.mci-drawer { display: none; }

.mci-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 28px 8px 22px;
    border: 1px solid var(--color-primary);
    background: transparent;
    color: var(--color-primary);
    text-decoration: none;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}

.mci-btn:hover,
.mci-btn:visited:hover {
    background: var(--color-primary);
    color: #f0f4f8;
}

.mci-btn--primary {
    background: var(--color-primary);
    color: #f0f4f8;
    border-color: var(--color-primary);
}

.mci-btn--primary:hover,
.mci-btn--primary:visited:hover {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: #fff;
}

a.mci-btn,
a.mci-btn:visited { color: var(--color-primary); }
a.mci-btn--primary,
a.mci-btn--primary:visited { color: #f0f4f8; }

.mci-hero {
    background:
        radial-gradient(circle at 12% 20%, rgba(0, 116, 217, 0.18), transparent 36%),
        linear-gradient(180deg, #d7e3ef 0%, var(--color-bg) 100%);
    padding: 56px 0 40px;
    border-bottom: 1px solid var(--color-border);
}

.mci-hero__title {
    font-size: clamp(1.8rem, 3.4vw, 2.7rem);
    max-width: 18ch;
    margin: 0 0 16px;
}

.mci-hero__text {
    max-width: 62ch;
    margin: 0 0 12px;
}

.mci-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    list-style: none;
    padding: 20px 0 0;
    margin: 28px 0 0;
    border-top: 1px solid var(--color-border);
}

.mci-facts li {
    font-size: 0.92rem;
    color: var(--color-text-light);
}

.mci-wrap { padding: 12px 0 8px; }

.mci-block { padding: 36px 0; }

.mci-h2 {
    font-size: clamp(1.4rem, 2.4vw, 2rem);
    margin: 0 0 18px;
}

.mci-magazine {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 32px;
    max-width: var(--mci-page-w);
    margin: 0 auto;
    padding: 0 20px;
}

.mci-side {
    background: var(--color-paper);
    border: 1px solid var(--color-border);
    padding: 20px;
    clip-path: polygon(16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%, 0 16px);
    height: fit-content;
}

.mci-side__label {
    font-family: var(--font-h);
    margin: 0 0 10px;
}

.mci-side ul { padding-left: 18px; margin: 0 0 16px; }

.mci-rank {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.mci-rank__item {
    background: var(--color-paper);
    border: 1px solid var(--color-border);
    padding: 20px 20px 20px 22px;
    clip-path: polygon(18px 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%, 0 18px);
}

.mci-rank__pos {
    margin: 0 0 8px;
    letter-spacing: 0.16em;
    font-size: 0.78rem;
    color: var(--color-accent);
}

.mci-rank__name { margin: 8px 0 4px; }
.mci-rank__dev { margin: 0 0 8px; color: var(--color-text-light); }
.mci-rank__desc { margin: 0 0 10px; }
.mci-rank__facts {
    margin: 0 0 8px;
    color: var(--color-text-light);
    font-size: 0.92rem;
}

.mci-app__icon {
    width: 96px;
    height: 96px;
    border-radius: 22%;
    object-fit: contain;
    flex-shrink: 0;
}

.mci-app__preview {
    width: auto;
    height: auto;
    max-width: 200px;
    max-height: 240px;
    object-fit: contain;
}

.mci-review .mci-app__preview {
    max-width: 280px;
    max-height: 280px;
}

.mci-app__note,
.mci-app__checked {
    font-size: 0.9rem;
    color: var(--color-text-light);
}

.mci-app__head {
    display: flex;
    gap: 16px;
    align-items: center;
    margin: 16px 0;
}

.mci-app__facts { padding-left: 18px; }

.mci-rank__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.mci-note {
    display: block;
    background: var(--color-paper);
    border: 1px solid var(--color-border);
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
}

.mci-note:hover { color: inherit; border-color: var(--color-accent); }

.mci-note h2,
.mci-note h3 {
    margin: 14px 16px 6px;
    font-size: 1.15rem;
}

.mci-note p { margin: 0 16px 16px; color: var(--color-text-light); }

.mci-note__band { display: block; height: 18px; }
.mci-note__band--a { background: linear-gradient(90deg, #001f3f, #0074d9); }
.mci-note__band--b { background: linear-gradient(90deg, #003d7a, #7aa6d4); }
.mci-note__band--c { background: linear-gradient(90deg, #0074d9, #c5d0dc); }
.mci-note__band--d { background: linear-gradient(90deg, #1a2430, #001f3f); }

.mci-scroll { overflow-x: auto; }

.mci-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
    background: var(--color-paper);
}

.mci-table th,
.mci-table td {
    border: 1px solid var(--color-border);
    padding: 10px 12px;
    text-align: left;
}

.mci-cta {
    background: var(--color-primary);
    color: #e8eef5;
    padding: 48px 0;
}

.mci-cta .mci-h2,
.mci-cta p { color: #e8eef5; }

.mci-cta a.mci-btn--primary,
.mci-cta a.mci-btn--primary:visited {
    background: #f0f4f8;
    color: #001f3f;
    border-color: #f0f4f8;
}

.mci-cta a.mci-btn--primary:hover {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
}

.mci-section { padding: 40px 0 56px; }

.mci-crumb { font-size: 0.88rem; color: var(--color-text-light); }

.mci-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 20px;
}

.mci-form input,
.mci-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    font: inherit;
    background: var(--color-paper);
}

.mci-form__err { color: #8b1e1e; }
.mci-form__ok { color: #1b5e20; }

.mci-footer {
    background: #0c1826;
    color: #d5dde6;
    padding: 40px 0 24px;
}

.mci-footer a,
.mci-footer a:visited { color: #d5dde6; }
.mci-footer a:hover { color: #7ec2ff; }

.mci-footer__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
    margin-bottom: 28px;
}

.mci-footer__label {
    font-family: var(--font-h);
    color: #fff;
    margin: 0 0 10px;
}

.mci-footer ul { list-style: none; padding: 0; margin: 0; }
.mci-footer li { margin: 0 0 6px; }

.mci-footer__link {
    background: none;
    border: 0;
    padding: 0;
    color: inherit;
    font: inherit;
    cursor: pointer;
    text-decoration: underline;
}

.mci-footer__legal,
.mci-footer__copy { font-size: 0.88rem; color: #9aa7b5; }

.mci-cookie { display: none; }

.mci-cookie:not([hidden]) {
    display: flex;
    position: fixed;
    z-index: 110;
    gap: 12px;
    align-items: flex-start;
    flex-direction: column;
    bottom: 16px;
    right: 16px;
    max-width: 360px;
    background: var(--color-paper);
    border: 1px solid var(--color-primary);
    padding: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.mci-cookie__actions { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 1024px) {
    .mci-magazine { grid-template-columns: 1fr; }
    .mci-nav { gap: 12px; }
}

@media (max-width: 1100px) {
    .mci-nav { display: none; }

    .mci-header__logo {
        position: static;
        transform: none;
    }

    .mci-header__row { justify-content: space-between; }

    .mci-header__logo img { width: 160px; }

    .mci-burger {
        display: block;
        width: 44px;
        height: 44px;
        margin-left: auto;
        border: 0;
        background: transparent;
        padding: 10px 8px;
    }

    .mci-burger span {
        display: block;
        height: 2px;
        margin: 5px 0;
        background: var(--color-primary);
    }

    .mci-overlay {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 200;
        background: rgba(0, 0, 0, 0.45);
        opacity: 0;
        visibility: hidden;
        transition: opacity .25s, visibility .25s;
    }

    .mci-drawer {
        display: block;
        position: fixed;
        z-index: 210;
        background: var(--color-bg);
        overflow-y: auto;
        visibility: hidden;
        transition: transform .3s ease, opacity .3s ease, visibility .3s;
    }

    .mci-drawer a { display: block; padding: 14px 20px; }

    .mci-drawer__close {
        position: absolute;
        top: 12px;
        right: 16px;
        width: 44px;
        height: 44px;
        border: 0;
        background: transparent;
        font-size: 1.8rem;
        line-height: 1;
    }

    .mci-drawer--top {
        top: var(--mci-header-h);
        left: 0;
        right: 0;
        max-height: calc(100dvh - var(--mci-header-h));
        padding: 56px 0 16px;
        transform: translateY(-16px);
        opacity: 0;
    }

    body.nav-open { overflow: hidden; }
    body.nav-open .mci-overlay { opacity: 1; visibility: visible; }
    body.nav-open .mci-drawer { visibility: visible; }
    body.nav-open .mci-drawer--top { transform: translateY(0); opacity: 1; }

}

@media (max-width: 768px) {
    .mci-header__logo img { width: 120px; }

    .mci-rank__item .mci-app__preview {
        display: block;
        margin: 16px auto 0;
    }

    .mci-footer__grid { grid-template-columns: 1fr 1fr; }

    .mci-cookie:not([hidden]) {
        left: 12px;
        right: 12px;
        max-width: none;
    }

    .mci-cookie .mci-btn { min-height: 44px; }
}

@media (max-width: 480px) {
    .mci-grid { grid-template-columns: 1fr; }
    .mci-footer__grid { grid-template-columns: 1fr; }
    .mci-hero { padding: 36px 0 28px; }
}
