:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #1a1a1a;
    --text-secondary: #4a5568;
    --text-tertiary: #718096;
    --border-color: #e2e8f0;
    --accent-color: #2563eb;
    --accent-hover: #1d4ed8;
}

[data-theme="dark"] {
    --bg-primary: #0a0a0a;
    --bg-secondary: #141414;
    --text-primary: #f5f5f5;
    --text-secondary: #a3a3a3;
    --text-tertiary: #737373;
    --border-color: #262626;
    --accent-color: #3b82f6;
    --accent-hover: #60a5fa;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(90deg, var(--border-color) 1px, transparent 1px),
        linear-gradient(var(--border-color) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.3;
    pointer-events: none;
    z-index: -1;
}

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

/* Navigation */
.nav {
    position: sticky;
    top: 0;
    background-color: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid var(--border-color);
    padding: 20px 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

[data-theme="dark"] .nav {
    background-color: rgba(10, 10, 10, 0.8);
}

.nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.logo:hover {
    opacity: 0.7;
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.theme-toggle:hover {
    color: var(--text-primary);
}

[data-theme="dark"] .theme-toggle .sun {
    display: none;
}

.theme-toggle .moon {
    display: none;
}

[data-theme="dark"] .theme-toggle .moon {
    display: block;
}

/* Article Layout */
.article {
    padding: 60px 0 100px;
}

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

/* Article Header */
.article-header {
    margin-bottom: 60px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--border-color);
}

.article-meta {
    font-size: 14px;
    color: var(--text-tertiary);
    margin-bottom: 16px;
    letter-spacing: 0.3px;
}

.article-title {
    font-family: 'Crimson Pro', Georgia, serif;
    font-size: 48px;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
}

.article-lead {
    font-size: 20px;
    line-height: 1.7;
    color: var(--text-secondary);
}

/* Article Content */
.article-content {
    font-size: 17px;
    line-height: 1.8;
    color: var(--text-secondary);
}

.article-section {
    margin-bottom: 48px;
}

.article-section h2 {
    font-family: 'Crimson Pro', Georgia, serif;
    font-size: 32px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    margin-top: 48px;
    letter-spacing: -0.01em;
}

.article-section h3 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    margin-top: 24px;
}

.article-section h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    margin-top: 16px;
}

.article-section p {
    margin-bottom: 20px;
}

.article-section strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Callout Box */
.callout {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(59, 130, 246, 0.02) 100%);
    border: 2px solid var(--accent-color);
    border-radius: 16px;
    padding: 40px;
    margin: 48px 0;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.1);
    transition: all 0.3s ease;
}

.callout:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(37, 99, 235, 0.15);
}

.callout-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.callout h3 {
    font-size: 28px;
    color: var(--text-primary);
    margin: 0;
    font-weight: 600;
}

.callout-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    margin: 12px 0 24px 0;
    font-weight: 500;
}

.feature-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 24px 0;
}

.feature-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.feature-item strong {
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 600;
}

.feature-item span {
    font-size: 14px;
    color: var(--text-secondary);
}

.link-arrow.primary {
    display: inline-block;
    margin-top: 8px;
    padding: 12px 24px;
    background-color: var(--accent-color);
    color: white;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.link-arrow.primary:hover {
    background-color: var(--accent-hover);
    transform: translateX(4px);
}

.badge {
    font-size: 12px;
    padding: 4px 12px;
    background-color: var(--accent-color);
    color: white;
    border-radius: 12px;
    font-weight: 500;
}

.callout p {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.feature-list {
    list-style: none;
    margin: 20px 0;
}

.feature-list li {
    padding-left: 24px;
    margin-bottom: 8px;
    position: relative;
    color: var(--text-secondary);
}

.feature-list li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--accent-color);
}

.callout-footer {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 20px;
    margin-bottom: 16px;
}

.tech-tag {
    display: inline-block;
    font-size: 13px;
    padding: 4px 12px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
}

.link-arrow {
    display: inline-block;
    color: var(--text-secondary);
    text-decoration: underline;
    text-underline-offset: 3px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.link-arrow:hover {
    color: var(--text-primary);
    text-underline-offset: 5px;
}

.inline-link {
    color: var(--text-secondary);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: all 0.2s ease;
}

.inline-link:hover {
    color: var(--text-primary);
    text-underline-offset: 5px;
}

/* Project List */
.project-list {
    display: flex;
    flex-direction: column;
    gap: 32px;
    margin-top: 24px;
}

.project-item {
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border-color);
}

.project-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.project-item h3 {
    margin-top: 0;
}

.project-item p {
    margin-bottom: 12px;
}

.project-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Stack Grid */
.stack-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 24px;
}

.stack-category {
    padding: 20px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.stack-category h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stack-category p {
    margin: 0;
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Contact Grid */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 24px;
}

.contact-card {
    display: flex;
    flex-direction: column;
    padding: 20px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.contact-card:hover {
    border-color: var(--accent-color);
    transform: translateX(2px);
}

.contact-label {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-bottom: 4px;
}

.contact-value {
    font-size: 16px;
    color: var(--text-primary);
    font-weight: 500;
}

/* Article Footer */
.article-footer {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.article-footer p {
    font-size: 14px;
    color: var(--text-tertiary);
}

/* Responsive */
@media (max-width: 768px) {
    .article-title {
        font-size: 36px;
    }

    .article-lead {
        font-size: 18px;
    }

    .article-section h2 {
        font-size: 28px;
    }

    .article-content {
        font-size: 16px;
    }

    .callout {
        padding: 24px;
    }

    .stack-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .article-container {
        padding: 0 20px;
    }

    .callout-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .article-title {
        font-size: 32px;
    }

    .article-section h2 {
        font-size: 24px;
    }
}

/* Smooth transitions */
* {
    transition-property: background-color, border-color, color;
    transition-duration: 0.2s;
    transition-timing-function: ease;
}
