:root {
    --bg-main: #020617;
    --bg-alt: #050b1f;
    --bg-card: rgba(15, 23, 42, 0.94);
    --border-subtle: rgba(148, 163, 184, 0.35);
    --accent: #22c55e;
    --accent-soft: rgba(34, 197, 94, 0.18);
    --text-main: #e5e7eb;
    --text-muted: #9ca3af;
    --danger: #f97373;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.75);
    --container-width: 1200px; /* чуть шире, чтобы карточки были крупнее */
    --transition-fast: 0.18s ease-out;
    --font-main: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
                 "Inter", "Segoe UI", sans-serif;
}

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

html, body {
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    background: radial-gradient(circle at top, #0b1120 0, #020617 52%, #000 100%);
    color: var(--text-main);
    font-family: var(--font-main);
    -webkit-font-smoothing: antialiased;
}

/* LAYOUT */

.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 16px;
}

/* HEADER */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(16px);
    background: linear-gradient(to right,
        rgba(15, 23, 42, 0.95),
        rgba(15, 23, 42, 0.85));
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 10px 16px;
}


.logo a {
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: lowercase;
    font-size: 1rem;
    color: #f9fafb;
    text-decoration: none;
}

/* NAV */

.main-nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-main);
    border-radius: 999px;
    margin-bottom: 4px;
}

.nav-list {
    display: flex;
    align-items: center;
    gap: 16px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-list a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 6px 10px;
    border-radius: 999px;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.nav-list a:hover {
    background: rgba(148, 163, 184, 0.12);
    color: #f9fafb;
}

.nav-list a.is-active {
    background: var(--accent-soft);
    color: #bbf7d0;
}

/* LANG SWITCHER + HEADER CTA */

.lang-switcher {
    position: relative;
    margin-left: 8px;
    font-size: 0.88rem;
}

.lang-switcher__button {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.6);
    background: rgba(15, 23, 42, 0.96);
    color: #e5e7eb;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    transition: background var(--transition-fast), border-color var(--transition-fast),
                color var(--transition-fast), transform var(--transition-fast);
}

.lang-switcher__button:hover {
    background: rgba(15, 23, 42, 1);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.lang-switcher__list {
    position: absolute;
    right: 0;
    top: 115%;
    min-width: 170px;
    margin: 0;
    padding: 8px 10px;
    list-style: none;
    background: rgba(15, 23, 42, 0.98);
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.65);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.9);
    display: none;
    z-index: 60;
}

.lang-switcher__list li + li {
    margin-top: 4px;
}

.lang-switcher__list a {
    display: block;
    padding: 4px 6px;
    color: #e5e7eb;
    text-decoration: none;
    font-size: 0.88rem;
    white-space: nowrap;
}

.lang-switcher__list a:hover {
    color: #bbf7d0;
    background: rgba(15, 23, 42, 0.9);
    border-radius: 8px;
}

/* показываем список при открытом переключателе */
.lang-switcher.lang-switcher--open .lang-switcher__list {
    display: block;
}

.header-cta {
    margin-left: 8px;
}

/* BUTTONS */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 0.95rem;
    border-radius: 999px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: transform var(--transition-fast),
                box-shadow var(--transition-fast),
                background var(--transition-fast),
                border-color var(--transition-fast),
                color var(--transition-fast);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #4ade80);
    color: #022c22;
    box-shadow: 0 10px 25px rgba(34, 197, 94, 0.55);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 32px rgba(34, 197, 94, 0.75);
}

.btn-secondary {
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(148, 163, 184, 0.5);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: rgba(15, 23, 42, 1);
    border-color: var(--accent);
}

.btn-ghost {
    background: transparent;
    border-color: rgba(148, 163, 184, 0.35);
    color: var(--text-muted);
}

.btn-ghost:hover {
    border-color: rgba(148, 163, 184, 0.8);
    color: #e5e7eb;
}

.btn-full {
    width: 100%;
    justify-content: center;
}

/* HERO */

.hero {
    padding: 40px 0 32px;
}

.hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 28px;
    align-items: stretch;
}

.hero-text h1 {
    font-size: 1.9rem;
    line-height: 1.2;
    margin: 0 0 14px;
}

.hero-lead {
    font-size: 1rem;
    color: var(--text-muted);
    max-width: 640px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 18px 0 10px;
}

.hero-note {
    font-size: 0.9rem;
    color: var(--text-muted);
    max-width: 640px;
}

.hero-small {
    padding-top: 32px;
}

/* HERO SIDE CARD */

.hero-side {
    display: flex;
    align-items: stretch;
}

.hero-card {
    width: 100%;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-soft);
    padding: 18px 18px 16px;
}

.hero-card h2 {
    font-size: 1.1rem;
    margin-top: 0;
}

.meta-list {
    list-style: none;
    padding: 0;
    margin: 10px 0 14px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.meta-list li {
    margin-bottom: 6px;
}

.meta-list span {
    color: #e5e7eb;
    font-weight: 500;
}

/* SECTIONS */

.section {
    padding: 32px 0;
}

.section-alt {
    background: radial-gradient(circle at top, #020617 0, #020617 45%, #000 100%);
}

.section h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.section p {
    font-size: 0.98rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 8px 0;
}

/* GRID UTILS */

.two-cols {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    gap: 24px;
    align-items: flex-start;
}

.two-cols-inner {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}

/* CARDS */

.info-card,
.nav-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    padding: 16px 14px;
    box-shadow: 0 14px 35px rgba(15, 23, 42, 0.65);
}

.info-card--inline {
    margin-top: 14px;
}

.info-card h3,
.nav-card h3 {
    margin-top: 0;
    font-size: 1rem;
}

.nav-card p {
    font-size: 0.9rem;
}

/* LISTS */

.bullet-list {
    list-style: disc;
    padding-left: 18px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.bullet-list li {
    margin-bottom: 6px;
}

/* CTA ROW */

.cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 14px;
}

/* FAQ */

.faq-item {
    border-top: 1px solid rgba(148, 163, 184, 0.35);
    padding: 10px 0 6px;
}

.faq-item h3 {
    font-size: 1rem;
    margin-bottom: 4px;
}

.faq-item p {
    font-size: 0.92rem;
}

/* FOOTER */

.site-footer {
    border-top: 1px solid rgba(148, 163, 184, 0.25);
    background: #020617;
    margin-top: 24px;
}

.footer-inner {
    padding: 16px 0 20px;
    text-align: center;
}

.footer-logo {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
}

.footer-text {
    margin: 4px 0 10px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.86rem;
    margin: 0 6px;
}

.footer-nav a:hover {
    color: #e5e7eb;
}

/* RESPONSIVE BASE */

@media (max-width: 900px) {
    .hero-inner,
    .two-cols,
    .two-cols-inner {
        grid-template-columns: minmax(0, 1fr);
    }

    .hero {
        padding-top: 26px;
    }
}

@media (max-width: 780px) {
    .nav-toggle {
        display: inline-block;
    }

    .nav-list {
        position: absolute;
        top: 54px;
        right: 16px;
        flex-direction: column;
        padding: 10px 12px;
        background: rgba(15, 23, 42, 0.98);
        border-radius: 16px;
        border: 1px solid rgba(148, 163, 184, 0.35);
        box-shadow: var(--shadow-soft);
        display: none;
    }

    .nav-list.is-open {
        display: flex;
    }

    .header-inner {
        padding: 10px 0;
    }

    .hero-text h1 {
        font-size: 1.5rem;
    }

    .header-cta {
        margin-left: 0;
    }
}

/* --- HERO banner --- */

.hero-banner {
    display: block;
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.25);
    box-shadow: var(--shadow-soft);
}

.hero-banner img {
    width: 100%;
    max-height: 340px; /* уменьшили размер баннера */
    object-fit: cover;
    display: block;
}

/* =====================================
   SLOTUNA GALLERY — карточки + псевдо-карусель на мобиле
   ===================================== */

.screenshots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); /* меньше минимальная ширина */
    gap: 20px;            /* было 26px */
    margin-top: 18px;     /* чуть меньше сверху */
}

/* На очень широких экранах — максимум 4 карточки в ряд */
@media (min-width: 1200px) {
    .screenshots-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.screenshot-item {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border-radius: 20px;       /* было 24px */
    border: 1px solid rgba(148, 163, 184, 0.25);
    padding: 14px 14px 16px;   /* меньше паддинги */
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.6); /* чуть легче тень */
}

.screenshot-item img {
    width: 100%;
    aspect-ratio: 16 / 9;      /* более компактно, чем 2/1 */
    max-height: 300px;         /* было 420px */
    object-fit: cover;
    border-radius: 14px;
    display: block;
}

.screenshot-item figcaption {
    margin-top: 10px;
    font-size: 0.95rem;
    line-height: 1.45;
    color: var(--text-main);
}

/* “Псевдо-карусель” на мобильных — горизонтальный скролл */

@media (max-width: 720px) {
    .screenshots-grid {
        display: flex;
        overflow-x: auto;
        gap: 14px;             /* было 18px */
        padding-bottom: 8px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }

    .screenshot-item {
        min-width: 230px;      /* было 270px */
        flex: 0 0 auto;
        scroll-snap-align: start;
    }
}

/* Картинки внутри info-card (панорама слотов, мобильный экран) */

.info-card img {
    width: 100%;
    max-height: 220px;         /* было 280px */
    object-fit: cover;
    border-radius: 12px;
    display: block;
    margin-bottom: 8px;
}
/* =========================
   LANG SWITCHER (IT / PT)
   ========================= */
.lang-switcher {
    position: relative;
    margin-left: 8px;
    font-size: 0.85rem;
}

.lang-switcher__button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.55);
    background: rgba(15, 23, 42, 0.95);
    color: var(--text-main);
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1;
    appearance: none;
    -webkit-appearance: none;
    transition: background 0.18s ease-out, border-color 0.18s ease-out, color 0.18s ease-out,
                transform 0.18s ease-out, box-shadow 0.18s ease-out;
}

.lang-switcher__button:hover {
    background: rgba(15, 23, 42, 1);
    border-color: var(--accent);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.6);
    transform: translateY(-1px);
}

/* выпадающий список */
.lang-switcher__list {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 160px;
    padding: 8px 10px;
    margin: 0;
    border-radius: 16px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-card);
    box-shadow: var(--shadow-soft);
    list-style: none;
    display: none;
    z-index: 60;
}

.lang-switcher--open .lang-switcher__list {
    display: block;
}

.lang-switcher__list li {
    margin: 2px 0;
}

/* ссылки внутри переключателя */
.lang-switcher__list a,
.lang-switcher__list a:visited {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.86rem;
    color: var(--text-main);
    text-decoration: none;
    padding: 4px 2px;
}

.lang-switcher__list a:hover {
    color: #fefce8;
}

/* убираем маркеры-точки у списка (если вдруг подтягиваются) */
.lang-switcher__list {
    list-style-type: none;
}


/* Hero image block placed under H1 on all content pages */
.hero-top-image {
    margin: 12px 0 16px;
}

.hero-top-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 16px;
}


/* FIX: better mobile layout for header CTA on small screens */
@media (max-width: 780px) {
    .header-inner {
        flex-wrap: wrap;
        row-gap: 8px;
    }

    .header-cta {
        margin-left: 0;
        width: 100%;
        display: flex;
        justify-content: flex-start;
    }

    .header-cta .btn {
        width: 100%;
    }
}

/* Global image responsiveness fix */
img {
    max-width: 100%;
    height: auto;
}




/* Layout improvements for header on desktop and mobile */
.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Allow menu links to wrap onto second line if space is tight, without overlapping CTA */
.nav-list {
    flex-wrap: wrap;
    row-gap: 4px;
}

@media (max-width: 780px) {
    .header-right {
        width: 100%;
        justify-content: flex-end;
    }
}


/* Refined mobile header layout: clean 2-row structure */
@media (max-width: 780px) {
    .header-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        padding: 8px 12px;
    }

    .header-left {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
    }

    .header-right {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
    }

    .header-actions {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .lang-switcher {
        margin-left: 0;
    }
}


/* FINAL mobile header layout: logo row + full-width CTA under languages */
@media (max-width: 780px) {
    .header-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 8px 12px;
    }

    .header-left {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
    }

    .header-right {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 6px;
    }

    .header-actions {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
    }

    .header-cta {
        width: 100%;
        display: flex;
    }

    .header-cta .btn {
        width: 100%;
    }

    .lang-switcher {
        margin-left: 0;
    }
}


/* FINAL OVERRIDE: mobile nav dropdown fully visible within viewport */
@media (max-width: 780px) {
    .nav-list {
        left: 12px;
        right: 12px;
        top: 100%;
        width: auto;
    }
}
