html {
    --bg: #e3f1fa;
    --ink: #172b4d;
    --muted: #40566d;
    --accent: #3457d5;
    --line: #b6cfdf;
    --paper: #f5fbfe;
    --band: #d8eaf5;
    color-scheme: light;
}
body {
    background: var(--bg) !important;
    color: var(--ink);
    margin: 0;
}
header {
    position: sticky !important;
    top: 0 !important;
    background: #292929 !important;
    z-index: 20 !important;
    border: 0 !important;
}
header nav {
    max-width: 1280px;
    margin: auto;
    display: flex;
    align-items: center;
    gap: 26px;
    padding: 5px 24px;
    min-height: 86px;
    flex-wrap: wrap;
}
header nav .brand {
    margin-right: auto;
}
header nav img {
    width: 70px;
    height: 70px;
    object-fit: contain;
}
header nav a:not(.brand) {
    color: #fff !important;
    position: relative;
    padding: 18px 0;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none !important;
    border: 0 !important;
}
header nav a:after {
    display: none !important;
}
header nav a[aria-current="page"]:after {
    display: block !important;
    content: "";
    position: absolute;
    bottom: 5px;
    left: 0;
    right: 0;
    height: 3px;
    background: #c9e9f6 !important;
}
footer {
    background: #292929 !important;
    color: #fff !important;
    text-align: center;
    padding: 48px 24px 30px !important;
}
footer a {
    color: #fff !important;
}
footer h2 {
    color: #fff !important;
}
footer .social {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 26px;
    margin: 20px auto;
}
footer .social a {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
}
footer .social svg {
    width: 26px;
    height: 26px;
}
footer p {
    color: #ddd !important;
}
html[data-theme="dark"] {
    --bg: #172b4d;
    --ink: #f5fbfe;
    --muted: #c7d5e8;
    --accent: #a8baff;
    --line: #405575;
    --paper: #203858;
    --band: #203858;
    color-scheme: dark;
}
header .theme {
    color: white !important;
    border: 1px solid #888;
    background: transparent;
    padding: 6px 10px;
    border-radius: 5px;
    cursor: pointer;
}
@media (max-width: 760px) {
    header nav {
        gap: 12px;
        padding: 6px 16px;
    }
    header nav img {
        width: 48px;
        height: 48px;
    }
    header nav a:not(.brand) {
        font-size: 12px;
        padding: 8px 0;
    }
    header nav a[aria-current="page"]:after {
        bottom: 0;
    }
}

/* =========================================
   Navigation Bar Corrections
   ========================================= */

   header {
    background: #292929 !important;
    border: none !important;
    border-bottom: none !important;
    box-shadow: none !important;
    outline: none !important;
}

header::before,
header::after {
    display: none !important;
}

header nav {
    min-height: 96px;
    border: none !important;
    box-shadow: none !important;
}

header nav .brand {
    display: flex;
    align-items: center;
    background: transparent;
}

header nav .brand img {
    width: 86px;
    height: 86px;
    object-fit: contain;
    background: transparent;
}

/* Only underline the active navigation item */

header nav a:not(.brand) {
    border-bottom: none !important;
}

header nav a[aria-current="page"]::after {
    display: block !important;
    background: #c9e9f6 !important;
    height: 3px;
}

/* =========================================
   Footer Social Media Icons
   ========================================= */

footer .social a {
    color: #ffffff !important;
    background: transparent;
    transition: color 0.2s ease,
                transform 0.2s ease;
}

footer .social svg {
    width: 26px;
    height: 26px;
    fill: currentColor !important;
}

footer .social svg path {
    fill: currentColor !important;
}

footer .social a:hover {
    color: #c9e9f6 !important;
    transform: translateY(-3px);
}

/* =========================================
   Responsive Navigation
   ========================================= */

@media (max-width: 760px) {
    header nav {
        min-height: 70px;
    }

    header nav .brand img {
        width: 64px;
        height: 64px;
    }
}

/* Footer email styling */

footer a[href^="mailto:"] {
    color: #ffffff !important;
    text-decoration: none !important;
    transition: color 0.2s ease;
}

footer a[href^="mailto:"]:hover {
    color: #c9e9f6 !important;
    text-decoration: none !important;
}
/* Final approved refinements */
html:not([data-theme="dark"]) { --bg: #e3f1fa; --band: #e3f1fa; --paper: #f5fbfe; --ink: #172b4d; --accent: #3457d5; --line: #b6cfdf; }
body { border: 0 !important; }
main a, footer a { text-decoration: none !important; }
main a:hover, footer a[href^="mailto:"]:hover { text-decoration: underline !important; }
main a.btn:hover, main a.social-inline:hover { text-decoration: none !important; }
footer .social a svg, .social-inline svg, .contact-info .links svg { fill: currentColor !important; width: 26px; height: 26px; }
footer .social svg path { fill: currentColor !important; }
header nav { border: 0 !important; }
.home-hero { padding-bottom: 28px; }
.home-photo { position: relative; isolation: isolate; max-width: 420px; margin: 20px auto; }
.home-photo::before { content: ""; position: absolute; inset: 0; background: #a9d4f5; border-radius: 24px; transform: rotate(-5deg); z-index: -1; }
.home-photo .portrait { display: block; width: 100%; max-height: 480px; object-fit: cover; border-radius: 20px; }
.headline-accent { text-decoration: underline; text-decoration-color: #70aaf1; text-decoration-thickness: 4px; text-underline-offset: 8px; }
.featured-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.featured-heading h2 span, .digital-banner h2 span { color: #77aaff; }
.featured-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; }
.featured-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; min-width: 0; background: var(--paper); }
.featured-card figure { margin: 0; overflow: hidden; }
.featured-card img { width: 100%; height: 170px; object-fit: contain; border-radius: 6px; }
.featured-card h3 { font-size: 20px; margin: 12px 0 4px; }
.featured-card p { font-size: 14px; }
.home-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.home-tags span { font-size: 12px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 4px; }
.digital-banner { margin-top: 40px; padding: 30px; border-radius: 16px; background: #172b4d; color: white; display: grid; grid-template-columns: 1fr 2fr; gap: 24px; align-items: center; }
.digital-banner h2 { color: white; margin: 8px 0; }
.digital-banner .eyebrow { color: #c9e9f6; }
.banner-avatar { text-align: center; }
.banner-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.banner-actions .outline { border: 1px solid white; background: transparent; }
.course-group { margin: 16px 0; }
.course-group ul { margin: 6px 0; padding-left: 20px; }
.skill-row { display: grid; grid-template-columns: 220px minmax(0,1fr); gap: 28px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.skill-row h3 { font-size: 20px; margin: 0; }
.skill-items { display: flex; flex-wrap: wrap; gap: 22px 26px; align-items: center; }
.skill-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font-size: 13px; text-align: center; max-width: 150px; }
.skill-item img { width: 34px; height: 34px; object-fit: contain; }
.social-inline { display: inline-flex; align-items: center; }
#contact form { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 26px; }
#contact form h2 { margin: 0 0 8px; }
@media(max-width: 760px) { .featured-grid, .digital-banner, .skill-row { grid-template-columns: 1fr; } .skill-row { gap: 12px; } .home-photo { max-width: 85%; } }

/* Targeted layout corrections */
header nav .brand::after { display: none !important; }
header, header nav { border: 0 !important; box-shadow: none !important; }
.home-hero { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 48px; }
.home-hero h1 { font-size: clamp(32px, 3.5vw, 48px); line-height: 1.15; letter-spacing: -0.025em; text-decoration: none; }
.home-hero .headline-accent { text-decoration: none; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 24px; margin-top: 22px; }
.home-photo { width: 100%; max-width: 380px; }
.featured-grid { gap: 20px; }
.featured-card { display: flex; flex-direction: column; padding: 16px; }
.featured-card figure { height: 190px; width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 0; background: var(--paper); }
.featured-card figure img { display: block; width: 100%; height: 100%; object-fit: contain; }
.featured-card h3 { margin: 18px 0 6px; font: 600 20px/1.3 system-ui,sans-serif; }
.featured-card p { margin: 0 0 10px; line-height: 1.55; }
.featured-card > a { margin-top: auto; padding-top: 8px; font-size: 14px; }
.featured-card .home-tags { margin-top: auto; }
.compact-preview { display: flex; flex-direction: column; color: #172b4d; background: #f5fbfe !important; }
.mini-label { font-size: 11px; padding: 10px 12px; border-bottom: 1px solid #b6cfdf; }
.mini-body { padding: 16px 12px; font-size: 14px; }
.mini-metrics { display: flex; justify-content: space-around; gap: 8px; margin-top: 16px; }
.mini-metrics div { display: flex; flex-direction: column; align-items: center; }
.mini-metrics b { font-size: 26px; color: #3457d5; }
.mini-metrics small { font-size: 10px; color: inherit; }
.outsmart-preview { background: #172b4d !important; color: white; }
.outsmart-preview .mini-metrics b { color: #c9e9f6; }
.course-group { margin: 18px 0; }
.course-group strong { display: block; font-size: 14px; margin-bottom: 8px; }
.course-group .course-tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.course-tags li { padding: 5px 10px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); font-size: 13px; line-height: 1.45; }
@media (max-width: 760px) { .home-hero { grid-template-columns: 1fr; gap: 24px; } .home-hero h1 br { display: none; } .home-photo { max-width: 85%; } }

/* Home portrait — original image proportions */

.home-hero .home-photo {
    width: 100%;
    max-width: 350px;
    margin-inline: auto;
}

.home-hero .home-photo .portrait {
    display: block;
    width: 100%;
    height: auto;
    max-height: none;
    aspect-ratio: 7 / 8;
    object-fit: contain;
    border-radius: 16px;
    filter: none;
    transform: none;
    image-rendering: auto;
}

/* =========================================
   Dark Mode Fix — Projects and AI Lab
   ========================================= */

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

html[data-theme="dark"] body {
    background: var(--bg) !important;
    color: var(--ink) !important;
}

/* Main content background */

html[data-theme="dark"] main#projects {
    background: var(--bg) !important;
    color: var(--ink) !important;
}

/* Headings and descriptions */

html[data-theme="dark"] #projects h1,
html[data-theme="dark"] #projects h2,
html[data-theme="dark"] #projects h3 {
    color: var(--ink);
}

html[data-theme="dark"] #projects .lead,
html[data-theme="dark"] #projects .project-body p,
html[data-theme="dark"] #projects .lab-row p,
html[data-theme="dark"] #projects .lab-feature p {
    color: var(--muted);
}

/* Project filters and search */

html[data-theme="dark"] .controls button {
    color: var(--ink);
    border-color: var(--line);
    background: transparent;
}

html[data-theme="dark"] .controls button[aria-pressed="true"] {
    background: #3457d5;
    color: #ffffff;
    border-color: #3457d5;
}

html[data-theme="dark"] .controls input {
    background: var(--paper);
    color: var(--ink);
    border-color: var(--line);
}

html[data-theme="dark"] .controls input::placeholder {
    color: var(--muted);
}

/* Technology tags */

html[data-theme="dark"] .chips span {
    background: var(--paper);
    color: var(--muted);
    border-color: var(--line);
}

/* Project screenshots and visual frames */

html[data-theme="dark"] .project-shot,
html[data-theme="dark"] .product-preview {
    background: var(--paper);
    border-color: var(--line);
}

html[data-theme="dark"] .visual-kind,
html[data-theme="dark"] .product-preview figcaption {
    color: var(--muted);
}

/* Preserve readability inside light previews */

html[data-theme="dark"] .window,
html[data-theme="dark"] .evidence {
    color: #172b4d;
}

html[data-theme="dark"] .window h2,
html[data-theme="dark"] .window h3,
html[data-theme="dark"] .evidence h2,
html[data-theme="dark"] .evidence h3 {
    color: #172b4d !important;
}

/* AI Lab panels */

html[data-theme="dark"] .lab-visual,
html[data-theme="dark"] .arena {
    background: var(--paper);
    color: var(--ink);
    border-color: var(--line);
}

html[data-theme="dark"] .visual-top span,
html[data-theme="dark"] .arena-bottom {
    color: var(--muted);
}

html[data-theme="dark"] .arena .players > div {
    background: var(--bg);
    color: var(--ink);
    border-color: var(--line);
}

html[data-theme="dark"] .lab-row {
    border-color: var(--line);
}

/* Connect Four */

html[data-theme="dark"] .board-panel {
    background: transparent;
    border: none;
    color: var(--ink);
}

html[data-theme="dark"] .board-controls .small-btn {
    background: var(--paper);
    color: var(--ink);
    border-color: var(--line);
}

/* Technical Tutor */

html[data-theme="dark"] .tutor-question,
html[data-theme="dark"] .tutor-answer {
    background: transparent;
    color: var(--ink);
    border-color: var(--line);
}

/* =========================================
   Consistent Navigation Logo
   ========================================= */

   header nav .brand {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: visible;
}

header nav .brand img {
    display: block;
    width: 86px;
    height: 86px;
    object-fit: contain;
    border-radius: 0 !important;
    background: transparent;
    clip-path: none !important;
}

@media (max-width: 720px) {
    header nav .brand img {
        width: 64px;
        height: 64px;
    }
}

/* Refine header logo size */
header img[src*="logo"] {
    width: 85px;
    height: auto;
    object-fit: contain;
}

/* Responsive logo */
@media (max-width: 768px) {
    header img[src*="logo"] {
        width: 65px;
    }
}


/* =========================================
   Mobile Hamburger Navigation
   ========================================= */

   header nav .mobile-menu-toggle {
    display: none;
}

@media (max-width: 900px) {
    header nav.mobile-ready {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 12px;
        min-height: 72px;
        padding: 8px 18px;
    }

    header nav.mobile-ready .brand {
        margin-right: auto;
        order: 0;
    }

    header nav.mobile-ready .brand img {
        width: 58px;
        height: auto;
        object-fit: contain;
    }

    header nav.mobile-ready .theme {
        order: 1;
        margin: 0;
        font-size: 13px;
        min-height: 44px;
    }

    header nav.mobile-ready .mobile-menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        order: 2;
        width: 44px;
        height: 44px;
        padding: 10px;
        color: #ffffff;
        background: transparent;
        border: 0;
        cursor: pointer;
    }

    header nav.mobile-ready .mobile-menu-toggle svg {
        width: 26px;
        height: 26px;
    }

    header nav.mobile-ready > a:not(.brand) {
        display: none;
        order: 3;
        flex: 0 0 100%;
        font-size: 15px;
        padding: 12px 14px;
    }

    header nav.mobile-ready.menu-open > a:not(.brand) {
        display: block;
    }

    header nav.mobile-ready.menu-open {
        max-height: 100dvh;
        overflow-y: auto;
        padding-bottom: 18px;
    }

    header nav.mobile-ready
    a[aria-current="page"] {
        background: #3b3b3b;
        border-radius: 5px;
        color: #c9e9f6 !important;
    }

    header nav.mobile-ready
    a[aria-current="page"]::after {
        display: none !important;
    }

    header nav.mobile-ready
    .mobile-menu-toggle:focus-visible {
        outline: 2px solid #c9e9f6;
        outline-offset: 2px;
    }
}
