@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Domine:wght@400..700&family=M+PLUS+1p&family=Raleway:ital,wght@0,100..900;1,100..900&family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap');

:root {
    /* Color scheme */
    --color-background: #ffffff;
    --color-text: #0B1215;
    --color-primary: #6e6e6e;
    --color-secondary: rgba(211, 211, 211, 0.5);
    --color-hover: rgba(229, 229, 229, 0.7);

    /* Spacing */
    --spacing-unit: 1rem;
    --spacing-small: calc(var(--spacing-unit) * 0.5);
    --spacing-medium: var(--spacing-unit);
    --spacing-large: calc(var(--spacing-unit) * 2);

    /* Animations */
    --animation-duration: 1s;
    --animation-delay-increment: 0.2s;

    /* Typography */
    --font-size-base: 1rem;
    --line-height-base: 1.6;
    --font-body: 'Roboto', sans-serif;
    --font-header: 'Raleway', sans-serif;

    /* NEIA Glow Colors */
    --neia-color-n: #73318C;
    --neia-color-e: #EFAE35;
    --neia-color-i: #FBDBAE;
    --neia-color-a: #ED4C2A;
}

body {
    background-color: var(--color-background);
    color: var(--color-text);
    font-family: var(--font-body), serif;
    margin: 0;
    overflow-x: hidden;
    transition: background-color 0.5s ease, color 0.5s ease;
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
}

body::before {
    content: "";
    display: block;
    height: 5rem;
    visibility: hidden;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: var(--spacing-large);
    position: relative;
}

.title {
    font-family: var(--font-header);
    font-size: var(--font-size-base);
    font-weight: 500;
    margin: 0;
}

.title a {
    color: inherit;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: border-color 0.3s ease;
}

.title a:hover {
    border-color: transparent;
}

.title a span {
    transition: text-shadow 0.3s ease;
}

.title a:hover span.glow-n {
    text-shadow: 0 0 5px #fff, 0 0 10px var(--neia-color-n), 0 0 20px var(--neia-color-n);
}

.title a:hover span.glow-e {
    text-shadow: 0 0 5px #fff, 0 0 10px var(--neia-color-e), 0 0 20px var(--neia-color-e);
}

.title a:hover span.glow-i {
    text-shadow: 0 0 5px #fff, 0 0 10px var(--neia-color-i), 0 0 20px var(--neia-color-i);
}

.title a:hover span.glow-a {
    text-shadow: 0 0 5px #fff, 0 0 10px var(--neia-color-a), 0 0 20px var(--neia-color-a);
}

.subtitle {
    text-align: center;
    color: var(--color-primary);
}

.name-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-medium);
    margin-bottom: var(--spacing-large);
}

.name {
    font-family: var(--font-header);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

h1, h2 {
    font-family: var(--font-header);
    font-weight: 700;
}

h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    margin-bottom: var(--spacing-medium);
}

nav {
    margin-bottom: var(--spacing-large);
}

nav a {
    color: inherit;
    text-decoration: none;
    margin: 0 var(--spacing-medium);
    transition: color 0.3s ease;
    position: relative;
}

nav a::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--color-secondary);
    border-radius: 10px;
    transform: scaleX(1);
    transition: transform 0.3s ease;
}

nav a:hover::after {
    transform: scaleX(1);
}

p, ul, li {
    line-height: var(--line-height-base);
    font-size: calc(var(--font-size-base) * 1.1);
    text-align: left;
}

section {
    margin-bottom: calc(var(--spacing-large) * 1.5);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    opacity: 0;
    transform: translateY(20px);
    filter: blur(10px);
    animation: fadeInUp var(--animation-duration) ease-out forwards;
    position: relative;
    width: 100%;
}

#Current\ projects {
    animation-delay: 0.1s;
}

#projects {
    animation-delay: 0.3s;
}

.project-box {
    display: inline-flex;
    flex-direction: column;
    padding: var(--spacing-medium);
    margin-bottom: var(--spacing-medium);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    filter: blur(10px);
    position: relative;
    box-sizing: border-box;
    align-self: flex-start;
}

.project-box:hover {
    transform: scale(1.02);
}

.project-title {
    font-family: var(--font-header);
    font-weight: 600;
    margin-bottom: var(--spacing-small);
    white-space: nowrap;
}

.project-box.unselected {
    transform: scale(0.8);
    opacity: 0.5;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.project-box.selected {
    transform: scale(1);
    opacity: 1;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.side-text-box.active {
    transition: flex 0.3s ease;
}

.project-meta {
    font-size: calc(var(--font-size-base) * 0.9);
    color: var(--color-primary);
    white-space: nowrap;
}

video {
    display: block;
    margin: 0 auto;
}

#Current\ projects .project-box,
#projects .project-box {
    opacity: 0;
    animation: fadeInUp var(--animation-duration) ease-out forwards;
}

#Current\ projects .project-box:nth-child(n),
#projects .project-box:nth-child(n) {
    animation-delay: calc(var(--animation-delay-increment) * var(--n));
}

#Current\ projects .project-box:nth-child(1) { --n: 1; }
#Current\ projects .project-box:nth-child(2) { --n: 2; }
#Current\ projects .project-box:nth-child(3) { --n: 3; }
#Current\ projects .project-box:nth-child(4) { --n: 4; }

#projects .project-box:nth-child(1) { --n: 2; }
#projects .project-box:nth-child(2) { --n: 3; }
#projects .project-box:nth-child(3) { --n: 4; }
#projects .project-box:nth-child(4) { --n: 5; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

/* Updated link styles */
.markdown-content a {
    position: relative;
    text-decoration: none;
    color: inherit;
}

.markdown-content a::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--color-secondary);
    border-radius: 10px;
    transform: scaleX(1);
    transition: transform 0.3s ease;
}

.markdown-content a:hover::after {
    background-color: var(--color-hover);
}

/* External link styles */
a[href^="http"],
a[href^="https"] {
    position: relative;
    text-decoration: none;
    color: inherit;
}

a[href^="http"]::after,
a[href^="https"]::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--color-secondary);
    border-radius: 10px;
    transform: scaleX(1);
    transition: transform 0.3s ease;
}

a[href^="http"]:hover::after,
a[href^="https"]:hover::after {
    background-color: var(--color-hover);
}

.hover-background {
    position: absolute;
    background-color: var(--color-hover);
    border-radius: 10px;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: -1;
    opacity: 0;
}

.project-box:hover ~ .hover-background {
    opacity: 1;
}

.name-container, nav {
    opacity: 0;
    transform: translateY(20px);
    filter: blur(10px);
    animation: fadeInUp 0.5s ease-out 0.1s forwards;
}

@keyframes fadeInWord {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.content-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--spacing-medium);
}

#projects {
    flex: 0 0 30%;
}

.side-text-box {
    flex: 0 0 65%;
    padding: var(--spacing-medium);
    border-radius: 10px;
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    height: auto;
    overflow-y: auto;
    overflow-x: hidden;
    transition: height 0.3s ease;
}

@media (max-width: 768px) {
    :root {
        --font-size-base: 0.9rem;
        --spacing-unit: 0.8rem;
    }

    .content-wrapper {
        flex-direction: column;
    }

    #projects {
        flex: 1;
        width: 100%;
        margin-right: 0;
        margin-bottom: var(--spacing-medium);
    }

    .side-text-box {
        flex: 0 0 65%;
        min-height: 300px;
        max-height: 80vh;
        transition: all 0.3s ease;
    }

    .side-text-box:empty {
        display: none;
    }

    .side-text-box p {
        margin: 0 0 1em 0;
    }

    .side-text-box span {
        display: inline-block;
        opacity: 0;
        transition: opacity 0.3s ease-in;
    }

    .container {
        padding: var(--spacing-medium);
    }

    h1 {
        font-size: clamp(1.5rem, 4vw, 2rem);
    }

    .name {
        font-size: 1.2rem;
    }

    .title {
        font-size: calc(var(--font-size-base) * 0.9);
    }

    nav a {
        font-size: calc(var(--font-size-base) * 0.9);
    }
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    :root {
        --color-background: #0B1215;
        --color-text: #FFFAEF;
        --color-primary: #b0b0b0;
        --color-secondary: rgba(211, 211, 211, 0.2);
        --color-hover: rgba(94, 94, 94, 0.3);
    }
}

.tldr {
    background-color: var(--color-secondary);
    padding: var(--spacing-small);
    border-radius: 5px;
    margin-bottom: var(--spacing-medium);
    font-size: calc(var(--font-size-base) * 1.1);
    line-height: var(--line-height-base);
    width: 100%;
    height: auto;
    transition: height 0.3s ease;
}

/* Markdown styles */
.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    font-family: var(--font-header);
    font-weight: 700;
    margin-top: var(--spacing-medium);
    margin-bottom: var(--spacing-small);
}

.markdown-content p {
    font-family: var(--font-body);
    margin-bottom: var(--spacing-medium);
}

.markdown-content ul,
.markdown-content ol {
    font-family: var(--font-body);
    margin-bottom: var(--spacing-medium);
    padding-left: var(--spacing-large);
}

.markdown-content li {
    font-family: var(--font-body);
    margin-bottom: var(--spacing-small);
}

.markdown-content img {
    max-width: 100%;
    height: auto;
    margin-bottom: var(--spacing-medium);
}

.markdown-content pre {
    padding: var(--spacing-small);
    border-radius: 5px;
    overflow-x: auto;
    margin-bottom: var(--spacing-medium);
}

.markdown-content code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
    border-radius: 8px;
}