/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Courier New', monospace;
    background: #000;
    color: #fff;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Accessibility - Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .parallax-bg {
        transform: none !important;
    }
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #2d1b3d 0%, #1a1a2e 30%, #16213e 60%, #0f0f23 100%);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease-out;
    font-family: 'Courier New', monospace;
    overflow: hidden;
}

.loading-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    text-align: center;
    position: relative;
    z-index: 2;
    max-width: 400px;
    width: 90%;
}

.glitch-container {
    margin-bottom: 40px;
    display: flex;
    justify-content: center;
}

.time-fragment {
    font-size: 3rem;
    color: #ffffff;
    font-family: 'Courier New', monospace;
    text-shadow: 
        2px 0 #00ffff,
        -2px 0 #ff0000,
        0 2px #ffff00;
    animation: timeGlitchMystery 3s infinite;
    filter: brightness(1.2);
}

.main-text {
    margin-bottom: 40px;
}

.glitch-text {
    font-size: 2.5rem;
    color: #ffffff;
    position: relative;
    text-transform: uppercase;
    animation: glitchMain 3s infinite;
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch-text::before {
    animation: glitchBefore 2s infinite;
    color: #ff0000;
    z-index: -1;
}

.glitch-text::after {
    animation: glitchAfter 2.5s infinite;
    color: #00ffff;
    z-index: -2;
}

.loading-bar {
    width: 350px;
    height: 25px;
    border: 2px solid #666;
    margin: 25px auto;
    background: #000;
    position: relative;
    overflow: hidden;
    border-radius: 3px;
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, 
        #ff69b4 0%, 
        #00ffff 25%, 
        #ffff00 50%, 
        #ff0000 75%, 
        #ff69b4 100%);
    width: 0%;
    animation: loadingProgress 3s ease-in-out, progressGlitch 0.5s infinite;
    position: relative;
}

.glitch-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 2px,
        rgba(255, 255, 255, 0.1) 2px,
        rgba(255, 255, 255, 0.1) 4px
    );
    animation: scanGlitch 0.1s infinite;
}

.vhs-noise {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(255, 255, 255, 0.03) 2px,
            rgba(255, 255, 255, 0.03) 4px
        );
    animation: vhsNoise 0.2s infinite;
    pointer-events: none;
}

.scan-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        transparent 50%, 
        rgba(255, 255, 255, 0.02) 50%
    );
    background-size: 100% 4px;
    animation: scanLines 0.1s linear infinite;
    pointer-events: none;
}

.time-distortion {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        circle at 50% 50%,
        rgba(255, 105, 180, 0.1) 0%,
        transparent 50%
    );
    animation: timeDistort 8s ease-in-out infinite;
    pointer-events: none;
}

/* Parallax Background */
.parallax-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 120vh;
    background-image: url('https://twzknjvtwbxtedklclht.supabase.co/storage/v1/object/public/sfwagere/lostchild.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
    will-change: transform;
    filter: brightness(0.7) contrast(1.2);
}

/* Header Styles */
.header {
    position: relative;
    padding: 20px 0;
    text-align: center;
    z-index: 100;
    margin-left: 15px;
}

/* Site Logo Styling */
.site-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
    position: relative;
    z-index: 10;
}

.logo-image {
    width: 60px;
    height: 60px;
    object-fit: contain;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.3));
    animation: flameFlicker 6s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
}

/* Logo fallback styling */
.logo-fallback {
    font-size: 48px;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.site-title {
    font-family: 'Courier New', monospace;
    font-size: clamp(2rem, 6vw, 4rem);
    font-weight: bold;
    text-shadow: 
        2px 2px 0 #000,
        4px 4px 0 rgba(0, 0, 0, 0.5);
    animation: colorFlash 2s infinite;
    letter-spacing: 0.1em;
    margin-top: 20px;
    margin-bottom: 10px;
}

.site-tagline {
    font-family: 'Times New Roman', serif;
    font-size: clamp(0.9rem, 2.5vw, 1.2rem);
    color: #ddd;
    font-style: italic;
    text-align: center;
    margin: 0;
    opacity: 0.9;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
    line-height: 1.3;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Navigation Styles */
.navigation {
    position: sticky;
    top: 0;
    z-index: 99;
    background: linear-gradient(45deg, #ccc, #888);
    border: 2px outset #999;
    border-radius: 5px;
    margin: 20px auto;
    max-width: 90%;
    box-shadow: 
        inset 1px 1px 0 rgba(255, 255, 255, 0.5),
        inset -1px -1px 0 rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.navigation::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 1px 1px, rgba(255,255,255,0.15) 1px, transparent 0);
    background-size: 20px 20px;
    animation: vhsStatic 0.5s infinite;
    pointer-events: none;
    z-index: 1;
}

.nav-list {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    list-style: none;
    padding: 10px;
    gap: 10px;
}

.nav-item {
    position: relative;
    z-index: 2;
}

.nav-link {
    color: #000;
    text-decoration: none;
    padding: 8px 16px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.2);
    border: 1px inset #999;
    border-radius: 3px;
    transition: all 0.2s ease;
    text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.5);
    display: block;
}

.nav-link:hover,
.nav-link:focus {
    background: rgba(50, 255, 50, 0.3);
    border: 1px outset #999;
    transform: translateY(-1px);
}

/* Tooltip Styles */
.tooltip {
    position: fixed;
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-family: Arial, sans-serif;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 9999;
    pointer-events: none;
    min-height: 28px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transform: translateX(-50%) translateY(-100%);
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid rgba(0, 0, 0, 0.9);
}

@media (hover: hover) {
    .nav-item:hover .tooltip,
    .nav-link:focus + .tooltip {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(-5px);
        transition-delay: 100ms;
    }
}

/* Touch device support */
@media (hover: none) {
    .nav-item.touch-active .tooltip {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(-5px);
    }
}

/* Main Container */
.main-container {
    position: relative;
    min-height: 100vh; /* Reduced from 200vh for more compact early 2000s webpage feel */
    background: rgba(0, 0, 0, 0.3);
    -webkit-backdrop-filter: blur(1px);
    backdrop-filter: blur(1px);
    padding: 20px 0; /* Add some padding for better spacing */
    padding-bottom: 140px; /* Space for marquee (40px) + gap (60px) + footer (~40px) */
}

/* Text Overlays */
.text-overlay {
    position: absolute;
    z-index: 200; /* ensure above other UI like marquee/footer */
    pointer-events: none;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.text-overlay.bottom-right {
    bottom: 200px;
    right: 50px;
    font-family: 'Comic Sans MS', cursive;
    font-size: clamp(1.2rem, 3vw, 2rem);
    color: #CC0000;
    transform: rotate(-3deg);
    animation: wobble 4s ease-in-out infinite;
    /* Enable interactions for this specific overlay */
    pointer-events: auto;
    cursor: pointer;
    transition: transform 180ms ease, text-shadow 180ms ease, color 180ms ease;
}

/* Hover effect: bright red glow + slight enlarge */
.text-overlay.bottom-right:hover {
    /* Stop wobble so our transform takes effect */
    animation: none !important;
    color: #ff1a1a;
    text-shadow:
        0 0 8px #ff0000,
        0 0 16px #ff1a1a,
        0 0 24px #ff3333,
        0 0 36px rgba(255, 0, 0, 0.6);
    transform: rotate(-3deg) scale(1.18);
}

/* Click effect: stronger glow + bigger pop (temporary via JS class) */
.text-overlay.bottom-right.glow-pop {
    animation: none !important; /* ensure transform isn't overridden by wobble */
    color: #ff3b3b;
    text-shadow:
        0 0 10px #ff0000,
        0 0 20px #ff2a2a,
        0 0 40px #ff4d4d,
        0 0 60px rgba(255, 0, 0, 0.7);
    transform: rotate(-3deg) scale(1.28);
}

/* Keyboard focus should mirror hover visuals */
.text-overlay.bottom-right:focus-visible {
    outline: none;
    animation: none !important;
    color: #ff1a1a;
    text-shadow:
        0 0 8px #ff0000,
        0 0 16px #ff1a1a,
        0 0 24px #ff3333,
        0 0 36px rgba(255, 0, 0, 0.6);
    transform: rotate(-3deg) scale(1.18);
}

/* Immediate click/touch feedback without JS */
.text-overlay.bottom-right:active {
    color: #ff2a2a;
    text-shadow:
        0 0 10px #ff0000,
        0 0 20px #ff2a2a,
        0 0 40px #ff4d4d,
        0 0 60px rgba(255, 0, 0, 0.7);
    transform: rotate(-3deg) scale(1.26);
}

/* Main Content */
.main-content {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.spacer {
    height: 10vh; /* Reduced from 50vh for more compact layout */
    opacity: 0;
}

/* Introduction Panel */
.intro-panel {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 300px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #666;
    border-radius: 10px;
    padding: 20px;
    z-index: 60;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    background-image: 
        radial-gradient(circle at 10px 10px, rgba(255, 255, 255, 0.1) 2px, transparent 2px);
    background-size: 30px 30px;
}

.intro-title {
    font-family: 'Comic Sans MS', cursive;
    font-size: 18px;
    text-align: center;
    color: #32FF32;
    margin-bottom: 15px;
    text-shadow: 0 0 5px rgba(50, 255, 50, 0.5);
}

.intro-content p {
    font-family: 'Times New Roman', serif;
    font-size: 14px;
    line-height: 1.4;
    text-align: justify;
    color: #ddd;
}

/* Scrolling Marquee */
.marquee {
    position: fixed;
    bottom: 60px;
    left: 0;
    width: 100%;
    height: 40px;
    background: rgba(0, 0, 0, 0.9);
    border-top: 2px solid #32FF32;
    border-bottom: 2px solid #32FF32;
    overflow: hidden;
    z-index: 200; /* above footer */
}

.marquee-content {
    white-space: nowrap;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: bold;
    color: #32FF32;
    line-height: 40px;
    animation: scroll 20s linear infinite;
    will-change: transform;
}

/* Footer */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    padding: 20px;
    background: rgba(0, 0, 0, 0.9);
    border-top: 1px solid #333;
    z-index: 150; /* below marquee */
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.copyright {
    font-size: 8px;
    opacity: 0.5;
    color: #888;
}

.comfort-element {
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    animation: comfortFadeIn 2s ease-in-out 1s forwards;
}

.pixel-heart {
    animation: heartFlicker 3s ease-in-out infinite;
}

.pixel-heart svg {
    filter: drop-shadow(0 0 3px rgba(255, 105, 180, 0.4));
}

.comfort-text {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: #ddd;
    opacity: 0.8;
    animation: gentlePulse 4s ease-in-out infinite;
}

/* Animations */
@keyframes timeGlitch {
    0% { 
        opacity: 0; 
        transform: translateX(-20px) scale(0.8);
        filter: hue-rotate(0deg);
    }
    10% { 
        opacity: 1; 
        transform: translateX(0) scale(1);
    }
    20%, 80% { 
        opacity: 1; 
        transform: translateX(0) scale(1);
        filter: hue-rotate(0deg);
    }
    25% { 
        transform: translateX(3px) scale(1.05);
        filter: hue-rotate(90deg);
    }
    30% { 
        transform: translateX(-2px) scale(0.95);
        filter: hue-rotate(180deg);
    }
    35% { 
        transform: translateX(0) scale(1);
        filter: hue-rotate(0deg);
    }
    90% { 
        opacity: 0.7; 
        filter: hue-rotate(360deg);
    }
    100% { 
        opacity: 0.9; 
        transform: translateX(0) scale(1);
        filter: hue-rotate(0deg);
    }
}

@keyframes timeGlitchMystery {
    0% { 
        opacity: 0; 
        transform: scale(0.5);
    }
    50% { 
        opacity: 1; 
        transform: scale(1.2);
        text-shadow: 
            0 0 20px #ffffff,
            2px 0 #ff0000,
            -2px 0 #00ffff;
    }
    100% { 
        opacity: 0.8; 
        transform: scale(1);
        text-shadow: 
            2px 0 #00ffff,
            -2px 0 #ff0000,
            0 2px #ffff00;
    }
}

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

@keyframes glitchBefore {
    0%, 100% { 
        clip: rect(42px, 9999px, 44px, 0);
        transform: skew(0.5deg);
    }
    5% { 
        clip: rect(12px, 9999px, 59px, 0);
        transform: skew(0.8deg);
    }
    10% { 
        clip: rect(85px, 9999px, 90px, 0);
        transform: skew(-0.3deg);
    }
    15% { 
        clip: rect(40px, 9999px, 95px, 0);
        transform: skew(0.6deg);
    }
    20% { 
        clip: rect(10px, 9999px, 15px, 0);
        transform: skew(-0.2deg);
    }
    25% { 
        clip: rect(50px, 9999px, 55px, 0);
        transform: skew(0.4deg);
    }
}

@keyframes glitchAfter {
    0%, 100% { 
        clip: rect(65px, 9999px, 119px, 0);
        transform: skew(-0.3deg);
    }
    5% { 
        clip: rect(25px, 9999px, 30px, 0);
        transform: skew(0.7deg);
    }
    10% { 
        clip: rect(75px, 9999px, 80px, 0);
        transform: skew(-0.5deg);
    }
    15% { 
        clip: rect(15px, 9999px, 20px, 0);
        transform: skew(0.2deg);
    }
    20% { 
        clip: rect(95px, 9999px, 100px, 0);
        transform: skew(-0.8deg);
    }
}

@keyframes fadeFlicker {
    0%, 100% { opacity: 0.8; }
    25% { opacity: 0.4; }
    50% { opacity: 1; }
    75% { opacity: 0.6; }
}

@keyframes subtleFlicker {
    0%, 100% { opacity: 1; text-shadow: 0 0 3px var(--accent-color-1), 0 0 6px var(--accent-color-2); }
    50% { opacity: 0.95; text-shadow: 0 0 2px var(--accent-color-1), 0 0 4px var(--accent-color-2); }
    75% { opacity: 0.98; text-shadow: 0 0 4px var(--accent-color-1), 0 0 8px var(--accent-color-2); }
}

@keyframes progressGlitch {
    0%, 95% { filter: none; }
    96% { filter: hue-rotate(90deg) saturate(150%); }
    98% { filter: hue-rotate(180deg) saturate(200%); }
    100% { filter: none; }
}

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

@keyframes traumaAppear {
    0% { 
        opacity: 0; 
        transform: translateY(15px);
        filter: blur(2px);
    }
    50% { 
        opacity: 0.7; 
        transform: translateY(-5px);
        filter: blur(1px);
    }
    100% { 
        opacity: 1; 
        transform: translateY(0);
        filter: blur(0);
    }
}

@keyframes vhsNoise {
    0% { transform: translateX(0); opacity: 0.1; }
    10% { transform: translateX(-1px); opacity: 0.2; }
    20% { transform: translateX(1px); opacity: 0.1; }
    30% { transform: translateX(-2px); opacity: 0.15; }
    40% { transform: translateX(2px); opacity: 0.05; }
    50% { transform: translateX(-1px); opacity: 0.2; }
    60% { transform: translateX(1px); opacity: 0.1; }
    70% { transform: translateX(0); opacity: 0.15; }
    80% { transform: translateX(-1px); opacity: 0.1; }
    90% { transform: translateX(1px); opacity: 0.2; }
    100% { transform: translateX(0); opacity: 0.1; }
}

@keyframes scanLines {
    0% { transform: translateY(0); }
    100% { transform: translateY(4px); }
}

@keyframes timeDistort {
    0%, 100% { 
        opacity: 0.1; 
        transform: scale(1);
    }
    25% { 
        opacity: 0.3; 
        transform: scale(1.1);
    }
    50% { 
        opacity: 0.2; 
        transform: scale(0.9);
    }
    75% { 
        opacity: 0.4; 
        transform: scale(1.05);
    }
}

@keyframes colorFlash {
    0% { color: #32FF32; }
    33% { color: #8A2BE2; }
    66% { color: #FF4500; }
    100% { color: #32FF32; }
}

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

@keyframes colorCycle {
    0% { color: #32FF32; }
    25% { color: #FF4500; }
    50% { color: #8A2BE2; }
    75% { color: #CC0000; }
    100% { color: #32FF32; }
}

@keyframes loadingProgress {
    0% { width: 0%; }
    100% { width: 100%; }
}

@keyframes fade {
    0% { opacity: 0.5; }
    100% { opacity: 1; }
}

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

@keyframes vhsStatic {
    0% { opacity: 0.1; }
    50% { opacity: 0.3; }
    100% { opacity: 0.1; }
}

@keyframes wobble {
    0%, 100% { transform: rotate(-3deg); }
    25% { transform: rotate(-1deg); }
    75% { transform: rotate(-5deg); }
}

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

@keyframes flameFlicker {
    0% { 
        filter: drop-shadow(0 0 3px rgba(255, 80, 0, 0.2)) brightness(0.95) saturate(0.9);
        transform: scale(0.99) rotate(-0.2deg);
    }
    7% { 
        filter: drop-shadow(0 0 6px rgba(255, 120, 0, 0.4)) brightness(1.05) saturate(1.1);
        transform: scale(1.01) rotate(0.3deg);
    }
    15% { 
        filter: drop-shadow(0 0 4px rgba(255, 100, 0, 0.3)) brightness(0.98) saturate(0.95);
        transform: scale(0.995) rotate(-0.1deg);
    }
    23% { 
        filter: drop-shadow(0 0 8px rgba(255, 150, 0, 0.5)) brightness(1.08) saturate(1.15);
        transform: scale(1.02) rotate(0.4deg);
    }
    31% { 
        filter: drop-shadow(0 0 2px rgba(255, 60, 0, 0.15)) brightness(0.92) saturate(0.85);
        transform: scale(0.985) rotate(-0.3deg);
    }
    42% { 
        filter: drop-shadow(0 0 10px rgba(255, 180, 0, 0.6)) brightness(1.12) saturate(1.25);
        transform: scale(1.025) rotate(0.2deg);
    }
    53% { 
        filter: drop-shadow(0 0 5px rgba(255, 110, 0, 0.35)) brightness(1.02) saturate(1.05);
        transform: scale(1.005) rotate(-0.1deg);
    }
    64% { 
        filter: drop-shadow(0 0 7px rgba(255, 140, 0, 0.45)) brightness(1.06) saturate(1.1);
        transform: scale(1.015) rotate(0.25deg);
    }
    75% { 
        filter: drop-shadow(0 0 1px rgba(255, 40, 0, 0.1)) brightness(0.88) saturate(0.8);
        transform: scale(0.98) rotate(-0.4deg);
    }
    86% { 
        filter: drop-shadow(0 0 9px rgba(255, 160, 0, 0.55)) brightness(1.1) saturate(1.2);
        transform: scale(1.02) rotate(0.15deg);
    }
    100% { 
        filter: drop-shadow(0 0 3px rgba(255, 80, 0, 0.2)) brightness(0.95) saturate(0.9);
        transform: scale(0.99) rotate(-0.2deg);
    }
}

@keyframes comfortFadeIn {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes heartFlicker {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
    25%, 75% { opacity: 0.9; }
}

@keyframes gentlePulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

@keyframes notepadFadeOut {
    0% { 
        opacity: 1; 
        transform: scale(1) translateY(0);
        filter: blur(0px);
    }
    100% { 
        opacity: 0; 
        transform: scale(0.95) translateY(-10px);
        filter: blur(2px);
    }
}

@keyframes notepadGlitch {
    0% { 
        transform: translate(0);
        filter: hue-rotate(0deg) saturate(1);
    }
    10% { 
        transform: translate(-2px, 1px);
        filter: hue-rotate(90deg) saturate(1.2);
    }
    20% { 
        transform: translate(2px, -1px);
        filter: hue-rotate(180deg) saturate(0.8);
    }
    30% { 
        transform: translate(-1px, 2px);
        filter: hue-rotate(270deg) saturate(1.1);
    }
    40% { 
        transform: translate(1px, -2px);
        filter: hue-rotate(0deg) saturate(1);
    }
    50% { 
        transform: translate(-2px, 0px);
        filter: hue-rotate(90deg) saturate(1.3);
    }
    60% { 
        transform: translate(2px, 1px);
        filter: hue-rotate(180deg) saturate(0.9);
    }
    70% { 
        transform: translate(0px, -1px);
        filter: hue-rotate(270deg) saturate(1.1);
    }
    80% { 
        transform: translate(-1px, 1px);
        filter: hue-rotate(0deg) saturate(1.2);
    }
    90% { 
        transform: translate(1px, 0px);
        filter: hue-rotate(90deg) saturate(0.95);
    }
    100% { 
        transform: translate(0);
        filter: hue-rotate(0deg) saturate(1);
    }
}

@keyframes corruptionPulse {
    0% { 
        color: #ff0000; 
        text-shadow: 0 0 5px rgba(255, 0, 0, 0.5);
        filter: brightness(1);
    }
    25% { 
        color: #ff4444; 
        text-shadow: 0 0 10px rgba(255, 0, 0, 0.8), 0 0 20px rgba(255, 0, 0, 0.4);
        filter: brightness(1.2);
    }
    50% { 
        color: #ff8888; 
        text-shadow: 0 0 15px rgba(255, 0, 0, 1), 0 0 30px rgba(255, 0, 0, 0.6);
        filter: brightness(1.4);
    }
    75% { 
        color: #ff4444; 
        text-shadow: 0 0 10px rgba(255, 0, 0, 0.8), 0 0 20px rgba(255, 0, 0, 0.4);
        filter: brightness(1.2);
    }
    100% { 
        color: #ff0000; 
        text-shadow: 0 0 5px rgba(255, 0, 0, 0.5);
        filter: brightness(1);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .intro-panel {
        position: static;
        transform: none;
        width: calc(100% - 40px);
        margin: 20px auto;
        top: auto;
        right: auto;
    }
    
    .text-overlay.bottom-right {
        right: 20px;
        bottom: 150px;
        font-size: 1rem;
    }
    
    .nav-list {
        flex-direction: column;
        align-items: center;
    }
    
    .nav-link {
        width: 200px;
        text-align: center;
    }
    
    .footer {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .comfort-element {
        justify-content: center;
    }
    
    .marquee-content {
        font-size: 14px;
    }
    
    /* Touch support for tooltips */
    .tooltip {
        font-size: 14px;
        padding: 10px 14px;
        min-height: 44px;
    }
    
    /* Logo responsive adjustments */
    .logo-image {
        width: 50px;
        height: 50px;
    }
    
    .logo-fallback {
        font-size: 40px;
    }
}

@media (max-width: 480px) {
    .site-title {
        font-size: 1.5rem;
    }
    
    .intro-panel {
        width: calc(100% - 20px);
        margin: 10px auto;
        padding: 15px;
    }
    
    .comfort-text {
        font-size: 10px;
    }
    
    .tooltip {
        font-size: 13px;
        padding: 8px 12px;
    }
    
    /* Logo responsive adjustments */
    .logo-image {
        width: 40px;
        height: 40px;
    }
    
    .logo-fallback {
        font-size: 32px;
    }
}

/* Melancholic Y2K Notepad Container */
.notepad-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 450px;
    height: 320px;
    background: linear-gradient(135deg,
        #2a2a3a 0%,
        #1a1a2a 25%,
        #3a2a2a 50%,
        #2a2a1a 75%,
        #1a1a2a 100%);
    border: 2px solid;
    border-image: linear-gradient(45deg,
        #4a4a5a,
        #3a3a4a,
        #5a4a4a,
        #4a4a3a,
        #3a3a4a) 1;
    border-radius: 8px;
    box-shadow:
        0 0 15px rgba(74, 74, 90, 0.3),
        0 0 30px rgba(58, 58, 74, 0.2),
        0 0 45px rgba(90, 74, 74, 0.15),
        inset 0 0 15px rgba(0, 0, 0, 0.4);
    z-index: 10000;
    font-family: 'Courier New', monospace;
    animation: melancholicPulse 8s ease-in-out infinite;
    resize: both;
    min-width: 350px;
    min-height: 250px;
    max-width: 80vw;
    max-height: 70vh;
    overflow: hidden;
}

@keyframes melancholicPulse {
    0%, 100% {
        filter: brightness(0.9) saturate(0.7) hue-rotate(0deg);
        box-shadow:
            0 0 15px rgba(74, 74, 90, 0.3),
            0 0 30px rgba(58, 58, 74, 0.2),
            0 0 45px rgba(90, 74, 74, 0.15),
            inset 0 0 15px rgba(0, 0, 0, 0.4);
    }
    50% {
        filter: brightness(0.95) saturate(0.8) hue-rotate(15deg);
        box-shadow:
            0 0 20px rgba(74, 74, 90, 0.4),
            0 0 35px rgba(58, 58, 74, 0.25),
            0 0 50px rgba(90, 74, 74, 0.2),
            inset 0 0 20px rgba(0, 0, 0, 0.5);
    }
}

/* Title Bar */
.notepad-titlebar {
    height: 28px;
    background: linear-gradient(90deg,
        #4a4a4a 0%,
        #5a5a5a 20%,
        #4a4a4a 40%,
        #5a5a5a 60%,
        #4a4a4a 80%,
        #404040 100%);
    border-bottom: 1px solid #666666;
    border-radius: 6px 6px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 0 5px rgba(0, 0, 0, 0.3);
}

.notepad-titlebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg,
        transparent 40%,
        rgba(102, 102, 102, 0.1) 50%,
        transparent 60%);
    animation: subtleShimmer 12s linear infinite;
}

@keyframes subtleShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.titlebar-left {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #cccccc;
    font-weight: normal;
    font-size: 12px;
    text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.5);
    font-family: 'Courier New', monospace;
}

.notepad-icon {
    font-size: 14px;
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.3));
    text-shadow: 0 0 3px rgba(255, 255, 255, 0.2);
}

.titlebar-buttons {
    display: flex;
    gap: 2px;
}

.titlebar-btn {
    width: 18px;
    height: 16px;
    border: 1px solid;
    border-color: #666 #333 #333 #666;
    background: linear-gradient(135deg, #888 0%, #666 100%);
    color: #ffffff;
    font-size: 10px;
    font-weight: normal;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border-radius: 2px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 0 3px rgba(0, 0, 0, 0.3);
}

.titlebar-btn:hover {
    background: linear-gradient(135deg, #999 0%, #777 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 0 5px rgba(0, 0, 0, 0.5);
    transform: translateY(-1px);
}

.titlebar-btn.close {
    background: linear-gradient(135deg, #aa6666 0%, #884444 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 0 3px rgba(136, 68, 68, 0.3);
}

.titlebar-btn.close:hover {
    background: linear-gradient(135deg, #bb7777 0%, #995555 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 0 5px rgba(136, 68, 68, 0.5);
}

/* Menu Bar */
.notepad-menubar {
    height: 20px;
    background: linear-gradient(90deg,
        #3a3a3a 0%,
        #4a4a4a 25%,
        #3a3a3a 50%,
        #4a4a4a 75%,
        #3a3a3a 100%);
    border-bottom: 1px solid #555555;
    display: flex;
    align-items: center;
    padding: 0 10px;
    gap: 10px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.menu-item {
    color: #aaaaaa;
    font-size: 11px;
    padding: 2px 6px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    border-radius: 2px;
    font-family: 'Courier New', monospace;
    font-weight: normal;
}

.menu-item:hover {
    background: rgba(102, 102, 102, 0.2);
    border-color: rgba(102, 102, 102, 0.5);
    color: #cccccc;
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.3);
}

/* Content Area */
.notepad-content {
    flex: 1;
    background: linear-gradient(135deg,
        #1a1a1a 0%,
        #2a2a2a 25%,
        #1a1a1a 50%,
        #2a2a2a 75%,
        #1a1a1a 100%);
    border: 1px solid #444444;
    margin: 4px;
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.5);
}

.notepad-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center,
        rgba(64, 64, 64, 0.05) 0%,
        rgba(32, 32, 32, 0.03) 50%,
        transparent 100%);
    pointer-events: none;
}

/* Content Area */
.notepad-content {
    flex: 1;
    background: linear-gradient(135deg,
        #000033 0%,
        #000066 25%,
        #003300 50%,
        #330033 75%,
        #000033 100%);
    border: 2px solid #00ffff;
    margin: 6px;
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.notepad-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center,
        rgba(0, 255, 255, 0.1) 0%,
        rgba(255, 0, 255, 0.05) 50%,
        transparent 100%);
    pointer-events: none;
}

.notepad-textarea {
    width: 100%;
    height: 100%;
    padding: 12px;
    background: transparent;
    color: #cccccc;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.4;
    border: none;
    outline: none;
    resize: none;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    z-index: 1;
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.2);
    word-wrap: break-word;
    white-space: pre-wrap;
}

/* Melancholic Custom Scrollbar */
.notepad-textarea::-webkit-scrollbar {
    width: 14px;
}

.notepad-textarea::-webkit-scrollbar-track {
    background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 100%);
    border-radius: 6px;
    margin: 4px;
}

.notepad-textarea::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg,
        #666666 0%,
        #777777 50%,
        #666666 100%);
    border-radius: 6px;
    border: 2px solid #2a2a2a;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
}

.notepad-textarea::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg,
        #777777 0%,
        #888888 50%,
        #777777 100%);
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.notepad-textarea::-webkit-scrollbar-corner {
    background: #1a1a1a;
}

.memory-fragment {
    white-space: pre-line;
}

.glitch-text {
    display: block;
    margin: 6px 0;
    animation: melancholicGlitch 8s ease-in-out infinite;
    color: #888888;
    text-shadow: 0 0 3px rgba(136, 136, 136, 0.4);
}

@keyframes melancholicGlitch {
    0%, 90%, 100% {
        transform: translateX(0);
        color: #888888;
        text-shadow: 0 0 3px rgba(136, 136, 136, 0.4);
    }
    92% {
        transform: translateX(-1px);
        color: #777777;
        text-shadow: 1px 0 rgba(119, 119, 119, 0.3);
    }
    94% {
        transform: translateX(1px);
        color: #999999;
        text-shadow: -1px 0 rgba(153, 153, 153, 0.3);
    }
    96% {
        transform: translateX(0);
        color: #888888;
        text-shadow: 0 0 3px rgba(136, 136, 136, 0.4);
    }
}

.corrupted-text {
    color: #666666;
    text-shadow: 0 0 4px rgba(102, 102, 102, 0.5), 0 0 8px rgba(102, 102, 102, 0.2);
    animation: melancholicCorruption 8s ease-in-out infinite;
    font-weight: normal;
}

@keyframes melancholicCorruption {
    0%, 100% {
        opacity: 0.8;
        filter: brightness(0.9);
    }
    25% {
        opacity: 0.9;
        filter: brightness(0.95);
    }
    50% {
        opacity: 0.7;
        filter: brightness(0.85);
    }
    75% {
        opacity: 0.9;
        filter: brightness(0.95);
    }
}

@keyframes corruptionPulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

.scroll-indicator {
    color: #888888;
    font-weight: normal;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.9), 0 0 20px rgba(0, 255, 255, 0.5);
    animation: y2kGlow 2s ease-in-out infinite alternate;
    background: rgba(0, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(0, 255, 255, 0.3);
}

@keyframes y2kGlow {
    0% {
        text-shadow: 0 0 10px rgba(0, 255, 255, 0.9), 0 0 20px rgba(0, 255, 255, 0.5);
        background: rgba(0, 255, 255, 0.1);
    }
    100% {
        text-shadow: 0 0 15px rgba(0, 255, 255, 1.2), 0 0 30px rgba(0, 255, 255, 0.8);
        background: rgba(0, 255, 255, 0.2);
    }
}

.warning-text {
    color: #ff4500;
    font-weight: bold;
    text-shadow: 0 0 8px rgba(255, 69, 0, 1), 0 0 16px rgba(255, 69, 0, 0.6);
    animation: y2kWarning 1.5s ease-in-out infinite;
    background: rgba(255, 69, 0, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(255, 69, 0, 0.3);
}

@keyframes y2kWarning {
    0%, 50%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    25%, 75% {
        opacity: 0.7;
        transform: scale(1.02);
    }
}

@keyframes warningBlink {
    0%, 50%, 100% { opacity: 1; }
    25%, 75% { opacity: 0.3; }
}

/* Status Bar */
.notepad-statusbar {
    height: 22px;
    background: linear-gradient(90deg,
        #3a3a3a 0%,
        #4a4a4a 30%,
        #3a3a3a 70%,
        #2a2a2a 100%);
    border-top: 2px solid #555555;
    border-radius: 0 0 10px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    font-size: 10px;
    color: #cccccc;
    font-family: 'Courier New', monospace;
    font-weight: normal;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.status-text {
    color: #888888;
    font-weight: normal;
    text-shadow: 0 0 2px rgba(136, 136, 136, 0.3);
    animation: melancholicStatusGlow 8s ease-in-out infinite alternate;
}

@keyframes melancholicStatusGlow {
    0% { text-shadow: 0 0 2px rgba(136, 136, 136, 0.3); }
    100% { text-shadow: 0 0 3px rgba(136, 136, 136, 0.5), 0 0 5px rgba(136, 136, 136, 0.2); }
}

/* Resize Handle */
.resize-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg,
        #666666 0%,
        #777777 50%,
        #666666 100%);
    cursor: nw-resize;
    border-top: 2px solid #888888;
    border-left: 2px solid #888888;
    clip-path: polygon(100% 0%, 0% 100%, 100% 100%);
    box-shadow: 0 0 3px rgba(136, 136, 136, 0.3);
    z-index: 10;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .notepad-container {
        width: 90vw;
        height: 60vh;
        max-width: 500px;
    }
    
    .notepad-textarea {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .notepad-container {
        width: 95vw;
        height: 50vh;
    }
    
    .notepad-titlebar {
        height: 24px;
        padding: 0 4px;
    }
    
    .titlebar-left {
        font-size: 10px;
    }
    
    .menu-item {
        font-size: 10px;
        padding: 1px 4px;
    }
}

/* Easter Egg Question Mark */
.easter-egg-question {
    position: fixed;
    bottom: 120px;
    right: 80px;
    font-size: 18px;
    color: rgba(136, 136, 136, 0.3);
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    z-index: 50;
    transition: all 0.3s ease;
    transform: rotate(15deg);
    text-shadow: 0 0 3px rgba(136, 136, 136, 0.2);
    -webkit-user-select: none;
    user-select: none;
}

.easter-egg-question:hover {
    color: rgba(136, 136, 136, 0.6);
    transform: rotate(15deg) scale(1.2);
    text-shadow: 0 0 8px rgba(136, 136, 136, 0.4);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background-color: rgba(0,0,0,0.9);
    border: 2px solid var(--text-color);
    border-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10"><rect x="0" y="0" width="10" height="10" fill="transparent"/><path d="M0,0 H10 V10 H0 Z M1,1 H9 V9 H1 Z" fill="%23c0f0c0"/></svg>') 3 repeat;
    border-width: 2px;
    border-style: solid;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-bleed);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

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

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--text-color);
    background: linear-gradient(90deg, rgba(20, 20, 20, 0.8) 0%, rgba(40, 40, 40, 0.8) 100%);
    border-radius: 8px 8px 0 0;
    position: relative;
}

.modal-title {
    color: var(--accent-color-2);
    font-family: 'Press Start 2P', cursive;
    font-size: 1.1em;
    margin: 0;
    text-shadow: var(--shadow-bleed);
    text-align: center;
}

/* Specific content spacing for About modal on homepage */
.about-body {
    padding: 16px;
    line-height: 1.6;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: rgba(102, 153, 255, 0.2);
    color: var(--accent-color-2);
}

.modal-body {
    padding: 20px;
    color: var(--text-color);
    font-family: 'Handlee', cursive;
    font-size: 1.2em;
    line-height: 1.4;
    text-align: justify;
}

.modal-body p {
    margin-bottom: 1em;
}

/* Scribble Underline Effect in Modal */
.modal-body .scribble-underline {
    display: inline-block;
    position: relative;
}
.modal-body .scribble-underline::after {
    content: '';
    position: absolute;
    left: -5px;
    right: -5px;
    bottom: -5px;
    height: 2px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="2"><path d="M0,1 Q2.5,0 5,1 T10,1" stroke="%23ff6699" fill="none"/></svg>');
    background-repeat: repeat-x;
    background-size: 10px 2px;
}

/* Modal Scrollbar */
.modal-content::-webkit-scrollbar {
    width: 8px;
}
.modal-content::-webkit-scrollbar-track {
    background: #111;
    border: 1px solid #333;
}
.modal-content::-webkit-scrollbar-thumb {
    background-color: #555;
    border: 1px solid #777;
}
.modal-content::-webkit-scrollbar-thumb:hover {
    background-color: #888;
}

/* --- Root Variables (Dependencies for colors/shadows) --- */
:root {
    --crt-bg-color: #0d120a; /* Dark, almost black green */
    --text-color: #c0f0c0; /* Pale green/white */
    --accent-color-1: #ff6699; /* Pale pink */
    --accent-color-2: #6699ff; /* Muted blue */
    --shadow-bleed: 0 0 5px var(--accent-color-1), 0 0 10px var(--accent-color-2);
    --border-glitch-color: rgba(255, 0, 0, 0.3); /* Reddish tint for border glitches */
}

/* Main Flex Layout for the two columns */
.main-layout {
    max-width: 900px; /* Early 2000s typical webpage width */
    width: 95%;
    margin: 0 auto; /* Center the layout */
    display: flex;
    padding: 20px;
    gap: 20px;
    position: relative;
    z-index: 14;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid var(--text-color);
    border-radius: 8px;
    box-shadow: var(--shadow-bleed);
}


/* --- Right Column: Introduction Panel --- */
.intro-panel {
    flex: 1; /* Smaller sidebar-like panel */
    background-color: rgba(0,0,0,0.5);
    border: 2px solid var(--text-color);
    padding: 15px;
    overflow-y: auto;
    font-size: 0.9em;
    line-height: 1.5;
    position: relative;
    /* Irregular border from sketch (using SVG data URI) */
    border-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10"><rect x="0" y="0" width="10" height="10" fill="transparent"/><path d="M0,0 H10 V10 H0 Z M1,1 H9 V9 H1 Z" fill="%23c0f0c0"/></svg>') 3 repeat;
    border-width: 2px;
    border-style: solid;
    max-height: 400px; /* More compact than memory archive */
}
.intro-panel h3 {
    font-family: 'Press Start 2P', cursive;
    font-size: 1.1em;
    margin-bottom: 10px;
    color: var(--accent-color-2);
    text-shadow: var(--shadow-bleed);
    text-align: center;
}
.intro-panel p {
    margin-bottom: 1em;
}

/* Scribble Underline Effect */
.intro-panel .scribble-underline {
    display: inline-block;
    position: relative;
}
.intro-panel .scribble-underline::after {
    content: '';
    position: absolute;
    left: -5px;
    right: -5px;
    bottom: -5px;
    height: 2px;
    /* SVG Data URI for a squiggly line */
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="2"><path d="M0,1 Q2.5,0 5,1 T10,1" stroke="%23ff6699" fill="none"/></svg>');
    background-repeat: repeat-x;
    background-size: 10px 2px;
}

/* --- Common Border Glitch Effect --- */
.border-glitch::before {
    content: '';
    position: absolute;
    top: -2px; left: -2px; right: -2px; bottom: -2px;
    border: 2px solid transparent;
    animation: border-glitch-anim 0.5s infinite alternate;
    pointer-events: none;
    z-index: 20;
}
@keyframes border-glitch-anim {
    0% { border-color: transparent; }
    30% { border-color: var(--border-glitch-color); }
    60% { border-color: transparent; }
    100% { border-color: var(--border-glitch-color); }
}

/* Scrollbar styling for a retro look (Webkit browsers) */
.intro-panel::-webkit-scrollbar { width: 8px; }
.intro-panel::-webkit-scrollbar-track { background: #111; border: 1px solid #333; }
.intro-panel::-webkit-scrollbar-thumb { background-color: #555; border: 1px solid #777; }
.intro-panel::-webkit-scrollbar-thumb:hover { background-color: #888; }

/* Responsive adjustments for mobile/tablet */
@media (max-width: 768px) {
    .main-layout {
        flex-direction: column; /* Stacks columns vertically on small screens */
        max-width: 95%;
        padding: 15px;
        gap: 15px;
    }
    
    .intro-panel {
        max-height: none; /* Allow full height on mobile */
    }
}

/* Memory Archive styles removed */