:root {
    --bg-primary: #0a0f1a;
    --bg-secondary: #111827;
    --bg-card: #1a2035;
    --bg-card-hover: #1f2a42;
    --color-accent: #00b4d8;
    --color-accent-dark: #0096b7;
    --color-accent-glow: rgba(0, 180, 216, 0.15);
    --color-text: #e2e8f0;
    --color-text-muted: #94a3b8;
    --color-text-heading: #f1f5f9;
    --color-border: #1e293b;
    --color-success: #10b981;
    --color-danger: #ef4444;
    --color-warning: #f59e0b;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --transition: 0.25s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font-main);
    background: var(--bg-primary);
    color: var(--color-text);
    line-height: 1.7;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--color-accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-accent-dark); }

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.text-muted { color: var(--color-text-muted); }
.articles-empty { text-align: center; grid-column: 1 / -1; }

/* ====== NAVBAR ====== */

.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    background: rgba(10, 15, 26, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
    transition: box-shadow var(--transition);
}
.navbar.scrolled { box-shadow: 0 2px 20px rgba(0, 0, 0, 0.4); }
.navbar .container { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.navbar-brand { font-size: 1.2rem; font-weight: 700; color: var(--color-text-heading); }
.navbar-brand span { color: var(--color-accent); }
.navbar-menu { display: flex; list-style: none; gap: 28px; }
.navbar-menu a { color: var(--color-text-muted); font-size: 0.85rem; font-weight: 500; letter-spacing: 0.02em; }
.navbar-menu a:hover { color: var(--color-text-heading); }
.navbar-toggle { display: none; background: none; border: none; color: var(--color-text); font-size: 1.5rem; cursor: pointer; }

/* ====== BUTTONS ====== */

.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 24px; border-radius: var(--radius);
    font-size: 0.9rem; font-weight: 600;
    border: none; cursor: pointer;
    transition: all var(--transition); text-decoration: none;
}
.btn-primary { background: var(--color-accent); color: var(--bg-primary); }
.btn-primary:hover { background: var(--color-accent-dark); color: var(--bg-primary); transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0, 180, 216, 0.3); }
.btn-outline { background: transparent; color: var(--color-text); border: 1px solid var(--color-border); }
.btn-outline:hover { border-color: var(--color-accent); color: var(--color-accent); }
.btn-sm { padding: 7px 16px; font-size: 0.8rem; }
.btn-block { width: 100%; justify-content: center; }

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

.hero {
    padding: 120px 0 70px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -30%; right: -10%;
    width: 600px; height: 600px;
    background: radial-gradient(circle, var(--color-accent-glow) 0%, transparent 70%);
    pointer-events: none;
}

.hero-split {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 48px;
    align-items: center;
}

.hero-text { position: relative; z-index: 1; }

.hero-badge {
    display: inline-block;
    padding: 4px 14px;
    background: var(--color-accent-glow);
    border: 1px solid rgba(0, 180, 216, 0.25);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--color-accent);
    margin-bottom: 20px;
    letter-spacing: 0.03em;
}

.hero h1 { font-size: 2.8rem; font-weight: 800; line-height: 1.15; color: var(--color-text-heading); margin-bottom: 16px; }
.hero h1 em { font-style: normal; color: var(--color-accent); }
.hero-subtitle { font-size: 1.05rem; color: var(--color-text-muted); margin-bottom: 28px; max-width: 480px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* Hero metrics panel */
.hero-panel {
    position: relative; z-index: 1;
    background: var(--bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.hero-panel-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
    margin-bottom: 20px;
    font-weight: 600;
}

.metrics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.metric { text-align: center; padding: 16px 8px; background: var(--bg-secondary); border-radius: var(--radius); border: 1px solid var(--color-border); }
.metric-value { font-size: 1.8rem; font-weight: 800; color: var(--color-accent); line-height: 1; margin-bottom: 6px; font-family: var(--font-mono); }
.metric-label { font-size: 0.75rem; color: var(--color-text-muted); line-height: 1.3; }

/* ====== SECTIONS ====== */

.section { padding: 70px 0; }
.section--alt { background: var(--bg-secondary); }

.section-title {
    font-size: 1.8rem; font-weight: 700;
    color: var(--color-text-heading);
    margin-bottom: 36px;
}

.section-header-row {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 32px;
}
.section-header-row .section-title { margin-bottom: 0; }

/* Centered section headers (used by articles page) */
.section-header { text-align: center; margin-bottom: 48px; }
.section-header h2 { font-size: 2rem; font-weight: 700; color: var(--color-text-heading); margin-bottom: 12px; }
.section-header p { font-size: 1rem; color: var(--color-text-muted); max-width: 500px; margin: 0 auto; }

/* ====== PROBLEMS (compact list) ====== */

.problems-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 40px;
}

.problem-item {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 20px;
    background: var(--bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.92rem;
    color: var(--color-text);
    transition: border-color var(--transition);
}

.problem-item:hover { border-color: rgba(245, 158, 11, 0.4); }

.problem-dot {
    width: 8px; height: 8px;
    background: var(--color-warning);
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

/* ====== APPROACH (numbered steps) ====== */

.steps-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.step {
    background: var(--bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    transition: border-color var(--transition);
    position: relative;
}

.step:hover { border-color: rgba(0, 180, 216, 0.3); }

.step-num {
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 800;
    color: rgba(0, 180, 216, 0.2);
    line-height: 1;
    margin-bottom: 16px;
}

.step h3 {
    font-size: 1.05rem;
    color: var(--color-text-heading);
    margin-bottom: 10px;
}

.step p {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    line-height: 1.6;
}

/* ====== ARTICLES ====== */

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.article-card {
    background: var(--bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition);
    cursor: pointer; text-decoration: none; display: block;
}
.article-card:hover { background: var(--bg-card-hover); border-color: rgba(0, 180, 216, 0.2); transform: translateY(-3px); box-shadow: var(--shadow); }
.article-card-img { aspect-ratio: 1200 / 630; overflow: hidden; }
.article-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s ease; }
.article-card:hover .article-card-img img { transform: scale(1.03); }
.article-card-body { padding: 20px 24px 24px; }
.article-date { font-size: 0.75rem; color: var(--color-text-muted); margin-bottom: 10px; font-family: var(--font-mono); }
.article-card h3 { font-size: 0.95rem; color: var(--color-text-heading); margin-bottom: 8px; line-height: 1.4; }
.article-card p { font-size: 0.85rem; color: var(--color-text-muted); line-height: 1.5; }

/* ====== CONTACT (CTA block) ====== */

.cta-block {
    max-width: 680px;
    margin: 0 auto;
    text-align: center;
}

.cta-block .section-title { text-align: center; }

.cta-subtitle {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    margin-bottom: 28px;
}

.cta-form {
    background: var(--bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 28px;
    text-align: left;
}

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

.cta-form-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 4px;
}

.cta-contacts {
    display: flex;
    gap: 20px;
}

.cta-contacts a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.cta-contacts a:hover { color: var(--color-accent); }
.cta-contacts a svg { flex-shrink: 0; }

.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: 0.8rem; color: var(--color-text-muted); margin-bottom: 5px; font-weight: 500; }
.form-group input,
.form-group textarea {
    width: 100%; padding: 10px 14px;
    background: var(--bg-secondary); border: 1px solid var(--color-border); border-radius: var(--radius);
    color: var(--color-text); font-family: var(--font-main); font-size: 0.9rem;
    transition: border-color var(--transition);
}
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--color-text-muted); opacity: 0.6; }
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--color-accent); }
.form-group textarea { resize: vertical; min-height: 100px; }

.form-message { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 14px; font-size: 0.85rem; display: none; }
.form-message.success { background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.3); color: var(--color-success); display: block; }
.form-message.error { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3); color: var(--color-danger); display: block; }

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

.footer { padding: 32px 0; border-top: 1px solid var(--color-border); background: var(--bg-secondary); }
.footer .container { display: flex; justify-content: space-between; align-items: center; }
.footer-copy { font-size: 0.8rem; color: var(--color-text-muted); }
.footer-links { display: flex; gap: 20px; }
.footer-links a { font-size: 0.8rem; color: var(--color-text-muted); }
.footer-links a:hover { color: var(--color-text); }

/* ====== ARTICLE PAGE ====== */

.article-page { padding-top: 90px; padding-bottom: 50px; min-height: 80vh; }
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 0.85rem; color: var(--color-text-muted); margin-bottom: 28px; }
.breadcrumbs a { color: var(--color-text-muted); }
.breadcrumbs a:hover { color: var(--color-accent); }
.breadcrumbs-sep { opacity: 0.5; }
.breadcrumbs > span:last-child { color: var(--color-text); }
.related-articles { margin-top: 60px; padding-top: 40px; border-top: 1px solid var(--color-border); }
.related-articles h2 { font-size: 1.4rem; color: var(--color-text-heading); margin-bottom: 24px; }
.related-articles-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 768px) { .related-articles-grid { grid-template-columns: 1fr; } }
.article-page h1 { font-size: 2rem; color: var(--color-text-heading); margin-bottom: 12px; line-height: 1.3; }
.article-meta { color: var(--color-text-muted); font-size: 0.8rem; font-family: var(--font-mono); margin-bottom: 36px; }

.article-content { max-width: none; font-size: 1.05rem; line-height: 1.8; }
.article-content h2 { font-size: 1.4rem; color: var(--color-text-heading); margin-top: 36px; margin-bottom: 14px; }
.article-content h3 { font-size: 1.15rem; color: var(--color-text-heading); margin-top: 28px; margin-bottom: 10px; }
.article-content p { margin-bottom: 14px; }
.article-content code { font-family: var(--font-mono); background: var(--bg-card); padding: 2px 7px; border-radius: 4px; font-size: 0.9em; }
.article-content pre { background: var(--bg-card); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 18px; overflow-x: auto; margin-bottom: 18px; }
.article-content pre code { background: none; padding: 0; }
.article-content ul, .article-content ol { margin-bottom: 14px; padding-left: 24px; }
.article-content li { margin-bottom: 6px; }
.article-content img { max-width: 100%; border-radius: var(--radius); margin: 18px 0; }
.article-content blockquote { border-left: 3px solid var(--color-accent); padding: 12px 20px; margin: 18px 0; background: var(--bg-card); border-radius: 0 var(--radius) var(--radius) 0; }
.article-content table { width: 100%; border-collapse: collapse; margin: 18px 0; }
.article-content th, .article-content td { padding: 10px 14px; border: 1px solid var(--color-border); text-align: left; font-size: 0.9rem; }
.article-content th { background: var(--bg-card); color: var(--color-text-heading); font-weight: 600; }

/* ====== ARTICLES LIST PAGE ====== */

.articles-page { padding-top: 90px; padding-bottom: 50px; min-height: 80vh; }
.articles-page h1 { font-size: 1.8rem; color: var(--color-text-heading); margin-bottom: 6px; }
.articles-page .section-subtitle { color: var(--color-text-muted); margin-bottom: 32px; }

.search-box { position: relative; max-width: 380px; margin-bottom: 32px; }
.search-box input { width: 100%; padding: 10px 14px 10px 40px; background: var(--bg-card); border: 1px solid var(--color-border); border-radius: var(--radius); color: var(--color-text); font-size: 0.9rem; }
.search-box input:focus { outline: none; border-color: var(--color-accent); }
.search-box svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--color-text-muted); }

/* ====== RESPONSIVE ====== */

@media (max-width: 1024px) {
    .hero-split { grid-template-columns: 1fr; gap: 36px; }
    .hero-panel { max-width: 420px; }
    .steps-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .navbar-menu {
        display: none; position: absolute; top: 56px; left: 0; right: 0;
        background: var(--bg-secondary); flex-direction: column; padding: 16px 24px; gap: 14px;
        border-bottom: 1px solid var(--color-border);
    }
    .navbar-menu.active { display: flex; }
    .navbar-toggle { display: block; }

    .hero { padding: 90px 0 50px; }
    .hero h1 { font-size: 2rem; }
    .hero-subtitle { font-size: 0.95rem; }

    .problems-list,
    .articles-grid { grid-template-columns: 1fr; }

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

    .cta-form-top { grid-template-columns: 1fr; }
    .cta-form-bottom { flex-direction: column; align-items: stretch; }
    .cta-contacts { justify-content: center; }
    .btn-block-mobile { width: 100%; justify-content: center; }

    .section { padding: 50px 0; }
    .section-title { font-size: 1.5rem; margin-bottom: 28px; }

    .section-header-row { flex-direction: column; align-items: flex-start; gap: 12px; }

    .footer .container { flex-direction: column; gap: 12px; text-align: center; }

    .article-page h1 { font-size: 1.5rem; }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 1.7rem; }
    .hero-actions { flex-direction: column; }
    .btn { justify-content: center; }
    .metrics-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
}
