:root {
    --color-primary: #8b6f47;
    --color-secondary: #a0826d;
    --color-accent: #d4af37;
    --color-bg: #faf8f4;
    --color-text: #2c2416;
    --color-text-light: #5c5144;
    --color-border: #d9cbb8;
    --color-header: #f3eadf;
    --spr-header-h: 88px;
    --spr-page-w: 1120px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 28px;
    --font-head: "Bitter", Georgia, serif;
    --font-body: "Cabin", "Segoe UI", sans-serif;
}

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

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

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

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

body {
    padding-top: var(--spr-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;
}

a { color: #6a4e2e; }

h1, h2, h3 {
    font-family: var(--font-head);
    line-height: 1.25;
    font-weight: 700;
}

p { margin: 0 0 0.9rem; }

[hidden] { display: none !important; }

.spr-container {
    width: min(var(--spr-page-w), 100%);
    margin: 0 auto;
    padding: 0 20px;
}

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

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

.spr-header a,
.spr-header a:visited { color: #3d2e1c; }

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

.spr-header__logo {
    display: block;
    flex: 0 0 auto;
    line-height: 0;
}

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

.spr-nav {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-left: auto;
}

.spr-nav__link {
    text-decoration: none;
    font-weight: 600;
    padding: 8px 0;
    border-bottom: 2px solid transparent;
}

.spr-nav__link.spr-is-active { border-bottom-color: var(--color-accent); }

.spr-header__store { flex: 0 0 auto; }

.spr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.4rem 1rem;
    background: var(--color-bg);
    color: #3d2e1c;
    border: 2px solid var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-bg), 0 0 0 5px var(--color-accent);
    text-decoration: none;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    line-height: 1.2;
}

.spr-btn--primary {
    background: var(--color-primary);
    color: #faf8f4;
    border-color: #5c4630;
}

.spr-header .spr-btn,
.spr-header .spr-btn:visited { color: #faf8f4; }

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

.spr-burger {
    width: 44px;
    height: 44px;
    padding: 10px;
    border: 2px solid var(--color-primary);
    background: var(--color-bg);
    cursor: pointer;
    flex: 0 0 auto;
}

.spr-burger span {
    display: block;
    height: 2px;
    margin: 5px 0;
    background: #3d2e1c;
}

.spr-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
}

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

.spr-drawer a {
    display: block;
    padding: 14px 20px;
    color: #3d2e1c;
    text-decoration: none;
    font-size: 1.4rem;
    font-family: var(--font-head);
}

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

.spr-drawer--sheet {
    inset: 0;
    height: 100vh;
    height: 100dvh;
    padding: 72px 24px 32px;
    opacity: 0;
}

body.spr-nav-open { overflow: hidden; }
body.spr-nav-open .spr-overlay { display: none; }
body.spr-nav-open .spr-drawer--sheet { opacity: 1; visibility: visible; }

.spr-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    align-items: start;
    position: relative;
}

.spr-hero { grid-column: 1 / -1; }

.spr-aside {
    grid-column: 1;
    grid-row: 2;
    padding: 28px 20px 40px 20px;
    border-right: 1px solid var(--color-border);
    background: var(--color-bg);
}

@media (min-width: 981px) {
    .spr-aside--pin {
        position: fixed;
        top: var(--spr-header-h);
        left: 0;
        width: 260px;
        max-height: calc(100dvh - var(--spr-header-h));
        overflow-y: auto;
        z-index: 40;
    }

    .spr-aside--end {
        position: absolute;
        top: auto;
        bottom: 0;
        left: 0;
        width: 260px;
        max-height: none;
    }
}

.spr-main {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
}

.spr-hero {
    background: linear-gradient(180deg, #efe4d4 0%, var(--color-bg) 100%);
    padding: 48px 0 32px;
    border-bottom: 1px solid var(--color-border);
}

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

.spr-hero__text { max-width: 62ch; }

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

.spr-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.spr-strip__item {
    border: 1px solid var(--color-border);
    padding: 10px 12px;
    background: #fffdf8;
    clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px), 0 10px);
}

.spr-strip__item strong { display: block; font-family: var(--font-head); }

.spr-section {
    padding: 36px 0;
    animation: spr-scale 0.35s ease both;
}

@keyframes spr-scale {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: none; }
}

.spr-section h2 { margin-top: 0; font-size: 1.7rem; }

.spr-aside h2 { font-size: 1.25rem; }

.spr-aside__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.spr-aside__list a {
    display: block;
    padding: 8px 0;
    text-decoration: none;
    border-bottom: 1px solid var(--color-border);
}

.spr-table-wrap { overflow-x: auto; }

.spr-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
    font-size: 0.95rem;
}

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

.spr-table th {
    font-family: var(--font-head);
    background: #efe4d4;
}

.spr-rank { display: flex; flex-direction: column; gap: 22px; }

.spr-rank__item {
    display: grid;
    grid-template-columns: auto 96px minmax(0, 1fr) 200px;
    grid-template-areas:
        "pos icon name still"
        "pos icon dev still"
        "pos icon desc still"
        "pos icon facts still"
        "pos icon actions still";
    column-gap: 16px;
    row-gap: 4px;
    padding: 18px;
    background: #fffdf8;
    border: 1px solid var(--color-primary);
    clip-path: polygon(14px 0, calc(100% - 14px) 0, 100% 14px, 100% calc(100% - 14px), calc(100% - 14px) 100%, 14px 100%, 0 calc(100% - 14px), 0 14px);
    animation: spr-slide 0.45s ease both;
}

.spr-rank__item:nth-child(2) { animation-delay: 0.05s; }
.spr-rank__item:nth-child(3) { animation-delay: 0.1s; }
.spr-rank__item:nth-child(4) { animation-delay: 0.15s; }

@keyframes spr-slide {
    from { opacity: 0; transform: translateX(18px); }
    to { opacity: 1; transform: none; }
}

.spr-rank__pos { grid-area: pos; font-family: var(--font-head); margin: 0; letter-spacing: 0.04em; }
.spr-rank__name { grid-area: name; margin: 0; font-size: 1.35rem; }
.spr-rank__dev { grid-area: dev; margin: 0; color: var(--color-text-light); }
.spr-rank__desc { grid-area: desc; margin: 6px 0; }
.spr-rank__facts { grid-area: facts; margin: 0; }
.spr-rank__actions { grid-area: actions; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }

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

.spr-rank__item .spr-app__icon { grid-area: icon; }

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

.spr-rank__item .spr-app__preview {
    grid-area: still;
    justify-self: end;
    align-self: center;
}

.spr-faq__item { border-bottom: 1px solid var(--color-border); }

.spr-faq__q {
    width: 100%;
    text-align: left;
    background: transparent;
    border: 0;
    padding: 14px 0;
    font-family: var(--font-head);
    font-size: 1.05rem;
    color: var(--color-text);
    cursor: pointer;
    min-height: 44px;
}

.spr-faq__a { padding: 0 0 14px; }

.spr-pick {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
    padding: 18px;
    background: #fffdf8;
    border: 1px solid var(--color-border);
}

.spr-cta {
    background: #efe4d4;
    padding: 40px 0;
}

.spr-prose { max-width: 760px; }
.spr-prose h1 { font-size: clamp(1.7rem, 3vw, 2.3rem); }

.spr-band {
    height: 10px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    margin: -8px -8px 12px;
}

.spr-card {
    background: #fffdf8;
    border: 1px solid var(--color-border);
    padding: 8px 16px 16px;
    clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 12px, 100% calc(100% - 12px), calc(100% - 12px) 100%, 12px 100%, 0 calc(100% - 12px), 0 12px);
}

.spr-card h3 { margin: 0 0 8px; }
.spr-card a { font-weight: 600; }

.spr-crumbs { font-size: 0.9rem; color: var(--color-text-light); }
.spr-crumbs a { color: inherit; }

.spr-review__head {
    display: flex;
    gap: 16px;
    align-items: center;
    margin: 12px 0 18px;
}

.spr-review .spr-app__preview {
    max-width: 280px;
    max-height: 280px;
    display: block;
    margin: 12px 0 18px;
}

.spr-form { display: grid; gap: 12px; max-width: 520px; }
.spr-form label { font-weight: 600; }
.spr-form input,
.spr-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-primary);
    background: #fffdf8;
    font: inherit;
    color: inherit;
}
.spr-form__status { min-height: 1.4em; }

.spr-footer {
    background: #efe4d4;
    border-top: 3px solid var(--color-primary);
    padding: 22px 0;
}

.spr-footer__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 24px;
}

.spr-footer__links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.spr-footer__link {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    color: #6a4e2e;
    cursor: pointer;
    text-decoration: underline;
    min-height: 44px;
}

.spr-footer__copy,
.spr-footer__note { margin: 0; }

.spr-footer__note { flex-basis: 100%; font-size: 0.92rem; color: var(--color-text-light); }

.spr-cookie { display: none; }

.spr-cookie:not([hidden]) {
    display: flex;
    position: fixed;
    z-index: 110;
    gap: 12px;
    align-items: center;
}

.spr-cookie--pill:not([hidden]) {
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100% - 32px);
    border-radius: 999px;
    background: #fffdf8;
    border: 2px solid var(--color-primary);
    padding: 10px 14px 10px 18px;
    box-shadow: 0 8px 24px rgba(44, 36, 22, 0.12);
}

.spr-cookie p { margin: 0; }

.spr-cookie__actions { display: flex; gap: 8px; flex: 0 0 auto; }

.spr-cookie .spr-btn,
.spr-cookie .spr-btn--primary {
    border-radius: 999px;
    box-shadow: none;
    border: 0;
    background: var(--color-primary);
    color: #faf8f4;
    min-height: 40px;
    padding: 0 1.2rem;
}

@media (max-width: 980px) {
    .spr-nav { display: none; }
    .spr-header__store { display: none; }
    .spr-burger { display: block; margin-left: auto; }
    .spr-overlay { display: block; }
    .spr-drawer { display: block; }
    .spr-layout { grid-template-columns: 1fr; }
    .spr-hero { order: 1; }
    .spr-main { order: 2; grid-column: 1; grid-row: auto; }
    .spr-aside,
    .spr-aside--pin,
    .spr-aside--end {
        order: 3;
        grid-column: 1;
        grid-row: auto;
        position: static;
        top: auto;
        left: auto;
        bottom: auto;
        width: auto;
        max-height: none;
        border-right: 0;
        border-top: 1px solid var(--color-border);
    }
    .spr-rank__item {
        grid-template-columns: auto 72px minmax(0, 1fr);
        grid-template-areas:
            "pos icon name"
            "pos icon dev"
            "pos icon desc"
            "pos icon facts"
            "pos icon actions"
            "still still still";
    }
    .spr-app__icon { width: 72px; height: 72px; }
    .spr-rank__item .spr-app__preview {
        display: block;
        margin: 16px auto 0;
        justify-self: center;
    }
    .spr-strip { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 981px) {
    .spr-burger,
    .spr-overlay,
    .spr-drawer { display: block; }
    .spr-burger { margin-left: 8px; }
    .spr-drawer a { padding: 14px 28px; }
}

@media (max-width: 768px) {
    .spr-header__logo img { width: 120px; }
    .spr-grid { grid-template-columns: repeat(2, 1fr); }
    .spr-cookie--pill:not([hidden]) {
        left: 12px;
        right: 12px;
        transform: none;
        border-radius: 24px;
        flex-wrap: wrap;
    }
    .spr-cookie .spr-btn { min-height: 44px; }
}

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

@media (prefers-reduced-motion: reduce) {
    .spr-rank__item { animation: none; }
}
