/* THEME VARIABLES & VISUAL STYLES */

:root {
    /* UNIVERSAL LIGHT (Slate) */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --text-primary: #334155;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --accent-color: #0f172a;
    --hover-bg: #f1f5f9;
    --focus-ring: rgba(15, 23, 42, 0.5);
}

.theme-dark {
    /* UNIVERSAL DARK (Obsidian) */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --accent-color: #38bdf8;
    --hover-bg: #1e293b;
    --focus-ring: rgba(56, 189, 248, 0.5);
}

.theme-sepia {
    /* UNIVERSAL SEPIA (Archivist) */
    --bg-primary: #f2e8cf;
    --bg-secondary: #fffcf5;
    --text-primary: #382b22;
    --text-secondary: #695848;
    --border-color: #d6cbb0;
    --accent-color: #2c241b;
    --hover-bg: #e6dac0;
    --focus-ring: rgba(44, 36, 27, 0.5);
}

body { 
    -webkit-font-smoothing: antialiased; 
    background-color: var(--bg-primary); 
    color: var(--text-primary);
    transition: background-color 0.3s, color 0.3s;
}

/* Scrollbar Utility */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }

/* Interactive Utilities */
.card-hover { transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.card-hover:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); 
    border-color: var(--accent-color); 
}

/* Typography & Maintainability Helpers */
h1, h2, h3, h4, h5, h6 { color: var(--text-primary); transition: color 0.3s; }
p, li { color: var(--text-primary); line-height: 1.75; transition: color 0.3s; }
.text-muted { color: var(--text-secondary); }

/* Accessibility: Focus Visible */
*:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Accessibility: Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Static Grain Overlay - CPU Optimized */
.grain-overlay::after {
    content: "";
    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='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.5;
}

/* Pipeline Element State */
.pipeline-item {
    border-style: dashed;
    filter: grayscale(1);
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.pipeline-item:hover {
    opacity: 0.6;
}

/* Media Query for Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}