/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #48766c;
    --primary-dark: #365a54;
    --primary-light: #5a8a7f;
    --primary-hover: #5a8a7f;
    --secondary-color: #64748b;
    --text-color: #333333;
    --text-light: #666666;
    --bg-color: #ffffff;
    --section-bg: #f5f5f5;
    --border-color: #e0e0e0;
    --shadow: 0 2px 4px rgba(0,0,0,0.1);
    --max-width: 1100px;
    
    /* Skill bar colors */
    --skill-technical-bg: #e8f0ed;
    --skill-technical-fill: #48766c;
    --skill-hobbies-bg: #f0ebe8;
    --skill-hobbies-fill: #48766c;
}

[data-theme="dark"] {
    --text-color: #e0e0e0;
    --text-light: #b0b0b0;
    --bg-color: #121212;
    --section-bg: #1e1e1e;
    --border-color: #333333;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--bg-color);
    font-size: 18px;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    position: sticky;
    top: 0;
    width: 100%;
    background-color: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    box-shadow: var(--shadow);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.nav-brand a {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-color);
    text-decoration: none;
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-menu a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 400;
    transition: color 0.3s;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary-color);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.lang-switch {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.25rem 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: all 0.3s;
}

.lang-switch:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.theme-toggle-btn {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: var(--text-color);
}

/* Main Content */
main {
    display: block;
}

section {
    padding: 3rem 0;
}

h1, h2, h3, h4 {
    margin-bottom: 1rem;
}

h2 {
    font-size: 2rem;
    font-weight: 500;
    text-align: center;
    margin-bottom: 2rem;
}

h3 {
    font-size: 1.5rem;
    font-weight: 500;
}

/* Hero Section */
.hero-section {
    padding: 4rem 0;
}

.hero-wrapper {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 4rem;
    align-items: start;
}

.hero-left {
    text-align: center;
}

.profile-image {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.hero-left h1 {
    font-size: 1.75rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.hero-subtitle {
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.hero-role {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.hero-org a {
    color: var(--primary-color);
    text-decoration: none;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: center;
}

.social-links a {
    font-size: 1.25rem;
    color: var(--text-color);
    transition: color 0.3s;
}

.social-links a:hover {
    color: var(--primary-color);
}

.hero-right h2 {
    text-align: left;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.bio-content {
    text-align: justify;
    line-height: 1.8;
}

.bio-content p {
    margin-bottom: 1.5rem;
}

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

.bio-content a {
    color: var(--primary-color);
    text-decoration: none;
}

/* About Section */
.about-section {
    background-color: var(--section-bg);
}

.about-content {
    max-width: 1000px;
    margin: 0 auto;
}

/* Skills Grid - Technical and Hobbies side by side */
.skills-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    margin-bottom: 3rem;
}

.skill-column {
    flex: 1;
}

/* Info Grid - Interests and Education side by side */
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.interests-section h3,
.education-section h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.interests-list {
    list-style: none;
    padding: 0;
}

.interests-list li {
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem;
}

.interests-list i {
    color: var(--text-light);
    font-size: 0.9rem;
}

.education-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: start;
}

.education-item i {
    color: var(--text-light);
    font-size: 1.1rem;
    margin-top: 0.2rem;
    width: 1.4rem;
    text-align: center;
    flex-shrink: 0;
}

.education-content strong {
    display: block;
    margin-bottom: 0.25rem;
}

.education-content p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Skills Section */
.skills-section {
    text-align: center;
}

.skills-title {
    font-size: 1.75rem;
    margin-bottom: 2rem;
}

.skill-group-title {
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0 0 1rem;
    color: var(--text-light);
    letter-spacing: 0.5px;
}

.skill-item {
    margin-bottom: 1.5rem;
}

.skill-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.skill-header i {
    font-size: 1.1rem;
    color: var(--text-light);
}

.skill-name {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--text-light);
    letter-spacing: 0.5px;
}

.skill-bar {
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
}

.skill-bar-technical {
    background-color: var(--skill-technical-bg);
}

.skill-bar-hobbies {
    background-color: var(--skill-hobbies-bg);
}

.skill-bar-technical .skill-progress {
    background-color: var(--skill-technical-fill);
}

.skill-bar-hobbies .skill-progress {
    background-color: var(--skill-hobbies-fill);
}

.skill-progress {
    height: 100%;
    transition: width 0.8s ease;
}

/* Publications Section */
.publications-list {
    max-width: 900px;
    margin: 0 auto;
}

.publication-item {
    display: flex;
    justify-content: space-between;
    align-items: start;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

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

.pub-content {
    flex: 1;
}

.pub-title {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.pub-authors {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.pub-venue {
    margin-bottom: 0.75rem;
}

.venue-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 500;
    font-style: normal;
    line-height: 1.4;
    white-space: nowrap;
}

.venue-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Accepted / published — green */
.venue-pill--accepted {
    background-color: #e6f6ec;
    color: #1a7f37;
}

.venue-pill--accepted .venue-dot {
    background-color: #1a7f37;
}

/* Submitted / under review — yellow */
.venue-pill--submitted {
    background-color: #fdf3d3;
    color: #9a6700;
}

.venue-pill--submitted .venue-dot {
    background-color: #d4a017;
}

.pub-links {
    display: flex;
    gap: 1rem;
}

.pub-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: opacity 0.3s;
}

.pub-link:hover {
    opacity: 0.7;
}

.pub-link i {
    font-size: 0.8rem;
}

.pub-year {
    font-size: 0.95rem;
    color: var(--text-light);
    margin-left: 2rem;
    font-weight: 500;
}

/* Projects Section */
.projects-section {
    background-color: var(--section-bg);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.project-card {
    background-color: var(--bg-color);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: var(--shadow);
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.project-image {
    width: 100%;
    height: 180px;
    object-fit: contain;
    background-color: var(--section-bg);
}

.project-content {
    padding: 1.5rem;
}

.project-content h3 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.project-tags {
    margin: 1rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.project-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: var(--section-bg);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    font-size: 0.8rem;
    color: var(--text-light);
    transition: all 0.3s ease;
}

.project-tag:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.project-links {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background-color: var(--section-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.project-link:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.project-link.github-link {
    background-color: #24292e;
    color: white;
    border-color: #24292e;
}

.project-link.github-link:hover {
    background-color: #1a1e22;
    border-color: #1a1e22;
}

.project-link.external-link {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.project-link.external-link:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

/* Contact Section */
.contact-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.contact-info p {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.contact-info .schedule-link {
    margin-top: 1.5rem;
}

.contact-info a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
}

.contact-info a:hover {
    opacity: 0.7;
    text-decoration: underline;
}

/* Schedule button (top/hero) */
.schedule-hero {
    margin-top: 1rem;
}

.schedule-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.9rem;
    border-radius: 10px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s, background-color 0.2s, opacity 0.2s;
}

.schedule-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    opacity: 1;
    text-decoration: none;
}

/* Buttons */
.btn-view-all {
    display: inline-block;
    margin-top: 2rem;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    transition: background-color 0.3s;
}

.btn-view-all:hover {
    background-color: var(--primary-dark);
}

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

/* Footer */
footer {
    background-color: var(--section-bg);
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        font-size: 16px;
    }

    .navbar .container {
        flex-wrap: wrap;
        row-gap: 0.5rem;
        padding: 0.75rem 16px;
    }

    .nav-menu {
        order: 3;
        width: 100%;
        gap: 1.25rem;
        overflow-x: auto;
        font-size: 0.95rem;
    }

    .container {
        padding: 0 16px;
    }
    
    .hero-wrapper {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-right h2 {
        text-align: center;
    }
    
    .skills-grid,
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    section {
        padding: 2rem 0;
    }
    
    .publication-item {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .pub-year {
        margin-left: 0;
    }
}

/* Additional styles for pages */
.filter-section {
    text-align: center;
    margin-bottom: 2rem;
}

.filter-tags {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.filter-tag {
    padding: 0.5rem 1rem;
    background-color: var(--section-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.875rem;
}

.filter-tag:hover {
    background-color: var(--primary-light);
    color: white;
}

.filter-tag.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}


/* ------------------------------------------------------------------ */
/* Site additions (Jekyll port)                                        */
/* ------------------------------------------------------------------ */

img {
    max-width: 100%;
}

a {
    color: var(--primary-color);
}

.nav-brand a:hover {
    color: var(--primary-color);
}

.theme-toggle-btn {
    padding: 0.25rem;
}

/* Cards: clickable image + title */
.project-image-link {
    display: block;
}

.project-card .project-content p {
    font-size: 0.95rem;
    color: var(--text-light);
}

.project-card h3 a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s;
}

.project-card h3 a:hover {
    color: var(--primary-color);
}

.project-tag.date-tag,
.project-tag.date-tag:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background-color: transparent;
}

.card-date {
    font-size: 0.85rem !important;
    margin-bottom: 0.5rem;
}

.project-tag:hover {
    background-color: var(--section-bg);
    color: var(--text-light);
    border-color: var(--border-color);
}

.project-card .project-links {
    margin-top: 1rem;
}

/* Post list items */
.pub-title a {
    color: inherit;
    text-decoration: none;
}

.pub-title a:hover {
    text-decoration: underline;
}

/* List pages */
.page-header {
    background-color: var(--section-bg);
    padding: 3rem 0;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 500;
    text-align: center;
    margin-bottom: 0.5rem;
}

.page-subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.search-container {
    max-width: 600px;
    margin: 0 auto;
}

.search-box {
    width: 100%;
    padding: 0.75rem 1rem;
    font: inherit;
    font-size: 1rem;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-color);
    transition: border-color 0.3s;
}

.search-box:focus {
    outline: none;
    border-color: var(--primary-color);
}

.filter-tags {
    margin-top: 2rem;
}

.filter-tag {
    font: inherit;
    font-size: 0.875rem;
    color: var(--text-color);
}

.no-results {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
}

.page-header + .projects-section {
    padding-top: 1rem;
}

/* Detail pages (posts & projects) */
.project-detail {
    padding: 3rem 0;
}

.project-header {
    max-width: 800px;
    margin: 0 auto 2rem;
}

.project-header h1 {
    font-size: 2rem;
    font-weight: 500;
    line-height: 1.3;
    margin-bottom: 0.75rem;
}

.detail-subtitle {
    font-size: 1.15rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.detail-ack {
    font-size: 0.95rem;
    color: var(--text-light);
    font-style: italic;
    margin-bottom: 1rem;
}

.project-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.project-meta .project-tags {
    margin: 0;
}

.project-meta .project-tags > span:not(.venue-pill) {
    padding: 0.25rem 0.75rem;
    background-color: var(--section-bg);
    border-radius: 15px;
    font-size: 0.875rem;
    color: var(--text-light);
}

.detail-links {
    display: flex;
    gap: 1.25rem;
}

.external-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.project-featured-image {
    margin-bottom: 3rem;
}

.project-featured-image img,
.project-featured-image video {
    width: 100%;
    max-width: 800px;
    max-height: 480px;
    object-fit: contain;
    margin: 0 auto;
    display: block;
    border-radius: 8px;
    box-shadow: var(--shadow);
    background-color: var(--section-bg);
}

.project-navigation {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.btn-back {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

/* Long-form content */
.article-body {
    max-width: 800px;
    margin: 0 auto 3rem;
    line-height: 1.8;
    overflow-wrap: break-word;
}

.article-body h1,
.article-body h2 {
    font-size: 1.6rem;
    font-weight: 500;
    text-align: left;
    margin: 2.5rem 0 1rem;
}

.article-body h3 {
    font-size: 1.3rem;
    margin: 2rem 0 0.75rem;
}

.article-body h4,
.article-body h5,
.article-body h6 {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-light);
    margin: 0.5rem 0 1.5rem;
}

.article-body > :first-child {
    margin-top: 0;
}

.article-body p,
.article-body ul,
.article-body ol,
.article-body blockquote,
.article-body table,
.article-body pre {
    margin-bottom: 1.25rem;
}

.article-body ul,
.article-body ol {
    padding-left: 1.5rem;
}

.article-body li {
    margin-bottom: 0.4rem;
}

.article-body a {
    text-decoration: none;
}

.article-body a:hover {
    text-decoration: underline;
}

.article-body img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 1.5rem auto 0.5rem;
    border-radius: 8px;
}

.article-body blockquote {
    border-left: 3px solid var(--primary-color);
    padding: 0.25rem 0 0.25rem 1.25rem;
    color: var(--text-light);
}

.article-body code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.875em;
    background-color: var(--section-bg);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
}

.article-body pre {
    background-color: var(--section-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    overflow-x: auto;
    line-height: 1.5;
}

.article-body pre code {
    background: none;
    padding: 0;
    font-size: 0.85rem;
}

.article-body table {
    width: 100%;
    border-collapse: collapse;
    display: block;
    overflow-x: auto;
    font-size: 0.95rem;
}

.article-body th,
.article-body td {
    border: 1px solid var(--border-color);
    padding: 0.5rem 0.75rem;
    text-align: left;
}

.article-body th {
    background-color: var(--section-bg);
    font-weight: 500;
}

.article-body hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 2rem 0;
}

.page-section {
    padding-top: 3rem;
}

/* Syntax highlighting (rouge) */
.highlight .c, .highlight .c1, .highlight .cm, .highlight .cs { color: #6a737d; font-style: italic; }
.highlight .k, .highlight .kd, .highlight .kn, .highlight .kr, .highlight .kt { color: #48766c; font-weight: 500; }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sb, .highlight .sc { color: #9a6700; }
.highlight .m, .highlight .mi, .highlight .mf, .highlight .mh { color: #1a7f37; }
.highlight .nf, .highlight .nc { color: #365a54; }
[data-theme="dark"] .highlight .k, [data-theme="dark"] .highlight .kd,
[data-theme="dark"] .highlight .kn, [data-theme="dark"] .highlight .kr,
[data-theme="dark"] .highlight .kt { color: #7fb5a8; }
[data-theme="dark"] .highlight .nf, [data-theme="dark"] .highlight .nc { color: #9cc9bd; }
[data-theme="dark"] .highlight .s, [data-theme="dark"] .highlight .s1,
[data-theme="dark"] .highlight .s2 { color: #e3b341; }
[data-theme="dark"] .highlight .m, [data-theme="dark"] .highlight .mi { color: #56d364; }

/* Dark-mode tweaks for fixed-color pieces */
[data-theme="dark"] {
    --primary-color: #6a9e92;
    --primary-dark: #48766c;
    --primary-hover: #7fb5a8;
    --shadow: 0 2px 4px rgba(0,0,0,0.4);
}

[data-theme="dark"] .venue-pill--accepted {
    background-color: rgba(46, 160, 67, 0.15);
    color: #56d364;
}

[data-theme="dark"] .venue-pill--accepted .venue-dot {
    background-color: #56d364;
}

@media (max-width: 768px) {
    .hero-section {
        padding: 2.5rem 0;
    }

    .profile-image {
        width: 200px;
        height: 200px;
    }

    .bio-content {
        text-align: left;
    }

    .page-header,
    .project-detail {
        padding: 2rem 0;
    }

    .project-header h1,
    .page-header h1 {
        font-size: 1.6rem;
    }

    h2 {
        font-size: 1.6rem;
    }

    .projects-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Collapsible sections inside long-form content */
.article-body details {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--section-bg);
    padding: 0.75rem 1.25rem;
    margin-bottom: 1.25rem;
}

.article-body details summary {
    cursor: pointer;
    font-weight: 500;
    color: var(--primary-color);
    list-style: none;
}

.article-body details summary::-webkit-details-marker {
    display: none;
}

.article-body details summary::before {
    content: "\25B8";
    display: inline-block;
    margin-right: 0.5rem;
    transition: transform 0.2s ease;
}

.article-body details[open] summary::before {
    transform: rotate(90deg);
}

.article-body details[open] summary {
    margin-bottom: 1rem;
}

.article-body details h3 {
    margin-top: 1.5rem;
}

.article-body details img {
    max-height: 420px;
    width: auto;
}

.article-body .image-caption {
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* Series navigation box (multi-part posts) */
.article-body .series-nav {
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-color);
    border-radius: 8px;
    background-color: var(--section-bg);
    padding: 1rem 1.25rem;
    margin: 0 0 2rem;
    font-size: 0.95rem;
}

.article-body .series-nav-title {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.article-body .series-nav ol {
    margin: 0;
    padding-left: 1.25rem;
}

.article-body .series-nav li {
    margin: 0.2rem 0;
}

/* ------------------------------------------------------------------ */
/* Projects: summaries, post carousels and in-project navigation       */
/* ------------------------------------------------------------------ */
.eyebrow {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.eyebrow a {
    text-decoration: none;
}

.project-index {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.project-index .filter-tag {
    text-decoration: none;
}

.project-block {
    padding: 3rem 0;
    border-bottom: 1px solid var(--border-color);
    scroll-margin-top: 4rem;
}

.project-block:nth-child(even) {
    background-color: var(--section-bg);
}

.project-block-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    margin-bottom: 0.75rem;
}

.project-block-header h2 {
    font-size: 1.5rem;
    font-weight: 500;
    margin: 0;
}

.project-block-header h2 a {
    color: var(--text-color);
    text-decoration: none;
}

.project-block-header h2 a:hover {
    color: var(--primary-color);
}

.project-block-header .project-tags {
    margin: 0;
}

.project-hero {
    max-width: 800px;
    margin: 0 0 1.5rem;
}

.project-detail .project-hero {
    margin: 0 auto 2rem;
}

.project-hero video {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 70vh;
    border-radius: 8px;
    background-color: #000;
}

.project-detail .project-hero video {
    margin: 0 auto;
}

/* Landscape video on the left, summary on the right */
.project-intro-beside {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 2rem;
    align-items: center;
    margin-bottom: 1.5rem;
}

.project-detail .project-intro-beside {
    max-width: 1000px;
    margin: 0 auto 2.5rem;
}

.project-intro-beside .project-hero,
.project-detail .project-intro-beside .project-hero,
.project-intro-beside .project-summary,
.project-detail .project-intro-beside .project-summary {
    max-width: none;
    margin: 0;
}

.project-intro-beside .project-hero video {
    width: 100%;
    margin: 0;
}

/* Portrait video on the left: the video column shrinks to the video's width */
.project-intro-beside-portrait {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
}

.project-intro-beside-portrait .project-hero video {
    width: auto;
    max-width: 100%;
    max-height: 28vh;
}

@media (max-width: 768px) {
    .project-intro-beside-portrait .project-hero video {
        max-height: 24vh;
        margin: 0 auto;
    }

    .project-intro-beside {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.25rem;
    }
}

/* Portrait video: summary, video and posts side by side on one row */
.project-intro-side {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) 180px minmax(0, 1fr);
    gap: 2rem;
    align-items: start;
    margin-bottom: 1.5rem;
}

.project-detail .project-intro-side {
    max-width: 1000px;
    margin: 0 auto 2.5rem;
}

.project-intro-side .project-hero,
.project-detail .project-intro-side .project-hero,
.project-intro-side .project-summary,
.project-detail .project-intro-side .project-summary {
    max-width: none;
    margin: 0;
}

.project-intro-side .project-hero video {
    width: 100%;
    max-height: none;
    margin: 0;
}

/* One card per view in the narrow posts column */
.project-intro-side .carousel-track {
    grid-auto-columns: 100%;
}

@media (max-width: 900px) {
    .project-intro-side {
        grid-template-columns: minmax(0, 1fr) 180px;
    }

    .project-intro-posts {
        grid-column: 1 / -1;
    }
}

@media (max-width: 600px) {
    .project-intro-side {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.25rem;
    }

    .project-intro-side .project-hero video {
        width: auto;
        max-width: 100%;
        max-height: 60vh;
        margin: 0 auto;
    }
}

.project-summary {
    max-width: 800px;
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.project-detail .project-summary {
    margin: 0 auto 2.5rem;
    font-size: 1.05rem;
}

.project-posts {
    max-width: 1000px;
    margin: 0 auto 2rem;
}

.project-section {
    border-top: 1px solid var(--border-color);
}

.project-section:last-child {
    border-bottom: 1px solid var(--border-color);
}

.project-section summary {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem 0.25rem;
    cursor: pointer;
    list-style: none;
}

.project-section summary::-webkit-details-marker {
    display: none;
}

.project-section-number {
    flex: none;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.project-section-heading {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.project-section-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-color);
    transition: color 0.2s ease;
}

.project-section summary:hover .project-section-title {
    color: var(--primary-color);
}

.project-section-desc {
    font-size: 0.95rem;
    color: var(--text-light);
}

.project-section-chevron {
    flex: none;
    margin-top: 0.5rem;
    color: var(--text-light);
    transition: transform 0.2s ease;
}

.project-section[open] .project-section-chevron {
    transform: rotate(180deg);
}

.project-section > .carousel {
    padding-bottom: 1.25rem;
}

.carousel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.carousel-count {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-light);
}

.carousel-controls {
    display: flex;
    gap: 0.5rem;
}

.carousel-btn {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.carousel-btn:hover:not(:disabled) {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.carousel-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.carousel {
    min-width: 0;
}

.carousel-track {
    list-style: none;
    max-width: 100%;
    margin: 0;
    padding: 0.25rem 0.25rem 1rem;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - 2 * 1.25rem) / 3);
    column-gap: 1.25rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 0.25rem;
    overscroll-behavior-x: contain;
}

.carousel-card {
    scroll-snap-align: start;
    display: flex;
}

.carousel-card-link {
    display: flex;
    flex-direction: column;
    width: 100%;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    color: inherit;
    text-decoration: none;
    box-shadow: var(--shadow);
    transition: transform 0.2s, border-color 0.2s;
}

.carousel-card-link:hover {
    transform: translateY(-3px);
    border-color: var(--primary-color);
}

.carousel-image {
    width: 100%;
    height: 150px;
    object-fit: contain;
    background-color: var(--section-bg);
    border-bottom: 1px solid var(--border-color);
}

.carousel-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1rem 1.1rem 1.1rem;
}

.carousel-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.carousel-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.4rem;
    height: 1.4rem;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    font-size: 0.75rem;
}

.carousel-body h3 {
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.carousel-desc {
    font-size: 0.875rem;
    color: var(--text-light);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.carousel-read {
    margin-top: auto;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--primary-color);
}

.project-post-nav {
    max-width: 800px;
    margin: 0 auto 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.project-post-nav .next {
    text-align: right;
}

.project-post-nav span {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.project-post-nav a {
    text-decoration: none;
    font-weight: 500;
    line-height: 1.4;
}

@media (max-width: 900px) {
    .carousel-track {
        grid-auto-columns: calc((100% - 1.25rem) / 2);
    }
}

@media (max-width: 600px) {
    .carousel-track {
        grid-auto-columns: 85%;
    }

    .project-post-nav {
        grid-template-columns: 1fr;
    }

    .project-post-nav .next {
        text-align: left;
    }
}

.project-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.project-title .project-date {
    flex-shrink: 0;
    white-space: nowrap;
}

.project-header .project-title {
    margin-bottom: 0.75rem;
}

.project-header .project-title h1 {
    margin-bottom: 0;
}

.project-logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
    flex-shrink: 0;
}

.project-block .project-logo {
    width: 56px;
    height: 56px;
}

.project-block > .container > .project-tags {
    margin: 0 0 1rem;
}

/* Neobrutalist diagrams carry their own square frame and hard shadow */
.article-body img[src*="/serverless-llm/"][src$=".svg"],
.project-featured-image img[src*="/serverless-llm/"][src$=".svg"] {
    border-radius: 0;
    box-shadow: none;
    background-color: transparent;
}

.article-body video {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 1.5rem auto 0.5rem;
    border-radius: 8px;
    background-color: #000;
}
