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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #2a2d26;
    color: #faf8ed;
    min-height: 100vh;
}

p + p {
    margin-top: 8px;
}

/* Translucent line colour used for the rails and section dividers */
:root {
    --line: rgba(250, 248, 237, 0.25);
}

/* Centered column; the two vertical lines make the content look "lifted" */
.page {
    max-width: 90%;
    min-height: 100vh;
    margin: 0 auto;
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
}

/* Each section of the page; a translucent line separates neighbours */
.section {
    padding: 36px 40px;
}

.section + .section {
    border-top: 1px solid var(--line);
}

.right-box {
    display: none; /* hidden for now; remove this line to bring it back */
}

/* Bubbled section titles (same look as the tags on the literature review page) */
.section-pill {
    display: inline-block;
    font-family: inherit;
    font-size: 1.15em;
    font-weight: 500;
    line-height: 1.4;
    padding: 4px 16px;
    margin-bottom: 18px;
    border-radius: 999px;
    background-color: rgba(167, 115, 201, 0.2);
    border: 1px solid rgba(167, 115, 201, 0.45);
    color: #c9a0e8;
    letter-spacing: 0.3px;
}

.section-pill-lg {
    font-size: 2em;
    padding: 6px 24px;
}

h1 {
    font-size: 2.5em;
    margin-bottom: 20px;
    color: #faf8ed;
}

.bio {
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 30px;
    color: #faf8ed;
}

.social-links {
    display: flex;
    gap: 20px;
    margin-top: 14px;
}

.social-links a {
    color: #a773c9;
    font-size: 1.5em;
    transition: transform 0.2s;
    text-decoration: none;
}

.social-links a:hover {
    transform: scale(1.2);
}

/* Intro: blurb text with photo beside it */
.intro {
    display: flex;
    align-items: flex-start;
    gap: 30px;
}

.intro-text {
    flex: 1;
}

.intro-photo {
    width: 280px;
    flex-shrink: 0;
    display: block;
    border: 2px solid #faf8ed;
    border-radius: 12px;
}

.left-blurb {
    font-size: 1em;
    line-height: 1.6;
    margin-bottom: 20px;
    color: #faf8ed;
    opacity: 0.85;
}

/* no gap under the last sentence, so the social links sit close beneath it */
.intro-text .left-blurb:last-of-type {
    margin-bottom: 0;
}

.inline-icon {
    vertical-align: -3px;
    margin-right: 6px;
}

.left-blurb a {
    color: #a773c9;
    text-decoration: none;
    transition: opacity 0.2s;
}

.left-blurb a:hover {
    opacity: 0.7;
    text-decoration: underline;
}

/* Show/hide button (also has .section-pill) and the content it controls */
.toggle-button {
    margin-bottom: 0;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

.toggle-button:hover {
    background-color: rgba(167, 115, 201, 0.32);
    border-color: rgba(167, 115, 201, 0.75);
}

.toggle-content {
    display: none;
}

.toggle-content.show {
    display: block;
}

/* Names in a running line, separated by bullets, wrapping as needed */
.inline-list {
    list-style: none;
    padding-top: 16px;
    line-height: 1.9;
}

.inline-list li {
    display: inline;
}

.inline-list li:not(:last-child)::after {
    content: "•";
    margin: 0 0.7em;
    color: #a773c9;
}

.inline-list a {
    color: #a773c9;
    text-decoration: none;
    transition: opacity 0.2s;
}

.inline-list a:hover {
    opacity: 0.7;
    text-decoration: underline;
}

/* Short notes: numbered list modelled on the literature review page */
.notes-list {
    list-style: none;
    counter-reset: note;
}

.notes-list li {
    counter-increment: note;
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 8px;
    border-bottom: 1px solid rgba(250, 248, 237, 0.08);
    transition: background-color 0.18s;
}

.notes-list li::before {
    content: counter(note) ".";
    color: #a773c9;
    font-weight: bold;
    min-width: 28px;
    padding-top: 1px;
    flex-shrink: 0;
}

.notes-list li:hover {
    background-color: rgba(250, 248, 237, 0.07);
}

.notes-title {
    font-size: 1.05em;
    line-height: 1.5;
    color: #faf8ed;
    text-decoration: none;
}

/* makes the whole row clickable (only when the title itself is a link) */
a.notes-title::after {
    content: '';
    position: absolute;
    inset: 0;
}

/* Several separate links under one item (e.g. Report / Poster) */
.notes-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.link-pill {
    position: relative; /* sits above the row overlay if the title is also a link */
    z-index: 1;
    font-size: 0.85em;
    padding: 2px 12px;
    border-radius: 999px;
    border: 1px solid rgba(167, 115, 201, 0.45);
    color: #c9a0e8;
    text-decoration: none;
    letter-spacing: 0.3px;
    transition: background-color 0.18s, border-color 0.18s;
}

.link-pill:hover {
    background-color: rgba(167, 115, 201, 0.25);
    border-color: rgba(167, 115, 201, 0.85);
}

.notes-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.tag-pill {
    font-size: 0.72em;
    padding: 2px 8px;
    border-radius: 20px;
    background-color: rgba(167, 115, 201, 0.2);
    border: 1px solid rgba(167, 115, 201, 0.45);
    color: #c9a0e8;
    letter-spacing: 0.3px;
}

.blog-list {
    list-style: none;
}

.blog-item {
    background-color: rgba(250, 248, 237, 0.05);
    border-left: 4px solid #a773c9;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    transition: background-color 0.2s;
    position: relative;
}

.tag {
    position: absolute;
    top: 20px;
    right: 20px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.75em;
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 4px;
    letter-spacing: 1px;
}

.tag-blog {
    background-color: #4a9eff;
    color: #faf8ed;
}

.tag-project {
    background-color: #ff6b6b;
    color: #faf8ed;
}

.tag-tutorial {
    background-color: #51cf66;
    color: #faf8ed;
}

.blog-item:hover {
    background-color: rgba(250, 248, 237, 0.1);
}

.blog-item h2 {
    font-size: 1.5em;
    margin-bottom: 10px;
    color: #faf8ed;
}

.blog-item a {
    color: #a773c9;
    text-decoration: none;
    font-weight: 500;
}

.blog-item a:hover {
    text-decoration: underline;
}

.blog-item p {
    color: #faf8ed;
    opacity: 0.8;
    margin-top: 10px;
    line-height: 1.6;
}

.blog-date {
    font-size: 0.9em;
    opacity: 0.6;
    margin-top: 10px;
}

/* Custom scrollbar */
.right-box::-webkit-scrollbar {
    width: 10px;
}

.right-box::-webkit-scrollbar-track {
    background: rgba(250, 248, 237, 0.1);
    border-radius: 10px;
}

.right-box::-webkit-scrollbar-thumb {
    background: #a773c9;
    border-radius: 10px;
}

.right-box::-webkit-scrollbar-thumb:hover {
    background: #8e5db0;
}

/* Blog page specific styles */
.blog-container {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    gap: 40px;
    position: relative;
}

.blog-content {
    flex: 1;
    max-width: 800px;
}

.blog-article {
    margin-top: 20px;
}

.toc-wrapper {
    width: 280px;
    order: 2;
    position: relative;
}

.toc-sticky {
    position: fixed;
    right: 20px;
    top: 0;
    bottom: 0;
    width: 200px;
    padding: 40px 0;
}

.toc-sticky h3 {
    position: absolute;
    top: 40px;
    left: 0;
    color: #faf8ed;
    font-size: 1em;
}

.toc-sticky ul {
    list-style: none;
    position: relative;
    height: 100%;
    padding-top: 80px;
}

.toc-sticky ul::before {
    content: '';
    position: absolute;
    left: 0;
    top: 80px;
    bottom: 0;
    width: 1px;
    background-color: #a773c9;
}

.toc-sticky li {
    position: absolute;
    line-height: 1.3;
    transition: all 0.3s ease;
    left: 0;
    width: 100%;
}

.toc-sticky li.h2 {
    padding-left: 0;
}

.toc-sticky li.h3 {
    padding-left: 15px;
    font-size: 0.8em;
}

.toc-sticky a {
    color: #a773c9;
    text-decoration: none;
    transition: all 0.2s;
    display: inline-block;
    padding: 4px 0;
    opacity: 0.6;
    font-size: 0.85em;
    max-width: 100%;
    word-wrap: break-word;
}

.toc-sticky a:hover {
    opacity: 1;
}

.toc-sticky a.active {
    color: #faf8ed;
    font-weight: bold;
    opacity: 1;
    border-left: 3px solid #a773c9;
    padding-left: 8px;
    margin-left: -3px;
}

.toc-sticky li.h3 a.active {
    padding-left: 20px;
    margin-left: -3px;
}

/* Custom scrollbar for body */
body::-webkit-scrollbar {
    width: 8px;
}

body::-webkit-scrollbar-track {
    background: #2a2d26;
}

body::-webkit-scrollbar-thumb {
    background: #a773c9;
    border-radius: 4px;
}

body::-webkit-scrollbar-thumb:hover {
    background: #8e5db0;
}

.blog-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

.blog-content h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.blog-content .blog-date {
    font-size: 1em;
    opacity: 0.6;
    margin-bottom: 30px;
    display: block;
}

.blog-content h2 {
    font-size: 1.8em;
    margin-top: 30px;
    margin-bottom: 15px;
    color: #faf8ed;
}

.blog-content p {
    font-size: 1.1em;
    line-height: 1.8;
    margin-bottom: 20px;
    color: #faf8ed;
}

.math-block {
    font-size: 1.2em;
    text-align: center;
    margin: 30px 0;
    padding: 20px;
    background-color: rgba(250, 248, 237, 0.05);
    border-radius: 8px;
    overflow-x: auto;
}

.blog-content a {
    color: #a773c9;
    text-decoration: none;
}

.blog-content a:hover {
    text-decoration: underline;
}

.blog-content code {
    background-color: rgba(250, 248, 237, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

.blog-content pre {
    background-color: rgba(250, 248, 237, 0.1);
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 20px;
}

.blog-content pre code {
    background-color: transparent;
    padding: 0;
}

.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: #a773c9;
    text-decoration: none;
    font-weight: 500;
}

.back-link:hover {
    text-decoration: underline;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    .intro {
        flex-direction: column;
    }

    .intro-photo {
        width: 100%;
        max-width: 320px;
    }

    .section {
        padding: 24px 20px;
    }

    .section-pill-lg {
        font-size: 1.6em;
        padding: 4px 18px;
    }

    h1 {
        font-size: 2em;
    }

    .bio {
        font-size: 1em;
    }

    .social-links {
        margin-top: 20px;
    }

    .blog-container {
        flex-direction: column;
        padding: 20px 15px;
    }

    .toc-wrapper {
        order: -1;
        width: 100%;
        margin-bottom: 30px;
    }

    .toc-sticky {
        position: relative;
        right: auto;
        top: 0;
        width: 100%;
        padding: 20px;
        background-color: #44473c;
        border: 2px solid #faf8ed;
        border-radius: 12px;
    }

    .toc-sticky h3 {
        position: relative;
        top: 0;
        margin-bottom: 15px;
    }

    .toc-sticky ul {
        padding-top: 0;
        height: auto;
    }

    .toc-sticky li {
        position: relative !important;
        top: auto !important;
        margin: 8px 0;
    }

    .blog-content {
        padding: 20px 15px;
        max-width: 100%;
    }

    .blog-content h1 {
        font-size: 2em;
    }

    .blog-content h2 {
        font-size: 1.5em;
    }

    .blog-content p {
        font-size: 1em;
    }

    .math-block {
        font-size: 1em;
        padding: 15px;
        margin: 20px 0;
    }
}