/* =========================================================
   SERVERGUARD — LANDING PAGE
   Depends on css/tokens.css (loaded first).

   Composition notes:
   - dense, top-aligned hero with a real product screenshot
   - hairline section separators instead of large empty bands
   - varied feature layouts (featured panel, bordered grid, table)
   - open layouts over repetitive rounded cards
   ========================================================= */

.container {
    width: 100%;
    margin: 0 auto;
    padding-inline: var(--page-gutter);
}

main {
    overflow-x: clip;
}

section[id] {
    scroll-margin-top: calc(var(--header-h) + 16px);
}

/* =========================================================
   BACKGROUND TEXTURE
   ========================================================= */

body::before {
    content: "";

    position: fixed;
    top: -380px;
    left: 50%;

    width: 1100px;
    height: 620px;

    transform: translateX(-50%);

    background:
        radial-gradient(
            circle,
            rgba(139, 92, 246, 0.20) 0%,
            rgba(217, 70, 239, 0.07) 42%,
            transparent 72%
        );

    pointer-events: none;
    z-index: -1;
}

body::after {
    content: "";

    position: fixed;
    inset: 0;

    background-image:
        linear-gradient(rgba(168, 139, 250, 0.022) 1px, transparent 1px),
        linear-gradient(90deg, rgba(168, 139, 250, 0.022) 1px, transparent 1px);

    background-size: 56px 56px;

    mask-image: linear-gradient(to bottom, black 0%, transparent 62%);
    -webkit-mask-image: linear-gradient(to bottom, black 0%, transparent 62%);

    pointer-events: none;
    z-index: -1;
}


/* =========================================================
   HEADER / NAV
   ========================================================= */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;

    height: var(--header-h);

    z-index: 1000;

    background: rgba(8, 6, 15, 0.8);

    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);

    border-bottom: 1px solid var(--border);
}

.nav {
    display: flex;
    align-items: center;
    gap: var(--sp-6);

    height: 100%;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 9px;

    flex: none;

    font-size: var(--fs-md);
    font-weight: 750;
    letter-spacing: -0.02em;
}

.logo-mark {
    display: grid;
    place-items: center;

    width: 30px;
    height: 30px;

    border-radius: var(--r-md);

    background: var(--gradient-accent);
    color: #fff;

    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.4);
}

.logo-mark .icon {
    font-size: 17px;
    stroke-width: 1.9;
}

.logo span {
    color: var(--accent-text);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--sp-5);

    font-size: var(--fs-sm);
    font-weight: 500;
}

.nav-links a {
    position: relative;

    padding: 6px 2px;

    color: var(--text-secondary);
    transition: color var(--t);
}

.nav-links a:hover,
.nav-links a:focus-visible {
    color: var(--text);
}

.nav-links a.is-active {
    color: var(--text);
}

.nav-links a.is-active::after {
    content: "";

    position: absolute;
    left: 2px;
    right: 2px;
    bottom: 0;

    height: 2px;

    border-radius: 2px;

    background: var(--gradient-accent);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: var(--sp-3);

    margin-left: auto;
}

.nav-actions .btn {
    min-height: 34px;
    padding: 0 var(--sp-4);
    font-size: var(--fs-sm);
}

.nav-icon-link {
    display: inline-grid;
    place-items: center;

    width: 34px;
    height: 34px;

    flex: none;

    border-radius: var(--r-md);
    border: 1px solid var(--border);

    background: transparent;
    color: var(--text-secondary);

    transition: color var(--t), background var(--t), border-color var(--t);
}

.nav-icon-link .icon {
    font-size: 17px;
}

.nav-icon-link:hover {
    color: var(--text);
    background: var(--surface-2);
    border-color: var(--border-accent);
}

.nav-toggle {
    display: none;

    align-items: center;
    justify-content: center;

    width: 34px;
    height: 34px;

    flex: none;

    border-radius: var(--r-md);
    border: 1px solid var(--border-strong);

    background: var(--surface-2);
    color: var(--text);

    cursor: pointer;

    transition: background var(--t), border-color var(--t);
}

.nav-toggle:hover {
    background: var(--surface-3);
    border-color: var(--border-accent);
}

.nav-toggle .icon-close {
    display: none;
}

.nav-toggle.is-open .icon-menu {
    display: none;
}

.nav-toggle.is-open .icon-close {
    display: inline-block;
}


/* =========================================================
   MOBILE NAVIGATION
   ========================================================= */

.mobile-nav {
    display: none;

    position: fixed;

    top: var(--header-h);
    left: 0;
    right: 0;

    z-index: 999;

    flex-direction: column;
    gap: 2px;

    padding: var(--sp-4) var(--gutter) var(--sp-5);

    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;

    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.mobile-nav.open {
    display: flex;
}

.mobile-nav-link {
    padding: 11px 10px;
    border-radius: var(--r-md);

    color: var(--text-secondary);
    font-size: var(--fs-base);
    font-weight: 500;

    transition: color var(--t), background var(--t);
}

.mobile-nav-link:hover {
    color: var(--text);
    background: var(--surface-2);
}

.mobile-nav .btn {
    margin-top: var(--sp-3);
    width: 100%;
}


/* =========================================================
   HERO
   ========================================================= */

.hero {
    padding-top: calc(var(--header-h) + 64px);
    padding-bottom: 56px;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
    gap: clamp(32px, 4vw, 60px);
    align-items: start;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;

    margin-bottom: 22px;

    color: var(--text-muted);

    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    letter-spacing: 0.02em;
}

.hero-eyebrow::before {
    content: "";

    width: 22px;
    height: 1px;

    background: var(--accent);
}

.hero h1 {
    max-width: 17ch;

    margin-bottom: 20px;

    font-size: clamp(40px, 5vw, 58px);
    line-height: 1.02;
    letter-spacing: -0.045em;
    font-weight: 800;
}

.hero h1 em {
    font-style: normal;

    background: var(--gradient-text);
    -webkit-background-clip: text;
    background-clip: text;

    color: transparent;
}

.hero h1 em::selection {
    color: #fff;
}

.hero-description {
    max-width: 52ch;

    margin-bottom: 28px;

    color: var(--text-secondary);
    font-size: var(--fs-md);
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-3);

    margin-bottom: 30px;
}

.hero-actions .btn {
    min-height: 44px;
    padding: 0 var(--sp-5);
    font-size: var(--fs-sm);
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-6) var(--sp-7);

    padding-top: 20px;

    border-top: 1px solid var(--border);
}

.hero-meta dt {
    color: var(--text-faint);

    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.hero-meta dd {
    margin: 4px 0 0;

    color: var(--text-secondary);

    font-family: var(--font-mono);
    font-size: var(--fs-sm);
}

.hero-meta dd.latest-version {
    color: var(--accent-text);
}

.hero-visual {
    width: 100%;
    max-width: 760px;

    justify-self: end;
}


/* =========================================================
   APP WINDOW (real product screenshots)
   ========================================================= */

.app-window {
    border-radius: var(--r-xl);
    overflow: hidden;

    background: var(--surface);
    border: 1px solid var(--border-strong);

    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.04) inset,
        0 24px 60px rgba(3, 2, 8, 0.6),
        0 0 0 1px rgba(139, 92, 246, 0.05);
}

/* Small source screenshots: cap the frame so they are not
   upscaled past their native resolution on wide layouts. */
.app-window--sm {
    max-width: 560px;
    margin-inline-start: auto;
}

.app-window-bar {
    display: flex;
    align-items: center;
    gap: 6px;

    height: 36px;
    padding: 0 var(--sp-4);

    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}

.app-window-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #3a3355;
}

.app-window-title {
    margin-left: var(--sp-2);

    color: var(--text-muted);

    font-family: var(--font-mono);
    font-size: 11px;
}

.app-window img {
    display: block;
    width: 100%;
    height: auto;

    background: var(--bg-deep);
}

.app-window-caption {
    padding: 10px var(--sp-4);

    border-top: 1px solid var(--border);

    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 11px;
}

.hero-commands {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;

    margin-top: 12px;
}

.hero-commands code {
    padding: 5px 10px;

    border-radius: var(--r-full);
    border: 1px solid var(--border);

    background: var(--surface-2);
    color: var(--accent-text);

    font-size: 11px;

    transition: border-color var(--t), color var(--t);
}

.hero-commands code:hover {
    border-color: var(--border-accent);
    color: var(--text);
}


/* =========================================================
   SECTION RHYTHM
   ========================================================= */

.section {
    padding: 76px 0;

    border-top: 1px solid var(--border);
}

.section-head {
    max-width: 720px;
    margin-bottom: 40px;
}

.eyebrow {
    display: block;

    margin-bottom: 10px;

    color: var(--accent-text);

    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.section-head h2 {
    font-size: clamp(26px, 3vw, 36px);
    line-height: 1.12;
    letter-spacing: -0.03em;

    margin-bottom: 12px;
}

.section-head p {
    max-width: 62ch;
    color: var(--text-secondary);
    font-size: var(--fs-base);
    line-height: 1.72;
}

.copy-title {
    font-size: clamp(24px, 2.8vw, 32px);
    letter-spacing: -0.03em;
    line-height: 1.14;

    margin-bottom: 14px;
}


/* =========================================================
   FEATURES — FEATURED PANEL
   ========================================================= */

.feature-prime {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr);
    gap: clamp(var(--sp-6), 4vw, var(--sp-9));
    align-items: start;

    margin-bottom: var(--sp-7);
    padding: var(--sp-6);

    border-bottom: 1px solid var(--border);
}

.feature-prime--flush {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: 0;
}

.feature-prime-head {
    display: flex;
    align-items: center;
    gap: 12px;

    margin-bottom: 16px;
}

.feature-icon {
    display: grid;
    place-items: center;

    width: 38px;
    height: 38px;

    flex: none;

    border-radius: var(--r-md);

    background: var(--gradient-accent-soft);
    border: 1px solid var(--border-accent);
    color: var(--accent-text);

    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.16);
}

.feature-icon .icon {
    font-size: 19px;
}

.feature-prime h3 {
    font-size: var(--fs-xl);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.feature-prime-copy > p {
    max-width: 56ch;
    margin-bottom: 20px;

    color: var(--text-secondary);
    font-size: var(--fs-base);
    line-height: 1.72;
}

.feature-points {
    list-style: none;

    padding: 0;
    margin: 0 0 20px;

    display: grid;
    gap: 10px;
}

.feature-points li {
    display: flex;
    align-items: flex-start;
    gap: 10px;

    color: var(--text-secondary);
    font-size: var(--fs-sm);
}

.feature-points .icon {
    margin-top: 3px;
    color: var(--accent-text);
    font-size: 15px;
}

.feature-meta {
    color: var(--text-faint);

    font-family: var(--font-mono);
    font-size: 12px;
}


/* =========================================================
   MODULE REFERENCE TABLE
   ========================================================= */

.reftables {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--sp-4);
}

.reftables .reftable {
    margin-top: 0;
}

.reftable {
    margin-top: 28px;

    border: 1px solid var(--border);
    border-radius: var(--r-xl);

    overflow: hidden;
}

.reftable-row {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: var(--sp-5);

    align-items: center;

    padding: 12px 18px;

    border-bottom: 1px solid var(--border);
}

.reftable-row:last-child {
    border-bottom: 0;
}

.reftable-head {
    background: var(--surface-2);

    color: var(--text-faint);

    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.reftable-cmd {
    color: var(--accent-text);

    font-family: var(--font-mono);
    font-size: 12.5px;
}

.reftable-purpose {
    color: var(--text-secondary);
    font-size: var(--fs-sm);
}


/* =========================================================
   QUICK START — command reference
   ========================================================= */

.cmd-ref {
    border: 1px solid var(--border);
    border-radius: var(--r-xl);

    overflow: hidden;

    background: var(--bg-deep);
}

.cmd-ref-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 11px 16px;

    border-bottom: 1px solid var(--border);

    color: var(--text-muted);

    font-family: var(--font-mono);
    font-size: 11px;
}

.cmd-ref-header span:last-child {
    color: var(--text-faint);
}

.cmd-ref-body {
    padding: 14px 16px;

    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cmd-ref-line {
    display: grid;
    grid-template-columns: minmax(0, auto) 1fr;
    gap: 16px;
    align-items: baseline;

    font-family: var(--font-mono);
    font-size: 12.5px;
}

.cmd-ref-line .cmd {
    color: var(--text);
}

.cmd-ref-line .cmd::before {
    content: "$ ";
    color: var(--accent-text);
}

.cmd-ref-line .desc {
    color: var(--text-muted);
    text-align: right;
}

.quickstart-note {
    display: flex;
    align-items: flex-start;
    gap: 12px;

    margin-top: 40px;
    padding-top: 20px;

    border-top: 1px solid var(--border);
}

.quickstart-note .icon {
    margin-top: 2px;
    color: var(--warning);
    font-size: 18px;
}

.quickstart-note p {
    color: var(--text-secondary);
    font-size: var(--fs-sm);
    line-height: 1.7;
}

.quickstart-note code {
    padding: 1px 6px;
    border-radius: var(--r-xs);
    background: var(--surface-3);
    color: var(--accent-text);
    font-size: 12px;
}

.quickstart-note a {
    color: var(--accent-text);
    border-bottom: 1px solid var(--border-accent);
}


/* =========================================================
   SECURITY
   ========================================================= */

.security-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(28px, 4vw, 56px);
    align-items: start;
}

.security-lead {
    max-width: 54ch;
    margin-bottom: 26px;

    color: var(--text-secondary);
    font-size: var(--fs-md);
    line-height: 1.72;
}

.security-list {
    list-style: none;

    padding: 0;
    margin: 0;

    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 24px;
}

.security-list li {
    display: flex;
    align-items: center;
    gap: 10px;

    color: var(--text);
    font-size: var(--fs-sm);
}

.security-list .icon {
    color: var(--success);
    font-size: 16px;
}

.flow {
    border-top: 1px solid var(--border);
}

.flow-step {
    display: grid;
    grid-template-columns: 34px 1fr;
    gap: var(--sp-4);

    padding: 16px 0;

    border-bottom: 1px solid var(--border);
}

.flow-step .n {
    color: var(--accent-text);
    font-family: var(--font-mono);
    font-size: 12px;
}

.flow-step strong {
    display: block;
    font-size: var(--fs-sm);
    font-weight: 600;
}

.flow-step span {
    color: var(--text-muted);
    font-size: var(--fs-xs);
}


/* =========================================================
   NETWORK
   ========================================================= */

.network-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: clamp(28px, 4vw, 56px);
    align-items: center;
}

.network-copy > p {
    max-width: 50ch;
    margin-bottom: 22px;

    color: var(--text-secondary);
    font-size: var(--fs-md);
    line-height: 1.72;
}

.network-points {
    list-style: none;

    padding: 0;
    margin: 0;

    display: grid;
    gap: 12px;
}

.network-points li {
    display: flex;
    align-items: flex-start;
    gap: 10px;

    color: var(--text-secondary);
    font-size: var(--fs-sm);
    line-height: 1.6;
}

.network-points .icon {
    margin-top: 3px;
    color: var(--accent-text);
    font-size: 15px;
}

.globe-wrap {
    position: relative;

    width: 100%;
    max-width: 620px;
    aspect-ratio: 1 / 1;

    margin: 0 auto;
}

.globe-wrap canvas {
    display: block;
    width: 100%;
    height: 100%;

    cursor: grab;
    touch-action: pan-y;
}

.globe-wrap canvas.dragging {
    cursor: grabbing;
}

.globe-legend {
    position: absolute;
    left: 50%;
    bottom: 1%;

    transform: translateX(-50%);

    display: flex;
    gap: 14px;

    padding: 6px 13px;

    border-radius: var(--r-full);
    border: 1px solid var(--border);

    background: rgba(8, 6, 15, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);

    color: var(--text-secondary);
    font-size: 11px;

    white-space: nowrap;
}

.globe-legend i {
    display: inline-block;

    width: 6px;
    height: 6px;

    margin-right: 6px;

    border-radius: 50%;

    vertical-align: 1px;
}

.globe-hint {
    position: absolute;
    top: 1%;
    right: 0;

    color: var(--text-faint);

    font-family: var(--font-mono);
    font-size: 11px;
}

.globe-disclaimer {
    margin-top: 14px;

    color: var(--text-faint);
    font-size: 11px;
    text-align: center;
}


/* =========================================================
   TELEGRAM
   ========================================================= */

.telegram-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.82fr);
    gap: clamp(28px, 4vw, 56px);
    align-items: center;
}

.telegram-copy > p {
    max-width: 46ch;
    margin-bottom: 22px;

    color: var(--text-secondary);
    font-size: var(--fs-md);
    line-height: 1.72;
}

.telegram-card {
    border: 1px solid var(--border);
    border-radius: var(--r-xl);

    overflow: hidden;

    background: var(--surface);
    box-shadow: var(--shadow-md);
}

.telegram-header {
    display: flex;
    align-items: center;
    gap: 11px;

    padding: 14px var(--sp-4);

    border-bottom: 1px solid var(--border);
}

.telegram-logo {
    display: grid;
    place-items: center;

    width: 34px;
    height: 34px;

    border-radius: var(--r-md);

    background: var(--accent-soft);
    color: var(--accent-text);
}

.telegram-logo .icon {
    font-size: 17px;
}

.telegram-name {
    font-size: var(--fs-sm);
    font-weight: 600;
}

.telegram-status {
    color: var(--text-muted);
    font-size: 11px;
}

.telegram-body {
    padding: var(--sp-4);

    display: flex;
    flex-direction: column;
    gap: 8px;
}

.message {
    padding: 12px 14px;

    border-radius: var(--r-md);
    border: 1px solid var(--border);

    background: var(--bg-deep);
}

.message-title {
    display: flex;
    align-items: center;
    gap: 7px;

    margin-bottom: 4px;

    color: var(--accent-text);
    font-size: var(--fs-xs);
    font-weight: 650;
}

.message-title .icon {
    font-size: 14px;
}

.message-text {
    color: var(--text-secondary);
    font-size: var(--fs-xs);
    line-height: 1.6;
}

.message-text code {
    color: var(--text);
    font-size: 11px;
}

.message-danger .message-title {
    color: var(--danger);
}

.message-ok .message-title {
    color: var(--success);
}


/* =========================================================
   NEWS
   ========================================================= */

.news-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
    gap: var(--sp-4);
}

.news-card {
    display: flex;
    flex-direction: column;

    overflow: hidden;

    border-radius: var(--r-xl);
    border: 1px solid var(--border);

    background: var(--surface);

    transition: border-color var(--t), background var(--t);
}

.news-card:hover {
    border-color: var(--border-accent);
    background: var(--surface-2);
}

.news-card-featured {
    grid-column: span 2;
}

.news-image {
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--bg-deep);
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-image-error {
    display: none;
}

.news-image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 60%, rgba(4, 3, 9, 0.72));
}

.news-content {
    display: flex;
    flex-direction: column;
    flex: 1;

    padding: var(--sp-5);
}

.news-meta {
    display: flex;
    align-items: center;
    gap: var(--sp-2);

    margin-bottom: 10px;

    color: var(--text-muted);
    font-size: var(--fs-xs);
}

.news-category {
    color: var(--accent-text);
    font-weight: 600;
}

.news-dot {
    color: var(--text-faint);
}

.news-card h3 {
    margin-bottom: 8px;
    font-size: var(--fs-lg);
    letter-spacing: -0.01em;
}

.news-card p {
    color: var(--text-secondary);
    font-size: var(--fs-sm);
    line-height: 1.65;
}

.news-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-3);

    margin-top: auto;
    padding-top: var(--sp-5);
}

.news-status {
    display: flex;
    align-items: center;
    gap: 7px;

    color: var(--text-muted);
    font-size: var(--fs-xs);
}

.news-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
}

.news-read-more {
    display: inline-flex;
    align-items: center;
    gap: 4px;

    color: var(--accent-text);
    font-size: var(--fs-xs);
    font-weight: 600;
}

.news-loading,
.news-empty {
    grid-column: 1 / -1;

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-3);

    padding: var(--sp-9) var(--sp-4);

    border-radius: var(--r-xl);
    border: 1px dashed var(--border-strong);

    color: var(--text-muted);
    font-size: var(--fs-sm);
}

.news-empty-icon {
    display: grid;
    place-items: center;

    width: 44px;
    height: 44px;

    border-radius: var(--r-lg);

    background: var(--surface-2);
    color: var(--text-muted);
}

.news-empty h3 {
    font-size: var(--fs-base);
    color: var(--text);
}

.news-loading-spinner {
    width: 20px;
    height: 20px;

    border-radius: 50%;
    border: 2px solid var(--border-strong);
    border-top-color: var(--accent);

    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.news-error {
    margin-top: var(--sp-5);
    padding: var(--sp-4) var(--sp-5);

    border-radius: var(--r-lg);
    border: 1px solid rgba(240, 115, 110, 0.35);
    background: var(--danger-soft);

    color: var(--danger);
    font-size: var(--fs-sm);
}


/* =========================================================
   DOWNLOAD CTA
   ========================================================= */

.cta {
    padding-bottom: 76px;
}

.cta-box {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    gap: clamp(28px, 4vw, 56px);
    align-items: center;

    padding: clamp(28px, 4vw, 44px);

    border-radius: var(--r-2xl);
    border: 1px solid var(--border-accent);

    background:
        radial-gradient(circle at 100% 0%, var(--accent-soft-strong), transparent 55%),
        radial-gradient(circle at 0% 120%, var(--magenta-soft), transparent 50%),
        var(--surface);

    box-shadow: var(--shadow-glow);
}

.cta-box h2 {
    font-size: clamp(28px, 3.4vw, 40px);
    letter-spacing: -0.03em;
    margin-bottom: 12px;
}

.cta-box > div > p {
    max-width: 48ch;
    margin-bottom: 22px;

    color: var(--text-secondary);
    font-size: var(--fs-base);
    line-height: 1.7;
}

.cta-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-3);
}

.cta-actions .btn {
    min-height: 44px;
    padding: 0 var(--sp-6);
    font-size: var(--fs-sm);
}

.cta-meta {
    display: grid;
    gap: 12px;

    padding-left: clamp(0px, 3vw, 40px);
    border-left: 1px solid var(--border);
}

.cta-meta dt {
    color: var(--text-faint);

    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.cta-meta dd {
    margin: 4px 0 0;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: var(--fs-sm);
}

.cta-meta dd.latest-version {
    color: var(--accent-text);
}

.download-unavailable {
    opacity: 0.5;
    pointer-events: none;
}


/* =========================================================
   FOOTER
   ========================================================= */

.site-footer {
    padding: var(--sp-8) 0 var(--sp-7);

    border-top: 1px solid var(--border);
}

.footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
    gap: var(--sp-7);
}

.footer-brand .logo {
    margin-bottom: 14px;
}

.footer-brand p {
    max-width: 34ch;
    color: var(--text-muted);
    font-size: var(--fs-sm);
}

.footer-col h4 {
    margin-bottom: 14px;

    color: var(--text-faint);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.footer-col ul {
    list-style: none;
    padding: 0;

    display: grid;
    gap: 10px;
}

.footer-col a {
    color: var(--text-secondary);
    font-size: var(--fs-sm);
    transition: color var(--t);
}

.footer-col a:hover {
    color: var(--text);
}

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-4);

    margin-top: var(--sp-8);
    padding-top: var(--sp-5);

    border-top: 1px solid var(--border);

    color: var(--text-faint);
    font-size: var(--fs-xs);
}


/* =========================================================
   SCROLL REVEAL
   ========================================================= */

html.js .reveal {
    opacity: 0;
    transform: translateY(14px);

    transition: opacity 0.5s ease, transform 0.5s ease;
}

html.js .reveal.visible {
    opacity: 1;
    transform: none;
}


/* =========================================================
   RESPONSIVE — TABLET
   ========================================================= */

@media (max-width: 1000px) {

    .nav-links {
        display: none;
    }

    .nav-toggle {
        display: inline-flex;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        gap: var(--sp-9);
    }

    .hero {
        padding-top: calc(var(--header-h) + 48px);
    }

    .hero h1 {
        max-width: none;
    }

    .hero-visual {
        max-width: 620px;
        margin: 0 auto;
        justify-self: center;
    }

    .feature-prime,
    .security-grid,
    .network-grid,
    .telegram-grid,
    .cta-box {
        grid-template-columns: 1fr;
    }

    .cta-meta {
        padding-left: 0;
        border-left: 0;
        border-top: 1px solid var(--border);
        padding-top: var(--sp-5);
    }

    .network-copy {
        order: 2;
    }

    .globe-wrap {
        max-width: 480px;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}


/* =========================================================
   RESPONSIVE — MOBILE
   ========================================================= */

@media (max-width: 720px) {

    :root {
        --gutter: 16px;
        --page-gutter: 16px;
    }

    .section {
        padding: var(--sp-10) 0;
    }

    .reftables {
        grid-template-columns: 1fr;
    }

    .reftable-row {
        grid-template-columns: 1fr;
        gap: 3px;
    }

    .reftable-head {
        display: none;
    }

    .news-card-featured {
        grid-column: span 1;
    }

    .news-list {
        grid-template-columns: 1fr;
    }

    .security-list {
        grid-template-columns: 1fr;
    }

    .app-window-title {
        display: none;
    }
}

/* Focused density correction; preserve the established landing composition
   while bringing the next section into a more useful first scroll position. */
@media (min-width: 721px) {
    .hero { padding-bottom: 52px; }
    .section { padding-block: 76px; }
}

@media (max-width: 520px) {

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .globe-legend {
        gap: var(--sp-2);
        font-size: 10px;
        padding: 5px 10px;
    }
}


/* =========================================================
   PERFORMANCE — SMALL SCREENS
   A blurred fixed header is expensive to repaint while the page
   scrolls. On phones use a near-opaque background instead.
   ========================================================= */

@media (max-width: 720px) {

    .site-header {
        background: rgba(8, 6, 15, 0.96);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    /* Large fixed gradients and the masked grid are expensive to
       composite while scrolling on low-powered phones. Keep a
       smaller glow and drop the grid texture on small screens. */
    body::before {
        width: 640px;
        height: 420px;
    }

    body::after {
        display: none;
    }

    .globe-legend {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: rgba(8, 6, 15, 0.9);
    }
}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    html.js .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .news-loading-spinner {
        animation: none;
    }

    .news-card:hover,
    .btn-primary:hover {
        transform: none;
    }
}


/* =========================================================
   SHARED COMPONENTS ON THE LANDING PAGE
   ========================================================= */

.panel > .feature-prime {
    padding: var(--sp-6);
}

.panel > .feature-prime .app-window {
    margin-bottom: 0;
}

.qs-steps + .cmd-ref {
    margin-top: var(--sp-6);
}

.pipeline {
    margin-bottom: var(--sp-6);
}

/* Header wordmark + tagline */

.logo-text {
    display: flex;
    flex-direction: column;

    line-height: 1.1;
}

.logo-tagline {
    margin-top: 1px;

    color: var(--text-faint);

    font-size: 9.5px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* Hero version badge */

.hero-badge {
    margin-bottom: 18px;
}

/* Quick-start links */

.qs-link {
    margin-top: 10px;

    font-size: var(--fs-sm);
    font-weight: 600;
}

/* Header download label swaps on narrow screens */

.btn-label-short {
    display: none;
}

@media (max-width: 860px) {

    .btn-label-full {
        display: none;
    }

    .btn-label-short {
        display: inline;
    }
}

@media (max-width: 560px) {

    .logo-tagline {
        display: none;
    }

    .nav-icon-link {
        display: none;
    }
}

@media (max-width: 400px) {

    .nav {
        gap: var(--sp-3);
    }

    .nav-actions .btn {
        padding: 0 var(--sp-3);
    }
}

/* =========================================================
   PASS 2 — COMPOSITION REFINEMENT
   ========================================================= */

.container {
    width: min(calc(100% - 96px), var(--content-max));
    max-width: none;
    padding-inline: 0;
}

.hero {
    position: relative;
    padding-top: calc(var(--header-h) + 42px);
    padding-bottom: 72px;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 620px;
    pointer-events: none;
    background: radial-gradient(circle at 75% 34%, rgba(139,92,246,.16), transparent 31%), radial-gradient(circle at 28% 0%, rgba(217,70,239,.09), transparent 30%);
    mask-image: linear-gradient(to bottom, #000, transparent);
    -webkit-mask-image: linear-gradient(to bottom, #000, transparent);
}

.hero-grid {
    position: relative;
    grid-template-columns: minmax(0, .91fr) minmax(0, 1.09fr);
    gap: clamp(34px, 5vw, 78px);
    align-items: center;
}

.hero-copy { padding-block: 18px; }
.hero-badge { background: rgba(139,92,246,.09); box-shadow: inset 0 0 0 1px rgba(255,255,255,.025); }
.hero h1 { max-width: 13ch; font-size: clamp(48px, 5.5vw, 72px); line-height: .98; letter-spacing: -.06em; }
.hero-description { max-width: 47ch; margin-bottom: 30px; font-size: 16px; color: #c4bdd7; }
.hero-actions .btn-primary { min-height: 50px; padding-inline: 22px; box-shadow: 0 14px 34px rgba(109,40,217,.28), inset 0 1px rgba(255,255,255,.22); }
.hero-actions .btn-secondary { min-height: 50px; }
.hero-meta { max-width: 450px; gap: 0; justify-content: space-between; padding-top: 16px; }
.hero-meta > div { flex: 1; padding-right: 16px; border-right: 1px solid var(--border); }
.hero-meta > div:last-child { padding-right: 0; border-right: 0; }

.hero-visual {
    position: relative;
    max-width: 720px;
    padding: 14px;
    border: 1px solid rgba(167,139,250,.18);
    border-radius: 22px;
    background: linear-gradient(145deg, rgba(26,21,48,.82), rgba(8,6,15,.55));
    box-shadow: 0 28px 80px rgba(3,2,8,.66), 0 0 70px rgba(109,40,217,.16);
}
.hero-visual::before, .hero-visual::after { content: ""; position: absolute; z-index: -1; border: 1px solid rgba(167,139,250,.13); border-radius: 18px; }
.hero-visual::before { inset: 8px -8px -8px 8px; }
.hero-visual::after { inset: 17px -17px -17px 17px; opacity: .55; }
.hero-visual .app-window { border-color: rgba(255,255,255,.13); box-shadow: 0 18px 42px rgba(0,0,0,.48); }
.app-window-dot:first-child { background: #f0736e; }
.app-window-dot:nth-child(2) { background: #e6b45a; }
.app-window-dot:nth-child(3) { background: #4ade80; }
.hero-commands { margin: 12px 2px 0; }

.section { padding: 92px 0; background: linear-gradient(180deg, transparent, rgba(19,16,34,.16) 50%, transparent); }
.section-head { max-width: 780px; margin-bottom: 46px; }
.section-head h2 { font-size: clamp(32px, 3.5vw, 46px); letter-spacing: -.045em; }
.section-head p { color: #bdb5cf; }

.pipeline { gap: 0; margin-bottom: 28px; padding: 4px; border: 1px solid var(--border); border-radius: 16px; background: rgba(13,11,24,.74); }
.pipeline-node { position: relative; z-index: 1; min-height: 116px; padding: 18px 16px; border: 0; border-radius: 11px; background: transparent; }
.pipeline-node:not(:last-of-type)::after { content: ""; position: absolute; top: 50%; right: -1px; width: 1px; height: 42px; transform: translateY(-50%); background: var(--border-strong); }
.pipeline-node .icon { color: var(--accent-text); font-size: 22px; }
.pipeline-node strong { font-size: 14px; }
.pipeline-node span { font-size: 12px; }
.pipeline-arrow { display: none; }

.feature-prime { border: 1px solid var(--border-strong); border-radius: var(--r-2xl); background: linear-gradient(135deg, rgba(19,16,34,.96), rgba(13,11,24,.82)); box-shadow: 0 22px 55px rgba(0,0,0,.22); }
.feature-grid { gap: var(--sp-3); }
.feature-card { padding: var(--sp-5); border-color: rgba(167,139,250,.13); background: linear-gradient(145deg, rgba(26,21,48,.74), rgba(13,11,24,.9)); }
.feature-card:hover { transform: translateY(-3px); border-color: var(--border-accent-strong); box-shadow: 0 16px 35px rgba(0,0,0,.25); }
.feature-card h3 { font-size: 16px; }
.feature-card p { color: #bdb5cf; }
.feature-card-go { margin-top: 18px; }

.security-grid, .network-grid, .telegram-grid { gap: clamp(38px, 7vw, 100px); }
.globe-wrap { min-height: 460px; border: 1px solid rgba(167,139,250,.15); border-radius: 22px; background: radial-gradient(circle at 50% 44%, rgba(109,40,217,.17), transparent 58%), rgba(13,11,24,.55); box-shadow: inset 0 0 50px rgba(139,92,246,.06); }
.telegram-card { border-color: rgba(167,139,250,.22); background: linear-gradient(145deg, rgba(29,22,52,.95), rgba(13,11,24,.96)); box-shadow: 0 24px 60px rgba(0,0,0,.34); }
.news-list { gap: 14px; }
.news-card { min-height: 190px; padding: 24px; border-color: rgba(167,139,250,.14); background: linear-gradient(145deg, rgba(26,21,48,.74), rgba(13,11,24,.92)); }
.cta-box { overflow: hidden; border-color: rgba(167,139,250,.3); background: radial-gradient(circle at 82% 15%, rgba(217,70,239,.24), transparent 35%), radial-gradient(circle at 10% 100%, rgba(109,40,217,.3), transparent 42%), #120d24; box-shadow: 0 30px 80px rgba(47,16,91,.22); }

@media (max-width: 1000px) {
    .hero-grid { grid-template-columns: 1fr; }
    .hero-copy { padding-block: 0; }
    .hero h1 { max-width: 13ch; }
    .hero-visual { justify-self: stretch; margin-inline: auto; }
}
@media (max-width: 720px) {
    .hero { padding-top: calc(var(--header-h) + 28px); padding-bottom: 46px; }
    .hero h1 { font-size: clamp(42px, 12vw, 58px); }
    .hero-description { font-size: 15px; }
    .hero-visual { padding: 8px; border-radius: 16px; }
    .hero-visual::before, .hero-visual::after { display: none; }
    .section { padding: 64px 0; }
    .pipeline { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; }
    .pipeline-node { min-height: 104px; }
    .pipeline-node:not(:last-of-type)::after { display: none; }
    .globe-wrap { min-height: 340px; }
}

/* Structural composition: the product frame carries a small amount of
   real context so the screenshot reads as part of the hero, not a loose image. */
.hero-proof {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 14px;
    margin: 12px 2px 0;
    padding: 11px 13px;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: rgba(8, 6, 15, .68);
}
.hero-proof-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 10px;
    white-space: nowrap;
}
.hero-proof-status span { width: 6px; height: 6px; border-radius: 50%; background: var(--success); box-shadow: 0 0 10px rgba(74,222,128,.6); }
.hero-proof-items { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; }
.hero-proof-items span { display: inline-flex; align-items: center; gap: 5px; color: var(--text-muted); font-size: 10px; }
.hero-proof-items .icon { color: var(--accent-text); font-size: 13px; }

@media (max-width: 720px) {
    .hero-proof { grid-template-columns: 1fr; gap: 8px; }
    .hero-proof-items { justify-content: flex-start; }
}

@media (max-width: 720px) {
    .container { width: calc(100% - 32px); max-width: none; padding-inline: 0; }
}

/* Targeted density correction for the existing landing composition. */
@media (min-width: 721px) {
    .section { padding-block: 72px; }
    .section-head { margin-bottom: 32px; }
    #features .section-head { margin-bottom: 24px; }
    #features .feature-prime-copy { align-self: start; }
    #features .feature-prime .code-panel pre { padding: 14px 16px; }
    #features .feature-prime .code-panel pre code { line-height: 1.55; }
}
