@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
    --bg-dark: #050507;
    --bg-panel: #0f0f12;
    --bg-panel-alt: #151217;
    --accent-red-dim: #3b090d;
    --accent-red-mid: #8d151b;
    --accent-red-bright: #ef1d25;
    --accent-glow: #ff2a2a;
    --text-primary: #f8f8f8;
    --text-secondary: #a3a3a3;
    --text-muted: #737373;
    --text-mono: #ff2a2a;
    --border: #1f1f26;
    --font-main: 'Inter', sans-serif;
    --font-tech: 'JetBrains Mono', monospace;
    --grid-line: rgba(255, 42, 42, 0.028);
    --type-big: clamp(1.1rem, 2.4vw, 1.3rem);
    --type-small: 0.92rem;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    background: var(--bg-dark);
}

body {
    min-height: 100vh;
    background: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: var(--type-small);
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

body::selection,
*::selection {
    background: var(--accent-glow);
    color: #fff;
}

.grid-overlay {
    position: fixed;
    inset: 0;
    background-size: 40px 40px;
    background-image:
        linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
        linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
    pointer-events: none;
    z-index: -2;
}

.ambient-glow {
    position: fixed;
    right: -180px;
    top: 120px;
    width: 520px;
    height: 520px;
    border-radius: 999px;
    background: rgba(255, 42, 42, 0.045);
    filter: blur(80px);
    pointer-events: none;
    z-index: -1;
}

.scan-line {
    display: none;
}

.container {
    width: 100%;
    max-width: 920px;
    margin: 0 auto;
    padding: 0 24px;
}

.muted {
    color: var(--text-secondary);
}

h1,
h2,
h3 {
    font-size: var(--type-big);
    font-weight: 800;
    letter-spacing: -0.045em;
}

a {
    color: inherit;
}

.btn-group,
.guide-actions,
.secret-actions,
.action-stack {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn {
    min-height: 54px;
    padding: 14px 22px;
    border-radius: 14px;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text-primary);
    font-size: var(--type-small);
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: 0.16s ease;
    will-change: transform;
}

.btn:hover {
    transform: translateY(-2px) scale(1.018);
}

.btn:active {
    transform: translateY(0) scale(0.975);
}

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    transform: none;
}

.btn:focus-visible,
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid rgba(255, 42, 42, 0.82);
    outline-offset: 4px;
}

.btn-primary {
    background: var(--accent-red-bright);
    border-color: var(--accent-red-bright);
    box-shadow: 0 12px 34px rgba(255, 42, 42, 0.18);
}

.btn-primary:hover {
    background: var(--accent-glow);
    border-color: var(--accent-glow);
}

.btn-secondary {
    background: var(--bg-panel);
    border-color: var(--border);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    border-color: #404040;
    color: #fff;
}

.brand-link span,
header[style] div span {
    font-size: inherit !important;
    line-height: 1;
}

.hidden {
    display: none !important;
}

.download-count {
    min-height: 1em;
    color: var(--text-muted);
    font-family: var(--font-tech);
    font-size: var(--type-small);
}

.download-panel {
    width: min(100%, 440px);
    margin-top: 18px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 24px;
    background:
        radial-gradient(circle at top right, rgba(255, 42, 42, 0.08), transparent 42%),
        rgba(12, 12, 14, 0.72);
    box-shadow: 0 24px 72px rgba(0, 0, 0, 0.34);
}

.download-row,
.download-links {
    display: grid;
    gap: 10px;
}

.download-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
}

.download-links {
    margin-top: 12px;
}

.download-option {
    display: grid;
    gap: 5px;
    justify-items: center;
    grid-template-rows: auto 1em;
}

.download-btn,
.download-wide {
    width: 100%;
    justify-content: center;
    white-space: nowrap;
}

.download-btn {
    min-height: 48px;
    padding: 12px 16px;
    background: var(--accent-red-bright);
    border-color: var(--accent-red-bright);
    color: #fff;
    box-shadow: 0 12px 34px rgba(255, 42, 42, 0.18);
}

.download-btn:hover {
    background: var(--accent-glow);
    border-color: var(--accent-glow);
}

.download-wide {
    min-height: 48px;
    padding: 12px 18px;
    border-color: #333;
    color: var(--text-secondary);
}

.download-telegram {
    border-color: var(--accent-red-mid);
    color: var(--text-primary);
}

/* Landing */
header[style] {
    max-width: 920px;
    margin: 0 auto;
    border-bottom: 1px solid var(--border);
}

.hero {
    min-height: calc(100vh - 92px);
    display: flex;
    align-items: center;
    padding: 72px 0;
}

.hero-text h1 {
    font-size: var(--type-big);
    line-height: 0.96;
    margin-bottom: 18px;
}

.hero-text p {
    color: var(--text-secondary);
    font-size: var(--type-small);
}

.features,
.compat-section,
.faq-section {
    padding: 54px 0;
}

.features h2,
.faq-section h2 {
    margin-bottom: 18px;
}

.grid-2x2,
.platform-logos {
    display: grid;
    gap: 18px;
}

.grid-2x2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card,
details,
.onboarding-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.22);
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.card:hover,
details:hover,
.onboarding-card:hover,
.platform-item:hover {
    border-color: rgba(255, 42, 42, 0.5);
    box-shadow: 0 26px 70px rgba(255, 42, 42, 0.08), 0 24px 70px rgba(0, 0, 0, 0.32);
    transform: translateY(-2px);
}

.card-icon {
    color: var(--accent-glow);
    margin-bottom: 14px;
}

.card h3 {
    font-size: var(--type-big);
    margin-bottom: 8px;
}

.card p,
.faq-content {
    color: var(--text-secondary);
}

.platform-logos {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compat-section {
    display: grid;
    gap: 16px;
    padding-top: 18px;
}

.platform-logos {
    align-items: stretch;
}

.platform-item {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.platform-item {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 76px;
}

summary {
    cursor: pointer;
    font-weight: 800;
    transition: color 0.16s ease;
}

summary:hover {
    color: var(--accent-glow);
}

.faq-content {
    padding-top: 14px;
}

footer {
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    padding: 42px 0;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    margin-left: 18px;
}

.footer-links a:hover {
    color: #fff;
}

.onboarding-wrap {
    min-height: calc(100vh - 92px);
    display: grid;
    place-items: center;
    padding: 48px 0;
}

.onboarding-card {
    max-width: 720px;
    width: 100%;
}

.onboarding-status {
    color: var(--text-secondary);
    margin-top: 10px;
}

.debug-panel,
.debug-log {
    background: #08080a;
    border: 1px solid var(--border);
    border-radius: 16px;
}

.debug-panel {
    margin-top: 18px;
    padding: 14px;
}

.debug-log {
    color: var(--text-secondary);
    font-family: var(--font-tech);
    font-size: var(--type-small);
    max-height: 220px;
    overflow: auto;
    padding: 12px;
}

@media (max-width: 780px) {
    .container {
        padding: 0 18px;
    }

    .grid-2x2,
    .platform-logos,
    .download-row {
        grid-template-columns: 1fr;
    }

    .footer-content {
        flex-direction: column;
    }

    .footer-links a {
        margin: 0 14px 0 0;
    }
}

@media (max-width: 620px) {
    .hero {
        min-height: auto;
        padding: 54px 0;
    }

    .download-panel {
        padding: 14px;
    }

    .features,
    .compat-section,
    .faq-section {
        padding: 38px 0;
    }

    .platform-item,
    details {
        padding: 16px;
        min-height: auto;
    }
}

/* Final typography guard: every page uses only these two text sizes. */
body,
p,
li,
span,
small,
label,
input,
textarea,
summary,
.muted,
.download-count,
.status-line,
.instructions-nav,
.cabinet-nav,
.profile-kicker,
.footer-links a,
.faq-content,
.platform-name,
.debug-log,
button,
.btn,
.platform-card {
    font-size: var(--type-small) !important;
}

h1,
h2,
h3,
.brand-link,
.hero-text h1,
.card h3,
.guide-card strong,
.guide-hero h1,
.instructions-hero h1,
.plan-card strong,
.modal-card h2,
#userMeta {
    font-size: var(--type-big) !important;
}
