/* ============================================================
   nDirect - лендинг
   Палитра как у панели: тёмный сланцевый фон и сине-фиолетовый акцент #5b5ef0.
   Окно браузера серверов в первом экране оставлено в родных цветах CS 1.6 (VGUI).
   ============================================================ */
:root {
    --bg: #0a0e1c;          /* фон страницы */
    --surface: #10162a;     /* поверхности, полосы разделов */
    --surface-2: #161e36;
    --ink: #e2e8f0;         /* основной текст */
    --ink-2: #94a3b8;       /* второстепенный */
    --line: rgba(148, 163, 184, .14);
    --line-strong: #334155;

    --accent: #5b5ef0;      /* кнопки, фон выделения - как primary в панели */
    --accent-hover: #6d70f4;
    --accent-ink: #ffffff;  /* текст на акценте */
    --accent-text: #a5a8ff; /* акцент как цвет текста на тёмном фоне - светлее, чтобы читался */
    --accent-soft: rgba(91, 94, 240, .12);

    /* Окно VGUI: цвета самой игры */
    --olive: #4c5844;
    --olive-dk: #3e4637;
    --bevel-lt: #8c9284;
    --bevel-dk: #282e22;
    --vgui-ink: #d8ded3;
    --vgui-sel: #c4b550;
    --vgui-sel-ink: #1c2014;

    --display: 'Unbounded', 'Arial Black', sans-serif;
    --body: 'Onest', system-ui, sans-serif;
    --game: Tahoma, Verdana, 'Segoe UI', sans-serif;

    --wrap: 1180px;
    --gap: clamp(16px, 3vw, 28px);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--body);
    font-size: 1.0625rem;
    line-height: 1.6;
    background: var(--bg);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gap); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: 12px; top: 12px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 6px; }

h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.12; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); }
.section-title { font-size: clamp(1.6rem, 3.2vw, 2.4rem); margin-bottom: 14px; }
h3 { font-size: 1.25rem; font-weight: 500; }
.section-lead { color: var(--ink-2); max-width: 38em; }

section { padding: clamp(64px, 9vw, 112px) 0; }
section[id] { scroll-margin-top: 72px; }

/* ---------- кнопки ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 14px 24px; border-radius: 10px;
    background: var(--accent); color: var(--accent-ink);
    font-weight: 700; text-decoration: none; line-height: 1.2;
    transition: background-color .15s ease, transform .15s ease;
}
.btn:hover { background: var(--accent-hover); }
.btn:active { transform: translateY(1px); }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px rgba(148, 163, 184, .3); }
.btn-ghost:hover { background: rgba(148, 163, 184, .08); }
.btn-sm { padding: 9px 16px; font-size: .95rem; }
.btn-block { width: 100%; }
.text-link { color: var(--accent-text); text-underline-offset: 4px; font-weight: 600; }

/* ---------- шапка ---------- */
.head {
    position: sticky; top: 0; z-index: 50;
    background: rgba(10, 14, 28, .85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
}
.head-row { display: flex; align-items: center; gap: 28px; height: 64px; }
.logo { font-family: var(--display); font-weight: 700; font-size: 1.2rem; text-decoration: none; color: var(--ink); }
.nav { display: flex; gap: 24px; margin-left: auto; }
.nav a { color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: .98rem; }
.nav a:hover { color: var(--ink); }
.burger { display: none; width: 40px; height: 40px; position: relative; }
.burger span { position: absolute; left: 10px; right: 10px; height: 2px; background: var(--ink); transition: transform .2s ease; }
.burger span:first-child { top: 15px; }
.burger span:last-child { top: 23px; }
.burger[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.burger[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* Переключатель языка */
.lang { display: inline-flex; gap: 2px; padding: 3px; border-radius: 8px; background: rgba(148, 163, 184, .08); }
.lang-item { padding: 4px 9px; border-radius: 6px; font-size: .82rem; font-weight: 700; color: var(--ink-2); text-decoration: none; }
.lang-item:hover { color: var(--ink); }
.lang-item.is-active { background: var(--accent); color: var(--accent-ink); }

@media (max-width: 860px) {
    .head-row { gap: 12px; }
    .lang { margin-left: auto; }
    .burger { display: block; }
    .nav {
        position: fixed; inset: 64px 0 auto 0; margin: 0;
        flex-direction: column; gap: 0;
        background: var(--surface); border-bottom: 1px solid var(--line);
        padding: 8px var(--gap) 16px;
        transform: translateY(-120%); visibility: hidden; transition: transform .25s ease, visibility .25s;
    }
    .nav.open { transform: none; visibility: visible; }
    .nav a { padding: 14px 0; border-bottom: 1px solid var(--line); }
}

/* ---------- hero ---------- */
.hero {
    padding-top: clamp(40px, 7vw, 88px);
    /* Мягкое фиолетовое свечение за окном серверов */
    background: radial-gradient(55% 60% at 78% 38%, rgba(91, 94, 240, .28), transparent 70%);
}
.hero-grid { display: grid; grid-template-columns: 5fr 6fr; gap: clamp(32px, 5vw, 64px); align-items: center; }
.hero-copy h1 { max-width: 12em; }
.lead { margin-top: 22px; font-size: 1.2rem; color: var(--ink-2); max-width: 32em; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-note { margin-top: 24px; font-size: .95rem; color: var(--ink-2); max-width: 34em; }
@media (max-width: 960px) { .hero-grid { grid-template-columns: 1fr; } }

/* ---------- окно VGUI (браузер серверов CS 1.6) ---------- */
.vgui-wrap figcaption { margin-top: 14px; font-size: .92rem; color: var(--ink-2); max-width: 36em; }
.vgui {
    font-family: var(--game); font-size: 13.5px; line-height: 1.4; color: var(--vgui-ink);
    background: var(--olive);
    border: 1px solid; border-color: var(--bevel-lt) var(--bevel-dk) var(--bevel-dk) var(--bevel-lt);
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .6);
    user-select: none;
}
.vgui-title { display: flex; justify-content: space-between; padding: 7px 10px 5px; color: var(--vgui-ink); }
.vgui-x { font-style: normal; opacity: .8; }
.vgui-tabs { display: flex; gap: 2px; padding: 0 8px; overflow: hidden; }
.vgui-tabs span {
    padding: 4px 10px 3px; background: var(--olive-dk); color: #a0aa95; white-space: nowrap;
    border: 1px solid; border-color: var(--bevel-lt) var(--bevel-dk) transparent var(--bevel-lt);
}
.vgui-tabs .on { background: var(--olive); color: var(--vgui-ink); position: relative; top: 1px; }
.vgui-table {
    margin: 0 8px; background: var(--olive-dk);
    border: 1px solid; border-color: var(--bevel-dk) var(--bevel-lt) var(--bevel-lt) var(--bevel-dk);
}
.vgui-row { display: grid; grid-template-columns: minmax(0, 1fr) 58px 112px 58px; gap: 8px; padding: 4px 9px; white-space: nowrap; }
.vgui-row span { overflow: hidden; text-overflow: ellipsis; }
.vgui-head { color: #a0aa95; border-bottom: 1px solid var(--bevel-dk); }
.vgui-rows { min-height: calc(8 * 27px); }
.vgui-row.sel { background: var(--vgui-sel); color: var(--vgui-sel-ink); }
.c-pl, .c-ping { text-align: right; }
.vgui-foot { display: flex; gap: 6px; padding: 8px; }
.vgui-grow { flex: 1; }
.vgui-btn {
    padding: 3px 10px; background: var(--olive);
    border: 1px solid; border-color: var(--bevel-lt) var(--bevel-dk) var(--bevel-dk) var(--bevel-lt);
}
@media (max-width: 520px) {
    .vgui { font-size: 12px; }
    .vgui-row { grid-template-columns: minmax(0, 1fr) 46px 52px; }
    .c-map { display: none; }
}
/* Строки появляются по очереди - как при опросе серверов в игре. Скрипт снимает класс is-loading */
.vgui-rows.is-loading .vgui-row { visibility: hidden; }
.vgui-rows .vgui-row.is-in { visibility: visible; }

/* ---------- возможности ---------- */
.features .section-title { margin-bottom: clamp(32px, 5vw, 56px); }
.feat {
    display: grid; grid-template-columns: 5fr 7fr; gap: clamp(28px, 5vw, 64px); align-items: center;
    padding: clamp(28px, 4vw, 48px) 0;
    border-top: 1px solid var(--line);
}
.feat-flip { grid-template-columns: 7fr 5fr; }
.feat-flip .feat-text { order: 2; }
.feat > *, .hero-grid > *, .sdk-grid > * { min-width: 0; }
.feat-text h3 { font-size: clamp(1.25rem, 2vw, 1.55rem); margin-bottom: 14px; }
.feat-text p { color: var(--ink-2); max-width: 34em; }
.ticks { list-style: none; margin-top: 18px; display: grid; gap: 10px; max-width: 34em; }
.ticks li { position: relative; padding-left: 22px; color: var(--ink); font-size: 1rem; }
.ticks li::before { content: ''; position: absolute; left: 2px; top: .62em; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); }
@media (max-width: 900px) {
    .feat, .feat-flip { grid-template-columns: 1fr; }
    .feat-flip .feat-text { order: 0; }
}

/* ---------- скриншоты и заглушки ---------- */
/* Рамка принимает пропорции самой картинки: скриншот виден целиком, без обрезки */
.shot { position: relative; margin: 0; border-radius: 12px; overflow: hidden; background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.shot-open { display: block; width: 100%; cursor: zoom-in; }
.shot img { width: 100%; height: auto; }

/* Пока файла нет - заглушка фиксированной формы */
.shot.is-empty { aspect-ratio: 16 / 9; }
.shot-empty {
    display: none; position: absolute; inset: 0;
    align-items: center; justify-content: center; flex-direction: column; text-align: center;
    color: var(--ink-2); font-size: .95rem; line-height: 1.5;
    border: 2px dashed rgba(91, 94, 240, .4); border-radius: 12px;
    background: repeating-linear-gradient(135deg, transparent 0 14px, rgba(148, 163, 184, .03) 14px 28px);
}
.shot-empty small { display: block; color: rgba(148, 163, 184, .7); }
.shot.is-empty .shot-open { display: none; }
.shot.is-empty .shot-empty { display: flex; }

/* ---------- все разделы панели ---------- */
.catalog .section-lead { margin-bottom: clamp(28px, 4vw, 44px); }
.cat-group + .cat-group { margin-top: clamp(40px, 5vw, 64px); }
.cat-title {
    font-size: 1.05rem; font-weight: 500; color: var(--accent-text);
    padding-bottom: 12px; margin-bottom: 22px; border-bottom: 1px solid var(--line);
}
.cat-grid { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px var(--gap); }
.cat-item { display: flex; flex-direction: column; }
.cat-body { padding-top: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.cat-body h4 { font-family: var(--body); font-size: 1.08rem; font-weight: 700; }
.cat-body p { color: var(--ink-2); font-size: .96rem; flex: 1; }
.cat-plan {
    align-self: flex-start; margin-top: 6px; font-size: .82rem; font-weight: 600;
    padding: 3px 10px; border-radius: 999px; color: var(--ink-2);
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, .25);
}
.cat-plan.is-pro { color: var(--accent-text); box-shadow: inset 0 0 0 1px rgba(91, 94, 240, .6); }
.cat-plan.is-legend { color: var(--accent-ink); background: var(--accent); box-shadow: none; }
.shot-sm { border-radius: 10px; }
.shot-sm .shot-empty { font-size: .85rem; border-radius: 10px; }
/* Группа из одного экрана - крупно, текст справа */
.cat-grid-single { grid-template-columns: 1fr; }
.cat-grid-single .cat-item { display: grid; grid-template-columns: 7fr 5fr; gap: var(--gap); align-items: center; }
.cat-grid-single .cat-body { padding-top: 0; flex: none; }
@media (max-width: 960px) {
    .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cat-grid-single { grid-template-columns: 1fr; }
}
@media (max-width: 700px) { .cat-grid-single .cat-item { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .cat-grid { grid-template-columns: 1fr; } }

/* ---------- тарифы ---------- */
.plans { background: var(--surface); }
.plans .section-lead { margin-bottom: 36px; }
.plans-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 14px; }
.plans-table { width: 100%; min-width: 760px; border-collapse: separate; border-spacing: 0; font-size: 1rem; }
.plans-table th, .plans-table td { padding: 14px 16px; text-align: center; border-bottom: 1px solid var(--line); }
.plans-table tbody th[scope="row"] { text-align: left; font-weight: 400; color: var(--ink); width: 46%; }
.plans-table thead th { vertical-align: bottom; padding-bottom: 22px; }
.plan-name { display: block; font-family: var(--display); font-size: 1.3rem; font-weight: 700; }
.plan-price { display: block; font-size: 1.1rem; font-weight: 700; color: var(--accent-text); margin-top: 4px; }
.plan-for { display: block; font-size: .88rem; color: var(--ink-2); font-weight: 400; margin-top: 4px; }
.plans-group th { text-align: left !important; font-family: var(--display); font-weight: 500; font-size: .95rem; color: var(--accent-text); padding-top: 28px; }
.plan-hot { background: var(--accent-soft); }
thead .plan-hot { border-radius: 12px 12px 0 0; box-shadow: inset 0 3px 0 var(--accent); }
.yes { color: var(--accent-text); font-weight: 700; font-size: 1.1rem; }
.no { color: rgba(148, 163, 184, .4); }
.plans-table tfoot th, .plans-table tfoot td { border-bottom: 0; padding-top: 22px; }
.plans-table tfoot .btn { padding: 11px 14px; font-size: .95rem; white-space: nowrap; }
.plans-table tfoot .plan-hot { border-radius: 0 0 12px 12px; }

/* ---------- шаги запуска ---------- */
.steps { list-style: none; counter-reset: step; display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); margin-top: 36px; }
.steps li { counter-increment: step; padding-top: 18px; border-top: 2px solid var(--line-strong); }
.steps li::before { content: counter(step); display: block; font-family: var(--display); font-size: 2rem; color: var(--accent-text); line-height: 1; margin-bottom: 14px; }
.steps h3 { font-size: 1.08rem; margin-bottom: 8px; }
.steps p { color: var(--ink-2); font-size: .98rem; }
@media (max-width: 900px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }

/* ---------- SDK ---------- */
.sdk { background: var(--surface); }
.sdk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.sdk .section-lead { margin-bottom: 18px; }
.code { background: var(--bg); border-radius: 12px; box-shadow: 0 0 0 1px var(--line); overflow-x: auto; }
.code pre { padding: 22px 24px; font: 14px/1.7 ui-monospace, 'Cascadia Code', Menlo, monospace; color: var(--ink); }
.code .c { color: #64748b; }
.code .k { color: #c4a5ff; }
.code .s { color: #86efac; }
.code .v { color: #e2e8f0; }
.code .f { color: var(--accent-text); }
.code .n { color: #fda4af; }
@media (max-width: 900px) { .sdk-grid { grid-template-columns: 1fr; } }

/* ---------- вопросы ---------- */
.faq-wrap { display: grid; grid-template-columns: 1fr 2fr; gap: var(--gap); }
.faq-list { display: grid; gap: 8px; }
.faq details { border-bottom: 1px solid var(--line); padding: 4px 0 14px; }
.faq summary { cursor: pointer; list-style: none; font-weight: 600; font-size: 1.08rem; padding: 12px 32px 0 0; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; position: absolute; right: 4px; top: 8px; font-size: 1.4rem; color: var(--accent-text); transition: transform .2s ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--ink-2); margin-top: 10px; max-width: 40em; }
@media (max-width: 800px) { .faq-wrap { grid-template-columns: 1fr; } }

/* ---------- финал и подвал ---------- */
.final { padding-top: 0; }
.final-box {
    background: linear-gradient(135deg, #2a2d8f 0%, #3b2f8f 55%, #4a2d86 100%); border-radius: 18px;
    padding: clamp(32px, 5vw, 56px); display: grid; gap: 14px; justify-items: start;
}
.final-box .btn { background: #ffffff; color: #2a2d8f; }
.final-box .btn:hover { background: #e8e9ff; }
.final-box h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
.final-box p { color: #d9ddff; max-width: 36em; margin-bottom: 10px; }

.foot { border-top: 1px solid var(--line); padding: 28px 0; }
.foot-row { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 32px; }
.foot-nav { display: flex; gap: 22px; }
.foot-nav a { color: var(--ink-2); text-decoration: none; }
.foot-nav a:hover { color: var(--ink); }
.foot-copy { margin-left: auto; color: var(--ink-2); font-size: .92rem; }

/* ---------- просмотр скриншота ---------- */
.lb { position: fixed; inset: 0; z-index: 90; background: rgba(5, 8, 20, .92); display: flex; align-items: center; justify-content: center; padding: 4vw; }
.lb[hidden] { display: none; }
.lb-fig { margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.lb-img { max-width: 100%; max-height: calc(100vh - 8vw - 48px); border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.lb-cap { color: var(--ink-2); font-size: .95rem; text-align: center; }
.lb-close { position: absolute; top: 14px; right: 18px; font-size: 2rem; line-height: 1; color: var(--ink); padding: 8px; }
.lb-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 48px; height: 64px; font-size: 2.4rem; line-height: 1; color: var(--ink);
    background: rgba(22, 30, 54, .8); border-radius: 10px;
}
.lb-nav:hover { background: rgba(91, 94, 240, .6); }
.lb-prev { left: 12px; }
.lb-next { right: 12px; }
.lb-nav[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition: none !important; animation: none !important; }
}
