/* Reset & Base */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans SC', sans-serif;
    background: #020208;
    color: #e2e8f0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    font-size: 15px;
}

/* Background Canvas */
#bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: #0a0a20; }
::-webkit-scrollbar-thumb { background: #302b63; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #7c3aed; }

/* Container */
.container { max-width: 780px; margin: 0 auto; padding: 0 24px; width: 100%; }

/* Nav */
nav {
    border-bottom: 1px solid #302b6333;
    position: sticky;
    top: 0;
    background: #0a0820dd;
    backdrop-filter: blur(12px);
    z-index: 100;
}
nav .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}
.logo {
    font-size: 1.15rem;
    font-weight: 700;
    color: #a78bfa;
    text-decoration: none;
    letter-spacing: 0.08em;
    font-family: 'JetBrains Mono', monospace;
}
.nav-links { display: flex; gap: 28px; }
.nav-links a {
    font-size: 0.85rem;
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s;
}
.nav-links a:hover { color: #a78bfa; }

/* Main */
main { flex: 1; padding: 48px 0; position: relative; z-index: 1; }

/* Footer */
footer {
    border-top: 1px solid #302b6333;
    padding: 24px 0;
    text-align: center;
    font-size: 0.75rem;
    color: #64748b;
    position: relative;
    z-index: 1;
}
footer a { color: #94a3b8; text-decoration: none; }
footer a:hover { color: #a78bfa; }

/* === Hero Section === */
.hero { margin-bottom: 56px; }
.hero-greeting {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: #7c3aed;
    margin-bottom: 8px;
}
.hero-name {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #e2e8f0, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}
.hero-tagline { color: #94a3b8; font-size: 1.05rem; margin-bottom: 16px; }
.hero-techs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

/* === Tags === */
.tag {
    font-size: 0.7rem;
    padding: 3px 10px;
    border-radius: 4px;
    background: #302b6333;
    color: #a78bfa;
    border: 1px solid #302b6344;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.03em;
    text-decoration: none;
    transition: all 0.2s;
}
.tag:hover { border-color: #7c3aed; color: #c4b5fd; }
.tag.active { background: #7c3aed; color: #fff; border-color: #7c3aed; }

/* === Section === */
.section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #7c3aed;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'JetBrains Mono', monospace;
}
.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #302b6333;
}

/* === Project Cards === */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.project-card {
    background: #1a164088;
    border: 1px solid #302b6344;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
}
.project-card:hover {
    border-color: #7c3aed44;
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.08);
    transform: translateY(-1px);
}
.project-card h3 { font-size: 0.95rem; font-weight: 700; color: #a78bfa; margin-bottom: 6px; }
.project-card p { font-size: 0.82rem; color: #94a3b8; line-height: 1.5; margin-bottom: 10px; }
.project-card .tags { display: flex; gap: 6px; flex-wrap: wrap; }

/* === Article List === */
.article-item {
    display: block;
    padding: 20px;
    background: #1a164066;
    border: 1px solid #302b6344;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    margin-bottom: 10px;
    transition: all 0.2s;
}
.article-item:hover {
    border-color: #7c3aed44;
    background: #1a164088;
}
.article-item .meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}
.article-item .title { font-weight: 600; font-size: 0.95rem; color: #e2e8f0; transition: color 0.2s; }
.article-item:hover .title { color: #a78bfa; }
.article-item .date { font-size: 0.75rem; color: #64748b; font-family: 'JetBrains Mono', monospace; white-space: nowrap; margin-left: 16px; }
.article-item .summary { font-size: 0.82rem; color: #94a3b8; line-height: 1.5; margin-top: 4px; }
.article-item .tags { display: flex; gap: 6px; margin-top: 8px; }

/* === Article Detail === */
.article-header { margin-bottom: 40px; }
.article-header h1 { font-size: 1.75rem; font-weight: 800; margin-bottom: 10px; letter-spacing: -0.01em; }
.article-header .meta { display: flex; align-items: center; gap: 16px; font-size: 0.8rem; color: #64748b; }
.article-header .meta time { font-family: 'JetBrains Mono', monospace; }

/* Prose */
.prose h1 { font-size: 1.4rem; font-weight: 700; margin: 2rem 0 0.75rem; color: #e2e8f0; }
.prose h2 { font-size: 1.15rem; font-weight: 700; margin: 1.75rem 0 0.75rem; color: #e2e8f0; border-left: 3px solid #7c3aed; padding-left: 12px; }
.prose h3 { font-size: 1.05rem; font-weight: 600; margin: 1.5rem 0 0.5rem; color: #e2e8f0; }
.prose p { margin: 0.75rem 0; line-height: 1.85; color: #c4b5fdaa; font-size: 0.95rem; }
.prose a { color: #a78bfa; text-decoration: none; border-bottom: 1px solid #a78bfa44; }
.prose a:hover { color: #c4b5fd; border-bottom-color: #c4b5fd; }
.prose ul, .prose ol { margin: 0.75rem 0; padding-left: 1.5rem; color: #c4b5fdaa; }
.prose li { margin: 0.35rem 0; line-height: 1.85; }
.prose li::marker { color: #7c3aed; }
.prose blockquote {
    border-left: 3px solid #7c3aed;
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    background: #1a164066;
    border-radius: 0 6px 6px 0;
    color: #94a3b8;
}
.prose img { max-width: 100%; border-radius: 6px; margin: 1rem 0; }
.prose hr { border: none; border-top: 1px solid #302b6333; margin: 2rem 0; }
.prose strong { color: #e2e8f0; }
.prose pre {
    background: #0a0820;
    border: 1px solid #302b6333;
    border-left: 3px solid #7c3aed;
    border-radius: 6px;
    padding: 1rem 1.25rem;
    overflow-x: auto;
    margin: 1rem 0;
    font-size: 0.82rem;
    line-height: 1.7;
}
.prose code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.875em;
}
.prose :not(pre) > code {
    background: #1a164055;
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
    color: #c4b5fd;
    border: 1px solid #302b6333;
}

/* Nav prev/next */
.article-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 48px;
    padding-top: 20px;
    border-top: 1px solid #302b6333;
}
.article-nav a {
    font-size: 0.85rem;
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s;
}
.article-nav a:hover { color: #a78bfa; }

/* === About Page === */
.about-section { margin-bottom: 36px; }
.about-section h2 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #7c3aed;
    margin-bottom: 16px;
    font-family: 'JetBrains Mono', monospace;
}
.tech-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.tech-item {
    background: #1a164077;
    border: 1px solid #302b6344;
    border-radius: 6px;
    padding: 14px;
}
.tech-item .name { font-weight: 600; font-size: 0.9rem; }
.tech-item .level { font-size: 0.7rem; color: #64748b; margin-top: 2px; }

/* === 404 === */
.not-found { text-align: center; padding: 80px 0; }
.not-found h1 { font-size: 5rem; font-weight: 800; color: #7c3aed; margin-bottom: 8px; }
.not-found p { color: #94a3b8; font-size: 1.1rem; margin-bottom: 24px; }
.not-found a { color: #a78bfa; text-decoration: none; border-bottom: 1px solid #a78bfa44; }
.not-found a:hover { border-bottom-color: #a78bfa; }

/* === Section Divider === */
.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, #302b6355, transparent);
    margin: 48px 0;
}

/* === Theme Picker === */
#theme-picker {
    display: inline-flex;
    gap: 2px;
    margin-left: 4px;
    vertical-align: middle;
}
.theme-btn {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    padding: 2px 6px;
    background: transparent;
    color: #64748b;
    border: 1px solid transparent;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1.4;
}
.theme-btn:hover { color: #a78bfa; border-color: #302b63; }
.theme-btn.active { color: #a78bfa; border-color: #7c3aed; background: #7c3aed22; }

/* === Responsive === */
@media (max-width: 640px) {
    .hero-name { font-size: 1.75rem; }
    .projects-grid { grid-template-columns: 1fr; }
    .tech-grid { grid-template-columns: repeat(2, 1fr); }
    .container { padding: 0 16px; }
    main { padding: 32px 0; }
    .nav-links { gap: 20px; }
}
