body {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    background-color: #f0ead6;
    color: #0000ff;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    position: relative;
    overflow-x: hidden;
    background-image:
        linear-gradient(rgba(219, 35, 35, 0.05) 0.2mm, transparent 1mm),
        linear-gradient(90deg, rgba(0, 0, 139, 0.05) 0.1mm, transparent 0.1mm);
    background-size: 10mm 10mm;
    background-repeat: repeat;
}

@font-face {
    font-family: PPNeueBit;
    src: url("/static/fonts/PPMondwest-Regular.otf");
}

@font-face {
    font-family: duke;
    src: url("/static/fonts/Nowduke-Regular.woff");
}

h2 {
    font-family: PPNeueBit;
}


/* costume selected text*/
::selection {
    background: #0000ff;
    color: white;
}

header {
    text-align: center;
    background: #f0ead6;
    padding: 10px 0 1rem 0;
    width: 100%;
}

.header-content {
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
}

nav {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    background: #0000ff;
    z-index: 100;
    display: flex;
    justify-content: center;
}

.nav-content {
    width: 100vw;
    display: flex;
    justify-content: center;
    padding: 0 1rem;
    box-sizing: border-box;
}

main {
    width: 100%;
    box-sizing: border-box;
}

header.scrolled {
    box-shadow: 0 2px 8px rgba(0, 0, 255, 0.1);
}

.site-title {
    font-size: clamp(1.5rem, 5vw, 2rem);
    margin: 0;
    padding: 0;
    border: none;
}

.subtitle {
    margin: 0.5rem 0;
    font-size: clamp(0.9rem, 3vw, 1rem);
}

nav a {
    color: #f0ead6;
    text-decoration: none;
    font-weight: bold;
    padding: 0.25rem 0.75rem;
    border: 3px dotted transparent;
    transition: all 0.2s ease;
    text-align: center;
    min-width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

nav a.active {
    border: 2px solid #ffffff;
    padding: 0.25rem 0.75rem;
}

nav a:hover {
    text-decoration: none;
    border-color: #f0ead6;
    background: rgba(240, 234, 214, 0.1);
}

/* Responsive adjustments */
@media (max-width: 280px) {
    .nav-content {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
}


a {
    color: #0000ff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h2 {
    border-bottom: none;
    font-size: clamp(1.2rem, 4vw, 1.5rem);
}

h1 {
    border-bottom: none;
    font-size: clamp(1.7rem, 4vw, 1.5rem);
}

footer {
    margin-top: 0;
    padding: 3rem 0;
    text-align: center;
    font-size: clamp(0.8rem, 2.5vw, 0.9rem);
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.profile {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 20px;
}

.profile-image-container {
    flex-shrink: 0;
    /* Prevent the image from shrinking */
    border: 3px solid #0000ff;
    padding: 3px;
    background: #0000ff;
    max-width: 150px;
    /* Set a max width for the image container */
}

.profile-image-container img {
    max-width: 100%;
    /* Ensure the image fits within the container */
    height: auto;
    /* Maintain aspect ratio */
    object-fit: cover;
}

.profile-content {
    flex-direction: column;
    /* Stack text vertically */
    color: #0000ff;
    /* Text color */
}

.profile-facts {
    list-style-type: disc;
    /* Use native bullet points */
    padding-left: 20px;
    /* Indent bullet points */
    color: #0000ff;
    /* Text color */
}

@media (max-width: 768px) {
    .profile {
        flex-direction: column;
        /* Stack image and text on smaller screens */
        align-items: center;
        /* Center align items */
    }

    .profile-image-container {
        margin: 0 auto;
        /* Center the image */
        max-width: 90%;
        /* Allow the image container to be responsive */
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

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

    .profile-image-container {
        width: fit-content;
        margin: 0 auto;
        max-width: 95vw;
    }

    .profile img {
        width: clamp(200px, 70vw, 350px);
        height: clamp(200px, 70vw, 350px);
    }

    .profile-content {
        padding: 1rem 0;
        width: 100%;
        text-align: left;
    }
}

@media (min-width: 768px) {
    .profile-content {
        flex-direction: row;
        /* Align items in a row on larger screens */
    }
}

p {
    font-size: clamp(0.9rem, 3vw, 1rem);
}

#resolution,
#colorDepth {
    color: #0000ff;
    font-weight: bold;
}

* {
    box-sizing: border-box;

}

/* Global Custom Scrollbar Styling */
/* For Webkit browsers (Chrome, Safari) */
::-webkit-scrollbar {
    width: 12px;
    /* Vertical scrollbar width */
    height: 12px;
    /* Horizontal scrollbar height */
    background-color: rgba(0, 0, 255, 0.05);
    border: 1px solid #0000ff;
}

::-webkit-scrollbar-thumb {
    background-color: #0000ff;
    border: 2px solid #f0ead6;
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 255, 0.8);
}

::-webkit-scrollbar-track {
    background-color: #f0ead6;
    border: 1px solid #0000ff;
}

/* For Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #0000ff #f0ead6;
}

/* Retro button-like ends */
::-webkit-scrollbar-button:single-button {
    background-color: #f0ead6;
    border: 1px solid #0000ff;
    height: 12px;
    width: 12px;
}

::-webkit-scrollbar-button:vertical:decrement {
    /* Up button */
    border-radius: 4px 4px 0 0;
}

::-webkit-scrollbar-button:vertical:increment {
    /* Down button */
    border-radius: 0 0 4px 4px;
}

::-webkit-scrollbar-button:horizontal:decrement {
    /* Left button */
    border-radius: 4px 0 0 4px;
}

::-webkit-scrollbar-button:horizontal:increment {
    /* Right button */
    border-radius: 0 4px 4px 0;
}

/* Instagram-like Feed Layout */
.posters-grid {
    color: #0000FF;
    display: flex;
    flex-direction: column;
    gap: 40px;
    /* Increased gap between posts */
    max-width: 600px;
    /* Instagram-like width */
    width: 100%;
    margin: 0 auto;
    padding: 20px;
    scroll-behavior: smooth;
    /* Smooth scrolling */
    background-color: transparent;
    /* Make background transparent to show grid */
}

.poster-item {
    width: 100%;
    background: #f0ead6;
    border: 3px solid #0000ff;
    transform: translateY(20px);
    /* Start slightly below */
    box-shadow: 9px 9px 4px rgba(0, 0, 255, 0.2);
    /* Subtle shadow */
}

/* Fade in animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.poster-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    cursor: pointer;
    background: #f0ead6;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px
        /* Minimum height while loading */
}

.music-player {
    width: 100%;
    justify-content: center;
    position: flex;
    bottom: 0;
    left: 0;
    background: #0000ff;
    z-index: 100;
    display: flex;
}

.music-content {
    width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 0 1rem;
    box-sizing: border-box;
    color: #f0ead6;
    /* Light text color for better contrast on blue background */
}

.music-content button {
    background: transparent;
    border: none;
    color: #f0ead6;
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1rem;
}

.music-content button:hover {
    opacity: 0.8;
}

.music-content button[aria-label="Pause"] {
    display: none;
    /* Initially hidden */
}

.footer-gif {
    height: 30px;
    margin-right: 1rem;
}

.song-info {
    margin-left: 1rem;
    font-size: 0.9rem;
}

/* Add this to ensure the footer doesn't overlap your content */



.poster-container img {
    max-width: 100%;
    width: auto;
    height: auto;
    max-height: 80vh;
    object-fit: contain;
    display: block;
    transition: transform 0.3s ease;
}

.poster-container:hover img {
    transform: scale(1.02);
    /* Subtle zoom on hover */
}

.poster-info {
    padding: 15px;
    border-top: 3px solid #0000ff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* New: Stack download + resolution vertically on the right */
.poster-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.2;
}

.poster-resolution {
    color: #0000ff;
    margin: 4px 0 0;
    font-size: 0.85rem;
}

.poster-filename {
    color: #0000ff;
    margin: 0;
    font-size: 0.9rem;
    flex-grow: 1;
}

.download-button {
    color: #0000ff;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border: 2px solid #0000ff;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    display: inline-block;
    white-space: nowrap;
}

.download-button:hover {
    background: #0000ff;
    color: #f0ead6;
    text-decoration: none;
}

/* Lazy loading animation */
.poster-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(0, 0, 255, 10),
            transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    from {
        left: -100%;
    }

    to {
        left: 100%;
    }
}

/* Hide loading animation when image is loaded */
.poster-container.loaded::before {
    display: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .posters-grid {
        padding: 10px;
        gap: 0;
        /* Instagram-like scroll snapping */
        scroll-snap-type: y mandatory;
        overflow-y: scroll;
        height: 100vh;
        scroll-padding-top: 10px;
    }

    .poster-item {
        scroll-snap-align: start;
        scroll-snap-stop: always;
        margin-bottom: 20px;
    }
}

@media (max-width: 480px) {
    .posters-grid {
        padding: 5px;
        gap: 0;
        scroll-snap-type: y mandatory;
        overflow-y: scroll;
        height: 100vh;
    }

    .poster-item {
        scroll-snap-align: start;
        scroll-snap-stop: always;
        margin-bottom: 15px;
    }
}

/* Add these styles for the modal */
/* Modern Gallery Modal styles - replaced old modal styles */
.g-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    z-index: 2000;
    flex-direction: column;
}

.g-modal.active {
    display: flex;
}

.g-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(240, 234, 214, 0.98);
    background-image: radial-gradient(rgba(0, 0, 255, 0.2) 1px, transparent 1px);
    background-size: 20px 20px;
    backdrop-filter: blur(5px);
}

.g-modal-top {
    position: relative;
    width: 100%;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 2002;
    color: #0000ff;
    background: linear-gradient(to bottom, rgba(240, 234, 214, 0.8), transparent);
}

.g-modal-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.g-title {
    font-family: PPNeueBit;
    font-size: 1.5rem;
}

.g-counter {
    font-size: 0.8rem;
    opacity: 0.7;
}

.g-close {
    background: transparent;
    border: 2px solid #0000ff;
    color: #0000ff;
    font-size: 2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.g-close:hover {
    background: #0000ff;
    color: #f0ead6;
}

.g-modal-main {
    position: relative;
    flex: 1;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2001;
    padding: 0 80px;
    /* Space for nav arrows */
    overflow: hidden;
}

.g-image-wrap {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

#gModalImg {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    transition: opacity 0.3s ease;
    border: 1px solid #0000ff;
}

.g-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 255, 0.1);
    border: 2px solid #0000ff;
    color: #0000ff;
    font-size: 2rem;
    padding: 1rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    z-index: 2003;
}

.g-nav:hover {
    background: #0000ff;
    color: #f0ead6;
}

.g-nav.prev {
    left: 20px;
}

.g-nav.next {
    right: 20px;
}

.g-modal-bottom {
    position: relative;
    width: 100%;
    padding: 1.5rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    z-index: 2002;
    background: linear-gradient(to top, rgba(240, 234, 214, 0.8), transparent);
}

.g-meta-display {
    display: flex;
    gap: 1rem;
    color: #0000ff;
    font-size: 0.9rem;
}

.g-meta-item {
    background: rgba(0, 0, 255, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
}

.g-dl-btn {
    background: #0000ff;
    color: #f0ead6;
    padding: 0.8rem 2rem;
    text-decoration: none;
    font-weight: bold;
    border-radius: 4px;
    transition: transform 0.2s ease;
}

.g-dl-btn:hover {
    transform: scale(1.05);
    background: transparent;
    color: #0000ff;
    border: 2px solid #0000ff;
}

.g-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 255, 0.3);
    border-top-color: #0000ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    position: absolute;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 1024px) {
    .g-modal-main {
        padding: 0 10px;
    }

    .g-nav {
        background: rgba(0, 0, 0, 0.5);
        padding: 0.8rem;
        font-size: 1.5rem;
    }

    .g-nav.prev {
        left: 10px;
    }

    .g-nav.next {
        right: 10px;
    }
}

/* Posters Gallery v2 */
.gallery-header {
    margin-bottom: 3rem;
    text-align: center;
}

.gallery-subtitle {
    color: #0000ff;
    opacity: 0.8;
    margin-top: 0.5rem;
}

.posters-grid-v2 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    padding: 1rem 0;
}

.poster-card {
    background: #f0ead6;
    border: 2px solid #0000ff;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.poster-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 255, 0.1);
}

.poster-preview {
    position: relative;
    aspect-ratio: 3/4;
    overflow: hidden;
    background: #eee;
}

.poster-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.poster-card:hover .poster-preview img {
    transform: scale(1.05);
}

.poster-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.poster-card:hover .poster-overlay {
    opacity: 1;
}

.view-label {
    color: #f0ead6;
    background: #0000ff;
    padding: 0.5rem 1rem;
    font-family: PPNeueBit;
    font-size: 1.2rem;
    transform: translateY(10px);
    transition: transform 0.3s ease;
}

.poster-card:hover .view-label {
    transform: translateY(0);
}

.poster-details {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.poster-name {
    margin: 0;
    font-size: 1.1rem;
    color: #0000ff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.poster-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.meta-tag {
    font-size: 0.75rem;
    padding: 2px 8px;
    border: 1px solid #0000ff;
    color: #0000ff;
    border-radius: 2px;
}

.meta-tag.res {
    background: rgba(0, 0, 255, 0.05);
}

.poster-footer {
    margin-top: 0.5rem;
}

.dl-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #f0ead6;
    background: #0000ff;
    padding: 0.6rem 1.2rem;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: bold;
    transition: all 0.2s ease;
}

.dl-btn:hover {
    background: #3333ff;
    transform: scale(1.02);
}

@media (max-width: 600px) {
    .posters-grid-v2 {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* Password Modal Themed Styles */
.pw-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    font-family: 'PPNeueBit', 'duke', ui-monospace, monospace;
}

.pw-modal-box {
    background: #fffbe6;
    padding: 2.5em 2em 2em 2em;
    border-radius: 12px;
    box-shadow: 0 4px 24px #000a, 0 0 0 2px #0000ff44;
    border: 2px solid #0000ff;
    min-width: 320px;
    max-width: 90vw;
    text-align: center;
}

.pw-label {
    font-family: 'PPNeueBit', 'duke', monospace;
    color: #0000ff;
    font-size: 1.1em;
    letter-spacing: 0.04em;
}

.pw-input {
    margin-top: 1em;
    padding: 0.6em 1em;
    border: 2px solid #0000ff;
    border-radius: 6px;
    background: #f0ead6;
    color: #b00;
    font-family: 'duke', ui-monospace, monospace;
    font-size: 1.1em;
    outline: none;
    box-shadow: 0 0 0 2px #0000ff22;
    transition: border 0.2s, box-shadow 0.2s;
}

.pw-input:focus {
    border: 2px solid #b00;
    box-shadow: 0 0 0 3px #b002;
    background: #fff;
}

.pw-btn,
.pw-btn-alt {
    margin-top: 1.2em;
    padding: 0.5em 1.2em;
    border: none;
    border-radius: 6px;
    font-family: 'PPNeueBit', 'duke', monospace;
    font-size: 1em;
    background: #0000ff;
    color: #fff;
    cursor: pointer;
    margin-right: 0.7em;
    box-shadow: 0 2px 8px #0002;
    transition: background 0.2s, color 0.2s;
}

.pw-btn-alt {
    background: #fff;
    color: #0000ff;
    border: 2px solid #0000ff;
}

.pw-btn:hover,
.pw-btn-alt:hover {
    background: #b00;
    color: #fff;
}

.pw-hint {
    color: #b00;
    margin-top: 1.2em;
    font-family: 'duke', monospace;
    font-size: 1em;
}

.pw-error {
    color: #b00;
    margin-top: 0.7em;
    font-family: 'duke', monospace;
    font-size: 1em;
}

/* Writeups List Styling */
.writeups-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.writeup-item {
    border: 2px solid #0000ff;
    padding: 1rem;
    transition: background-color 0.3s ease;
}

.writeup-item:hover {
    background-color: #0000ff;
}

.writeup-item:hover .writeup-title,
.writeup-item:hover .writeup-date {
    color: #f0ead6;
}

.writeup-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none;
}

.writeup-title {
    color: #0000ff;
    font-size: 1.1rem;
}

.writeup-date {
    color: #0000ff;
    font-size: 0.9rem;
}

/* Individual Writeup Styling */
.writeup-container {
    width: 100%;
    max-width: 800px;
    /* Match body max-width */
    margin: 0 auto;
    box-sizing: border-box;
    overflow: visible;
}

.writeup-content {
    margin-top: 2rem;
    line-height: 1.6;
    overflow: visible;
}


/* Code block styling */
.writeup-content pre {
    background: rgba(0, 0, 255, 0.05);
    border: 2px solid #0000ff;
    color: #0000ff;
    padding: 1rem;
    margin: 1.5rem 0;
    border-radius: 4px;
    font-size: inherit;
    /* use same size as normal text */
    line-height: inherit;
    /* match text line height */
    position: relative;
    width: 100%;
    box-sizing: border-box;
    white-space: pre;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 10px;
    -webkit-overflow-scrolling: touch;
}

/* Ensure all code elements use the same size as surrounding text */
.writeup-content pre,
.writeup-content .highlight,
.writeup-content pre code,
.writeup-content :not(pre)>code {
    font-size: inherit;
    /* match normal text size */
    line-height: inherit;
}

/* Inline code everywhere (not just in paragraphs), but not inside pre */
.writeup-content :not(pre)>code {
    background: rgba(0, 0, 255, 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    border: 1px solid #0000ff;
    white-space: normal;
    word-break: break-word;
    color: #0000ff;
    font-size: inherit;
    /* match normal text */
    line-height: inherit;
}

/* Pygments/highlight container should also inherit normal text size */
.highlight {
    margin: 0;
    padding: 0.5rem;
    overflow-x: auto;
    background: #f0ead6;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: inherit;
    /* match normal text */
    line-height: inherit;
    position: relative;
    /* For copy button */
}

.copy-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #0000ff;
    color: #f0ead6;
    border: 1px solid #f0ead6;
    border-radius: 3px;
    font-size: 0.75rem;
    padding: 2px 6px;
    cursor: pointer;
    opacity: 0.4;
    transition: all 0.2s;
    font-family: ui-monospace, monospace;
    z-index: 10;
}

.copy-btn:hover {
    opacity: 1;
    background: #0000aa;
}

.copy-btn.copied {
    background: #008000;
    border-color: #008000;
}




@media (max-width: 768px) {

    /* Set a base font size for the whole writeup so code inherits it */
    .writeup-content {
        font-size: clamp(0.9rem, 3vw, 1rem);
    }

    /* Reinforce inheritance on mobile to override any lingering rules */
    .writeup-content pre,
    .writeup-content .highlight,
    .writeup-content pre code,
    .writeup-content :not(pre)>code {
        font-size: inherit !important;
        line-height: inherit;
    }
}

@media (max-width: 480px) {
    .writeup-container {
        padding: 0 10px;
    }

    .writeup-content pre {
        margin: 1rem -10px;
        width: calc(100% + 20px);
    }
}

/* Ensure content doesn't overflow */
.writeup-container {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    padding: 0 10px;
    box-sizing: border-box;
    overflow: visible;
}

/* Handle long URLs and text */
.writeup-content {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.writeup-content img {
    max-width: 100%;
    height: auto;
}

/* Adjust table display on mobile */
.writeup-content table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Add spacing between consecutive code blocks */
.writeup-content pre+pre {
    margin-top: 2rem;
}

/* Ensure headers don't break code block flow */
.writeup-content h1,
.writeup-content h2,
.writeup-content h3,
.writeup-content h4 {
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
    clear: both;
    /* Prevent floating elements */
}

/* Add spacing after paragraphs */
.writeup-content p {
    margin-bottom: 1.5rem;
    clear: both;
    /* Prevent floating elements */
}

/* Numbered lists containing code blocks */
.writeup-content ol {
    margin: 2rem 0;
    padding-left: 2.5rem;
}

.writeup-content ol li {
    margin-bottom: 2rem;
    /* Space between list items */
}

/* Language badge for code blocks */
.writeup-content pre::before {
    content: attr(class);
    position: absolute;
    top: -12px;
    right: 10px;
    background: #0000ff;
    color: #f0ead6;
    padding: 2px 8px;
    font-size: 0.8rem;
    border-radius: 3px;
    opacity: 0.8;
}

/* Ensure code blocks in lists are properly spaced */
.writeup-content li pre {
    margin: 1rem 0;
}

/* Prevent text wrapping around code blocks */
.writeup-content pre,
.writeup-content .highlight {
    clear: both;
    display: block;
    width: 100%;
}

.writeup-content code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    color: #0000ff;
    /* Inline code color */
}

.writeup-content ul,
.writeup-content ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.writeup-content img {
    max-width: 100%;
    height: auto;
    margin: 1rem 0;
}

/* Line numbers */
.writeup-content .linenums {
    padding-left: 2.5rem;
    color: #666666;
    margin: 0;
}

.writeup-content .linenums li {
    list-style-type: decimal;
    color: #666666;
}

/* Syntax highlighting */
.writeup-content .highlight {
    background: transparent;
}

.writeup-content .highlight .k {
    color: #0000ff;
    font-weight: bold;
}

/* Keyword */
.writeup-content .highlight .s {
    color: #006400;
}

/* String */
.writeup-content .highlight .n {
    color: #000080;
}

/* Name */
.writeup-content .highlight .p {
    color: #0000ff;
}

/* Punctuation */
.writeup-content .highlight .o {
    color: #0000ff;
}

/* Operator */
.writeup-content .highlight .c {
    color: #666666;
    font-style: italic;
}

/* Comment */
.writeup-content .highlight .nb {
    color: #800080;
}

/* Built-in */
.writeup-content .highlight .nf {
    color: #000080;
    font-weight: bold;
}

/* Function */
.writeup-content .highlight .mi {
    color: #800000;
}

/* Number */
.writeup-content .highlight .s1 {
    color: #006400;
}

/* Single quotes */
.writeup-content .highlight .s2 {
    color: #006400;
}

/* Double quotes */
.writeup-content .highlight .kc {
    color: #0000ff;
    font-weight: bold;
}

/* Constant */
.writeup-content .highlight .kd {
    color: #0000ff;
    font-weight: bold;
}

/* Declaration */

/* Language-specific highlighting */
.writeup-content .language-python .highlight {
    color: #000080;
    /* Default color for Python */
}

.writeup-content .language-bash .highlight {
    color: #006400;
    /* Default color for Bash */
}

.writeup-content .language-matlab .highlight {
    color: #800000;
    /* Default color for MATLAB */
}

/* Mermaid diagrams */
.writeup-content .mermaid {
    background: #f0ead6;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 4px;
    border: 2px solid #0000ff;
}

.writeup-content .mermaid svg {
    max-width: 100%;
    height: auto;
}

/* Inline code */
.writeup-content p code {
    background: rgba(0, 0, 255, 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    border: 1px solid #0000ff;
    white-space: normal;
    /* Allow inline code to wrap */
    word-break: break-word;
}

/* Pygments syntax highlighting */
.highlight .hll {
    background-color: rgba(0, 0, 255, 0.1)
}

.highlight .c {
    color: #666666;
    font-style: italic
}

/* Comment */
.highlight .err {
    color: #FF0000
}

/* Error */
.highlight .k {
    color: #0000ff;
    font-weight: bold
}

/* Keyword */
.highlight .o {
    color: #0000ff
}

/* Operator */
.highlight .ch {
    color: #666666;
    font-style: italic
}

/* Comment.Hashbang */
.highlight .cm {
    color: #666666;
    font-style: italic
}

/* Comment.Multiline */
.highlight .cp {
    color: #666666
}

/* Comment.Preproc */
.highlight .cpf {
    color: #666666;
    font-style: italic
}

/* Comment.PreprocFile */
.highlight .c1 {
    color: #666666;
    font-style: italic
}

/* Comment.Single */
.highlight .cs {
    color: #666666;
    font-weight: bold
}

/* Comment.Special */
.highlight .gd {
    color: #A00000
}

/* Generic.Deleted */
.highlight .ge {
    font-style: italic
}

/* Generic.Emph */
.highlight .gr {
    color: #FF0000
}

/* Generic.Error */
.highlight .gh {
    color: #000080;
    font-weight: bold
}

/* Generic.Heading */
.highlight .gi {
    color: #00A000
}

/* Generic.Inserted */
.highlight .go {
    color: #888888
}

/* Generic.Output */
.highlight .gp {
    color: #000080;
    font-weight: bold
}

/* Generic.Prompt */
.highlight .gs {
    font-weight: bold
}

/* Generic.Strong */
.highlight .gu {
    color: #800080;
    font-weight: bold
}

/* Generic.Subheading */
.highlight .gt {
    color: #0044DD
}

/* Generic.Traceback */
.highlight .kc {
    color: #0000ff;
    font-weight: bold
}

/* Keyword.Constant */
.highlight .kd {
    color: #0000ff;
    font-weight: bold
}

/* Keyword.Declaration */
.highlight .kn {
    color: #0000ff;
    font-weight: bold
}

/* Keyword.Namespace */
.highlight .kp {
    color: #0000ff
}

/* Keyword.Pseudo */
.highlight .kr {
    color: #0000ff;
    font-weight: bold
}

/* Keyword.Reserved */
.highlight .kt {
    color: #0000ff
}

/* Keyword.Type */
.highlight .m {
    color: #666666
}

/* Literal.Number */
.highlight .s {
    color: #006400
}

/* Literal.String */
.highlight .na {
    color: #7D9029
}

/* Name.Attribute */
.highlight .nb {
    color: #800080
}

/* Name.Builtin */
.highlight .nc {
    color: #0000FF;
    font-weight: bold
}

/* Name.Class */
.highlight .no {
    color: #880000
}

/* Name.Constant */
.highlight .nd {
    color: #AA22FF
}

/* Name.Decorator */
.highlight .ni {
    color: #999999;
    font-weight: bold
}

/* Name.Entity */
.highlight .ne {
    color: #D2413A;
    font-weight: bold
}

/* Name.Exception */
.highlight .nf {
    color: #0000FF
}

/* Name.Function */
.highlight .nl {
    color: #A0A000
}

/* Name.Label */
.highlight .nn {
    color: #0000FF;
    font-weight: bold
}

/* Name.Namespace */
.highlight .nt {
    color: #0000ff;
    font-weight: bold
}

/* Name.Tag */
.highlight .nv {
    color: #19177C
}

/* Name.Variable */
.highlight .w {
    color: #bbbbbb
}

/* Text.Whitespace */

/* LaTeX/MathJax styling */
.MathJax {
    color: #0000ff !important;
    font-size: 1.1em !important;
}

/* Display math (centered equations) */
.writeup-content .math {
    overflow-x: auto;
    margin: 2rem 0;
    padding: 1rem 0;
    text-align: center;
    overflow: visible;
}

/* Inline math */
.writeup-content p .MathJax {
    max-width: 100%;
    overflow-x: auto;
    vertical-align: middle;
    margin: 0 0.2em;
    overflow: visible;
}

/* Vector arrows */
.MathJax .vec {
    font-weight: bold;
}

/* Video styling */
.writeup-content video {
    max-width: 100%;
    height: auto;
    margin: 1rem 0;
    border: 2px solid #0000ff;
    border-radius: 4px;
    background: rgba(0, 0, 255, 0.05);
}

.writeup-content video:focus {
    outline: none;
    border-color: #0000ff;
    box-shadow: 0 0 0 2px rgba(0, 0, 255, 0.2);
}

/* Custom Scrollbar Styling - Only for code blocks */
/* For Webkit browsers (Chrome, Safari) */
.writeup-content pre::-webkit-scrollbar {
    display: block;
    height: 12px;
    background-color: rgba(0, 0, 255, 0.05);
    border: 1px solid #0000ff;
    border-radius: 6px;
}

.writeup-content pre::-webkit-scrollbar-thumb {
    background-color: #0000ff;
    border: 2px solid #f0ead6;
}

.writeup-content pre::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 255, 0.8);
}

.writeup-content pre::-webkit-scrollbar-track {
    background-color: #f0ead6;
}

/* For Firefox */
.writeup-content pre {
    scrollbar-width: thin;
}

/* Retro button-like ends */
.writeup-content pre::-webkit-scrollbar-button:single-button {
    display: block;
    background-color: #f0ead6;
    border: 1px solid #0000ff;
    height: 12px;
    width: 12px;
}

.writeup-content pre::-webkit-scrollbar-button:single-button:horizontal:decrement {
    border-radius: 4px 0 0 4px;
}

.writeup-content pre::-webkit-scrollbar-button:single-button:horizontal:increment {
    border-radius: 0 4px 4px 0;
}

/* Update other scrollable elements to use overflow: visible instead */
.writeup-content {
    overflow: visible;
}

.writeup-container {
    overflow: visible;
}

.writeup-content .math {
    overflow: visible;
}

.writeup-content p .MathJax {
    overflow: visible;
}

/* Only allow horizontal scroll on code blocks */
.writeup-content pre {
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 15px;
    /* Make room for scrollbar */
}

/* Visitor counter styling */
.visitor-count {
    font-weight: bold;
    color: #0000ff;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.code-wrapper {
    position: relative;
    margin: 1rem 0;
    background: #f0ead6;
    border-radius: 4px;
    border: 2px solid #0000ff;
    padding: 0.5rem;
}

.highlight {
    margin: 0;
    padding: 0.5rem;
    overflow-x: auto;
    background: #f0ead6;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: inherit;
    /* match normal text */
    line-height: inherit;
}

.highlight pre {
    margin: 0;
    white-space: pre;
    word-wrap: normal;
    background: transparent;
}

/* Line numbers styling */
.highlight .linenodiv pre {
    color: #666;
    border-right: 1px solid #0000ff;
    margin-right: 0.5em;
    padding-right: 0.5em;
}

/* Custom scrollbar for webkit browsers */
.highlight::-webkit-scrollbar {
    height: 12px;
    /* Increased height */
    background-color: #f0ead6;
    border: 1px solid #0000ff;
    border-radius: 6px;
}

.highlight::-webkit-scrollbar-thumb {
    background-color: #0000ff;
    border: 2px solid #f0ead6;
    /* Border to create padding effect */
    border-radius: 6px;
}

.highlight::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 255, 0.8);
}

.highlight::-webkit-scrollbar-track {
    background-color: #f0ead6;
    border: 1px solid #0000ff;
    border-radius: 6px;
}

/* Retro button-like ends */
.highlight::-webkit-scrollbar-button:single-button {
    background-color: #f0ead6;
    border: 1px solid #0000ff;
    height: 12px;
    width: 12px;
}

.highlight::-webkit-scrollbar-button:horizontal:decrement {
    /* Left button */
    border-radius: 6px 0 0 6px;
}

.highlight::-webkit-scrollbar-button:horizontal:increment {
    /* Right button */
    border-radius: 0 6px 6px 0;
}

/* For Firefox */
.highlight {
    scrollbar-width: thin;
    scrollbar-color: #0000ff #f0ead6;
}

/* Add some bottom padding to accommodate the scrollbar */
.code-wrapper {
    padding-bottom: 0.8rem;
    /* Increased to make room for stylish scrollbar */
}

/* Ensure code doesn't overflow on mobile */
@media (max-width: 768px) {
    .highlight {
        max-width: 100%;
        /* Changed from 100vw */
        margin: 0;
        /* Remove negative margins */
        border-radius: 4px;
        /* Keep border radius */
    }

    .code-wrapper {
        margin: 1rem 0;
        /* Remove negative margins */
        border-radius: 4px;
        /* Keep border radius */
        width: 100%;
        overflow-x: auto;
    }

    /* Ensure scrollbar styling remains on mobile */
    .highlight::-webkit-scrollbar {
        display: block !important;
        /* Force display scrollbar */
        height: 12px !important;
        -webkit-overflow-scrolling: touch;
    }

    /* Ensure proper touch behavior */
    .highlight {
        -webkit-overflow-scrolling: touch;
        overflow-x: auto;
    }
}

/* Add specific iOS WebKit styling */
@supports (-webkit-touch-callout: none) {
    .highlight {
        -webkit-overflow-scrolling: touch;
    }
}

.footer-gif {
    height: 30px;
    padding: 5px;
    width: auto;
    /* Remove fixed width to maintain aspect ratio */
    margin: 5px 0;
    background: #000fff;
    /* Add vertical margin */
}

/* Retro buttons and layout cleanup */

.retro-button {
    display: inline-block;
    padding: 10px 20px;
    text-align: center;
    white-space: nowrap;
    border: 2px solid #0000ff;
    background-color: #f0ead6;
    color: #0000ff;
    font-family: 'MS Sans Serif', sans-serif;
    font-size: 16px;
    box-shadow: 2px 2px 0 #808080;
    cursor: pointer;
    margin: 0 auto;
    transition: all 0.1s ease-in-out;
}

.retro-button:hover {
    background-color: #e0e0e0;
    box-shadow: 1px 1px 0 #808080;
}

.paper-margins {
    position: relative;
    padding: 0 15px;
    border-left: 2px dashed #0000ff;
    border-right: 2px dashed #0000ff;
}

.scrolling-text {
    font-family: PPNeueBit;
    background-color: #0000ff;
    overflow: hidden;
    white-space: nowrap;
    box-sizing: border-box;
    width: 100vw;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    font-size: 21rem !important;
    font-weight: bold;
    line-height: 1;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    z-index: 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.scrolling-text p {
    font-family: PPNeueBit;
    font-size: 3rem !important;
    display: inline-block;
    padding-left: 100%;
    animation: scroll-text 100s linear infinite;
    margin-top: 0px !important;
    margin-bottom: 0px !important;
    z-index: 0;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    background-image:
        linear-gradient(rgba(219, 35, 35, 0.05) 0.2mm, transparent 1mm),
        linear-gradient(90deg, rgba(0, 0, 139, 0.05) 0.1mm, transparent 0.1mm);
    background-size: 10mm 10mm;
    background-color: #f0ead6;
    background-attachment: fixed;
}

.scrolling-text p::selection {
    font-size: 3rem !important;
    display: inline-block;
    padding-left: 100%;
    animation: scroll-text 100s linear infinite;
    margin-top: 0px !important;
    margin-bottom: 0px !important;
    z-index: 0;
    background: yellow;
    color: black;

}

@keyframes scroll-text {
    0% {
        transform: translateX(0%);
    }

    100% {
        transform: translateX(-100%);
    }
}












.guestbook-title,
.entries-title {
    color: #0000ff;
    text-align: center;
    margin-top: 20px;
    font-family: 'MS Sans Serif', Geneva, sans-serif;
}

.guestbook-form {
    max-width: 600px;
    margin: 20px auto;
    padding: 20px;
    border: 2px solid #0000ff;
    border-radius: 2px;
    background-color: #f0ead6;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
    font-family: 'MS Sans Serif', Geneva, sans-serif;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
    font-family: 'MS Sans Serif', Geneva, sans-serif;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #0000ff;
    border-radius: 2px;
    background-color: #f0ead6;
    font-family: 'MS Sans Serif', Geneva, sans-serif;
}

.submit-button {
    display: block;
    width: 100%;
    padding: 10px;
    background-color: #f0ead6;
    color: #0000FF;
    border: dotted;
    border-radius: 2px;
    font-size: 16px;
    cursor: pointer;
    font-family: 'MS Sans Serif', Geneva, sans-serif;

}

.submit-button:hover {
    background-color: #0000ff;
    color: white;
}

.entries-container {
    max-width: 600px;
    margin: 20px auto;
}

.entry-box {
    background-color: #f0ead6;
    border: 2px solid #0000ff;
    border-radius: 2px;
    padding: 10px;
    margin-bottom: 10px;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
    font-family: 'MS Sans Serif', Geneva, sans-serif;
}

.entry-header {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #000000;
    margin-bottom: 5px;
    padding-bottom: 5px;
}

.entry-timestamp {
    color: #0000ff;
    font-size: 12px;
}

.entry-message {
    margin-top: 5px;
}

.guestbook-button {
    position: relative;
    background: linear-gradient(90deg, #0000ff 50%, transparent 50%),
        linear-gradient(90deg, #0000ff 50%, transparent 50%),
        linear-gradient(0deg, #0000ff 50%, transparent 50%),
        linear-gradient(0deg, #0000ff 50%, transparent 50%);
    background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;
    background-size: 10px 2px, 10px 2px, 2px 10px, 2px 10px;
    background-position: 0% 0%, 100% 100%, 0% 100%, 100% 0%;
    animation: dotted-border-dance 20s infinite linear;
}

@keyframes dotted-border-dance {
    0% {
        background-position: 0% 0%, 100% 100%, 0% 100%, 100% 0%;
    }

    25% {
        background-position: 25% 0%, 75% 100%, 0% 75%, 100% 25%;
    }

    50% {
        background-position: 50% 0%, 50% 100%, 0% 50%, 100% 50%;
    }

    75% {
        background-position: 75% 0%, 25% 100%, 0% 25%, 100% 75%;
    }

    100% {
        background-position: 100% 0%, 0% 100%, 0% 0%, 100% 100%;
    }
}

/* Globe Container - Moved from globe.css */
#globe-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
    opacity: 0;
    transition: opacity 1.5s ease-in;
}

#globe-container.loaded {
    opacity: 1;
}


/* Ensure helper remains cleanly hidden */
#gModalImg {
    cursor: crosshair;
    /* Indicate zoom availability */
}

/* Pyramid Container for Writeups Page */
#pyramid-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
    opacity: 0;
    transition: opacity 1.5s ease-in;
}

#pyramid-container.loaded {
    opacity: 1;
}