*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --paper: #FFFFFF;
    --navy: #0B1B33;
    --text: #1A2233;
    --muted: #3D4B61;
    --cyan: #126E91;          /* text and links on white */
    --cyan-on-navy: #7FD0EE;  /* numbers and links on navy */
    --cyan-rule: #1B8DB8;     /* section heading underlines */
    --pink: #F6C9C9;
    --card: #EEF6F9;

    --on-navy: #E8EEF5;
    --on-navy-soft: #D5DFEB;
    --on-navy-muted: #9FB3CC;
    --navy-rule: #2B3F5E;
    --rule: #C9D2DE;
    --rule-card: #B9D3DE;

    --font-serif: 'Newsreader', Georgia, 'Times New Roman', serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    --topbar-height: 62px;
}

html {
    scroll-behavior: smooth;
}

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

html,
body {
    margin: 0;
    background: var(--paper);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-serif);
    font-size: 18px;
    line-height: 1.5;
    text-wrap: pretty;
}

p {
    margin: 0;
}

a {
    color: var(--cyan);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

a:hover {
    color: var(--navy);
}

a:focus-visible {
    outline: 2px solid var(--cyan-rule);
    outline-offset: 3px;
}

img {
    max-width: 100%;
}

::selection {
    background: var(--cyan);
    color: var(--paper);
}

.page {
    max-width: 1168px; /* 1120px of content plus the side gutters */
    margin: 0 auto;
    padding: 0 24px 80px;
}

/* ---------- nav ---------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 28px;
    padding: 20px 0 14px;
    background: var(--paper);
    border-bottom: 2px solid var(--navy);
    font-family: var(--font-mono);
    font-size: 13px;
}

.logo {
    color: var(--navy);
    background: var(--pink);
    padding: 4px 10px;
    text-decoration: none;
}

.logo:hover {
    color: var(--navy);
}

.logo__slash {
    color: var(--cyan);
}

.nav-link {
    color: var(--text);
    text-decoration: none;
    padding-bottom: 2px;
    border-bottom: 2px solid transparent;
    transition: color .2s ease, border-color .2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--cyan);
    border-bottom-color: var(--cyan);
}

.status-pill {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--navy);
    color: var(--paper);
    padding: 4px 12px;
}

.status-pill__dot {
    width: 8px;
    height: 8px;
    flex-shrink: 0;
    background: var(--cyan-on-navy);
}

/* ---------- layout ---------- */

.layout {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 40px;
    padding-top: 32px;
}

.identity {
    flex: 1 1 260px;
    max-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 24px;
    background: var(--navy);
    color: var(--on-navy);
    border-top: 4px solid var(--pink);
}

.identity__photo {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    object-position: top;
    filter: grayscale(1) contrast(1.05);
    outline: 2px solid var(--cyan-on-navy);
    outline-offset: 5px;
    margin: 5px 0 6px;
}

.identity__name {
    margin: 0;
    color: var(--paper);
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: 44px;
    line-height: 1.02;
    letter-spacing: -0.015em;
}

.identity__name span {
    display: block;
}

.identity__meta {
    margin-top: 12px;
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.7;
    color: #C9D5E3;
}

.identity__links {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 12px;
}

.identity__links a {
    color: var(--paper);
    text-decoration-color: var(--cyan-on-navy);
    overflow-wrap: anywhere;
}

.identity__links a:hover {
    color: var(--cyan-on-navy);
}

.button {
    display: block;
    padding: 12px;
    background: var(--pink);
    color: var(--navy);
    font-family: var(--font-mono);
    font-size: 13px;
    text-align: center;
    text-decoration: none;
    transition: background .2s ease;
}

.button:hover {
    background: var(--paper);
    color: var(--navy);
}

.identity .button:focus-visible {
    outline-color: var(--cyan-on-navy);
}

.main {
    flex: 999 1 560px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 56px;
}

/* ---------- sections ---------- */

.section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    scroll-margin-top: calc(var(--topbar-height) + 20px);
}

.section-heading {
    margin: 0;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--cyan-rule);
    color: var(--navy);
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 400;
    font-size: 22px;
}

.section-heading--plain {
    padding-bottom: 0;
    border-bottom: 0;
}

/* ---------- hero ---------- */

.hero {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.lede {
    color: var(--navy);
    font-size: clamp(32px, 4vw, 46px);
    line-height: 1.1;
    letter-spacing: -0.01em;
}

.lede__turn {
    color: var(--cyan);
}

.lede-sub {
    max-width: 680px;
    font-size: 20px;
    line-height: 1.55;
}

/* ---------- selected work ---------- */

.project {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 24px;
    background: var(--paper);
    border: 1px solid var(--navy);
    scroll-margin-top: calc(var(--topbar-height) + 20px);
}

.project--lead {
    background: var(--card);
}

.project__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 14px;
}

.project__title {
    margin: 0;
    color: var(--cyan);
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: 30px;
    line-height: 1.1;
}

.project__stack,
.project__when {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--muted);
}

.project__when {
    margin-left: auto;
}

.result {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 14px;
    padding-top: 12px;
    border-top: 1px solid #D5DEE7;
}

.project--lead .result {
    border-top-color: var(--rule-card);
}

.result__label {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--cyan);
}

.result__text {
    flex: 1 1 400px;
}

.project__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    font-family: var(--font-mono);
    font-size: 13px;
}

.also {
    font-size: 16px;
    line-height: 1.6;
    color: var(--muted);
}

/* ---------- how I work ---------- */

.how {
    gap: 24px;
    padding: 32px;
    background: var(--navy);
    color: var(--on-navy);
    border-top: 4px solid var(--pink);
}

.how__intro {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.how__label {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--pink);
}

.how__heading {
    margin: 0;
    color: var(--paper);
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: 34px;
    line-height: 1.15;
}

.steps {
    margin: 0;
    padding: 0;
    list-style: none;
    border-bottom: 1px solid var(--navy-rule);
}

.step {
    display: flex;
    gap: 24px;
    padding: 14px 0;
    border-top: 1px solid var(--navy-rule);
}

.step__num {
    flex: 0 0 56px;
    color: var(--cyan-on-navy);
    font-size: 40px;
    line-height: 1;
}

.step__body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.step__title {
    margin: 0;
    color: var(--paper);
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: 22px;
    line-height: 1.25;
}

.step__text {
    font-size: 16px;
    line-height: 1.45;
    color: var(--on-navy-soft);
}

.step__example {
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.6;
    color: var(--on-navy-muted);
}

/* ---------- experience ---------- */

.job {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.job__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 12px;
}

.job__role {
    margin: 0;
    color: var(--text);
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: 24px;
    line-height: 1.2;
}

.job__org {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--muted);
}

.job__when {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--cyan);
}

.job p {
    font-size: 17px;
}

.additional {
    margin: 0;
    padding: 14px 0 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-top: 1px solid var(--rule);
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--muted);
}

.additional__row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
}

.additional__when {
    margin-left: auto;
}

/* ---------- education ---------- */

.education {
    gap: 10px;
    padding: 20px 24px;
    background: var(--card);
    border: 1px solid var(--navy);
}

.degree {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 12px;
}

.degree__title {
    font-size: 20px;
}

.degree__org {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--muted);
}

.degree__when {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--cyan);
}

/* ---------- contact ---------- */

.contact__text {
    max-width: 680px;
}

/* ---------- responsive ---------- */

/* Pin the sidebar only where it fits on screen beside the writing. */
@media screen and (min-width: 920px) and (min-height: 760px) {
    .identity {
        position: sticky;
        top: calc(var(--topbar-height) + 24px);
    }
}

/* Below this width the sidebar wraps above the main column: let it span. */
@media screen and (max-width: 919px) {
    .identity {
        max-width: none;
    }

    .identity__photo {
        max-width: 240px;
    }
}

@media screen and (max-width: 620px) {
    body {
        font-size: 17px;
    }

    .page {
        padding: 0 16px 64px;
    }

    /* the bar wraps onto several rows here, and pinning it would eat the viewport */
    .topbar {
        position: static;
        gap: 10px 20px;
    }

    .status-pill {
        margin-left: 0;
    }

    .section,
    .project {
        scroll-margin-top: 12px;
    }

    .main {
        gap: 48px;
    }

    .project,
    .how {
        padding: 20px;
    }

    .education {
        padding: 18px 20px;
    }

    .how__heading {
        font-size: 28px;
    }

    .step {
        gap: 16px;
    }

    .step__num {
        flex-basis: 40px;
        font-size: 30px;
    }

    .project__when,
    .job__when,
    .degree__when,
    .additional__when {
        margin-left: 0;
    }
}
