:root {
    --color-primary: #27ae60;
    --color-secondary: #52be80;
    --color-accent: #ffd700;
    --color-bg: #f0fdf4;
    --color-text: #1c2b22;
    --color-text-light: #3d5346;
    --color-border: #cfe3d4;
    --color-nav: #145233;
    --spe-header-h: 84px;
    --spe-page-w: 1120px;
    --space-lg: 24px;
    --spe-font-head: "Manrope", sans-serif;
    --spe-font-body: "Atkinson Hyperlegible", sans-serif;
}

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

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

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

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

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

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

h1, h2, h3 {
    font-family: var(--spe-font-head);
    line-height: 1.2;
    margin: 0 0 0.6em;
}

h1 { font-size: clamp(1.8rem, 4vw, 2.7rem); }
h2 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); }

p { margin: 0 0 1em; }

a { color: var(--color-nav); }

[hidden] { display: none !important; }

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

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

@media (max-width: 768px) {
    .spe-grid { grid-template-columns: repeat(2, 1fr); }
}

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

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

.spe-header a,
.spe-header a:visited { color: var(--color-nav); }

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

.spe-header__logo { display: flex; align-items: center; flex: 0 0 auto; }

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

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

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

.spe-nav a {
    text-decoration: none;
    font-family: var(--spe-font-head);
    font-weight: 700;
    font-size: 0.92rem;
    white-space: nowrap;
    padding: 6px 0;
}

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

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

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

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

@media (max-width: 1200px) {
    .spe-nav { display: none; }
    .spe-header__row { justify-content: space-between; }
    .spe-burger { display: block; }

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

    .spe-drawer {
        display: block;
        position: fixed;
        z-index: 210;
        background: #f0fdf4;
        overflow-y: auto;
        visibility: hidden;
        transition: transform .3s ease, opacity .3s ease, visibility .3s;
    }

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

    .spe-drawer a.is-active { background: #dff5e6; }

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

    body.nav-open { overflow: hidden; }
    body.nav-open .spe-overlay { opacity: 1; visibility: visible; }
    body.nav-open .spe-drawer { visibility: visible; }

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

    body.nav-open .spe-drawer--wide { transform: translateX(0); }
}

.spe-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    background: transparent;
    color: #145233;
    border: 2px solid #27ae60;
    border-radius: 8px;
    text-decoration: none;
    font-family: var(--spe-font-head);
    font-weight: 700;
    cursor: pointer;
}

.spe-btn:hover,
.spe-btn:focus-visible {
    background: #27ae60;
    color: #f0fdf4;
}

.spe-btn--primary {
    background: #27ae60;
    border-color: #27ae60;
    color: #f0fdf4;
}

.spe-section { padding: 56px 0; animation: spe-fade .3s ease; }
.spe-section--alt { background: #e5f6ea; }

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

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

.spe-hero {
    position: relative;
    min-height: 560px;
    background: #143d28 url("/images/hero.jpg") center / cover no-repeat;
    display: flex;
    align-items: stretch;
}

.spe-hero__layout {
    display: flex;
    align-items: stretch;
    width: 100%;
}

.spe-hero__panel {
    width: min(40vw, 34rem);
    background: #143d28;
    color: #f0fdf4;
    padding: 48px 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.spe-hero__panel h1,
.spe-hero__text { color: #f0fdf4; }

.spe-hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

.spe-hero .spe-btn { color: #f0fdf4; border-color: #ffd700; }
.spe-hero .spe-btn:hover { background: #ffd700; color: #143d28; }
.spe-hero .spe-btn--primary { background: #27ae60; border-color: #27ae60; color: #f0fdf4; }

.spe-card,
.spe-rank__item,
.spe-note {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 20px;
}

.spe-card { transition: transform .2s ease; }
.spe-card:hover { transform: scale(1.05); }

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

.spe-rank__item {
    display: grid;
    grid-template-columns: auto 96px 1fr 200px;
    grid-template-areas:
        "pos icon name preview"
        "pos icon dev preview"
        "pos icon desc preview"
        "pos icon facts preview"
        "pos icon actions preview";
    column-gap: 16px;
    row-gap: 6px;
    align-items: start;
}

.spe-rank__pos {
    grid-area: pos;
    margin: 0;
    font-family: var(--spe-font-head);
    font-weight: 800;
    color: #145233;
}

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

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

.spe-app__preview {
    width: auto;
    height: auto;
    max-width: 200px;
    max-height: 240px;
    object-fit: contain;
    transition: transform .2s ease;
}

.spe-rank__item:hover .spe-app__preview { transform: scale(1.05); }

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

.spe-log { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.spe-log__date { font-family: var(--spe-font-head); font-weight: 800; margin: 0 0 4px; color: #145233; }

.spe-faq { display: grid; gap: 10px; }
.spe-faq__item { border: 1px solid var(--color-border); border-radius: 12px; background: #fff; }
.spe-faq__q {
    width: 100%;
    text-align: left;
    background: transparent;
    border: 0;
    min-height: 44px;
    padding: 12px 16px;
    font-family: var(--spe-font-head);
    font-weight: 700;
    font-size: 1rem;
    color: var(--color-nav);
    cursor: pointer;
}
.spe-faq__a { padding: 0 16px 12px; }

.spe-cta {
    background: #145233;
    color: #f0fdf4;
    padding: 56px 0;
}
.spe-cta h2 { color: #f0fdf4; }
.spe-cta .spe-btn--primary { background: #ffd700; border-color: #ffd700; color: #143d28; }

.spe-footer {
    background: #123828;
    color: #e7f6ec;
    padding: 28px 0;
}
.spe-footer a,
.spe-footer__link {
    color: #e7f6ec;
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    cursor: pointer;
    text-decoration: underline;
}
.spe-footer__row { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; }
.spe-footer__links { display: flex; flex-wrap: wrap; gap: 8px 18px; list-style: none; margin: 0; padding: 0; }
.spe-footer__legal, .spe-footer__copy { margin: 0; flex: 1 1 100%; font-size: 0.92rem; }
.spe-footer__brand { margin: 0; font-family: var(--spe-font-head); font-weight: 800; }

.spe-cookie { display: none; }
.spe-cookie:not([hidden]) {
    display: flex;
    position: fixed;
    z-index: 110;
    left: 0;
    right: 0;
    bottom: 0;
    background: #123828;
    color: #f0fdf4;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.16);
}
.spe-cookie a { color: #ffd700; }
.spe-cookie__inner {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    padding-bottom: 14px;
    width: 100%;
}
.spe-cookie p { margin: 0; }

.spe-prose { max-width: 760px; }
.spe-page { padding: 40px 0 64px; }
.spe-crumbs { font-size: 0.92rem; margin-bottom: 16px; }
.spe-crumbs a { text-decoration: none; }

.spe-facts {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 16px 18px;
}
.spe-facts li { margin: 0.3em 0; }

.spe-band {
    height: 10px;
    border-radius: 12px 12px 0 0;
    margin: -20px -20px 16px;
}
.spe-band--1 { background: #27ae60; }
.spe-band--2 { background: #52be80; }
.spe-band--3 { background: #1a5c38; }
.spe-band--4 { background: #ffd700; }

.spe-note h3 { margin-top: 0; }
.spe-note a.spe-btn { margin-top: 8px; }

.spe-form { display: grid; gap: 12px; max-width: 560px; }
.spe-form label { font-family: var(--spe-font-head); font-weight: 700; }
.spe-form input,
.spe-form textarea {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 10px 12px;
    font: inherit;
    background: #fff;
}
.spe-form textarea { min-height: 140px; }
.spe-status { background: #fff; border-radius: 12px; padding: 12px 14px; border: 1px solid var(--color-border); }

.spe-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 28px;
    align-items: start;
}

@media (max-width: 768px) {
    .spe-hero { min-height: 0; }
    .spe-hero__panel { width: 100%; }
    .spe-rank__item {
        grid-template-columns: auto 72px 1fr;
        grid-template-areas:
            "pos icon name"
            "pos icon dev"
            "desc desc desc"
            "facts facts facts"
            "preview preview preview"
            "actions actions actions";
    }
    .spe-rank__item .spe-app__icon { width: 72px; height: 72px; }
    .spe-rank__item .spe-app__preview {
        display: block;
        margin: 16px auto 0;
        justify-self: center;
    }
    .spe-split { grid-template-columns: 1fr; }
    .spe-cookie__inner { flex-direction: column; align-items: stretch; }
    .spe-cookie:not([hidden]) { left: 12px; right: 12px; bottom: 12px; border-radius: 12px; }
}

@media (max-width: 480px) {
    .spe-hero__actions .spe-btn { width: 100%; }
}
