@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&display=swap');

:root {
    /* Unified Cyber-AI Design System - Light Mode */
    --bg-main: #f1f5f9;
    --bg-card: rgba(255, 255, 255, 0.7);
    --bg-card-hover: rgba(255, 255, 255, 0.9);
    --bg-glass: rgba(241, 245, 249, 0.85);
    --bg-accent: #e2e8f0;
    
    --text-title: #0f172a;
    --text-body: #334155;
    --text-muted: #64748b;
    
    --border-main: rgba(15, 23, 42, 0.08);
    --border-accent: rgba(14, 165, 233, 0.2);
    
    --accent: #0ea5e9;
    --accent-glow: rgba(14, 165, 233, 0.1);
    --accent-red: #e11d48;
    --accent-green: #059669;
    --accent-indigo: #4f46e5;
    
    --canvas-bg: #f8fafc;
    --grid-color: rgba(15, 23, 42, 0.03);
}

.dark {
    /* Semantic Variables - Dark Theme */
    --bg-main: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.5);
    --bg-card-hover: rgba(30, 41, 59, 0.7);
    --bg-glass: rgba(15, 23, 42, 0.8);
    --bg-accent: rgba(255, 255, 255, 0.05);
    
    --text-title: #ffffff;
    --text-body: #e2e8f0;
    --text-muted: #94a3b8;
    
    --border-main: rgba(255, 255, 255, 0.1);
    --border-accent: rgba(56, 189, 248, 0.2);
    
    --accent: #38bdf8;
    --accent-glow: rgba(56, 189, 248, 0.4);
    --accent-red: #f43f5e;
    --accent-green: #10b981;
    --accent-indigo: #818cf8;
    
    --canvas-bg: #020617;
    --grid-color: rgba(255, 255, 255, 0.03);
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-body);
    background-image: 
        radial-gradient(circle at 20% 20%, var(--accent-glow) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(79, 70, 229, 0.05) 0%, transparent 40%);
    background-attachment: fixed;
    transition: background-color 0.4s ease, color 0.4s ease;
    overflow-x: hidden;
}

/* Futuristic Grid Background */
body::before {
    content: "";
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-image: linear-gradient(var(--grid-color) 1px, transparent 1px), 
                      linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -1;
}

/* Glassmorphism Navbar */
.nav-glass {
    background: var(--bg-glass);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--border-main);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Premium Tech Cards */
.tech-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-main);
    border-radius: 1.5rem; /* Slightly smaller radius for mobile */
    transition: all 0.4s ease;
    padding: 1.5rem; /* Default mobile padding */
    overflow: hidden;
}

@media (min-width: 768px) {
    .tech-card {
        border-radius: 2rem;
        padding: 3rem; /* md:p-12 equivalent */
    }
}

.tech-card:hover {
    transform: translateY(-10px) scale(1.01);
    border-color: var(--accent);
    background: var(--bg-card-hover);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1), 0 0 20px var(--accent-glow);
}

.dark .tech-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 20px var(--accent-glow);
}

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-step {
    opacity: 0;
    animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-main); }
::-webkit-scrollbar-thumb { background: var(--border-main); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* Math Box - Cyber Style */
.formula-box {
    background: var(--bg-accent);
    border-left: 4px solid var(--accent);
    position: relative;
}

.formula-box::after {
    content: "EQUATION_01";
    position: absolute;
    top: 10px; right: 20px;
    font-size: 10px;
    color: var(--accent);
    letter-spacing: 2px;
    opacity: 0.5;
}

/* Canvas Dark Mode */
#isoCanvas {
    width: 100%;
    height: 300px; /* Default height for mobile */
    display: block;
    background: var(--canvas-bg);
    border-radius: 1.5rem;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.05);
    transition: background-color 0.3s ease;
}

@media (min-width: 768px) {
    #isoCanvas {
        height: 400px;
    }
}

.dark #isoCanvas {
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

/* Image Zoom Styling */
.zoomable {
    cursor: zoom-in;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.zoomable:hover {
    filter: brightness(1.1) contrast(1.1);
    transform: scale(1.02);
}

@keyframes zoom-in {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-zoom-in {
    animation: zoom-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Modal Body Lock */
.modal-open {
    overflow: hidden;
}

/* Dragging Performance */
#modalImg {
    transition: transform 0.1s ease-out, box-shadow 0.3s ease;
    will-change: transform;
}

.modal-open #imageModal {
    cursor: crosshair;
}

/* Utility Overrides */
.text-primary-theme { color: var(--text-title); }
.text-body-theme { color: var(--text-body); }
.text-muted-theme { color: var(--text-muted); }
.bg-accent-theme { background-color: var(--bg-accent); }

/* Architecture Flow Animations */
@keyframes flow-dot {
    0% { transform: translateX(-100%); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateX(500%); opacity: 0; }
}

.animate-flow-dot {
    animation: flow-dot 3s linear infinite;
}

@keyframes pulse-subtle {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.05); }
}

.animate-pulse-subtle {
    animation: pulse-subtle 3s ease-in-out infinite;
}

@keyframes float-tech {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.animate-float-tech {
    animation: float-tech 4s ease-in-out infinite;
}

.flow-line {
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    width: 100%;
    position: relative;
    overflow: hidden;
}

.flow-line::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 20%;
    height: 100%;
    background: white;
    box-shadow: 0 0 10px white;
    animation: flow-dot 2s linear infinite;
}

/* Liquid Flow SVG Animation (The Neon Stream) */
@keyframes liquid-flow {
    0% { stroke-dashoffset: 400; }
    100% { stroke-dashoffset: 0; }
}

.animate-liquid-flow {
    stroke-dasharray: 40 80; /* Spacing of the pulses */
    animation: liquid-flow 8s linear infinite;
}

/* Mobile Tidy Utilities */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

@media (max-width: 768px) {
    .tab-btn {
        min-width: 90px;
        flex-shrink: 0;
    }
}

/* SVG Theme Support - Unified & High Contrast */
.svg-text-main { fill: #0f172a; transition: fill 0.3s ease; font-weight: 700; }
.svg-text-label { fill: #000000; transition: fill 0.3s ease; font-weight: 800; }
.svg-node-text { fill: #f8fafc !important; font-weight: 600; } /* Always white for dark nodes */
.svg-box-bg { fill: rgba(15, 23, 42, 0.05); stroke: rgba(15, 23, 42, 0.2); transition: all 0.3s ease; }
.svg-flow-line { stroke: #334155; stroke-width: 1.5; transition: stroke 0.3s ease; }

.dark .svg-text-main { fill: #f8fafc; font-weight: normal; }
.dark .svg-text-label { fill: #94a3b8; font-weight: normal; }
.dark .svg-node-text { fill: #f8fafc !important; }
.dark .svg-box-bg { fill: rgba(30, 41, 59, 0.3); stroke: rgba(255, 255, 255, 0.1); }
.dark .svg-flow-line { stroke: #f8fafc; stroke-width: 1; }


