:root {
    /* Crystalline Grid Palette (iOS 26 Concept) */
    --bg-canvas: #F2F4F8;
    /* Pastel Cool Grey */

    /* Refined Pastel Mesh (Matches Image) */
    --bg-mesh:
        radial-gradient(at 0% 0%, rgba(200, 240, 255, 0.8) 0px, transparent 50%),
        /* Brighter Blue Top Left */
        radial-gradient(at 100% 0%, rgba(255, 220, 230, 0.8) 0px, transparent 50%),
        /* Soft Pink Top Right */
        radial-gradient(at 0% 100%, rgba(220, 255, 230, 0.6) 0px, transparent 50%),
        /* Mint Bottom Left */
        radial-gradient(at 100% 100%, rgba(240, 240, 255, 0.8) 0px, transparent 50%);
    /* Lavender Bottom Right */

    --bg-gradient: var(--bg-mesh);

    /* Glass Material - High Transparency (Global) */
    --glass-bg: rgba(255, 255, 255, 0.3);
    /* Unified High Transparency */
    --glass-blur: 30px;
    /* Stronger blur to compensate for transparency */
    --glass-saturate: 180%;

    /* Volumetric Lighting (Borders) */
    --glass-border-light: rgba(255, 255, 255, 0.6);
    --glass-border-shadow: rgba(0, 0, 0, 0.05);

    /* Shadows */
    --shadow-ambient: 0px 10px 30px rgba(0, 0, 0, 0.04);
    --shadow-direct: 0px 1px 3px rgba(0, 0, 0, 0.02);

    /* Typography */
    --font-main: 'Montserrat', sans-serif;
    --font-mono: "SF Mono", monospace;

    --text-primary: #1d1d1f;
    --text-secondary: #4a4a4a;
    --text-tertiary: #86868b;

    --accent-color: #007AFF;

    --card-radius: 24px;
    --transition-elastic: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);

    /* Navbar uses global glass settings now */
    --nav-bg: var(--glass-bg);
    --nav-active-bg: #ffffff;
}

[data-theme="dark"] {
    --bg-canvas: #000000;
    --bg-gradient: linear-gradient(135deg, #1c1c1e 0%, #000000 100%);

    --glass-bg: rgba(30, 30, 30, 0.4);
    --glass-border-light: rgba(255, 255, 255, 0.15);
    --glass-border-shadow: rgba(0, 0, 0, 0.3);

    --shadow-ambient: 0px 10px 30px rgba(0, 0, 0, 0.3);
    --shadow-direct: 0px 1px 3px rgba(0, 0, 0, 0.2);

    --text-primary: #F5F5F7;
    --text-secondary: #A1A1A6;
    --text-tertiary: #86868b;

    --accent-color: #007AFF;

    --nav-bg: var(--glass-bg);
    --nav-active-bg: #3a3a3c;
}

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

body {
    font-family: var(--font-main);
    background: var(--bg-gradient);
    background-color: var(--bg-canvas);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* Skip Navigation Link - Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent-color);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    font-weight: 600;
    border-radius: 0 0 8px 0;
    z-index: 10000;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 0;
    outline: 2px solid white;
    outline-offset: 2px;
}

/* Navbar - Floating Pill */
#navbar {
    position: fixed;
    top: 10px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    z-index: 1000;
    pointer-events: none;
}

.nav-links {
    display: flex;
    gap: 5px;
    align-items: center;
    background: var(--nav-bg);
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    padding: 6px 8px;
    border-radius: 100px;
    box-shadow:
        inset 0 1px 1px 0 var(--glass-border-light),
        0 10px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    pointer-events: auto;
}

.nav-links a {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    padding: 8px 24px;
    border-radius: 100px;
    transition: var(--transition-elastic);
    text-decoration: none;
    opacity: 0.7;
}

.nav-links a:hover {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.2);
}

.nav-links a.active {
    opacity: 1;
    color: #000000;
    background-color: var(--nav-active-bg);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}



/* Settings Menu */
.settings-container {
    position: relative;
    margin-left: 10px;
}

.settings-btn {
    background: var(--nav-bg);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    box-shadow: inset 0 1px 1px 0 var(--glass-border-light);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--text-primary);

    transition: var(--transition-elastic);
    cursor: pointer;
}

.settings-btn:hover {
    transform: scale(1.1);
    background-color: rgba(255, 255, 255, 0.2);
}

.settings-dropdown {
    position: absolute;
    top: 50px;
    right: 0;
    width: 200px;
    background: var(--nav-bg);
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 12px;
    display: none;
    flex-direction: column;
    gap: 12px;
    z-index: 1000;
}

.settings-dropdown.active {
    display: flex;
    animation: fadeIn 0.2s ease-out;
}

.settings-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding-left: 4px;
}

.settings-options {
    display: flex;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    padding: 4px;
    gap: 4px;
}

.settings-opt {
    flex: 1;
    border: none;
    background: transparent;
    padding: 6px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-opt:hover {
    background: rgba(255, 255, 255, 0.1);
}

.settings-opt.active {
    background: var(--nav-active-bg);
    color: #000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-weight: 600;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Main Content */
#content {
    padding-top: 100px;
    min-height: calc(100vh - 200px);
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 40px;
    text-align: center;
    color: var(--text-primary);
}

/* Filter Chips */
/* Filter Chips - Matches Navbar Architecture */
.filter-chips-container {
    display: inline-flex;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 40px;
    margin-top: 20px;

    /* Glass Pill Container Style */
    background: var(--nav-bg);
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    padding: 6px 8px;
    border-radius: 100px;
    box-shadow:
        inset 0 1px 1px 0 var(--glass-border-light),
        0 10px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);

    /* Center the container itself */
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    max-width: 90%;
}

.filter-chip {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 8px 24px;
    border-radius: 100px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-elastic);
    color: inherit;
    text-decoration: none;
    text-decoration: none;
    display: inline-block;
    opacity: 0.7;
}

.filter-chip:hover {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.2);
    transform: none;
}

.filter-chip.active {
    background-color: var(--nav-active-bg);
    color: #000000;
    border-color: transparent;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    opacity: 1;
}

/* Blog Grid */
.blog-list-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    padding: 20px 0;
}

/* Blog Card - High Transparency */
.blog-card {
    border-radius: var(--card-radius);
    background: var(--glass-bg);
    /* Use global high transparency */
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));

    box-shadow:
        inset 0 1px 1px 0 var(--glass-border-light),
        inset 0 -1px 1px 0 var(--glass-border-shadow),
        var(--shadow-ambient),
        var(--shadow-direct);

    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 32px;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: var(--transition-elastic);
    color: var(--text-primary);
    text-decoration: none;
}

[data-theme="dark"] .blog-card {
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.blog-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow:
        inset 0 1px 1px 0 rgba(255, 255, 255, 1),
        0 20px 50px -12px rgba(0, 0, 0, 0.12);
}

.blog-card:active {
    transform: scale(0.98);
    opacity: 0.95;
}

.blog-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-family: var(--font-main);
    font-size: 0.75rem;
}

.blog-category {
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    color: var(--accent-color);
    opacity: 0.9;
}

.blog-meta span:last-child {
    color: var(--text-tertiary);
    font-family: var(--font-mono);
}

.blog-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.1;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.blog-card p {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

/* Article Detail Styles */
.detail-card {
    max-width: 800px;
    margin: 0 auto;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    padding: 20px;
    border-radius: var(--card-radius);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow:
        inset 0 1px 1px 0 var(--glass-border-light),
        inset 0 -1px 1px 0 var(--glass-border-shadow),
        var(--shadow-ambient),
        var(--shadow-direct);
}

.article-container {
    max-width: 800px;
    margin: 0 auto;
}

.related-post-card {
    color: inherit;
    text-decoration: none;
}

[data-theme="dark"] .detail-card {
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.article-content {
    /* Removed container constraints to let it fill the card */
    color: var(--text-primary);
}

.article-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-top: 20px;
    /* Increased top margin (more than bottom) */
    margin-bottom: 20px;
    /* Increased bottom margin */
    text-align: center;
    color: var(--text-primary);
    line-height: 1.2;
    /* Tighter line height */
}

.article-meta {
    text-align: center;
    margin-bottom: 40px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.meta-separator {
    color: var(--text-tertiary);
}

.reading-time {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Breadcrumbs */
.breadcrumbs {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    padding: 12px 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.breadcrumbs a {
    color: var(--accent-color);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

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

.breadcrumb-separator {
    color: var(--text-tertiary);
    user-select: none;
}

.breadcrumb-current {
    color: var(--text-primary);
    font-weight: 500;
}

.article-content ul,
.article-content ol {
    margin-left: 10px;
    margin-bottom: 10px;
    margin-top: 10px;
    list-style-position: inside;
}

.tag-pill {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 10px;
    transition: opacity 0.2s ease;
}

.tag-pill:hover {
    opacity: 0.8;
    text-decoration: none;
}

.article-content li {
    margin-bottom: 10px;
    display: list-item;
}

.article-content h1 {
    margin-top: 15px;
    /* Very large top margin */
    margin-bottom: 5px;
    /* Large bottom margin */
    color: var(--text-primary);
}

/* Load More Button */
.load-more-container {
    display: flex;
    justify-content: center;
    margin-top: 40px;
    margin-bottom: 20px;
}

.load-more-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 32px;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 100px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: var(--transition-elastic);
    cursor: pointer;
    box-shadow: var(--shadow-ambient);
    font-family: var(--font-main);
}

.load-more-btn:hover {
    transform: translateY(-2px) scale(1.02);
    background: #ffffff;
    color: #000000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .load-more-btn:hover {
    background: #3a3a3c;
    color: #ffffff;
}

.article-content h2 {
    margin-top: 15px;
    /* Increased top margin */
    margin-bottom: 5px;
    /* Increased bottom margin */
    color: var(--text-primary);
}

/* Responsive Images in Articles */
.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    display: block;
    margin: 30px auto;
    box-shadow: var(--shadow-ambient);
}

/* Glassmorphic Table of Contents */
.toc-container {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 24px;
    padding: 0;
    margin-bottom: 40px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    overflow: hidden;
    max-width: 600px;
    /* Increased width */
    /* Limit width like a menu */
    margin-left: auto;
    margin-right: auto;
}

[data-theme="dark"] .toc-container {
    background: rgba(30, 30, 30, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.toc-title {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    padding: 20px 24px 10px;
    margin: 0;
    font-weight: 600;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-list li {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .toc-list li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.toc-list li:last-child {
    border-bottom: none;
}

.toc-list a {
    display: flex;
    align-items: center;
    padding: 5px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    transition: background-color 0.2s ease;
    font-size: 1rem;
}

.toc-list a:hover {
    background-color: rgba(255, 255, 255, 0.4);
}

[data-theme="dark"] .toc-list a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.toc-icon {
    margin-right: 12px;
    opacity: 0.6;
    color: var(--accent-color);
}

.toc-text {
    flex-grow: 1;
}

.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
}

/* Projects Grid */
.projects-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.project-card {
    border-radius: var(--card-radius);
    background: var(--glass-bg);
    /* Use global high transparency */
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));

    box-shadow:
        inset 0 1px 1px 0 var(--glass-border-light),
        inset 0 -1px 1px 0 var(--glass-border-shadow),
        var(--shadow-ambient),
        var(--shadow-direct);

    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 70px 32px 32px;
    /* Increased top padding for content */
    margin-top: 60px;
    /* Space for the overlapping image */

    transition: var(--transition-elastic);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    /* For absolute positioning of image */
    overflow: visible;
    /* Allow image to overflow */
}

[data-theme="dark"] .project-card {
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.blog-card,
.project-card,
.related-post-card {
    color: var(--text-primary);
    text-decoration: none;
}

.project-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow:
        inset 0 1px 1px 0 rgba(255, 255, 255, 1),
        0 20px 50px -12px rgba(0, 0, 0, 0.12);
    z-index: 10;
}

.project-image-wrapper {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 120px;
    z-index: 2;
}

.project-image-container {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    background: var(--card-bg);
    /* Fallback */
}

.project-image {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--glass-bg);
    /* Create a border that matches/blends or frames it */
    /* If we want it to look like a cutout, we might need the background color of the body, 
       but since the body is a mesh gradient, a solid border is safer/cleaner. */
}

.project-image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-purple));
    border-radius: 50%;
    border: 4px solid var(--glass-bg);
}

.project-info-banner {
    width: 100%;
}

.project-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    margin-top: 10px;
    color: var(--accent-color);
}

.project-description {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* About Section */
.about-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

.about-profile-img {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 50%;
    box-shadow: var(--shadow-ambient);
}

.about-text {
    max-width: 900px;
    text-align: left;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.about-text p {
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.about-timeline {
    position: relative;
    display: grid;
    gap: 28px;
    margin: 44px 0;
    padding-left: 28px;
}

.about-timeline::before {
    content: "";
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: 6px;
    width: 2px;
    background: rgba(0, 122, 255, 0.18);
}

.timeline-item {
    position: relative;
}

.timeline-item::before {
    content: "";
    position: absolute;
    top: 8px;
    left: -28px;
    width: 14px;
    height: 14px;
    border: 3px solid var(--bg-canvas);
    border-radius: 50%;
    background: var(--accent-color);
    box-shadow: 0 0 0 1px rgba(0, 122, 255, 0.18);
}

.timeline-date {
    display: block;
    margin-bottom: 6px;
    color: var(--accent-color);
    font-size: 0.86rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0;
}

.timeline-item h3 {
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 1.08rem;
    line-height: 1.35;
}

.timeline-item p {
    margin-bottom: 0;
}

.about-education {
    margin: 48px 0 36px;
}

.about-education h3 {
    margin-bottom: 18px;
    color: var(--text-primary);
    font-size: 1.25rem;
    line-height: 1.35;
}

.education-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.education-grid article {
    padding: 18px;
    border-radius: 18px;
    background: var(--glass-bg);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: var(--shadow-ambient);
}

.education-grid span {
    display: block;
    margin-bottom: 8px;
    color: var(--accent-color);
    font-size: 0.82rem;
    font-weight: 700;
}

.education-grid strong {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 0.98rem;
    line-height: 1.35;
}

.education-grid p {
    margin-bottom: 0;
    font-size: 0.95rem;
}

/* Contact */
.contact-container {
    text-align: center;
    padding: 60px 20px;
}

.contact-text {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.contact-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.contact-btn {
    gap: 10px;
    margin-bottom: 30px;
    justify-content: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 32px;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 100px;
    color: var(--text-primary);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition-elastic);
    cursor: pointer;
    box-shadow: var(--shadow-ambient);
}

.btn:hover {
    transform: translateY(-2px) scale(1.02);
    background: #ffffff;
    color: #000000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

/* Post Navigation (Previous/Next) */
.post-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 60px;
    gap: 20px;
    width: 100%;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 100px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition-elastic);
    cursor: pointer;
    font-size: 1rem;
    max-width: 48%;
    min-height: 48px;
    /* Minimum touch target size */
}

.nav-btn:hover {
    transform: translateY(-2px);
}

.nav-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Previous Button - Glassy/Transparent (Like "Skip") */
.nav-btn-prev {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-secondary);
}

.nav-btn-prev:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

/* Next Button - Solid White (Like "Next") */
.nav-btn-next {
    background: #ffffff;
    color: #000000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.5);
    margin-left: auto;
    /* Push to right if alone */
}

.nav-btn-next:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px) scale(1.02);
}

/* Dark theme adjustments */
[data-theme="dark"] .nav-btn-next {
    background: #ffffff;
    color: #000000;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {

    /* Typography & Spacing */
    .section-title {
        font-size: 2rem;
        margin-bottom: 30px;
    }

    #content {
        padding-top: 80px;
        padding-left: 10px;
        /* Reduced side padding */
        padding-right: 10px;
    }

    .blog-card,
    .detail-card {
        padding: 24px;
    }

    .project-card {
        padding: 80px 24px 24px;
        /* Restore top padding for image */
    }

    /* Grid Adjustments for Mobile */
    .blog-list-container,
    .projects-container {
        grid-template-columns: 1fr;
        /* Force single column */
        gap: 20px;
        /* Increased spacing for easier reading */
    }

    /* Tag Menu - Horizontal Scroll */
    .filter-chips-container {
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        max-width: 100%;
        left: 0;
        transform: none;
        margin: 80px 0 30px 0;
        padding: 6px 15px;
        /* Hide scrollbar */
        -ms-overflow-style: none;
        scrollbar-width: none;
        /* Ensure pill shape is maintained visually */
        border-radius: 100px;
        /* Allow scrolling to edges */
        width: 100%;
        box-sizing: border-box;
    }

    .filter-chips-container::-webkit-scrollbar {
        display: none;
    }

    .filter-chip {
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* Navbar Adjustments - Better touch targets */
    .nav-links {
        padding: 6px 8px;
        gap: 4px;
    }

    .nav-links a {
        padding: 8px 12px;
        /* Improved touch target */
        font-size: 0.85rem;
        /* More readable */
        min-height: 36px;
        /* Minimum touch target */
        display: flex;
        align-items: center;
    }
}

/* Glassmorphic Table */
.table-container {
    overflow-x: auto;
    margin: 30px 0;
    border-radius: 16px;
    box-shadow: var(--shadow-ambient);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    border-radius: 16px;
    overflow: hidden;
}

th,
td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-secondary);
}

th {
    background-color: rgba(255, 255, 255, 0.3);
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

[data-theme="dark"] th {
    background-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] th,
[data-theme="dark"] td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

tr:last-child td {
    border-bottom: none;
}

/* Cookie Consent Banner */
.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    padding: 20px;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
}

.cookie-consent-banner.show {
    transform: translateY(0);
}

[data-theme="dark"] .cookie-consent-banner {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.cookie-consent-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.cookie-consent-text {
    flex: 1;
    min-width: 300px;
}

.cookie-consent-text p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

.cookie-consent-text p:first-child {
    color: var(--text-primary);
    margin-bottom: 8px;
}

.cookie-consent-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.cookie-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.cookie-btn-accept {
    background: var(--accent-color);
    color: white;
}

.cookie-btn-accept:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.cookie-btn-decline {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.cookie-btn-decline:hover {
    background: rgba(255, 255, 255, 0.3);
}

@media (max-width: 768px) {
    .cookie-consent-content {
        flex-direction: column;
        align-items: stretch;
    }

    .cookie-consent-actions {
        width: 100%;
    }

    .cookie-btn {
        flex: 1;
    }
}

/* Additional Mobile Optimizations */
@media (max-width: 768px) {

    /* Breadcrumbs - Horizontal scroll on mobile */
    .breadcrumbs {
        overflow-x: auto;
        white-space: nowrap;
        padding: 12px 4px;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    .breadcrumbs::-webkit-scrollbar {
        display: none;
    }

    /* Article Title - Smaller on mobile */
    .article-title {
        font-size: 1.8rem;
        line-height: 1.3;
    }

    /* Reading time and meta - Better wrapping */
    .article-meta {
        font-size: 0.85rem;
    }

    /* Settings button - Larger touch target */
    .settings-btn {
        width: 44px;
        height: 44px;
    }

    /* Post navigation - Stack vertically with better spacing */
    .post-navigation {
        flex-direction: column-reverse;
        /* Next button appears first (top), Previous button second (bottom) */
        gap: 16px;
    }

    .nav-btn {
        width: 100%;
        max-width: 100%;
        text-align: center;
        padding: 16px 32px;
        font-size: 1rem;
        min-height: 52px;
        /* Larger touch target on mobile */
    }

    .nav-btn-next {
        margin-left: 0;
        /* Remove auto margin on mobile */
    }

    /* About profile image - Smaller */
    .about-profile-img {
        width: 150px;
        height: 150px;
    }

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

    /* Back link - Larger touch target */
    .back-link {
        display: inline-block;
        padding: 8px 0;
        margin-bottom: 16px;
    }

    /* TOC - Full width on mobile */
    .toc-container {
        max-width: 100%;
    }

    /* Cookie consent - Smaller text */
    .cookie-consent-text p {
        font-size: 0.85rem;
    }

    .cookie-btn {
        padding: 12px 20px;
        font-size: 0.85rem;
    }

    /* Load More button - Larger touch target */
    .load-more-btn {
        padding: 16px 40px;
        font-size: 1rem;
        min-height: 52px;
        width: 100%;
        max-width: 300px;
    }

    /* Improved touch highlight for all interactive elements */
    a,
    button,
    .blog-card,
    .project-card,
    .filter-chip {
        -webkit-tap-highlight-color: rgba(0, 122, 255, 0.2);
    }
}

/* Very small screens */
@media (max-width: 480px) {
    .section-title {
        font-size: 1.6rem;
    }

    .article-title {
        font-size: 1.5rem;
    }

    .breadcrumbs {
        font-size: 0.75rem;
    }

    .nav-links a {
        padding: 6px 8px;
        font-size: 0.7rem;
    }
}

/* Reading Progress Bar */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
    z-index: 10001;
    pointer-events: none;
}

.reading-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color), #00d4ff);
    width: 0%;
    transition: width 0.1s ease-out;
    box-shadow: 0 0 10px rgba(0, 122, 255, 0.5);
}

[data-theme="dark"] .reading-progress-bar {
    box-shadow: 0 0 10px rgba(0, 122, 255, 0.8);
}

/* Blog Search */
.blog-search-container {
    max-width: 600px;
    margin: 0 auto 20px;
    position: relative;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 16px;
    color: var(--text-tertiary);
    pointer-events: none;
}

.blog-search-input {
    width: 100%;
    padding: 14px 45px 14px 48px;
    font-size: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    color: var(--text-primary);
    font-family: var(--font-main);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-ambient);
}

.blog-search-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

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

.search-clear {
    position: absolute;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px 8px;
    transition: color 0.2s ease;
}

.search-clear:hover {
    color: var(--text-primary);
}

/* Search Results */
.search-results {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    max-height: 500px;
    overflow-y: auto;
    z-index: 1000;
}

[data-theme="dark"] .search-results {
    border-color: rgba(255, 255, 255, 0.1);
}

.search-result-item {
    display: block;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: background 0.2s ease;
    color: inherit;
    text-decoration: none;
}

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

.search-result-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.search-result-category {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.search-result-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.search-result-preview {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 6px;
}

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

.search-no-results {
    padding: 32px 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.error-container {
    max-width: 640px;
    margin: 64px auto;
    padding: 32px;
    text-align: center;
    border-radius: var(--card-radius);
    background: var(--glass-bg);
    box-shadow: var(--shadow-ambient);
}

.project-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.error-container {
    max-width: 640px;
    margin: 64px auto;
    padding: 32px;
    text-align: center;
    border-radius: var(--card-radius);
    background: var(--glass-bg);
    box-shadow: var(--shadow-ambient);
}

.project-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.search-more {
    padding: 12px 20px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Highlight */
.search-result-title mark,
.search-result-preview mark {
    background: rgba(0, 122, 255, 0.2);
    color: var(--accent-color);
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
}

@media (max-width: 768px) {
    .blog-search-container {
        max-width: 100%;
        padding: 0 10px;
    }

    .blog-search-input {
        font-size: 0.9rem;
        padding: 12px 40px 12px 44px;
    }

    .search-results {
        max-height: 400px;
    }
}

/* Enhanced Footer with Social Links */
#footer {
    margin-top: 80px;
    padding: 40px 20px 30px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.social-links {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-ambient);
}

.social-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    border-color: var(--accent-color);
}

.social-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.social-text {
    font-size: 0.85rem;
}

/* RSS special color */
.rss-link {
    color: #FF6600;
}

.rss-link:hover {
    border-color: #FF6600;
    background: rgba(255, 102, 0, 0.1);
}

.rss-link svg {
    fill: #FF6600;
}

.footer-copyright {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-align: center;
}

@media (max-width: 768px) {
    .social-links {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
    }

    .social-link {
        width: 100%;
        justify-content: center;
    }

    #footer {
        margin-top: 60px;
    }
}

/* Formula Block - For displaying mathematical formulas */
.formula-block {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1.1rem;
    font-style: italic;
    text-align: center;
    padding: 16px 24px;
    margin: 20px 0;
    background: rgba(0, 122, 255, 0.05);
    border-left: 4px solid var(--accent-color);
    border-radius: 8px;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

[data-theme="dark"] .formula-block {
    background: rgba(0, 122, 255, 0.1);
}
