﻿/* SEO Magnit - Main Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #10b981;
    --text: #1f2937;
    --text-light: #6b7280;
    --bg: #ffffff;
    --bg-light: #f9fafb;
    --border: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}

/* Navigation */
header {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}

nav ul {
    display: flex;
    gap: 2rem;
    list-style: none;
}

nav a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s;
}

nav a:hover {
    color: var(--primary);
}

/* ============ HOMEPAGE v2 ============ */

/* Site hero */
.site-hero {
    background: linear-gradient(135deg, #eff6ff 0%, #f0fdf9 55%, #ffffff 100%);
    border: 1px solid #dbeafe;
    border-radius: 16px;
    padding: 4rem 2.5rem;
    margin-bottom: 2.5rem;
    position: relative;
    overflow: hidden;
}

.site-hero .badge {
    margin-bottom: 1.25rem;
}

.site-hero h1 {
    font-size: 2.5rem;
    line-height: 1.15;
    margin-bottom: 1rem;
    max-width: 760px;
}

.site-hero .lead {
    font-size: 1.2rem;
    line-height: 1.7;
    color: var(--text-light);
    max-width: 680px;
}

.site-hero .meta-row {
    margin-top: 1.25rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.75rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 0.85rem 2rem;
    border-radius: 50px;
    font-weight: 700;
    text-decoration: none;
    font-size: 1rem;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s, color 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.35);
}

.btn-outline {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

/* Section head */
.section-head {
    text-align: center;
    margin-bottom: 2rem;
}

.section-head h2 {
    margin-bottom: 0.5rem;
}

.section-head p {
    color: var(--text-light);
    font-size: 1.05rem;
}

/* Features grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 3rem;
}

.feature-card {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.feature-card .feature-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 12px;
    background: #eff6ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
}

.feature-card p {
    color: var(--text-light);
    font-size: 0.925rem;
}

/* Articles grid */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.article-card {
    display: flex;
    flex-direction: column;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    margin-bottom: 0;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
    border-color: #d1d5db;
}

.article-card .badge {
    align-self: flex-start;
    margin-bottom: 0.75rem;
}

.article-card h3 {
    font-size: 1.05rem;
    line-height: 1.35;
    margin-bottom: 0.5rem;
}

.article-card h3 a {
    color: var(--text);
    text-decoration: none;
}

.article-card h3 a:hover {
    color: var(--primary);
}

.article-card .article-excerpt {
    color: var(--text-light);
    font-size: 0.925rem;
    margin-top: auto;
}

/* Footer v2 */
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2.5rem;
}

.footer-grid .footer-about p {
    color: #9ca3af;
    margin-bottom: 0.75rem;
}

.footer-grid h4 {
    margin-bottom: 1rem;
    font-size: 1rem;
}

.footer-grid ul {
    list-style: none;
}

.footer-grid a {
    color: #d1d5db;
    text-decoration: none;
    display: block;
    padding: 0.25rem 0;
}

.footer-grid a:hover {
    color: white;
}

/* Sections */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

section {
    margin-bottom: 4rem;
}

h2 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    color: var(--text);
}

/* Tools Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.tool-card {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.tool-card h3 {
    margin-bottom: 0.5rem;
}

.tool-card h3 a {
    color: var(--primary);
    text-decoration: none;
}

.tool-card p {
    color: var(--text-light);
}

/* Blog Articles */
.article-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: transform 0.2s;
}

.article-card:hover {
    transform: translateX(4px);
}

.article-card h3 {
    margin-bottom: 0.5rem;
}

.article-card h3 a {
    color: var(--text);
    text-decoration: none;
}

.article-card h3 a:hover {
    color: var(--primary);
}

.article-meta {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.article-excerpt {
    color: var(--text-light);
}

/* Footer */
footer {
    background: var(--text);
    color: white;
    padding: 3rem 2rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.footer-links h4 {
    margin-bottom: 1rem;
    font-size: 1rem;
}

.footer-links ul {
    list-style: none;
}

.footer-links a {
    color: #d1d5db;
    text-decoration: none;
    display: block;
    padding: 0.25rem 0;
}

.footer-links a:hover {
    color: white;
}

.footer-copyright {
    grid-column: 1 / -1;
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #374151;
    color: #9ca3af;
}

/* Article Page */
.article-content {
    max-width: 800px;
    margin: 0 auto;
}

.article-content h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.article-content h2 {
    font-size: 1.5rem;
    margin: 2rem 0 1rem;
}

.article-content h3 {
    font-size: 1.25rem;
    margin: 1.5rem 0 0.75rem;
}

.article-content p {
    margin-bottom: 1rem;
}

.article-content ul, .article-content ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.article-content li {
    margin-bottom: 0.5rem;
}

.article-content blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 1rem;
    margin: 1.5rem 0;
    color: var(--text-light);
    font-style: italic;
}

.article-content code {
    background: var(--bg-light);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
}

.article-content pre {
    background: var(--text);
    color: white;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.article-content th, .article-content td {
    border: 1px solid var(--border);
    padding: 0.75rem;
    text-align: left;
}

.article-content th {
    background: var(--bg-light);
}

/* Calculator */
.calculator {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
}

.calculator h3 {
    margin-bottom: 1rem;
}

.calculator input, .calculator select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.calculator button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.calculator button:hover {
    background: var(--primary-dark);
}

.calculator .result {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

/* ============ ARTICLE DESIGN SYSTEM v2 ============ */

/* Table of Contents */
.toc {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem 2rem;
    margin: 2rem 0;
}

.toc h2 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.toc ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.toc li {
    margin-bottom: 0.4rem;
}

.toc a {
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px dotted var(--border);
    transition: color 0.2s;
}

.toc a:hover {
    color: var(--primary);
}

/* Callout boxes */
.callout {
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
    border-left: 4px solid;
}

.callout-info {
    background: #eff6ff;
    border-color: var(--primary);
}

.callout-tip {
    background: #ecfdf5;
    border-color: var(--secondary);
}

.callout-warn {
    background: #fffbeb;
    border-color: #f59e0b;
}

.callout-danger {
    background: #fef2f2;
    border-color: #ef4444;
}

.callout strong {
    display: block;
    margin-bottom: 0.25rem;
}

/* Step cards */
.step-list {
    counter-reset: step;
    margin: 1.5rem 0;
}

.step-card {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    position: relative;
    padding-left: 3.5rem;
}

.step-card::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 1rem;
    top: 1.25rem;
    width: 1.75rem;
    height: 1.75rem;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.step-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.05rem;
}

.step-card p, .step-card ul {
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

/* Pro/Con columns */
.pros-cons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 1.5rem 0;
}

.pros, .cons {
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
}

.pros {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
}

.cons {
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.pros h3, .cons h3 {
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.pros ul, .cons ul {
    margin: 0;
    padding-left: 1.25rem;
}

/* KPI cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.kpi-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
}

.kpi-card .kpi-value {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.kpi-card .kpi-label {
    font-size: 0.8rem;
    opacity: 0.9;
}

.kpi-card.green {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.kpi-card.orange {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

/* Comparison table */
.table-wrap {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin: 1.5rem 0;
}

.table-wrap table {
    margin: 0;
}

.table-wrap th {
    background: var(--primary);
    color: white;
    border: none;
}

.table-wrap tr:nth-child(even) {
    background: var(--bg-light);
}

/* FAQ accordion */
.faq-item {
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.faq-item summary {
    padding: 1rem 1.5rem;
    cursor: pointer;
    font-weight: 600;
    background: var(--bg-light);
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.faq-item summary:hover {
    background: #f3f4f6;
}

.faq-item summary::after {
    content: '+';
    font-size: 1.25rem;
    color: var(--primary);
}

.faq-item[open] summary::after {
    content: '−';
}

.faq-item .faq-body {
    padding: 1rem 1.5rem;
}

/* CTA block */
.cta-block {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 16px;
    padding: 2.5rem 2rem;
    margin: 2.5rem 0;
    text-align: center;
}

.cta-block h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    color: white;
}

.cta-block p {
    opacity: 0.9;
    margin-bottom: 1.5rem;
}

.cta-block a {
    display: inline-block;
    background: white;
    color: var(--primary);
    padding: 0.9rem 2.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    transition: transform 0.2s, box-shadow 0.2s;
}

.cta-block a:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.cta-block .cta-note {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Related articles */
.related-articles {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 2.5rem;
}

.related-articles h3 {
    margin-bottom: 1rem;
    color: var(--primary);
}

.related-articles ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.related-articles li {
    margin-bottom: 0.5rem;
}

.related-articles a {
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px dotted var(--border);
    transition: color 0.2s;
}

.related-articles a:hover {
    color: var(--primary);
}

/* Article header hero */
.article-hero {
    background: linear-gradient(135deg, #eff6ff 0%, #f0fdf9 100%);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    margin-bottom: 2rem;
    border: 1px solid #dbeafe;
}

.article-hero h1 {
    font-size: 2.25rem;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.article-hero .lead {
    font-size: 1.15rem;
    color: var(--text-light);
    line-height: 1.7;
}

.article-hero .meta-row {
    margin-top: 1rem;
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    color: var(--text-light);
    font-size: 0.875rem;
}

/* Author box */
.author-box {
    display: flex;
    gap: 1rem;
    align-items: center;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    margin: 2rem 0;
}

.author-box .author-avatar {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.author-box .author-name {
    font-weight: 700;
}

.author-box .author-desc {
    color: var(--text-light);
    font-size: 0.875rem;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-blue {
    background: #eff6ff;
    color: var(--primary);
}

.badge-green {
    background: #ecfdf5;
    color: #059669;
}

/* Focus accessibility */
a:focus-visible,
summary:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.5);
    outline-offset: 2px;
    border-radius: 4px;
}

html {
    scroll-behavior: smooth;
}

/* Responsive */
@media (max-width: 1024px) {
    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .site-hero h1 {
        font-size: 2.1rem;
    }
}

@media (max-width: 768px) {
    nav {
        flex-direction: column;
        gap: 1rem;
    }

    nav ul {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    main {
        padding: 1.25rem;
    }

    .site-hero {
        padding: 2.5rem 1.5rem;
    }

    .site-hero h1 {
        font-size: 1.85rem;
    }

    .site-hero .lead {
        font-size: 1.05rem;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        text-align: center;
    }

    .articles-grid {
        grid-template-columns: 1fr;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .pros-cons {
        grid-template-columns: 1fr;
    }

    .article-hero h1 {
        font-size: 1.75rem;
    }

    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .cta-block {
        padding: 2rem 1.25rem;
    }

    .cta-block h3 {
        font-size: 1.3rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .article-content h1 {
        font-size: 1.75rem;
    }

    .toc {
        padding: 1.25rem;
    }
}

@media (max-width: 480px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .site-hero {
        padding: 2rem 1.25rem;
    }

    .site-hero h1 {
        font-size: 1.55rem;
    }

    .article-hero {
        padding: 2rem 1.25rem;
    }

    .article-hero .meta-row {
        gap: 0.6rem;
        flex-direction: column;
        align-items: flex-start;
    }

    .step-card {
        padding-left: 3rem;
    }

    .table-wrap table {
        min-width: 480px;
    }

    nav .logo {
        font-size: 1.3rem;
    }
}

@media print {
    header,
    footer,
    .cta-block,
    .toc,
    .related-articles,
    .hero-actions {
        display: none !important;
    }

    body {
        font-size: 12pt;
    }

    .article-content {
        max-width: 100%;
    }

    a {
        text-decoration: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
        scroll-behavior: auto !important;
    }
}

/* ============================================================
   DARK "LIQUID GLASS" REDESIGN — overrides
   ============================================================ */

:root {
    --primary: #a3e635;
    --primary-dark: #84cc16;
    --secondary: #8b5cf6;
    --text: #e6edf3;
    --text-light: #9aa7b4;
    --bg: #0a0e14;
    --bg-light: #11161f;
    --glass: rgba(255, 255, 255, 0.05);
    --border: rgba(255, 255, 255, 0.09);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    --font-head: 'Manrope', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html {
    scrollbar-color: #2a3342 #0a0e14;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(600px 400px at 15% -80px, rgba(139, 92, 246, 0.16), transparent 70%),
        radial-gradient(700px 420px at 55% -120px, rgba(59, 130, 246, 0.14), transparent 70%),
        radial-gradient(600px 380px at 92% -60px, rgba(163, 230, 53, 0.09), transparent 70%);
    filter: blur(80px);
}

::selection {
    background: #a3e635;
    color: #0a0e14;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: #0a0e14;
}
::-webkit-scrollbar-thumb {
    background: #2a3342;
    border-radius: 6px;
    border: 2px solid #0a0e14;
}
::-webkit-scrollbar-thumb:hover {
    background: #3d4a5e;
}

h1, h2, h3, h4,
.site-hero h1, .article-hero h1, .section-head h2,
.article-card h3, .feature-card h3, .cta-block h3,
.toc h2, .step-card h3, .related-articles h3,
.pros h3, .cons h3, .faq-item summary {
    font-family: var(--font-head);
    color: var(--text);
}

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

/* ---------- Header / nav ---------- */
header {
    background: rgba(10, 14, 20, 0.75);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.logo {
    font-family: var(--font-head);
    background: linear-gradient(90deg, #a3e635, #3b82f6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

nav a {
    color: var(--text-light);
}

nav a:hover {
    color: var(--primary);
}

nav a.active {
    color: var(--primary);
    font-weight: 600;
}

/* ---------- Hero ---------- */
.site-hero {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.12) 0%, rgba(59, 130, 246, 0.10) 50%, rgba(163, 230, 53, 0.06) 100%);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 20px;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.site-hero .lead,
.article-hero .lead {
    color: var(--text-light);
}

/* ---------- Buttons ---------- */
.btn {
    font-family: var(--font-head);
    font-weight: 700;
    transition: transform 0.25s, box-shadow 0.25s, background 0.25s, color 0.25s, border-color 0.25s;
}

.btn-primary {
    background: linear-gradient(135deg, #a3e635, #84cc16);
    color: #0a0e14;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(163, 230, 53, 0.35);
}

.btn-outline {
    background: rgba(255, 255, 255, 0.04);
    color: var(--primary);
    border: 1px solid rgba(163, 230, 53, 0.55);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.btn-outline:hover {
    background: rgba(163, 230, 53, 0.12);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(163, 230, 53, 0.18);
}

/* ---------- Cards ---------- */
.feature-card, .article-card, .tool-card,
.calculator, .toc, .step-card, .related-articles,
.author-box, .faq-item, .related-block {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 16px;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    color: var(--text);
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}

.feature-card:hover, .article-card:hover, .tool-card:hover {
    transform: translateY(-4px);
    border-color: rgba(163, 230, 53, 0.45);
    box-shadow: 0 8px 32px rgba(163, 230, 53, 0.15), var(--shadow);
}

.feature-card .feature-icon {
    background: rgba(163, 230, 53, 0.12);
}

.feature-card p, .tool-card p,
.article-card .article-excerpt, .article-excerpt, .article-meta {
    color: var(--text-light);
}

.article-card h3 a, .tool-card h3 a {
    color: var(--text);
}

.article-card h3 a:hover {
    color: var(--primary);
}

.tool-card h3 a:hover {
    color: var(--primary);
}

.section-head p {
    color: var(--text-light);
}

/* ---------- Article content ---------- */
.article-content h1, .article-content h2, .article-content h3 {
    color: var(--text);
}

.article-content p, .article-content li {
    color: #d6dee8;
}

.article-content a {
    color: var(--primary);
}

.article-content blockquote {
    border-left-color: var(--primary);
    color: var(--text-light);
    background: rgba(255, 255, 255, 0.03);
    padding: 0.75rem 1rem;
    border-radius: 0 10px 10px 0;
}

.article-content code {
    background: rgba(255, 255, 255, 0.08);
    color: #a5f3a5;
}

.article-content pre {
    background: #0d1117;
    border: 1px solid var(--border);
    color: #d6dee8;
}

.article-content th {
    background: linear-gradient(135deg, #1a2233, #141b28);
    color: var(--text);
}

.article-content td {
    border-color: rgba(255, 255, 255, 0.08);
}

.article-content th {
    border-color: rgba(255, 255, 255, 0.10);
}

/* ---------- Calculator ---------- */
.calculator input, .calculator select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 10px;
}

.calculator input:focus, .calculator select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(163, 230, 53, 0.15);
}

.calculator button {
    background: linear-gradient(135deg, #a3e635, #84cc16);
    color: #0a0e14;
    font-family: var(--font-head);
    font-weight: 700;
    border-radius: 50px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.calculator button:hover {
    background: linear-gradient(135deg, #b5f34d, #a3e635);
    box-shadow: 0 8px 24px rgba(163, 230, 53, 0.3);
    transform: translateY(-2px);
}

.calculator .result {
    background: rgba(163, 230, 53, 0.07);
    border: 1px solid rgba(163, 230, 53, 0.3);
    color: var(--text);
}

/* ---------- TOC ---------- */
.toc h2 {
    color: var(--primary);
}

.toc a {
    color: var(--text-light);
    border-bottom: 1px dotted rgba(255, 255, 255, 0.15);
}

.toc a:hover {
    color: var(--primary);
}

.toc li::marker {
    color: var(--primary);
}

/* ---------- Callouts ---------- */
.callout {
    background: rgba(255, 255, 255, 0.04);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    color: var(--text);
}

.callout-info {
    background: rgba(59, 130, 246, 0.10);
    border-color: #3b82f6;
}

.callout-tip {
    background: rgba(163, 230, 53, 0.08);
    border-color: var(--primary);
}

.callout-warn {
    background: rgba(245, 158, 11, 0.10);
    border-color: #f59e0b;
}

.callout-danger {
    background: rgba(239, 68, 68, 0.10);
    border-color: #ef4444;
}

/* ---------- Steps ---------- */
.step-card {
    transition: border-color 0.25s, box-shadow 0.25s;
}

.step-card:hover {
    border-color: rgba(163, 230, 53, 0.4);
}

.step-card::before {
    background: linear-gradient(135deg, #a3e635, #84cc16);
    color: #0a0e14;
    box-shadow: 0 0 16px rgba(163, 230, 53, 0.35);
}

/* ---------- Pros / Cons ---------- */
.pros {
    background: rgba(163, 230, 53, 0.07);
    border: 1px solid rgba(163, 230, 53, 0.25);
}

.cons {
    background: rgba(239, 68, 68, 0.07);
    border: 1px solid rgba(239, 68, 68, 0.28);
}

.pros, .cons {
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

/* ---------- KPI ---------- */
.kpi-card {
    background: linear-gradient(135deg, #6366f1, #8b5cf6, #3b82f6);
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(99, 102, 241, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.kpi-card.green {
    background: linear-gradient(135deg, rgba(163, 230, 53, 0.18), rgba(132, 204, 22, 0.10));
    border: 1px solid rgba(163, 230, 53, 0.35);
    box-shadow: 0 12px 32px rgba(163, 230, 53, 0.12);
    color: var(--text);
}

.kpi-card.orange {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(217, 119, 6, 0.10));
    border: 1px solid rgba(245, 158, 11, 0.35);
    box-shadow: 0 12px 32px rgba(245, 158, 11, 0.12);
    color: var(--text);
}

.kpi-card .kpi-value {
    font-family: var(--font-head);
}

/* ---------- Tables ---------- */
.table-wrap {
    border-color: var(--border);
    background: rgba(255, 255, 255, 0.03);
}

.table-wrap th {
    background: linear-gradient(135deg, #1a2233, #141b28);
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.10);
}

.table-wrap td {
    border-color: rgba(255, 255, 255, 0.07);
}

.table-wrap tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.03);
}

/* ---------- FAQ ---------- */
.faq-item summary {
    background: transparent;
    color: var(--text);
}

.faq-item summary:hover {
    background: rgba(255, 255, 255, 0.04);
}

.faq-item summary::after {
    color: var(--primary);
}

.faq-item .faq-body {
    color: #d6dee8;
}

/* ---------- CTA ---------- */
.cta-block {
    background: linear-gradient(135deg, #3b82f6, #6366f1 45%, #8b5cf6);
    box-shadow: 0 20px 60px rgba(99, 102, 241, 0.30);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.cta-block h3 {
    color: #fff;
}

.cta-block a {
    background: linear-gradient(135deg, #a3e635, #84cc16);
    color: #0a0e14;
}

.cta-block a:hover {
    box-shadow: 0 10px 30px rgba(163, 230, 53, 0.45);
}

.cta-block .cta-note {
    color: rgba(255, 255, 255, 0.75);
}

/* ---------- Related / author / hero ---------- */
.related-articles a, .related-list a {
    color: var(--text-light);
    border-bottom: 1px dotted rgba(255, 255, 255, 0.15);
}

.related-articles a:hover, .related-list a:hover {
    color: var(--primary);
}

.related-articles h3 {
    color: var(--primary);
}

.article-hero {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.10), rgba(59, 130, 246, 0.08));
    border: 1px solid rgba(255, 255, 255, 0.10);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.article-hero .meta-row {
    color: var(--text-light);
}

.author-box .author-avatar {
    background: linear-gradient(135deg, #a3e635, #3b82f6);
    color: #0a0e14;
}

.author-box .author-desc {
    color: var(--text-light);
}

/* ---------- Badges ---------- */
.badge-blue {
    background: rgba(59, 130, 246, 0.15);
    color: #7db3f8;
    border: 1px solid rgba(59, 130, 246, 0.35);
}

.badge-green {
    background: rgba(163, 230, 53, 0.12);
    color: var(--primary);
    border: 1px solid rgba(163, 230, 53, 0.35);
}

/* ---------- Footer ---------- */
footer {
    background: #080b10;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-light);
}

.footer-grid .footer-about p, .footer-copyright {
    color: var(--text-light);
}

.footer-grid h4, .footer-links h4 {
    color: var(--text);
}

.footer-grid a, .footer-links a {
    color: var(--text-light);
    transition: color 0.2s;
}

.footer-grid a:hover, .footer-links a:hover {
    color: var(--primary);
}

.footer-copyright {
    border-top-color: rgba(255, 255, 255, 0.08);
}

/* ---------- Focus ---------- */
a:focus-visible,
summary:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 3px solid rgba(163, 230, 53, 0.55);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ---------- Print ---------- */
@media print {
    body, .site-hero, .article-hero, .article-card, .feature-card,
    .callout, .calculator, .kpi-card, .step-card, .faq-item,
    .pros, .cons, .author-box {
        background: #ffffff !important;
        color: #111111 !important;
        border-color: #cccccc !important;
        box-shadow: none !important;
    }

    h1, h2, h3, h4, .article-content p, .article-content li,
    .site-hero .lead, .article-hero .lead, .article-content a {
        color: #111111 !important;
    }
}

/* ---------- Dashboard utility classes (used in dashboard/content pages) ---------- */
.stat-card {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}

.stat-card:hover {
    transform: translateY(-3px);
    border-color: rgba(163, 230, 53, 0.4);
    box-shadow: 0 8px 32px rgba(163, 230, 53, 0.12);
}

.stat-card .value {
    font-family: var(--font-head);
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(90deg, #a3e635, #3b82f6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-card .label {
    color: var(--text-light);
    font-size: 0.875rem;
}

.quality-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
}

.quality-fill {
    height: 100%;
    background: linear-gradient(90deg, #a3e635, #3b82f6);
}

.related-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.related-list li {
    margin-bottom: 0.5rem;
}

.related-block {
    margin: 2rem 0;
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
}

/* ============================================================
   LIQUID GLASS v3.1 — точная имитация референсов
   (глянец, цветные кромки, glow-тени, больше воздуха)
   ============================================================ */

:root {
    --lime: #a3e635;
    --lime-dim: rgba(163, 230, 53, 0.5);
    --grad-i: linear-gradient(135deg, #6366f1, #8b5cf6, #3b82f6);
    --grad-lime: linear-gradient(135deg, #a3e635, #84cc16);
}

/* --- Фон: глубже, «дальше» свечения --- */
body {
    background: #080b10;
}
body::before {
    background:
        radial-gradient(700px 460px at 12% -140px, rgba(139, 92, 246, 0.22), transparent 72%),
        radial-gradient(800px 480px at 52% -180px, rgba(59, 130, 246, 0.18), transparent 72%),
        radial-gradient(700px 440px at 90% -120px, rgba(163, 230, 53, 0.13), transparent 72%);
    filter: blur(90px);
}

/* --- Типографика и ритм: крупнее, светлее, шире интерлиньяж --- */
.article-content h1, .site-hero h1, .article-hero h1 {
    letter-spacing: -0.02em;
}
.article-content { line-height: 1.75; }
.article-content p { margin-bottom: 1.25rem; }
.article-content h2 { margin-top: 2.75rem; }
.article-content h3 { margin-top: 2rem; }

/* --- Базовая карточка: стекло + глянец сверху + лёгкая внутренняя тень --- */
.feature-card, .article-card, .tool-card, .stat-card,
.calculator, .toc, .step-card, .faq-item,
.related-articles, .author-box,
.article-hero, .site-hero {
    position: relative;
    background: linear-gradient(160deg, rgba(255,255,255,0.055), rgba(255,255,255,0.02) 45%, rgba(255,255,255,0.03));
    border: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.07) inset,           /* верхний блик-кромка */
        0 10px 24px rgba(0, 0, 0, 0.35),
        0 2px 8px rgba(0, 0, 0, 0.25);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}
/* Глянцевый блик сверху у «стекла» */
.feature-card, .article-card, .tool-card, .stat-card,
.calculator, .toc, .faq-item,
.related-articles, .author-box,
.article-hero, .site-hero,
.kpi-card, .cta-block {
    overflow: hidden;
}
.feature-card::after, .article-card::after, .tool-card::after, .stat-card::after,
.calculator::after, .toc::after, .faq-item::after,
.related-articles::after, .author-box::after,
.article-hero::after, .site-hero::after,
.kpi-card::after, .cta-block::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
    pointer-events: none;
}

/* Hover — карточка «подсвечивается» изнутри акцентом */
.feature-card:hover, .article-card:hover, .tool-card:hover, .stat-card:hover {
    border-color: rgba(163, 230, 53, 0.55);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.09) inset,
        0 16px 40px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(163, 230, 53, 0.15) inset,
        0 8px 32px rgba(163, 230, 53, 0.16);
    transform: translateY(-5px);
}

/* --- Кнопки: пилюли-«стекло» с градиентным свечением --- */
.btn,
.calculator button,
.cta-block a {
    border-radius: 999px;
    letter-spacing: 0.01em;
}

.btn-primary,
.calculator button,
.cta-block a {
    background: var(--grad-lime);
    color: #07101a;
    box-shadow:
        0 1px 0 rgba(255,255,255,0.35) inset,
        0 0 0 1px rgba(255,255,255,0.08) inset,
        0 10px 30px rgba(163, 230, 53, 0.25);
}
.btn-primary:hover,
.calculator button:hover,
.cta-block a:hover {
    box-shadow:
        0 1px 0 rgba(255,255,255,0.45) inset,
        0 0 0 1px rgba(255,255,255,0.10) inset,
        0 14px 40px rgba(163, 230, 53, 0.45),
        0 0 24px rgba(163, 230, 53, 0.30);
    transform: translateY(-2px);
}

.btn-outline {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(163, 230, 53, 0.5);
    color: var(--primary);
    box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset;
}
.btn-outline:hover {
    background: rgba(163, 230, 53, 0.10);
    box-shadow:
        0 1px 0 rgba(255,255,255,0.09) inset,
        0 0 20px rgba(163, 230, 53, 0.20) inset,
        0 8px 24px rgba(163, 230, 53, 0.18);
}

/* --- Hero: многослойное стекло с цветными кромками сверху --- */
.site-hero, .article-hero {
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
        0 1px 0 rgba(255,255,255,0.08) inset,
        0 24px 70px rgba(0, 0, 0, 0.45);
}
.site-hero {
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(139, 92, 246, 0.16) 0%, transparent 48%),
        radial-gradient(120% 140% at 100% 0%, rgba(59, 130, 246, 0.14) 0%, transparent 48%),
        linear-gradient(160deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
}
.article-hero {
    background:
        radial-gradient(120% 130% at 50% 0%, rgba(59, 130, 246, 0.12) 0%, transparent 55%),
        linear-gradient(160deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
}

/* --- KPI: градиентное стекло с цветной верхней кромкой и свечением --- */
.kpi-card {
    background: var(--grad-i);
    box-shadow:
        0 1px 0 rgba(255,255,255,0.18) inset,
        0 16px 44px rgba(99, 102, 241, 0.32);
    border: 1px solid rgba(255, 255, 255, 0.18);
}
.kpi-card.green {
    background: var(--grad-lime);
    color: #07101a;
    box-shadow:
        0 1px 0 rgba(255,255,255,0.30) inset,
        0 16px 44px rgba(163, 230, 53, 0.28);
    border: 1px solid rgba(255,255,255,0.20);
}
.kpi-card.green .kpi-label { color: rgba(7,16,26,0.72); }
.kpi-card.orange {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow:
        0 1px 0 rgba(255,255,255,0.22) inset,
        0 16px 44px rgba(245, 158, 11, 0.25);
}
/* переливающаяся верхняя кромка у KPI */
.kpi-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.55), transparent);
}

/* --- CTA: многослойное градиентное стекло с глубоким свечением --- */
.cta-block {
    background:
        radial-gradient(140% 120% at 50% 0%, rgba(139, 92, 246, 0.35) 0%, transparent 55%),
        linear-gradient(135deg, #3b82f6, #6366f1 40%, #8b5cf6 80%, #3b82f6);
    box-shadow:
        0 1px 0 rgba(255,255,255,0.20) inset,
        0 30px 80px rgba(99, 102, 241, 0.40),
        0 0 60px rgba(139, 92, 246, 0.18);
}

/* --- Step-card: номер-кружок со свечением, легче карточка --- */
.step-card::before {
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.20) inset,
        0 0 18px rgba(163, 230, 53, 0.45);
    background: var(--grad-lime);
}
.step-card:hover {
    border-color: rgba(163, 230, 53, 0.5);
    box-shadow: 0 8px 24px rgba(163, 230, 53, 0.10);
}

/* --- Поиск/инпуты: глубокое стекло, фокус-глоу --- */
.calculator input, .calculator select {
    background: rgba(255, 255, 255, 0.045);
    box-shadow: 0 1px 0 rgba(255,255,255,0.05) inset;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.calculator input:focus, .calculator select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(163, 230, 53, 0.16),
                0 1px 0 rgba(255,255,255,0.06) inset;
}

/* --- Чипсы/бейджи: стекло с кромкой --- */
.badge {
    box-shadow: 0 1px 0 rgba(255,255,255,0.08) inset;
    backdrop-filter: blur(8px);
}

/* --- Таблицы: header со стеклом, строки — лайм на hover --- */
.table-wrap th {
    background: linear-gradient(135deg, rgba(99,102,241,0.55), rgba(139,92,246,0.45));
    backdrop-filter: blur(8px);
}
.table-wrap tr:hover td {
    background: rgba(163, 230, 53, 0.05);
}

/* --- Логотип: шире свечение градиента --- */
.logo {
    text-shadow: 0 0 24px rgba(163, 230, 53, 0.25);
}

/* --- Доп. «воздуха» главной --- */
main { padding-top: 2.5rem; }

/* FIX: <nav class="toc"> наследует базовый стиль nav {display:flex} — возвращаем block */
.toc,
.toc ul,
.toc li {
    display: block;
    float: none;
}
.toc {
    max-width: none;
}

/* --- «Жидкое стекло»: анимированный блик при hover на кнопки --- */
.btn, .calculator button, .cta-block a {
    position: relative;
    overflow: hidden;
}
.btn::before, .calculator button::before, .cta-block a::before {
    content: '';
    position: absolute;
    top: 0; left: -80%;
    width: 60%; height: 100%;
    background: linear-gradient(105deg, transparent, rgba(255,255,255,0.35), transparent);
    transform: skewX(-18deg);
    transition: none;
    pointer-events: none;
}
.btn:hover::before, .calculator button:hover::before, .cta-block a:hover::before {
    animation: liquid-shine 0.7s ease;
}
@keyframes liquid-shine {
    from { left: -80%; }
    to   { left: 140%; }
}
@media (prefers-reduced-motion: reduce) {
    .btn:hover::before, .calculator button:hover::before, .cta-block a:hover::before {
        animation: none;
    }
}

/* ============================================================
   Прогресс-бар чтения страницы (лента сверху)
   Дизайн-стиль: тонкая неоновая лента с градиентом + glow,
   поверх sticky-header. Работает без JS (ширина управляется
   через documentElement.style.setProperty из прогресс-скрипта
   либо inline script в страницах с "= 0 и заполнением на скролл).
   ============================================================ */

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.06);
    z-index: 9999;
    pointer-events: none;
}

.scroll-progress__fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6 35%, #a3e635 100%);
    box-shadow:
        0 0 8px rgba(163, 230, 53, 0.55),
        0 0 16px rgba(139, 92, 246, 0.35);
    border-radius: 0 3px 3px 0;
    transition: width 0.08s linear;
    will-change: width;
}

/* Лента залезает на высоту sticky header — поднимем липкий header чуть ниже */
header {
    top: 3px;
}

@media (prefers-reduced-motion: reduce) {
    .scroll-progress__fill {
        transition: none;
    }
}

@media print {
    .scroll-progress { display: none !important; }
}

/* ============================================================
   КОМПАКТНАЯ МОБИЛЬНАЯ ШАПКА + «Наверх» + фикс прогресс-бара
   ============================================================ */

/* --- Header: по умолчанию уже компактнее --- */
header {
    padding: 0;
}
nav {
    padding: 0.6rem 1.5rem;  /* было 1rem 2rem */
    max-width: 1280px;
}
.logo {
    font-size: 1.3rem;
}
nav ul {
    gap: 1.5rem;
}
nav a {
    font-size: 0.94rem;
}

/* --- Мобильная шапка: одна строка, горизонтальный скролл ссылок --- */
@media (max-width: 768px) {
    nav {
        flex-direction: row;              /* было column — высота падала вдвое */
        flex-wrap: nowrap;
        align-items: center;
        gap: 0.75rem;
        padding: 0.55rem 1rem;
    }
    .logo {
        flex-shrink: 0;
        font-size: 1.15rem;
    }
    nav ul {
        display: flex;
        gap: 1rem;
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;          /* скрыть скролл */
        -webkit-overflow-scrolling: touch;
        flex: 1;
        justify-content: flex-end;
        margin: 0;
        padding: 0;
    }
    nav ul::-webkit-scrollbar { display: none; }
    nav ul li { white-space: nowrap; }
    nav a {
        font-size: 0.925rem;
    }
    header {
        height: auto;
    }
}

@media (max-width: 480px) {
    nav { padding: 0.5rem 0.75rem; }
    .logo { font-size: 1.05rem; }
    nav ul { gap: 0.75rem; }
    nav a { font-size: 0.875rem; }
}

/* --- Прогресс-бар: выше z-index, pointer-events none, fallback видимости --- */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0; right: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.07);
    z-index: 9999 !important;
    pointer-events: none;
}
.scroll-progress__fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6 40%, #a3e635 90%);
    box-shadow: 0 0 10px rgba(163, 230, 53, 0.6), 0 0 20px rgba(139, 92, 246, 0.4);
    border-radius: 0 3px 3px 0;
    transition: width 0.08s linear;
    will-change: width;
}
/* header sticky сдвигаем под бар */
header { top: 3px; }

/* --- Кнопка «Наверх»: стеклянная, glow, правый нижний угол --- */
.back-to-top {
    position: fixed;
    right: 1.25rem;
    bottom: 1.5rem;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: rgba(15, 20, 29, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.12);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    color: var(--text-light);
    font-size: 1.1rem;
    z-index: 900;
    box-shadow: 0 1px 0 rgba(255,255,255,0.08) inset, 0 8px 24px rgba(0,0,0,0.35);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.3s, transform 0.3s, background 0.2s, color 0.2s, border-color 0.2s;
}
.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.back-to-top:hover {
    background: rgba(163, 230, 53, 0.12);
    border-color: rgba(163, 230, 53, 0.5);
    color: var(--primary);
    box-shadow: 0 0 24px rgba(163, 230, 53, 0.25);
}
.back-to-top:focus-visible {
    outline: 3px solid rgba(163, 230, 53, 0.55);
    outline-offset: 2px;
}

@media print {
    .back-to-top { display: none !important; }
}

/* --- Универсальная адаптивность изображений/iframe/таблиц --- */
.article-content img, .article-content iframe, .article-content video {
    max-width: 100%;
    height: auto;
    display: block;
}
img { max-width: 100%; height: auto; }

/* Таблицы: гарантированный горизонтальный скролл на мобайле */
.table-wrap {
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}
.table-wrap table {
    min-width: 560px;
}
@media (max-width: 640px) {
    .table-wrap table { min-width: 480px; font-size: 0.9rem; }
}

/* Статья на очень узких экранах */
@media (max-width: 480px) {
    .article-content { padding: 0 0.25rem; }
    .article-content h1 { font-size: 1.6rem; }
    .article-content h2 { font-size: 1.4rem; margin-top: 2.25rem; }
    .article-content h3 { font-size: 1.15rem; margin-top: 1.75rem; }
    .article-content p, .article-content li { font-size: 0.96rem; }
    .article-hero { padding: 1.5rem 1.1rem; border-radius: 12px; }
    .toc { padding: 1rem 1.1rem; }
    .callout, .step-card, .kpi-card { padding: 1rem; }
    .cta-block { padding: 1.5rem 1rem; }
    .cta-block h3 { font-size: 1.2rem; }
    .pros-cons { gap: 0.75rem; }
    .pros, .cons { padding: 1rem; }
}

/* Очень узкие (<360px): ещё плотнее шапка */
@media (max-width: 360px) {
    nav { padding: 0.4rem 0.5rem; gap: 0.5rem; }
    .logo { font-size: 1rem; }
    nav a { font-size: 0.8rem; }
    nav ul { gap: 0.65rem; }
    main { padding: 0.85rem; }
    h1 { word-break: break-word; }
}

/* ============================================================
   ПРОФЕССИОНАЛЬНАЯ МОБИЛЬНАЯ ШАПКА
   480-768px: компактная однострочная. <=480px: бургер-меню.
   ============================================================ */

/* Бургер-кнопка: по умолчанию скрыта */
.nav-burger {
    display: none;
    flex-shrink: 0;
    width: 2.6rem;
    height: 2.4rem;
    padding: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    cursor: pointer;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
.nav-burger:hover {
    border-color: rgba(163, 230, 53, 0.4);
    background: rgba(163, 230, 53, 0.08);
}
.nav-burger:active { transform: scale(0.96); }
.nav-burger span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.25s, opacity 0.2s, background 0.2s;
}
.nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); background: var(--primary); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); background: var(--primary); }

/* ====== 480-768px: плотная однострочная шапка ====== */
@media (min-width: 481px) and (max-width: 768px) {
    nav {
        padding: 0.5rem 1rem;
        gap: 0.6rem;
    }
    .logo {
        font-size: 1.1rem;
    }
    nav ul {
        gap: 0.85rem;
    }
    nav a {
        font-size: 0.875rem;
        padding: 0.3rem 0.55rem;
        border-radius: 999px;
        white-space: nowrap;
    }
    nav a:hover {
        background: rgba(163, 230, 53, 0.12);
    }
}

/* ====== <=480px: бургер меню ====== */
@media (max-width: 480px) {
    nav {
        padding: 0.5rem 0.75rem;
        gap: 0.6rem;
        position: relative;
    }
    .logo {
        font-size: 1.05rem;
    }
    .nav-burger {
        display: flex;
    }
    nav ul {
        display: none;             /* по умолчанию скрыто */
        position: fixed;
        top: calc(3px + 52px);     /* под прогресс-баром и шапкой */
        left: 0;
        right: 0;
        z-index: 1000;
        flex-direction: column;
        gap: 0;
        background: rgba(10, 14, 20, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        border-top: 1px solid rgba(255, 255, 255, 0.06);
        padding: 0.5rem 0;
        margin: 0;
        overflow: visible;
        justify-content: stretch;
    }
    nav ul.open {
        display: flex;
    }
    nav ul li {
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
    nav ul li:last-child {
        border-bottom: none;
    }
    nav a {
        display: block;
        padding: 0.875rem 1.25rem;
        font-size: 0.96rem;
        text-decoration: none;
        transition: background 0.2s, color 0.2s, padding-left 0.2s;
    }
    nav a:hover {
        background: rgba(163, 230, 53, 0.10);
        color: var(--primary);
        padding-left: 1.5rem;
    }
    /* Быстрые ссылки в шапке между logo и бургером — скрываем на узком */
    nav > ul > li {
        /* видимо, т.к. в выпадающем меню */
    }
}

/* ====== <=360px ====== */
@media (max-width: 360px) {
    nav { padding: 0.45rem 0.5rem; }
    .logo { font-size: 0.95rem; }
    .nav-burger { width: 2.35rem; height: 2.2rem; }
    .nav-burger span { width: 16px; }
    .nav-burger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
    .nav-burger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
    nav ul {
        top: calc(3px + 46px);
    }
    nav a { font-size: 0.9rem; padding: 0.8rem 1rem; }
}

/* --- Perfect alignment of burger+logo inside nav on mobile --- */
@media (max-width: 768px) {
    nav {
        justify-content: space-between;
    }
    nav ul {
        /* keep items centered vertically, don't squeeze */
        align-items: center;
    }
}
/* links clickable without bleed in collapsed state */
nav ul#nav-menu a { color: var(--text-light); }
nav ul#nav-menu a:hover { color: var(--primary); }

/* Мобильное меню: прочный непрозрачный фон (читабельность важнее эффекта) */
@media (max-width: 480px) {
    nav ul {
        background: #0d1117;
        border-bottom: 1px solid rgba(255, 255, 255, 0.14);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.55);
    }
}
@media (max-width: 360px) {
    nav ul { background: #0d1117; }
}

/* ============================================================
   ПОЛЕ ПРИТЯЖЕНИЯ SEO МАГНИТ — аудитория прибывает
   ============================================================ */

.live-signal {
    position: relative;
    margin-bottom: 2rem;
    border-radius: 20px;
    overflow: hidden;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02) 55%, rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(148, 163, 184, 0.18);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.09),
        inset 0 -1px 0 rgba(0, 0, 0, 0.4),
        0 20px 60px rgba(0, 0, 0, 0.4);
}

.live-signal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 8%;
    right: 8%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.6), rgba(232, 121, 249, 0.5), transparent);
    pointer-events: none;
    z-index: 1;
}

/* --- Верхняя панель: статус слева, частота поля справа --- */
.live-signal__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.7rem 1.15rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.02);
}

.live-signal__status {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
}

.live-signal__pulse {
    position: relative;
    width: 9px;
    height: 9px;
    flex-shrink: 0;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 10px 2px rgba(52, 211, 153, 0.55);
}

.live-signal__pulse::after {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    border: 1.5px solid rgba(52, 211, 153, 0.5);
    animation: live-ping 1.9s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes live-ping {
    0%        { transform: scale(0.4); opacity: 0.9; }
    75%, 100% { transform: scale(1.9); opacity: 0; }
}

.live-signal__label {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text);
    white-space: nowrap;
}

.live-signal__readout {
    position: relative;
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    font-family: ui-monospace, 'Cascadia Mono', 'JetBrains Mono', Consolas, 'SF Mono', monospace;
    font-variant-numeric: tabular-nums;
    user-select: none;
    flex-shrink: 0;
}

.live-signal__readout-label {
    font-family: var(--font-head);
    font-size: 0.56rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-light);
}

.live-signal__cta {
    display: inline-block;
    font-size: clamp(1.15rem, 3.2vw, 1.45rem);
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #4cd08a;
    text-decoration: none;
    text-shadow: 0 0 18px rgba(76, 208, 138, 0.35);
    will-change: transform;
    cursor: pointer;
}

.live-signal__cta:hover {
    color: #6ae3a3;
    text-shadow: 0 0 24px rgba(76, 208, 138, 0.6);
}

.live-signal__cta:focus-visible {
    outline: 2px solid #22d3ee;
    outline-offset: 2px;
    border-radius: 4px;
}

.live-signal__unit {
    font-family: var(--font-head);
    font-size: 0.56rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-light);
}

/* Всплытие «+N» — сколько читателей притянуто за этот всплеск */
.ekg-delta {
    position: absolute;
    left: calc(100% + 0.15rem);
    top: -0.35rem;
    font-family: var(--font-head);
    font-size: 0.7rem;
    font-weight: 700;
    color: #7ef0b0;
    text-shadow: 0 0 10px rgba(126, 240, 176, 0.6);
    opacity: 0;
    pointer-events: none;
}

.ekg-delta.pop {
    animation: ekg-delta-pop 0.85s ease-out;
}

@keyframes ekg-delta-pop {
    0%   { opacity: 0; transform: translateY(8px); }
    18%  { opacity: 1; }
    100% { opacity: 0; transform: translateY(-8px); }
}

/* --- Экран поля: космос, сетка притяжения, свечение --- */
.ekg-screen {
    position: relative;
    height: clamp(96px, 13vw, 150px);
    overflow: hidden;
    background-color: #070a14;
    background-image:
        radial-gradient(60% 90% at 50% 0%, rgba(34, 211, 238, 0.10), transparent 70%),
        radial-gradient(50% 80% at 85% 100%, rgba(232, 121, 249, 0.09), transparent 70%),
        linear-gradient(rgba(129, 140, 248, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(129, 140, 248, 0.06) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 100% 12.5%, 10% 100%;
}

.ekg-screen::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(130% 140% at 50% 45%, transparent 52%, rgba(0, 0, 0, 0.5) 100%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 30%);
}

/* Расходящиеся кольца — волны притяжения */
.ekg-rings {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

html.js .ekg-ring {
    position: absolute;
    left: 50%;
    top: 55%;
    width: 96px;
    height: 96px;
    margin: -48px 0 0 -48px;
    border-radius: 50%;
    border: 1px solid rgba(76, 208, 138, 0.55);
    opacity: 0;
    animation: ekg-ring 2.4s cubic-bezier(0, 0, 0.3, 1) infinite;
    will-change: transform, opacity;
}

.ekg-ring--1 { animation-delay: 0s; }
.ekg-ring--2 { animation-delay: 0.8s; }
.ekg-ring--3 { animation-delay: 1.6s; }

@keyframes ekg-ring {
    0%   { transform: scale(0.35); opacity: 0.55; }
    70%  { opacity: 0.18; }
    100% { transform: scale(2.4); opacity: 0; }
}

.ekg-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

/* Фантомная линия (весь комплекс, приглушён) */
.ekg-base {
    fill: none;
    stroke: url(#ekg-grad);
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-opacity: 0.12;
}

/* Дешёвое свечение без feGaussianBlur: два halo-слоя, синхронных с развёрткой */
.ekg-halo {
    fill: none;
    stroke: url(#ekg-grad);
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ekg-halo--wide {
    stroke-width: 7;
    stroke-opacity: 0.14;
}

.ekg-halo--thin {
    stroke-width: 4.5;
    stroke-opacity: 0.26;
}

/* Непрерывный поток по линии — «живое» притяжение аудитории */
.ekg-flow {
    fill: none;
    stroke: url(#ekg-grad);
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-opacity: 0.6;
    stroke-dasharray: 14 22;
    animation: ekg-flow 1.4s linear infinite;
    will-change: stroke-dashoffset;
}

@keyframes ekg-flow {
    from { stroke-dashoffset: 0; }
    to   { stroke-dashoffset: -36; }
}

/* Активная линия развёртки (рисуется слева направо) */
.ekg-sweep {
    fill: none;
    stroke: url(#ekg-grad);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-opacity: 1;
}

/* Точка на фронте волны + след позади (JS через transform) */
.ekg-dot,
.ekg-trail {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 50%;
    pointer-events: none;
    will-change: transform;
}

html.js .ekg-dot,
html.js .ekg-trail {
    display: block;
}

.ekg-dot {
    width: 10px;
    height: 10px;
    background: radial-gradient(circle at 38% 38%, #ffffff, #c9f7dc 40%, #4cd08a 75%);
    box-shadow:
        0 0 8px 2px rgba(76, 208, 138, 0.95),
        0 0 20px 6px rgba(76, 208, 138, 0.5),
        0 0 44px 16px rgba(34, 211, 238, 0.25);
}

.ekg-trail--1 {
    width: 8px;
    height: 8px;
    background: rgba(76, 208, 138, 0.5);
    box-shadow: 0 0 12px 3px rgba(76, 208, 138, 0.4);
}

.ekg-trail--2 {
    width: 6px;
    height: 6px;
    background: rgba(34, 211, 238, 0.45);
    box-shadow: 0 0 10px 3px rgba(34, 211, 238, 0.35);
}

/* Частицы-читатели — влетают с краёв и поглощаются волной в момент всплеска */
html.js .ekg-reader {
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #7ef0b0;
    box-shadow: 0 0 8px 2px rgba(126, 240, 176, 0.7);
    pointer-events: none;
    visibility: hidden;
    will-change: transform;
}

/* --- Фид: «что именно притянуло» — реальные статьи --- */
.live-signal__feed {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 0.45rem;
    row-gap: 0.15rem;
    padding: 0.45rem 1.15rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.015);
    font-size: 0.7rem;
}

.live-signal__feed-label {
    font-family: var(--font-head);
    font-size: 0.56rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-light);
}

.live-signal__feed-link {
    color: var(--text-light);
    text-decoration: none;
    opacity: 0.45;
    transition: opacity 0.3s ease, color 0.3s ease;
}

html.js .live-signal__feed-link.is-live {
    opacity: 1;
    color: #e6edf3;
}

.live-signal__feed-link:hover {
    color: var(--primary);
    opacity: 1;
}

/* --- Нижняя плашка: посыл проекта --- */
.live-signal__caption {
    padding: 0.55rem 1.15rem 0.7rem;
    text-align: center;
    font-family: var(--font-head);
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--text-light);
    text-wrap: balance;
    max-width: 26em;
    margin-inline: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
}

.live-signal__caption-accent {
    color: var(--primary);
    font-weight: 700;
}

/* Без JS: линия видна, точка и кольца скрыты */
html:not(.js) .ekg-sweep { stroke-opacity: 0.55; }

/* Скринридер: скрытый анонс притянутых читателей */
.live-signal__sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* --- Мобильная подгонка --- */
@media (max-width: 599px) {
    .live-signal {
        margin-bottom: 1.5rem;
        border-radius: 16px;
    }
    .live-signal__bar {
        flex-wrap: wrap;
        gap: 0.35rem 0.85rem;
        padding: 0.6rem 0.85rem;
    }
    .live-signal__status {
        flex: 1 1 auto;
        min-width: 0;
    }
    .live-signal__label {
        white-space: normal;
        line-height: 1.25;
    }
    .live-signal__readout {
        flex: 0 0 auto;
        margin-left: auto;
        max-width: 100%;
    }
    .live-signal__cta {
        font-size: clamp(1.15rem, 4.5vw, 1.35rem);
    }
    .live-signal__feed {
        padding: 0.4rem 0.85rem;
        font-size: 0.66rem;
    }
    .ekg-delta {
        left: auto;
        right: calc(100% + 0.15rem);
    }
}

/* --- Доступность: без анимаций — статичный снимок поля --- */
@media (prefers-reduced-motion: reduce) {
    .live-signal__pulse::after { animation: none; }
    .ekg-flow { animation: none; stroke-opacity: 0; }
    html.js .ekg-ring { animation: none; opacity: 0.1; }
    html.js .ekg-reader { visibility: hidden; }
    .ekg-delta.pop { animation: none; opacity: 0; }
    .live-signal__feed-link { transition: none; }
    .live-signal__cta { text-shadow: none; will-change: auto; }
    html.js .ekg-dot, html.js .ekg-trail { box-shadow: none; }
}

@media (prefers-reduced-data: reduce) {
    .ekg-screen { background-image: none; }
    .live-signal__cta { text-shadow: none; }
    .ekg-halo { stroke-opacity: 0; }
}
