/* 1. Light Mode Variables */
:root {
    --background-color: #fafafa;
    --text-color: #111827;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    --nav-background: rgba(250, 250, 250, 0.8);
    --footer-background: #f3f4f6;
    --card-background: #ffffff;
    --card-hover-background: #ffffff;
    --input-background: #ffffff;
    --input-text-color: #111827;
    --button-background: #111827;
    --button-text-color: #ffffff;
    --button-hover: #374151;
    --link-color: #2563eb;
    --link-hover-color: #1d4ed8;
    --border-color: #e5e7eb;
    --border-subtle: #f3f4f6;
    --code-background: #f3f4f6;
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.06), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
    --accent-subtle: #f0f5ff;
    --accent-border: #dbeafe;
    --divider: #e5e7eb;
    --gradient-subtle: linear-gradient(135deg, #f0f5ff 0%, #faf5ff 100%);
    --tag-background: #f3f4f6;
    --tag-color: #4b5563;
}

/* 2. Dark Mode Variables */
body.dark-mode {
    --background-color: #09090b;
    --text-color: #f4f4f5;
    --text-secondary: #a1a1aa;
    --text-tertiary: #71717a;
    --nav-background: rgba(9, 9, 11, 0.8);
    --footer-background: #18181b;
    --card-background: #18181b;
    --card-hover-background: #1f1f23;
    --input-background: #27272a;
    --input-text-color: #f4f4f5;
    --button-background: #f4f4f5;
    --button-text-color: #09090b;
    --button-hover: #d4d4d8;
    --link-color: #60a5fa;
    --link-hover-color: #93bbfd;
    --border-color: #27272a;
    --border-subtle: #1f1f23;
    --code-background: #18181b;
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
    --accent-subtle: rgba(59, 130, 246, 0.08);
    --accent-border: rgba(59, 130, 246, 0.2);
    --divider: #27272a;
    --gradient-subtle: linear-gradient(135deg, rgba(59, 130, 246, 0.06) 0%, rgba(139, 92, 246, 0.06) 100%);
    --tag-background: #27272a;
    --tag-color: #a1a1aa;
}

/* 3. Base Styles */
* {
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 16px;
    letter-spacing: -0.011em;
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--link-hover-color);
}

/* 4. Navigation */
.navbar {
    background: var(--nav-background);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    padding: 0 24px;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    box-sizing: border-box;
}

/* Desktop Navigation */
.desktop-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    height: 56px;
}

.desktop-nav .nav-links ul {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
    gap: 2px;
}

.desktop-nav .nav-links li a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.875em;
    padding: 6px 14px;
    border-radius: 6px;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.desktop-nav .nav-links li a:hover {
    background-color: var(--accent-subtle);
    color: var(--text-color);
    text-decoration: none;
}

.desktop-nav .theme-toggle-container {
    margin-left: auto;
}

/* Mobile Navigation */
.mobile-nav {
    display: none;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    height: 48px;
}

.mobile-home {
    font-size: 1.2em;
    color: var(--text-color);
    padding: 0 8px;
}

.mobile-menu-toggle {
    background: none;
    border: none;
    font-size: 1.2em;
    color: var(--text-color);
    cursor: pointer;
    padding: 0 8px;
    outline: none;
}

/* Mobile Menu Panel */
.mobile-menu-panel {
    display: none;
    position: fixed;
    top: 48px;
    left: 0;
    width: 100%;
    background-color: var(--nav-background);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    z-index: 999;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.mobile-menu-panel ul {
    list-style: none;
    margin: 0;
    padding: 0;
    text-align: center;
}

.mobile-menu-panel li {
    margin: 4px 0;
}

.mobile-menu-panel li a {
    text-decoration: none;
    color: var(--text-color);
    font-size: 1em;
    font-weight: 500;
    display: block;
    padding: 10px 0;
}

.mobile-menu-panel li a:hover {
    color: var(--link-color);
}

.mobile-menu-panel.open {
    display: block;
}

/* Theme Toggle Buttons */
.theme-toggle-container {
    margin-left: auto;
}

#theme-toggle {
    background: none;
    border: 1px solid var(--border-color);
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.95em;
    padding: 6px 8px;
    border-radius: 8px;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    line-height: 1;
}

#theme-toggle:hover {
    background-color: var(--accent-subtle);
    color: var(--text-color);
    border-color: var(--accent-border);
}

#theme-toggle:focus {
    outline: none;
}

.mobile-theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 1.2em;
    padding: 5px;
    outline: none;
}

/* 5. Main Content */
#content {
    flex: 1;
    padding: 80px 24px 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 6. Home Page Styles */
.home-page {
    width: 100%;
    max-width: 640px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 16px;
}

.home-page h1 {
    font-size: 2.25em;
    margin-bottom: 2px;
    letter-spacing: -0.04em;
    font-weight: 700;
    line-height: 1.15;
}

.home-page h4 {
    font-size: 1em;
    font-weight: 400;
    color: var(--text-secondary);
    margin-top: 0;
    margin-bottom: 32px;
    letter-spacing: 0;
}

.intro-text {
    margin-bottom: 14px;
    text-align: center;
    line-height: 1.7;
    word-wrap: break-word;
    width: 100%;
    max-width: 560px;
    font-weight: 400;
    font-size: 0.975em;
    color: var(--text-secondary);
}

.intro-text a {
    font-weight: 500;
    text-decoration: underline;
    text-decoration-color: var(--accent-border);
    text-underline-offset: 2px;
    transition: text-decoration-color 0.15s ease, color 0.15s ease;
}

.intro-text a:hover {
    text-decoration-color: var(--link-color);
}

.intro-image {
    width: 100%;
    max-width: 140px;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 24px;
    box-shadow: var(--shadow-lg);
    border: 3px solid var(--card-background);
}

/* 7. Contact Section */
#contact-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 2.5rem auto;
    max-width: 480px;
    width: 100%;
    background: var(--card-background);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    padding: 2rem;
}

.contact-form-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}

.contact-form-wrapper h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

#contact-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

#contact-form label {
    font-weight: 500;
    font-size: 0.8125em;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    letter-spacing: 0;
}

#contact-form input,
#contact-form select,
#contact-form textarea {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9375rem;
    font-family: inherit;
    background: var(--input-background);
    color: var(--input-text-color);
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#contact-form input:focus,
#contact-form select:focus,
#contact-form textarea:focus {
    outline: none;
    border-color: var(--link-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

#contact-form textarea {
    resize: vertical;
    min-height: 100px;
}

#contact-form button[type="submit"] {
    margin-top: 0.75rem;
    padding: 0.625rem;
    background: var(--button-background);
    color: var(--button-text-color);
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: -0.01em;
    transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

#contact-form button[type="submit"]:hover {
    background: var(--button-hover);
    box-shadow: var(--shadow-md);
}

#contact-form button[type="submit"]:active {
    transform: scale(0.98);
}

#form-response {
    margin-top: 1rem;
    text-align: center;
    font-weight: 500;
    font-size: 0.9375em;
}

/* 8. Footer */
footer {
    background-color: var(--footer-background);
    border-top: 1px solid var(--divider);
    text-align: center;
    padding: 20px 16px;
    font-weight: 400;
    font-size: 0.8125em;
    color: var(--text-tertiary);
    margin-top: auto;
}

footer p {
    margin: 3px 0;
}

footer a {
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.15s ease;
}

footer a:hover {
    color: var(--text-color);
}

.heart {
    color: #ef4444;
    margin: 0 2px;
    font-size: 1em;
    vertical-align: middle;
}

/* 9. Links Page Styles */
.links-page {
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 0;
}

.links-header {
    text-align: center;
    margin-bottom: 36px;
}

.links-header h1 {
    font-size: 2em;
    margin-bottom: 8px;
    letter-spacing: -0.04em;
    font-weight: 700;
}

.links-header p {
    font-size: 0.975em;
    color: var(--text-secondary);
    max-width: 520px;
    line-height: 1.65;
}

.links-section {
    width: 100%;
    margin-bottom: 20px;
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px 24px;
    text-align: center;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.links-section:hover {
    box-shadow: var(--shadow-sm);
}

.links-section h2 {
    font-size: 0.75em;
    margin-bottom: 14px;
    font-weight: 600;
    color: var(--text-tertiary);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-bottom: none;
    display: block;
    padding-bottom: 0;
}

.links-section h2::after {
    display: none;
}

.links-section ul {
    list-style: none;
    padding: 0;
    margin: 0 auto;
}

.links-section ul li {
    margin-bottom: 6px;
}

.links-section ul li a {
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.9375em;
    transition: color 0.15s ease;
    font-weight: 450;
}

.links-section ul li a:hover {
    color: var(--link-color);
}

.socials-list {
    display: flex;
    flex-direction: row;
    gap: 8px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.socials-list li a {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.875em;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.socials-list li a:hover {
    color: var(--link-color);
    background-color: var(--accent-subtle);
    border-color: var(--accent-border);
    box-shadow: var(--shadow-sm);
}

.socials-list li a i {
    font-size: 1em;
}

/* 10. Blog Listing Styles */
.blog-page {
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 0;
}

.blog-header {
    text-align: center;
    margin-bottom: 36px;
}

.blog-header h1 {
    font-size: 2em;
    margin-bottom: 8px;
    letter-spacing: -0.04em;
    font-weight: 700;
}

.blog-header p {
    font-size: 0.975em;
    color: var(--text-secondary);
}

.blog-entries {
    width: 100%;
}

.blog-entries h2 {
    font-size: 0.75em;
    font-weight: 600;
    margin-top: 28px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
    border-bottom: none;
    display: block;
    padding-bottom: 0;
    padding-left: 2px;
}

.blog-entries ul {
    list-style: none;
    padding: 0;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.blog-entries ul li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.blog-entries ul li:hover {
    background-color: var(--card-background);
    border-color: var(--border-color);
}

.blog-entries ul li a {
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.9375em;
    font-weight: 500;
    transition: color 0.15s ease;
}

.blog-entries ul li a:hover {
    color: var(--link-color);
}

.blog-entries ul li .date {
    margin-left: 16px;
    font-size: 0.8125em;
    color: var(--text-tertiary);
    white-space: nowrap;
    font-weight: 400;
    font-variant-numeric: tabular-nums;
}

/* 11. Single Post Page Styles */
.post-page {
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    padding: 16px 0;
}

.post-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--divider);
}

.post-header h1 {
    font-size: 2.1em;
    margin-bottom: 10px;
    letter-spacing: -0.035em;
    line-height: 1.2;
    font-weight: 700;
}

.post-header .post-meta {
    font-size: 0.875em;
    color: var(--text-tertiary);
    margin-top: 4px;
    margin-bottom: 16px;
}

.post-header a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.8125em;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.15s ease, gap 0.15s ease;
}

.post-header a:hover {
    color: var(--link-color);
    gap: 6px;
}

.post-content {
    width: 100%;
    font-size: 1.0125em;
    line-height: 1.75;
    word-wrap: break-word;
}

.post-content h2 {
    font-size: 1.35em;
    margin: 36px 0 12px 0;
    letter-spacing: -0.025em;
    font-weight: 650;
}

.post-content h3 {
    font-size: 1.15em;
    margin: 28px 0 10px 0;
    font-weight: 600;
    letter-spacing: -0.015em;
}

.post-content p {
    margin-bottom: 16px;
}

.post-content ul,
.post-content ol {
    margin-bottom: 16px;
    padding-left: 24px;
}

.post-content li {
    margin-bottom: 6px;
}

.post-content blockquote {
    border-left: 2px solid var(--link-color);
    margin: 24px 0;
    padding: 14px 20px;
    background-color: var(--accent-subtle);
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: var(--text-secondary);
}

.post-content blockquote p:last-child {
    margin-bottom: 0;
}

.post-content code {
    background-color: var(--code-background);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.875em;
    font-family: 'SF Mono', 'Fira Code', 'JetBrains Mono', Menlo, Consolas, monospace;
    border: 1px solid var(--border-color);
}

.post-content pre {
    margin: 20px 0;
    border-radius: 10px;
    overflow-x: auto;
}

.post-content pre code {
    display: block;
    padding: 1.125em 1.25em;
    background-color: var(--code-background);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.8125em;
    line-height: 1.65;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 20px 0;
    box-shadow: var(--shadow-sm);
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 0.9375em;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.post-content thead {
    background-color: var(--accent-subtle);
}

.post-content th,
.post-content td {
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    text-align: left;
}

.post-content th {
    font-weight: 600;
    font-size: 0.8125em;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
}

.post-content strong {
    font-weight: 600;
}

.post-content a {
    color: var(--link-color);
    text-decoration: underline;
    text-decoration-color: var(--accent-border);
    text-underline-offset: 3px;
    transition: text-decoration-color 0.15s ease, color 0.15s ease;
}

.post-content a:hover {
    color: var(--link-hover-color);
    text-decoration-color: var(--link-hover-color);
}

.post-content hr {
    border: none;
    border-top: 1px solid var(--divider);
    margin: 32px 0;
}

/* 12. Responsive Design */
@media (max-width: 600px) {
    .desktop-nav {
        display: none;
    }
    .mobile-nav {
        display: flex;
    }

    .navbar {
        flex-direction: column;
        padding: 0 16px;
    }

    #content {
        padding: 64px 16px 32px;
    }

    .home-page {
        padding-top: 8px;
    }

    .home-page h1 {
        font-size: 1.75em;
    }

    .intro-text {
        margin-bottom: 12px;
        padding: 0 4px;
        font-size: 0.925em;
    }

    .intro-image {
        max-width: 110px;
        margin-bottom: 20px;
    }

    #contact-section {
        margin: 1.5rem 0;
        padding: 1.25rem;
        border-radius: 10px;
    }

    footer {
        padding: 16px 12px;
        font-size: 0.75em;
    }

    /* Links page mobile */
    .links-page {
        padding: 0 4px;
    }
    .links-header h1 {
        font-size: 1.5em;
    }
    .links-section {
        padding: 16px;
        border-radius: 10px;
    }
    .links-section h2 {
        font-size: 0.6875em;
    }
    .socials-list {
        flex-direction: column;
        gap: 6px;
    }

    /* Blog listing mobile */
    .blog-page {
        padding: 0 4px;
    }
    .blog-header h1 {
        font-size: 1.5em;
    }
    .blog-entries h2 {
        font-size: 0.6875em;
    }
    .blog-entries ul li {
        flex-wrap: wrap;
        justify-content: flex-start;
        padding: 10px 12px;
        border-radius: 8px;
    }
    .blog-entries ul li .date {
        margin-left: 0;
        margin-top: 2px;
        width: 100%;
    }

    /* Post page mobile */
    .post-page {
        padding: 0 4px;
    }
    .post-header {
        margin-bottom: 28px;
        padding-bottom: 18px;
    }
    .post-header h1 {
        font-size: 1.5em;
    }
    .post-content {
        font-size: 0.975em;
    }
    .post-content h2 {
        font-size: 1.2em;
    }
    .post-content pre code {
        font-size: 0.75em;
        padding: 0.875em;
        border-radius: 8px;
    }
    .post-content blockquote {
        padding: 10px 14px;
        border-radius: 0 6px 6px 0;
    }
}
