/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
    padding-top: 60px;
    padding-bottom: 80px;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: #fff;
    border-bottom: 1px solid #e5e5e5;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-link {
    text-decoration: none;
    color: #666;
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 8px 0;
    border-bottom: 2px solid transparent;
}

.nav-link:hover,
.nav-link.active {
    color: #333;
    border-bottom-color: #333;
}

/* Main content */
.main-content {
    min-height: calc(100vh - 140px);
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Tab content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Welcome section */
.welcome-section {
    text-align: center;
    margin-bottom: 60px;
}

.welcome-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #333;
}

.welcome-subtitle {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 40px;
}

.profile-section {
    margin-top: 40px;
}

.profile-section::after {
    content: "";
    display: table;
    clear: both;
}

.profile-image {
    width: 200px;
    height: 200px;
    border-radius: 0;
    overflow: hidden;
    border: 3px solid #f0f0f0;
    float: left;
    margin-right: 30px;
    margin-bottom: 20px;
    shape-outside: margin-box;
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.image-placeholder {
    width: 100%;
    height: 100%;
    background-color: #f8f8f8;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 0.9rem;
    text-align: center;
}

.profile-text {
    text-align: left;
    max-width: 600px;
}

.intro-text,
.mission-text,
.interests-text {
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: #444;
}

.interests-list {
    list-style: none;
    margin-top: 20px;
}

.interests-list li {
    padding: 8px 0;
    color: #555;
    position: relative;
    padding-left: 20px;
}

.interests-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #333;
    font-weight: bold;
}

/* Section titles */
.section-title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 40px;
    color: #333;
    text-align: center;
}

/* Publications */
.publications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.publication-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 25px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.publication-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.publication-card h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: #333;
}

.publication-date {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.publication-description {
    color: #555;
    margin-bottom: 20px;
    line-height: 1.6;
}

.publication-link {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid #333;
    transition: border-color 0.3s ease;
}

.publication-link:hover {
    border-bottom-color: transparent;
}

/* Writing */
.subscription-embed-container {
    display: flex;
    justify-content: center;
    margin: 30px 0 40px 0;
    width: 100%;
}

.subscription-embed-container iframe {
    max-width: 100%;
    width: 480px;
    height: 320px;
}

.writing-list {
    display: flex;
    flex-direction: column;
    gap: 40px;
    margin-top: 40px;
}

.writing-item {
    border-bottom: 1px solid #e5e5e5;
    padding-bottom: 30px;
    transition: transform 0.2s ease;
}

.writing-item:hover {
    transform: translateX(5px);
}

.writing-item:last-child {
    border-bottom: none;
}

.writing-title {
    font-size: 1.4rem;
    margin-bottom: 10px;
    color: #333;
    line-height: 1.3;
}

.writing-date {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.writing-excerpt {
    color: #555;
    margin-bottom: 20px;
    line-height: 1.6;
    font-size: 1rem;
}

.writing-link {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid #333;
    transition: border-color 0.3s ease;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.writing-link:hover {
    border-bottom-color: transparent;
}

/* Post header with source badges */
.post-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.source-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 12px;
    background-color: #f0f0f0;
    color: #666;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.source-badge.substack {
    background-color: #ff6719;
    color: white;
}

/* Post page styles */
.post-content {
    max-width: 700px;
    margin: 0 auto;
    padding: 40px 0;
}

.post-header-full {
    margin-bottom: 40px;
    text-align: center;
}

.post-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #333;
    line-height: 1.2;
}

.post-date {
    color: #666;
    font-size: 1rem;
    margin-bottom: 5px;
}

.post-meta {
    color: #999;
    font-size: 0.9rem;
    font-style: italic;
}

.post-body {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #444;
}

.post-body h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 40px 0 20px 0;
    color: #333;
}

.post-body h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 30px 0 15px 0;
    color: #333;
}

.post-body p {
    margin-bottom: 20px;
}

.post-body ul, .post-body ol {
    margin-bottom: 20px;
    padding-left: 20px;
}

.post-body li {
    margin-bottom: 8px;
}

.post-body code {
    background-color: #f5f5f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
}

.post-body a {
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #333;
    transition: border-color 0.3s ease;
}

.post-body a:hover {
    border-bottom-color: transparent;
}

.post-footer {
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid #e5e5e5;
}

.back-link {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid #333;
    transition: border-color 0.3s ease;
}

.back-link:hover {
    border-bottom-color: transparent;
}

/* Responsive design for posts */
@media (max-width: 768px) {
    .post-title {
        font-size: 2rem;
    }
    
    .post-body {
        font-size: 1rem;
    }
    
    .post-content {
        padding: 20px 0;
    }
}

/* Loading and error states */
.loading {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
}

.error-message {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.error-message p {
    margin-bottom: 15px;
}

.error-message a {
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #333;
    transition: border-color 0.3s ease;
}

.error-message a:hover {
    border-bottom-color: transparent;
}

/* Responsive design */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        height: auto;
        padding: 15px 20px;
        gap: 15px;
    }
    
    .nav-brand {
        font-size: 1.5rem;
        align-self: flex-start;
    }
    
    .nav-menu {
        gap: 20px;
        align-self: flex-end;
    }
    
    .welcome-title {
        font-size: 2rem;
    }
    
    .profile-image {
        width: 150px;
        height: 150px;
        float: none;
        margin: 0 auto 20px auto;
        display: block;
    }
    
    .publications-grid {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 20px 15px;
    }
    
    .subscription-embed-container iframe {
        width: 100% !important;
        max-width: 100%;
        height: 320px;
    }
}

@media (max-width: 480px) {
    .nav-brand {
        font-size: 1.3rem;
    }
    
    .nav-container {
        padding: 10px 15px;
        gap: 10px;
    }
    
    .nav-menu {
        gap: 15px;
    }
    
    .welcome-title {
        font-size: 1.8rem;
    }
    
    .profile-image {
        width: 120px;
        height: 120px;
        float: none;
        margin: 0 auto 20px auto;
        display: block;
    }
}

/* Footer */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: #fff;
    border-top: 1px solid #e5e5e5;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.1);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-links {
    display: flex;
    gap: 30px;
    align-items: center;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #666;
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 8px 0;
}

.social-link:hover {
    color: #333;
}

.social-link svg {
    transition: transform 0.3s ease;
}

.social-link:hover svg {
    transform: scale(1.1);
}

.social-link-text {
    font-size: 0.9rem;
}

/* Responsive footer */
@media (max-width: 768px) {
    body {
        padding-bottom: 70px;
    }
    
    .footer-container {
        height: 70px;
        padding: 0 15px;
    }
    
    .social-links {
        gap: 20px;
    }
    
    .social-link-text {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    body {
        padding-bottom: 60px;
    }
    
    .footer-container {
        height: 60px;
        padding: 0 10px;
    }
    
    .social-links {
        gap: 15px;
    }
    
    .social-link-text {
        display: none;
    }
    
    .social-link {
        padding: 8px;
    }
} 