:root {
    --bg: #080a10;
    --bg-2: #10141d;
    --card: #141a26;
    --card-2: #1b2333;
    --line: rgba(140, 255, 214, 0.16);
    --text: #edf2f7;
    --muted: #9aa6b8;
    --mint: #3dffc0;
    --mint-2: #00e7a8;
    --ink: #06281c;
    --amber: #ffc857;
    --danger: #ff6b7a;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
    --sans: "Manrope", "Segoe UI", sans-serif;
    --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(900px 420px at 10% -10%, rgba(61, 255, 192, 0.16), transparent 55%),
        radial-gradient(700px 380px at 100% 0%, rgba(255, 200, 87, 0.08), transparent 50%),
        var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.6;
}

body.is-admin { background: var(--bg); }

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

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

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.03em; }

h1 { font-size: clamp(2rem, 4vw, 3.4rem); margin: 0 0 0.6rem; }

h2 { font-size: clamp(1.5rem, 2vw, 2rem); margin: 0 0 0.4rem; }

p { margin: 0 0 0.8rem; }

button, input, textarea, select { font: inherit; color: inherit; }

.sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.wrap {
    width: min(1080px, calc(100% - 32px));
    margin: 0 auto;
}

.narrow { width: min(560px, calc(100% - 32px)); padding: 28px 0 48px; }

.muted, .fine { color: var(--muted); }

.fine { font-size: 0.92rem; }

.eyebrow {
    margin: 0 0 0.4rem;
    color: var(--mint);
    font-family: var(--mono);
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.top {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(8, 10, 16, 0.86);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.top-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 72px;
}

.logo {
    margin-right: auto;
    color: var(--mint);
    font-family: var(--mono);
    font-weight: 700;
    font-size: 1.15rem;
    text-decoration: none;
    text-shadow: 0 0 18px rgba(61, 255, 192, 0.35);
}

.logo span { color: #d5deea; font-weight: 500; }

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

.nav a {
    color: var(--text);
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 999px;
}

.nav a:hover,
.nav a.is-active { background: rgba(61, 255, 192, 0.12); color: var(--mint); }

.nav-out { border: 1px solid var(--line); }

.nav-toggle {
    display: none;
    background: transparent;
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 14px;
}

.hero {
    position: relative;
    overflow: hidden;
    padding: 72px 0 36px;
}

.hero-inner { position: relative; z-index: 1; max-width: 760px; }

.lead { font-size: 1.12rem; color: #d5deea; }

.code-rain {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(38%, 420px);
    overflow: hidden;
    pointer-events: none;
    mask-image: linear-gradient(90deg, transparent, #000 28%);
}

.code-rain pre {
    position: absolute;
    margin: 0;
    color: rgba(61, 255, 192, 0.34);
    font-family: var(--mono);
    font-size: 13px;
    animation: rise 22s linear infinite;
}

.c1 { left: 18%; top: 8%; }
.c2 { left: 28%; top: 28%; animation-duration: 18s; animation-delay: -7s; }
.c3 { left: 12%; top: 48%; animation-duration: 26s; }
.c4 { left: 34%; top: 66%; animation-duration: 20s; animation-delay: -4s; }
.c5 { left: 16%; top: 82%; animation-duration: 24s; animation-delay: -11s; }

@keyframes rise {
    from { transform: translateY(24px); }
    to { transform: translateY(-36px); }
}

.hero-actions, .admin-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 999px;
    padding: 12px 18px;
    background: linear-gradient(180deg, var(--mint), var(--mint-2));
    color: var(--ink);
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(61, 255, 192, 0.18);
}

.btn:hover { filter: brightness(1.05); }

.btn.ghost, .btn.tiny.ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--line);
    box-shadow: none;
}

.btn.danger, .btn.tiny.danger {
    background: transparent;
    color: #ffd0d5;
    border: 1px solid rgba(255, 107, 122, 0.45);
    box-shadow: none;
}

.btn.tiny { padding: 8px 12px; font-size: 0.92rem; font-weight: 700; }

.directions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    padding-bottom: 10px;
}

.directions article, .dev-card, .contact-card, .panel, .buybox, .admin-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 40%), var(--card);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 22px;
    box-shadow: var(--shadow);
}

.directions article { padding: 18px 18px 8px; }

.directions span { font-size: 1.6rem; }

.catalog { padding: 42px 0; }

.catalog-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: end;
    margin-bottom: 18px;
}

.search input, .stack input, .stack textarea, .stack select,
.form-grid input, .form-grid textarea, .form-grid select, .editor textarea {
    width: 100%;
    background: #0c1018;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 14px;
}

.search input { min-width: min(320px, 100%); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }

.chip {
    border: 1px solid var(--line);
    background: transparent;
    color: var(--text);
    border-radius: 999px;
    padding: 8px 12px;
    cursor: pointer;
}

.chip.is-on { background: rgba(61, 255, 192, 0.16); color: var(--mint); border-color: transparent; }

.section-head { margin: 18px 0 12px; }

.section-head h3 { margin: 0 0 4px; }

.section-head p { color: var(--muted); margin: 0; }

.dev-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }

.dev-grid.is-single { grid-template-columns: 1fr; }

.dev-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 14px;
    padding: 18px;
    color: inherit;
    text-decoration: none;
    transition: transform 0.18s ease, border-color 0.18s ease;
}

.dev-grid.is-single .dev-card { grid-template-columns: auto 1fr auto; align-items: center; }

.dev-card:hover { transform: translateY(-3px); border-color: rgba(61, 255, 192, 0.45); }

.dev-emoji {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: #0e1420;
    border: 1px solid var(--line);
    font-size: 1.8rem;
}

.dev-emoji.xl { width: 84px; height: 84px; font-size: 2.4rem; }

.dev-emoji img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 14px;
    display: block;
}

.dev-emoji img[src$=".svg"] {
    object-fit: contain;
    padding: 10px;
    box-sizing: border-box;
}

.mini-icon {
    width: 1.15em;
    height: 1.15em;
    object-fit: cover;
    border-radius: 4px;
    vertical-align: -0.2em;
    margin-right: 0.2em;
}

.mini-icon[src$=".svg"] { object-fit: contain; }

.icon-field { display: grid; gap: 8px; }

.check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.form-grid .check input,
.stack .check input { width: auto; }

.dev-kicker {
    color: var(--amber);
    font-family: var(--mono);
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.dev-body h3 { margin: 2px 0 6px; font-size: 1.35rem; }

.dev-body p { color: var(--muted); margin: 0 0 10px; }

.dev-meta { display: flex; flex-wrap: wrap; gap: 8px; }

.dev-meta span {
    background: #0e1420;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.92rem;
}

.dev-go { align-self: end; color: var(--mint); font-weight: 800; }

.dev-grid.is-single .dev-go { align-self: center; }

.contact {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 22px;
    padding: 20px 0 64px;
    align-items: center;
}

.contact-card { padding: 18px; display: grid; gap: 10px; }

.contact-row {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 10px;
    border-radius: 16px;
    text-decoration: none;
    color: inherit;
    background: #0e1420;
}

.contact-row span:first-child { font-size: 1.4rem; }

.contact-row small { display: block; color: var(--muted); }

.contact-row strong { color: var(--text); }

.project { padding: 28px 0 64px; }

.crumbs { color: var(--muted); }

.crumbs a { color: var(--mint); text-decoration: none; }

.update-banner {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin: 12px 0 18px;
    padding: 14px 16px;
    border-radius: 16px;
    text-decoration: none;
    color: var(--ink);
    background: linear-gradient(90deg, var(--amber), #ffe3a3);
    font-weight: 700;
}

.project-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 22px;
    align-items: start;
}

.project-head { display: flex; gap: 16px; align-items: center; margin-bottom: 12px; }

.facts { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0 0 18px; list-style: none; }

.facts li {
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    padding: 6px 12px;
}

.prose > *:first-child { margin-top: 0; }

.prose h2, .prose h3 { margin: 1.3rem 0 0.45rem; }

.prose ul, .prose ol { padding-left: 1.2rem; }

.prose li { margin: 0.25rem 0; }

.prose a { color: var(--mint); }

.prose blockquote {
    margin: 1rem 0;
    padding: 0.2rem 0 0.2rem 1rem;
    border-left: 3px solid var(--mint);
    color: #d5deea;
}

.prose .note {
    margin: 1rem 0;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 200, 87, 0.1);
    border-left: 3px solid var(--amber);
}

.prose pre, .prose code {
    font-family: var(--mono);
    background: #0c1018;
    border-radius: 10px;
}

.prose code { padding: 0.1rem 0.35rem; }

.prose pre { padding: 12px; overflow: auto; }

.prose pre code { padding: 0; background: transparent; }

.prose table { width: 100%; border-collapse: collapse; margin: 1rem 0; }

.prose th, .prose td { border: 1px solid rgba(255, 255, 255, 0.08); padding: 8px 10px; text-align: left; }

.prose hr { border: 0; border-top: 1px solid rgba(255, 255, 255, 0.08); margin: 1.2rem 0; }

.updates { margin-top: 28px; }

.timeline { display: grid; gap: 10px; }

.tick {
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 18px;
    background: var(--card);
    overflow: hidden;
}

.tick-btn {
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    text-align: left;
    background: transparent;
    border: 0;
    padding: 14px 16px;
    cursor: pointer;
}

.tick-btn strong { display: block; font-family: var(--mono); }

.tick-btn em { font-style: normal; margin-right: 8px; }

.tick-btn small { color: var(--muted); }

.tick-btn b { color: var(--amber); white-space: nowrap; }

.tick-body { padding: 0 16px 14px; }

.buybox {
    position: sticky;
    top: 90px;
    padding: 18px;
}

.buy-label { color: var(--muted); margin-bottom: 0; }

.buy-price { font-size: 2rem; font-weight: 800; margin: 0 0 12px; }

.buy-update { color: var(--amber); font-weight: 800; font-size: 1.2rem; }

.buybox .btn { width: 100%; margin-top: 8px; }

.page-miss { padding: 64px 0; }

.empty {
    padding: 22px;
    border: 1px dashed var(--line);
    border-radius: 18px;
    color: var(--muted);
}

.foot { border-top: 1px solid rgba(255, 255, 255, 0.06); padding: 22px 0 32px; }

.foot a { color: var(--text); }

.flash, .errors {
    border-radius: 14px;
    padding: 12px 14px;
    margin: 12px 0;
}

.flash { background: rgba(61, 255, 192, 0.12); color: var(--mint); }

.errors { background: rgba(255, 107, 122, 0.12); color: #ffd0d5; }

.errors ul { margin: 6px 0 0; }

.stack, .panel.stack { display: grid; gap: 12px; }

.panel { padding: 18px; margin: 14px 0; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.form-grid .wide { grid-column: 1 / -1; }

label { display: grid; gap: 6px; font-weight: 700; }

.admin-list { display: grid; gap: 12px; }

.admin-card {
    padding: 16px 18px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.admin-card h2 { font-size: 1.2rem; margin: 0 0 4px; }

.admin-card p { margin: 0; color: var(--muted); }

.editor { display: grid; gap: 8px; }

.editor-bar, .emoji-pick { display: flex; flex-wrap: wrap; gap: 6px; }

.editor-bar button, .emoji-pick button {
    background: #0e1420;
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 6px 8px;
    cursor: pointer;
}

.editor-bar button:hover, .emoji-pick button:hover { border-color: var(--mint); color: var(--mint); }

.editor textarea { min-height: 220px; resize: vertical; font-family: var(--mono); font-size: 0.92rem; }

.editor-preview { padding: 12px; border-radius: 14px; background: #0c1018; border: 1px dashed var(--line); }

.update-block {
    display: grid;
    gap: 10px;
    padding: 12px;
    border-radius: 16px;
    background: #0e1420;
}

.update-head { display: flex; justify-content: space-between; align-items: center; }

.savebar {
    position: sticky;
    bottom: 10px;
    display: flex;
    gap: 10px;
    padding: 10px;
    border-radius: 16px;
    background: rgba(8, 10, 16, 0.92);
    border: 1px solid var(--line);
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(0, 0, 0, 0.62);
}

.modal[hidden] { display: none; }

.modal-card {
    width: min(460px, 100%);
    padding: 18px;
    border-radius: 18px;
    background: var(--card-2);
    border: 1px solid var(--line);
}

:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }

@media (max-width: 860px) {
    .nav-toggle { display: inline-flex; }
    .nav { display: none; width: 100%; flex-direction: column; align-items: stretch; padding-bottom: 12px; }
    .nav.is-open { display: flex; }
    .top-inner { flex-wrap: wrap; }
    .code-rain { display: none; }
    .directions, .dev-grid, .contact, .project-layout, .form-grid { grid-template-columns: 1fr; }
    .dev-grid.is-single .dev-card { grid-template-columns: auto 1fr; }
    .dev-go { grid-column: 2; }
    .catalog-head, .admin-card, .project-head, .update-banner { flex-direction: column; align-items: stretch; }
    .buybox { position: static; }
    .search input { min-width: 0; }
}

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

/* ---------- Примеры сообщений (экран мессенджера) ---------- */
.prose .chat {
    max-width: 460px;
    margin: 12px 0 20px;
    padding: 0 0 12px;
    border-radius: 20px;
    background:
        radial-gradient(260px 160px at 90% 0%, rgba(61, 255, 192, 0.08), transparent 70%),
        #0d1219;
    border: 1px solid rgba(255, 255, 255, 0.07);
    overflow: hidden;
}

.prose .chat-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.prose .chat-ava {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(180deg, var(--mint), var(--mint-2));
    font-size: 1rem;
}

.prose .chat-head b { display: block; line-height: 1.2; }

.prose .chat-head small { display: block; color: var(--muted); font-size: 0.8rem; line-height: 1.3; }

.prose .msg {
    position: relative;
    margin: 0 12px;
    padding: 10px 12px 22px;
    border-radius: 4px 16px 16px 16px;
    background: #1d2633;
    white-space: pre-line;
    font-size: 0.93rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.prose .msg code { background: rgba(0, 0, 0, 0.25); font-size: 0.88em; }

.prose .msg u { text-underline-offset: 2px; }

.prose .msg-time {
    position: absolute;
    right: 10px;
    bottom: 4px;
    color: var(--muted);
    font-size: 0.72rem;
}

.prose .msg-out {
    display: block;
    width: fit-content;
    margin: 0 0 10px auto;
    padding: 6px 12px;
    border-radius: 14px 4px 14px 14px;
    background: rgba(61, 255, 192, 0.18);
    color: var(--mint);
}

.prose .chat-file {
    max-width: 460px;
    margin: -10px 0 20px;
    padding: 10px 14px;
    border-radius: 14px;
    background: #0d1219;
    border: 1px dashed var(--line);
    color: var(--muted);
    font-size: 0.92rem;
}

.prose table td b { color: var(--mint); }

/* ---------- Тарифы ---------- */
.prices { padding: 10px 0 42px; }

.price-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin: 18px 0;
}

.price-card {
    display: flex;
    flex-direction: column;
    padding: 18px;
    border-radius: 22px;
    color: inherit;
    text-decoration: none;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 40%), var(--card);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: var(--shadow);
    transition: transform 0.18s ease, border-color 0.18s ease;
}

.price-card:hover { transform: translateY(-3px); border-color: rgba(61, 255, 192, 0.45); }

.price-ico { font-size: 1.7rem; }

.price-card h3 { margin: 6px 0 10px; font-size: 1.25rem; }

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    margin: 0 0 6px;
    color: var(--muted);
    font-size: 0.95rem;
}

.price-row b { color: var(--text); font-size: 1.15rem; white-space: nowrap; }

.price-month {
    margin: auto 0 0;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--amber);
    font-weight: 700;
}

.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    padding: 0;
    margin: 0;
    list-style: none;
    counter-reset: step;
}

.steps li {
    counter-increment: step;
    position: relative;
    padding: 16px 16px 16px 58px;
    border-radius: 18px;
    background: #0e1420;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.steps li::before {
    content: counter(step);
    position: absolute;
    left: 16px;
    top: 16px;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(61, 255, 192, 0.16);
    color: var(--mint);
    font-family: var(--mono);
    font-weight: 700;
}

/* ---------- Телефоны и планшеты ---------- */
@media (max-width: 1000px) {
    .price-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
    .steps { grid-template-columns: 1fr; }
    .prose table { font-size: 0.9rem; }
    .prose th, .prose td { padding: 6px 8px; vertical-align: top; }
    .project-layout > div { min-width: 0; }
    .update-banner strong { align-self: flex-start; }
}

@media (max-width: 560px) {
    body { font-size: 16px; }
    .wrap, .narrow { width: calc(100% - 28px); }
    .top-inner { min-height: 60px; }
    .hero { padding: 40px 0 24px; }
    h1 { font-size: 1.75rem; }
    .lead { font-size: 1.02rem; }
    .hero-actions .btn { width: 100%; }
    .price-grid { grid-template-columns: 1fr; }
    .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
    .chips::-webkit-scrollbar { display: none; }
    .chip { flex: 0 0 auto; }
    .dev-card { grid-template-columns: 1fr; padding: 16px; }
    .dev-grid.is-single .dev-card { grid-template-columns: 1fr; }
    .dev-go { grid-column: 1; }
    .dev-emoji { width: 52px; height: 52px; font-size: 1.5rem; }
    .dev-emoji.xl { width: 64px; height: 64px; font-size: 1.9rem; }
    .project-head { flex-direction: row; align-items: center; }
    .project-head h1 { font-size: 1.6rem; }
    .facts li { font-size: 0.92rem; }
    .prose .chat, .prose .chat-file { max-width: none; margin-left: -4px; margin-right: -4px; }
    .prose .msg { font-size: 0.9rem; }
    .contact-row strong { overflow-wrap: anywhere; }
    .buy-price { font-size: 1.7rem; }
}

@media (max-width: 1100px) {
    .code-rain { display: none; }
}
