:root {
    color-scheme: dark;
    --background: #0c0e12;
    --surface: #12151b;
    --text: #f2f4f8;
    --body-text: #bdc3cd;
    --muted: #a0a9b7;
    --line: #2b3039;
    --accent: #82a8ff;
    --blue: #5487ff;
    --tint: #141c2b;
    --chip: #1b2434;
    --mono: "IBM Plex Mono", Consolas, "Liberation Mono", monospace;
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
    background: var(--background);
    color: var(--text);
}

:root[data-theme="light"] {
    color-scheme: light;
    --background: #f9fafc;
    --surface: #fff;
    --text: #151923;
    --body-text: #404a58;
    --muted: #526174;
    --line: #ccd3dd;
    --accent: #2456bd;
    --blue: #3265d8;
    --tint: #eaf0fc;
    --chip: #eaf0fa;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
a { color: inherit; }
button { font: inherit; }
::selection { background: #3659a8; color: white; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
.container { width: min(75rem, 88%); margin-inline: auto; }
.icon { display: block; flex: none; }
.skip-link { position: absolute; top: -5rem; z-index: 1; padding: .7rem; background: var(--surface); }
.skip-link:focus { top: .5rem; }
.site-header { border-bottom: 1px solid var(--line); }
.navigation { display: flex; align-items: center; min-height: 5rem; gap: clamp(1.3rem, 4vw, 3.7rem); }
.brand { display: flex; }
.brand img { object-fit: contain; image-rendering: pixelated; }
.navigation nav { display: flex; align-self: stretch; gap: clamp(1.2rem, 3vw, 2.7rem); }
.navigation nav a {
    display: grid;
    align-items: center;
    position: relative;
    font-size: .96rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--muted);
}
.navigation a:hover, .navigation a[aria-current] { color: var(--text); }
.navigation a[aria-current]::after {
    content: "";
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 3px;
    background: var(--blue);
}
.theme-toggle, .button-link {
    border: 1px solid var(--line);
    border-radius: .45rem;
    color: var(--text);
    background: var(--surface);
    cursor: pointer;
}
.theme-toggle {
    margin-left: auto;
    width: 2.65rem;
    height: 2.65rem;
    display: grid;
    place-items: center;
    flex: none;
}
.theme-toggle[hidden], .icon-moon, [data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }
.button-link:hover, .theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
main:focus { outline: none; }
.page-heading {
    padding: clamp(2.5rem, 5vw, 4.9rem) 0 clamp(1.65rem, 3vw, 2.75rem);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.5rem;
}
h1, h2, p, figure { margin: 0; }
h1 {
    font-size: clamp(3.4rem, 6.35vw, 6rem);
    line-height: 1.04;
    font-weight: 650;
    letter-spacing: -.065em;
}
.period { color: var(--blue); }
.socials, .button-link { display: flex; align-items: center; gap: .65rem; }
.button-link { padding: .65rem 1rem; min-height: 2.7rem; font-weight: 550; font-size: .94rem; text-decoration: none; }
.button-link .icon { width: 1.07rem; height: 1.07rem; }
.profile {
    display: grid;
    grid-template-columns: minmax(0, .76fr) minmax(0, 1.24fr);
    gap: clamp(2.5rem, 6.2vw, 6rem);
    align-items: start;
    padding: clamp(2rem, 4vw, 3.6rem) 0 4rem;
}
.picture-frame {
    position: relative;
    padding: .55rem;
    border: 1px solid var(--line);
    background: var(--surface);
}
.picture-frame::before, .picture-frame::after {
    content: "";
    width: 1.7rem;
    height: 1.7rem;
    position: absolute;
    border: solid var(--blue);
    pointer-events: none;
}
.picture-frame::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.picture-frame::after { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }
.picture-frame img { display: block; width: 100%; aspect-ratio: 4 / 4.65; object-fit: cover; object-position: center 32%; }
figcaption {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding-block: .95rem;
    font: .84rem/1.4 var(--mono);
    color: var(--muted);
}
figcaption .icon { color: var(--accent); width: 1rem; height: 1rem; }
.section-label {
    display: flex;
    align-items: center;
    gap: .8rem;
    margin: .15rem 0 1.3rem;
    color: var(--accent);
    font: 600 .82rem/1.4 var(--mono);
    letter-spacing: .12em;
    text-transform: uppercase;
}
.section-label::before { content: ""; width: 1.8rem; height: 2px; background: var(--blue); }
.biography p, .project-card p { font-size: clamp(1rem, 1.2vw, 1.125rem); line-height: 1.72; color: var(--body-text); }
.biography p + p { margin-top: 1.25rem; }
strong { color: var(--text); font-weight: 600; }
.biography a, .repo-link { color: var(--accent); text-underline-offset: .2em; }
.biography a:hover, .repo-link:hover { color: var(--text); }
.biography p.availability {
    border-left: 2px solid var(--blue);
    background: var(--tint);
    padding: .9rem 1.15rem;
    margin-top: 1.6rem;
    font-size: 1rem;
    line-height: 1.65;
}
.project-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.4rem;
    padding: clamp(2rem, 4vw, 3.6rem) 0 4rem;
}
.project-card { border: 1px solid var(--line); background: var(--surface); padding: clamp(1.25rem, 2.3vw, 2rem); border-radius: .5rem; scroll-margin-top: 1.5rem; }
.project-card:target { border-color: var(--blue); }
.project-card header { padding-bottom: 1.25rem; border-bottom: 1px solid var(--line); }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.card-title h2 { font-size: clamp(1.45rem, 2vw, 1.95rem); line-height: 1.15; font-weight: 600; letter-spacing: -.045em; }
.repo-link { display: inline-flex; align-items: center; gap: .45rem; font-size: .875rem; text-decoration: none; }
.repo-link .icon { width: 1rem; height: 1rem; }
.technologies { padding: 0; margin: 1rem 0 0; display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; }
.technologies li { color: var(--accent); background: var(--chip); border-radius: .2rem; padding: .25rem .5rem; font: .8rem/1.4 var(--mono); }
.project-card p { margin-top: 1.2rem; font-size: 1rem; }

@media (max-width: 48rem) {
    .container { width: min(90%, 38rem); }
    .navigation { gap: 1.5rem; min-height: 4.2rem; }
    .profile, .project-grid { grid-template-columns: 1fr; }
    .profile { gap: 1.5rem; }
    .portrait { width: min(100%, 24rem); }
    .page-heading { align-items: flex-start; flex-direction: column; }
    .picture-frame img { aspect-ratio: 1; object-position: center 25%; }
}
@media (max-width: 30rem) {
    .navigation { gap: .85rem; }
    .brand img { width: 2.4rem; height: 1.6rem; }
    .navigation nav { gap: clamp(.6rem, 2.5vw, 1rem); }
    .navigation nav a { font-size: .86rem; }
    .theme-toggle { width: 2.1rem; height: 2.1rem; }
    h1 { font-size: clamp(2.65rem, 12vw, 3.7rem); }
}
