/* ===== Reset & Base ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg-primary: #0f1218;
    --bg-secondary: #161b22;
    --bg-card: #1c2128;
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --accent: #2ea44f;
    --accent-line: #2d6a4f;
    --border: #30363d;
    --white: #ffffff;
}

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ===== Top Accent Line ===== */
body::before {
    content: "";
    display: block;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-line), var(--accent));
}

/* ===== Navigation ===== */
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2.5rem;
    height: 52px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-logo {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--white);
}

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

.nav-links a {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.2s;
    letter-spacing: 0.3px;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--white);
}

.nav-social {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-social a {
    color: var(--text-secondary);
    transition: color 0.2s;
    display: flex;
}

.nav-social a:hover { color: var(--white); }

.nav-social svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Mobile nav toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
}

/* ===== Hero / Page Header ===== */
.page-header {
    padding: 4rem 2.5rem 3rem;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.page-header h1 {
    font-size: 2.4rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 0.6rem;
}

.page-header p {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 520px;
    margin: 0 auto;
}

/* ===== Article Cards Grid ===== */
.articles-section {
    max-width: 1100px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.articles-section > h2 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

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

.article-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.25s, border-color 0.25s;
}

.article-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
}

.article-card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--bg-secondary);
}

.article-card-body {
    padding: 1.4rem 1.5rem 1.6rem;
}

.article-card-tag {
    display: inline-block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent);
    margin-bottom: 0.6rem;
    font-weight: 600;
}

.article-card-body h3 {
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.6rem;
    color: var(--text-primary);
}

.article-card-body p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.55;
    margin-bottom: 1rem;
}

.article-card-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ===== Article Page ===== */
.article-page {
    max-width: 760px;
    margin: 0 auto;
    padding: 3rem 2rem 5rem;
}

.article-page .back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    transition: color 0.2s;
}

.article-page .back-link:hover { color: var(--white); }

.article-page header {
    margin-bottom: 2.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 2rem;
}

.article-page header .tag {
    display: inline-block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 0.8rem;
}

.article-page header h1 {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
}

.article-page header .meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.article-page .cover-img {
    width: 100%;
    height: 380px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 2.5rem;
    background: var(--bg-secondary);
}

/* Article content typography */
.article-content h2 {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 2.5rem 0 1rem;
    color: var(--text-primary);
}

.article-content h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 2rem 0 0.8rem;
    color: var(--text-primary);
}

.article-content p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.75;
    margin-bottom: 1.2rem;
}

.article-content ul,
.article-content ol {
    margin: 1rem 0 1.5rem 1.4rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.75;
}

.article-content li { margin-bottom: 0.5rem; }

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

.article-content blockquote {
    border-left: 3px solid var(--accent);
    padding: 0.8rem 1.2rem;
    margin: 1.5rem 0;
    background: var(--bg-secondary);
    border-radius: 0 6px 6px 0;
}

.article-content blockquote p {
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 0;
}

/* Plan/tip boxes */
.plan-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.3rem 1.5rem;
    margin: 1.5rem 0;
}

.plan-box h4 {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    color: var(--accent);
}

.plan-box p {
    font-size: 0.88rem;
    margin-bottom: 0;
}

/* ===== Footer ===== */
.footer {
    border-top: 1px solid var(--border);
    padding: 2.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
    list-style: none;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 0.82rem;
    transition: color 0.2s;
}

.footer-links a:hover { color: var(--white); }

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .nav { padding: 0 1.2rem; }

    .nav-links {
        display: none;
        position: absolute;
        top: 52px;
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--bg-primary);
        border-bottom: 1px solid var(--border);
        padding: 1rem 0;
        gap: 0;
    }

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

    .nav-links li { width: 100%; text-align: center; }

    .nav-links a {
        display: block;
        padding: 0.7rem 1.2rem;
        font-size: 0.95rem;
    }

    .nav-social { gap: 0.8rem; }
    .nav-toggle { display: block; }

    .page-header { padding: 2.5rem 1.2rem 2rem; }
    .page-header h1 { font-size: 1.8rem; }

    .articles-section { padding: 2rem 1.2rem; }
    .articles-grid { grid-template-columns: 1fr; }

    .article-page { padding: 2rem 1.2rem 3rem; }
    .article-page header h1 { font-size: 1.5rem; }
    .article-page .cover-img { height: 220px; }
}
