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

html {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #fafafa;
    color: #333;
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navigation Bar */
.navbar {
    background-color: white;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 0;
    justify-content: center;
}

.nav-links li a {
    display: block;
    color: #6b7280;
    text-decoration: none;
    padding: 1.5rem 2rem;
    transition: color 0.2s ease;
    font-weight: 400;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
}

.nav-links li a:hover {
    color: #5f9ea0;
}

.nav-links li a.active {
    color: #5f9ea0;
    font-weight: 500;
}

/* Main Container */
.main-container {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    flex: 1 0 auto;
    width: 100%;
}

/* Sidebar - only for about page */
.sidebar {
    background-color: #f9fafb;
    border-right: 1px solid #e5e7eb;
    width: 300px;
    padding: 4rem 2rem;
}

.profile-section {
    text-align: center;
}

.profile-image {
    width: 200px;
    height: 200px;
    margin: 0 auto 2rem;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #c3e0cf;
}

.profile-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    object-position: center center;
    min-height: 100%;
}

.placeholder-image {
    width: 200px;
    height: 200px;
    background-color: #d1e7dd;
    border-radius: 50%;
    margin: 0 auto 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #c3e0cf;
}

.placeholder-image span {
    color: #6b9080;
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.05em;
}

.profile-name {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: 500;
}

.profile-links {
    display: inline-flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
}

.profile-location {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #6b7280;
    font-size: 0.9rem;
}

.profile-location svg {
    flex-shrink: 0;
    width: 18px;
}

.profile-social {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.profile-social a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #6b7280;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.profile-social a svg {
    flex-shrink: 0;
    width: 18px;
}

.profile-social a:hover {
    color: #5f9ea0;
}

/* Main Content */
.content {
    flex: 1;
    padding: 4rem;
    background-color: white;
    max-width: 900px;
    margin: 0 auto;
}

.content.full-width {
    max-width: 100%;
}

.intro-section h2 {
    color: #333;
    font-size: 2rem;
    font-weight: 400;
    margin-bottom: 2rem;
    letter-spacing: -0.02em;
}

.intro-section p {
    margin-bottom: 1.5rem;
    font-size: 1rem;
    color: #4b5563;
    line-height: 1.8;
}

/* Page Headings */
h1, h2, h3 {
    color: #333;
    font-weight: 400;
}

h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    letter-spacing: -0.02em;
}

h3 {
    font-size: 1.3rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

/* Links */
a {
    color: #5f9ea0;
    transition: color 0.2s ease;
    text-decoration: none;
}

a:hover {
    color: #4a7a7c;
}

/* Blog Sidebar */
.blog-sidebar {
    width: 300px;
    background-color: #fafafa;
    border-right: 1px solid #e5e7eb;
    position: relative;
    overflow: hidden;
    min-height: 100vh;
}

/* Dynamic square pattern - two layers for crossfade animation */
.blog-sidebar .pattern-layer {
    position: absolute;
    inset: 0;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-position: left top;
    transition: opacity 2s ease-in-out;
}

.blog-sidebar .pattern-layer-1 {
    background-image: var(--pattern-bg-1);
}

.blog-sidebar .pattern-layer-2 {
    background-image: var(--pattern-bg-2);
}

/* Blog Posts */
.blog-posts {
    display: grid;
    gap: 3rem;
}

.blog-post {
    padding: 0;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 3rem;
    transition: opacity 0.2s ease;
}

.blog-post:hover {
    opacity: 0.8;
}

.blog-post:last-child {
    border-bottom: none;
}

.blog-post h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.4rem;
    font-weight: 500;
}

.blog-post h3 a {
    color: #5f9ea0;
    text-decoration: underline;
    border-bottom: none;
}

.blog-post h3 a:hover {
    color: #4a8a8c;
}

.blog-post .date {
    color: #9ca3af;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    display: block;
    letter-spacing: 0.02em;
}

.blog-post p {
    color: #4b5563;
    line-height: 1.8;
}

/* Full Blog Post Page */
.blog-post-full {
    max-width: 800px;
    margin: 0 auto;
}

.blog-post-full h1 {
    font-size: 2.5rem;
    font-weight: 500;
    color: #333;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.blog-post-full .date {
    color: #9ca3af;
    font-size: 0.9rem;
    margin-bottom: 2rem;
    display: block;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e5e7eb;
}

.blog-post-full h2 {
    font-size: 1.8rem;
    font-weight: 500;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.blog-post-full h3 {
    font-size: 1.4rem;
    font-weight: 500;
    margin-top: 2rem;
    margin-bottom: 0.8rem;
}

.blog-post-full p {
    margin-bottom: 1.5rem;
    color: #4b5563;
    line-height: 1.8;
}

.blog-post-full ul, .blog-post-full ol {
    margin-bottom: 1.5rem;
    margin-left: 2rem;
    color: #4b5563;
    line-height: 1.8;
}

.blog-post-full li {
    margin-bottom: 0.5rem;
}

.blog-post-full code {
    background-color: #f3f4f6;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #5f9ea0;
}

.blog-post-full pre {
    background-color: #f3f4f6;
    padding: 1rem;
    border-radius: 5px;
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.blog-post-full pre code {
    background-color: transparent;
    padding: 0;
    color: #333;
}

.blog-post-full blockquote {
    border-left: 4px solid #5f9ea0;
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    color: #6b7280;
    font-style: italic;
}

.blog-post-full table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

.blog-post-full table th,
.blog-post-full table td {
    border: 1px solid #e5e7eb;
    padding: 0.75rem;
    text-align: left;
}

.blog-post-full table th {
    background-color: #f9fafb;
    font-weight: 500;
    color: #333;
}

.blog-post-full table td {
    color: #4b5563;
}

.blog-post-full hr {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 2rem 0;
}

.blog-post-full a {
    color: #5f9ea0;
    text-decoration: none;
    border-bottom: 1px solid #5f9ea0;
}

.blog-post-full a:hover {
    color: #4a7a7c;
    border-bottom-color: #4a7a7c;
}

/* Sidebar for individual blog posts */
.blog-post-sidebar {
    width: 80px;
    background-color: #fafafa;
    border-right: 1px solid #e5e7eb;
    position: relative;
    flex-shrink: 0;
}

.blog-post-sidebar .pattern-layer {
    position: absolute;
    inset: 0;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-position: left top;
}

/* Back link for blog posts */
.back-link {
    display: inline-block;
    margin-bottom: 2rem;
    color: #6b7280;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s ease;
    border-bottom: none;
}

.back-link:hover {
    color: #5f9ea0;
}

/* CV Sections */
.cv-section {
    margin-bottom: 3rem;
}

.cv-section h3 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    margin-top: 0;
    color: #5f9ea0;
    font-weight: 500;
}

.cv-item {
    margin-bottom: 2rem;
}

.cv-item h4 {
    color: #333;
    margin-bottom: 0.3rem;
    font-weight: 500;
    font-size: 1.05rem;
}

.cv-item .period {
    color: #9ca3af;
    font-style: normal;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.cv-item p {
    color: #4b5563;
    line-height: 1.8;
}

/* Footer */
.footer {
    background-color: white;
    border-top: 1px solid #e5e7eb;
    padding: 2rem 0;
    flex-shrink: 0;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer p {
    color: #6b7280;
    margin: 0;
    font-size: 0.9rem;
}

.social-links {
    display: flex;
    gap: 1.5rem;
}

.social-links a {
    color: #6b7280;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
}

.social-links a:hover {
    color: #5f9ea0;
}

.social-links svg {
    width: 20px;
    height: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        padding: 3rem 2rem;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
    }

    .blog-sidebar,
    .blog-post-sidebar {
        display: none;
    }

    .content {
        padding: 2rem 1.5rem;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .nav-links li a {
        padding: 1rem 1.2rem;
        font-size: 0.9rem;
    }

    .footer-container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}
