body {
    font: 1.3rem/1.5 -apple-system,BlinkMacSystemFont,avenir next,avenir,helvetica,helvetica neue,ubuntu,roboto,noto,segoe ui,arial,sans-serif;
    padding: 0 2rem !important;
}

header.header-container {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 2rem !important;
    line-height: 1 !important;
    padding: 0.4rem 0 0.4rem 0 !important;
    margin-bottom: 0 !important;
    flex-wrap: nowrap !important;
}

header {
    padding-bottom: 0.3rem !important;
    line-height: 1 !important;
}

.header-left {
    flex-shrink: 0;
    display: inline-block;
}

.header-right {
    display: flex !important;
    align-items: center !important;
    gap: 2rem !important;
    flex-wrap: nowrap !important;
}

.header-nav {
    display: flex !important;
    gap: 1.5rem !important;
    align-items: center !important;
    vertical-align: middle !important;
    flex-wrap: nowrap !important;
}

.header-nav .nav-link {
    text-decoration: none;
    color: inherit;
    display: inline-block;
    white-space: nowrap;
    margin: 0 !important;
    padding: 0.5rem 0 !important;
    line-height: 1.4 !important;
    vertical-align: middle !important;
}

.header-nav .nav-link.active {
    text-decoration: underline;
}

.header-icons {
    display: flex !important;
    align-items: center !important;
    gap: 0 !important;
    flex-wrap: nowrap !important;
}

#clustrmap-container {
    padding-top: 200px;
    width: 100%;
}

/* Code styling */
code {
    background: #eee;
}

.highlight {
    background: #f3f3f3 !important;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.highlight > pre {
    background: #f3f3f3 !important;
    padding: 0.12rem 0.55rem !important;
    margin: 0;
    line-height: 1.2 !important;
    border-radius: 4px;
}

.highlight > pre code {
    line-height: 1.2 !important;
}

.highlight > pre code > span {
    display: block !important;
}

.highlight > pre code > span > span {
    display: inline !important;
}

:not(pre) > code {
    padding: 0.2rem 0.4rem;
    font-size: 0.8em;
    border-radius: 4px;
}

/* Homepage styles */
.hero {
    margin: 3rem 0 4rem 0;
}

.hero-intro {
    margin-bottom: 3rem;
    padding: 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 8px;
    border-left: 5px solid #3b82f6;
}

.intro-name {
    font-size: 2rem;
    font-weight: 800;
    color: #000;
    margin: 0 0 1rem 0;
    letter-spacing: -0.5px;
}

.intro-text {
    font-size: 1.05rem;
    color: #444;
    line-height: 1.8;
    font-weight: 400;
    margin: 0;
}

.content-sections {
    display: flex;
    flex-direction: column;
    gap: 2.2rem;
}

.hero-section {
    display: flex;
    flex-direction: column;
}

.hero h3 {
    font-size: 1.1rem;
    color: #000;
    margin-bottom: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding-left: 0.8rem;
    border-left: 4px solid;
}

.hero-section:nth-child(1) h3 {
    border-left-color: #3b82f6;
}

.hero-section:nth-child(2) h3 {
    border-left-color: #10b981;
}

.hero-section:nth-child(3) h3 {
    border-left-color: #f59e0b;
}

.items-container {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.item-card {
    padding: 1.2rem;
    background: #fafafa;
    border-radius: 8px;
    border-left: 4px solid;
}

/* Education */
.education-item {
    border-left-color: #3b82f6;
}

.item-title {
    font-weight: 700;
    color: #000;
    font-size: 1.05rem;
}

.item-title-single {
    font-weight: 700;
    color: #000;
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
}

.item-subtitle {
    color: #888;
    font-size: 0.9rem;
    margin-top: 0.3rem;
}

/* Experience */
.experience-item {
    border-left-color: #10b981;
}

.item-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 0.5rem;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.item-header .item-title {
    font-size: 1.05rem;
    font-weight: 700;
}

.item-meta {
    color: #999;
    font-size: 0.8rem;
    white-space: nowrap;
    font-weight: 500;
    margin-left: auto;
}

.item-header .item-location {
    color: #666;
    font-size: 0.85rem;
    font-weight: 500;
}

.item-role {
    color: #555;
    font-size: 0.95rem;
    margin-bottom: 0.7rem;
    font-weight: 600;
}

.item-tags {
    color: #777;
    font-size: 0.85rem;
    line-height: 1.6;
}

/* Skills */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.skill-group {
    background: #f9f9f9;
    padding: 1rem 1.2rem;
    border-radius: 6px;
    border-left: 4px solid #ccc;
}

.skills-grid > :nth-child(1) {
    border-left-color: #3b82f6;
}

.skills-grid > :nth-child(2) {
    border-left-color: #8b5cf6;
}

.skills-grid > :nth-child(3) {
    border-left-color: #10b981;
}

.skills-grid > :nth-child(4) {
    border-left-color: #f59e0b;
}

.skill-label {
    font-weight: 600;
    color: #000;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    display: block;
}

.skill-items {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.6;
}

.latest-posts {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
}

.latest-posts h2 {
    margin-bottom: 1.5rem;
    font-weight: 600;
}

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

.posts-list li {
    margin-bottom: 1.2rem;
    display: flex;
    align-items: baseline;
    gap: 1rem;
}

.posts-list time {
    flex-shrink: 0;
    color: #999;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.posts-list a {
    text-decoration: none;
    color: inherit;
}

.posts-list a:hover {
    text-decoration: underline;
}

/* Social icons in header */
.social-icon {
    width: 0.95em;
    height: 0.95em;
    display: inline-block;
    vertical-align: -0.12em;
}

.social-link {
    display: inline;
    opacity: 0.6;
    transition: opacity 0.2s;
    margin-left: 0.5rem;
}

.social-link:hover {
    opacity: 1;
}

.dark-mode-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: inline;
    opacity: 0.6;
    transition: opacity 0.2s;
    margin-left: 1.5rem;
    font-size: inherit;
}

.dark-mode-toggle:hover {
    opacity: 1;
}

/* Dark mode styles */
html.dark-mode {
    color-scheme: dark;
    background: #252526 !important;
}

html.dark-mode body {
    background: #252526 !important;
    color: #e4e4e4 !important;
}

html.dark-mode main, html.dark-mode .content {
    background: #252526 !important;
    color: #e4e4e4 !important;
}

html.dark-mode header {
    background: #1a1a1a !important;
}

html.dark-mode header a, html.dark-mode header a:visited {
    color: #e4e4e4 !important;
}

html.dark-mode blockquote {
    border-left-color: #444 !important;
    color: #b8b8b8 !important;
}

html.dark-mode code, html.dark-mode pre {
    background: #2a2a2a !important;
    color: #e4e4e4 !important;
}

html.dark-mode :not(pre) > code {
    background: #2a2a2a !important;
    color: #e4e4e4 !important;
}

html.dark-mode .highlight {
    background: #1e1e1e !important;
}

html.dark-mode .highlight > pre {
    background: #1e1e1e !important;
    color: #e4e4e4 !important;
}

html.dark-mode .highlight code {
    background: transparent !important;
}

/* Code block font size */
.highlight {
    font-size: 1.05rem;
}

.highlight code {
    font-size: 1.05rem;
}

html.dark-mode .meta {
    color: #888 !important;
}

html.dark-mode .hr-list, html.dark-mode hr {
    border-bottom-color: #333 !important;
}

html.dark-mode a, html.dark-mode a:visited {
    color: #88d4ff !important;
}

html.dark-mode a:hover, html.dark-mode a.heading-link {
    color: #5dc7ff !important;
}

html.dark-mode .posts-list time {
    color: #888 !important;
}

html.dark-mode .index-date {
    color: #666 !important;
}

html.dark-mode table {
    border-color: #444 !important;
}

html.dark-mode th, html.dark-mode td {
    border-color: #444 !important;
}

html.dark-mode th {
    background-color: #2a2a2a !important;
    color: #e4e4e4 !important;
}

html.dark-mode section {
    color: #e4e4e4 !important;
}

/* Dark mode - Homepage */
html.dark-mode .hero-intro {
    background: linear-gradient(135deg, #2a2a2a 0%, #1f1f1f 100%) !important;
}

html.dark-mode .intro-name {
    color: #e4e4e4 !important;
}

html.dark-mode .intro-text {
    color: #aaa !important;
}

html.dark-mode .hero h3 {
    color: #e4e4e4 !important;
}

html.dark-mode .item-card {
    background: #2a2a2a !important;
}

html.dark-mode .item-title,
html.dark-mode .item-title-single {
    color: #e4e4e4 !important;
}

html.dark-mode .item-subtitle,
html.dark-mode .item-meta,
html.dark-mode .item-location,
html.dark-mode .item-role,
html.dark-mode .item-tags {
    color: #aaa !important;
}

html.dark-mode .skill-group {
    background: #2a2a2a !important;
    border-color: #3a3a3a !important;
}

html.dark-mode .skill-label {
    color: #e4e4e4 !important;
}

html.dark-mode .skill-items {
    color: #aaa !important;
}

/* Footer */
.site-footer {
    margin-top: 3rem;
    padding: 1.5rem 0 1rem 0;
    text-align: center;
}

.footer-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, #e0e0e0 50%, transparent 100%);
    margin-bottom: 1rem;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.footer-tech {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.footer-label {
    font-size: 0.8rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
    justify-content: center;
}

.footer-link {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: #666;
    text-decoration: none;
    transition: all 0.2s ease;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

.footer-link:hover {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.05);
}

.footer-icon {
    font-size: 0.9rem;
}

.footer-link-text {
    font-weight: 500;
    font-size: 0.85rem;
}

.footer-separator {
    color: #ddd;
    font-weight: 300;
}

.footer-copyright {
    font-size: 0.8rem;
    color: #999;
    margin: 0;
    font-weight: 400;
}

/* Dark mode - Footer */
html.dark-mode .footer-divider {
    background: linear-gradient(90deg, transparent 0%, #333 50%, transparent 100%);
}

html.dark-mode .footer-label {
    color: #666 !important;
}

html.dark-mode .footer-link {
    color: #aaa !important;
}

html.dark-mode .footer-link:hover {
    color: #60a5fa !important;
    background: rgba(96, 165, 250, 0.1) !important;
}

html.dark-mode .footer-separator {
    color: #444 !important;
}

html.dark-mode .footer-copyright {
    color: #666 !important;
}

/* Disqus comments styling */
#disqus_thread {
    font-size: 0.75rem;
}

#disqus_thread iframe {
    max-width: 100%;
}

/* Hide Disqus emoji picker */
.emoji-picker,
.emoji-button,
[class*="emoji"],
[id*="emoji"] {
    display: none !important;
}

/* Mobile menu toggle button */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    gap: 0.4rem;
}

.mobile-menu-toggle span {
    width: 24px;
    height: 2px;
    background: #000;
    transition: all 0.3s ease;
    display: block;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

html.dark-mode .mobile-menu-toggle span {
    background: #e4e4e4;
}

/* Mobile responsive improvements */
@media (max-width: 768px) {
    body {
        padding: 0 1rem !important;
        font-size: 1rem;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    header {
        display: block !important;
    }

    .mobile-menu {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        flex-direction: column !important;
        width: 100%;
        padding: 0 !important;
        margin-top: 1rem !important;
    }

    .mobile-menu.active {
        max-height: 500px;
    }

    .mobile-menu li {
        display: block !important;
        border-bottom: 1px solid #eee;
        padding: 0 !important;
        margin: 0 !important;
    }

    .mobile-menu li:last-child {
        border-bottom: none;
    }

    .mobile-menu a {
        display: block;
        padding: 0.75rem 0 !important;
    }

    .intro-name {
        font-size: 1.5rem !important;
    }

    .intro-text {
        font-size: 0.95rem;
    }

    .skills-grid {
        grid-template-columns: 1fr !important;
    }

    .item-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.5rem !important;
    }

    .item-meta {
        margin-left: 0 !important;
    }

    .avatar {
        margin: 0 0 1.5rem 0 !important;
        float: none !important;
        display: block;
        margin-left: auto;
        margin-right: auto;
    }

    table {
        font-size: 0.85rem;
        overflow-x: auto;
        display: block;
    }

    th, td {
        padding: 0.5rem !important;
    }

    pre {
        font-size: 0.8rem;
        padding: 0.75rem !important;
    }

    .content {
        max-width: 100%;
    }

    .hero-intro {
        padding: 1.5rem !important;
    }
}

@media (max-width: 480px) {
    body {
        padding: 0 0.75rem !important;
        font-size: 0.95rem;
    }

    header.header-container {
        padding: 0.75rem 0 !important;
    }

    .header-nav {
        gap: 0.5rem !important;
    }

    .intro-name {
        font-size: 1.25rem !important;
    }

    .intro-text {
        font-size: 0.9rem;
    }

    .hero h3 {
        font-size: 0.95rem;
    }

    .item-card {
        padding: 0.75rem !important;
    }

    .item-title {
        font-size: 0.95rem;
    }

    .footer-links {
        flex-direction: column;
        gap: 0.5rem !important;
    }
}

/* Dark mode responsive */
@media (max-width: 768px) {
    html.dark-mode .mobile-menu li {
        border-bottom-color: #333;
    }

    html.dark-mode .hero-intro {
        padding: 1.5rem !important;
    }
}

/* Final override: compact Hugo/Chroma code blocks */
.highlight {
    margin: 1.2rem 0 !important;
}

.highlight > pre,
.highlight > pre[tabindex="0"] {
    margin: 0 !important;
}

.highlight > pre,
.highlight > pre[tabindex="0"] {
    padding-top: 0.08rem !important;
    padding-bottom: 0.08rem !important;
    padding-left: 0.55rem !important;
    padding-right: 0.55rem !important;
    line-height: 1.15 !important;
}

.highlight > pre code,
.highlight > pre[tabindex="0"] code {
    line-height: 1.15 !important;
}

.highlight > pre code > span,
.highlight > pre[tabindex="0"] code > span {
    display: block !important;
    line-height: 1.15 !important;
}

.highlight > pre code > span > span,
.highlight > pre[tabindex="0"] code > span > span {
    display: inline !important;
    line-height: 1.15 !important;
}
