:root {
    --primary: #0d9488;
    --primary-dark: #0f766e;
    --bg: #f0fdfa;
    --card: #ffffff;
    --text: #334155;
    --heading: #134e4a;
    --text-muted: #64748b;
    --border: #ccfbf1;
    --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; }
.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }

.header {
    background: var(--heading);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.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: #5eead4; font-size: 1.4rem; font-weight: 800; }
.logo-accent { color: #5eead4; }
.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;
}
.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;
    border-radius: 1px;
}

.hero {
    background: linear-gradient(135deg, #134e4a 0%, #115e59 45%, #0d9488 100%);
    padding: 96px 0 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -40%;
    left: -15%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(94,234,212,0.12) 0%, transparent 70%);
    border-radius: 50%;
}
.hero-title {
    color: #fff;
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -0.03em;
    line-height: 1.15;
    position: relative;
}
.hero-subtitle {
    color: #99f6e4;
    font-size: 1.15rem;
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.7;
    position: relative;
}

.section { padding: 72px 0; }
.section-title {
    font-size: 1.65rem;
    color: var(--heading);
    margin-bottom: 10px;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.section-desc { color: var(--text-muted); font-size: 1.02rem; margin-bottom: 36px; }

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 22px;
}
.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: 26px; }
.article-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 12px;
}
.tag-math { background: #ccfbf1; color: #0f766e; }
.tag-binary { background: #fef3c7; color: #92400e; }
.tag-tools { background: #e0e7ff; color: #4338ca; }
.article-card h3 {
    font-size: 1.1rem;
    color: var(--heading);
    margin-bottom: 8px;
    font-weight: 700;
    line-height: 1.35;
}
.article-card h3 a { text-decoration: none; color: inherit; }
.article-card h3 a:hover { color: var(--primary); }
.article-card .excerpt {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 16px;
}
.article-meta { display: flex; gap: 16px; color: var(--text-muted); font-size: 0.8rem; }

.newsletter {
    background: linear-gradient(135deg, #0f766e, #14b8a6);
    padding: 64px 0;
    text-align: center;
    color: #fff;
}
.newsletter h2 { font-size: 1.6rem; margin-bottom: 8px; font-weight: 700; }
.newsletter p { color: #ccfbf1; margin-bottom: 24px; font-size: 1.02rem; }
.newsletter-form { display: flex; max-width: 420px; margin: 0 auto; gap: 10px; }
.newsletter-form input {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid transparent;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: var(--font);
    outline: none;
}
.newsletter-form button {
    padding: 14px 24px;
    background: var(--heading);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font);
    white-space: nowrap;
}

.footer {
    background: var(--heading);
    color: #64748b;
    padding: 28px 0;
    font-size: 0.88rem;
}
.footer-inner { display: flex; align-items: center; justify-content: space-between; }
.footer a { color: #94a3b8; }
.footer a:hover { color: #fff; }
.footer-links { display: flex; gap: 20px; }

.article-page { padding: 56px 0 72px; }
.article-page .container { max-width: 720px; }
.article-header { margin-bottom: 32px; }
.article-header h1 {
    font-size: 2rem;
    color: var(--heading);
    font-weight: 800;
    line-height: 1.25;
    margin: 14px 0;
}
.article-body h2 { font-size: 1.25rem; color: var(--heading); margin: 36px 0 12px; font-weight: 700; }
.article-body p { margin-bottom: 16px; line-height: 1.8; }
.article-body pre {
    background: #134e4a;
    color: #ecfdf5;
    padding: 18px 20px;
    border-radius: 10px;
    overflow-x: auto;
    margin: 20px 0;
    font-family: var(--mono);
    font-size: 0.85rem;
}
.article-body code {
    font-family: var(--mono);
    font-size: 0.88em;
    background: #ccfbf1;
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--primary-dark);
}
.article-body pre code { background: none; padding: 0; color: inherit; }
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
}
.back-link:hover { color: var(--primary); text-decoration: none; }

.about-page { padding: 56px 0 72px; }
.about-page .container { max-width: 720px; }
.about-content h1 { font-size: 1.85rem; color: var(--heading); margin-bottom: 20px; font-weight: 800; }
.about-content p { margin-bottom: 16px; line-height: 1.8; }
.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
    margin: 24px 0;
}
.tech-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px;
    text-align: center;
}
.tech-item strong { display: block; color: var(--heading); margin-bottom: 4px; }
.tech-item span { font-size: 0.82rem; color: var(--text-muted); }

@media (max-width: 768px) {
    .hero-title { font-size: 2rem; }
    .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: 10px;
        box-shadow: 0 8px 16px rgba(0,0,0,0.3);
    }
    .mobile-toggle { display: block; }
    .footer-inner { flex-direction: column; gap: 12px; }
    .newsletter-form { flex-direction: column; }
}
