:root {
    --bg-color: #0d1117;
    --term-bg: #0c0c0c;
    --term-text: #eee;
    --cyan: #00f3ff;
    --pink: #ff0055;
    --green: #00ff41;
    --amber: #ffb000;
    --dim: #666;
    --border: #333;
    --font-stack: 'Fira Code', 'Courier New', monospace;
    --retro-font: 'VT323', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: var(--term-bg);
    color: var(--term-text);
    font-family: var(--font-stack);
    overflow-x: hidden;
    line-height: 1.4;
    font-size: 16px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* CRT Effect Overlay */
.scanlines {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(255,255,255,0), rgba(255,255,255,0) 50%,
        rgba(0,0,0,0.2) 50%, rgba(0,0,0,0.2)
    );
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 999;
}

.screen-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(
        circle, rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.4) 90%, rgba(0, 0, 0, 0.8) 100%
    );
    pointer-events: none;
    z-index: 998;
}

/* Layout */
.terminal-wrapper {
    max-width: 900px; margin: 0 auto; padding: 20px;
    width: 100%; flex: 1; display: flex; flex-direction: column;
}

/* Status Bar */
.status-bar {
    display: flex; justify-content: space-between;
    background: var(--bg-color); border-bottom: 2px solid var(--dim);
    font-size: 0.9rem; margin-bottom: 2rem;
    position: sticky; top: 0; z-index: 1000;
}
.segment { padding: 5px 15px; border-right: 1px solid var(--dim); }
.segment.active { background: var(--cyan); color: #000; font-weight: bold; }
.segment.success { color: var(--green); }
.segment.btn-lang { cursor: pointer; user-select: none; transition: background 0.2s, color 0.2s; }
.segment.btn-lang:hover { background: var(--dim); color: #fff; }

/* Typography */
h1 { font-family: var(--retro-font); font-size: 3rem; margin-bottom: 1rem; text-shadow: 0 0 5px var(--cyan); }
h2.section-title { color: var(--pink); border-bottom: 1px dashed var(--dim); padding-bottom: 5px; margin-bottom: 20px; font-size: 1.2rem; letter-spacing: 1px; }

.cyan { color: var(--cyan); } .green { color: var(--green); } .pink { color: var(--pink); } .dim { color: var(--dim); }
.success { color: var(--green); }

.ascii-art { color: var(--cyan); font-size: 0.7rem; line-height: 1; white-space: pre; margin-bottom: 20px; opacity: 0.8; }

/* Sections */
.section { margin-bottom: 4rem; }
.hero-msg p { font-size: 1.1rem; color: #ccc; margin-bottom: 10px; }

/* NEW AGENT FIRST STYLES */
.agent-context-box {
    margin-top: 30px; margin-bottom: 10px;
}
.caption {
    color: var(--cyan); font-weight: bold; margin-bottom: 5px; font-size: 1rem;
}
.url-copy-row {
    display: flex; gap: 0; border: 1px solid var(--cyan); border-radius: 4px; overflow: hidden;
}
.url-copy-row input {
    background: #000; color: #fff; border: none; padding: 12px 15px; font-family: var(--font-stack); font-size: 0.9rem; flex: 1; outline: none;
}
.btn-copy {
    background: var(--cyan); color: #000; border: none; padding: 0 20px; font-weight: bold; cursor: pointer; font-family: var(--font-stack); transition: background 0.2s;
}
.btn-copy:hover { background: #fff; }

.manual-install-box {
    margin-top: 20px; padding: 15px; border-top: 1px dashed var(--dim); opacity: 0.7; transition: opacity 0.2s;
}
.manual-install-box:hover { opacity: 1; }
.caption-dim {
    color: var(--dim); font-size: 0.8rem; margin-bottom: 5px; font-style: italic;
}
.cmd-dim {
    color: var(--dim); background: #111; padding: 5px 10px; border-radius: 3px; font-size: 0.85rem; border: 1px solid #333; display: inline-block;
}

/* LINK GROUP */
.link-group {
    display: flex; gap: 15px; margin-top: 20px; justify-content: flex-start; flex-wrap: wrap;
}
.btn-link {
    text-decoration: none; padding: 8px 16px; font-size: 0.9rem; font-weight: bold;
    border: 1px solid var(--dim); color: var(--dim); transition: all 0.2s;
    background: #050505; display: inline-flex; align-items: center; gap: 8px;
}
.btn-link:hover { border-color: var(--cyan); color: var(--cyan); box-shadow: 0 0 8px rgba(0, 243, 255, 0.2); }
.btn-link.npm:hover { border-color: #cb3837; color: #cb3837; box-shadow: 0 0 8px rgba(203, 56, 55, 0.2); } /* NPM Red */
.btn-link.github:hover { border-color: #fff; color: #fff; box-shadow: 0 0 8px rgba(255, 255, 255, 0.2); }
.btn-link.deepwiki:hover { border-color: #58a6ff; color: #58a6ff; box-shadow: 0 0 8px rgba(88, 166, 255, 0.2); } /* Github Blue */
.btn-link.hits { padding: 6px 10px; }
.btn-link.hits img { display: block; height: 20px; }

/* LOG SIMULATION STYLES */
.log-container {
    background: #050505; border: 1px solid var(--dim); padding: 20px; border-radius: 4px; font-family: var(--font-stack);
}
.log-entry { margin-bottom: 15px; border-left: 2px solid var(--dim); padding-left: 15px; }
.log-entry:last-child { margin-bottom: 0; border-left-color: var(--cyan); }
.log-cmd { color: #fff; margin-bottom: 5px; font-weight: bold; }
.log-out { color: var(--dim); font-size: 0.9rem; }
.log-out.cyan { color: var(--cyan); } .log-out.success { color: var(--green); }
.output-block { background: #111; color: #ccc; padding: 10px; margin-top: 5px; border: 1px solid var(--border); white-space: pre; }
.cursor-block { display: inline-block; width: 8px; height: 15px; background: var(--green); animation: blink 1s step-end infinite; vertical-align: middle; }

/* OPERATIONS CARDS */
.op-card {
    background: #050505; border: 1px solid var(--border); transition: all 0.2s;
    display: flex; flex-direction: column;
}
.op-card:hover { border-color: var(--green); box-shadow: 0 0 10px rgba(0, 255, 65, 0.1); }
.op-header {
    background: #111; padding: 8px 15px; border-bottom: 1px solid var(--border);
    color: var(--green); font-size: 0.8rem; font-weight: bold; letter-spacing: 0.5px;
}
.op-card:hover .op-header { background: rgba(0, 255, 65, 0.1); }
.op-body { padding: 20px; flex: 1; }
.op-body h3 { color: #fff; font-size: 1.1rem; margin-bottom: 10px; }
.op-body p { color: #aaa; font-size: 0.9rem; line-height: 1.5; margin-bottom: 15px; }
.code-snippet { background: #111; padding: 5px 10px; color: var(--cyan); font-size: 0.85rem; border-radius: 3px; display: inline-block; }

/* STEALTH OP STYLES (NEW) */
.full-width { margin-top: 20px; width: 100%; }
.stealth-op { position: relative; overflow: hidden; cursor: pointer; min-height: 150px; border-color: var(--pink); }
.stealth-op:hover { border-color: var(--pink); box-shadow: 0 0 15px rgba(255, 0, 85, 0.3); }

.stealth-op.locked { border-color: var(--dim); cursor: pointer; }
.stealth-op.locked .op-content { filter: blur(8px) grayscale(100%); opacity: 0.3; pointer-events: none; }
.stealth-op.locked:hover { border-color: var(--pink); }

.noise-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.1'/%3E%3C/svg%3E");
    pointer-events: none; z-index: 2; opacity: 0;
}
.stealth-op.locked .noise-overlay { opacity: 1; }

.lock-screen {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    text-align: center; z-index: 5; display: none; width: 100%;
}
.stealth-op.locked .lock-screen { display: block; }
.lock-icon { font-size: 3rem; margin-bottom: 10px; display: block; }
.lock-screen h3 { color: var(--pink); margin-bottom: 5px; font-family: var(--font-stack); text-transform: uppercase; letter-spacing: 2px; text-shadow: 0 0 5px var(--pink); }
.lock-screen p { color: #fff; font-size: 0.8rem; letter-spacing: 2px; animation: blink 0.5s step-end infinite; background: #000; display: inline-block; padding: 2px 5px; }

.warning-badge {
    background: var(--pink); color: #fff; font-size: 0.7rem; padding: 2px 5px; border-radius: 3px; margin-left: 10px; vertical-align: middle; text-transform: uppercase; font-weight: bold;
}

/* Modules Grid */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.module { border: 1px solid var(--border); padding: 20px; transition: all 0.2s; background: #080808; }
.module:hover { border-color: var(--cyan); box-shadow: 0 0 15px rgba(0, 243, 255, 0.1); }
.module .icon { font-size: 2rem; display: block; margin-bottom: 10px; }
.module h3 { color: var(--cyan); margin-bottom: 10px; font-size: 1rem; }
.module p { font-size: 0.9rem; color: #aaa; }

/* Table */
.cli-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.cli-table th { text-align: left; border-bottom: 1px solid var(--cyan); padding: 10px; color: var(--cyan); }
.cli-table td { padding: 10px; border-bottom: 1px solid var(--dim); color: #ccc; }
.cli-table code { background: #111; padding: 2px 5px; border-radius: 3px; }

/* Footer */
.input-line {
    border-top: 1px solid var(--dim); padding: 15px 0; margin-top: auto;
    background: var(--bg-color); position: sticky; bottom: 0; width: 100%; z-index: 100;
}
.prompt { color: var(--green); margin-right: 10px; }
.blink-link { color: var(--term-text); text-decoration: none; }
.blink-link:hover { text-decoration: underline; color: var(--cyan); }
.cursor {
    display: inline-block; width: 10px; height: 1.2em; background-color: var(--cyan);
    vertical-align: text-bottom; animation: blink 1s step-end infinite; margin-left: 5px;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

@media (max-width: 768px) {
    /* 1. Layout & Container */
    .terminal-wrapper { padding: 10px; overflow-x: hidden; }
    .section { margin-bottom: 3rem; }
    
    /* 2. Typography */
    h1 { font-size: 1.8rem; line-height: 1.2; word-break: break-word; }
    h2.section-title { font-size: 1rem; }
    .hero-msg p { font-size: 1rem; }
    
    /* 3. ASCII Art Sizing */
    .ascii-art { font-size: 0.4rem; overflow-x: hidden; letter-spacing: -1px; }

    /* 4. Grid Stacking */
    .grid-2, .grid-3 { grid-template-columns: 1fr; }

    /* 5. Status Bar Compact */
    .status-bar { font-size: 0.75rem; padding: 10px 5px; }
    .segment { padding: 0 8px; }
    /* Hide Version/Branch on Mobile to save space */
    .bar-left .segment:nth-child(2), 
    .bar-left .segment:nth-child(3) { display: none; } 
    
    /* 6. Agent Context Box (URL Input) */
    .url-copy-row { flex-direction: row; }
    .url-copy-row input { 
        width: 100%; min-width: 0; /* Important for flex shrinking */
        font-size: 0.8rem; padding: 10px;
    }
    .btn-copy { padding: 0 10px; font-size: 0.8rem; }
    
    /* 7. Link Buttons */
    .link-group { gap: 10px; }
    .btn-link { padding: 8px 12px; font-size: 0.8rem; flex: 1; justify-content: center; }

    /* 8. Table Transformation (Table -> Cards) */
    .cli-table, .cli-table tbody, .cli-table tr, .cli-table td {
        display: block; width: 100%;
    }
    .cli-table thead { display: none; } /* Hide Header */
    .cli-table tr {
        margin-bottom: 15px; border: 1px solid var(--dim); 
        background: #080808; padding: 10px; border-radius: 4px;
    }
    .cli-table td {
        padding: 5px 0; border: none;
    }
    .cli-table td:first-child {
        border-bottom: 1px dashed var(--dim); margin-bottom: 5px; padding-bottom: 8px;
    }

    /* 9. Footer */
    .input-line { font-size: 0.8rem; padding: 10px 15px; }
    .prompt { display: none; } /* Hide prompt to save space */
    
    /* 10. Log Container */
    .log-container { padding: 10px; font-size: 0.85rem; }
    .output-block { overflow-x: auto; }
}
