:root {
    color-scheme: dark;
    --control-size: 44px;
    --page: #0B1624;
    --bar: #0F1F32;
    --surface: #14263B;
    --ink: #EEF5FC;
    --muted: #AEBFD2;
    --accent: #4DA3FF;
    --header-accent: var(--link);
    --header-muted: var(--muted);
    --link: #7CBFFF;
    --rule: #213D56;
    --bar-height: 3.75rem;
    --gutter: clamp(1rem, 4.5vw, 4rem);
    --serif: 'Iowan Old Style', Georgia, serif;
    scroll-padding-top: calc(var(--bar-height) + .75rem);
    --control-ink: var(--ink);
    --control-bg: var(--surface);
    --control-border: #547590;
    --control-hover: #213D56;
    --control-focus: var(--link);
    --hover: #1D344B;
    --active-ink: #D6EAFE;
    --detail: #40C9B0;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; padding-block-start: var(--bar-height); background: var(--page); color: var(--ink); font: 1rem/1.58 Inter, 'Segoe UI', system-ui, sans-serif; }
.wrap { width: min(65rem, calc(100% - 2 * var(--gutter))); margin-inline: auto; }
a { color: var(--link); text-underline-offset: .23em; }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--control-focus); outline-offset: 3px; }
h1, h2, h3, p, dl, dd, ul, ol { margin: 0; }
h1, h2 { font-family: var(--serif); font-weight: 500; line-height: 1.12; letter-spacing: -.045em; }
h1 { font-size: clamp(2.6rem, 6vw, 5.6rem); margin: .12em 0; }
h1 em { color: var(--accent); font-weight: 400; }
h2 { font-size: clamp(2rem, 3.6vw, 3rem); margin-bottom: 1.3rem; }
h3 { font-size: 1.15rem; line-height: 1.35; }
.skip { position: fixed; top: .4rem; left: .5rem; z-index: 300; padding: .6rem 1rem; background: var(--surface); transform: translateY(-180%); }
.skip:focus { transform: none; }

.cv-nav { position: fixed; inset: 0 0 auto; height: var(--bar-height); z-index: 200; background: var(--bar); border-bottom: 1px solid var(--rule); }
.cv-nav .wrap { height: 100%; display: flex; align-items: center; }
.section-links { justify-self: center; display: flex; align-items: center; gap: .15rem; }
.section-links a { text-align: center; text-decoration: none; font-size: .89rem; color: var(--muted); padding: .48rem .65rem; border-radius: .32rem; }
.section-links a:hover { background: var(--hover); color: var(--ink); }
.section-links a[aria-current="location"] { background: var(--control-hover); color: var(--active-ink); }
.section-links a[aria-current="location"] { text-decoration: underline; text-decoration-thickness: 2px; }

.cv-profile { display: grid; grid-template-columns: minmax(0, 1fr) minmax(140px, 20%); align-items: center; gap: clamp(2rem, 6vw, 5rem); padding-block: clamp(2rem, 4vw, 3.5rem); }
.eyebrow, .dates { font-size: .8rem; font-weight: 650; color: var(--accent); }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; }
.role { font-size: clamp(1.12rem, 1.8vw, 1.45rem); }
.summary { max-width: 66ch; margin-block: .7rem; color: var(--muted); }
.cv-photo { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; object-position: 50% 40%; border: 1px solid var(--control-border); border-radius: 50%; }
.text-link, .button { display: inline-flex; align-items: center; gap: .75rem; min-height: 44px; font-size: .92rem; font-weight: 650; }
.button { background: var(--control-hover); border: 1px solid var(--control-border); border-radius: .45rem; padding: .6rem .95rem; text-decoration: none; }
.button:hover { background: var(--hover); }
.cv-section { border-top: 1px solid var(--rule); padding-block: clamp(1.9rem, 3.6vw, 3.25rem); }
.timeline, .badges, .contact ul { padding: 0; list-style: none; }
.timeline { margin-left: .33rem; }
.timeline > li { position: relative; display: grid; grid-template-columns: minmax(150px, 24%) minmax(0,1fr); gap: 1rem; border-left: 1px solid var(--rule); padding: 0 0 1.8rem 1.4rem; }
.timeline > li:last-child { padding-bottom: 0; }
.timeline > li::before { content: ''; position: absolute; top: .45rem; left: -5px; width: 9px; height: 9px; background: var(--accent); border-radius: 50%; }
.dates { letter-spacing: .015em; }
.company { color: var(--accent); font-weight: 550; }
.timeline ul, .project ul { padding-left: 1.2rem; margin-block: .5rem 0; color: var(--muted); }
.timeline ul li, .project li { margin-top: .22rem; }
.badge-group + .badge-group { margin-top: 1.55rem; }
.badge-group h3 { color: var(--muted); font-size: .95rem; }
.badges, .projects { display: grid; gap: .75rem; }
.badges { grid-template-columns: repeat(auto-fill, minmax(min(100%, 10.6rem), 1fr)); margin-top: .65rem; }
.badges a, .project { background: var(--surface); border: 1px solid var(--rule); border-radius: .55rem; padding: 1rem; }
.badges a { display: flex; flex-direction: column; height: 100%; color: var(--ink); text-decoration: none; }
.badges img { object-fit: contain; margin-bottom: .65rem; }
.badges a > span { line-height: 1.4; font-weight: 600; }
.badges small { margin-top: auto; padding-top: .7rem; color: var(--link); }
.badges a:hover { border-color: var(--detail); }
.badges a:hover small { text-decoration: underline; }
.skills { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem 2rem; }
.skills > div { border-top: 1px solid var(--rule); padding-block: .85rem; }
.skills dt { font-weight: 650; }
.skills dd { margin-top: .3rem; color: var(--muted); }
.projects { grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.project { display: flex; flex-direction: column; border-top: 2px solid var(--detail); }
.project h3 { font: 500 1.45rem/1.2 var(--serif); }
.project ul { margin-bottom: 1.2rem; font-size: .94rem; }
.project a { margin-top: auto; font-weight: 600; }
.contact { display: flex; align-items: flex-start; justify-content: space-between; gap: 2rem; }
/* Leave space for the final section to be reached by its fragment, even on tall screens. */
#contact { min-height: calc(100vh - var(--bar-height) - 5rem); min-height: calc(100svh - var(--bar-height) - 5rem); }
.contact h2 { margin-bottom: .55rem; }
.contact p { margin-bottom: 1rem; color: var(--muted); }
.contact ul { min-width: min(40%, 18rem); }
.contact li { border-bottom: 1px solid var(--rule); }
.contact li a { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: .55rem 0; text-decoration: none; }
.contact li a:hover { text-decoration: underline; }
footer.wrap { display: flex; justify-content: space-between; align-items: center; gap: .6rem 1rem; flex-wrap: wrap; border-top: 1px solid var(--rule); min-height: 4.25rem; color: var(--muted); font-size: .88rem; }
footer a { padding-block: .5rem; }

@media (max-width: 56rem) {
    :root { --bar-height: 5.25rem; }
    .cv-nav .experience-bar {
        grid-template-areas: "brand . actions" "tools tools tools";
        grid-template-rows: 44px auto;
    }
    .section-links { width: 100%; justify-content: space-between; }
    .section-links a { padding-inline: .4rem; }
}
@media (max-width: 38rem) {
    :root { --gutter: 1rem; }
    .section-links a { padding: .35rem .2rem; font-size: .78rem; }
    .cv-profile { grid-template-columns: minmax(0, 1fr) clamp(4.5rem, 19vw, 6.5rem); gap: 0 .75rem; }
    .cv-profile > div { display: contents; }
    .cv-profile .eyebrow { grid-area: 1 / 1; align-self: end; }
    .cv-profile h1 { grid-area: 2 / 1; }
    .cv-profile :is(.role, .summary, .text-link) { grid-column: 1 / -1; }
    .cv-profile .text-link { justify-self: start; }
    .cv-photo { grid-area: 1 / 2 / span 2; }
    .timeline > li { grid-template-columns: 1fr; gap: .25rem; }
    .skills { grid-template-columns: 1fr; }
    .contact { display: block; }
    .contact ul { margin-top: 1.25rem; }
    .badges { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
    .badges a { padding: .75rem; font-size: .9rem; overflow-wrap: anywhere; }
    .badges img { width: 56px; height: 56px; }
}
@media (max-width: 25rem) {
    :root { --bar-height: 6rem; }
    .section-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 .2rem; }
    .section-links a { padding-block: .19rem; }
}
@media print {
    :root { color-scheme: light; --page: white; --ink: #16161a; --muted: #34343a; --accent: #40404b; --rule: #bbb; --link: #252539; --surface: white; }
    body { padding: 0; }
    .button { color: var(--ink); background: white; }
    .cv-nav, .skip, .cv-profile .text-link, footer.wrap { display: none; }
    .wrap { width: 100%; }
    .cv-profile, .cv-section { padding-block: 1rem; }
    #contact { min-height: auto; }
    .project, .timeline > li, .badges li { break-inside: avoid; }
}
