/* ============================================================
   Eirlab Blog — styles
   Base tokens & chrome are copied verbatim from index.html so the
   blog shares the exact same look. The "article prose" block at the
   bottom is the only genuinely new design (long-read typography that
   did not exist on the landing pages).
   ============================================================ */

/* ---- Base tokens (from index.html) ---- */
:root {
    --bg-color: #1a1a1a;
    --text-color: #ffffff;
    --secondary-text-color: #888888;
    --border-color: #333333;
    --font-headings: 'Syne', sans-serif;
    --font-body: 'Inter', sans-serif;
    /* New: comfortable reading color for long body text */
    --reading-text-color: #d9d9d9;
    --accent-color: #ff6600;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    background-color: var(--bg-color);
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    color: var(--text-color);
    overflow-x: hidden;
    position: relative;
}

/* ---- Fire cursor (from index.html) ---- */
.fire-cursor { position: fixed; pointer-events: none; z-index: 9999; display: none; }
body.fire-active { cursor: none; }
body.fire-active .fire-cursor { display: block; }
.fire-particle { position: absolute; width: 8px; height: 8px; border-radius: 50%; pointer-events: none; }
.fire-main {
    width: 20px; height: 20px;
    background: radial-gradient(circle, #ff4444, #ff6600, #ffaa00);
    border-radius: 50%;
    box-shadow: 0 0 20px #ff4444, 0 0 40px #ff6600, 0 0 60px #ffaa00;
    animation: fireFlicker 0.1s infinite alternate;
}
@keyframes fireFlicker {
    0%   { transform: scale(1) rotate(0deg);   box-shadow: 0 0 20px #ff4444, 0 0 40px #ff6600, 0 0 60px #ffaa00; }
    100% { transform: scale(1.1) rotate(5deg); box-shadow: 0 0 25px #ff4444, 0 0 45px #ff6600, 0 0 65px #ffaa00; }
}
.fire-trail { background: radial-gradient(circle, #ff6600, #ff4444, transparent); animation: fadeTrail 1.2s ease-out forwards; }
@keyframes fadeTrail { 0% { opacity: 0.8; transform: scale(1); } 100% { opacity: 0; transform: scale(0.3); } }
.fire-spark { background: #ffaa00; width: 3px; height: 3px; animation: sparkFade 1.2s ease-out forwards; }
@keyframes sparkFade {
    0%   { opacity: 1; transform: scale(1) translate(0, 0); }
    100% { opacity: 0; transform: scale(0) translate(var(--dx, 0), var(--dy, 0)); }
}
@keyframes gradientShift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ---- Header / nav (from index.html) ---- */
.site-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 2rem 5%; max-width: 1400px; margin: 0 auto;
    position: relative; z-index: 10;
}
.header-nav { display: flex; align-items: center; gap: 2rem; }
.logo img { height: 35px; }
.main-nav a {
    text-decoration: none; font-weight: 500; color: var(--secondary-text-color);
    transition: color 0.3s ease; position: relative;
}
.main-nav a::after {
    content: ''; position: absolute; bottom: -4px; left: 0; width: 0; height: 1px;
    background-color: var(--text-color); transition: width 0.3s ease;
}
.main-nav a:hover::after { width: 100%; }
.main-nav a:hover { color: var(--text-color); }
.main-nav a.active { color: var(--text-color); }
.language-switcher { display: flex; gap: 0.5rem; align-items: center; margin-left: 1rem; }
.lang-btn {
    padding: 0.3rem 0.6rem; border: 1px solid var(--border-color); border-radius: 4px;
    background: transparent; color: var(--secondary-text-color); text-decoration: none;
    font-size: 0.85rem; font-weight: 500; transition: all 0.3s ease; cursor: pointer;
}
.lang-btn.active { background: var(--text-color); color: var(--bg-color); border-color: var(--text-color); }
.lang-btn:not(.active):hover { color: var(--text-color); border-color: var(--text-color); }

/* ---- Contact / footer (from index.html) ---- */
.contact-section { text-align: center; padding: 6rem 5% 4rem; position: relative; z-index: 5; }
.contact-section h3 { font-size: 2rem; margin-bottom: 1rem; }
.contact-section p { color: var(--secondary-text-color); margin-bottom: 2.5rem; }
.contact-links { display: flex; justify-content: center; gap: 2rem; }
.contact-links a { padding: 0.5rem; border-radius: 50%; transition: all 0.3s ease; position: relative; }
.contact-links a::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    border-radius: 50%; border: 1px solid transparent; transition: border-color 0.3s ease;
}
.contact-links a:hover::before { border-color: rgba(255, 255, 255, 0.2); }
.contact-links svg { width: 32px; height: 32px; fill: var(--secondary-text-color); transition: all 0.3s ease; }
.contact-links a:hover svg { fill: var(--text-color); transform: scale(1.3) rotate(5deg); }

/* ---- Scroll fade-in (from index.html) ---- */
.fade-in { opacity: 0; transform: translateY(20px); transition: all 0.6s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }
[data-ru], [data-en] { transition: opacity 0.3s ease; }

/* ============================================================
   NEW: Blog index (article list)
   Reuses the card look from index.html .project-item
   ============================================================ */
.blog-hero {
    max-width: 820px; margin: 0 auto; padding: 3rem 5% 1rem;
    position: relative; z-index: 5;
}
.blog-hero h1 {
    font-family: var(--font-headings); font-size: 2.6rem; margin: 0 0 0.75rem;
    background: linear-gradient(45deg, #f7e8dd, #ff6600);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.blog-hero p { color: var(--secondary-text-color); font-size: 1.05rem; margin: 0; max-width: 640px; }

.article-list {
    max-width: 820px; margin: 0 auto; padding: 2rem 5% 4rem;
    display: flex; flex-direction: column; gap: 1px;
    background-color: var(--border-color);
    border: 1px solid var(--border-color);
    position: relative; z-index: 5;
}
.article-card {
    display: block; background-color: var(--bg-color); color: inherit; text-decoration: none;
    padding: 2rem 2.25rem; transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
    position: relative; overflow: hidden; border: 1px solid var(--border-color); border-radius: 12px;
}
.article-card:hover, .article-card:focus-within {
    transform: translateY(-6px); background-color: rgba(255, 255, 255, 0.02);
    box-shadow: 0 0 30px rgba(255, 102, 0, 0.3); border-color: rgba(255, 102, 0, 0.5);
}
.article-card .card-meta {
    color: var(--secondary-text-color); font-size: 0.85rem; letter-spacing: 0.04em;
    text-transform: uppercase; margin-bottom: 0.75rem;
}
.article-card h2 {
    font-family: var(--font-headings); font-size: 1.5rem; line-height: 1.25; margin: 0 0 0.75rem;
    color: var(--text-color); transition: color 0.3s ease;
}
.article-card:hover h2 { color: #ffa64d; }
.article-card .card-excerpt { margin: 0; color: var(--secondary-text-color); line-height: 1.6; }

/* ============================================================
   NEW: Article (long-read prose)
   ============================================================ */
.article { max-width: 760px; margin: 0 auto; padding: 3rem 5% 2rem; position: relative; z-index: 5; }

.article-back {
    display: inline-block; color: var(--secondary-text-color); text-decoration: none;
    font-size: 0.9rem; margin-bottom: 2rem; transition: color 0.3s ease;
}
.article-back:hover { color: var(--accent-color); }

.article-header { margin-bottom: 3rem; }
.article-title {
    font-family: var(--font-headings); font-size: 2.8rem; line-height: 1.1; margin: 0 0 1rem;
    background: linear-gradient(45deg, #f7e8dd, #ff6600);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.article-meta {
    color: var(--secondary-text-color); font-size: 0.9rem; letter-spacing: 0.04em;
    display: flex; gap: 1.25rem; flex-wrap: wrap;
}

/* Body typography */
.article-body { font-size: 1.08rem; line-height: 1.75; color: var(--reading-text-color); }
.article-body > p { margin: 0 0 1.4rem; }
.article-body strong { color: var(--text-color); font-weight: 500; }
.article-body a { color: var(--accent-color); text-decoration: none; border-bottom: 1px solid rgba(255, 102, 0, 0.4); }
.article-body a:hover { border-bottom-color: var(--accent-color); }

.article-body h2 {
    font-family: var(--font-headings); font-size: 1.85rem; line-height: 1.2;
    color: var(--text-color); margin: 3.5rem 0 1.25rem; padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}
.article-body h3 {
    font-family: var(--font-headings); font-size: 1.3rem; line-height: 1.3;
    color: var(--text-color); margin: 2.5rem 0 1rem;
}
.article-body h4 {
    font-family: var(--font-body); font-weight: 500; font-size: 1.05rem;
    color: var(--accent-color); margin: 1.75rem 0 0.6rem; letter-spacing: 0.02em;
}

.article-body ul { margin: 0 0 1.4rem; padding: 0; list-style: none; }
.article-body ul li { position: relative; padding-left: 1.5rem; margin-bottom: 0.7rem; }
.article-body ul li::before {
    content: ''; position: absolute; left: 0; top: 0.65em;
    width: 6px; height: 6px; border-radius: 50%; background: var(--accent-color);
}
.article-body ol { margin: 0 0 1.4rem; padding-left: 1.5rem; }
.article-body ol li { margin-bottom: 0.7rem; padding-left: 0.3rem; }
.article-body ol li::marker { color: var(--accent-color); font-weight: 500; }

/* Lead paragraph */
.article-body .lead {
    font-size: 1.2rem; line-height: 1.6; color: var(--text-color);
    margin-bottom: 2rem;
}

/* Table of contents box */
.toc {
    border: 1px solid var(--border-color); border-radius: 12px;
    padding: 1.5rem 1.75rem; margin: 2.5rem 0; background: rgba(255, 255, 255, 0.015);
}
.toc h4 { margin: 0 0 1rem; color: var(--secondary-text-color); }
.toc ol { margin: 0; padding-left: 1.25rem; }
.toc li { margin-bottom: 0.55rem; color: var(--reading-text-color); line-height: 1.5; }

/* Callout / formula box */
.callout {
    border-left: 3px solid var(--accent-color); border-radius: 0 8px 8px 0;
    background: rgba(255, 102, 0, 0.06); padding: 1.25rem 1.5rem; margin: 2rem 0;
}
.callout p { margin: 0 0 0.6rem; }
.callout p:last-child { margin-bottom: 0; }
.callout .formula { font-family: var(--font-body); font-weight: 500; color: var(--text-color); }

/* Pull quote / example */
.article-body blockquote {
    margin: 2rem 0; padding: 0.5rem 0 0.5rem 1.5rem;
    border-left: 3px solid var(--border-color); color: var(--text-color); font-style: italic;
}

/* Section divider (==== in source) */
.article-body hr {
    border: none; height: 1px; background: var(--border-color); margin: 3rem 0;
}

.article-footer {
    margin-top: 3.5rem; padding-top: 2rem; border-top: 1px solid var(--border-color);
    color: var(--secondary-text-color); font-size: 0.9rem;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
    .site-header { display: block; text-align: center; padding: 1.5rem 1rem; }
    .logo { margin-bottom: 1.5rem; }
    .header-nav { flex-direction: column; gap: 1rem; align-items: center; }
    .main-nav { display: flex; justify-content: center; gap: 1.5rem; flex-wrap: wrap; }
    .main-nav a { font-size: 0.9rem; }
    .language-switcher { margin-left: 0; }

    .blog-hero { padding: 2rem 1rem 0.5rem; }
    .blog-hero h1 { font-size: 1.9rem; }
    .article-list { padding: 1.5rem 1rem 3rem; }
    .article-card { padding: 1.5rem 1.25rem; }
    .article-card h2 { font-size: 1.25rem; }
    .article-card:hover, .article-card:focus-within { transform: none; }

    .article { padding: 2rem 1.25rem; }
    .article-title { font-size: 1.9rem; }
    .article-body { font-size: 1.02rem; }
    .article-body h2 { font-size: 1.5rem; margin-top: 2.5rem; }
    .article-body h3 { font-size: 1.2rem; }
    .article-body .lead { font-size: 1.1rem; }

    .contact-section { padding: 3rem 1rem; }
    .contact-section h3 { font-size: 1.25rem; }
    .contact-links { gap: 1.5rem; }
    .contact-links svg { width: 28px; height: 28px; }
}

@media (hover: none) and (pointer: coarse) {
    .article-card:active {
        transform: scale(0.99); background-color: rgba(255, 255, 255, 0.02);
        box-shadow: 0 0 30px rgba(255, 102, 0, 0.3); border-color: rgba(255, 102, 0, 0.5);
    }
    .contact-links a:active { transform: scale(0.9); }
}
