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

:root {
    --bg: #f6f8fa;
    --surface: #ffffff;
    --border: #d0d7de;
    --border-light: #e8ecf0;
    --text: #0f172a;
    --text-muted: #57606a;
    --text-body: #24292f;
    --accent: #2e7d32;
    --accent-mid: #4caf50;
    --accent-hover: #1b5e20;
    --accent-dim: rgba(46, 125, 50, 0.08);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.05);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg);
    background-image: url('assets/circuit-pattern.svg');
    background-size: 120px 120px;
    color: var(--text);
    line-height: 1.6;
    font-size: 16px;
}

/* ─── Layout ─────────────────────────────────────────────── */

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ─── Header / Nav ───────────────────────────────────────── */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(246, 248, 250, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.nav {
    max-width: 960px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: 0.01em;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 28px;
    align-items: center;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.18s;
}

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

.nav-links .nav-linkedin {
    color: var(--accent);
}

.nav-links .nav-linkedin:hover {
    color: var(--accent-hover);
}

/* ─── Hero ───────────────────────────────────────────────── */

.hero {
    padding: 48px 24px;
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
}

.hero-inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 0;
}

.hero-logo {
    flex-shrink: 0;
    padding-right: 52px;
    border-right: 1px solid var(--border);
}

.hero-logo img {
    width: min(200px, 26vw);
    height: auto;
    filter: invert(28%) sepia(62%) saturate(600%) hue-rotate(90deg) brightness(85%);
    display: block;
}

.hero-text {
    flex: 1;
    padding-left: 52px;
}

.hero-name {
    font-size: clamp(1.75rem, 3vw, 2.6rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.15;
    margin-bottom: 10px;
    color: var(--text);
}

.hero-subtitle {
    font-size: 1rem;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 16px;
    letter-spacing: 0.01em;
}

.hero-bio {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.75;
    margin-bottom: 0;
    max-width: 520px;
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 24px;
}

/* ─── Buttons ────────────────────────────────────────────── */

.btn {
    display: inline-block;
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.18s;
    cursor: pointer;
}

.btn-primary {
    background: var(--accent);
    color: #ffffff;
}

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

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ─── Section shared ─────────────────────────────────────── */

.section-heading {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.section-sub {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 48px;
}

/* ─── Articles Section ───────────────────────────────────── */

.articles-section {
    padding: 64px 0 80px;
    background: transparent;
}

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

.category-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 28px 28px 24px;
    transition: box-shadow 0.2s, border-color 0.2s;
    box-shadow: var(--shadow-sm);
}

.category-card:hover {
    box-shadow: var(--shadow-md);
    border-color: #a5d6a7;
}

.category-icon {
    font-size: 1.75rem;
    margin-bottom: 14px;
}

.category-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text);
    letter-spacing: -0.01em;
}

.category-desc {
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.75;
    margin-bottom: 24px;
}

.coming-soon {
    border-top: 1px solid var(--border-light);
    padding-top: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.coming-soon-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 20px;
    background: var(--accent-dim);
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    white-space: nowrap;
}

.coming-soon p {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ─── About Section ──────────────────────────────────────── */

.about-section {
    padding: 80px 0;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.about-content {
    max-width: 560px;
}

.about-content p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.75;
    margin-bottom: 16px;
}

.about-content .btn {
    margin-top: 8px;
}

/* ─── Footer ─────────────────────────────────────────────── */

.site-footer {
    border-top: 1px solid var(--border);
    padding: 32px 0;
    text-align: center;
    background: var(--surface);
}

.site-footer p {
    color: var(--text-muted);
    font-size: 0.825rem;
}

.footer-tagline {
    margin-top: 6px;
    font-size: 0.7rem !important;
    letter-spacing: 0.12em;
    opacity: 0.4;
}

/* ─── Article List (in category cards) ──────────────────── */

.article-list {
    border-top: 1px solid var(--border-light);
    padding-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.article-item a {
    display: block;
    color: var(--text);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.45;
    transition: color 0.18s;
}

.article-item a:hover {
    color: var(--accent);
}

.article-item-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 3px;
    font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
    letter-spacing: 0.02em;
}

/* ─── Article Page ───────────────────────────────────────── */

.article-header {
    padding: 80px 24px 72px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.article-header-inner {
    max-width: 740px;
    margin: 0 auto;
}

.article-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 36px;
    transition: color 0.18s;
    letter-spacing: 0.01em;
}

.article-back:hover {
    color: var(--accent);
}

.article-category {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent);
    background: var(--accent-dim);
    border: 1px solid rgba(46, 125, 50, 0.2);
    padding: 4px 10px;
    border-radius: 20px;
    margin-bottom: 20px;
}

.article-title {
    font-size: clamp(1.75rem, 4.5vw, 2.75rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 22px;
    color: var(--text);
}

.article-subtitle {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.75;
    max-width: 640px;
    margin-bottom: 32px;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.article-meta-item {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
}

.article-meta-item strong {
    color: var(--text-body);
    font-weight: 600;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.article-meta-divider {
    width: 1px;
    height: 12px;
    background: var(--border);
}

/* ─── Article Body ───────────────────────────────────────── */

.article-body {
    padding: 72px 24px 120px;
    background: var(--bg);
}

.article-body-inner {
    max-width: 740px;
    margin: 0 auto;
}

.article-body h2 {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-top: 64px;
    margin-bottom: 20px;
    padding-left: 18px;
    border-left: 3px solid var(--accent-mid);
    color: var(--text);
    line-height: 1.3;
}

.article-body > div > h2:first-child,
.article-body-inner > h2:first-child {
    margin-top: 0;
}

.article-body h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-top: 40px;
    margin-bottom: 14px;
    color: var(--text);
    letter-spacing: -0.01em;
}

.article-body p {
    color: var(--text-body);
    font-size: 1rem;
    line-height: 1.85;
    margin-bottom: 22px;
}

.article-body ul {
    list-style: none;
    margin: 0 0 24px 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.article-body ol {
    margin: 0 0 24px 0;
    padding-left: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.article-body li {
    color: var(--text-body);
    font-size: 1rem;
    line-height: 1.75;
    padding-left: 20px;
    position: relative;
}

.article-body ol li {
    padding-left: 6px;
}

.article-body li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 11px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-mid);
    opacity: 0.8;
}

.article-body ol li::before {
    display: none;
}

.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 24px 0;
    font-size: 0.95rem;
}

.article-body th {
    text-align: left;
    padding: 10px 14px;
    background: var(--accent-dim);
    color: var(--text);
    font-weight: 600;
    border-bottom: 2px solid var(--accent-mid);
}

.article-body td {
    padding: 10px 14px;
    color: var(--text-body);
    border-bottom: 1px solid var(--border-light);
    vertical-align: top;
}

.article-body tr:last-child td {
    border-bottom: none;
}

.article-body code {
    font-family: 'SF Mono', 'Fira Code', 'Courier New', Courier, monospace;
    font-size: 0.85em;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    padding: 2px 7px;
    border-radius: 5px;
    color: #166534;
}

/* ─── Responsive ─────────────────────────────────────────── */

@media (max-width: 640px) {
    .nav-links {
        gap: 18px;
    }

    .hero {
        padding: 40px 24px;
    }

    .hero-inner {
        flex-direction: column;
        gap: 0;
        text-align: center;
    }

    .hero-logo {
        padding-right: 0;
        padding-bottom: 28px;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .hero-text {
        padding-left: 0;
        padding-top: 28px;
    }

    .hero-bio {
        max-width: 100%;
    }

    .hero-logo img {
        width: min(180px, 55vw);
        margin: 0 auto;
    }

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