/* Custom Styles for Digital Brutalism / Tactical Industrial Aesthetic */

/* Base font configurations */
body {
    font-family: 'Inter', sans-serif;
}

.font-mono {
    font-family: 'Space Mono', monospace;
    font-feature-settings: 'liga' 0;
    letter-spacing: 0.02em;
}

/* Grainy texture overlay effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    animation: grain 8s steps(10) infinite;
}

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

/* Custom scrollbar for state log */
#state-log::-webkit-scrollbar {
    width: 8px;
}

#state-log::-webkit-scrollbar-track {
    background: #1a1a1a;
    border: 1px solid #FF5F00;
}

#state-log::-webkit-scrollbar-thumb {
    background: #FF5F00;
    border: 1px solid #1a1a1a;
}

#state-log::-webkit-scrollbar-thumb:hover {
    background: #ff7f33;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection color */
::selection {
    background-color: #FF5F00;
    color: #2F2F2F;
}

::-moz-selection {
    background-color: #FF5F00;
    color: #2F2F2F;
}

/* Focus styles for accessibility */
input:focus,
button:focus {
    outline: 2px solid #FF5F00;
    outline-offset: 2px;
}

/* Mobile-first adjustments */
@media (max-width: 640px) {
    .font-mono {
        letter-spacing: 0.01em;
    }
    
    /* Better touch targets on mobile */
    button, input {
        min-height: 44px;
    }
}

/* Extra small screens */
@media (max-width: 375px) {
    body {
        font-size: 14px;
    }
}

/* Typewriter cursor animation */
@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

#cursor {
    animation: blink 1s infinite;
}

/* Modal styles */
#state-modal {
    animation: fadeIn 0.2s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

#state-modal > div {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Codex card initial state */
.codex-card {
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

/* Codex content transition */
#codex-content.hidden {
    display: none;
}

#codex-content:not(.hidden) {
    display: grid;
}

