/**
 * styles.css - Angel Percs™ Enhanced Stylesheet
 * Version 2.0 - Optimized for performance, accessibility, and maintainability
 * 
 * Table of Contents:
 * 1. CSS Variables & Root Styles
 * 2. General & Body Styles
 * 3. Navigation & Header Elements
 * 4. General Components (Buttons, Grids, etc.)
 * 5. Hero Section
 * 6. Character Page Styles
 * 7. Diagnostic Scan Styles
 * 8. Data Archive Page Styles
 * 9. Store Page Styles
 * 10. Admin Password Section
 * 11. Warning Section
 * 12. Footer Styles
 * 13. Global Glitch Effects
 * 14. Terminal Page Styles
 * 15. Responsive Styles
 * 16. Accessibility Improvements
 * 17. Print Styles
 * 18. Utility Classes
 */

/* ============================================================================
   1. CSS VARIABLES & ROOT STYLES
   ============================================================================ */
:root {
    /* Color Palette */
    --bg-color: #08001a;
    --text-color: #aaccff;
    
    /* Fonts */
    --font-primary: 'Press Start 2P', cursive;
    --font-secondary: 'Share Tech Mono', monospace;
    --font-tibetan: 'Noto Sans Tibetan', sans-serif;

    /* Neon Colors */
    --neon-green: #00FF00;
    --neon-purple: #7777FF;
    --neon-red: #FF0000;
    --neon-yellow: #FFCC00;
    --neon-magenta: #FF00FF;
    --neon-cyan: #00FFFF;
    
    /* Timing Functions */
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ============================================================================
   2. GENERAL & BODY STYLES
   ============================================================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
}

body {
    font-family: var(--font-secondary);
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    text-align: center;
    line-height: 1.6;
    background-image:
        radial-gradient(circle at 1px 1px, rgba(119, 119, 255, 0.2) 1px, transparent 0),
        radial-gradient(circle at 10px 10px, rgba(119, 119, 255, 0.1) 1px, transparent 0);
    background-size: 20px 20px;
    background-attachment: fixed;
    position: relative;
    min-height: 100vh;
}

/* Scanline effect overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15),
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 9999;
    animation: scanlines 8s linear infinite;
}

@keyframes scanlines {
    0% { transform: translateY(0); }
    100% { transform: translateY(10px); }
}

/* Chromatic aberration on scroll */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, transparent 0%, rgba(8, 0, 26, 0.3) 100%);
    pointer-events: none;
    z-index: 1;
    mix-blend-mode: multiply;
}

.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background: radial-gradient(ellipse at center, rgba(8, 0, 26, 0.95) 0%, rgba(0, 0, 0, 0.98) 100%);
    border: 1px solid var(--neon-purple);
    box-shadow: 
        0 0 25px rgba(119, 119, 255, 0.5), 
        inset 0 0 15px rgba(119, 119, 255, 0.3),
        0 0 50px rgba(119, 119, 255, 0.2);
    position: relative;
    z-index: 10;
}

/* Container glow pulse */
.container::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--neon-purple), var(--neon-cyan), var(--neon-magenta), var(--neon-purple));
    background-size: 300% 300%;
    z-index: -1;
    filter: blur(10px);
    opacity: 0.3;
    animation: borderPulse 6s ease infinite;
}

@keyframes borderPulse {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

h1, h2, h3 {
    font-family: var(--font-primary);
    color: var(--neon-green);
    text-shadow: 
        0 0 10px var(--neon-green), 
        0 0 20px rgba(0,255,0,0.5),
        0 0 30px rgba(0,255,0,0.3);
    margin-bottom: 25px;
    letter-spacing: 2px;
}

h1 { 
    font-size: 2.2em; 
    text-transform: uppercase;
    animation: titleGlow 3s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    from { text-shadow: 0 0 10px var(--neon-green), 0 0 20px rgba(0,255,0,0.5); }
    to { text-shadow: 0 0 20px var(--neon-green), 0 0 40px rgba(0,255,0,0.8), 0 0 60px rgba(0,255,0,0.4); }
}

h2 { font-size: 1.6em; }
h3 { 
    font-size: 1.2em; 
    color: var(--neon-yellow); 
    text-shadow: 0 0 8px var(--neon-yellow), 0 0 15px rgba(255, 204, 0, 0.5); 
}

/* ============================================================================
   3. NAVIGATION & HEADER ELEMENTS
   ============================================================================ */
.main-nav {
    background: rgba(0,0,0,0.8);
    border-bottom: 2px solid var(--neon-magenta);
    padding: 15px;
    text-align: right;
    position: sticky; 
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(12px) saturate(150%);
    box-shadow: 0 4px 20px rgba(255, 0, 255, 0.3);
}

.main-nav a {
    font-family: var(--font-primary);
    color: var(--neon-cyan);
    text-decoration: none;
    margin: 0 15px;
    font-size: 0.9em;
    transition: all 0.3s ease;
    position: relative;
    padding: 5px 10px;
}

.main-nav a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--neon-magenta);
    transform: translateX(-50%);
    transition: width 0.3s ease;
}

.main-nav a:hover::before {
    width: 100%;
}

.main-nav a:hover {
    color: var(--neon-magenta);
    text-shadow: 
        0 0 10px var(--neon-magenta),
        0 0 20px rgba(255, 0, 255, 0.6);
    transform: translateY(-2px);
}

.propaganda-ticker {
    background: linear-gradient(90deg, #000 0%, #110011 50%, #000 100%);
    color: var(--neon-yellow);
    padding: 10px 0;
    overflow: hidden;
    white-space: nowrap;
    border-bottom: 2px solid var(--neon-yellow);
    box-shadow: 
        0 0 10px var(--neon-yellow),
        0 4px 15px rgba(255, 204, 0, 0.3);
    position: relative;
}

.propaganda-ticker::before {
    content: '⚠️';
    position: absolute;
    left: 10px;
    animation: warningBlink 1s infinite;
}

@keyframes warningBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.propaganda-ticker span {
    display: inline-block;
    padding-left: 100%;
    animation: ticker-scroll 30s linear infinite;
    font-weight: bold;
}

@keyframes ticker-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

.ascension-tracker { 
    text-align: right; 
    font-size: 0.9em; 
    color: var(--neon-purple); 
    margin-bottom: 15px;
    font-family: var(--font-primary);
}

.ascension-tracker span {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(119, 119, 255, 0.1);
    border: 1px solid var(--neon-purple);
    margin-left: 10px;
    animation: counterGlow 2s ease-in-out infinite;
}

@keyframes counterGlow {
    0%, 100% { box-shadow: 0 0 5px rgba(119, 119, 255, 0.3); }
    50% { box-shadow: 0 0 15px rgba(119, 119, 255, 0.6); }
}

.logo-img {
    max-width: 300px;
    height: auto;
    margin: 20px auto;
    display: block;
    filter: drop-shadow(0 0 20px rgba(0, 255, 255, 0.6));
    animation: logoFloat 4s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.shen-apparition {
    position: fixed; 
    bottom: 20px; 
    right: 20px;
    width: 120px; 
    height: 120px;
    background-image: url('https://res.cloudinary.com/dedzcha7h/image/upload/v1758065925/Shen_the_fallen_jhyjzy.png');
    background-size: contain; 
    background-repeat: no-repeat;
    z-index: 998; 
    pointer-events: none;
    animation: flicker-shen 15s infinite ease-in-out 3s;
    filter: drop-shadow(0 0 10px rgba(255, 0, 255, 0.5));
}

@keyframes flicker-shen {
    0%, 100%, 5.1%, 95% { 
        opacity: 0; 
        transform: translate(5px, -5px) scale(0.95); 
        filter: drop-shadow(0 0 10px rgba(255, 0, 255, 0.5));
    }
    5%, 95.1% { 
        opacity: 0.8; 
        transform: translate(0, 0) scale(1); 
        filter: drop-shadow(0 0 20px rgba(255, 0, 255, 0.8));
    }
    50% {
        filter: hue-rotate(30deg) drop-shadow(0 0 25px rgba(255, 0, 255, 1));
    }
}

/* ============================================================================
   4. GENERAL COMPONENTS (BUTTONS, GRIDS, ETC.)
   ============================================================================ */
.btn {
    display: inline-block; 
    background: transparent; 
    color: var(--neon-green);
    padding: 15px 30px; 
    border: 2px solid var(--neon-green);
    box-shadow: 
        0 0 15px rgba(0, 255, 0, 0.5), 
        inset 0 0 5px rgba(0, 255, 0, 0.3);
    transition: all 0.3s ease; 
    font-size: 1.1em; 
    cursor: pointer;
    text-transform: uppercase; 
    font-family: var(--font-primary); 
    margin: 10px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(0, 255, 0, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:hover {
    background-color: var(--neon-green); 
    color: var(--bg-color);
    box-shadow: 
        0 0 25px var(--neon-green),
        0 0 50px rgba(0, 255, 0, 0.5);
    transform: scale(1.05) translateY(-2px);
}

.btn:active {
    transform: scale(0.98) translateY(0);
}

.btn-small { 
    padding: 10px 20px; 
    font-size: 0.9em; 
}

.pulse {
    animation: pulseButton 2.8s ease-in-out infinite;
}

@keyframes pulseButton {
    0%, 100% { 
        box-shadow: 0 0 15px rgba(0, 255, 0, 0.5), inset 0 0 5px rgba(0, 255, 0, 0.3); 
    }
    50% { 
        box-shadow: 0 0 30px rgba(0, 255, 0, 0.8), inset 0 0 10px rgba(0, 255, 0, 0.5);
    }
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.feature-item {
    background: rgba(119, 119, 255, 0.05);
    padding: 25px;
    border: 1px solid transparent;
    border-image: linear-gradient(135deg, var(--neon-purple), var(--neon-magenta), var(--neon-cyan)) 1;
    box-shadow: inset 0 0 10px rgba(119, 119, 255, 0.2);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.feature-item::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(119, 119, 255, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s;
}

.feature-item:hover::before {
    opacity: 1;
    animation: rotateGradient 3s linear infinite;
}

@keyframes rotateGradient {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.feature-item:hover {
    transform: translateY(-5px);
    background: rgba(119, 119, 255, 0.15);
    box-shadow: 
        0 0 20px var(--neon-cyan), 
        inset 0 0 15px rgba(119, 119, 255, 0.3),
        0 10px 30px rgba(0, 255, 255, 0.2);
    border-image: linear-gradient(135deg, var(--neon-cyan), var(--neon-magenta), var(--neon-purple)) 1;
}

.feature-img, .hero-img {
    width: 100%;
    max-width: 100%;
    height: auto;
    border: 2px solid var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
    transition: all 0.3s ease;
}

/* Scale down hero video specifically */
.hero-img {
    width: 70%;
    max-width: 800px;
    margin: 0 auto;
    display: block;
}

.feature-img:hover, .hero-img:hover {
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.8);
    transform: scale(1.02);
    filter: brightness(1.1);
}

.hidden-content { 
    display: none; 
}

.glitch-text { 
    animation: glitchText 1s steps(2, end) infinite; 
    position: relative;
}

@keyframes glitchText {
    0%, 100% { 
        text-shadow: 
            2px 0 0 var(--neon-red), 
            -2px 0 0 var(--neon-cyan); 
    }
    25% {
        text-shadow: 
            -2px 0 0 var(--neon-red), 
            2px 0 0 var(--neon-cyan);
    }
    50% { 
        text-shadow: 
            2px 2px 0 var(--neon-red), 
            -2px -2px 0 var(--neon-cyan); 
    }
    75% {
        text-shadow: 
            -2px 2px 0 var(--neon-red), 
            2px -2px 0 var(--neon-cyan);
    }
}

.glitch-btn {
    display: inline-block;
    transition: all 0.3s ease;
    filter: drop-shadow(0 0 10px rgba(0, 255, 255, 0.5));
}

.glitch-btn:hover {
    filter: 
        drop-shadow(0 0 20px rgba(0, 255, 255, 0.8))
        drop-shadow(0 0 40px rgba(0, 255, 255, 0.4));
    transform: scale(1.05);
    animation: btnGlitch 0.3s infinite;
}

@keyframes btnGlitch {
    0%, 100% { transform: scale(1.05) translate(0, 0); }
    25% { transform: scale(1.05) translate(-2px, 2px); }
    50% { transform: scale(1.05) translate(2px, -2px); }
    75% { transform: scale(1.05) translate(-2px, -2px); }
}

/* ============================================================================
   5. HERO SECTION
   ============================================================================ */
.hero {
    margin: 40px 0;
    padding: 30px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid var(--neon-purple);
    box-shadow: inset 0 0 30px rgba(119, 119, 255, 0.2);
}

/* ============================================================================
   6. CHARACTER PAGE STYLES
   ============================================================================ */
.character-profile {
    margin-top: 40px; 
    padding: 30px;
    border: 2px solid var(--neon-purple);
    background: linear-gradient(135deg, rgba(10, 0, 20, 0.9) 0%, rgba(20, 0, 30, 0.8) 100%);
    text-align: left;
    position: relative;
    overflow: hidden;
}

.character-profile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent 30%, rgba(119, 119, 255, 0.05) 50%, transparent 70%);
    background-size: 200% 200%;
    animation: shimmer 10s ease infinite;
    pointer-events: none;
}

@keyframes shimmer {
    0% { background-position: 0% 0%; }
    50% { background-position: 100% 100%; }
    100% { background-position: 0% 0%; }
}

.character-header { 
    display: flex; 
    align-items: center; 
    gap: 25px; 
    margin-bottom: 20px; 
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.character-portrait {
    width: 150px; 
    height: 150px; 
    border-radius: 50%;
    border: 3px solid var(--neon-cyan); 
    object-fit: cover;
    animation: holographicEcho 5s infinite alternate;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.6);
}

@keyframes holographicEcho {
    0% { 
        box-shadow: 0 0 15px var(--neon-cyan);
        transform: scale(1); 
        filter: hue-rotate(0deg);
    }
    50% {
        filter: hue-rotate(20deg);
    }
    100% { 
        box-shadow: 0 0 30px var(--neon-magenta), 0 0 50px rgba(255, 0, 255, 0.4);
        transform: scale(1.03); 
        filter: hue-rotate(0deg);
    }
}

.character-bio {
    line-height: 1.8;
    color: var(--text-color);
    position: relative;
    z-index: 1;
}

.interactive-lore {
    margin-top: 30px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px dashed var(--neon-yellow);
    position: relative;
    z-index: 1;
}

.interactive-trigger {
    width: 100px; 
    height: auto; 
    cursor: pointer;
    border: 2px solid transparent; 
    transition: all 0.3s ease;
    filter: brightness(0.8) saturate(0.5);
}

.interactive-trigger:hover {
    border-color: var(--neon-yellow);
    filter: brightness(1.2) saturate(1) drop-shadow(0 0 10px var(--neon-yellow));
    transform: scale(1.1) rotate(3deg);
}

.console-ui {
    margin-top: 15px; 
    padding: 15px; 
    background: #000;
    border: 1px solid var(--neon-green);
    box-shadow: inset 0 0 10px rgba(0, 255, 0, 0.2);
}

.console-ui input { 
    background: #001100; 
    border: 1px solid var(--neon-green); 
    color: var(--neon-green); 
    padding: 8px; 
    margin-right: 10px;
    font-family: var(--font-secondary);
    transition: all 0.3s ease;
}

.console-ui input:focus {
    outline: none;
    border-color: var(--neon-cyan);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.console-output { 
    margin-top: 10px; 
    color: var(--neon-yellow); 
    font-style: italic; 
    min-height: 24px; 
    white-space: pre-wrap; 
    overflow: hidden;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.console-output.success { 
    color: var(--neon-green);
    text-shadow: 0 0 5px var(--neon-green);
}

.console-output.error { 
    color: var(--neon-red);
    text-shadow: 0 0 5px var(--neon-red);
    animation: shakeError 0.3s ease;
}

@keyframes shakeError {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* ============================================================================
   7. DIAGNOSTIC SCAN STYLES
   ============================================================================ */
.scan-bar {
    width: 100%;
    height: 30px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid var(--neon-cyan);
    position: relative;
    overflow: hidden;
}

.scan-progress {
    height: 100%;
    background: linear-gradient(90deg, 
        var(--neon-cyan) 0%, 
        var(--neon-green) 50%, 
        var(--neon-cyan) 100%);
    background-size: 200% 100%;
    width: 0;
    transition: width 4s ease;
}

.scan-progress.scanning {
    width: 100%;
    animation: scanPulse 4s ease forwards;
}

@keyframes scanPulse {
    0% { 
        width: 0%; 
        background-position: 0% 50%;
    }
    100% { 
        width: 100%; 
        background-position: 100% 50%;
    }
}

/* ============================================================================
   8. DATA ARCHIVE PAGE STYLES
   ============================================================================ */
.loader { 
    border: 4px solid rgba(255, 255, 255, 0.1); 
    border-top: 4px solid var(--neon-magenta); 
    border-radius: 50%; 
    width: 40px; 
    height: 40px; 
    animation: spin 1s linear infinite; 
    margin: 20px auto; 
}

@keyframes spin { 
    0% { transform: rotate(0deg); } 
    100% { transform: rotate(360deg); } 
}

.trace-memory {
    color: var(--neon-magenta); 
    cursor: pointer;
    font-weight: bold; 
    text-shadow: 0 0 5px var(--neon-magenta);
    transition: all 0.2s ease;
    position: relative;
}

.trace-memory:hover {
    color: var(--neon-cyan);
    text-shadow: 0 0 10px var(--neon-cyan);
    transform: scale(1.05);
}

.echo-popup {
    position: fixed; 
    background: rgba(0,0,0,0.95);
    border: 2px solid var(--neon-magenta); 
    padding: 15px;
    color: var(--neon-magenta); 
    z-index: 2000; 
    pointer-events: none;
    transition: opacity 1s ease-out; 
    max-width: 250px;
    border-radius: 8px; 
    box-shadow: 0 0 25px var(--neon-magenta), inset 0 0 10px rgba(255, 0, 255, 0.2);
    animation: popupAppear 0.3s ease;
}

@keyframes popupAppear {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

#archive-display {
    border: 2px dashed var(--neon-yellow); 
    background: rgba(20,20,0,0.3);
    padding: 20px; 
    text-align: left;
    box-shadow: inset 0 0 20px rgba(255, 204, 0, 0.1);
}

/* ============================================================================
   9. STORE PAGE STYLES
   ============================================================================ */
.glimmer-overlay {
    position: fixed; 
    top: 0; 
    left: 0;
    width: 100vw; 
    height: 100vh;
    background: rgba(0,0,0,0.95); 
    color: var(--neon-cyan);
    font-family: var(--font-primary); 
    display: none;
    justify-content: center; 
    align-items: center;
    text-align: center; 
    z-index: 3000; 
    font-size: 2em;
    animation: glimmerPulse 1s ease infinite;
}

.glimmer-overlay.frosted-panel {
    background:
        linear-gradient(180deg, rgba(8,0,26,0.88), rgba(0,0,0,0.92)),
        repeating-linear-gradient(0deg, rgba(255,255,255,0.035) 0 1px, transparent 1px 12px);
    border: 1px solid rgba(255,176,0,0.42);
    padding: 28px;
    line-height: 1.35;
    text-shadow: 0 0 20px rgba(0,255,255,0.65);
}

@keyframes glimmerPulse {
    0%, 100% { 
        text-shadow: 0 0 20px var(--neon-cyan);
        opacity: 0.9;
    }
    50% { 
        text-shadow: 0 0 40px var(--neon-cyan), 0 0 80px rgba(0, 255, 255, 0.5);
        opacity: 1;
    }
}

.testimonials .feature-item {
    border-color: var(--neon-yellow);
    background: rgba(255, 204, 0, 0.05);
    border-width: 2px;
}

/* ============================================================================
   10. ADMIN PASSWORD SECTION
   ============================================================================ */
.admin-password-section {
    margin: 40px 0;
    padding: 30px;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid var(--neon-magenta);
    box-shadow: inset 0 0 20px rgba(255, 0, 255, 0.2);
}

.admin-password-section input {
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid var(--neon-cyan);
    color: var(--neon-cyan);
    font-family: var(--font-secondary);
    font-size: 1.1em;
    margin: 10px;
    transition: all 0.3s ease;
}

.admin-password-section input:focus {
    outline: none;
    border-color: var(--neon-magenta);
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.5);
}

#codeOutput {
    margin-top: 20px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid var(--neon-green);
    box-shadow: inset 0 0 15px rgba(0, 255, 0, 0.2);
    transition: all 0.3s ease;
}

/* ============================================================================
   11. WARNING SECTION
   ============================================================================ */
.warning {
    margin: 40px 0;
    padding: 25px;
    background: rgba(255, 0, 0, 0.05);
    border: 2px solid var(--neon-red);
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.3), inset 0 0 10px rgba(255, 0, 0, 0.1);
    position: relative;
}

.warning::before {
    content: '⚠️';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 2em;
    animation: warningBlink 1.5s infinite;
}

.warning ul {
    list-style: none;
    padding-left: 0;
    text-align: left;
}

.warning li {
    padding: 10px 0;
    padding-left: 30px;
    position: relative;
}

.warning li::before {
    content: '⚡';
    position: absolute;
    left: 0;
    color: var(--neon-red);
    animation: warningPulse 2s infinite;
}

@keyframes warningPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

/* ============================================================================
   12. FOOTER STYLES
   ============================================================================ */
.footer {
    margin-top: 50px;
    padding: 30px;
    background: rgba(0, 0, 0, 0.7);
    border-top: 2px solid var(--neon-purple);
    box-shadow: 0 -4px 20px rgba(119, 119, 255, 0.3);
}

/* ============================================================================
   13. GLOBAL GLITCH EFFECTS
   ============================================================================ */
body.karma-glitch { 
    animation: karmaGlitchEffect 0.5s 3; 
}

@keyframes karmaGlitchEffect {
    0% { 
        filter: hue-rotate(0deg) saturate(1) brightness(1); 
        transform: translate(0, 0);
    }
    20% {
        filter: hue-rotate(90deg) saturate(3) brightness(1.3);
        transform: translate(-5px, 2px) skew(2deg, -2deg);
    }
    40% {
        filter: hue-rotate(180deg) saturate(5) brightness(1.5);
        transform: translate(5px, -2px) skew(-2deg, 2deg);
    }
    60% {
        filter: hue-rotate(270deg) saturate(3) brightness(1.3);
        transform: translate(-3px, 3px) skew(1deg, -1deg);
    }
    80% {
        filter: hue-rotate(360deg) saturate(2) brightness(1.2);
        transform: translate(3px, -3px) skew(-1deg, 1deg);
    }
    100% { 
        filter: hue-rotate(0deg) saturate(1) brightness(1); 
        transform: translate(0, 0);
    }
}

.divergence-glitch { 
    animation: divergenceEffect 0.2s 4 forwards; 
}

@keyframes divergenceEffect {
    0% { 
        transform: translate(0, 0); 
        opacity: 1; 
        filter: hue-rotate(0deg);
    }
    25% { 
        transform: translate(5px, -5px); 
        opacity: 0.5; 
        filter: hue-rotate(60deg);
    }
    50% { 
        transform: translate(-5px, 5px); 
        opacity: 0.8; 
        filter: hue-rotate(120deg);
    }
    75% {
        transform: translate(5px, 5px);
        opacity: 0.6;
        filter: hue-rotate(180deg);
    }
    100% { 
        transform: translate(0, 0); 
        opacity: 1; 
        filter: hue-rotate(0deg);
    }
}

/* ============================================================================
   14. TERMINAL PAGE STYLES
   ============================================================================ */
.terminal-container { 
    max-width: 800px; 
    margin: 20px auto; 
    border: 2px solid var(--neon-green); 
    box-shadow: 
        0 0 15px rgba(51, 255, 51, 0.3),
        0 0 30px rgba(51, 255, 51, 0.2);
    background: rgba(0, 0, 0, 0.8);
}

.terminal-section { 
    padding: 20px; 
}

.terminal-section h2 { 
    color: var(--neon-yellow); 
}

/* Diary Entry Styling */
.diary-entry {
    color: #ff6666;
    font-style: italic;
    text-shadow: 0 0 5px rgba(255, 0, 0, 0.3);
    line-height: 1.4;
    padding: 5px 0;
    border-left: 2px solid #ff6666;
    padding-left: 10px;
    margin: 5px 0;
    font-family: var(--font-secondary);
}

.game-status-display { 
    padding: 12px; 
    background: linear-gradient(to bottom, #001100 0%, #000 100%); 
    border-bottom: 2px solid var(--neon-green); 
    display: flex; 
    flex-wrap: wrap; 
    justify-content: space-between; 
    font-size: 0.9em;
    font-family: var(--font-primary);
}

.game-status-display span {
    margin: 5px 10px;
    padding: 5px 10px;
    background: rgba(0, 255, 0, 0.1);
    border: 1px solid var(--neon-green);
}

.terminal { 
    background: #000; 
    color: var(--neon-green); 
    padding: 15px; 
    height: 500px; 
    overflow-y: auto; 
    white-space: pre-wrap; 
    line-height: 1.6; 
    border: 2px solid var(--neon-green);
    box-shadow: inset 0 0 20px rgba(0, 255, 0, 0.2);
    font-family: var(--font-secondary);
}

.terminal::-webkit-scrollbar {
    width: 10px;
}

.terminal::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.5);
}

.terminal::-webkit-scrollbar-thumb {
    background: var(--neon-green);
    box-shadow: 0 0 10px var(--neon-green);
}

.terminal-input-container { 
    display: flex; 
    margin-top: 10px; 
    border: 2px solid var(--neon-green);
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

#terminalInput { 
    flex-grow: 1; 
    padding: 10px; 
    background: #002200; 
    color: var(--neon-green); 
    border: none;
    outline: none; 
    font-family: var(--font-secondary);
    font-size: 1em;
}

#terminalInput:focus {
    background: #003300;
    box-shadow: inset 0 0 10px rgba(0, 255, 0, 0.3);
}

.terminal-command { 
    color: var(--neon-yellow); 
    font-weight: bold;
}

.terminal-location { 
    color: var(--neon-magenta); 
    font-weight: bold; 
    text-shadow: 0 0 5px var(--neon-magenta);
}

.terminal-system { 
    color: var(--neon-cyan); 
}

.terminal-warning { 
    color: var(--neon-yellow); 
    animation: warningBlink 1s infinite;
}

.terminal-error { 
    color: var(--neon-red); 
    text-shadow: 0 0 5px var(--neon-red);
}

.terminal-proverb { 
    color: var(--neon-purple); 
    font-style: italic; 
    text-shadow: 0 0 5px var(--neon-purple);
}

.terminal-win { 
    color: var(--neon-green); 
    font-weight: bold; 
    text-shadow: 0 0 10px var(--neon-green), 0 0 20px var(--neon-green);
    animation: victoryPulse 1s infinite;
}

@keyframes victoryPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.terminal-lose { 
    color: var(--neon-red); 
    font-weight: bold; 
    text-shadow: 0 0 10px var(--neon-red), 0 0 20px var(--neon-red);
    animation: defeatGlitch 0.5s infinite;
}

@keyframes defeatGlitch {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-2px, 2px); }
    75% { transform: translate(2px, -2px); }
}

/* ============================================================================
   15. RESPONSIVE STYLES
   ============================================================================ */
@media (max-width: 768px) {
    .main-nav { 
        flex-direction: column; 
        align-items: flex-end; 
        gap: 10px; 
        text-align: right; 
    }
    
    h1 { font-size: 1.5em; } 
    h2 { font-size: 1.3em; }
    h3 { font-size: 1.1em; }
    
    .btn { 
        padding: 12px 25px; 
        font-size: 0.9em; 
    }
    
    .feature-grid { 
        grid-template-columns: 1fr; 
    }
    
    .character-header { 
        flex-direction: column; 
        text-align: center; 
    }
    
    .character-portrait {
        width: 120px;
        height: 120px;
    }
    
    .logo-img {
        max-width: 200px;
    }
    
    .propaganda-ticker span {
        font-size: 0.85em;
    }
    
    .shen-apparition {
        width: 80px;
        height: 80px;
        bottom: 10px;
        right: 10px;
    }
    
    .terminal {
        height: 350px;
    }
    
    .game-status-display {
        font-size: 0.75em;
        justify-content: center;
    }
    
    body::before {
        background-size: 1px 2px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
        margin: 10px;
    }
    
    h1 { font-size: 1.2em; }
    h2 { font-size: 1.1em; }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.8em;
        margin: 5px;
    }
    
    .feature-item {
        padding: 15px;
    }
    
    .character-profile {
        padding: 15px;
    }
    
    .admin-password-section input {
        width: 100%;
        margin: 5px 0;
    }
}

/* ============================================================================
   16. ACCESSIBILITY IMPROVEMENTS
   ============================================================================ */

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Visible for Keyboard Navigation */
*:focus-visible {
    outline: 3px solid var(--neon-cyan);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Screen Reader Only Class */
.sr-only {
    position: absolute;
    width: 1px;
    max-width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Skip to Main Content Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--neon-green);
    color: var(--bg-color);
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* ============================================================================
   17. PRINT STYLES
   ============================================================================ */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .main-nav,
    .propaganda-ticker,
    .shen-apparition,
    .btn {
        display: none;
    }
    
    .container {
        border: 1px solid black;
        box-shadow: none;
    }
}

/* ============================================================================
   18. UTILITY CLASSES & SELECTION STYLES
   ============================================================================ */

/* Text Selection Styling */
::selection {
    background: var(--neon-cyan);
    color: var(--bg-color);
    text-shadow: none;
}

::-moz-selection {
    background: var(--neon-cyan);
    color: var(--bg-color);
    text-shadow: none;
}

/* Hidden Content Class */
.hidden-content {
    display: none;
}

/* Glitch Button Link Styling */
.glitch-btn-link {
    text-decoration: none;
    display: inline-block;
    padding: 0;
    border: none;
    background: transparent;
}

/* Performance Optimization: will-change for animated elements */
.logo-img,
.shen-apparition,
.scan-progress {
    will-change: transform;
}

h1 {
    will-change: text-shadow;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --neon-green: #00FF00;
        --neon-cyan: #00FFFF;
        --neon-magenta: #FF00FF;
        --neon-yellow: #FFFF00;
        --text-color: #FFFFFF;
    }
    
    .btn,
    .main-nav a,
    h1, h2, h3 {
        text-shadow: none;
    }
}

/* ============================================================================
   19. MOTION ARCHITECTURE LAYER
   CSS/WAAPI primitives for premium cyberpunk system motion.
   ============================================================================ */

:root {
    --as-black: #020203;
    --as-ink: #f2f2ea;
    --as-dim: #7e827b;
    --as-paper: #ebe7d8;
    --as-amber: #ffb000;
    --as-danger: #ff3158;
    --as-signal: #33ff99;
    --as-blue: #79a7ff;
    --pointer-x: 0;
    --pointer-y: 0;
    --intensity: 0.35;
}

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 10001;
    pointer-events: none;
    transform: scaleX(0);
    transform-origin: left;
    background: linear-gradient(90deg, var(--neon-magenta), var(--neon-cyan), var(--as-signal));
    box-shadow: 0 0 14px rgba(0, 255, 255, 0.65);
}

@supports (animation-timeline: scroll()) {
    .scroll-progress {
        animation: scrollProgress linear both;
        animation-timeline: scroll();
    }
}

@keyframes scrollProgress {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

body {
    background-color: var(--bg-color);
    background-image:
        radial-gradient(circle at 1px 1px, rgba(119, 119, 255, 0.26) 1px, transparent 0),
        radial-gradient(circle at 10px 10px, rgba(0, 255, 255, 0.12) 1px, transparent 0),
        radial-gradient(circle at 22% 12%, rgba(255, 0, 255, 0.16), transparent 34%),
        radial-gradient(circle at 78% 18%, rgba(0, 255, 255, 0.11), transparent 32%),
        radial-gradient(ellipse at center, rgba(8, 0, 26, 0.28) 0%, rgba(2, 2, 3, 0) 66%);
    background-size: 20px 20px, 20px 20px, 100% 100%, 100% 100%, 100% 100%;
    background-attachment: fixed;
    letter-spacing: 0;
}

body::after {
    background:
        linear-gradient(90deg, rgba(255, 0, 255, 0.045), transparent 18%, transparent 82%, rgba(0, 255, 255, 0.04)),
        radial-gradient(ellipse at center, transparent 0%, rgba(8, 0, 26, 0.52) 100%);
    transform: translate3d(
        calc(var(--pointer-x) * -10px),
        calc(var(--pointer-y) * -8px),
        0
    );
    will-change: transform;
}

[data-phase="TRACE"] body::after,
[data-phase="DECRYPT"] body::after {
    filter: saturate(calc(1 + var(--intensity) * 0.45));
}

[data-phase="KORRUPTION"] body::after {
    filter: hue-rotate(22deg) saturate(calc(1 + var(--intensity)));
}

[data-phase="RECOVERY"] body::after {
    filter: saturate(0.82) brightness(1.08);
}

.container {
    background:
        radial-gradient(ellipse at center, rgba(8, 0, 26, 0.95) 0%, rgba(0, 0, 0, 0.985) 100%),
        repeating-linear-gradient(90deg, rgba(119, 119, 255, 0.035) 0 1px, transparent 1px 14px);
    border-color: rgba(119, 119, 255, 0.86);
    box-shadow:
        0 0 25px rgba(119, 119, 255, 0.5),
        inset 0 0 18px rgba(119, 119, 255, 0.28),
        0 0 58px rgba(119, 119, 255, 0.22),
        0 24px 80px rgba(0,0,0,0.68);
    isolation: isolate;
}

.container::before {
    background: linear-gradient(45deg, var(--neon-purple), var(--neon-cyan), var(--neon-magenta), var(--neon-purple));
    filter: blur(12px);
    opacity: 0.32;
    animation-duration: 8s;
}

.main-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px 12px;
    border: 1px solid rgba(242,242,234,0.18);
    border-bottom-color: rgba(255,176,0,0.8);
    background:
        linear-gradient(180deg, rgba(0,0,0,0.92), rgba(14,10,2,0.84)),
        repeating-linear-gradient(90deg, rgba(255,176,0,0.08) 0 1px, transparent 1px 18px);
}

.main-nav a {
    margin: 0;
    color: var(--as-paper);
    border: 1px solid rgba(242,242,234,0.14);
    background: rgba(0,0,0,0.34);
    box-shadow: inset 0 -1px 0 rgba(255,176,0,0.2);
    transform: translateZ(0);
}

.main-nav a:hover,
.main-nav a:focus-visible {
    color: #000;
    background: var(--as-paper);
    border-color: var(--as-paper);
    text-shadow: none;
    transform: translate3d(0, -2px, 0);
}

.frosted-panel {
    backdrop-filter: blur(18px) saturate(145%);
    -webkit-backdrop-filter: blur(18px) saturate(145%);
}

.motion-magnetic {
    transition: transform 220ms cubic-bezier(0.34, 1.56, 0.64, 1), filter 220ms ease, box-shadow 220ms ease;
    transform: translateZ(0);
}

.motion-magnetic:not(:hover) {
    will-change: auto;
}

.station-bug {
    margin-left: auto;
    padding: 5px 8px;
    border: 1px solid rgba(255,176,0,0.55);
    color: var(--as-amber);
    font-family: var(--font-primary);
    font-size: 0.62em;
    line-height: 1;
    letter-spacing: 0;
    box-shadow: 0 0 18px rgba(255,176,0,0.12);
}

.arg-terminal-badge {
    margin: 0 0 14px;
    padding: 9px 12px;
    color: var(--as-signal);
    border: 1px solid rgba(51,255,153,0.55);
    background: rgba(0,0,0,0.42);
    font-family: var(--font-primary);
    font-size: 0.72em;
    text-align: center;
    box-shadow: 0 0 22px rgba(51,255,153,0.14);
}

.arg-residue {
    color: var(--as-amber);
    font-size: 0.85em;
    margin-top: 10px;
}

.ap-relic-residue {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 12px;
    padding: 8px;
    border: 1px solid rgba(0,255,255,0.25);
    background: rgba(0,0,0,0.45);
}

.ap-relic-residue span {
    color: #050505;
    background: var(--as-paper);
    border: 1px solid var(--as-amber);
    padding: 4px 6px;
    font-family: var(--font-secondary);
    font-size: 0.68rem;
}

.store-configurator {
    display: grid;
    gap: 12px;
    margin: 18px 0;
    padding: 14px;
    border: 1px solid rgba(0,255,255,0.28);
    background:
        linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.01)),
        rgba(0,0,0,0.48);
}

.store-configurator__title {
    color: var(--as-amber);
    font-family: var(--font-primary);
    font-size: 0.72em;
}

.store-configurator__swatches {
    display: flex;
    gap: 8px;
}

.store-configurator__swatches span {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(235,231,216,0.6);
    background:
        radial-gradient(circle at 32% 28%, rgba(255,255,255,0.95), transparent 20%),
        var(--swatch);
    box-shadow: 0 0 18px color-mix(in srgb, var(--swatch), transparent 45%);
}

.store-configurator__modes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.arg-whisper {
    position: fixed;
    right: 14px;
    bottom: 14px;
    z-index: 10002;
    max-width: min(330px, calc(100vw - 28px));
    padding: 10px 12px;
    color: var(--as-paper);
    background: rgba(0,0,0,0.82);
    border: 1px solid rgba(255,176,0,0.45);
    box-shadow: 0 18px 45px rgba(0,0,0,0.42), inset 0 0 0 1px rgba(255,255,255,0.04);
    opacity: 0;
    transform: translate3d(0, 8px, 0);
    transition: opacity 260ms ease, transform 260ms ease;
    font-family: var(--font-secondary);
    font-size: 0.8rem;
    pointer-events: none;
}

.arg-whisper.is-visible {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

.propaganda-ticker {
    background: var(--as-paper);
    color: #050505;
    border: 0;
    border-bottom: 3px solid #050505;
    box-shadow: none;
    text-transform: uppercase;
}

.propaganda-ticker::before {
    content: 'SIGNAL';
    top: 50%;
    transform: translateY(-50%);
    color: var(--as-danger);
    font-family: var(--font-primary);
    font-size: 0.66em;
    animation: warningBlink 2s steps(2, end) infinite;
}

header,
.hero,
.features,
.admin-password-section,
.warning,
.footer,
.character-profile {
    border-color: rgba(242,242,234,0.2);
    background:
        radial-gradient(ellipse at center, rgba(8, 0, 26, 0.74) 0%, rgba(0,0,0,0.88) 78%),
        repeating-linear-gradient(0deg, rgba(119,119,255,0.035) 0 1px, transparent 1px 22px);
    box-shadow:
        inset 0 0 20px rgba(119,119,255,0.12),
        inset 0 0 0 1px rgba(255,255,255,0.035),
        0 18px 44px rgba(0,0,0,0.32);
}

header {
    position: relative;
    padding: 28px 16px 18px;
}

header::before,
.hero::before,
.features::before,
.character-profile::after {
    content: 'TRANSMISSION // 7777MHZ';
    display: block;
    width: max-content;
    max-width: 100%;
    margin: 0 0 14px;
    padding: 4px 7px;
    color: #050505;
    background: var(--as-amber);
    font-family: var(--font-primary);
    font-size: 0.56em;
    line-height: 1.35;
    text-shadow: none;
}

.hero::before {
    content: 'ANGEL PERCS SIGNAL // SAMSARA BYPASS CHANNEL';
}

.features::before {
    content: 'SYSTEM MODULE // RESTRICTED INTERFACE';
}

.character-profile::after {
    content: 'PERSONNEL FILE // RESTRICTED';
    margin-top: 22px;
}

h1,
h2,
h3 {
    letter-spacing: 0;
    text-wrap: balance;
}

h1 {
    color: var(--as-paper);
    text-shadow:
        2px 0 0 rgba(255,49,88,0.72),
        -2px 0 0 rgba(51,255,153,0.62),
        0 0 22px rgba(242,242,234,0.28);
}

.typewriter-line {
    position: relative;
    display: inline-block;
    max-width: 100%;
    clip-path: inset(0 100% 0 0);
    animation: typeReveal 1150ms steps(var(--type-chars, 28), end) var(--type-delay, 0ms) forwards;
}

.typewriter-line::after {
    content: '';
    position: absolute;
    top: 0.08em;
    right: -0.28em;
    width: 2px;
    height: 0.95em;
    background: var(--as-amber);
    box-shadow: 0 0 12px rgba(255,176,0,0.7);
    animation: caretBlink 700ms steps(2, end) infinite;
}

.typewriter-line.typewriter-complete {
    clip-path: none;
    animation: none;
}

.typewriter-line.typewriter-complete::after {
    display: none;
}

@keyframes typeReveal {
    to { clip-path: inset(0 0 0 0); }
}

@keyframes caretBlink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

h2 {
    color: var(--as-signal);
}

h3 {
    color: var(--as-amber);
}

.hero {
    position: relative;
    overflow: hidden;
}

.hero-img {
    width: min(100%, 860px);
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background: #000;
    border-color: rgba(242,242,234,0.38);
    box-shadow:
        0 0 0 1px rgba(0,0,0,0.85),
        0 16px 42px rgba(0,0,0,0.55);
}

.feature-grid {
    gap: 18px;
}

.feature-item {
    border: 1px solid rgba(242,242,234,0.18);
    border-image: none;
    border-radius: 6px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.012)),
        rgba(0,0,0,0.5);
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.65);
    transform: translateZ(0);
}

.feature-item:hover {
    border-color: rgba(255,176,0,0.8);
    background: rgba(5,5,5,0.78);
    box-shadow:
        0 0 0 1px rgba(255,176,0,0.24),
        0 16px 38px rgba(0,0,0,0.46);
    transform: translate3d(0, -6px, 0);
}

.feature-item::before {
    background:
        linear-gradient(115deg, transparent 0%, rgba(255,176,0,0.12) 42%, rgba(51,255,153,0.1) 50%, transparent 60%);
    transform: translate3d(-20%, 0, 0) rotate(0deg);
}

.feature-item:hover::before {
    animation: bumpSweep 1300ms cubic-bezier(.2,.8,.2,1) 1;
}

.feature-img,
.glitch-btn {
    border-color: rgba(242,242,234,0.32);
    filter: saturate(0.92) contrast(1.08);
}

.btn {
    border-color: var(--as-paper);
    color: var(--as-paper);
    background:
        linear-gradient(90deg, transparent 0%, rgba(255,176,0,0.16) 100%),
        #050505;
    box-shadow:
        0 0 0 1px rgba(0,0,0,0.92),
        inset 0 0 0 1px rgba(255,255,255,0.04);
}

.btn:hover,
.btn:focus-visible {
    background: var(--as-paper);
    color: #050505;
    box-shadow:
        0 0 0 2px #050505,
        0 0 28px rgba(255,176,0,0.28);
    transform: translate3d(0, -2px, 0);
}

.scan-bar,
.terminal,
.terminal-input-container,
#archive-display,
#codeOutput {
    border-color: rgba(242,242,234,0.25);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}

.decrypt-console {
    position: relative;
    display: grid;
    gap: 14px;
    color: var(--as-paper);
    min-height: 190px;
}

.decrypt-console::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, transparent, rgba(51,255,153,0.1), transparent),
        repeating-linear-gradient(0deg, rgba(255,255,255,0.035) 0 1px, transparent 1px 8px);
    opacity: 0.6;
    pointer-events: none;
    transform: translate3d(-35%, 0, 0);
    animation: decryptSweep 1800ms cubic-bezier(.2,.8,.2,1) infinite;
}

.decrypt-console__header,
.decrypt-console__line,
.decrypt-console__meta {
    position: relative;
    z-index: 1;
}

.decrypt-console__header {
    color: var(--as-amber);
    font-family: var(--font-primary);
    font-size: clamp(0.72rem, 2vw, 0.95rem);
}

.decrypt-console__line {
    padding: 10px 12px;
    background: rgba(0,0,0,0.42);
    border: 1px solid rgba(51,255,153,0.24);
    color: var(--as-signal);
    text-align: left;
}

.decrypt-console__bar {
    position: relative;
    z-index: 1;
    height: 9px;
    overflow: hidden;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(242,242,234,0.16);
}

.decrypt-console__bar::after {
    content: '';
    display: block;
    height: 100%;
    transform-origin: left;
    background: linear-gradient(90deg, var(--neon-magenta), var(--neon-cyan), var(--as-signal));
    animation: decryptBar 1600ms cubic-bezier(.2,.8,.2,1) infinite;
}

.decrypt-console__meta {
    color: var(--as-dim);
    font-size: 0.85em;
    text-align: left;
}

.archive-output {
    position: relative;
    color: var(--text-color);
    line-height: 1.72;
}

.archive-output.is-decoded {
    animation: decodedReveal 520ms cubic-bezier(.2,.8,.2,1) both;
}

.trace-memory {
    display: inline-block;
    padding: 0 3px;
    border-bottom: 1px solid rgba(255,0,255,0.55);
    transform: translateZ(0);
}

.trace-memory:hover,
.trace-memory:focus-visible {
    background: rgba(255,0,255,0.12);
    outline: none;
}

.trace-popup {
    position: fixed;
    z-index: 10002;
    max-width: min(320px, calc(100vw - 28px));
    padding: 14px 16px;
    color: var(--as-paper);
    background:
        linear-gradient(180deg, rgba(8,0,26,0.96), rgba(0,0,0,0.94)),
        repeating-linear-gradient(0deg, rgba(255,255,255,0.035) 0 1px, transparent 1px 10px);
    border: 1px solid rgba(255,176,0,0.62);
    box-shadow: 0 18px 54px rgba(0,0,0,0.7), 0 0 28px rgba(255,176,0,0.18);
    font-family: var(--font-secondary);
    text-align: left;
    pointer-events: auto;
}

.trace-popup__kicker {
    color: var(--as-amber);
    font-family: var(--font-primary);
    font-size: 0.62rem;
    margin-bottom: 8px;
}

.trace-popup__body {
    color: var(--text-color);
}

.archive-error {
    color: var(--neon-red);
    border-color: rgba(255,49,88,0.65) !important;
    text-shadow: 0 0 8px rgba(255,49,88,0.5);
}

@keyframes decryptSweep {
    0% { transform: translate3d(-45%, 0, 0); opacity: 0; }
    20% { opacity: 0.7; }
    100% { transform: translate3d(35%, 0, 0); opacity: 0; }
}

@keyframes decryptBar {
    0% { transform: scaleX(0.08); }
    55% { transform: scaleX(0.78); }
    100% { transform: scaleX(1); }
}

@keyframes decodedReveal {
    from { opacity: 0; transform: translate3d(0, 12px, 0); filter: blur(2px); }
    to { opacity: 1; transform: translate3d(0, 0, 0); filter: blur(0); }
}

.motion-ready .motion-reveal {
    opacity: 0.001;
    transform: translate3d(0, 24px, 0);
    transition:
        opacity 620ms var(--ease-smooth) var(--reveal-delay, 0ms),
        transform 620ms var(--ease-smooth) var(--reveal-delay, 0ms),
        filter 620ms var(--ease-smooth) var(--reveal-delay, 0ms);
    filter: saturate(0.65);
}

.motion-ready .motion-reveal.is-visible {
    opacity: 1;
    transform: translate3d(0, 0, 0);
    filter: saturate(1);
}

@keyframes bumpSweep {
    0% { transform: translate3d(-45%, 0, 0); opacity: 0; }
    22% { opacity: 1; }
    100% { transform: translate3d(20%, 0, 0); opacity: 0; }
}

@keyframes pulse {
    0%, 100% { opacity: 0.86; transform: translateZ(0) scale(1); }
    50% { opacity: 1; transform: translateZ(0) scale(1.015); }
}

/* Dark Mode Support (if system prefers dark) */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #000000;
    }
}

@media (max-width: 768px) {
    .main-nav {
        justify-content: flex-start;
    }

    .main-nav a {
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    .feature-grid {
        grid-template-columns: 1fr !important;
    }

    .station-bug {
        margin-left: 0;
    }

    header::before,
    .hero::before,
    .features::before,
    .character-profile::after {
        width: auto;
    }

}

@media (prefers-reduced-motion: reduce) {
    body::after {
        transform: none;
    }

    .scroll-progress {
        display: none;
    }

    .motion-ready .motion-reveal {
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
    }

    .arg-whisper {
        transition: none !important;
        transform: none !important;
    }

    .typewriter-line {
        clip-path: none !important;
        animation: none !important;
    }

    .typewriter-line::after,
    .decrypt-console::before,
    .decrypt-console__bar::after {
        animation: none !important;
        display: none;
    }

}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* --- Custom Cursor Effect (Optional Enhancement) --- */
@media (hover: hover) and (pointer: fine) {
    body {
        cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20"><circle cx="10" cy="10" r="3" fill="%2300FFFF" opacity="0.8"/></svg>'), auto;
    }
    
    a, button, .btn, .interactive-trigger {
        cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20"><circle cx="10" cy="10" r="5" fill="%23FF00FF" opacity="0.9"/></svg>'), pointer;
    }
}

/* ============================================================================
   19. MOBILE FIT PASS
   ============================================================================ */
html,
body {
    width: 100%;
    max-width: 100%;
}

body {
    overflow-wrap: anywhere;
}

img,
video,
canvas,
svg,
iframe {
    max-width: 100%;
}

button,
.btn,
input,
select,
textarea,
a {
    touch-action: manipulation;
}

.container {
    width: min(100%, 1200px);
    max-width: calc(100vw - 16px);
    overflow: hidden;
}

.main-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: center;
    gap: 8px;
    text-align: center;
}

.main-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    max-width: 100%;
    margin: 0;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.btn,
button,
input[type="button"],
input[type="submit"],
[role="button"] {
    min-height: 44px;
}

input,
textarea,
select {
    max-width: 100%;
    min-height: 44px;
    font-size: 16px;
}

h1,
h2,
h3 {
    line-height: 1.35;
    max-width: 100%;
    overflow-wrap: anywhere;
}

h1 { font-size: clamp(1.1rem, 6vw, 2.2rem); }
h2 { font-size: clamp(1rem, 4.8vw, 1.6rem); }
h3 { font-size: clamp(0.9rem, 4vw, 1.2rem); }

.typewriter-line {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
}

.feature-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}

.feature-item {
    min-width: 0;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.feature-item > *,
.character-profile > *,
.hero > *,
.features > *,
.warning-section > *,
.footer > * {
    max-width: 100%;
}

.console-ui {
    display: grid;
    gap: 10px;
}

.console-ui,
#diagnostic-controls {
    min-width: 0;
    max-width: 100%;
}

.console-ui input {
    width: 100%;
    margin-right: 0;
}

#archive-display,
.decrypt-console,
.archive-output,
#codeOutput,
.terminal {
    max-width: 100%;
    overflow-wrap: anywhere;
}

.store-configurator__swatches,
.store-configurator__modes {
    min-width: 0;
}

.store-configurator__swatches span,
.store-configurator__modes button {
    min-width: 44px;
    min-height: 44px;
}

.glimmer-overlay {
    padding: 16px;
    font-size: clamp(1rem, 5vw, 2rem);
    line-height: 1.35;
    overflow-wrap: anywhere;
}

@media (max-width: 768px) {
    body {
        padding-inline: 8px;
    }

    .container {
        margin: 8px auto;
        padding: 12px;
    }

    .main-nav {
        justify-content: stretch;
        padding: 8px;
    }

    .main-nav a {
        flex: 1 1 min(100%, 220px);
        padding: 10px 12px;
        font-size: 0.7rem;
    }

    header,
    .hero,
    .features,
    .admin-password-section,
    .warning-section,
    .footer,
    .character-profile {
        padding: 14px;
    }

    .hero-img,
    .feature-img {
        width: 100%;
    }

    .feature-grid,
    .features .feature-grid[style] {
        grid-template-columns: 1fr !important;
    }

    .feature-item::before {
        content: none;
    }

    #diagnostic-controls {
        display: grid;
        justify-items: center;
    }
}

@media (max-width: 540px) {
    body {
        padding-inline: 6px;
    }

    .container {
        max-width: calc(100vw - 12px);
        padding: 10px;
    }

    .main-nav a {
        flex-basis: 100%;
        font-size: 0.66rem;
    }

    .typewriter-line {
        display: block;
    }

    .typewriter-line::after {
        right: 0;
    }

    .btn {
        width: 100%;
        max-width: 100%;
        padding-inline: 12px;
    }

    .propaganda-ticker span {
        display: inline-block;
        max-width: none;
    }

    .trace-popup {
        left: 14px !important;
        right: 14px !important;
        max-width: none;
    }
}
