:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --bg: #f1f5f9;
    --card: #ffffff;
    --text: #334155;
    --heading: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 12px 24px rgba(0,0,0,0.12);
    --radius: 12px;
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --mono: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
}

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

html { scroll-behavior: smooth; }

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

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

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

/* ==================== Header ==================== */
.header {
    background: var(--heading);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #fff;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.logo:hover { text-decoration: none; }

.logo-icon {
    font-family: var(--mono);
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: 800;
}

.logo-accent { color: var(--primary); }

.nav {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-link {
    color: #94a3b8;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.2s;
    letter-spacing: 0.01em;
}

.nav-link:hover,
.nav-link.active {
    color: #fff;
    text-decoration: none;
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.mobile-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    margin: 5px 0;
    transition: 0.3s;
    border-radius: 1px;
}

/* ==================== Hero ==================== */
.hero {
    background: linear-gradient(135deg, #0f172a 0%, #1a2e4a 40%, #1e40af 100%);
    padding: 100px 0 90px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(37,99,235,0.15) 0%, transparent 70%);
    border-radius: 50%;
}

.hero-title {
    color: #fff;
    font-size: 3.2rem;
    font-weight: 800;
    margin-bottom: 18px;
    letter-spacing: -0.03em;
    line-height: 1.15;
    position: relative;
}

.hero-subtitle {
    color: #94a3b8;
    font-size: 1.2rem;
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.7;
    position: relative;
}

/* ==================== Section ==================== */
.section { padding: 80px 0; }

.section-title {
    font-size: 1.75rem;
    color: var(--heading);
    margin-bottom: 12px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.section-desc {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-bottom: 40px;
}

/* ==================== Articles Grid ==================== */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

.article-card {
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.3s, transform 0.3s;
    border: 1px solid var(--border);
}

.article-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}

.article-card-accent {
    height: 4px;
}

.article-card-body {
    padding: 28px;
}

.article-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 14px;
}

.tag-webdev    { background: #dbeafe; color: #1e40af; }
.tag-devops    { background: #d1fae5; color: #065f46; }
.tag-backend   { background: #ede9fe; color: #5b21b6; }
.tag-database  { background: #fef3c7; color: #92400e; }
.tag-infra     { background: #fee2e2; color: #991b1b; }
.tag-tooling   { background: #f1f5f9; color: #475569; }

.article-card h3 {
    font-size: 1.15rem;
    color: var(--heading);
    margin-bottom: 10px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: -0.01em;
}

.article-card h3 a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

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

.article-card .excerpt {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.65;
    margin-bottom: 18px;
}

.article-meta {
    display: flex;
    gap: 16px;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.article-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ==================== Newsletter ==================== */
.newsletter {
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    padding: 72px 0;
    text-align: center;
    color: #fff;
}

.newsletter h2 {
    font-size: 1.75rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.newsletter p {
    color: #bfdbfe;
    margin-bottom: 28px;
    font-size: 1.05rem;
}

.newsletter-form {
    display: flex;
    max-width: 440px;
    margin: 0 auto;
    gap: 10px;
}

.newsletter-form input {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid transparent;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: var(--font);
    outline: none;
    transition: border-color 0.2s;
}

.newsletter-form input:focus {
    border-color: var(--primary);
}

.newsletter-form button {
    padding: 14px 28px;
    background: var(--heading);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font);
    transition: background 0.2s, transform 0.1s;
    white-space: nowrap;
}

.newsletter-form button:hover { background: #1e293b; }
.newsletter-form button:active { transform: scale(0.97); }

/* ==================== Footer ==================== */
.footer {
    background: var(--heading);
    color: #64748b;
    padding: 32px 0;
    text-align: center;
    font-size: 0.88rem;
}

.footer a { color: #94a3b8; }
.footer a:hover { color: #fff; }

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-links {
    display: flex;
    gap: 20px;
}

/* ==================== Article Page ==================== */
.article-page {
    padding: 60px 0 80px;
}

.article-page .container {
    max-width: 760px;
}

.article-header {
    margin-bottom: 40px;
}

.article-header h1 {
    font-size: 2.2rem;
    color: var(--heading);
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.02em;
    margin: 16px 0;
}

.article-header .article-meta {
    margin-top: 12px;
}

.article-body h2 {
    font-size: 1.4rem;
    color: var(--heading);
    margin: 40px 0 16px;
    font-weight: 700;
}

.article-body h3 {
    font-size: 1.15rem;
    color: var(--heading);
    margin: 32px 0 12px;
    font-weight: 600;
}

.article-body p {
    margin-bottom: 18px;
    line-height: 1.8;
}

.article-body ul, .article-body ol {
    margin: 0 0 18px 24px;
}

.article-body li {
    margin-bottom: 6px;
    line-height: 1.7;
}

.article-body pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 20px 24px;
    border-radius: 10px;
    overflow-x: auto;
    margin: 24px 0;
    font-family: var(--mono);
    font-size: 0.88rem;
    line-height: 1.6;
}

.article-body code {
    font-family: var(--mono);
    font-size: 0.88em;
    background: #f1f5f9;
    padding: 2px 7px;
    border-radius: 4px;
    color: var(--primary-dark);
}

.article-body pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.article-body blockquote {
    border-left: 4px solid var(--primary);
    padding: 12px 20px;
    margin: 24px 0;
    background: #f8fafc;
    border-radius: 0 8px 8px 0;
    color: var(--text-muted);
    font-style: italic;
}

.article-body strong {
    color: var(--heading);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 24px;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--primary);
    text-decoration: none;
}

/* ==================== About Page ==================== */
.about-page { padding: 60px 0 80px; }

.about-page .container { max-width: 760px; }

.about-content h1 {
    font-size: 2rem;
    color: var(--heading);
    margin-bottom: 24px;
    font-weight: 800;
}

.about-content p { margin-bottom: 18px; line-height: 1.8; }

.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.tech-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.tech-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.tech-item strong {
    display: block;
    color: var(--heading);
    margin-bottom: 4px;
}

.tech-item span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
    .hero { padding: 60px 0 50px; }
    .hero-title { font-size: 2rem; }
    .hero-subtitle { font-size: 1rem; }
    .section { padding: 50px 0; }
    .articles-grid { grid-template-columns: 1fr; }
    .newsletter-form { flex-direction: column; }
    .newsletter-form button { width: 100%; }

    .nav { display: none; }
    .nav.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--heading);
        padding: 16px 24px;
        gap: 12px;
        box-shadow: 0 8px 16px rgba(0,0,0,0.3);
    }
    .mobile-toggle { display: block; }

    .footer-inner { flex-direction: column; gap: 12px; }

    .article-header h1 { font-size: 1.6rem; }
    .article-body pre { padding: 14px 16px; font-size: 0.82rem; }
}

@media (max-width: 480px) {
    .container { padding: 0 16px; }
    .hero-title { font-size: 1.7rem; }
    .articles-grid { gap: 16px; }
    .article-card-body { padding: 20px; }
}
