/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 18px;
    line-height: 1.6;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #333;
    background: #fff;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Navigation */
nav {
    position: fixed;
    top: 2rem;
    left: 2rem;
    z-index: 100;
}

.resume-link {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #333;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: background 0.2s ease;
}

.resume-link:hover {
    background: #555;
}

/* Main content */
main {
    max-width: 650px;
    margin: 0 auto;
    padding-top: 1rem;
}

header {
    margin-bottom: 3rem;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

article {
    position: relative;
}

p {
    margin-bottom: 1.4rem;
    text-align: justify;
}

/* Links */
a {
    color: #0066cc;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-bottom-color 0.2s ease;
}

a:hover {
    border-bottom-color: #0066cc;
}

/* Lists */
.project-list,
.links-list {
    list-style: none;
    margin-bottom: 1.4rem;
}

.project-list li {
    margin-bottom: 1rem;
}

.links-list {
    display: flex;
    gap: 2rem;
}

.links-list li {
    display: inline;
}

/* Sidenotes - Desktop */
.sidenote-wrapper {
    position: relative;
}

.sidenote,
.margin-toggle {
    display: none;
}

@media (min-width: 1200px) {
    body {
        padding-left: 12.5%;
    }

    main {
        max-width: 55%;
        margin-left: 0;
    }

    .sidenote {
        display: block;
        float: right;
        clear: right;
        margin-right: -60%;
        width: 50%;
        font-size: 0.85rem;
        line-height: 1.5;
        position: relative;
        vertical-align: baseline;
    }

    .sidenote-number {
        counter-increment: sidenote-counter;
    }

    .sidenote-number:after {
        content: counter(sidenote-counter);
        font-size: 0.75rem;
        top: -0.5rem;
        left: 0.1rem;
        position: relative;
        vertical-align: baseline;
    }

    .sidenote:before {
        content: counter(sidenote-counter) " ";
        font-size: 0.75rem;
        top: -0.5rem;
        left: -0.5rem;
        position: relative;
        vertical-align: baseline;
    }

    body {
        counter-reset: sidenote-counter;
    }
}

/* Sidenotes - Mobile */
@media (max-width: 1199px) {
    .margin-toggle:checked + .sidenote {
        display: block;
        float: left;
        left: 1rem;
        clear: both;
        width: 95%;
        margin: 1rem 2.5%;
        padding: 1rem;
        background: #f5f5f5;
        border-left: 3px solid #0066cc;
        font-size: 0.9rem;
        position: relative;
    }

    .sidenote-number {
        cursor: pointer;
    }

    .sidenote-number:after {
        content: " [+]";
        font-size: 0.8rem;
        color: #0066cc;
    }

    .margin-toggle:checked + .sidenote-number:after {
        content: " [−]";
    }
}

/* Footer */
footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
    text-align: center;
    color: #999;
    font-size: 0.9rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }

    nav {
        position: static;
        margin-bottom: 2rem;
    }

    h1 {
        font-size: 2rem;
    }

    main {
        max-width: 100%;
    }
}
