@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&family=Inter:wght@400;600;800&display=swap');

        body { font-family: 'Inter', sans-serif; }
        .font-mono { font-family: 'JetBrains Mono', monospace; }

        :root {
            --primary: #00F0FF;
            --danger: #FF003C;
            --purple: #BC13FE;
        }

        /* Animation */
        @keyframes pulse-glow { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
        .animate-gradient {
            background-size: 200% 200%;
            animation: gradient-move 3s ease infinite;
        }
        @keyframes gradient-move {
            0% { background-position: 0% 50%; }
            50% { background-position: 100% 50%; }
            100% { background-position: 0% 50%; }
        }

        /* Interactive Frame Styles */
        .frame-container {
            position: relative;
            width: 100%;
            max-width: 700px;
            height: 450px;
            margin: 0 auto;
        }

        .frame {
            position: relative;
            border: 2px solid rgba(255,255,255,0.1);
            border-radius: 12px;
            transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
            cursor: pointer;
        }

        .label-tag {
            position: absolute;
            top: -12px;
            left: 20px;
            background: #050505;
            padding: 0 10px;
            font-size: 0.75rem;
            color: #64748b;
            font-weight: 600;
            transition: color 0.3s;
            pointer-events: none;
            z-index: 20;
        }

        .frame-outer {
            width: 100%;
            height: 100%;
            padding: 35px;
            background: rgba(255, 255, 255, 0.01);
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .frame-middle {
            width: 100%;
            height: 100%;
            border: 2px dashed rgba(255, 255, 255, 0.30);
            padding: 25px;
            position: relative;
        }

        .element-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            grid-template-rows: 1fr 1fr;
            gap: 15px;
            width: 100%;
            height: 100%;
            position: relative;
            pointer-events: none;
        }

        .element-box {
            background: rgba(26, 29, 43, 0.6);
            border: 1px solid rgba(255,255,255,0.6);
            border-radius: 8px;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            font-size: 1rem;
            font-weight: bold;
            color: #94A3B8;
            transition: all 0.3s ease;
            position: relative;
            z-index: 2;
            pointer-events: auto;
        }

        .center-node {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 50px;
            height: 50px;
            background: #0a0a0a;
            border: 2px solid rgba(255,255,255,0.2);
            border-radius: 50%;
            z-index: 10;
            display: flex;
            justify-content: center;
            align-items: center;
            font-size: 1.3rem;
            box-shadow: 0 0 10px rgba(0,0,0,0.5);
            transition: all 0.3s ease;
            pointer-events: auto;
            color: #94A3B8;
        }

        .connector {
            position: absolute;
            background: white;
            opacity: 0.05;
            z-index: 1;
            transition: all 0.3s ease;
            pointer-events: none;
        }
        .conn-h { top: 50%; left: 10%; width: 80%; height: 2px; transform: translateY(-50%); }
        .conn-v { left: 50%; top: 10%; width: 2px; height: 80%; transform: translateX(-50%); }

        /* Active States */
        .frame-container.focus-step1 .frame-outer {
            border-color: var(--primary);
            box-shadow: 0 0 20px rgba(0, 240, 255, 0.25);
        }
        .frame-container.focus-step1 .frame-outer > .label-tag { color: var(--primary); }

        .frame-container.focus-step5 .frame-outer {
            border-color: var(--purple);
            background: rgba(188, 19, 254, 0.08);
            box-shadow: 0 0 40px rgba(188, 19, 254, 0.25);
        }
        .frame-container.focus-step5 .frame-outer > .label-tag { color: var(--purple); }

        .frame-middle.active { border-color: rgba(255, 255, 255, 0.7); background: rgba(255, 255, 255, 0.02); }
        .frame-middle.active > .label-tag { color: white; }

        .element-box.active { 
            background: rgba(255, 0, 60, 0.12); 
            border-color: var(--danger); 
            color: white; 
            box-shadow: 0 0 25px rgba(255, 0, 60, 0.3); 
            transform: scale(1.03); 
        }

        .center-node.active {
            background: var(--purple);
            border-color: var(--purple);
            color: white;
            box-shadow: 0 0 35px rgba(188, 19, 254, 0.5);
            transform: translate(-50%, -50%) scale(1.15);
        }

        .frame-container.focus-element .frame-outer { border-color: rgba(255,255,255,0.05); }
        .frame-container.focus-element .element-box { opacity: 0.25; }
        .frame-container.focus-element .element-box.active { opacity: 1; }

        .frame-container.focus-node .connector {
            background: var(--purple);
            opacity: 0.5;
            box-shadow: 0 0 10px var(--purple);
        }

        /* Volume Shape */
        .volume-box {
            width: 100%;
            height: 120px;
            background: rgba(0, 0, 0, 0.3);
            border: 1px dashed rgba(255, 255, 255, 0.30);
            position: relative;
            display: flex;
            justify-content: center;
            align-items: flex-start;
            border-radius: 8px;
            overflow: hidden;
            padding: 4px 0 0 0;
        }

        .volume-shape {
            transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
            border-radius: 4px;
            display: flex;
            justify-content: center;
            align-items: center;
            box-shadow: 0 5px 15px rgba(0,0,0,0.3);
        }

        .vol-text {
            color: white;
            font-weight: 800;
            font-size: 0.7rem;
            font-family: 'JetBrains Mono', monospace;
        }

        .vol-wide { width: 95%; height: 30%; background: var(--primary); }
        .vol-deep { width: 30%; height: 95%; background: var(--danger); }
        .vol-mid { width: 50%; height: 50%; background: var(--purple); }
        .vol-default { width: 95%; height: 3px; background: rgba(255,255,255,0.1); }

        /* Step Cards */
        .step-card {
            background: rgba(255,255,255,0.03);
            border: 1px solid rgba(255,255,255,0.3);
            border-radius: 12px;
            padding: 20px;
            transition: all 0.3s ease;
            cursor: pointer;
        }
        .step-card:hover {
            border-color: rgba(255,255,255,0.4);
            background: rgba(255,255,255,0.05);
            transform: translateY(-3px);
        }
        .step-card.active {
            border-color: var(--primary);
            background: rgba(0, 240, 255, 0.05);
        }

        /* 3D Context Allocator Cube Styles */
        .ctx-cube-scene {
            perspective: 1000px;
            width: 260px;
            height: 260px;
            margin: 0 auto;
            cursor: grab;
        }
        .ctx-cube-scene:active {
            cursor: grabbing;
        }
        .ctx-cube {
            width: 100%;
            height: 100%;
            position: relative;
            transform-style: preserve-3d;
        }
        .ctx-cube-face {
            position: absolute;
            width: 260px;
            height: 260px;
            border: 2px solid rgba(148, 163, 184, 0.2);
            box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
            color: #cbd5e1;
            font-family: 'JetBrains Mono', monospace;
            font-size: 10px;
            font-weight: 700;
            display: flex;
            align-items: center;
            justify-content: center;
            backface-visibility: visible;
            overflow: hidden;
            border-radius: 4px;
            user-select: none;
            opacity: 0.95;
        }

        /* Context Allocator Face Transforms */
        .ctx-face-front  { transform: rotateY(0deg) translateZ(130px); }
        .ctx-face-back   { transform: rotateY(180deg) translateZ(130px); }
        .ctx-face-right  { transform: rotateY(90deg) translateZ(130px); }
        .ctx-face-left   { transform: rotateY(-90deg) translateZ(130px); }
        .ctx-face-top    { transform: rotateX(90deg) translateZ(130px); }
        .ctx-face-bottom { transform: rotateX(-90deg) translateZ(130px); }

        /* Context Allocator Face Colors - Transparent backgrounds with colored borders */
        .ctx-face-front  { background: rgba(6, 182, 212, 0.15); border-color: rgba(6, 182, 212, 0.6); color: #67e8f9; } /* Cyan - Step 1 */
        .ctx-face-back   { background: rgba(148, 163, 184, 0.15); border-color: rgba(148, 163, 184, 0.6); color: #cbd5e1; } /* Gray - Step 2 */
        .ctx-face-right  { background: rgba(244, 63, 94, 0.15); border-color: rgba(244, 63, 94, 0.6); color: #fda4af; } /* Rose - Step 3 */
        .ctx-face-left   { background: rgba(168, 85, 247, 0.15); border-color: rgba(168, 85, 247, 0.6); color: #e9d5ff; } /* Purple - Step 4 */
        .ctx-face-top    { background: rgba(52, 211, 153, 0.15); border-color: rgba(52, 211, 153, 0.6); color: #6ee7b7; } /* Emerald - Step 5 */
        .ctx-face-bottom { background: rgba(59, 130, 246, 0.15); border-color: rgba(59, 130, 246, 0.6); color: #93c5fd; } /* Blue - Step 6 */