body {
    font-family: Optima, "Candara", "URW Classico", sans-serif;
    line-height: 1.4;
    font-size: 16px;
    margin: 50px auto;
    max-width: 710px;
    padding: 0 10px;
    color: #000;
    background: #fff;
}

.header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 2em;
}

.profile-pic {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #595fca;
}

.header-text {
    flex: 1;
}

p {
    margin-bottom: 1em;
}

a {
    text-decoration: none;
    color: #595fca; /* deep blue, readable on white */
    font-weight: 500;
    background-color: rgba(89, 95, 202, 0.05);
}

.award {
    border: 1.5px solid #5e60e4;
    color: black;
    font-style: normal;
    font-weight: 400;
    text-decoration: none;
    padding-left: 3px;
    padding-right: 3px;
    border-radius: 5px;
    box-shadow: 0 0 3px var(--secondary);
    font-size: smaller;
    font-style: italic;
}

.authors {
    font-size: 0.9em;
    margin-left: 2em;
    display: inline-block;
}

img {
    max-width: 100%;
}

.sidenote {
    font-size: 80%;
    position: relative;
}
/* Wide viewport */
@media (min-width: 1400px) {
    .sidenote {
        float: right;
        clear: right;
        margin-right: -23vw;
        text-align: left;

        top: -3rem;
        width: 20vw;
        margin-top: 1rem;
    }
}

/* Narrow viewport */
@media (max-width: 1400px) {
    .sidenote {
        float: left;
        text-align: left;

        width: 95%;
        margin: 1rem 0;
        padding-left: 5%;
    }
}

/* Sidenote counter */
body {
    counter-reset: sidenote-counter;
}
.sidenote-number {
    counter-increment: sidenote-counter;
}
/* Counter before the sidenote in the margin. */
.sidenote::before {
    content: counter(sidenote-counter)".";
    position: relative;
    vertical-align: baseline;
    font-size: 0.9em;
    font-weight: bold;
    margin-right: 0.3rem;
}
/* Counter in the main body. */
.sidenote-number::after {
    content: counter(sidenote-counter);
    vertical-align: super;
    font-size: 0.7em;
    font-weight: bold;
    margin-right: 0.05rem;
    margin-left: -0.05rem;
}

@media (min-width: 1400px) {
    /* Highlight the sidenote when mouse hovers on the sidenote number in body. */
    .sidenote-number:hover .sidenote {
        background-color: yellow;
    }
}

/* Responsive design for mobile */
@media (max-width: 600px) {
    .header {
        flex-direction: column;
        text-align: center;
    }
    
    .profile-pic {
        width: 150px;
        height: 150px;
    }
}

.date {
    color: #666;
    font-size: 0.9em;
    font-weight: normal;
}

.company {
    color: #595fca;
    font-size: 0.85em;
    display: block;
    margin: 0.2em 0;
}

.description {
    font-size: 0.9em;
    margin-left: 2em;
    display: inline-block;
}

/* Consistent spacing for both projects and experiences */
p:nth-of-type(n+6) {
    margin-bottom: 1.2em;
}

/* Remove any extra spacing after the last item */
p:last-of-type {
    margin-bottom: 0;
}

/* Override styles for company links */
a.company {
    background-color: transparent;
    color: #595fca;
    text-decoration: none;
}
/* 
a.company:hover {
    background-color: rgba(89, 95, 202, 0.05);
} */