:root {
    --color-primary: #0366d6;
    --color-primary-hover: #024a9c;
    --border-radius: 8px;
    --font-main: "Inter", sans-serif;

    --color-bg: #f6f8fa;
    --color-text: #24292e;
    --color-card-bg: #ffffff;
    --color-border: #d0d7de;
    --color-tagline: #586069;
    --color-icon: #586069;
    --color-github-icon: #24292e;
    --color-hover-shadow: rgba(140, 149, 159, 0.2);

    --color-bg-dark: #131821;
    --color-text-dark: #c9d1d9;
    --color-card-bg-dark: #161b22;
    --color-border-dark: #30363d;
    --color-tagline-dark: #8b949e;
    --color-icon-dark: #8b949e;
    --color-github-icon-dark: #c9d1d9;
    --color-hover-shadow-dark: rgba(200, 200, 255, 0.1);

    --color-highlight-glow: rgba(139, 92, 246, 0.25);
}

body.dark-mode {
    --color-bg: var(--color-bg-dark);
    --color-text: var(--color-text-dark);
    --color-card-bg: var(--color-card-bg-dark);
    --color-border: var(--color-border-dark);
    --color-tagline: var(--color-tagline-dark);
    --color-icon: var(--color-icon-dark);
    --color-github-icon: var(--color-github-icon-dark);
    --color-hover-shadow: var(--color-hover-shadow-dark);

    --color-highlight-glow: rgba(139, 92, 246, 0.5);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    line-height: 1.6;
    background-color: var(--color-bg);
    color: var(--color-text);
    max-width: 1050px;
    margin: 0 auto;
    padding: 20px;
    transition: background-color 0.3s, color 0.3s;
}

#theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: var(--color-icon);
    font-size: 1.4em;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    z-index: 1000;
    transition: color 0.2s, background-color 0.2s;
}

#theme-toggle:hover {
    color: var(--color-primary);
    background-color: rgba(0,0,0,0.05);
}

body.dark-mode #theme-toggle:hover {
    background-color: rgba(255,255,255,0.1);
}

h1, h2, h3 {
    font-family: var(--font-main);
    margin: 0;
    padding: 0;
    line-height: 1.3;
}

h1 {
    font-size: 2.5em;
    font-weight: 700;
}

h2 {
    font-size: 1.75em;
    font-weight: 600;
    border-bottom: 2px solid var(--color-border);
    padding-bottom: 10px;
    margin-top: 40px;
    margin-bottom: 24px;
}

h3 {
    font-size: 1.25em;
    font-weight: 600;
    color: var(--color-primary);
}

h3 a {
    color: var(--color-primary);
}

p {
    margin: 0 0 16px 0;
}

a {
    text-decoration: none;
    color: var(--color-primary);
    font-weight: 600;
}

a:hover {
    text-decoration: underline;
}

ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.header {
    text-align: center;
    padding: 60px 0 40px 0;
    margin-bottom: 20px;
}

.header h1 {
    font-size: 3em;
    font-weight: 700;
    margin-bottom: 12px;
}

.tagline {
    font-size: 1.1em;
    color: var(--color-tagline);
    font-weight: 400;
    margin: 0 0 40px 0;
}

.main-nav {
    position: sticky;
    top: 20px;
    z-index: 100;
    padding: 12px 30px;
    margin: 0 auto 80px auto;
    width: fit-content;
    border-radius: 50px;

    background-color: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(50px) saturate(200%);
    -webkit-backdrop-filter: blur(50px) saturate(200%);
    border-radius: 999px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 10px 25px;

    transition: all 0.3s ease;
}

body.dark-mode .main-nav {
    background-color: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.main-nav ul {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 25px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.main-nav a {
    font-size: 1em;
    font-weight: 600;
    color: var(--color-text);
    padding: 5px 0;
    transition: color 0.2s ease;
    text-decoration: none;
}

@media (hover: hover) {
    .main-nav a:hover {
        color: var(--color-primary);
        text-decoration: none;
    }
}

.social-links ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-bottom: 24px;
}

.social-links a {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.8em;
    color: var(--color-icon);
    text-decoration: none;
    z-index: 1;
    will-change: transform;
    transform: translateZ(0);
    transition: transform 0.3s ease-out, color 0.3s ease;
}

.social-links a i,
.social-links a svg,
.social-links a img {
    display: block;
    width: 1em !important;
    height: 1em !important;
    font-size: 1em !important;
    line-height: 1 !important;
    text-align: center;
    margin: 0 auto !important;
    padding: 0 !important;
    fill: currentColor;
}

.social-links a::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--color-primary);
    border-radius: 50%;
    z-index: -1;
    opacity: 0;
    filter: blur(12px);
    transform: scale(0.4) translateZ(0);
    will-change: transform, opacity;
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

@media (hover: hover) {
    .social-links a:hover {
        color: var(--color-primary);
        transform: translateY(-5px) scale(1.1) translateZ(0);
        transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.2s ease;
    }

    .social-links a:hover::before {
        opacity: 0.15;
        transform: scale(1) translateZ(0);
        transition: opacity 0.2s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    body.dark-mode .social-links a:hover::before {
        opacity: 0.1;
    }
}

@media (hover: none) {
    .social-links a:active {
        transform: scale(0.9);
        color: var(--color-primary);
        transition: transform 0.1s ease, color 0.1s ease;
    }
}

.contact-email {
    font-size: 1.3em;
    color: var(--color-tagline);
    font-weight: 500;
    margin-top: 0;
    margin-bottom: 40px;
}

.project-list {
    display: block;
}

.project-content {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
}

.project-image {
    flex: 1 1 40%;
    max-width: 300px;
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border);
    object-fit: cover;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

@media (hover: hover) {
    .project-image:hover {
        transform: scale(1.03);
        box-shadow: 0 8px 20px var(--color-hover-shadow);
    }
}

.project-text {
    flex: 1 1 55%;
    min-width: 250px;
}

@media (max-width: 700px) {
    .project-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .project-image {
        width: 100%;
        max-width: 100%;
    }
}

.publication-list {
    display: block;
}

.publication-content {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
}

.publication-image {
    flex: 1 1 40%;
    max-width: 300px;
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border);
    object-fit: cover;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

@media (hover: hover) {
    .publication-image:hover {
        transform: scale(1.03);
        box-shadow: 0 8px 20px var(--color-hover-shadow);
    }
}

.publication-text {
    flex: 1 1 55%;
    min-width: 250px;
}

.publication-title {
    font-size: 1.25em;
    font-weight: 600;
    color: var(--color-text);
    margin-top: 0;
    margin-bottom: 5px;
    line-height: 1.3;
}

.authors {
    font-size: 1em;
    color: var(--color-tagline);
    font-style: italic;
    margin-bottom: 4px;
}

.publication-meta {
    font-size: 1em;
    font-style: italic;
    color: var(--color-tagline);
    margin-bottom: 24px;
}

.publication-description {
    font-size: 0.95em;
    color: var(--color-text);
    margin-bottom: 16px;
    line-height: 1.5;
}

.publication-links {
    display: flex;
    gap: 16px;
}

.pub-link {
    font-size: 1em;
    font-weight: 600;
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.pub-link:hover {
    color: var(--color-primary-hover);
}

@media (max-width: 700px) {
    .publication-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .publication-image {
        width: 100%;
        max-width: 100%;
    }
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0px;
}

.project-header h3 {
    margin: 0;
}

.project-header .github-link {
    font-size: 1.4em;
    color: var(--color-github-icon);
    transition: color 0.2s;
}

.project-header .github-link:hover {
    color: var(--color-primary);
    text-decoration: none;
}

.project-card p {
    font-size: 0.95em;
    color: var(--color-text);
    margin: 0;
}

.project-card .project-meta {
    font-size: 0.95em;
    font-style: italic;
    color: var(--color-tagline);
    margin-top: 0px;
    margin-bottom: 30px;
}

.project-description {
    font-size: 0.95em;
    color: var(--color-text);
    margin-top: 0;
    margin-bottom: 0;
}

.github-stats-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 0;
    margin-bottom: 20px;
    align-items: start;
    justify-items: center;
}

.github-stats-container > a {
    display: block;
    perspective: 1000px;
}

.github-stat-img.dark {
    display: none;
}

body.dark-mode .github-stat-img.light {
    display: none;
}

body.dark-mode .github-stat-img.dark {
    display: block;
}

.experience-list {
    position: relative;
    padding-left: 30px;
}

.experience-list::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 5px;
    bottom: 5px;
    width: 2px;
    background-color: var(--color-border);
}

.experience-list > li {
    position: relative;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--color-border);
}

.experience-list > li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.experience-list > li::before {
    content: '';
    position: absolute;
    left: -26px;
    top: 5px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--color-bg);
    border: 2px solid var(--color-primary);
    z-index: 1;
}

.experience-list .item-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
}

.experience-list .item-title {
    font-size: 1.15em;
    font-weight: 600;
}

.experience-list .item-meta {
    font-size: 0.95em;
    color: var(--color-tagline);
    font-style: normal;
    font-weight: 600;
}

.experience-details {
    list-style: disc;
    padding-left: 20px;
    margin-top: 24px;
}

.experience-details li {
    font-size: 0.95em;
    color: var(--color-text);
    position: relative;
    margin-bottom: 8px;
}

#tech-stack-interactive-container {
    position: relative;
    width: 100%;
    height: 600px;
    margin: 0 auto;
    overflow: hidden;
    cursor: grab;
}

#tech-stack-interactive-container:active {
    cursor: grabbing;
}

.tech-node {
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    position: absolute;
    user-select: none;
    transition: transform 0.2s ease;
    padding: 5px;
}

.tech-node:hover {
    transform: scale(1.15);
    z-index: 10;
}

.tech-node svg {
    width: 100%;
    height: 100%;
    fill: var(--color-primary);
    pointer-events: none;
    margin: 0;
    display: block;
}

.tech-node h3 {
    display: none;
}

.tech-node.size-xl {
    width: 150px;
    height: 150px;
}

.tech-node.size-l {
    width: 90px;
    height: 90px;
}

.tech-node.size-m {
    width: 75px;
    height: 75px;
}

.tech-node.size-s {
    width: 60px;
    height: 60px;
}

.tech-node.size-xs {
    width: 40px;
    height: 40px;
}

.cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

.cert-badge-wrapper {
    width: 100%;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    padding: 20px;
    box-sizing: border-box;
}

.cert-badge-wrapper.icon-badge-wrapper {
    font-size: 5em;
}

.cert-badge-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.05));
    transition: transform 0.3s ease;
}

.cert-card:hover .cert-badge-img {
    transform: scale(1.05);
}

.cert-badge-wrapper.icon-badge-wrapper .cert-icon {
    color: var(--color-primary);
    transition: color 0.3s ease;
}

.cert-card:hover .cert-badge-wrapper.icon-badge-wrapper .cert-icon {
    color: var(--color-primary-hover);
}

.cert-content {
    flex: 1;
    padding: 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 20px;
}

.cert-title {
    font-size: 1.2em;
    font-weight: 700;
    margin: 0 0 8px 0;
    line-height: 1.3;
    color: var(--color-text);
}

.cert-issuer {
    font-size: 0.95em;
    color: var(--color-tagline);
    margin: 0 0 16px 0;
    font-weight: 500;
}

.cert-meta {
    font-size: 0.9em;
    color: var(--color-tagline);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.cert-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cert-meta i {
    opacity: 0.7;
    color: var(--color-primary);
}

.cert-verify-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    gap: 8px;
    padding: 10px 24px;
    background-color: transparent;
    border: 2px solid var(--color-primary);
    border-radius: 50px;
    color: var(--color-primary);
    font-weight: 600;
    font-size: 0.9em;
    text-decoration: none;
    transition: all 0.2s ease;
    margin-top: auto;
}

.cert-verify-btn:hover {
    background-color: var(--color-primary);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--color-highlight-glow);
    text-decoration: none;
}

body.dark-mode .cert-verify-btn:hover {
    color: var(--color-bg-dark);
}

.cert-verify-btn i {
    transition: transform 0.2s ease;
}

.cert-verify-btn:hover i {
    transform: translate(2px, -2px);
}

@media (max-width: 600px) {
    .cert-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .cert-badge-wrapper {
        height: 160px;
        padding: 15px;
    }

    .cert-badge-wrapper.icon-badge-wrapper {
        font-size: 4em;
    }

    .cert-content {
        padding: 20px;
    }

    .cert-verify-btn {
        width: 100%;
        box-sizing: border-box;
    }
}

.cert-tile {
    display: block;
    background-color: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: 20px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
}

.cert-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px var(--color-hover-shadow);
    text-decoration: none;
}

.cert-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.cert-icon {
    font-size: 1.5em;
    color: var(--color-primary);
    margin-top: 4px;
}

.cert-info h3 {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--color-primary);
    margin: 0 0 4px 0;
}

.cert-info p {
    font-size: 0.95em;
    color: var(--color-tagline);
    margin: 0;
}

.info-list li {
    background-color: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 16px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.info-list li:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px var(--color-hover-shadow);
}

.info-list .item-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
}

.info-list .item-title {
    font-size: 1.15em;
    font-weight: 600;
}

.info-list .item-meta {
    font-size: 0.95em;
    color: var(--color-tagline);
    font-style: italic;
    display: block;
    margin-top: 2px;
}

.info-list .authors {
    font-size: 0.95em;
    font-style: italic;
    color: var(--color-tagline);
    margin-top: 4px;
    margin-bottom: 0;
}

.info-list .item-description {
    font-size: 0.95em;
    color: var(--color-text);
    margin-top: 28px;
    margin-bottom: 12px;
}

.info-list .publication-link {
    font-weight: 600;
    font-size: 0.95em;
    margin-top: 8px;
    margin-right: 16px;
    display: inline-block;
}

.info-list .publication-link i {
    margin-right: 5px;
}

footer {
    text-align: center;
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid var(--color-border);
    font-size: 0.9em;
    color: var(--color-tagline);
}

#back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--color-primary);
    color: white;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    text-decoration: none;
    font-size: 1.2em;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

#back-to-top.show {
    opacity: 1;
    visibility: visible;
}

#back-to-top:hover {
    background-color: var(--color-primary-hover);
    text-decoration: none;
}

.publication-image, .project-image {
    image-rendering: -webkit-optimize-contrast;
    cursor: zoom-in;
}

.image-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgb(0,0,0);
    background-color: rgba(0,0,0,0.9);
    backdrop-filter: blur(5px);
}

.modal-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 1200px;
    max-height: 85vh;
    object-fit: contain;
    animation-name: zoom;
    animation-duration: 0.3s;
}

#caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    height: 150px;
    font-size: 1.1em;
}

@keyframes zoom {
    from {transform:scale(0.9); opacity: 0}
    to {transform:scale(1); opacity: 1}
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    z-index: 2001;
    cursor: pointer;
}

.close-modal:hover,
.close-modal:focus {
    color: var(--color-primary);
    text-decoration: none;
    cursor: pointer;
}

@media (max-width: 700px) {
    body {
        padding: 15px;
    }

    #theme-toggle {
        top: 10px;
        right: 10px;
    }

    .header {
        padding: 20px 0;
        margin-bottom: 20px;
    }

    .main-nav {
        padding: 10px 15px; 
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        border-radius: 35px;
    }

    .main-nav ul {
        gap: 8px 14px;
    }

    .main-nav a {
        font-size: 0.95em;
    }

    .header h1 {
        font-size: 2.2em;
    }

    .tagline {
        font-size: 1.0em;
    }

    h2 {
        font-size: 1.5em;
    }

    .github-stats-container {
        margin-bottom: 50px;
    }

    .project-header .github-link {
        font-size: 1.2em;
    }

    .info-list .item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .experience-list {
        padding-left: 20px;
    }
    .experience-list > li::before {
        left: -16px;
    }
    .experience-list .item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    #tech-stack-interactive-container {
        height: 500px;
    }

    .tech-node.size-xl {
        width: 100px;
        height: 100px;
    }

    .tech-node.size-l {
        width: 70px;
        height: 70px;
    }

    .tech-node.size-m {
        width: 50px;
        height: 50px;
    }

    .tech-node.size-s {
        width: 40px;
        height: 40px;
    }

    .tech-node.size-xs {
        width: 25px;
        height: 25px;
    }

    .cert-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .modal-content {
        width: 95%;
    }
}

@media (max-width: 600px) {

}

.publication-description strong,
.project-description strong {
    background: linear-gradient(
        90deg, 
        var(--color-primary) 0%,
        #8b5cf6 50%,
        var(--color-primary) 100%
    );
    background-size: 200% auto;
    
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;

    animation: gradient-flow 4s linear infinite;
    display: inline;
}

@keyframes gradient-flow {
    0% {
        background-position: 100% center;
        filter: drop-shadow(0 0 2px rgba(3, 102, 214, 0.4));
    }
    50% {
        filter: drop-shadow(0 0 4px rgba(139, 92, 246, 0.6));
    }
    100% {
        background-position: -100% center;
        filter: drop-shadow(0 0 2px rgba(3, 102, 214, 0.4));
    }
}

.ambient-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1500px;
    overflow: hidden;
    z-index: -2;
    pointer-events: none;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%);
}

.mesh-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.45;
    mix-blend-mode: multiply;
    animation: mesh-float ease-in-out infinite;
    translate: 0 calc(var(--scroll-pos, 0px) * var(--parallax-speed, 0.5));
    will-change: translate, transform;
}

.orb-1 {
    width: 60vw;
    height: 60vw;
    max-width: 500px;
    max-height: 500px;
    background: var(--color-primary);
    top: -10%;
    left: 20%;
    animation-duration: 28s;
    opacity: 0.35;
    --parallax-speed: 0.35;
}

.orb-2 {
    width: 60vw;
    height: 60vw;
    max-width: 500px;
    max-height: 500px;
    background: #8b5cf6;
    top: -15%;
    right: 15%;
    animation-duration: 35s;
    animation-delay: -5s;
    opacity: 0.3;
    --parallax-speed: 0.15;
}

.orb-3 {
    width: 50vw;
    height: 50vw;
    max-width: 600px;
    max-height: 600px;
    background: var(--color-primary);
    top: 15%;
    left: 50%;
    transform: translateX(-50%);
    animation-duration: 32s;
    animation-delay: -10s;
    opacity: 0.25;
    --parallax-speed: 0.25;
}

@keyframes mesh-float {
    0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
    33% { transform: translate(80px, -50px) scale(1.2) rotate(10deg); }
    66% { transform: translate(-60px, 60px) scale(0.85) rotate(-5deg); }
}

body.dark-mode .mesh-orb {
    mix-blend-mode: screen;
    opacity: 0.3;
    filter: blur(140px);
}

body.dark-mode .orb-1 { opacity: 0.2; }
body.dark-mode .orb-2 { opacity: 0.15; }
body.dark-mode .orb-3 { opacity: 0.15; }

@media (max-width: 700px) {
    .mesh-orb {
        filter: blur(60px);
        opacity: 0.17;
    }

    body.dark-mode .mesh-orb {
        opacity: 0.3;
        filter: blur(80px);
    }

    .orb-1 {
        top: -5%;
        width: 80vw;
        height: 80vw;
    }
    .orb-2 {
        top: -10%;
        width: 80vw;
        height: 80vw;
    }
    .orb-3 {
        top: 30%;
        width: 70vw;
        height: 70vw;
    }
}

.reveal-on-scroll {
    opacity: 0;
    transform: translateY(50px) scale(0.96);
    filter: blur(10px);
    transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 1.2s cubic-bezier(0.16, 1, 0.3, 1),
                filter 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
}

.project-card.is-visible,
.publication-card.is-visible,
.cert-card.is-visible {
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), 
                box-shadow 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), 
                border-color 0.2s ease !important;
}

.project-card,
.publication-card,
.cert-card {
    position: relative;
    display: block;
    background-color: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: 24px;
    margin-bottom: 16px;
}

.cert-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0;
    overflow: hidden;
    margin-bottom: 0;
}

.github-stat-img {
    position: relative;
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    border: 1px solid transparent;
}

.project-card,
.publication-card,
.cert-card,
.github-stat-img {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.3s ease !important;
}

@media (hover: hover) {
    .project-card:hover,
    .publication-card:hover,
    .cert-card:hover,
    .github-stats-container > a:hover .github-stat-img {
        transition: transform 0.15s cubic-bezier(0.17, 0.67, 0.14, 1),
                    box-shadow 0.15s cubic-bezier(0.17, 0.67, 0.14, 1),
                    border-color 0.15s ease-out !important;
        transform: translateY(-6px) scale(1.02);
        box-shadow: 0 20px 40px -5px rgba(0,0,0,0.15);
        border-color: var(--color-primary) !important;
    }
}

.service-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.service-category {
    background-color: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: 24px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

/* Hover effects (matches Project Cards) */
@media (hover: hover) {
    .service-category:hover {
        transform: translateY(-4px);
        box-shadow: 0 8px 20px var(--color-hover-shadow);
        border-color: var(--color-primary);
    }
}

.service-category h3 {
    margin-top: 0;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--color-border);
    font-size: 1.1em;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--color-text);
}

.service-category h3 i {
    color: var(--color-primary);
    font-size: 0.9em;
}

.service-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.service-list li {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px dashed var(--color-border);
    font-size: 0.95em;
    color: var(--color-text);
    line-height: 1.4;
    gap: 15px;
}

.service-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.service-year {
    font-size: 0.8em;
    font-weight: 600;
    background-color: var(--color-bg);
    border: 1px solid var(--color-border);
    color: var(--color-tagline);
    padding: 2px 10px;
    border-radius: 12px;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: 0;
    transition: color 0.2s, border-color 0.2s;
    margin-top: 2px;
}

.service-category:hover .service-year {
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.main-nav a.active {
    color: var(--color-primary);
    position: relative;
}

.main-nav a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--color-primary);
    border-radius: 2px;
}

@media (max-width: 800px) {
    .main-nav {
        position: relative; 
        top: auto;
        
        margin-bottom: 40px; 
    }

    .main-nav a.active {
        color: var(--color-text);
        font-weight: 600;
        opacity: 1;
    }

    .main-nav a.active::after {
        display: none;
        content: none;
    }

    .experience-list {
        padding-left: 25px;
    }

    .experience-list > li::before {
        left: -21px;
    }
    
    .experience-list::before {
        left: 10px;
    }
}

@media (max-width: 900px) and (min-width: 801px) {
    #theme-toggle {
        top: auto;
        right: auto;
        
        bottom: 20px;
        left: 20px;
        
        background-color: var(--color-card-bg);
        border: 1px solid var(--color-border);
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        
        z-index: 2000;
    }
}

section {
    scroll-margin-top: 20px; 
}

@media (min-width: 801px) {
    section {
        scroll-margin-top: 100px;
    }
}

.exp-card-final {
    display: flex;
    flex-direction: column;
    margin-top: -5px;
}

.exp-header-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 20px;
    margin-bottom: 6px;
}

.exp-role {
    font-size: 1.15em;
    font-weight: 700;
    color: var(--color-text);
    margin: 0;
    line-height: 1.1;
}

.exp-date {
    font-size: 0.95em;
    font-weight: 600;
    color: var(--color-tagline);
    white-space: nowrap;
    text-align: right;
    flex-shrink: 0;
}

.exp-subtitle {
    font-size: 0.95em;
    color: var(--color-text);
    margin: 0 0 25px 2px;
    line-height: 1.5;
    opacity: 0.9;
}

.exp-company-wrapper {
    display: flex;
}

.company-badge {
    display: inline-block;
    background-color: rgba(3, 102, 214, 0.08);
    color: var(--color-primary);
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 0.90em;
    font-weight: 500;
    line-height: 1;
}

body.dark-mode .company-badge {
    background-color: rgba(56, 139, 253, 0.15);
    color: #58a6ff;
}

@media (max-width: 600px) {
    .exp-header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .exp-date {
        order: -1;
        margin-bottom: 2px;
        font-size: 0.9em;
    }
}