/* Shared chrome and page-agnostic styles: everything base.html's own
   markup needs, plus any class used by two or more templates, plus every
   class whose one owning template (index.html, projects.html, resume.html,
   resume_en.html, search.html, error.html, gitweb.html) gets no stylesheet
   of its own in this split. Loaded on every page, right after tokens.css. */

/* Anthropic-inspired Theme - Minimal, refined, warm */
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("/static/fonts/inter-var.woff2") format("woff2");
}
@font-face {
    font-family: "JetBrains Mono";
    font-style: normal;
    font-weight: 100 800;
    font-display: swap;
    src: url("/static/fonts/jetbrains-mono-var.woff2") format("woff2");
}

/* The hidden attribute is implemented by the browser's own stylesheet, which any
   author display rule overrides. Keep hidden elements hidden regardless. */
[hidden] {
    display: none !important;
}

/* Selection styling */
::selection {
    background: var(--selection-bg);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    line-height: 1.6;
    background-color: var(--background);
    color: var(--foreground);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Header */
header {
    border-bottom: 1px solid var(--border-color);
    padding: var(--space-md) var(--site-margin);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    background: var(--background);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: var(--content-width);
    margin: 0 auto;
}

.logo {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--foreground);
    letter-spacing: -0.01em;
    text-decoration: none;
}

.logo:hover {
    color: var(--foreground);
}

.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    gap: var(--space-2xl);
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 450;
    transition: color 0.2s ease;
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--foreground);
}

/* Main content */
main {
    flex: 1;
    max-width: var(--content-width);
    margin: 0 auto;
    /* off-scale: 4rem sits above --space-3xl, the largest named step. Left as a literal
       because snapping it would move pixels; 2B retires it. */
    padding: clamp(var(--space-xl), 5vw, 4rem) var(--site-margin);
    width: 100%;
}

/* Typography - Responsive scaling */
h1, h2, h3, h4 {
    color: var(--foreground);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

h1 {
    font-size: clamp(2rem, 4vw, 2.75rem);
    margin-bottom: var(--space-lg);
}

h2 {
    font-size: clamp(1.5rem, 3vw, 1.875rem);
    margin-bottom: var(--space-sm);
}

h3 {
    font-size: clamp(1.125rem, 2vw, 1.25rem);
    margin-bottom: var(--space-xs);
}

p {
    margin-bottom: var(--space-sm);
    color: var(--text-secondary);
}

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

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

/* Focus states - Accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    color: var(--on-dark);
    padding: var(--space-xs) var(--space-lg);
    text-decoration: none;
    border-radius: var(--border-radius);
    border: none;
    cursor: pointer;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn:hover {
    background: var(--primary-hover);
    color: var(--on-dark);
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-secondary {
    background: transparent;
    color: var(--foreground);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--card-bg);
    border-color: var(--text-muted);
    color: var(--foreground);
}

/* Cards */
.card {
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    /* off-scale: 1.75rem sits between --space-lg and --space-xl. Left as a literal
       because snapping it would move pixels; 2B retires it. */
    padding: 1.75rem;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.card h2 {
    margin-bottom: var(--space-xs);
}

.card p {
    margin-bottom: var(--space-sm);
    color: var(--text-muted);
}

.card .tags {
    margin-bottom: var(--space-md);
}

.card .btn {
    margin-top: var(--space-md);
}

/* Homepage */
.homepage-intro {
    margin-bottom: var(--space-3xl);
    max-width: 640px;
}

.homepage-intro h1 {
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    margin-bottom: var(--space-3xs);
}

.homepage-role {
    font-size: 1.125rem;
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: var(--space-sm);
}

.homepage-bio {
    font-size: clamp(1rem, 2vw, 1.125rem);
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.homepage-links {
    display: flex;
    gap: var(--space-lg);
    flex-wrap: wrap;
}

.homepage-links a {
    color: var(--text-muted);
    font-size: 0.9375rem;
    font-weight: 450;
}

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

.homepage-section {
    margin-bottom: var(--space-3xl);
}

.homepage-section h2 {
    font-size: 1.25rem;
    margin-bottom: var(--space-md);
    color: var(--foreground);
}

.homepage-posts {
    list-style: none;
    margin-bottom: var(--space-sm);
}

.homepage-post-item {
    display: flex;
    align-items: baseline;
    gap: var(--space-sm);
    /* off-scale: 0.625rem sits between --space-2xs and --space-xs. Left as a literal
       because snapping it would move pixels; 2B retires it. */
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.homepage-post-item time {
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-weight: 500;
    flex-shrink: 0;
    min-width: 90px;
}

.homepage-post-item a {
    color: var(--foreground);
    font-weight: 500;
    font-size: 0.9375rem;
}

.homepage-post-item a:hover {
    color: var(--primary-color);
}

.homepage-post-tags {
    display: flex;
    gap: var(--space-3xs);
    margin-left: auto;
}

.homepage-more-link {
    font-size: 0.875rem;
    color: var(--primary-color);
    font-weight: 500;
}

/* Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-lg);
}

/* Resume Styles */
.resume-container {
    background: var(--card-bg);
    /* off-scale: 3.5rem sits above --space-3xl, the largest named step. Left as a literal
       because snapping it would move pixels; 2B retires it. */
    padding: clamp(var(--space-xl), 4vw, 3.5rem);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
}

.resume-header {
    text-align: center;
    margin-bottom: var(--space-3xl);
    padding-bottom: var(--space-xl);
    border-bottom: 1px solid var(--border-color);
}

.resume-header h1 {
    color: var(--foreground);
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    margin-bottom: var(--space-2xs);
}

.resume-header h2 {
    color: var(--text-muted);
    font-size: clamp(1rem, 2vw, 1.25rem);
    font-weight: 400;
    margin-bottom: var(--space-sm);
}

/* Language flag switch */
.lang-flag {
    font-size: 1.5rem;
    text-decoration: none;
    opacity: 0.7;
    transition: opacity 0.2s ease, transform 0.2s ease;
    display: inline-block;
}

.lang-flag:hover {
    opacity: 1;
    transform: scale(1.1);
}

.contact-info {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
}

.summary {
    max-width: 700px;
    margin: 0 auto;
    color: var(--text-secondary);
    line-height: 1.7;
}

.resume-section {
    margin-bottom: var(--space-2xl);
}

.resume-section h3 {
    color: var(--primary-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: var(--space-xs);
    margin-bottom: var(--space-lg);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.8125rem;
    font-weight: 600;
}

.job {
    margin-bottom: var(--space-xl);
}

.job h4 {
    font-size: 1.0625rem;
    color: var(--foreground);
    margin-bottom: var(--space-3xs);
}

.job .date {
    float: right;
    color: var(--primary-color);
    font-weight: 500;
    font-size: 0.875rem;
}

.job p em {
    color: var(--text-muted);
    display: block;
    margin-bottom: var(--space-xs);
    font-style: normal;
}

.job ul {
    margin-left: var(--space-md);
    margin-bottom: var(--space-xs);
    color: var(--text-secondary);
}

.job li {
    margin-bottom: var(--space-2xs);
}

.tech-stack {
    background: var(--background);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--border-radius);
    font-size: 0.8125rem;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
}

.skills-list {
    list-style: none;
}

.skills-list li {
    margin-bottom: var(--space-xs);
    padding: var(--space-2xs) 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.skills-list strong {
    color: var(--primary-color);
    display: inline-block;
    min-width: 120px;
}

.tag-small {
    font-size: 0.6875rem;
    /* off-scale: 0.125rem sits below --space-3xs, the smallest named step. Left as a literal
       because snapping it would move pixels; 2B retires it. */
    padding: 0.125rem var(--space-2xs);
    background: var(--background);
    border-radius: 20px;
    color: var(--text-muted);
}

/* Blog List (legacy) */
.blog-list h1 {
    margin-bottom: var(--space-xl);
}

.blog-list ul {
    list-style: none;
}

.blog-item {
    background: var(--card-bg);
    margin-bottom: var(--space-md);
    padding: var(--space-lg);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.blog-item:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.blog-item .date {
    color: var(--primary-color);
    font-size: 0.8125rem;
    font-weight: 500;
}

.blog-item .reading-time {
    color: var(--text-muted);
    font-size: 0.8125rem;
    margin-left: var(--space-sm);
}

.blog-item h2 {
    margin: 0.625rem 0;
    font-size: 1.25rem;
}

.blog-item h2 a {
    color: var(--foreground);
    text-decoration: none;
}

.blog-item h2 a:hover {
    color: var(--primary-color);
}

.blog-item p {
    color: var(--text-muted);
    margin-bottom: 0;
    line-height: 1.6;
}

/* Tags */
.tags {
    margin-top: var(--space-sm);
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2xs);
}

.tag {
    display: inline-block;
    background: var(--background);
    color: var(--text-muted);
    padding: var(--space-3xs-half) var(--space-xs-half);
    border-radius: 20px;
    font-size: 0.8125rem;
    text-decoration: none;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

/* Hover is a link affordance, so it is scoped to the anchor: a journal
   entry's tags are rendered as <span class="tag"> labels (there is no
   /journal?tag= page to send them to), and a label that lit up under the
   cursor would advertise a link that is not there. */
a.tag:hover, .tag.active {
    background: var(--primary-color);
    color: var(--on-dark);
    border-color: var(--primary-color);
}

/* Search */
.search-section h1 {
    margin-bottom: var(--space-lg);
}

.search-form {
    display: flex;
    gap: var(--space-xs);
    margin-bottom: var(--space-xl);
}

.search-form input {
    flex: 1;
    padding: var(--space-xs-half) var(--space-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    background: var(--card-bg);
    color: var(--foreground);
    transition: border-color 0.2s ease;
}

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

.search-results-count {
    color: var(--text-muted);
    margin-bottom: var(--space-lg);
}

/* Pagination */
.pagination {
    margin-top: var(--space-3xl);
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-sm);
}

.pagination span {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* The date span and the stage count: the same small muted line the journal's
   day headings use, without the uppercasing, since this one holds numerals. */
.trip-meta {
    color: var(--text-muted);
    font-size: 0.8125rem;
    letter-spacing: 0.01em;
    /* The base p rule gives every paragraph 1rem below it; the places line
       and the header rule below set their own spacing instead. */
    margin-bottom: 0;
}

.post-hero .post-meta time,
.post-hero .post-meta .updated-date,
.post-hero .post-meta .reading-time {
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.post-hero .tags {
    margin-top: var(--space-xs);
}

.post-meta .reading-time {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    margin-top: var(--space-3xl);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9375rem;
}

.back-link:hover {
    color: var(--primary-color);
}

/* Theme Toggle */
.theme-toggle {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: var(--space-2xs);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.theme-toggle:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.theme-icon-moon { display: none; }

[data-theme="dark"] .theme-icon-sun { display: none; }
[data-theme="dark"] .theme-icon-moon { display: block; }

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-icon-sun { display: none; }
    :root:not([data-theme="light"]) .theme-icon-moon { display: block; }
}

/* Footer */
footer {
    background: var(--footer-bg);
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: var(--space-xl) var(--site-margin);
    margin-top: auto;
}

[data-theme="dark"] footer {
    background: var(--footer-bg);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) footer {
        background: var(--footer-bg);
    }
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: var(--content-width);
    margin: 0 auto;
    gap: var(--space-lg);
    flex-wrap: wrap;
}

.footer-copyright p {
    margin: 0;
    font-size: 0.875rem;
}

.footer-built {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    gap: var(--space-lg);
}

.footer-links a {
    color: var(--text-muted);
    font-size: 0.875rem;
    text-decoration: none;
}

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

.footer-social {
    display: flex;
    gap: var(--space-sm);
}

.footer-social a {
    color: var(--text-muted);
    font-size: 0.875rem;
    text-decoration: none;
}

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

@media (max-width: 768px) {
    header {
        padding: var(--space-sm) var(--site-margin);
    }

    .columns {
        grid-template-columns: 1fr;
    }

    .nav-links {
        gap: var(--space-md);
    }

    .nav-links a {
        font-size: 0.875rem;
    }

    .resume-container {
        padding: var(--space-lg);
    }

    .job .date {
        float: none;
        display: block;
        margin-bottom: var(--space-2xs);
    }
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 101;
}

.mobile-menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--foreground);
    border-radius: 2px;
    transition: all 0.3s ease;
}

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

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

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

/* Mobile menu overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 99;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-overlay.active {
    opacity: 1;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .mobile-overlay {
        display: block;
        pointer-events: none;
    }

    .mobile-overlay.active {
        pointer-events: auto;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: var(--card-bg);
        flex-direction: column;
        align-items: flex-start;
        /* off-scale: 5rem; see --site-margin in tokens.css for the first use
           and the comment explaining it. */
        padding: 5rem var(--space-xl) var(--space-xl);
        gap: 0;
        box-shadow: -4px 0 20px rgba(0,0,0,0.1);
        transition: right 0.3s ease;
        z-index: 100;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links li {
        width: 100%;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-links li:last-child {
        border-bottom: none;
        margin-top: var(--space-sm);
    }

    .nav-links a {
        display: block;
        padding: var(--space-sm) 0;
        font-size: 1rem;
    }

    .nav-links .theme-toggle {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .nav-links {
        width: 100%;
    }

    .logo {
        font-size: 1rem;
    }

    main {
        padding: var(--space-lg) var(--space-sm);
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

main {
    animation: fadeIn 0.4s ease-out;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Error Pages */
.error-page {
    text-align: center;
    /* off-scale: 6rem sits well above --space-3xl, the largest named step. Left as a literal
       because snapping it would move pixels; 2B retires it. */
    padding: clamp(var(--space-3xl), 10vw, 6rem) var(--space-xl);
}

.error-code {
    font-size: clamp(5rem, 15vw, 10rem);
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
    margin-bottom: var(--space-sm);
    opacity: 0.8;
}

.error-page h1 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    margin-bottom: var(--space-sm);
}

.error-page p {
    color: var(--text-muted);
    font-size: 1.125rem;
    max-width: 400px;
    margin: 0 auto var(--space-xl);
}

.error-actions {
    display: flex;
    gap: var(--space-sm);
    justify-content: center;
    flex-wrap: wrap;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    min-width: 44px;
    max-width: 44px;
    min-height: 44px;
    max-height: 44px;
    padding: 0;
    background: var(--primary-color);
    color: var(--on-dark);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.2s ease;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-hover);
    box-sizing: border-box;
    overflow: hidden;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.back-to-top:active {
    transform: translateY(0);
}

.back-to-top svg {
    width: 20px;
    height: 20px;
    min-width: 20px;
    max-width: 20px;
    min-height: 20px;
    max-height: 20px;
    flex-shrink: 0;
}

/* Mobile Menu Performance - will-change removed for better compositing */

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Print Styles */
@media print {
    header,
    footer,
    .back-to-top,
    .copy-button,
    .mobile-menu-toggle,
    .mobile-overlay,
    .back-link,
    .tags,
    .toc-sidebar,
    .reading-progress,
    .share-buttons,
    .search-modal {
        display: none !important;
    }

    body {
        background: white;
        color: black;
        font-size: 12pt;
        line-height: 1.5;
    }

    main {
        max-width: 100%;
        padding: 0;
        margin: 0;
    }

    h1, h2, h3, h4 {
        color: black;
        page-break-after: avoid;
    }

    p, li {
        orphans: 3;
        widows: 3;
    }

    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }

    @page {
        margin: 2cm;
    }
}

/* ============================================
   UI ENHANCEMENTS - Alpine.js Powered Features
   ============================================ */

/* Skip to Content Link (Accessibility) */
.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    background: var(--primary-color);
    color: var(--on-dark);
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--border-radius);
    z-index: 1001;
    text-decoration: none;
    font-weight: 500;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 1rem;
}

/* Enhanced Focus Indicators */
:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 3px;
}

.btn:focus-visible {
    outline-offset: 4px;
    box-shadow: 0 0 0 4px var(--primary-light);
}

.card:focus-within {
    box-shadow: 0 0 0 3px var(--primary-color);
}

/* Breadcrumbs */
.breadcrumbs {
    margin-bottom: var(--space-lg);
    font-size: 0.875rem;
}

.breadcrumbs ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2xs);
    margin: 0;
    padding: 0;
}

.breadcrumbs li {
    display: flex;
    align-items: center;
}

.breadcrumbs li:not(:last-child)::after {
    content: '/';
    margin-left: var(--space-2xs);
    color: var(--text-muted);
}

.breadcrumbs a {
    color: var(--text-muted);
    text-decoration: none;
}

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

.breadcrumbs li[aria-current="page"] {
    color: var(--foreground);
    font-weight: 500;
}

.toc-link:hover,
.toc-link.active {
    color: var(--primary-color);
}

.toc-link.active {
    font-weight: 500;
}

/* Search Modal */
.search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 200;
}

.search-modal {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 560px;
    background: var(--card-bg);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 201;
    overflow: hidden;
}

.search-input {
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    border: none;
    border-bottom: 1px solid var(--border-color);
    font-size: 1.125rem;
    background: transparent;
    color: var(--foreground);
    font-family: var(--font-sans);
}

.search-input:focus {
    outline: none;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-result-title {
    display: block;
    color: var(--foreground);
    font-weight: 500;
    margin-bottom: var(--space-3xs);
}

.search-result-title mark {
    background: var(--primary-light);
    color: var(--primary-color);
    padding: 0 0.125rem;
    border-radius: 2px;
}

.search-result-date {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.search-results-dropdown {
    max-height: 320px;
    overflow-y: auto;
    margin: 0;
    padding: 0;
    list-style: none;
}

.search-hint {
    margin: 0;
    padding: var(--space-sm) var(--space-lg);
    font-size: 0.875rem;
    color: var(--text-muted);
}

.search-result-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: var(--space-xs) var(--space-lg);
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
    transition: background 0.15s ease;
}

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

.search-result-item:hover {
    background: var(--background);
}

.search-result-item .search-result-title {
    color: var(--foreground);
    font-weight: 500;
    font-size: 0.9375rem;
}

.search-result-item:hover .search-result-title {
    color: var(--primary-color);
}

.search-result-item .search-result-date {
    color: var(--text-muted);
    font-size: 0.75rem;
    flex-shrink: 0;
    margin-left: var(--space-sm);
}

.search-trigger {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    text-decoration: none;
    padding: var(--space-2xs) var(--space-xs-half);
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-muted);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-trigger:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.search-trigger kbd {
    background: var(--background);
    padding: 0.125rem var(--space-3xs-half);
    border-radius: 4px;
    font-size: 0.75rem;
    font-family: var(--font-mono);
    border: 1px solid var(--border-color);
}

/* Resume Timeline */
.job {
    position: relative;
    padding-left: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.job::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.5rem;
    width: 10px;
    height: 10px;
    background: var(--primary-color);
    border-radius: 50%;
    border: 2px solid var(--card-bg);
    box-shadow: 0 0 0 2px var(--primary-color);
}

.job::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1.5rem;
    bottom: -1rem;
    width: 2px;
    background: var(--border-color);
}

.job:last-child::after {
    display: none;
}

/* Print Button */
.print-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2xs);
}

/* Enhanced Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

main {
    animation: fadeInUp 0.5s ease-out;
}

/* Staggered card animations — only when motion is acceptable */
@media (prefers-reduced-motion: no-preference) {
    .card,
    .archive-item,
    .blog-item {
        animation: fadeInUp 0.4s ease-out;
        animation-fill-mode: both;
    }

    .card:nth-child(1), .archive-item:nth-child(1) { animation-delay: 0.05s; }
    .card:nth-child(2), .archive-item:nth-child(2) { animation-delay: 0.1s; }
    .card:nth-child(3), .archive-item:nth-child(3) { animation-delay: 0.15s; }
    .card:nth-child(4), .archive-item:nth-child(4) { animation-delay: 0.2s; }
    .card:nth-child(5), .archive-item:nth-child(5) { animation-delay: 0.25s; }
    .card:nth-child(6), .archive-item:nth-child(6) { animation-delay: 0.3s; }
}

/* Enhanced Card Hover */
.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

/* Button Hover Ripple Effect */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.15);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.btn:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

.btn--compact {
    font-size: 0.875rem;
    padding: var(--space-2xs) var(--space-sm);
}

/* Resume toolbar */
.resume-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.resume-actions__group {
    display: flex;
    gap: var(--space-xs);
}