/* Base styles */
html, body {
    margin: 0;
    padding: 0;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    background: 
        linear-gradient(217deg, rgba(255, 0, 0, 0.8), rgba(255, 0, 0, 0) 70.71%),
        linear-gradient(127deg, rgba(0, 255, 0, 0.8), rgba(0, 255, 0, 0) 70.71%),
        linear-gradient(336deg, rgba(0, 0, 255, 0.8), rgba(0, 0, 255, 0) 70.71%);
    font-family: 'Orbitron', sans-serif;
    color: #fff;
    perspective: 1000px;
    box-sizing: border-box;
}

@font-face {
    font-family: 'Orbitron';
    src: url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&display=swap');
}

/* Registration marks - make them scale with screen size */
.registration-mark {
    position: fixed;
    width: min(20px, 3vw);
    height: min(20px, 3vw);
    pointer-events: none;
    z-index: 20;
}

.registration-mark::before,
.registration-mark::after {
    content: "";
    position: absolute;
    background-color: #000;
}

.registration-mark::before {
    width: 100%;
    height: 10%;
    top: 45%;
    left: 0;
}

.registration-mark::after {
    width: 10%;
    height: 100%;
    top: 0;
    left: 45%;
}

.registration-mark-tl {
    top: 1vh;
    left: 1vw;
}

.registration-mark-tr {
    top: 1vh;
    right: 1vw;
}

.registration-mark-bl {
    bottom: 1vh;
    left: 1vw;
}

.registration-mark-br {
    bottom: 1vh;
    right: 1vw;
}

/* Center registration mark - fully responsive */
.registration-mark-center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(30px, 4vw);
    height: min(30px, 4vw);
    z-index: 4; /* Lower z-index to position behind frames (frames have z-index 5) */
}

.registration-mark-center::before {
    width: 30px;
    left: -5px;
}

.registration-mark-center::after {
    height: 30px;
    top: -5px;
}

/* Color swatches - repositioned to upper left */
.color-swatches {
    position: fixed;
    top: 3vh;
    left: 3vw;
    display: flex;
    gap: min(3px, 0.6vw);
    padding: min(3px, 0.6vw);
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    z-index: 20;
    cursor: pointer;
}

.color-swatch {
    width: min(15px, 2.5vw);
    height: min(15px, 2.5vw);
    border: 1px solid #fff;
}

.swatch-c { background-color: #00FFFF; cursor: pointer; }
.swatch-m { background-color: #FF00FF; cursor: pointer; }
.swatch-y { background-color: #FFFF00; cursor: pointer; }
.swatch-k { background-color: #000000; cursor: pointer; }

/* Add a hover effect for better UX */
.color-swatch:hover {
    transform: scale(1.1);
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
    transition: all 0.2s ease;
}

/* Print marks/text - more responsive */
.print-marks {
    position: fixed;
    font-family: monospace;
    font-size: clamp(6px, 1vw, 8px);
    color: rgba(255, 255, 255, 0.5);
    z-index: 20;
    pointer-events: none;
    user-select: none;
}

.print-marks-top {
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
}

.print-marks-bottom {
    bottom: 5px;
    right: 40px;
}

/* Typesetting artifacts */
.misaligned-text {
    position: relative;
}

.misaligned-text::before {
    content: attr(data-text);
    position: absolute;
    top: -2px;
    left: 2px;
    color: rgba(0, 255, 255, 0.5);
    z-index: -1;
}

/* Ink bleed effect */
.ink-bleed {
    text-shadow: 
        0.5px 0.5px 0 rgba(255, 0, 255, 0.5),
        -0.5px -0.5px 0 rgba(0, 255, 255, 0.5),
        0.7px -0.7px 0 rgba(255, 255, 0, 0.5);
    letter-spacing: 2px;
}

/* Halftone effect overlay */
.halftone-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: radial-gradient(circle, rgba(0,0,0,0.1) 1px, transparent 1px);
    background-size: 4px 4px;
    pointer-events: none;
    opacity: 0.5;
    z-index: 12;
}

/* Paper texture */
.paper-texture {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: url('data:image/png;base64,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');
    opacity: 0.05;
    pointer-events: none;
    z-index: 5;
}

/* Crop marks - make them responsive */
.crop-mark {
    position: fixed;
    pointer-events: none;
    z-index: 20;
    width: min(20px, 3vw);
    height: min(20px, 3vw);
}

.crop-mark::before,
.crop-mark::after {
    content: '';
    position: absolute;
    background-color: rgba(255, 255, 255, 0.7);
}

.crop-mark.top-left {
    top: 1vh;
    left: 1vw;
}

.crop-mark.top-left::before {
    top: 0;
    left: 0;
    width: 10px;
    height: 1px;
}

.crop-mark.top-left::after {
    top: 0;
    left: 0;
    width: 1px;
    height: 10px;
}

.crop-mark.top-right {
    top: 1vh;
    right: 1vw;
}

.crop-mark.top-right::before {
    top: 0;
    right: 0;
    width: 10px;
    height: 1px;
}

.crop-mark.top-right::after {
    top: 0;
    right: 0;
    width: 1px;
    height: 10px;
}

.crop-mark.bottom-left {
    bottom: 1vh;
    left: 1vw;
}

.crop-mark.bottom-left::before {
    bottom: 0;
    left: 0;
    width: 10px;
    height: 1px;
}

.crop-mark.bottom-left::after {
    bottom: 0;
    left: 0;
    width: 1px;
    height: 10px;
}

.crop-mark.bottom-right {
    bottom: 1vh;
    right: 1vw;
}

.crop-mark.bottom-right::before {
    bottom: 0;
    right: 0;
    width: 10px;
    height: 1px;
}

.crop-mark.bottom-right::after {
    bottom: 0;
    right: 0;
    width: 1px;
    height: 10px;
}

/* Ocassional print misalignment */
@keyframes slight-misalign {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(0.7px); }
}

@keyframes pulse {
    0% { text-shadow: 0 0 10px #ff00ff, 0 0 20px #ff00ff, 0 0 30px #ff00ff; }
    100% { text-shadow: 0 0 20px #ff00ff, 0 0 30px #ff00ff, 0 0 40px #ff00ff, 0 0 50px #ff00ff; }
}

@keyframes grid-animation {
    0% { transform: perspective(1000px) rotateX(70deg) translateY(0); }
    100% { transform: perspective(1000px) rotateX(70deg) translateY(100vh); }
}

@keyframes glitch-text {
    0% { text-shadow: 0.05em 0 0 rgba(255,0,0,0.75), -0.05em -0.025em 0 rgba(0,255,0,0.75), -0.025em 0.05em 0 rgba(0,0,255,0.75); }
    14% { text-shadow: 0.05em 0 0 rgba(255,0,0,0.75), -0.05em -0.025em 0 rgba(0,255,0,0.75), -0.025em 0.05em 0 rgba(0,0,255,0.75); }
    15% { text-shadow: -0.05em -0.025em 0 rgba(255,0,0,0.75), 0.025em 0.025em 0 rgba(0,255,0,0.75), -0.05em -0.05em 0 rgba(0,0,255,0.75); }
    49% { text-shadow: -0.05em -0.025em 0 rgba(255,0,0,0.75), 0.025em 0.025em 0 rgba(0,255,0,0.75), -0.05em -0.05em 0 rgba(0,0,255,0.75); }
    50% { text-shadow: 0.025em 0.05em 0 rgba(255,0,0,0.75), 0.05em 0 0 rgba(0,255,0,0.75), 0 -0.05em 0 rgba(0,0,255,0.75); }
    99% { text-shadow: 0.025em 0.05em 0 rgba(255,0,0,0.75), 0.05em 0 0 rgba(0,255,0,0.75), 0 -0.05em 0 rgba(0,0,255,0.75); }
    100% { text-shadow: -0.025em 0 0 rgba(255,0,0,0.75), -0.025em -0.025em 0 rgba(0,255,0,0.75), -0.025em -0.05em 0 rgba(0,0,255,0.75); }
}

@keyframes glitch-animation {
    0% { transform: translate(0); }
    20% { transform: translate(-5px, 5px); }
    40% { transform: translate(-5px, -5px); }
    60% { transform: translate(5px, 5px); }
    80% { transform: translate(5px, -5px); }
    100% { transform: translate(0); }
}

/* Extreme visual effects */
@keyframes neon-flicker {
    0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% { 
        filter: drop-shadow(0 0 1px #fff) 
               drop-shadow(0 0 5px #ff00ff) 
               drop-shadow(0 0 10px #ff00ff);
    }
    20%, 24%, 55% { 
        filter: none; 
    }
}

@keyframes rotate-hue {
    0% { filter: hue-rotate(0deg); }
    50% { filter: hue-rotate(180deg); }
    100% { filter: hue-rotate(360deg); }
}

@keyframes text-scramble {
    0% { clip-path: inset(0 0 0 0); }
    5% { clip-path: inset(33% 0 66% 0); }
    10% { clip-path: inset(66% 0 33% 0); }
    15% { clip-path: inset(33% 0 33% 0); }
    20% { clip-path: inset(0 0 0 0); }
    100% { clip-path: inset(0 0 0 0); }
}

@keyframes float-distort {
    0% { transform: translateY(0) skewX(0deg); }
    25% { transform: translateY(-15px) skewX(5deg); }
    75% { transform: translateY(15px) skewX(-5deg); }
    100% { transform: translateY(0) skewX(0deg); }
}

@keyframes warp {
    0% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
    50% { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
    100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Subtitle modifications */
.subtitle {
    font-size: clamp(1rem, 3vw, 2rem);
    margin-bottom: clamp(1rem, 3vw, 2.5rem);
    color: #0ff;
    text-shadow: 0 0 10px #0ff, 0 0 20px #0ff;
    animation: slight-misalign 8s ease-in-out infinite, text-scramble 10s infinite;
    text-align: right;
    position: absolute;
    top: 6%;
    z-index: 99;
    margin-top: 0;
    right: 3vw;
    width: auto;
    transition: opacity 0.3s linear; /* Simpler, faster transition */
}

/* Container modifications to support scrolling layout */
.container {
    position: absolute;
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    z-index: 1;
    align-items: flex-start;
    justify-content: flex-start;
    padding: min(2rem, 5vw);
    box-sizing: border-box;
    overflow-y: auto; /* Enable vertical scrolling for the container */
    max-height: 100vh; /* Ensure it doesn't exceed viewport height */
}

/* Title repositioned to upper left */
.title {
    font-size: clamp(2rem, 8vw, 5rem); /* Responsive font size */
    margin-bottom: 0; /* No bottom margin */
    text-transform: uppercase;
    letter-spacing: clamp(0.2rem, 0.5vw, 0.7rem);
    text-shadow: 
        0 0 10px #ff00ff,
        0 0 20px #ff00ff,
        0 0 30px #ff9500,
        0 0 40px #ff00ff;
    animation: pulse 2s infinite alternate; /* Removed shake animation */
    position: relative;
    z-index: 100;
    transform-origin: left center;
    line-height: 0.9; /* Added tighter line height to help with overlap */
}

.title-wrapper {
    position: relative;
    /* Removed text-scramble animation */
    margin-top: 1rem;
    margin-bottom: 1.5em; /* Add bottom margin to make space for absolutely positioned subtitle */
}

/* Add a subtle print misregistration effect to title */
.title::before {
    content: "Zymurnaut";
    position: absolute;
    left: -3px;
    top: 2px;
    color: cyan;
    opacity: 0.7;
    z-index: -1;
    /* Removed slight-misalign animation */
}

.title::after {
    content: "ZYMURN4U7";
    position: absolute;
    left: 3px;
    top: -2px;
    color: magenta;
    opacity: 0.7;
    z-index: -1;
    /* Removed slight-misalign animation */
}

/* Buttons */
.buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 1rem; /* Reduced from 2rem */
    margin-left: 10px;
}

/* Button component styling */
.button {
    /* Layout and sizing */
    padding: 0.4rem 0.8rem;  /* Reduced padding from 0.6rem 1.2rem */
    position: relative;
    overflow: hidden;
    font-size: 0.9rem;  /* Added smaller font size */
    
    /* Visual styling */
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(0, 255, 255, 0.6);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.4);
    
    /* Typography */
    color: #fff;
    font-family: 'Orbitron', sans-serif;
    animation: neon-flicker 5s infinite;
}

.button i {
    margin-right: 5px;  /* Add spacing between icon and text */
}

.button:hover {
    background: rgba(0, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.6);
}

/* Mobile optimization for button animations */
@media (max-width: 768px) {
    .button {
        /* Reduce or eliminate animations on mobile */
        animation: none; /* Remove flicker animation */
        box-shadow: 0 0 5px rgba(0, 255, 255, 0.3); /* Subtler glow */
        border: 1px solid rgba(0, 255, 255, 0.4); /* Thinner border */
    }
    
    .button.ink-bleed {
        text-shadow: none; /* Remove text shadow effects */
    }
    
    .button:hover {
        /* Simpler hover effect for mobile */
        transform: none;
        box-shadow: 0 0 8px rgba(0, 255, 255, 0.4);
        background: rgba(0, 255, 255, 0.15);
    }
}

/* Grid with dramatic movement - extend beyond viewport */
.grid {
    position: fixed;
    bottom: 0;
    width: 500%;  /* Extended to ensure no cutoff */
    left: -200%;  /* Adjusted to center wider grid */
    height: 300vh;  /* Extended to ensure coverage */
    background: 
        linear-gradient(to right, rgba(0, 255, 255, 1) 6px, transparent 6px),
        linear-gradient(to bottom, rgba(0, 255, 255, 1) 6px, transparent 6px);
    background-size: 8vw 8vw;
    transform: perspective(1000px) rotateX(65deg);
    transform-origin: bottom;
    animation: grid-animation 150s linear infinite;
    z-index: 0;
    box-shadow: 
        0 0 40px rgba(0, 255, 255, 0.9),
        0 0 80px rgba(0, 255, 255, 0.6),
        0 0 120px rgba(0, 255, 255, 0.4);
    opacity: 0.8;
}

/* Fix for mountains to cover entire width */
.mountains {
    position: fixed;
    bottom: 0;
    left: -5vw;  /* Extend slightly beyond left edge */
    width: 110vw;  /* Extend slightly beyond right edge */
    height: 20vh;
    background: 
        linear-gradient(transparent 0%, rgba(5, 5, 20, 0.8) 70%),
        linear-gradient(135deg, transparent 50%, #0f0f30 50%),
        linear-gradient(225deg, #0f0f30 50%, transparent 50%);
    z-index: -1;
    opacity: 0.7;
}

.sun {
    position: fixed;
    width: 350px;
    height: 350px;
    border-radius: 50%;
    background: radial-gradient(circle, #ff6e00 0%, #ff0097 50%, transparent 70%);
    top: 350px; /* Positioned from top instead of bottom */
    right: 80px; /* Positioned from right instead of left */
    /* Removed bottom and left positioning */
    /* Removed transform: translateX(-50%) since we're not centering anymore */
    box-shadow: 
        0 0 30px #ff0097,
        0 0 60px #ff0097,
        0 0 90px #ff8c00;
    z-index: -2;
    animation: float-distort 15s ease-in-out infinite;
    filter: blur(5px);
    opacity: 0.9;  /* Added opacity to let grid show through */
}

/* Animated color bars */
.color-bars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -6;
    overflow: hidden;
}

.color-bar {
    position: absolute;
    width: 100%;
    height: 20px;
    background: linear-gradient(90deg, #ff00ff, #00ffff);
    opacity: 0.5;
    animation: float-distort 8s ease-in-out infinite;
}

/* VHS tracking effect */
.vhs-tracking {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;  /* Use viewport width */
    height: 100vh;  /* Use viewport height */
    background: repeating-linear-gradient(
        0deg,
        rgba(0,0,0,0) 0,
        rgba(0,0,0,0) 4px,
        rgba(255,255,255,0.03) 5px,
        rgba(0,0,0,0) 6px
    );
    background-size: 100% auto;  /* Ensure pattern fills width */
    pointer-events: none;
    z-index: 30;
    mix-blend-mode: overlay;
}

/* Screen flicker */
@keyframes screen-flicker {
    0%, 100% { opacity: 1; }
    95% { opacity: 1; }
    95.5% { opacity: 0; }
    96% { opacity: 1; }
    98% { opacity: 1; }
    98.5% { opacity: 0; }
    99% { opacity: 1; }
}

.screen-flicker {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: transparent;
    mix-blend-mode: overlay;
    animation: screen-flicker 10s infinite;
    pointer-events: none;
    z-index: 40;
}

/* Scan line */
.scan-line {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 10px;
    background: linear-gradient(
        to bottom,
        transparent,
        rgba(255, 255, 255, 0.3) 50%,
        transparent
    );
    opacity: 0.7;
    z-index: 35;
    pointer-events: none;
    animation: scan 8s linear infinite;
}

@keyframes scan {
    0% { top: -10px; }
    100% { top: 100%; }
}

/* Warping liquid background */
.liquid-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        rgba(76, 0, 130, 0.6), 
        rgba(43, 0, 90, 0.6),
        rgba(120, 0, 130, 0.6)
    );
    filter: url('#turbulence');
    z-index: -10;
    animation: rotate-hue 20s linear infinite;
}

/* Edge glow */
.edge-glow {
    position: fixed;
    top: 10%;
    right: 10%;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(
        circle, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 0, 255, 0.3) 30%, 
        transparent 70%
    );
    filter: blur(30px);
    animation: warp 15s ease-in-out infinite alternate;
    z-index: -5;
}

/* Info Frames - More subtle styling */
.info-frames-container {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: clamp(1rem, 3vh, 2rem);
    margin-top: clamp(1rem, 2vh, 2rem); /* Reduced from clamp(2rem, 5vh, 4rem) */
    margin-bottom: 25px; /* Add 25px spacing from bottom of viewport */
    z-index: 5;
    /* Add flex-grow to take available space */
    flex-grow: 1;
    max-height: none; /* Remove height restriction */
    overflow: visible; /* Allow content to be visible */
}

/* Mobile-specific spacing adjustment */
@media (max-width: 768px) {
    .info-frames-container {
        margin-bottom: 80px; /* Increased bottom margin for mobile */
        padding-bottom: 20px; /* Add bottom padding */
        max-height: none; /* Remove max-height restriction */
    }
    
    /* Remove extra padding on mobile to maximize space */
    .container {
        padding: min(1rem, 3vw);
    }
    
    /* Make buttons more compact on mobile */
    .buttons {
        margin-bottom: 0.5rem;
        gap: 8px;
    }
    
    /* Reduce title spacing on mobile */
    .title-wrapper {
        margin-top: 0.5rem;
    }
    
    .subtitle {
        margin-bottom: 0.8rem;
        animation: none;
        transition: opacity 0.2s linear; /* Even faster transition on mobile */
    }

    /* Disable heavy animations on mobile */
    .scan-line {
        display: none; /* Remove scan line on mobile */
    }
    
    .screen-flicker {
        animation: none; /* Remove flicker effect on mobile */
    }
    
    /* Reduce turbulence effect on mobile */
    .liquid-bg {
        filter: none; /* Remove SVG filter on mobile */
        background: linear-gradient(135deg, 
            rgba(76, 0, 130, 0.6), 
            rgba(43, 0, 90, 0.6),
            rgba(120, 0, 130, 0.6)
        );
    }
    
    /* Simplify grid animation for better performance */
    .grid {
        animation: none;
        transform: perspective(1000px) rotateX(65deg);
        opacity: 0.6;
    }
    
    /* Reduce or eliminate other heavy visual effects */
    .color-bar {
        animation: none;
    }
    
    .sun {
        animation: none;
        filter: blur(3px); /* Less blur for better performance */
    }
    
    .edge-glow {
        animation: none;
        filter: blur(20px); /* Less blur */
    }
}

.info-frame {
    position: relative;
    padding: clamp(1rem, 3vw, 2rem);
    background: rgba(20, 10, 50, 0.35);
    border-radius: 5px;
    backdrop-filter: blur(10px);
    box-shadow: 
        0 0 15px rgba(0, 255, 255, 0.3),
        0 0 30px rgba(255, 0, 255, 0.15);
    color: #fff;
    /* Change to ensure content fits */
    height: auto; /* Auto height instead of 100% */
    max-height: none; /* Remove max-height restriction */
    display: none;
    flex-direction: column;
    overflow-y: auto; /* Keep vertical scrolling enabled */
    transition: all 0.6s ease;
    border: 2px solid transparent;
    background-clip: padding-box;
    margin-bottom: 30px; /* Add bottom margin to ensure content isn't cut off */
}

.info-frame h2 {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    margin-bottom: clamp(0.8rem, 2vh, 1.5rem);
    color: #0ff;
    text-shadow: 
        0 0 5px #0ff,
        0 0 10px #0ff;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.info-frame h3 {
    font-size: clamp(1.2rem, 3vw, 2rem);
    margin-bottom: clamp(0.5rem, 1.5vh, 1rem);
    margin-top: clamp(1rem, 2vh, 1.5rem);
    color: #ff00ff;
    text-shadow: 
        0 0 5px #ff00ff,
        0 0 10px #ff00ff;
}

.info-frame p {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    line-height: 1.6;
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.9);
}

/* Style updates for the project grid to ensure full background coverage */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
    margin-bottom: 1rem; /* Add bottom margin */
    width: 100%; /* Ensure full width */
}

.project-item {
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    border: 1px solid rgba(0, 255, 255, 0.3);
    transition: all 0.3s ease;
    position: relative; /* Added for absolute icon positioning */
}

.project-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 255, 255, 0.5);
}

.project-item h4 {
    font-size: clamp(1rem, 2vw, 1.3rem);
    color: #fff;
    margin-bottom: 0.5rem;
}

/* Updated project icon styling */
.project-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    color: #ff00ff;
    text-shadow: 0 0 5px #ff00ff;
    font-size: 1.8rem;
    opacity: 0.25;
    transition: opacity 0.3s ease;
    z-index: 1;
}

/* Brighten icon on hover */
.project-item:hover .project-icon {
    opacity: 0.5;
}

/* For very small screens, adjust layout */
@media (max-width: 480px) {
    .info-frame {
        padding: 0.8rem;
        max-height: none; /* Remove max-height restriction */
        margin-bottom: 100px; /* Extra space at the bottom */
    }
    
    .project-grid {
        grid-template-columns: 1fr;
    }
    
    /* Extra bottom spacing for very small screens */
    .info-frames-container {
        margin-bottom: 100px; /* Even more bottom margin for very small screens */
    }
    
    /* Ensure body can scroll on mobile */
    html, body {
        overflow-y: auto;
        height: auto;
        min-height: 100vh;
    }
    
    /* Fix buttons to be more usable on small screens */
    .button {
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
    }
}

/* Custom scrollbar for the info frames */
.info-frame::-webkit-scrollbar {
    width: 8px;
}

.info-frame::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.info-frame::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #ff00ff, #00ffff);
    border-radius: 10px;
}

/* Project modal styles */
.modal-overlay {
    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;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    position: relative;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    background: rgba(20, 10, 50, 0.8);
    border-radius: 8px;
    padding: clamp(1.5rem, 4vw, 2.5rem);
    box-shadow: 
        0 0 20px rgba(0, 255, 255, 0.4),
        0 0 40px rgba(255, 0, 255, 0.2);
    transform: translateY(50px);
    transition: transform 0.6s cubic-bezier(0.19, 1, 0.22, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.modal-close:hover {
    opacity: 1;
    transform: rotate(90deg);
}

.modal-title {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    margin-bottom: 1.5rem;
    color: #0ff;
    opacity: 0.9; /* Less intense color */
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5); /* Softer glow */
}

.modal-content {
    font-size: clamp(1rem, 2vw, 1.2rem);
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.8);
}

/* Custom scrollbar for the modal */
.modal::-webkit-scrollbar {
    width: 8px;
}

.modal::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.modal::-webkit-scrollbar-thumb {
    background: rgba(127, 127, 255, 0.5); /* More subtle scrollbar color */
    border-radius: 10px;
}

/* Quarterly view styling */
.quarterly-view {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    padding: 0.5rem;
    font-family: 'Orbitron', sans-serif;
}

.quarter-selector {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding: 0.25rem;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 5px;
}

.quarter-nav {
    display: flex;
    gap: 0.3rem;
}

.quarter-nav button {
    background: rgba(255, 0, 255, 0.3);
    border: 1px solid rgba(0, 255, 255, 0.5);
    color: white;
    padding: 0.15rem 0.3rem;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8rem;
}

.quarter-title {
    font-size: 1rem;
    text-transform: uppercase;
    color: #0ff;
    text-shadow: 0 0 5px #0ff;
    letter-spacing: 1px;
}

.quarter-tabs {
    display: flex;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid rgba(0, 255, 255, 0.3);
}

.quarter-tab {
    padding: 0.3rem 0.5rem;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.7);
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    font-size: 0.8rem;
}

.quarter-tab.active {
    color: #0ff;
    border-bottom: 2px solid #0ff;
}

.events-list {
    margin-top: 0.5rem;
}

.event-item {
    margin: 0.3rem 0;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    border-left: 3px solid #ff00ff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.event-item:hover {
    background: rgba(0, 0, 255, 0.15);
}

.event-date {
    font-size: 0.8rem;
    color: #0ff;
    margin-bottom: 0.25rem;
}

.event-title {
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.event-description {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Modal event styles */
.modal-event-item {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 255, 255, 0.3);
}

.modal-event-item:last-child {
    border-bottom: none;
}

.modal-event-title {
    color: #0ff;
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.modal-event-time {
    color: #ff00ff;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.modal-event-description {
    line-height: 1.4;
    margin-bottom: 1rem;
}

.modal-event-long-description {
    background: rgba(0, 0, 0, 0.2);
    padding: 0.8rem;
    border-radius: 5px;
    font-size: 0.9rem;
    line-height: 1.5;
    border-left: 2px solid rgba(0, 255, 255, 0.4);
}

/* Administrivia frame styling */
.admin-columns {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    width: 100%;
}

.admin-column {
    flex: 1;
    min-width: 250px;
}

.admin-column h3 {
    border-bottom: 1px solid rgba(0, 255, 255, 0.3);
    padding-bottom: 0.5rem;
    margin-bottom: 1.2rem;
}

.admin-link {
    display: block;
    padding: 0.7rem 1rem;
    margin-bottom: 0.8rem;
    background: rgba(0, 0, 0, 0.3);
    border-left: 3px solid #ff00ff;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.admin-link:hover {
    background: rgba(0, 255, 255, 0.15);
    transform: translateX(5px);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.admin-link i {
    margin-right: 0.5rem;
    color: #0ff;
}

/* Responsive adjustments for admin columns */
@media (max-width: 768px) {
    .admin-columns {
        flex-direction: column;
        gap: 1rem;
    }
    
    .admin-column {
        width: 100%;
    }
}

/* Add CSS for hidden state */
.hidden-element {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}
