:root {
    --clr-text:   rgb(224, 248, 250);
    --clr-nav:    rgb(252, 254, 243);
    --clr-bg:     rgb(20, 27, 45);
    --clr-accent: rgba(224, 248, 250, 0.4);
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    background-color: var(--clr-bg);
    color: var(--clr-text);
    font-family: "Liberation Serif", serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    color: var(--clr-text);
    text-decoration: none;
    transition: all 0.3s ease;
}

.topbar {
    position: relative;
    display: flex;
    justify-content: center;
    padding: 0.625rem 0 1.5rem 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 100%);
}

.logo {
    font-family: "Comic Neue", "Comic Sans MS", "Comic Sans", cursive;
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--clr-nav);
    text-shadow: 0 0 0.625rem rgba(252, 254, 243, 0.8), 0 0 1.25rem rgba(252, 254, 243, 0.5);
}

.logo:hover {
    text-shadow: 0 0 1.25rem rgba(252, 254, 243, 1), 0 0 2.5rem rgba(252, 254, 243, 0.8);
}

.desktop-logo {
    position: absolute;
    left: 2.5rem;
    top: 0.625rem;
}

.menu_box {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    font-family: "Times New Roman", Times, "Georgia", serif;
    font-size: 1rem;
    letter-spacing: 0.09em;
    color: var(--clr-nav);
}

.menu_box > a, .menu_box > .dropdown {
    position: relative;
    padding: 0 0.625rem;
    cursor: pointer;
}

.menu_box > a::after, .menu_box > .dropdown::after {
    content: "|";
    position: absolute;
    right: -0.25rem;
    color: var(--clr-accent);
}

.menu_box > a:first-of-type::before {
    content: "|";
    position: absolute;
    left: -0.25rem;
    color: var(--clr-accent);
}

.menu_box > a:hover, .menu_box .dropbtn:hover {
    color: var(--clr-nav);
    text-shadow: 0 0 0.625rem rgba(252, 254, 243, 0.9), 0 0 1.25rem rgba(252, 254, 243, 0.6);
}

.dropdown {
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.85);
    min-width: 7.5rem;
    padding: 0.9375rem 0;
    border-radius: 0.25rem;
    z-index: 10;
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.5);
}

@media (min-width: 56.3125em) {
    .dropdown:hover .dropdown-content {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }
}

.dropdown-content a {
    position: relative;
    padding: 0;
    font-size: 0.95rem;
    text-align: center;
    cursor: pointer;
}

.dropdown-content a:hover {
    color: var(--clr-nav);
    text-shadow: 0 0 0.625rem rgba(252, 254, 243, 0.9);
}

.dropdown-content a::after, .dropdown-content a::before {
    content: none !important;
}

.hamburger, .mobile-header {
    display: none;
}

@media (max-width: 56.25em) {
    .desktop-logo {
        left: 1.25rem;
    }

    .hamburger {
        display: flex;
        flex-direction: column;
        gap: 0.375rem;
        position: absolute;
        right: 1.25rem;
        top: 0.9375rem;
        cursor: pointer;
        z-index: 1000;
        background: none;
        border: none;
        padding: 0.3125rem;
    }

    .hamburger .bar {
        width: 1.875rem;
        height: 0.1875rem;
        background-color: var(--clr-nav);
        border-radius: 0.125rem;
        box-shadow: 0 0 0.3125rem rgba(252, 254, 243, 0.5);
    }

    .menu_box {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.98);
        flex-direction: column;
        justify-content: center;
        gap: 1.25rem;
        font-size: 1.4rem;
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.4s ease, visibility 0.4s ease;
        pointer-events: none;
    }

    .menu_box.active {
        opacity: 1;
        visibility: visible;
        pointer-events: all;
    }

    .mobile-header {
        display: flex;
        justify-content: center;
        align-items: center;
        position: absolute;
        top: 1.25rem;
        width: 100%;
    }

    .menu_box > a::after, .menu_box > a:first-of-type::before, .menu_box > .dropdown::after {
        content: none;
    }

    .menu_box > a::before, .menu_box > .dropdown > .dropbtn::before {
        content: "| ";
        color: rgba(255, 255, 255, 0.4);
    }

    .menu_box > a::after, .menu_box > .dropdown > .dropbtn::after {
        content: " |";
        color: rgba(255, 255, 255, 0.4);
    }

    .dropdown {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .dropdown-content {
        position: static;
        transform: none;
        background-color: transparent;
        box-shadow: none;
        padding: 0.9375rem 0 0 0;
        display: none;
    }

    .dropdown-content.show {
        display: flex;
        flex-direction: column;
        gap: 0.9375rem;
    }

    .dropdown-content a::before {
        content: "~ " !important;
        position: static;
        color: rgba(255,255,255,0.2);
    }

    .dropdown-content a::after {
        content: " ~" !important;
        position: static;
        color: rgba(255,255,255,0.2);
    }
}

.page-content {
    flex-grow: 1;
    padding: 1.25rem;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.parchment {
    position: relative;
    background-color: var(--clr-nav);
    background-image:
        repeating-linear-gradient(
            0deg,
            rgba(20, 27, 45, 0.04) 0,
            rgba(20, 27, 45, 0.04) 1px,
            transparent 1px,
            transparent 4px
        ),
        linear-gradient(
            135deg,
            rgba(255,255,255,0.08) 0%,
            transparent 50%,
            rgba(0,0,0,0.04) 100%
        );
    color: var(--clr-bg);
    padding: 2.5rem 3rem;
    margin: 2.5rem auto;
    width: 100%;
    max-width: 53.125rem;
    clip-path: polygon(
        1.2rem 0%,
        calc(100% - 1.2rem) 0%,
        100% 1.2rem,
        100% calc(100% - 1.2rem),
        calc(100% - 1.2rem) 100%,
        1.2rem 100%,
        0% calc(100% - 1.2rem),
        0% 1.2rem
    );
    outline: 1px solid rgba(252, 254, 243, 0.35);
    outline-offset: -1px;
    box-shadow:
        0 0 1.5rem rgba(252, 254, 243, 0.12),
        0 1.25rem 3rem rgba(0, 0, 0, 0.6);
    font-family: "Liberation Serif", "Times New Roman", serif;
    line-height: 1.7;
    font-size: 1rem;
    overflow: hidden;
}

.parchment::before,
.parchment::after {
    content: '';
    position: absolute;
    width: 1.5rem;
    height: 1.5rem;
    border-color: rgba(20, 27, 45, 0.4);
    border-style: solid;
    pointer-events: none;
}

.parchment::before {
    top: 0.5rem;
    left: 0.5rem;
    border-width: 0.125rem 0 0 0.125rem;
}

.parchment::after {
    bottom: 0.5rem;
    right: 0.5rem;
    border-width: 0 0.125rem 0.125rem 0;
}

.parchment h1, .parchment h2, .parchment h3 {
    color: var(--clr-bg);
    border-bottom: 1px solid rgba(20, 27, 45, 0.2);
    padding-bottom: 0.5rem;
    margin-top: 1.875rem;
    font-family: 'Special Elite', monospace;
    letter-spacing: 0.05em;
}

.parchment a {
    color: var(--clr-bg);
    text-decoration: none;
    border-bottom: 1px solid rgba(20, 27, 45, 0.4);
    transition: opacity 0.2s;
}

.parchment a:hover {
    opacity: 0.65;
    background: transparent;
}

.parchment code {
    background: rgba(20, 27, 45, 0.08);
    padding: 0.125rem 0.375rem;
    border-radius: 0.125rem;
    font-family: 'Special Elite', monospace;
    font-size: 0.95em;
    color: var(--clr-bg);
}

.parchment pre {
    background: rgba(20, 27, 45, 0.07);
    padding: 0.9375rem;
    overflow-x: auto;
    border-left: 0.1875rem solid rgba(20, 27, 45, 0.3);
    border-radius: 0;
}

@media (max-width: 37.5em) {
    .parchment {
        padding: 1.5rem 1.25rem;
        clip-path: polygon(
            0.75rem 0%,
            calc(100% - 0.75rem) 0%,
            100% 0.75rem,
            100% calc(100% - 0.75rem),
            calc(100% - 0.75rem) 100%,
            0.75rem 100%,
            0% calc(100% - 0.75rem),
            0% 0.75rem
        );
    }
}

.site-footer {
    text-align: center;
    padding: 1.875rem 1.25rem 1.25rem 1.25rem;
    font-size: 0.85rem;
    color: rgba(208, 216, 226, 0.4);
    font-family: "Liberation Serif", serif;
    letter-spacing: 0.09em;
    width: 80%;
    max-width: 50rem;
    margin: auto auto 0 auto;
    border-top: 1px solid rgba(208, 216, 226, 0.1);
}

.home-content {
    flex-grow: 1;
    max-width: 50rem;
    width: 100%;
    margin: 0 auto;
    padding: 3rem 2rem 4rem;
}

.home-section {
    padding: 2rem 0;
    border-bottom: 1px solid rgba(224, 248, 250, 0.07);
}

.home-section:last-child {
    border-bottom: none;
}

.home-heading {
    font-family: "Special Elite", monospace;
    font-size: 1rem;
    color: rgba(224, 248, 250, 0.45);
    letter-spacing: 0.1em;
    margin: 0 0 1.25rem 0;
    font-weight: normal;
}

.home-content p {
    font-family: "Liberation Serif", "Times New Roman", serif;
    font-size: 1rem;
    color: rgba(224, 248, 250, 0.85);
    line-height: 1.75;
    margin: 0.75rem 0;
}

.home-item {
    margin: 1rem 0 1.5rem 0;
}

.home-item-title {
    display: block;
    font-family: "Special Elite", monospace;
    font-size: 0.95rem;
    color: var(--clr-text);
    letter-spacing: 0.04em;
    margin-bottom: 0.2rem;
}

.home-item-meta {
    display: block;
    font-family: "Liberation Serif", serif;
    font-size: 0.8rem;
    color: rgba(224, 248, 250, 0.4);
    letter-spacing: 0.06em;
    margin-bottom: 0.4rem;
}

.home-item p {
    margin: 0.25rem 0 0 0;
    color: rgba(224, 248, 250, 0.7);
}

.home-stack-row {
    display: flex;
    gap: 1.5rem;
    align-items: baseline;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(224, 248, 250, 0.04);
    font-family: "Liberation Serif", serif;
    font-size: 0.9rem;
    color: rgba(224, 248, 250, 0.75);
}

.home-stack-label {
    font-family: "Special Elite", monospace;
    font-size: 0.75rem;
    color: rgba(224, 248, 250, 0.35);
    letter-spacing: 0.08em;
    min-width: 6rem;
    flex-shrink: 0;
}

@media (max-width: 37.5em) {
    .home-content {
        padding: 2rem 1.25rem 3rem;
    }

    .home-stack-row {
        flex-direction: column;
        gap: 0.25rem;
    }

    .home-stack-label {
        min-width: unset;
    }
}

.projects-hero {
    text-align: center;
    padding: 2.5rem 1.25rem 0.625rem;
    color: rgba(208, 216, 226, 0.6);
    font-family: "Liberation Serif", serif;
    letter-spacing: 0.125em;
    font-size: 0.85rem;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(18.75rem, 1fr));
    gap: 1.25rem;
    padding: 1.25rem 2.5rem 3.75rem;
    max-width: 68.75rem;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.project-card {
    background: rgba(13, 10, 32, 0.85);
    clip-path: polygon(
        1.5rem 0%,
        calc(100% - 1.5rem) 0%,
        100% 1.5rem,
        100% calc(100% - 1.5rem),
        calc(100% - 1.5rem) 100%,
        1.5rem 100%,
        0% calc(100% - 1.5rem),
        0% 1.5rem
    );
    padding: 1.75rem 2.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease, filter 0.3s ease;
    filter: drop-shadow(0 0 0.5rem rgba(224, 248, 250, 0.08)) drop-shadow(0 0 0 0.5px rgba(224, 248, 250, 0.15));
    position: relative;
}

.project-card:hover {
    transform: translateY(-0.3rem) scale(1.02);
    filter: drop-shadow(0 0 1.2rem rgba(224, 248, 250, 0.3)) drop-shadow(0 0 2.5rem rgba(224, 248, 250, 0.1));
}

.project-card-name {
    font-family: "Special Elite", serif;
    font-size: 1.1rem;
    color: var(--clr-text);
    letter-spacing: 0.06em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.project-card-name::before {
    content: '>';
    color: var(--clr-accent);
    font-family: "Liberation Serif", serif;
}

.project-card-desc {
    font-family: "Liberation Serif", serif;
    font-size: 0.9rem;
    color: rgba(224, 248, 250, 0.65);
    line-height: 1.5;
    flex-grow: 1;
}

.project-card-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-family: "Liberation Serif", serif;
    font-size: 0.8rem;
    color: rgba(224, 248, 250, 0.45);
}

.project-lang-dot {
    display: inline-block;
    width: 0.625rem;
    height: 0.625rem;
    border-radius: 50%;
    margin-right: 0.25rem;
    vertical-align: middle;
}

.project-lang {
    display: flex;
    align-items: center;
}

.project-stats {
    display: flex;
    gap: 0.75rem;
    margin-left: auto;
}

.project-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.project-topic-tag {
    font-family: "Special Elite", serif;
    font-size: 0.72rem;
    padding: 0.1875rem 0.5rem;
    border: 1px solid rgba(208, 216, 226, 0.2);
    border-radius: 1.25rem;
    color: rgba(208, 216, 226, 0.5);
    letter-spacing: 0.03em;
}

.projects-status {
    text-align: center;
    padding: 5rem 1.25rem;
    font-family: "Special Elite", serif;
    color: rgba(208, 216, 226, 0.4);
    letter-spacing: 0.125em;
    font-size: 0.95rem;
    width: 100%;
}

@media (max-width: 37.5em) {
    .projects-grid {
        padding: 1.25rem;
        grid-template-columns: 1fr;
    }
}

.project-header-band {
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 53.125rem;
    width: 100%;
    margin: 1.875rem auto 0;
    padding: 0 1.25rem;
    box-sizing: border-box;
}

.project-back-btn {
    font-family: "Special Elite", serif;
    font-size: 0.85rem;
    color: rgba(208, 216, 226, 0.5);
    text-decoration: none;
    letter-spacing: 0.06em;
    transition: color 0.2s;
    white-space: nowrap;
}

.project-back-btn:hover {
    color: rgba(208, 216, 226, 0.9);
}

.project-title-area {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.project-repo-name {
    font-family: "Special Elite", serif;
    font-size: 1.1rem;
    color: #fdfdfd;
    letter-spacing: 0.09em;
}

.project-repo-meta {
    font-family: "Liberation Serif", serif;
    font-size: 0.8rem;
    color: rgba(208, 216, 226, 0.4);
    letter-spacing: 0.06em;
    display: flex;
    align-items: center;
}

.project-repo-links {
    margin-left: auto;
    display: flex;
    gap: 0.75rem;
}

.project-link-btn {
    font-family: "Liberation Serif", serif;
    font-size: 0.8rem;
    color: rgba(208, 216, 226, 0.5);
    text-decoration: none;
    border: 1px solid rgba(208, 216, 226, 0.2);
    padding: 0.3125rem 0.75rem;
    border-radius: 0.25rem;
    transition: all 0.2s;
    white-space: nowrap;
}

.project-link-btn:hover {
    color: #fdfdfd;
    border-color: rgba(208, 216, 226, 0.5);
    background: rgba(208, 216, 226, 0.05);
}

.load-status {
    text-align: center;
    padding: 2.5rem 1.25rem;
    font-family: "Special Elite", serif;
    color: rgba(208, 216, 226, 0.4);
    letter-spacing: 0.125em;
    font-size: 0.9rem;
}

@keyframes blink {
    50% { opacity: 0; }
}

.blink {
    animation: blink 1s step-start infinite;
}

.parchment img {
    max-width: 100%;
    border-radius: 0.25rem;
}

.parchment table {
    border-collapse: collapse;
    width: 100%;
    margin: 1rem 0;
}

.parchment th,
.parchment td {
    border: 1px solid rgba(139, 69, 19, 0.3);
    padding: 0.5rem 0.75rem;
    text-align: left;
}

.parchment th {
    background: rgba(139, 69, 19, 0.08);
    font-weight: bold;
}

.parchment blockquote {
    border-left: 0.25rem solid rgba(139, 0, 0, 0.4);
    margin: 1rem 0;
    padding: 0.5rem 1rem;
    color: rgba(26, 5, 5, 0.7);
    font-style: italic;
}

.parchment ul,
.parchment ol {
    padding-left: 1.5rem;
}

.parchment li {
    margin: 0.25rem 0;
}

@media (max-width: 37.5em) {
    .project-header-band {
        flex-wrap: wrap;
        gap: 0.625rem;
    }

    .project-repo-links {
        margin-left: 0;
    }
}

.contact-container {
    padding: 5rem 2rem 3rem;
    font-family: "Special Elite", serif;
    color: var(--clr-text);
    letter-spacing: 0.07em;
    max-width: 40rem;
    margin: 0 auto;
}

.contact-header {
    font-size: 0.85rem;
    color: rgba(224, 248, 250, 0.4);
    letter-spacing: 0.12em;
    margin-bottom: 2.5rem;
}

.contact-line {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(224, 248, 250, 0.07);
}

.contact-prompt {
    color: rgba(224, 248, 250, 0.35);
    font-size: 0.9rem;
    flex-shrink: 0;
}

.contact-label {
    color: rgba(224, 248, 250, 0.55);
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    min-width: 5rem;
    flex-shrink: 0;
}

.contact-sep {
    color: rgba(224, 248, 250, 0.2);
    flex-shrink: 0;
}

.contact-link {
    color: var(--clr-text);
    text-decoration: none;
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    transition: text-shadow 0.3s ease, color 0.3s ease;
}

.contact-link:hover {
    text-shadow: 0 0 0.6rem rgba(224, 248, 250, 0.8), 0 0 1.2rem rgba(224, 248, 250, 0.4);
}

@media (max-width: 37.5em) {
    .contact-container {
        padding: 2.5rem 1rem 2rem;
    }

    .contact-header {
        font-size: 0.8rem;
        margin-bottom: 1.5rem;
    }

    .contact-line {
        flex-direction: column;
        gap: 0.25rem;
        padding: 0.875rem 0;
    }

    .contact-prompt {
        display: none;
    }

    .contact-sep {
        display: none;
    }

    .contact-label {
        min-width: unset;
        font-size: 0.75rem;
        text-transform: uppercase;
        color: rgba(224, 248, 250, 0.35);
    }

    .contact-link {
        font-size: 0.88rem;
        word-break: break-all;
        overflow-wrap: break-word;
    }
}
