:root {
    --bg-color: #0a0a0a;
    --panel-bg: #111111;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --accent-color: #00f0ff; /* Cyan */
    --accent-secondary: #ff00ff; /* Magenta */
    --accent-tertiary: #ffb000; /* Amber */
    --grid-line: #222;
    --font-mono: 'Fira Code', monospace;
    --font-sans: 'Space Grotesk', sans-serif;
    --spacing-unit: 1.5rem;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
}

/* --- SYSTEM OVERLAY (GRID & SCANLINES) --- */
.system-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -1;
    opacity: 0.3;
}

.scan-line {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: rgba(0, 240, 255, 0.1);
    z-index: 100;
    animation: scan 8s linear infinite;
    pointer-events: none;
}

@keyframes scan {
    0% { top: -10px; }
    100% { top: 100vh; }
}

/* --- TYPOGRAPHY & LINKS --- */
h1, h2, h3, h4, h5 {
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    color: var(--accent-secondary);
    text-shadow: 0 0 8px var(--accent-secondary);
}

/* --- HEADER --- */
#main-header {
    padding: 2rem;
    border-bottom: 2px solid var(--grid-line);
    background: rgba(10, 10, 10, 0.95);
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(5px);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.identity-block {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.status-indicator {
    width: 12px;
    height: 12px;
    background-color: #0f0;
    border-radius: 50%;
    box-shadow: 0 0 10px #0f0;
}

.role {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
    border: 1px solid var(--text-secondary);
    padding: 0.2rem 0.5rem;
}

.system-nav {
    display: flex;
    gap: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

.sub-header {
    margin-top: 1rem;
    font-size: 1.2rem;
    color: var(--accent-color);
    font-weight: 600;
}

/* --- MAIN LAYOUT --- */
.grid-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

.panel {
    border: 1px solid var(--grid-line);
    background: var(--panel-bg);
    position: relative;
    overflow: hidden;
}

.panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-color);
}

.panel-header {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-bottom: 1px solid var(--grid-line);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-id {
    font-family: var(--font-mono);
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.panel-body {
    padding: 2rem;
}

/* --- SECTIONS SPECIFIC --- */

/* Core Directive */
#core-directive p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    max-width: 800px;
}

.highlight-text {
    color: var(--accent-tertiary);
    font-size: 1.3rem !important;
    font-weight: bold;
    border-left: 2px solid var(--accent-tertiary);
    padding-left: 1rem;
}

.connection-request {
    margin-top: 2rem;
    border: 1px dashed var(--accent-color);
    padding: 1.5rem;
    background: rgba(0, 240, 255, 0.05);
}

.connection-request ul {
    list-style: none;
    margin-top: 1rem;
}

.connection-request li {
    font-family: var(--font-mono);
    margin-bottom: 0.5rem;
}

/* Operation Log (Timeline) */
.log-entry {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
    position: relative;
}

.log-entry::after {
    content: '';
    position: absolute;
    left: 200px; /* Adjust based on grid column width */
    top: 0;
    bottom: -3rem;
    width: 1px;
    background: var(--grid-line);
    z-index: 0;
}

.log-meta {
    font-family: var(--font-mono);
    color: var(--accent-color);
    font-size: 0.9rem;
    text-align: right;
    padding-right: 1rem;
    display: flex;
    flex-direction: column;
}

.log-content {
    padding-left: 1rem;
    border-left: 2px solid var(--grid-line);
    z-index: 1; /* Sit above the line */
}

.log-content h4 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    color: #fff;
}

.company {
    color: var(--accent-tertiary);
    margin-bottom: 1rem;
    font-size: 1rem;
}

.achievements {
    list-style-type: square;
    margin-left: 1.5rem;
    color: var(--text-secondary);
}

.achievements li {
    margin-bottom: 0.5rem;
}

/* Network Nodes (Grid) */
.grid-2-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.card {
    border: 1px solid var(--grid-line);
    padding: 2rem;
    background: rgba(255, 255, 255, 0.02);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    border-color: var(--accent-color);
}

.badge {
    display: inline-block;
    background: var(--accent-color);
    color: #000;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    margin: 0.5rem 0;
    font-weight: bold;
}

/* Specs (Tags) */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1rem;
    margin-bottom: 2rem;
}

.tags span {
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 0.5rem 1rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    transition: all 0.2s;
}

.tags span:hover {
    background: var(--accent-color);
    color: #000;
    cursor: default;
}

/* Footer */
#main-footer {
    border-top: 2px solid var(--grid-line);
    padding: 4rem 2rem;
    margin-top: 4rem;
    background: #000;
    display: flex;
    justify-content: center;
}

.footer-content {
    width: 100%;
    max-width: 1200px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

#omega-trigger {
    cursor: pointer;
    font-size: 1.5rem;
    color: #222; /* Hidden in plain sight */
    transition: color 0.3s;
    user-select: none;
}

#omega-trigger:hover {
    color: var(--accent-secondary);
}

/* --- TERMINAL OVERLAY --- */
.hidden {
    display: none !important;
}

#terminal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.terminal-window {
    width: 80%;
    max-width: 800px;
    height: 60vh;
    background: #000;
    border: 2px solid #0f0;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.2);
    display: flex;
    flex-direction: column;
    font-family: 'Courier New', monospace;
}

.terminal-header {
    background: #0f0;
    color: #000;
    padding: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
}

#close-terminal {
    background: none;
    border: none;
    font-weight: bold;
    cursor: pointer;
    font-size: 1.2rem;
}

.terminal-body {
    padding: 1rem;
    color: #0f0;
    flex-grow: 1;
    overflow-y: auto;
    font-size: 1rem;
    white-space: pre-wrap;
}

.cursor {
    animation: blink 1s step-end infinite;
}

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

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .system-nav {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .log-entry {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .log-entry::after {
        display: none;
    }

    .log-meta {
        text-align: left;
        flex-direction: row;
        gap: 1rem;
        padding-bottom: 0.5rem;
        border-bottom: 1px dashed var(--grid-line);
        margin-bottom: 1rem;
    }

    .log-content {
        border-left: none;
        padding-left: 0;
    }

    .grid-2-col {
        grid-template-columns: 1fr;
    }
}
