:root {
    --bg: #f7f7f5;
    --text: #1f1f1f;
    --secondary: #666;
    --accent: #77AAEE;

    --bio-width: 1100px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {

    width: 100%;
    overflow-x: hidden;

    background: var(--bg);
    color: var(--text);

    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}


/* ==========================================
   HERO
   ========================================== */


.hero {
    max-width: var(--bio-width);
    margin: 4rem auto;
    padding: 0 2rem;

    display: grid;
    grid-template-columns: 520px 300px;

    column-gap: 4rem; /* <-- this is your missing space */
    align-items: stretch; /* key: equal height columns */

    align-items: start;
    justify-content: center;
}

.portrait {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.bio {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.bio h1 {

    font-size: 3rem;
    font-weight: 600;

    margin-bottom: 1rem;

    line-height: 1.1;
}

.bio p {

    color: var(--secondary);
    /* max-width: 60ch; */
    max-width: none;
    margin-bottom: 1.5rem;
}


.links {
    display: flex;
    align-items: center;
    width: 100%;
    margin-top: 2rem;
    justify-content: flex-start; /* important */
}

.links > a {
    font-weight: 600;
    transition: color .2s ease;
}

.links > a + a {
    margin-left: 1.5rem;
}

.links > a:hover {
    color: var(--accent);
}

.social-links {
    margin-left: auto;

    display: flex;
    /* align-items: center; */
    gap: 0.8rem;
}

.md-social__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    text-decoration: none !important;
    border-bottom: none !important;
}

.md-social__link:hover {
    color: var(--accent);
    text-decoration: none !important;
    border-bottom: none !important;
}

.md-social__link svg {
    width: 1.2rem;
    height: 1.2rem;
    fill: currentColor;
    transition: color .2s ease, opacity .2s ease;
}

.md-social__link:hover svg {
    opacity: 1;
}

/* ==========================================
   PROJECT GRID
   ========================================== */

.projects {

    display: grid;

    width: 100%;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(220px, 1fr)
        );

    gap: 0;
}

.project {

    position: relative;

    aspect-ratio: 1;

    overflow: hidden;

    display: block;
}

.project img {

    width: 100%;
    height: 100%;

    object-fit: cover;

    transition: transform 0.3s ease;
}


/* ==========================================
   HOVER EFFECT
   ========================================== */

.overlay {
    position: absolute;
    inset: 0;

    background: rgba(0,0,0,0);

    transition: background .25s ease;
}

.overlay h2 {
    position: absolute;

    left: 1rem;
    bottom: 1rem;

    margin: 0;
    padding: .35rem .9rem;

    background: white;
    color: var(--accent);

    border: 1px solid var(--accent);
    border-radius: 9999px;

    font-size: 1rem;
    font-weight: 600;
    line-height: 1;

    opacity: 0;
    transform: translateY(8px);

    transition:
        opacity .25s ease,
        transform .25s ease;
}

.project:hover img {
    transform: scale(1.03);
}

.project:hover .overlay {
    background: rgba(255, 255, 255, 0.2);
}

.project:hover .overlay h2 {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================
   MOBILE
   ========================================== */

/* @media (max-width: 600px) {

    .hero {
        grid-template-columns: 1fr;
        text-align: center;
        margin: 2rem auto;
    }

    .portrait {
        order: -1;
        max-width: 260px;
        margin: 0 auto;
    }

    .bio p {
        margin-left: auto;
        margin-right: auto;
    }

    .bio h1 {
        font-size: 2.2rem;
    }

    .bio-content {
        max-width: 70ch;
    }

    .links {
        justify-content: center;
    }

    .projects {
        grid-template-columns: repeat(2, 1fr);
    }
} */

@media (max-width: 900px) {

    .hero {
        grid-template-columns: 1fr;
        row-gap: 2rem;
        justify-content: center;
    }

    .portrait {
        order: -1;
        width: 40%;
        /* max-width: 250x; */
        height: auto;
        justify-self: center;
    }

    .bio {
        align-items: center;
        text-align: center;
    }

    .links {
        justify-content: center;
    }

    /* .social-links {
        margin-left: 0;
    } */
}


/* ==========================================
   TOUCH DEVICES
   ========================================== */

@media (hover: none) {
    .overlay {
        background:
            linear-gradient(
                to top,
                rgba(0,0,0,.45),
                rgba(0,0,0,0)
            );
    }
}

/* ==========================================
   CONTENT PAGES
   ========================================== */

.page {
    max-width: 800px;
    margin: 4rem auto;
    padding: 0 2rem;
}

.back-link {
    margin-bottom: 3rem;
}

.back-link a {
    color: var(--secondary);
}

.back-link a:hover {
    color: var(--text);
}

.content h1 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 2rem;
    line-height: 1.1;
}

.content p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: var(--text);
}

.content em {
    font-style: italic;
}

@media (max-width: 600px) {
    .page {
        margin: 2rem auto;
    }
    .content h1 {
        font-size: 2rem;
    }

    .content p {
        font-size: 1rem;
    }
}

.publication-links {
    margin: 1.5rem 0 2.5rem 1.2rem;
}

.publication-links li {
    margin-bottom: 0.5rem;
}

.publication {
    padding: 1rem 0;
    border-top: 1px solid #e5e5e5;
}

.publication:last-of-type {
    border-bottom: 1px solid #e5e5e5;
}

.content h2 {
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
}