body.light-theme {
    --font-primary: 'Geist', 'Manrope', sans-serif;
    --font-secondary: 'Geist', 'Source Sans 3', sans-serif;
    --font-mono: 'Geist Mono', 'Share Tech Mono', monospace;
    --bg-primary: #fbfcff;
    --bg-secondary: #ffffff;
    --dashboard-panel: rgba(255, 255, 255, 0.72);
    --dashboard-panel-strong: rgba(255, 255, 255, 0.86);
    --dashboard-border: rgba(137, 157, 187, 0.28);
    --dashboard-divider: rgba(117, 139, 171, 0.18);
    --dashboard-shadow: 0 18px 50px rgba(42, 64, 98, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.88);
    --aurora-ice: rgba(104, 169, 255, 0.18);
    --aurora-mint-soft: rgba(87, 205, 177, 0.12);
    --aurora-lavender: rgba(169, 137, 232, 0.14);
    background-color: var(--bg-primary);
    background-image:
        linear-gradient(118deg, rgba(209, 230, 255, 0.76) 0%, rgba(255, 255, 255, 0.92) 29%, rgba(239, 231, 255, 0.66) 54%, rgba(255, 255, 255, 0.9) 75%, rgba(218, 248, 239, 0.58) 100%),
        linear-gradient(238deg, var(--aurora-mint-soft) 0%, transparent 35%, var(--aurora-ice) 61%, transparent 82%),
        linear-gradient(158deg, transparent 14%, var(--aurora-lavender) 44%, rgba(255, 255, 255, 0.45) 62%, transparent 82%);
    background-attachment: fixed;
}

body.light-theme::before {
    display: block;
    content: '';
    position: fixed;
    inset: 0;
    width: auto;
    height: auto;
    background-image:
        linear-gradient(rgba(71, 85, 105, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(71, 85, 105, 0.035) 1px, transparent 1px);
    background-size: 48px 48px;
    opacity: 1;
    pointer-events: none;
    z-index: 0;
    transition: none;
    -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0.2) 58%, transparent 96%);
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0.2) 58%, transparent 96%);
}

body.light-theme > :is(section, footer) {
    position: relative;
    z-index: 1;
    background-color: transparent;
    background-image: none;
    border-block: 0;
}

body.light-theme :is(#home, #projects, #experience, #skills, #techstack, #certifications, #about, #education, #contact, .footer) {
    background-color: transparent;
    background-image: none;
}

body.light-theme .navbar,
body.light-theme .navbar.scrolled {
    background: rgba(255, 255, 255, 0.76);
    border-bottom-color: var(--dashboard-divider);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    box-shadow: 0 8px 30px rgba(39, 58, 88, 0.055), inset 0 1px 0 rgba(255, 255, 255, 0.94);
}

body.light-theme .hero-content {
    grid-template-columns: minmax(0, 1fr) 296px;
    grid-template-areas: 'context portrait' 'title portrait' 'summary portrait' 'actions portrait' 'focus focus' 'footnote footnote';
    column-gap: 64px;
}

body.light-theme .intro-visual {
    grid-area: portrait;
    display: block;
    align-self: end;
    min-width: 0;
}

body.light-theme .intro-portrait {
    grid-area: auto;
    max-width: none;
    padding: 14px 14px 0;
    border: 1px solid var(--dashboard-border);
    border-radius: 10px;
    background:
        linear-gradient(145deg, rgba(219, 235, 255, 0.58), rgba(232, 250, 245, 0.5)),
        var(--dashboard-panel);
    box-shadow: var(--dashboard-shadow);
    overflow: hidden;
}

body.light-theme .intro-portrait img {
    filter: drop-shadow(0 16px 18px rgba(25, 43, 72, 0.14));
}

body.light-theme .intro-context::before {
    content: '';
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-radius: 50%;
    background: #15a879;
    box-shadow: 0 0 0 5px rgba(21, 168, 121, 0.1);
}

body.light-theme .intro-focus {
    padding: 12px;
    border: 1px solid var(--dashboard-border);
    border-radius: 10px;
    background: var(--dashboard-panel);
    box-shadow: var(--dashboard-shadow);
    backdrop-filter: blur(20px) saturate(145%);
    -webkit-backdrop-filter: blur(20px) saturate(145%);
}

body.light-theme .intro-focus li {
    min-height: 56px;
    padding-inline: 10px;
}

body.light-theme .intro-focus li + li {
    padding-left: 24px;
    border-left-color: var(--dashboard-divider);
}

body.light-theme .intro-footnote {
    border-top-color: var(--dashboard-divider);
}

body.light-theme .section .section-header {
    display: grid;
    gap: 7px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--dashboard-divider);
}

body.light-theme .section .section-kicker {
    margin: 0;
    color: var(--accent-color);
    font: 600 12px/1.4 var(--font-mono);
    letter-spacing: 0;
}

body.light-theme .section .section-title,
body.light-theme #projects .section-title {
    font-size: 32px;
    line-height: 1.2;
    letter-spacing: 0;
}

body.light-theme .work-overview {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1.4fr) auto;
    align-items: center;
    gap: 22px;
    margin-bottom: 18px;
    padding: 16px 18px;
    border: 1px solid var(--dashboard-border);
    border-radius: 10px;
    background: var(--dashboard-panel);
    box-shadow: var(--dashboard-shadow);
    backdrop-filter: blur(20px) saturate(145%);
    -webkit-backdrop-filter: blur(20px) saturate(145%);
}

body.light-theme .work-overview-intro {
    min-width: 0;
}

body.light-theme .work-overview-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    color: var(--text-primary);
    font: 600 12px/1.4 var(--font-mono);
}

body.light-theme .work-overview-label i {
    color: var(--primary-color);
}

body.light-theme .work-overview-intro > p:last-child {
    max-width: 43ch;
    font-size: 13px;
    line-height: 1.45;
}

body.light-theme .work-overview-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0;
}

body.light-theme .work-overview-metrics > div {
    min-width: 0;
    padding-inline: 16px;
    border-left: 1px solid var(--dashboard-divider);
}

body.light-theme .work-overview-metrics dt {
    color: var(--text-primary);
    font: 600 19px/1.2 var(--font-mono);
}

body.light-theme .work-overview-metrics dd {
    margin: 4px 0 0;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.3;
}

body.light-theme .work-overview-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 11px;
    border: 1px solid var(--dashboard-border);
    border-radius: 7px;
    color: var(--text-primary);
    background: var(--dashboard-panel-strong);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

body.light-theme .work-overview-link:hover {
    border-color: var(--primary-soft-border);
    color: var(--primary-color);
}

body.light-theme .magnetic-control {
    will-change: transform;
}

body.light-theme :is(.work-filters, .credential-filters) {
    width: fit-content;
    padding: 4px;
    border: 1px solid var(--dashboard-border);
    border-radius: 8px;
    background: var(--dashboard-panel);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

body.light-theme :is(.work-filters, .toolkit-filters, .credential-filters) button {
    transition: color 160ms ease-out, background-color 160ms ease-out, border-color 160ms ease-out, box-shadow 160ms ease-out;
}

body.light-theme :is(.work-filters, .toolkit-filters, .credential-filters) button[aria-pressed='true'] {
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

body.light-theme :is(.project-card, .capability, .career-content, .toolkit-item, .recognition-entry, .credential-entry, .education-entry) {
    border-color: var(--dashboard-border);
    background-color: var(--dashboard-panel);
    box-shadow: var(--dashboard-shadow);
}

body.light-theme :is(.project-card, .capability, .career-content, .recognition-entry, .credential-entry, .education-entry) {
    backdrop-filter: blur(22px) saturate(145%);
    -webkit-backdrop-filter: blur(22px) saturate(145%);
}

body.light-theme .project-card {
    position: relative;
    overflow: hidden;
}

body.light-theme .project-card::after {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(94, 157, 255, 0.72), rgba(88, 196, 173, 0.55), transparent);
    pointer-events: none;
}

body.light-theme .project-preview {
    border-bottom-color: var(--dashboard-divider);
}

body.light-theme .project-preview img {
    transition: transform 420ms cubic-bezier(0.2, 0.75, 0.25, 1), filter 240ms ease-out;
}

body.light-theme .project-tags .tag,
body.light-theme :is(.capability-skills, .credential-skills) {
    font-family: var(--font-mono);
}

body.light-theme .toolkit-toolbar {
    padding: 14px;
    border: 1px solid var(--dashboard-border);
    border-radius: 10px;
    background: var(--dashboard-panel);
    box-shadow: var(--dashboard-shadow);
    backdrop-filter: blur(20px) saturate(145%);
    -webkit-backdrop-filter: blur(20px) saturate(145%);
}

body.light-theme :is(.toolkit-search, .toolkit-usage select, #contact .form-group input, #contact .form-group textarea) {
    border-color: var(--dashboard-border);
    background: var(--dashboard-panel-strong);
    box-shadow: inset 0 1px 2px rgba(39, 58, 88, 0.035);
}

body.light-theme #contact .contact-form {
    padding: 24px;
    border: 1px solid var(--dashboard-border);
    border-radius: 10px;
    background: var(--dashboard-panel);
    box-shadow: var(--dashboard-shadow);
    backdrop-filter: blur(22px) saturate(145%);
    -webkit-backdrop-filter: blur(22px) saturate(145%);
}

body.light-theme #contact .contact-info {
    padding: 4px 22px;
    border: 1px solid var(--dashboard-border);
    border-radius: 10px;
    background: var(--dashboard-panel);
    box-shadow: var(--dashboard-shadow);
    backdrop-filter: blur(22px) saturate(145%);
    -webkit-backdrop-filter: blur(22px) saturate(145%);
}

::view-transition-group(project-results),
::view-transition-group(toolkit-results),
::view-transition-group(credential-results) {
    animation-duration: 180ms;
    animation-timing-function: cubic-bezier(0.2, 0.75, 0.25, 1);
}

::view-transition-old(project-results),
::view-transition-old(toolkit-results),
::view-transition-old(credential-results) {
    animation: 90ms ease-out both dashboard-filter-out;
}

::view-transition-new(project-results),
::view-transition-new(toolkit-results),
::view-transition-new(credential-results) {
    animation: 180ms ease-out both dashboard-filter-in;
}

@keyframes dashboard-filter-out {
    to { opacity: 0; transform: translateY(-3px); }
}

@keyframes dashboard-filter-in {
    from { opacity: 0; transform: translateY(4px); }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    body.light-theme .hero .btn.magnetic-control:hover,
    body.light-theme .work-overview-link.magnetic-control:hover,
    body.light-theme .work-preview-button.magnetic-control:hover,
    body.light-theme #contactSubmit.magnetic-control:hover {
        transform: translate3d(var(--magnetic-x, 0), calc(var(--magnetic-y, 0px) - 2px), 0);
    }

    body.light-theme .project-card:hover .project-preview img {
        transform: scale(1.025);
        filter: saturate(1.05) contrast(1.02);
    }

    body.light-theme .work-overview-link:hover {
        box-shadow: 0 8px 20px rgba(37, 99, 235, 0.1);
    }
}

@media (prefers-reduced-motion: reduce) {
    body.light-theme .magnetic-control {
        transform: none !important;
        will-change: auto;
    }

    ::view-transition-group(project-results),
    ::view-transition-group(toolkit-results),
    ::view-transition-group(credential-results) {
        animation-duration: 0s;
    }
}

@media (max-width: 900px) {
    body.light-theme .work-overview {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    body.light-theme .work-overview-metrics > div:first-child {
        border-left: 0;
        padding-left: 0;
    }

    body.light-theme .work-overview-link {
        justify-self: start;
    }
}

@media (max-width: 860px) {
    body.light-theme .hero-content {
        grid-template-columns: minmax(0, 1fr) 190px;
        column-gap: 28px;
    }

    body.light-theme .intro-portrait {
        padding: 4px 4px 0;
    }
}

@media (max-width: 600px) {
    body.light-theme .hero-content {
        grid-template-columns: minmax(0, 1fr) 112px;
        grid-template-areas: 'context portrait' 'title title' 'summary summary' 'actions actions' 'focus focus' 'footnote footnote';
        column-gap: 18px;
    }

    body.light-theme .intro-visual {
        align-self: center;
        margin-bottom: 18px;
    }

    body.light-theme .intro-focus {
        padding: 12px;
    }

    body.light-theme .intro-focus li {
        min-height: 30px;
        padding-inline: 0;
    }

    body.light-theme .work-overview {
        padding: 14px;
    }

    body.light-theme .work-overview-intro > p:last-child {
        display: none;
    }

    body.light-theme .work-overview-metrics > div {
        padding-inline: 10px;
    }

    body.light-theme .work-overview-metrics dt {
        font-size: 16px;
    }

    body.light-theme .work-overview-metrics dd {
        font-size: 11px;
    }

    body.light-theme #contact .contact-form {
        padding: 18px;
    }

    body.light-theme #contact .contact-info {
        padding-inline: 18px;
    }
}

@media (max-width: 380px) {
    body.light-theme .hero-content {
        grid-template-columns: minmax(0, 1fr) 100px;
        column-gap: 12px;
    }

    body.light-theme .intro-focus {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0;
        margin-block: 12px;
        padding: 8px;
    }

    body.light-theme .intro-focus li {
        flex-direction: column;
        align-items: center;
        gap: 5px;
        min-height: 58px;
        padding-inline: 5px;
        text-align: center;
    }

    body.light-theme .intro-focus li + li {
        padding-left: 5px;
        border-left: 1px solid var(--dashboard-divider);
    }

    body.light-theme .intro-focus strong {
        font-size: 11px;
        line-height: 1.25;
    }
}

html[data-browser-palette='dark'] body.light-theme {
    --dashboard-panel: rgba(32, 37, 45, 0.78);
    --dashboard-panel-strong: rgba(32, 37, 45, 0.9);
    --dashboard-border: rgba(148, 180, 224, 0.27);
    --dashboard-divider: rgba(148, 180, 224, 0.2);
    --dashboard-shadow: 0 18px 50px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(210, 228, 255, 0.1);
    --aurora-ice: rgba(68, 112, 193, 0.12);
    --aurora-mint-soft: rgba(45, 137, 117, 0.08);
    --aurora-lavender: rgba(117, 86, 164, 0.07);
}

@media (forced-colors: active) {
    body.light-theme {
        background-image: none;
    }

    body.light-theme::before {
        display: none;
    }

}