:root {
    --navy: #153556;
    --blue: #1d8fe4;
    --blue-dark: #156cb2;
    --blue-soft: #eef7ff;
    --blue-soft-2: #f8fbff;
    --cyan: #53b7f0;
    --text: #19324d;
    --muted: #5f738c;
    --line: #dbe6f2;
    --white: #ffffff;
    --bg: #fbfdff;
    --shadow: 0 18px 50px rgba(21, 66, 109, .08);
    --max: 1140px;
    --radius: 16px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--text);
    background: var(--white);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.65;
}

a {
    color: inherit;
}

img {
    max-width: 100%;
}

.container {
    width: min(calc(100% - 40px), var(--max));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(247, 252, 255, .92);
    border-bottom: 1px solid rgba(219, 230, 242, .95);
    backdrop-filter: blur(12px);
}

.nav {
    min-height: 70px;
    display: flex;
    align-items: center;
    gap: 30px;
}

.brand {
    color: var(--navy);
    font-weight: 800;
    letter-spacing: .08em;
    text-decoration: none;
    white-space: nowrap;
}

.brand span {
    color: var(--blue);
}

.nav nav {
    display: flex;
    gap: 20px;
    margin-left: auto;
}

.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    height: 2px;
    margin: 5px 0;
    background: var(--navy);
    border-radius: 2px;
    transition: transform .15s ease, opacity .15s ease;
}

.menu-toggle[aria-expanded="true"] span:first-child {
    transform: translateY(7px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.menu-toggle[aria-expanded="true"] span:last-child {
    transform: translateY(-7px) rotate(-45deg);
}

.nav nav a,
.language a {
    color: var(--muted);
    font-size: .88rem;
    font-weight: 600;
    text-decoration: none;
}

.nav nav a:hover,
.language a:hover,
.language a.active {
    color: var(--blue);
}

.language {
    display: flex;
    gap: 7px;
    font-size: .82rem;
    font-weight: 700;
}

.hero {
    position: relative;
    min-height: calc(100svh - 70px);
    display: flex;
    align-items: center;
    overflow: hidden;
    background-color: #dceffc;
    background-image: url('../images/hero-workspace.png');
    background-position: center center;
    background-size: cover;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 50% 45%, rgba(248, 253, 255, .92) 0%, rgba(239, 249, 255, .82) 28%, rgba(220, 241, 255, .50) 54%, rgba(229, 245, 255, .12) 100%),
        linear-gradient(180deg, rgba(240, 250, 255, .10), rgba(226, 244, 255, .24));
}

.hero-fade {
    position: absolute;
    inset: auto 0 0;
    height: 160px;
    background: linear-gradient(180deg, rgba(251, 253, 255, 0), rgba(251, 253, 255, .95));
}

.hero-content {
    position: relative;
    z-index: 1;
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 110px 0 130px;
}

.hero-copy {
    max-width: 880px;
    text-align: center;
}

.hero-copy .eyebrow {
    color: var(--blue-dark);
    text-wrap: balance;
    letter-spacing: .16em;
}

.eyebrow,
.section-label,
.selector-label,
.cv-language-note {
    color: var(--blue);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .12em;
}

h1,
h2,
h3 {
    color: var(--navy);
    line-height: 1.08;
}

h1 {
    margin: 18px 0 20px;
    font-size: clamp(3rem, 7vw, 6rem);
    letter-spacing: -.06em;
}

h2 {
    margin: 12px 0 30px;
    font-size: clamp(2rem, 4vw, 3.2rem);
    letter-spacing: -.04em;
}

h3 {
    margin: 0 0 12px;
    font-size: 1.2rem;
}

.hero-subtitle {
    max-width: 720px;
    margin: 0 auto;
    color: var(--navy);
    font-size: clamp(1rem, 1.55vw, 1.28rem);
    font-weight: 500;
}

.hero-social {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
    margin-top: 28px;
}

.hero-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(29, 143, 228, .38);
    border-radius: 999px;
    color: var(--navy);
    background: rgba(255, 255, 255, .65);
    backdrop-filter: blur(6px);
    transition: transform .15s ease, border-color .15s ease, background .15s ease;
}

.hero-social a:hover {
    transform: translateY(-2px);
    border-color: var(--blue);
    background: rgba(255, 255, 255, .9);
}

.hero-social svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 32px;
}

.button {
    display: inline-block;
    padding: 13px 20px;
    border: 1px solid var(--blue);
    border-radius: 10px;
    font-weight: 750;
    text-decoration: none;
    transition: transform .15s ease, background .15s ease, border-color .15s ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button.primary {
    color: var(--white);
    background: var(--blue);
}

.button.primary:hover {
    background: var(--blue-dark);
}

.button.secondary {
    color: var(--blue-dark);
    background: rgba(255, 255, 255, .85);
}

.scroll-hint {
    position: absolute;
    left: 50%;
    bottom: 30px;
    z-index: 2;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transform: translateX(-50%);
    color: var(--navy);
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-decoration: none;
    text-transform: uppercase;
}

.scroll-hint strong {
    font-size: 1.5rem;
    line-height: 1;
}

.section {
    padding: 100px 0;
}

.section-tint {
    background: var(--blue-soft-2);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.two-col,
.cv-layout {
    display: grid;
    grid-template-columns: .8fr 1.2fr;
    gap: 80px;
}

.prose {
    max-width: 760px;
    color: var(--muted);
    font-size: 1.06rem;
}

.skill-grid,
.project-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.skill-card,
.project-card {
    padding: 30px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: var(--shadow);
}

.skill-index {
    margin-bottom: 22px;
    color: var(--blue);
    font-family: ui-monospace, monospace;
    font-weight: 800;
}

.skill-card p,
.project-card p,
.timeline-item p {
    color: var(--muted);
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 20px;
}

.tags span {
    padding: 4px 8px;
    border-radius: 999px;
    color: var(--blue-dark);
    background: var(--blue-soft);
    font-family: ui-monospace, monospace;
    font-size: .72rem;
}

.timeline {
    border-top: 1px solid var(--line);
}

.experience-group {
    margin-top: 48px;
}

.group-heading {
    margin-bottom: 24px;
    padding-left: 18px;
    border-left: 3px solid var(--blue);
}

.group-heading h3 {
    margin-bottom: 5px;
    font-size: 1.4rem;
}

.group-heading p {
    margin: 0;
    color: var(--muted);
}

.timeline-item {
    display: grid;
    grid-template-columns: 235px 1fr;
    gap: 36px;
    padding: 30px 0;
    border-bottom: 1px solid var(--line);
}

.timeline-description h4 {
    margin: 0 0 10px;
    color: var(--navy);
    font-size: 1.3rem;
    line-height: 1.22;
}

.timeline-description > p {
    max-width: 740px;
}

.experience-details {
    max-width: 760px;
    margin: 12px 0 18px;
    padding-left: 19px;
    color: var(--muted);
}

.experience-details li {
    padding-left: 2px;
    margin: 6px 0;
}

.experience-details li::marker {
    color: var(--blue);
}

.timeline-description .tags {
    margin-top: 14px;
}

.date {
    color: var(--blue);
    font-family: ui-monospace, monospace;
    font-size: .8rem;
    font-weight: 800;
}

.company {
    margin-top: -5px;
    color: var(--blue) !important;
    font-weight: 700;
}

.project-top {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
    color: var(--blue);
    font-family: ui-monospace, monospace;
    font-size: .72rem;
    font-weight: 800;
}

.project-link {
    display: inline-flex;
    gap: 6px;
    margin-top: 22px;
    color: var(--blue-dark);
    text-decoration: none;
    font-weight: 750;
}

.project-link:hover {
    text-decoration: underline;
}

.cv-section {
    background: linear-gradient(180deg, #edf8ff, #dbf1ff);
}

.cv-selector {
    padding: 30px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .84);
    box-shadow: var(--shadow);
}

.selector-label {
    margin-bottom: 12px;
    text-transform: uppercase;
}

.role-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 24px;
}

.role-grid a {
    padding: 11px;
    border: 1px solid rgba(29, 143, 228, .22);
    border-radius: 10px;
    color: var(--muted);
    background: var(--white);
    text-align: center;
    text-decoration: none;
    font-weight: 600;
}

.role-grid a.active {
    border-color: var(--blue);
    color: var(--blue-dark);
    background: rgba(29, 143, 228, .08);
}

.download {
    width: 100%;
    text-align: center;
}

.small {
    margin-bottom: 0;
    margin-top: 12px;
    color: var(--muted) !important;
    font-size: .82rem;
}

.cv-language-note {
    margin-top: 20px;
}

.cv-language-note strong {
    color: var(--navy);
}

.contact {
    background: var(--blue-soft);
}

.contact h2 {
    max-width: 720px;
}

.contact > .container > p:not(.section-label) {
    max-width: 700px;
    color: var(--muted);
}

.contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    margin-top: 26px;
}

.contact-links a {
    color: var(--blue-dark);
    font-weight: 750;
}

footer {
    color: #7b95ad;
    background: #eff6fc;
    border-top: 1px solid var(--line);
    font-size: .8rem;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 24px 0;
}

@media (max-width: 1024px) {
    .nav {
        gap: 16px;
    }

    .nav nav {
        gap: 12px;
    }

    .nav nav a {
        font-size: .82rem;
    }
}

@media (max-width: 900px) {
    .site-header {
        position: sticky;
    }

    .menu-toggle {
        display: block;
        margin-left: auto;
        order: 1;
    }

    .language {
        order: 2;
    }

    .nav nav {
        display: none;
        position: absolute;
        top: calc(100% + 1px);
        left: 0;
        right: 0;
        margin: 0;
        padding: 16px max(20px, calc((100vw - var(--max))/2));
        border-bottom: 1px solid var(--line);
        background: rgba(249, 253, 255, .98);
        box-shadow: 0 16px 25px rgba(16, 45, 75, .08);
        flex-direction: column;
        gap: 0;
    }

    .nav nav.is-open {
        display: flex;
    }

    .nav nav a {
        font-size: 1rem;
        padding: 12px 0;
    }

    .two-col,
    .cv-layout,
    .skill-grid,
    .project-grid {
        grid-template-columns: 1fr;
        gap: 26px;
    }

    .hero {
        min-height: calc(100svh - 70px);
        background-position: 55% center;
    }

    .hero-content {
        padding: 90px 0 125px;
    }

    .hero-copy {
        max-width: 100%;
    }

    .timeline-item {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

@media (max-width: 640px) {
    .container {
        width: min(calc(100% - 28px), var(--max));
    }

    .section {
        padding: 70px 0;
    }

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

    .footer-inner {
        flex-direction: column;
    }

    .hero-overlay {
        background: linear-gradient(180deg, rgba(246, 252, 255, .91) 0%, rgba(235, 247, 255, .78) 55%, rgba(239, 250, 255, .73) 100%);
    }

    .hero h1 {
        font-size: clamp(2.6rem, 12vw, 4rem);
    }

    .hero-copy .eyebrow {
        font-size: .67rem;
        letter-spacing: .11em;
    }

    .hero-content {
        padding-top: 80px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *, *::before, *::after {
        transition-duration: 0s !important;
    }
}

/* v7: a compact visual skills summary inspired by tech-tool icon portfolios. */
.technology-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
    margin: 26px 0 54px;
}

.technology-item {
    min-height: 112px;
    padding: 20px 8px 13px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, .95);
    box-shadow: 0 7px 24px rgba(21, 66, 109, .04);
    transition: transform .18s ease, box-shadow .18s ease;
}

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

.technology-logo {
    display: block;
    width: 44px;
    height: 44px;
    max-width: 44px;
    max-height: 44px;
    object-fit: contain;
    flex: 0 0 auto;
}

.technology-item span {
    text-align: center;
    font-size: .79rem;
    font-weight: 700;
    color: var(--text);
}

.skills-detail-title {
    margin-bottom: 20px;
    font-size: clamp(1.35rem, 2vw, 1.7rem);
}

.skill-accordion {
    display: grid;
    gap: 10px;
}

.skill-detail {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 13px;
    overflow: hidden;
}

.skill-detail summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 17px;
    padding: 19px 24px;
    cursor: pointer;
}

.skill-detail summary::-webkit-details-marker {
    display: none;
}

.skill-detail summary:focus-visible,
.cv-selector a:focus-visible {
    outline: 3px solid var(--cyan);
    outline-offset: 3px;
}

.skill-detail summary .skill-index {
    margin: 0;
    width: 32px;
    flex-shrink: 0;
    font-size: .8rem;
}

.skill-detail summary strong {
    color: var(--navy);
    font-size: 1.03rem;
}

.summary-prompt {
    color: var(--blue-dark);
    font-size: .8rem;
    margin-left: auto;
}

.chevron {
    font-size: 1.55rem;
    color: var(--blue);
    transition: transform .15s ease;
}

.skill-detail[open] .chevron {
    transform: rotate(180deg);
}

.skill-detail-content {
    padding: 4px 24px 25px 72px;
    color: var(--muted);
    border-top: 1px solid var(--line);
}

.skill-detail-content p {
    max-width: 800px;
    margin: 16px 0 12px;
}

@media (max-width: 1000px) {
    .technology-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
    .technology-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
    .technology-item { min-height: 93px; padding: 15px 5px 8px; }
    .technology-logo { width: 34px; height: 34px; }
    .technology-item span { font-size: .73rem; }
    .skill-detail summary { padding: 15px; gap: 12px; }
    .skill-detail-content { padding: 6px 15px 20px; }
    .summary-prompt { display: none; }
    .region-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    .technology-item, .chevron { transition: none; }
}


/* v8: CV profiles are direct links to the original PDF/working output. */
.cv-direct-links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 64px;
    border-color: rgba(29, 143, 228, .28);
}
.cv-direct-links a:hover,
.cv-direct-links a:focus-visible {
    border-color: var(--blue);
    color: var(--blue-dark);
    background: #e8f5ff;
}
.cv-open-icon { font-size: 1.3rem; color: var(--blue); }

/* Locally hosted, original-color technology artwork. No icon font or external CSS. */
.hero-social svg { width: 22px; height: 22px; max-width: 22px; max-height: 22px; }
.technology-logo { display: block; width: 44px; height: 44px; max-width: 44px; max-height: 44px; object-fit: contain; }
.technology-fallback[hidden], .technology-logo[hidden] { display: none !important; }
.technology-fallback:not([hidden]) {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 4px;
    border-radius: 9px;
    background: #e9f4ff;
    color: #166aa5;
    font: 800 .87rem ui-monospace, monospace;
}
@media (max-width: 600px) {
    .technology-logo { width: 34px; height: 34px; }
    .technology-fallback:not([hidden]) { min-width: 34px; height: 34px; }
}

/* ---------------------------------------------------------
   v9 — dark experience timeline / media-first project cards
   --------------------------------------------------------- */
.experience-section {
    position: relative;
    overflow: hidden;
    background: #142d46;
    color: #d5e5f2;
}

.experience-section::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 100% 0%, rgba(72, 159, 220, .14), transparent 38%),
        linear-gradient(rgba(109, 166, 218, .025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(109, 166, 218, .025) 1px, transparent 1px);
    background-size: auto, 40px 40px, 40px 40px;
}

.experience-section > .container { position: relative; }
.experience-section .section-label,
.experience-section .date { color: #87d2ff; }
.experience-section h2,
.experience-section h3,
.experience-section h4 { color: #ffffff; }
.experience-section h2 { margin-bottom: 42px; }
.experience-section .group-heading { border-left-color: #4aaff0; }
.experience-section .group-heading p { color: #acc4d7; }
.experience-section .experience-group { margin-top: 46px; }
.experience-section .timeline {
    position: relative;
    border: 0;
    padding-left: 14px;
}
.experience-section .timeline::before {
    content: "";
    position: absolute;
    left: 9px;
    top: 32px;
    bottom: 28px;
    width: 2px;
    background: linear-gradient(#55b7f5, rgba(85, 183, 245, .2));
}
.experience-section .timeline-item {
    position: relative;
    grid-template-columns: 182px minmax(0, 1fr);
    gap: 26px;
    margin: 0 0 18px 19px;
    padding: 24px 28px;
    border: 1px solid rgba(169, 210, 240, .14);
    border-radius: 14px;
    background: rgba(255, 255, 255, .035);
    transition: border-color .2s, background .2s;
}
.experience-section .timeline-item:hover {
    border-color: rgba(135, 210, 255, .43);
    background: rgba(255, 255, 255, .058);
}
.experience-section .timeline-item::before {
    content: "";
    position: absolute;
    top: 30px;
    left: -31px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    border: 3px solid #142d46;
    background: #63bdff;
    box-shadow: 0 0 0 2px rgba(99, 189, 255, .3);
}
.experience-section .timeline-description h4 { color: #ffffff; }
.experience-section .timeline-description p,
.experience-section .experience-details,
.experience-section .timeline-item p { color: #bbcede; }
.experience-section .company { color: #86d1ff !important; }
.experience-section .tags span {
    color: #c8eaff;
    background: rgba(94, 171, 233, .13);
    border: 1px solid rgba(137, 212, 250, .14);
}
.experience-section .experience-details li::marker { color: #65c5fd; }
.experience-more { margin: 10px 0 14px; }
.experience-more summary {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #8ed3ff;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}
.experience-more summary::-webkit-details-marker { display:none; }
.experience-more summary:focus-visible { outline: 2px solid #9cddff; outline-offset: 5px; border-radius: 3px; }
.experience-more summary span { display: inline-block; font-size: 1.25rem; transition: transform .2s; }
.experience-more[open] summary span { transform: rotate(45deg); }
.experience-section .experience-details { margin-top: 14px; }

/* Light projects gallery with media, optional external links and detail dialog. */
.project-section {
    background: linear-gradient(180deg, #f9fcff 0%, #edf6fd 100%);
}
.project-section .project-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 21px;
    align-items: stretch;
}
.project-section .project-card {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    border-radius: 15px;
    box-shadow: 0 14px 38px rgba(24, 67, 102, .075);
    transition: transform .2s ease, box-shadow .2s ease;
}
.project-section .project-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 44px rgba(24, 67, 102, .13);
}
.project-cover {
    display: block;
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #1c476a;
}
.project-cover img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .32s; }
.project-cover:hover img { transform: scale(1.045); }
.project-image-note {
    position: absolute;
    left: 12px;
    bottom: 11px;
    padding: 4px 9px;
    border-radius: 30px;
    color: #e2f1fa;
    background: rgba(11, 36, 59, .78);
    backdrop-filter: blur(5px);
    font-size: .68rem;
    letter-spacing: .035em;
}
.project-zoom {
    position: absolute;
    right: 13px;
    top: 13px;
    display: grid;
    place-items: center;
    height: 34px;
    width: 34px;
    border-radius: 50%;
    color: #183d60;
    background: rgba(255, 255, 255, .94);
    font-size: 1.1rem;
    font-weight: 700;
}
.project-cover-fallback { display: grid; place-items: center; height: 100%; color: #bee5ff; font-size: 4rem; }
.project-card-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1;
    gap: 0;
    padding: 23px 24px 25px;
}
.project-card-body .project-top { margin-bottom: 14px; }
.project-card-body .project-top span { letter-spacing: .075em; }
.project-card-body h3 { margin-bottom: 9px; font-size: 1.3rem; }
.project-card-body > p { margin-top: 0; font-size: .95rem; line-height: 1.6; }
.project-card-body .tags { margin-top: auto; padding-top: 12px; }
.project-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px 18px;
    margin-top: 23px;
}
.project-actions a { margin: 0; font-size: .87rem; line-height: 1.3; }
.project-actions .project-link { color: #096fb9; }
.project-external { color: #546d85; text-decoration: none; font-weight: 700; }
.project-external:hover { text-decoration: underline; }
.project-cover:focus-visible,
.project-actions a:focus-visible { outline: 3px solid #158cdf; outline-offset: 2px; }

/* Dialog renders on top of the page; a separate project.php is the no-JS fallback. */
.project-dialog {
    width: min(1050px, calc(100% - 34px));
    max-width: 1050px;
    max-height: min(88dvh, 940px);
    padding: 0;
    border: 1px solid #d1e2f1;
    border-radius: 18px;
    background: #ffffff;
    color: var(--text);
    box-shadow: 0 34px 130px rgba(4, 20, 34, .35);
    overflow: auto;
}
.project-dialog::backdrop { background: rgba(10, 28, 46, .73); backdrop-filter: blur(4px); }
.project-dialog[open] { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); }
.project-dialog-close {
    position: absolute;
    z-index: 3;
    right: 15px;
    top: 14px;
    width: 39px;
    height: 39px;
    border: 1px solid #d8e5ef;
    border-radius: 50%;
    background: #ffffff;
    color: var(--navy);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}
.project-dialog-media { min-width: 0; background: #153a57; display:flex; flex-direction:column; }
.project-dialog-slide { display:grid; place-items:center; min-height: 320px; flex: 1; padding: 10px; }
.project-dialog-slide img,
.project-dialog-slide video,
.project-dialog-slide iframe { display:block; width: 100%; height: auto; max-height: 65dvh; object-fit: contain; border-radius: 6px; }
.project-dialog-slide iframe { aspect-ratio:16/9; border:0; }
.project-dialog-media-controls { display:flex; align-items:center; justify-content:space-between; gap:12px; padding: 16px 20px; background: #103047; min-height: 76px; }
.project-dialog-caption { font-size: .76rem; line-height:1.45; color: #c7dfee; text-align: center; margin:0; }
.media-arrow {
    min-width: 36px;
    height: 36px;
    border:1px solid #6497bb;
    border-radius:50%;
    background: transparent;
    color:#e7f6fd;
    cursor:pointer;
}
.media-arrow[hidden] { display: none; }
.project-dialog-details { padding: 54px 34px 36px; overflow-y: auto; }
.project-dialog-details h2 { font-size: clamp(1.55rem, 2.5vw, 2.25rem); margin: 8px 0 15px; }
.project-dialog-details h3 { font-size:1.03rem; margin:25px 0 12px; }
.project-dialog-details > p:not(.section-label) { color: var(--muted); }
.project-dialog-details li { color: var(--muted); margin: 7px 0; }
.project-dialog-details ul { padding-left: 19px; }
.project-dialog-details .project-external { display: inline-flex; margin-top: 24px; color: var(--blue-dark); }
.project-dialog-details .project-external[hidden] { display:none; }

/* Standalone project detail page for navigation without JavaScript. */
.project-page { background: linear-gradient(180deg,#f5faff,#eaf5fe); min-height: calc(100vh - 70px); }
.project-page-inner { max-width: 1000px; }
.project-page .section-label { margin-bottom: 13px; }
.project-page h1 { font-size:clamp(2.5rem, 5vw, 4.5rem); }
.project-page-cover { border-radius: 18px; overflow: hidden; background: #153957; box-shadow: var(--shadow); }
.project-page-cover img { display:block; width:100%; height:auto; }
.project-page-gallery { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; margin-top:26px; }
.project-page-gallery figure { margin:0; border-radius:12px; overflow:hidden; background:white; border:1px solid var(--line); }
.project-page-gallery figure img { display:block; width:100%; height:auto; }
.project-page-gallery figure video { display:block; width:100%; background:#153957; }
.project-page-gallery iframe { display:block; width:100%; aspect-ratio:16/9; border:0; }
.project-page-gallery figcaption { padding: 12px 16px; color:var(--muted); font-size:.81rem; }
.project-page-body { max-width:800px; margin: 35px 0 20px; font-size:1.06rem; }
.project-page-body li { margin: 9px 0; }

@media (max-width: 1050px) {
    .project-section .project-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 900px) {
    .experience-section .timeline-item { grid-template-columns: 1fr; gap:8px; padding:20px; }
    .project-dialog[open] { display: block; }
    .project-dialog-details { padding: 28px 22px 26px; }
    .project-dialog-slide { min-height: 225px; }
    .project-dialog-slide img, .project-dialog-slide video, .project-dialog-slide iframe { max-height: 40dvh; }
}
@media (max-width: 640px) {
    .project-section .project-grid, .project-page-gallery { grid-template-columns:1fr; }
    .experience-section .timeline-item { padding: 19px; margin-left: 15px; }
    .experience-section .timeline-item::before { left:-26px; }
    .project-card-body { padding: 21px 19px 23px; }
    .project-dialog { width: calc(100% - 16px); max-height: 94dvh; }
    .project-dialog-details { padding: 28px 18px; }
}

.media-placeholder-text { color:#d9ebf7; padding:26px; text-align:center; max-width:320px; }

/* Centered hero name with breathing room between given and family names. */
.hero-name {
    display: flex;
    justify-content: center;
    align-items: baseline;
    flex-wrap: wrap;
    column-gap: clamp(0.7rem, 3.2vw, 2.4rem);
    row-gap: 0;
    letter-spacing: -0.045em;
}
.hero-name span { display: inline-block; white-space: nowrap; }

/* Social brand icons are bundled locally; no CDN or external icon font. */
.hero-social img {
    display: block;
    width: 24px;
    height: 24px;
    max-width: 24px;
    max-height: 24px;
    object-fit: contain;
}

@media (max-width: 520px) {
    .hero-name { column-gap: 0.6rem; letter-spacing: -0.055em; }
}
