/* 
    SOFACT LABS - MASTER STYLESHEET 
    Theme: Sovereign Intelligence / Brutalist Laboratory
*/

/* 1. TYPOGRAPHY & CORE */
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Playfair+Display:ital,wght@0,400..900;1,400..900&family=JetBrains+Mono:wght@400;700&display=swap');

:root {
    --zinc-50: #fafafa;
    --zinc-100: #f4f4f5;
    --zinc-200: #e4e4e7;
    --zinc-400: #a1a1aa;
    --zinc-500: #71717a;
    --zinc-900: #18181b;
    --accent-red: #dc2626; /* Security */
    --accent-teal: #0d9488; /* Health */
}

body {
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    font-feature-settings: "cv01", "cv11", "ss01";
}

.serif { font-family: 'Playfair Display', serif; font-style: italic; }
.mono { font-family: 'JetBrains Mono', monospace; font-size: 0.85em; letter-spacing: -0.02em; }

/* 2. LAYOUT STABILITY (No Shaking/Jumps) */
html { scroll-behavior: smooth; }

main#main-content {
    scrollbar-gutter: stable; /* Crucial: Prevents layout shift when scrollbar appears */
    overflow-y: overlay; 
    background: var(--zinc-50);
}

/* Custom Thin Scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--zinc-200); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--zinc-400); }

/* 3. BENTO GRID (The Foundry Look) */
.bento-card {
    background: white;
    border: 1px solid var(--zinc-100);
    border-radius: 2rem;
    padding: 2.5rem;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.bento-card:hover {
    border-color: var(--zinc-900);
    transform: translateY(-8px);
    box-shadow: 0 30px 60px -15px rgba(0,0,0,0.1);
}

/* 4. NAVIGATION & SIDEBAR */
#top-nav {
    z-index: 1000;
    isolation: isolate;
    border-bottom: 1px solid var(--zinc-100);
}

.sidebar-link {
    display: block;
    padding: 0.6rem 0;
    color: var(--zinc-400);
    transition: all 0.4s ease;
    border-left: 2px solid transparent;
    font-size: 13px;
    font-weight: 500;
}

.sidebar-link:hover {
    color: var(--zinc-900);
    padding-left: 0.75rem;
}

.sidebar-link.active {
    color: var(--zinc-900);
    border-left: 2px solid var(--zinc-900);
    padding-left: 1.25rem;
    font-weight: 800;
}

/* 5. TOOLTIP (Floating HUD) */
#nav-tooltip {
    position: fixed;
    z-index: 9999;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--zinc-200);
    border-radius: 1.25rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    padding: 1.5rem;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: translateY(10px);
    opacity: 0;
}

#nav-tooltip.visible {
    opacity: 1;
    transform: translateY(20px);
}

/* 6. PROCESSING LOADER (Neural Pulse) */
#processing {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 10000;
    background: rgba(255, 255, 255, 0.6);
    display: none; /* Controlled by Moonwalk.js */
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.5em;
    pointer-events: none;
}

#processing::before {
    content: "";
    position: absolute;
    top: 0; left: 0; width: 100%; height: 3px;
    background: var(--zinc-900);
    animation: pulse-load 2s infinite ease-in-out;
    transform-origin: left;
}

@keyframes pulse-load {
    0% { transform: scaleX(0); }
    50% { transform: scaleX(1); }
    100% { transform: scaleX(0); transform-origin: right; }
}

/* 7. ANIMATIONS (Moonwalk.js support) */
.mw-animated {
    animation-duration: 0.8s;
    animation-fill-mode: both;
    animation-timing-function: cubic-bezier(0.23, 1, 0.32, 1);
}

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

.mw-fade-in-up { animation-name: mw-up; }
@keyframes mw-up {
    from { opacity: 0.1; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}


/* 8. TOAST NOTIFICATIONS */
.mw-toast {
    position: fixed;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--zinc-900);
    color: white;
    padding: 12px 28px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    z-index: 10001;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    animation: toast-in 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes toast-in {
    from { opacity: 0; transform: translate(-50%, 30px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* 9. SECTOR ACCENTS */
section#security h1 { color: var(--accent-red); }
section#healthcare h1 { color: var(--accent-teal); }

/* 10. FORM STYLING */
input, select, textarea {
    background: transparent;
    border-bottom: 1px solid var(--zinc-200);
    padding: 1rem 0;
    width: 100%;
    outline: none;
    transition: border-color 0.3s ease;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--zinc-900);
}

.mw-blink {
    animation: blink 0.8s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}