/* Quiet hierarchy, system typography, and immediate interaction feedback. */
:root {
    color-scheme: light;
    font: 100%/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-optical-sizing: auto;
    --ink: #1d1d1f;
    --muted: #626268;
    --accent: #0066cc;
    --canvas: #f5f5f7;
    --surface: #fff;
    --line: #e5e5e9;
    --maxw: 1120px;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 6rem; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--canvas); color: var(--ink); }
a { color: var(--accent); text-decoration: none; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { font: inherit; }
button, a, [tabindex] { outline-offset: 5px; }
:focus-visible { outline: 3px solid var(--accent); }
::selection { background: #cde5ff; color: #1d1d1f; }
img { max-width: 100%; }
.print-only { display: none; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; overflow-wrap: anywhere; }

/* A small translucent navigation layer leaves the resume in focus. */
.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgb(245 245 247 / 90%);
    -webkit-backdrop-filter: saturate(160%) blur(20px);
    backdrop-filter: saturate(160%) blur(20px);
    box-shadow: 0 4px 18px rgb(0 0 0 / 3%);
}
.topbar__inner {
    max-width: var(--maxw);
    min-height: 4.5rem;
    padding: .65rem 2.5rem;
    margin: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}
.brand { color: var(--ink); font-size: .95rem; font-weight: 650; letter-spacing: -.02em; }
.brand span { color: var(--muted); font-size: .8rem; font-weight: 450; letter-spacing: 0; }
.section-nav { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.section-nav a { display: inline-flex; align-items: center; min-height: 2.75rem; color: #444449; font-size: .85rem; }
.lang { display: inline-flex; padding: .2rem; background: #e9e9ed; border-radius: .7rem; }
.lang__item {
    display: grid;
    place-items: center;
    min-width: 2.75rem;
    min-height: 2.5rem;
    border-radius: .5rem;
    font-size: .75rem;
    font-weight: 600;
    color: var(--muted);
}
.lang__item.is-active { color: var(--ink); background: var(--surface); box-shadow: 0 1px 4px rgb(0 0 0 / 9%); }

.page { max-width: var(--maxw); margin: 1.75rem auto 0; padding: 0 2.5rem; }
.cv { min-width: 0; }
.intro {
    padding: 2.75rem 3rem;
    background: var(--surface);
    border-radius: 1.5rem;
    box-shadow: 0 0 0 1px rgb(0 0 0 / 3%), 0 6px 24px rgb(0 0 0 / 2%);
}
.intro__identity { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2rem; }
.intro__identity > div { min-width: 0; flex: 1 1 16rem; }
.eyebrow { color: var(--muted); font-size: .75rem; font-weight: 550; letter-spacing: .09em; text-transform: uppercase; margin-bottom: .8rem; }
h1 { font-size: clamp(2rem, 4.2vw, 3.25rem); font-weight: 650; letter-spacing: -.045em; line-height: 1.12; overflow-wrap: anywhere; }
.intro__role { margin-top: .8rem; font-size: clamp(1.1rem, 2vw, 1.4rem); font-weight: 500; line-height: 1.35; letter-spacing: -.02em; overflow-wrap: anywhere; }
.cv__avatar { width: 6.75rem; height: 6.75rem; flex: none; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1px rgb(0 0 0 / 6%); }
.intro__specialty { max-width: 46rem; margin-top: 1.6rem; color: var(--muted); font-size: .88rem; line-height: 1.65; }
.intro__summary { max-width: 47rem; margin-top: 1rem; font-size: 1rem; color: #424247; }
.intro__summary.prose p { margin: 0; }
.intro__location { display: flex; align-items: baseline; gap: .45rem; margin-top: 1.2rem; font-size: .85rem; color: var(--muted); }
.intro__location span { color: var(--ink); }
.intro__actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-top: 1.6rem; }
.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: .8rem;
    min-height: 2.85rem;
    padding: .65rem 1.1rem;
    border: 0;
    border-radius: .75rem;
    background: #f0f0f3;
    color: var(--ink);
    font-size: .875rem;
    font-weight: 550;
    cursor: pointer;
    transition: background-color 150ms ease, transform 150ms ease;
}
.btn--primary { background: var(--accent); color: #fff; }
.text-link { font-size: .8rem; padding: .7rem .3rem; }
.source-link { margin-left: auto; color: var(--muted); }
.btn:active, .lang__item:active { transform: scale(.97); transition-duration: 60ms; }

/* Experience is the first content block. Supporting information sits beside it. */
.resume-grid { display: grid; grid-template-columns: minmax(0, 1fr) 16rem; gap: 3.5rem; padding: 3rem .5rem; }
.resume-main, .resume-aside { min-width: 0; }
.resume-section { margin-bottom: 3rem; scroll-margin-top: 1rem; }
h2 { font-size: 1.4rem; font-weight: 650; line-height: 1.25; letter-spacing: -.025em; margin-bottom: 1.4rem; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.section-heading__note { font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.job { position: relative; padding: 0 0 1.7rem 1.4rem; margin-left: .2rem; border-left: 1px solid #d5d5db; }
.job:last-child { padding-bottom: 0; border-left-color: transparent; }
.job::before { content: ''; position: absolute; left: -.25rem; top: .45rem; width: .45rem; height: .45rem; border-radius: 50%; background: #b0b0b8; box-shadow: 0 0 0 4px var(--canvas); }
.job:first-of-type::before { background: var(--accent); }
h3 { font-size: 1rem; font-weight: 550; line-height: 1.4; letter-spacing: -.015em; }
.job__company { display: block; font-size: 1.13rem; font-weight: 650; }
.job__role { display: block; margin-top: .2rem; font-size: .92rem; color: #45454b; font-weight: 500; }
.job__dates { margin-top: .45rem; font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.prose { font-size: .94rem; line-height: 1.7; overflow-wrap: anywhere; }
.prose p { margin: .8rem 0; }
.prose strong { font-weight: 600; color: var(--ink); }
.prose em { color: var(--muted); }
.prose ul { padding-left: 1.1rem; margin: .85rem 0 0; }
.prose li { padding-left: .2rem; margin-bottom: .45rem; }
.prose li::marker { color: #898991; font-size: .75em; }
.prose code { font: inherit; font-size: .9em; padding: .1rem .3rem; border-radius: .3rem; background: #e9e9ee; white-space: normal; }
.prose a { text-decoration: underline; text-underline-offset: .18em; text-decoration-color: #a0c9ee; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
.resume-aside .resume-section { padding-bottom: 1.8rem; margin-bottom: 1.8rem; border-bottom: 1px solid #dcdce2; }
.resume-aside .resume-section:last-child { border-bottom: 0; }
.resume-aside h2 { font-size: .9rem; letter-spacing: -.01em; margin-bottom: 1rem; }
.resume-aside .prose { font-size: .83rem; line-height: 1.65; }
#skills .prose p { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; font-size: 0; }
#skills code { padding: .3rem .6rem; font-size: .75rem; line-height: 1.4; background: #e9e9ee; color: #44444c; border-radius: .45rem; }
.contact address { display: flex; flex-direction: column; align-items: flex-start; gap: .6rem; font-size: .85rem; font-style: normal; overflow-wrap: anywhere; }
.contact address > a:not(.contact__email) { color: var(--muted); font-size: .8rem; }
.contact__email { font-weight: 550; }
.contact__socials { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: .35rem; }
.footer { display: flex; justify-content: space-between; gap: 1rem; max-width: var(--maxw); padding: 0 3rem 2rem; margin: auto; color: var(--muted); font-size: .75rem; }
.footer a { color: inherit; }
.skip-link { position: fixed; left: 1rem; top: -20rem; max-width: calc(100% - 2rem); z-index: 20; background: var(--surface); padding: .75rem 1rem; border-radius: .5rem; }
.skip-link:focus { top: 1rem; }

@media (hover: hover) and (pointer: fine) {
    .btn:hover { background: #e4e4e9; }
    .btn--primary:hover { background: #005ab5; }
    .section-nav a:hover, .footer a:hover, .text-link:hover { color: var(--accent); }
    .lang__item:not(.is-active):hover { color: var(--ink); background: #dedee4; }
    .contact a:hover { text-decoration: underline; text-underline-offset: .2em; }
}
@media (max-width: 900px) {
    .resume-grid { grid-template-columns: minmax(0, 1fr) 13rem; gap: 2rem; }
    .page, .topbar__inner { padding-left: 1.5rem; padding-right: 1.5rem; }
    .intro { padding: 2rem; }
    .brand span { display: none; }
}
@media (max-width: 700px) {
    html { scroll-padding-top: 5rem; }
    .topbar__inner { min-height: 4rem; gap: .6rem; padding: .4rem 1.25rem; }
    .section-nav { gap: 1rem; }
    .section-nav a { font-size: .75rem; }
    .section-nav a:last-child { display: none; }
    .brand { font-size: .85rem; }
    .lang__item { min-width: 2.5rem; min-height: 2.75rem; }
    .page { padding: 0 1rem; margin-top: 1rem; }
    .intro { padding: 1.5rem; border-radius: 1.25rem; }
    .intro__identity { align-items: flex-start; gap: .85rem; }
    .intro__identity > div { flex-basis: 10rem; }
    .cv__avatar { width: 4rem; height: 4rem; margin-top: 1.6rem; }
    h1 { font-size: clamp(1.75rem, 6vw, 2.5rem); letter-spacing: -.035em; }
    .eyebrow { font-size: .65rem; margin-bottom: .6rem; }
    .intro__role { font-size: 1.05rem; margin-top: .7rem; }
    .intro__specialty { font-size: .8rem; margin-top: 1.2rem; }
    .intro__summary { font-size: .9rem; }
    .intro__location { font-size: .78rem; }
    .intro__actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr)); gap: .6rem; margin-top: 1.4rem; }
    .btn { flex: 1 1 auto; padding: .65rem .85rem; font-size: .8rem; }
    .btn span[aria-hidden] { display: none; }
    .source-link { margin-left: 0; }
    .resume-grid { display: flex; flex-direction: column; gap: 0; padding: 2.25rem .5rem .5rem; }
    .resume-main { display: contents; }
    .experience { order: -2; }
    .resume-aside { order: -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; margin-bottom: 1.5rem; }
    .resume-aside .resume-section { margin: 0; border: 0; padding-bottom: .5rem; }
    h2 { font-size: 1.3rem; }
    .prose { font-size: .9rem; }
    .footer { padding: 0 1.5rem 1.5rem; flex-wrap: wrap; }
}
@media (max-width: 420px) {
    .resume-aside { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
    .resume-aside .resume-section { padding-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
    .source-link { flex-basis: 100%; padding-bottom: 0; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
    .btn:active, .lang__item:active { transform: none; }
}
@media (prefers-reduced-transparency: reduce) {
    .topbar { background: var(--canvas); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
    :root { --muted: #353539; --line: #777; }
    .topbar { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; border-bottom: 1px solid var(--ink); }
    .btn, .lang, .intro, #skills code { outline: 1px solid #777; }
}

/* All content stays expanded and selectable in the printed document. */
@page { size: A4; margin: 15mm 14mm; }
@media print {
    .no-print, .skip-link { display: none !important; }
    html, body { background: #fff; color: #000; }
    body { font-size: 10pt; line-height: 1.4; }
    .page { margin: 0; padding: 0; max-width: none; }
    .intro { padding: 0 0 12pt; border-radius: 0; box-shadow: none; break-inside: avoid; }
    .eyebrow { display: none; }
    h1 { font-size: 25pt; }
    .intro__role { font-size: 12pt; margin-top: 5pt; }
    .cv__avatar { width: 60pt; height: 60pt; margin: 0; }
    .intro__specialty { margin-top: 8pt; font-size: 9pt; }
    .intro__summary { margin-top: 6pt; font-size: 10pt; }
    .intro__location { margin-top: 8pt; font-size: 9pt; }
    .print-only { display: block; }
    .print-contact { margin-top: 8pt; font-size: 8.5pt; overflow-wrap: anywhere; }
    .resume-grid, .resume-main, .resume-aside { display: contents; }
    .resume-section, .resume-aside .resume-section { margin: 14pt 0 0; padding: 0; border: 0; }
    h2, .resume-aside h2 { font-size: 13pt; margin-bottom: 8pt; }
    h2, h3, .section-heading, .job__heading { break-after: avoid; }
    .section-heading__note { display: none; }
    .job { margin: 0; padding: 0 0 10pt; border: 0; }
    .job::before { display: none; }
    .job__company { font-size: 11pt; }
    .job__role, .job__dates { font-size: 9pt; }
    .prose, .resume-aside .prose { font-size: 10pt; line-height: 1.45; }
    .prose p { margin: 5pt 0; }
    .prose li { margin-bottom: 3pt; }
    .prose p, .prose li, .contact { break-inside: avoid; }
    a, .prose a, .contact address > a:not(.contact__email) { color: #000; }
    #skills code, .prose code { background: transparent; border: 1px solid #ccc; font-size: 9pt; }
    .contact address { flex-direction: row; flex-wrap: wrap; gap: 5pt 12pt; }
    .contact__socials { margin: 0; }
}
