:root {
    --color-primary: #4b0082;
    --color-secondary: #6a0dad;
    --color-accent: #00ffff;
    --color-bg: #f5f3ff;
    --color-text: #333;
    --color-text-light: #666;
    --color-border: #d9cfee;
    --ae-header-h: 72px;
    --ae-page-w: 1120px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 28px;
    --font-head: "JetBrains Mono", ui-monospace, monospace;
    --font-body: "Courier Prime", "Courier New", serif;
}

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

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

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

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

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

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

[hidden] { display: none !important; }

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

h1, h2, h3, .ae-footer__label {
    font-family: var(--font-head);
    line-height: 1.25;
    color: var(--color-primary);
}

h1 { font-size: clamp(1.7rem, 3vw, 2.4rem); margin: 0 0 0.6rem; }
h2 { font-size: clamp(1.25rem, 2vw, 1.6rem); margin: 0 0 0.8rem; }
h3 { font-size: 1.05rem; margin: 0; }
p { margin: 0 0 0.8rem; }

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

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

.ae-flex { display: flex; }
.ae-col { flex-direction: column; }
.ae-center { align-items: center; }
.ae-between { justify-content: space-between; }
.ae-wrap { flex-wrap: wrap; }
.ae-gap-sm { gap: var(--space-sm); }
.ae-gap-md { gap: var(--space-md); }
.ae-gap-lg { gap: var(--space-lg); }
.ae-mt-md { margin-top: var(--space-md); }
.ae-mt-lg { margin-top: var(--space-lg); }

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

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

.ae-header a,
.ae-header a:visited { color: #4b0082; }

.ae-header__row {
    display: flex;
    align-items: center;
    min-height: var(--ae-header-h);
    position: relative;
}

.ae-header__logo { display: block; flex: 0 0 auto; }

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

.ae-nav {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 18px;
}

.ae-nav a {
    font-family: var(--font-head);
    font-size: 0.82rem;
    text-decoration: none;
    letter-spacing: 0.02em;
    padding: 8px 0;
}

.ae-nav a.is-active { box-shadow: inset 0 -2px 0 var(--color-accent); }

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

.ae-burger {
    margin-left: auto;
    width: 44px;
    height: 44px;
    padding: 10px;
    border: 1px solid var(--color-primary);
    background: var(--color-bg);
    cursor: pointer;
}

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

.ae-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid var(--color-primary);
    background: transparent;
    color: var(--color-primary);
    font-family: var(--font-head);
    font-size: 0.82rem;
    text-decoration: none;
    cursor: pointer;
    border-radius: 0;
}

.ae-btn--primary {
    background: var(--color-primary);
    color: var(--color-accent);
    border-color: var(--color-accent);
    box-shadow: 0 0 12px rgba(0, 255, 255, 0.55), 0 0 2px var(--color-secondary);
}

.ae-btn--primary:hover { color: #fff; }

.ae-hero {
    position: relative;
    background: var(--color-primary);
    color: #f5f3ff;
    overflow: hidden;
    padding: 48px 0 40px;
}

.ae-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        180deg,
        transparent 0 10px,
        rgba(0, 255, 255, 0.08) 10px 11px
    );
    animation: ae-rain 8s linear infinite;
    pointer-events: none;
}

.ae-hero .ae-container { position: relative; }

.ae-hero h1,
.ae-hero p { color: #f5f3ff; }

.ae-hero .ae-btn {
    color: #f5f3ff;
    border-color: #f5f3ff;
}

.ae-hero .ae-btn--primary,
.ae-cta .ae-btn--primary,
.ae-cookie .ae-btn--primary {
    color: var(--color-accent);
    border-color: var(--color-accent);
}

.ae-cookie .ae-btn {
    color: #f5f3ff;
    border-color: var(--color-accent);
}

@keyframes ae-rain {
    from { transform: translateY(0); }
    to { transform: translateY(22px); }
}

.ae-hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 16px 0; }

.ae-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 8px;
}

.ae-strip__item {
    border: 1px solid var(--color-accent);
    padding: 8px 10px;
    font-family: var(--font-head);
    font-size: 0.72rem;
    color: var(--color-accent);
}

.ae-section { padding: 48px 0; }

.ae-section--line { border-top: 1px solid var(--color-border); }

.ae-card {
    border: 1px solid var(--color-primary);
    border-radius: 0;
    padding: 16px;
    background: #fff;
}

.ae-card h3 { margin-bottom: 8px; }

.ae-rank { display: flex; flex-direction: column; gap: 20px; }

.ae-rank__item {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr) auto;
    gap: 16px 18px;
    align-items: start;
    border: 1px solid var(--color-primary);
    border-radius: 0;
    padding: 16px;
    background: #fff;
    animation: ae-in 0.3s ease both;
}

.ae-rank__pos {
    grid-column: 1 / -1;
    margin: 0;
    font-family: var(--font-head);
    letter-spacing: 0.08em;
    color: var(--color-secondary);
}

.ae-rank__dev { margin: 4px 0; color: var(--color-text-light); }
.ae-rank__facts { margin: 8px 0 0; overflow-wrap: anywhere; }
.ae-rank__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }

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

.ae-duotone { position: relative; display: inline-block; max-width: 200px; }
.ae-duotone::after {
    content: "";
    position: absolute;
    inset: 0;
    background: #6a0dad;
    mix-blend-mode: multiply;
    pointer-events: none;
}

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

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

.ae-log { list-style: none; margin: 0; padding: 0; }
.ae-log li {
    border-left: 3px solid var(--color-accent);
    padding: 8px 0 8px 14px;
    margin-bottom: 10px;
}

.ae-band {
    height: 8px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    margin: -16px -16px 14px;
}

.ae-crumbs { font-family: var(--font-head); font-size: 0.8rem; margin-bottom: 16px; }
.ae-crumbs a { text-decoration: none; }

.ae-form { display: grid; gap: 12px; max-width: 560px; }
.ae-form label { font-family: var(--font-head); font-size: 0.8rem; }
.ae-form input,
.ae-form textarea {
    width: 100%;
    border: 1px solid var(--color-primary);
    border-radius: 0;
    background: #fff;
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 1rem;
    padding: 10px 12px;
}
.ae-form textarea { min-height: 140px; resize: vertical; }
.ae-form__error { color: #8b1e3f; min-height: 1.2em; }

.ae-cta {
    background: #1a0a2e;
    color: #f5f3ff;
    padding: 48px 0;
}
.ae-cta h2,
.ae-cta p { color: #f5f3ff; }

.ae-footer {
    background: var(--color-primary);
    color: #f5f3ff;
    padding: 32px 0 24px;
}
.ae-footer a,
.ae-footer__link {
    color: var(--color-accent);
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    cursor: pointer;
    text-decoration: none;
}
.ae-footer__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 20px;
}
.ae-footer__label { color: var(--color-accent); margin: 0 0 8px; }
.ae-footer__list { list-style: none; margin: 0; padding: 0; }
.ae-footer__list li { margin: 6px 0; }
.ae-footer__note,
.ae-footer__copy { color: #efe8ff; font-size: 0.92rem; }

.ae-cookie { display: none; }
.ae-cookie:not([hidden]) {
    display: flex;
    position: fixed;
    z-index: 110;
    left: 0;
    right: 0;
    bottom: 0;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    background: #1a0a2e;
    color: #f5f3ff;
    border-top: 2px solid var(--color-accent);
    padding: 12px 20px;
}
.ae-cookie p { margin: 0; }
.ae-cookie a { color: var(--color-accent); }
.ae-cookie__actions { display: flex; gap: 8px; flex-shrink: 0; }

@keyframes ae-in {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@media (max-width: 1100px) {
    .ae-nav { display: none; }
    .ae-header__row { display: flex; align-items: center; justify-content: space-between; }
    .ae-burger { display: block; width: 44px; height: 44px; margin-left: auto; }

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

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

    .ae-drawer a { display: block; padding: 14px 20px; color: var(--color-primary); text-decoration: none; font-family: var(--font-head); }

    .ae-drawer__close {
        position: absolute;
        top: 12px;
        right: 16px;
        width: 44px;
        height: 44px;
        border: 1px solid var(--color-primary);
        background: var(--color-bg);
        color: var(--color-primary);
        font-size: 1.6rem;
        line-height: 1;
        cursor: pointer;
    }

    .ae-drawer--wide {
        top: 0;
        right: 0;
        height: 100vh;
        height: 100dvh;
        width: min(85vw, 400px);
        padding: 72px 0 24px;
        transform: translateX(100%);
    }

    body.nav-open { overflow: hidden; }
    body.nav-open .ae-overlay { opacity: 1; visibility: visible; }
    body.nav-open .ae-drawer { visibility: visible; }
    body.nav-open .ae-drawer--wide { transform: translateX(0); }
}

@media (max-width: 768px) {
    .ae-header__logo img { width: 120px; }
    .ae-grid { grid-template-columns: repeat(2, 1fr); }
    .ae-strip { grid-template-columns: 1fr 1fr; }
    .ae-rank__item { grid-template-columns: 72px minmax(0, 1fr); }
    .ae-rank__item .ae-duotone { grid-column: 1 / -1; }
    .ae-rank__item .ae-app__preview {
        display: block;
        margin: 16px auto 0;
    }
    .ae-app__icon { width: 72px; height: 72px; }
    .ae-footer__grid { grid-template-columns: 1fr; }
    .ae-cookie:not([hidden]) {
        left: 12px;
        right: 12px;
        flex-direction: column;
        align-items: stretch;
    }
    .ae-cookie__actions .ae-btn { min-height: 44px; }
}

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