/* ===== Переменные ===== */
:root {
    --bg: #8FA8B5;
    --s: #7C9AA9;      /* поверхность карточки */
    --sh: #7294A3;     /* поверхность при наведении */
    --sd: #688C9B;     /* тёмная поверхность */
    --sl: #96B3C0;     /* светлая поверхность */
    --sll: #A3BFC9;
    --a: #4E8A9F;      /* акцент */
    --al: #5D96A8;
    --ag: rgba(78, 138, 159, .3);
    --t: #FFF;
    --tm: rgba(255, 255, 255, .78);
    --td: rgba(255, 255, 255, .42);
    --g: #6DBF94;
    --warn: #E8C27A;
    --r: 28px;
    --e: cubic-bezier(.22, 1, .36, 1);
}

/* ===== Сброс ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: Outfit, "Segoe UI", system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--t);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.65;
}
a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }
button { cursor: pointer; font-family: inherit; }
:focus-visible { outline: 2px solid #FFF; outline-offset: 3px; }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--sd); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--a); }

.skip-link {
    position: fixed; top: 12px; left: 12px; z-index: 10000;
    padding: 10px 18px; border-radius: 100px;
    background: var(--a); color: #FFF; font-weight: 600;
    transform: translateY(-200%); transition: transform .3s var(--e);
}
.skip-link:focus { transform: none; }

/* ===== Фон ===== */
.site-bg {
    position: fixed; inset: 0; z-index: -3;
    background: #7A95A3 url(../img/city-background.jpg) center 30% / cover no-repeat;
    filter: grayscale(1) blur(5px) brightness(.85);
    transform: scale(1.05);
}
.site-bg-overlay {
    position: fixed; inset: 0; z-index: -2;
    background: linear-gradient(180deg, rgba(120, 155, 170, .72), rgba(143, 168, 181, .82) 40%, rgba(100, 130, 145, .88));
}
.bg-blobs { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.bg-blob { position: absolute; border-radius: 50%; filter: blur(50px); }
.bg-blob-1 { width: 500px; height: 500px; background: rgba(255, 255, 255, .07); top: -10%; left: -8%; animation: bm1 25s ease-in-out infinite alternate; }
.bg-blob-2 { width: 450px; height: 450px; background: rgba(78, 138, 159, .09); top: 40%; right: -12%; animation: bm2 30s ease-in-out infinite alternate; }
.bg-blob-3 { width: 400px; height: 400px; background: rgba(150, 179, 192, .08); bottom: -5%; left: 30%; animation: bm3 28s ease-in-out infinite alternate; }
@keyframes bm1 { to { transform: translate(80px, 120px) scale(.9); } }
@keyframes bm2 { to { transform: translate(-100px, 40px) scale(.95); } }
@keyframes bm3 { to { transform: translate(-40px, -80px) scale(.85); } }

/* ===== Прелоадер ===== */
#preloader {
    position: fixed; inset: 0; z-index: 9999;
    background: var(--bg);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px;
    transition: opacity .4s var(--e), visibility .4s var(--e);
}
#preloader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.preloader-logo { width: 64px; height: 64px; border-radius: 50%; animation: prePulse 1.5s ease-in-out infinite; }
.preloader-bar { width: 100px; height: 4px; background: var(--sd); border-radius: 99px; overflow: hidden; }
.preloader-bar::after { content: ''; display: block; height: 100%; width: 0; background: #FFF; animation: preFill .8s var(--e) forwards; }
@keyframes prePulse { 0%, 100% { transform: scale(1); opacity: .8; } 50% { transform: scale(1.1); opacity: 1; } }
@keyframes preFill { to { width: 100%; } }

/* ===== Прогресс прокрутки ===== */
#progress-bar {
    position: fixed; top: 0; left: 0; z-index: 1001;
    height: 3px; width: 100%;
    background: var(--al);
    transform-origin: left; transform: scaleX(0);
    transition: transform .1s linear;
}

/* ===== Навигация ===== */
.nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    padding: 20px 5vw;
    display: flex; align-items: center; justify-content: center;
    transition: background .5s var(--e), box-shadow .5s var(--e), padding .5s var(--e);
}
.nav.scrolled { background: var(--s); box-shadow: 0 2px 16px rgba(0, 0, 0, .08); padding: 14px 5vw; }
.nav-brand { position: absolute; left: 5vw; display: flex; align-items: center; }
.nav-logo { height: 38px; width: 38px; border-radius: 50%; transition: transform .4s var(--e); }
.nav-brand:hover .nav-logo { transform: scale(1.08); }
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-link {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 20px; border-radius: 100px;
    font-size: 14px; font-weight: 500; color: rgba(255, 255, 255, .85);
    transition: color .3s, background .3s, transform .3s, box-shadow .3s;
}
.nav-link:hover { color: #FFF; background: var(--sl); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0, 0, 0, .06); }
.nav-link i { font-size: 14px; }

.container { max-width: 1000px; margin: 0 auto; padding: 0 24px; }

/* ===== Hero ===== */
.hero {
    min-height: 90vh;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; position: relative;
    padding: 100px 24px 80px;
}
.hero-title {
    font-size: clamp(52px, 9vw, 100px); font-weight: 700;
    letter-spacing: -.02em; line-height: 1.05; margin-bottom: 24px;
    text-shadow: 0 4px 16px rgba(0, 0, 0, .1);
    opacity: 0; transform: translateY(30px);
    animation: fadeUp 1.2s .3s var(--e) forwards;
}
.hero-subtitle {
    font-size: clamp(18px, 3vw, 22px); color: rgba(255, 255, 255, .88);
    margin-bottom: 48px; max-width: 600px;
    opacity: 0; transform: translateY(20px);
    animation: fadeUp 1.2s .5s var(--e) forwards;
}
.hero-subtitle b { font-weight: 600; }
.hero-actions {
    display: flex; gap: 16px; flex-wrap: wrap; justify-content: center;
    opacity: 0; transform: translateY(20px);
    animation: fadeUp 1.2s .7s var(--e) forwards;
}
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }
.scroll-hint {
    position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
    color: rgba(255, 255, 255, .4); font-size: 20px;
    animation: bob 2s infinite ease-in-out; transition: color .3s;
}
.scroll-hint:hover { color: rgba(255, 255, 255, .8); }
@keyframes bob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 10px); } }

/* ===== Кнопки ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    padding: 18px 36px; border-radius: 100px; border: 0;
    font-size: 15px; font-weight: 600;
    transition: all .3s var(--e);
}
.btn-primary { background: var(--a); color: #FFF; box-shadow: 0 6px 20px var(--ag); }
.btn-primary:hover { background: var(--al); transform: translateY(-3px); box-shadow: 0 10px 28px var(--ag); }
.btn-ghost { background: 0 0; color: #FFF; border: 2px solid rgba(255, 255, 255, .28); }
.btn-ghost:hover { background: var(--sl); transform: translateY(-3px); border-color: var(--sl); }

/* ===== Статус сервера ===== */
.status-block {
    margin: 20px auto 80px; position: relative; z-index: 10;
    display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 24px;
    background: var(--s); border-radius: 100px; padding: 20px 32px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .08);
    transition: all .4s var(--e);
}
.status-block:hover { transform: translateY(-3px); box-shadow: 0 12px 36px rgba(0, 0, 0, .13); background: var(--sh); }
.status-info { display: flex; align-items: center; gap: 14px; }
.status-dot { width: 12px; height: 12px; flex-shrink: 0; border-radius: 50%; background: var(--td); position: relative; transition: background .3s; }
.status-dot.online { background: var(--g); }
.status-dot.online::after {
    content: ''; position: absolute; inset: 0; border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(109, 191, 148, .25);
    animation: ping 2s cubic-bezier(0, 0, .2, 1) infinite;
}
.status-dot.stale { background: var(--warn); }
@keyframes ping { to { transform: scale(2.5); opacity: 0; } }
.status-label { font-weight: 600; color: var(--tm); }
.status-label.online { color: var(--g); }
.status-label.stale { color: var(--warn); }
.status-sub { font-size: 13px; color: var(--tm); }
.progress-bar-wrap { width: 100%; max-width: 300px; background: var(--sd); height: 8px; border-radius: 99px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: rgba(255, 255, 255, .5); border-radius: 99px; transition: width 1s var(--e); }
.ip-box { display: flex; align-items: center; gap: 10px; background: var(--sd); padding: 10px 20px; border-radius: 100px; }
.ip-text { font-family: ui-monospace, Consolas, monospace; font-size: 15px; font-weight: 600; }
.copy-btn { background: 0 0; border: 0; color: var(--tm); font-size: 16px; transition: color .2s, transform .2s; }
.copy-btn:hover { color: #FFF; transform: scale(1.15); }
.status-block .btn-connect {
    background: var(--al); color: #FFF;
    padding: 12px 24px; font-size: 14px;
    box-shadow: 0 4px 14px var(--ag);
}
.status-block .btn-connect:hover { background: var(--a); transform: translateY(-2px); box-shadow: 0 6px 20px var(--ag); }
.status-block .btn-connect.is-dim { opacity: .55; box-shadow: none; }

/* ===== Секции ===== */
.section { padding-block: 80px; }
.section-title {
    display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
    font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .15em; color: var(--tm);
}
.section-title::before { content: ''; width: 30px; height: 2px; background: var(--sd); border-radius: 2px; }
.section-header { font-size: 36px; font-weight: 400; line-height: 1.25; margin-bottom: 48px; }
.section-header b { font-weight: 700; }

/* ===== Карточки ===== */
.soft-card {
    position: relative;
    background: var(--s); border-radius: var(--r);
    box-shadow: 0 4px 20px rgba(0, 0, 0, .06);
    transition: background .45s var(--e), transform .45s var(--e), box-shadow .45s var(--e);
}
.soft-card:hover { background: var(--sh); transform: translateY(-8px) scale(1.01); box-shadow: 0 18px 44px rgba(0, 0, 0, .12); }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.card-content { padding: 40px; transition: transform .45s var(--e); }
.soft-card:hover .card-content { transform: translateY(-4px); }
.card-icon {
    width: 56px; height: 56px; margin-bottom: 24px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; background: var(--sl); color: #FFF; font-size: 22px;
    transition: transform .4s var(--e), background .4s var(--e);
}
.soft-card:hover .card-icon { transform: scale(1.15) rotate(-4deg); background: var(--sll); }
.card-title { font-size: 20px; font-weight: 600; margin-bottom: 12px; transition: transform .45s var(--e); }
.soft-card:hover .card-title { transform: translateX(4px); }
.card-text { font-size: 15px; color: var(--tm); line-height: 1.7; }
ul.card-text { padding-left: 20px; }
ul.card-text li { margin-bottom: 6px; }
.g4-c { padding: 32px 20px; text-align: center; }
.g4-i { margin: 0 auto 20px; }
.g4-t { font-size: 18px; }
.soft-card:hover .g4-t { transform: none; }
.g4-d { font-size: 14px; }

/* ===== Команда ===== */
.team-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 24px; }
.team-card {
    width: 250px; max-width: 100%; padding: 32px 20px;
    display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center;
}
.team-avatar {
    width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; background: var(--sl); font-size: 30px;
    transition: all .4s var(--e);
}
.team-card:hover .team-avatar { transform: scale(1.12) rotate(5deg); background: var(--sll); }
.team-name { font-size: 18px; font-weight: 600; transition: transform .4s var(--e); }
.team-card:hover .team-name { transform: translateY(-2px); }
.team-role {
    width: 100%; padding: 7px 0; border-radius: 100px;
    background: var(--sd);
    font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
    transition: background .4s var(--e);
}
.team-card:hover .team-role { background: var(--sl); }

/* ===== Галерея ===== */
.gallery-track {
    display: flex; gap: 20px; padding: 4px 0 20px;
    overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
}
.gallery-track::-webkit-scrollbar { height: 6px; }
.gallery-track::-webkit-scrollbar-track { background: var(--sd); border-radius: 99px; }
.gallery-track::-webkit-scrollbar-thumb { background: var(--sl); border-radius: 99px; }
.gallery-item {
    flex: 0 0 auto; width: 380px; max-width: 82vw; aspect-ratio: 19 / 12;
    border: 0; padding: 0; border-radius: 20px; overflow: hidden;
    scroll-snap-align: start; background: var(--sd); color: #FFF;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .06);
    transition: transform .45s var(--e), box-shadow .45s var(--e);
}
.gallery-item:hover { transform: translateY(-6px) scale(1.02); box-shadow: 0 16px 36px rgba(0, 0, 0, .14); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--e); }
.gallery-item:hover img { transform: scale(1.06); }
/* Заглушка, пока нет скриншотов */
.gallery-item.is-empty {
    cursor: default;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
    background: repeating-linear-gradient(-45deg, var(--sd) 0 18px, var(--s) 18px 36px);
    color: var(--tm); font-size: 14px; font-weight: 500;
}
.gallery-item.is-empty i { font-size: 28px; color: rgba(255, 255, 255, .6); }
.gallery-item.is-empty:hover { transform: translateY(-3px); }

/* ===== Лайтбокс ===== */
.lightbox {
    position: fixed; inset: 0; z-index: 9997;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0, 0, 0, .88);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity .35s var(--e), visibility .35s var(--e);
}
.lightbox.open { opacity: 1; visibility: visible; pointer-events: auto; }
.lightbox img {
    max-width: 90vw; max-height: 88vh; object-fit: contain;
    border-radius: 16px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
    transform: scale(.92); transition: transform .4s var(--e);
}
.lightbox.open img { transform: scale(1); }
.lightbox-close, .lightbox-nav {
    position: absolute; width: 48px; height: 48px; border: 0; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, .12); color: #FFF; font-size: 18px;
    transition: background .3s, transform .3s;
}
.lightbox-close { top: 24px; right: 28px; font-size: 20px; }
.lightbox-close:hover { background: rgba(255, 255, 255, .25); transform: rotate(90deg); }
.lightbox-nav { top: 50%; transform: translateY(-50%); }
.lightbox-nav:hover { background: rgba(255, 255, 255, .22); }
.lightbox-nav.prev { left: 24px; }
.lightbox-nav.prev:hover { transform: translateY(-50%) translateX(-3px); }
.lightbox-nav.next { right: 24px; }
.lightbox-nav.next:hover { transform: translateY(-50%) translateX(3px); }
.lightbox-counter {
    position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
    padding: 6px 16px; border-radius: 100px;
    background: rgba(0, 0, 0, .3); color: rgba(255, 255, 255, .55); font-size: 14px; font-weight: 500;
}

/* ===== FAQ ===== */
.faq-card { padding: 10px 32px; }
.faq-card:hover { transform: none; }
.faq-item { border-bottom: 1px solid var(--sd); }
.faq-item:last-child { border-bottom: 0; }
.faq-trigger {
    width: 100%; padding: 28px 8px; gap: 16px;
    display: flex; justify-content: space-between; align-items: center;
    background: 0 0; border: 0; color: #FFF; text-align: left;
    font-size: 18px; font-weight: 500;
    transition: color .3s;
}
.faq-trigger:hover { color: var(--tm); }
.faq-trigger i {
    width: 36px; height: 36px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; background: var(--sl); color: #FFF; font-size: 14px;
    transition: transform .4s var(--e), background .3s;
}
.faq-item.open .faq-trigger i { transform: rotate(180deg); background: var(--sll); }
.faq-body { max-height: 0; overflow: hidden; transition: max-height .5s var(--e); }
.faq-body-inner { padding: 0 8px 28px; font-size: 15px; color: var(--tm); line-height: 1.8; }

/* ===== Модалка ===== */
.modal-overlay {
    position: fixed; inset: 0; z-index: 9996; padding: 24px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(40, 60, 70, .55);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity .35s var(--e), visibility .35s var(--e);
}
.modal-overlay.open { opacity: 1; visibility: visible; pointer-events: auto; }
/* Видимость включается сразу, иначе focus() в первый кадр не срабатывает */
.modal-overlay.open, .lightbox.open { transition: opacity .35s var(--e), visibility 0s; }
.modal-card {
    position: relative; width: 100%; max-width: 480px;
    padding: 40px; border-radius: var(--r);
    background: var(--s); text-align: center;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .2);
    transform: translateY(20px) scale(.96); transition: transform .4s var(--e);
}
.modal-overlay.open .modal-card { transform: none; }
.modal-icon { margin: 0 auto 20px; }
.modal-card h3 { font-size: 22px; font-weight: 600; line-height: 1.3; margin-bottom: 12px; }
.modal-card p { color: var(--tm); font-size: 15px; margin-bottom: 28px; }
.modal-actions { display: flex; flex-direction: column; gap: 12px; }
.modal-actions .btn { padding: 15px 28px; }
.modal-close {
    position: absolute; top: 16px; right: 16px;
    width: 40px; height: 40px; border: 0; border-radius: 50%;
    background: var(--sd); color: #FFF; font-size: 16px;
    transition: background .3s, transform .3s;
}
.modal-close:hover { background: var(--sl); transform: rotate(90deg); }

/* ===== Появление при прокрутке ===== */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity .8s var(--e), transform .8s var(--e); }
.reveal.visible { opacity: 1; transform: translateY(0); }
.no-js .reveal { opacity: 1; transform: none; }

/* ===== Подвал ===== */
.footer { margin-top: 60px; padding-block: 40px 50px; text-align: center; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 16px; }
.footer-links a {
    padding: 8px 18px; border-radius: 100px;
    font-size: 14px; font-weight: 500; color: var(--tm);
    transition: background .3s, color .3s;
}
.footer-links a:hover { background: var(--sl); color: #FFF; }
.footer-copy { font-size: 14px; opacity: .6; }

/* ===== Тост ===== */
#toast {
    position: fixed; bottom: 30px; left: 50%; z-index: 9998;
    display: flex; align-items: center; gap: 12px;
    padding: 14px 28px; border-radius: 100px;
    background: var(--sd); color: #FFF; font-weight: 500;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
    transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none;
    transition: all .4s var(--e);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast i { color: var(--g); font-size: 18px; }

/* ===== Адаптив ===== */
@media (max-width: 900px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .status-block { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 16px; padding: 24px; border-radius: var(--r); }
    .status-info { justify-content: center; }
    .progress-bar-wrap { max-width: 100%; }
    .grid-2 { grid-template-columns: 1fr; }
    .card-content { padding: 30px; }
    .section { padding-block: 60px; }
    .section-header { font-size: 30px; margin-bottom: 36px; }
    .faq-card { padding: 4px 20px; }
    .faq-trigger { font-size: 16px; padding: 22px 4px; }
    .modal-card { padding: 32px 24px; }
}
@media (max-width: 560px) {
    .nav { justify-content: flex-end; padding: 16px 16px; }
    .nav.scrolled { padding: 12px 16px; }
    .nav-brand { left: 16px; }
    .nav-link { padding: 10px 14px; }
    .nav-link span { display: none; }
    .nav-link i { font-size: 16px; }
    .grid-4 { grid-template-columns: 1fr; }
    .hero-actions { flex-direction: column; width: 100%; max-width: 320px; }
    .btn { padding: 16px 28px; }
    .lightbox-nav.prev { left: 10px; }
    .lightbox-nav.next { right: 10px; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
    .reveal { opacity: 1; transform: none; }
}
