:root {
    --color-primary: #0a4a7d;
    --color-secondary: #1e90ff;
    --color-accent: #00d4ff;
    --color-bg: #e8f4f8;
    --color-text: #16324a;
    --color-text-light: #3d5c73;
    --color-border: #c5d8e4;
    --qh-header-h: 84px;
    --qh-page-w: 1120px;
    --space-lg: 24px;
    --qh-font-d: "Bebas Neue", Impact, sans-serif;
    --qh-font-b: Ubuntu, "Segoe UI", sans-serif;
    --qh-radius: 20px;
}

@media (max-width: 1100px) {
    :root { --qh-header-h: 72px; }
}

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

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

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

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

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(0, 212, 255, 0.08), transparent 28%),
        repeating-linear-gradient(90deg, rgba(10, 74, 125, 0.05) 0 1px, transparent 1px 72px);
}

main, .qh-footer { position: relative; z-index: 1; }

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

a:not(.qh-btn) { color: var(--color-primary); }

h1, h2, h3 {
    font-family: var(--qh-font-d);
    font-weight: 400;
    letter-spacing: 0.04em;
    line-height: 1.05;
    margin: 0 0 0.6rem;
}

h1 { font-size: clamp(2.4rem, 5vw, 4.2rem); color: var(--color-primary); }
.qh-hero__panel h1 { color: #fff; }
h2 { font-size: clamp(1.8rem, 3vw, 2.6rem); color: var(--color-primary); }
h3 { font-size: 1.6rem; }

p { margin: 0 0 0.9rem; }

[hidden] { display: none !important; }

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

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

.qh-u-shell {
    max-width: var(--qh-page-w);
    margin: 0 auto;
    padding: 28px 20px 64px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 32px;
    align-items: start;
}

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

.qh-header__row {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: var(--qh-header-h);
}

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

.qh-header a,
.qh-header a:visited { color: #0a4a7d; }

.qh-nav {
    display: flex;
    flex-wrap: nowrap;
    gap: 14px;
    margin-left: auto;
    align-items: center;
}

.qh-nav a {
    text-decoration: none;
    font-size: 0.92rem;
    white-space: nowrap;
}

.qh-nav a.is-active { text-decoration: underline; text-underline-offset: 4px; }

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

.qh-burger {
    width: 44px;
    height: 44px;
    margin-left: auto;
    border: 0;
    background: transparent;
    padding: 10px;
    cursor: pointer;
}

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

.qh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 8px;
    border: 2px solid var(--color-primary);
    background: transparent;
    color: var(--color-primary);
    font-family: var(--qh-font-b);
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
}

.qh-btn--primary {
    border: 0;
    color: #fff;
    background: linear-gradient(115deg, #0a4a7d 0 50%, #1e90ff 50% 100%);
}

.qh-btn--primary:hover { filter: brightness(1.08); }

.qh-hero {
    position: relative;
    min-height: 78vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    background: #0a4a7d;
}

.qh-hero__still {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
}

.qh-hero__panel {
    position: relative;
    z-index: 1;
    width: min(40%, 28rem);
    margin: 6vh 0 6vh 4vw;
    padding: 28px 24px;
    border-radius: var(--qh-radius);
    background: rgba(10, 74, 125, 0.92);
    color: #e8f4f8;
    animation: qh-fade 0.3s ease both;
}

.qh-hero__panel p { color: #e8f4f8; }

.qh-hero__actions { display: flex; flex-wrap: wrap; gap: 10px; }

.qh-hero__actions .qh-btn:not(.qh-btn--primary) {
    color: #e8f4f8;
    border-color: #00d4ff;
}

.qh-section { margin: 0 0 40px; animation: qh-fade 0.3s ease both; }

.qh-aside {
    background: #fff;
    border-radius: var(--qh-radius);
    padding: 18px;
    border: 1px solid var(--color-border);
}

@media (min-width: 901px) {
    .qh-aside--pinned {
        position: fixed;
        top: calc(var(--qh-header-h) + 16px);
        right: max(20px, calc((100% - var(--qh-page-w)) / 2 + 20px));
        width: 260px;
        max-height: calc(100dvh - var(--qh-header-h) - 32px);
        overflow-y: auto;
        z-index: 2;
    }
}

.qh-aside h2 { font-size: 1.7rem; }

.qh-rank { display: flex; flex-direction: column; gap: 18px; }

.qh-rank__item {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr) 200px;
    grid-template-areas:
        "pos pos pos"
        "icon name preview"
        "icon dev preview"
        "icon desc preview"
        "facts facts preview"
        "actions actions preview";
    gap: 6px 16px;
    padding: 18px;
    background: #fff;
    border-radius: var(--qh-radius);
    border: 1px solid var(--color-border);
}

.qh-rank__pos {
    grid-area: pos;
    margin: 0;
    font-family: var(--qh-font-d);
    letter-spacing: 0.12em;
    color: var(--color-secondary);
    animation: qh-float 3.2s ease-in-out infinite;
}

.qh-rank__item .qh-app__icon { grid-area: icon; }
.qh-rank__name { grid-area: name; margin: 0; }
.qh-rank__dev { grid-area: dev; margin: 0; color: var(--color-text-light); }
.qh-rank__desc { grid-area: desc; margin: 0; }
.qh-rank__facts { grid-area: facts; margin: 8px 0 0; overflow-wrap: anywhere; }
.qh-rank__item .qh-app__preview { grid-area: preview; justify-self: end; }
.qh-rank__actions { grid-area: actions; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

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

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

.qh-pick__card {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
    background: #fff;
    border-radius: var(--qh-radius);
    padding: 18px;
    border: 1px solid var(--color-border);
}

.qh-pick__kicker {
    font-family: var(--qh-font-d);
    letter-spacing: 0.08em;
    color: var(--color-secondary);
    margin: 0 0 4px;
}

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

.qh-note-card {
    background: #fff;
    border-radius: var(--qh-radius);
    overflow: hidden;
    border: 1px solid var(--color-border);
}

.qh-note-card__band { height: 12px; }
.qh-note-card--a .qh-note-card__band { background: linear-gradient(90deg, #0a4a7d, #00d4ff); }
.qh-note-card--b .qh-note-card__band { background: #1e90ff; }
.qh-note-card--c .qh-note-card__band { background: linear-gradient(90deg, #00d4ff, #0a4a7d); }
.qh-note-card--d .qh-note-card__band { background: #0a4a7d; }
.qh-note-card--e .qh-note-card__band { background: linear-gradient(90deg, #1e90ff, #00d4ff); }

.qh-note-card h3, .qh-note-card p { padding: 0 16px; }
.qh-note-card h3 { padding-top: 14px; }
.qh-note-card p { padding-bottom: 16px; }
.qh-note-card a { text-decoration: none; }

.qh-cta {
    background: #0a4a7d;
    color: #e8f4f8;
    border-radius: var(--qh-radius);
    padding: 24px;
}

.qh-cta h2, .qh-cta p { color: #e8f4f8; }

.qh-page { padding: 36px 0 72px; }

.qh-measure { max-width: 760px; }

.qh-crumbs { font-size: 0.92rem; margin-bottom: 12px; }
.qh-crumbs a { text-decoration: none; }

.qh-facts { padding-left: 1.1rem; }
.qh-facts li { margin: 0 0 0.35rem; }

.qh-review-head {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr) 280px;
    gap: 16px;
    align-items: start;
    margin-bottom: 18px;
}

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

.qh-acc { border-top: 1px solid var(--color-border); }
.qh-acc button {
    width: 100%;
    text-align: left;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--color-border);
    min-height: 44px;
    padding: 12px 0;
    font-family: var(--qh-font-b);
    font-size: 1rem;
    color: var(--color-primary);
    cursor: pointer;
}

.qh-acc .qh-acc__panel { padding: 0 0 12px; }

.qh-form { display: grid; gap: 12px; max-width: 560px; }
.qh-form label { display: grid; gap: 4px; font-size: 0.92rem; }
.qh-form input, .qh-form textarea {
    font: inherit;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--color-border);
    background: #fff;
    color: var(--color-text);
}
.qh-form .qh-error { color: #8d1d1d; min-height: 1.2em; }

.qh-footer {
    background: #0a4a7d;
    color: #e8f4f8;
    padding: 36px 0 28px;
}

.qh-footer a, .qh-footer a:visited { color: #00d4ff; }

.qh-footer__map, .qh-footer__legal {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
}

.qh-footer__link {
    background: none;
    border: 0;
    color: #00d4ff;
    font: inherit;
    cursor: pointer;
    padding: 0;
    min-height: 44px;
}

.qh-cookie { display: none; }

.qh-cookie:not([hidden]) {
    display: block;
    position: fixed;
    z-index: 110;
    left: 0;
    right: 0;
    bottom: 0;
    background: #0a4a7d;
    color: #e8f4f8;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.16);
}

.qh-cookie__row {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    padding-bottom: 14px;
}

.qh-cookie p { margin: 0; }
.qh-cookie a { color: #00d4ff; }

@keyframes qh-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes qh-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@media (prefers-reduced-motion: reduce) {
    .qh-rank__pos, .qh-hero__panel, .qh-section { animation: none; }
}

@media (max-width: 1100px) {
    .qh-nav { display: none; }
    .qh-header__row { justify-content: space-between; }
    .qh-burger { display: block; }
    .qh-header__logo img { width: 120px; }

    .qh-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;
    }

    .qh-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;
    }

    .qh-drawer a { display: block; padding: 14px 20px; color: #0a4a7d; text-decoration: none; }

    .qh-drawer__close {
        position: absolute;
        top: 12px;
        right: 16px;
        width: 44px;
        height: 44px;
        border: 0;
        background: transparent;
        font-size: 1.8rem;
        line-height: 1;
        cursor: pointer;
        color: var(--color-primary);
    }

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

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

@media (max-width: 900px) {
    .qh-u-shell { grid-template-columns: 1fr; }
    .qh-rank__item {
        grid-template-columns: 72px minmax(0, 1fr);
        grid-template-areas:
            "pos pos"
            "icon name"
            "icon dev"
            "desc desc"
            "facts facts"
            "preview preview"
            "actions actions";
    }
    .qh-rank__item .qh-app__preview { justify-self: center; margin-top: 8px; }
    .qh-pick__card, .qh-review-head { grid-template-columns: 1fr; }
    .qh-review-head .qh-app__preview, .qh-pick__card .qh-app__preview { margin: 0 auto; }
}

@media (max-width: 768px) {
    .qh-u-grid { grid-template-columns: repeat(2, 1fr); }
    .qh-hero {
        min-height: 0;
        display: block;
    }
    .qh-hero__panel {
        width: auto;
        max-width: none;
        max-height: none;
        overflow: visible;
        margin: 20px 16px 24px;
    }
    .qh-hero__actions { flex-direction: column; align-items: stretch; }
    .qh-hero__actions .qh-btn { width: 100%; }
    .qh-btn--primary { background: #1e90ff; }
    .qh-cookie:not([hidden]) { left: 12px; right: 12px; }
    .qh-cookie__row { flex-direction: column; align-items: stretch; }
    .qh-app__icon { width: 72px; height: 72px; }
}

@media (max-width: 480px) {
    .qh-u-grid { grid-template-columns: 1fr; }
}
