:root {
    /* Color Palette - High Contrast */
    --bg-color: #101012;
    --surface-color: #161618; /* Slightly darker for better pop */
    --surface-active: #232326;
    
    --primary: #ffb000;   /* Amber - Interaction / Main Header */
    --secondary: #ff5f1f; /* Neon Orange - Alert / Highlights */
    --tertiary: #00e0e0;  /* Cyan - Data / Terminal / HUD */
    
    --text-main: #e6e1d8; /* Bone White */
    --text-dim: #7a7a7a;  /* Industrial Gray */
    --border-dim: #3a3a3a;
    
    /* Spacing */
    --spacing-sm: 10px;
    --spacing-md: 20px;
    --spacing-lg: 40px;
    
    --header-height: 70px;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Space Mono', monospace;
    font-size: 14px;
    line-height: 1.6;
    overflow-x: hidden;
    cursor: url('/assets/cursor.svg'), crosshair;
}

/* --- CRT Overlay Effects (Unchanged but refined) --- */
.crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    pointer-events: none;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 3px, 3px 100%;
}

.screen-glare {
    position: absolute;
    top: -50%;
    left: 0;
    width: 100%;
    height: 10px;
    backdrop-filter: blur(3px);
    background:linear-gradient(
        rgba(0, 0, 0, 0) 0%, 
        rgba(255, 255, 255, 0.1) 50%,
        rgba(0, 0, 0, 0) 100%
    );
    animation: scan-down 6s linear infinite;
}

@keyframes scan-down {
    0% { top: -10%; opacity: 0; }
    20% { opacity: 1; }
    100% { top: 110%; opacity: 0; }
}

/* --- Typography --- */
h1, h2, h3, h4 {
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: var(--spacing-md);
}

h1 { font-size: 2rem; color: var(--primary); text-shadow: 0 0 5px rgba(255, 176, 0, 0.5); }
h2 { font-size: 1.5rem; color: var(--primary); }
h3 { font-size: 1.2rem; color: var(--text-main); border-left: 4px solid var(--primary); padding-left: 10px; }
h4 { font-size: 1rem; color: var(--tertiary); }

.blink { animation: blinker 1s step-end infinite; }
@keyframes blinker { 50% { opacity: 0; } }

a { text-decoration:none; color:inherit; }

/* --- Initialization Screen (Centered & Spaced) --- */
#init-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    z-index: 1000;
    
    /* Centering Logic */
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.init-container {
    /* REMOVED OUTER BORDER */
    width: 80%;
    max-width: 700px;
    display: flex;
    flex-direction: column;
    gap: 30px; /* Explicit margin between elements */
}

.init-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 10px;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 10px;
    width: 100%;
}

.terminal-window {
    background-color: #08080a;
    height: 300px;
    width: 100%;
    overflow-y: auto;
    padding: 20px;
    font-family: 'Space Mono', monospace;
    font-size: 13px;
    
    /* Vivid Terminal Style */
    color: var(--tertiary); /* Cyan Text */
    border: 1px solid var(--tertiary); /* Cyan Border */
    box-shadow: inset 0 0 20px rgba(0, 163, 163, 0.1);
}

.terminal-line { display: block; margin-bottom: 5px; }

.loading-area {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.progress-bar-container {
    width: 100%;
    height: 24px;
    background: #000;
    border: 2px solid var(--secondary); /* Orange Border for contrast */
    padding: 2px;
}

.progress-bar {
    height: 100%;
    background-color: var(--secondary); /* Orange Fill */
    width: 0%;
    transition: width 0.1s linear;
    box-shadow: 0 0 10px var(--secondary);
}

.sys-status-text {
    text-align: right;
    font-size: 12px;
    color: var(--text-dim);
}

/* Button centered by flex gap in container, but let's ensure it's self-centered */
#btn-initialize {
    align-self: center; 
}

.hidden { display: none !important; }

/* --- Layout --- */
.layout-container {
    display: flex;
    min-height: 100vh;
    padding: var(--spacing-lg);
    gap: var(--spacing-lg);
    background-image: radial-gradient(var(--border-dim) 1px, transparent 1px);
    background-size: 30px 30px;
}

.sidebar {
    width: 27.5vw;
    position: fixed;
    top: var(--spacing-lg);
    left: var(--spacing-lg);
    bottom: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    gap: 25px; /* Spacing between sidebar modules */
    border-right: 1px solid var(--border-dim);
    padding-right: 25px;
    background: var(--bg-color); /* Mask the grid behind */
    z-index: 100;
}

.main-content {
    margin-left: calc(27.5vw + var(--spacing-lg));
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 50px; /* Large gap between sections */
    padding-bottom: 100px;
}

/* --- Components --- */

/* Buttons */
.button {
    background: rgba(0,0,0,0.5);
    border: 2px solid var(--primary);
    color: var(--primary);
    font-family: 'Space Mono', monospace;
    font-size: 16px;
    font-weight: 700;
    padding: 18px 36px;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 6px 6px 0px rgba(0,0,0,0.8); /* Hard shadow */
    transition: all 0.15s cubic-bezier(0, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.button:hover {
    background: var(--primary);
    color: #000;
    transform: translate(2px, 2px);
    box-shadow: 4px 4px 0px rgba(0,0,0,0.8);
    border-color: var(--primary);
}

.button:active {
    transform: translate(6px, 6px);
    box-shadow: none;
}

.full-width { width: 100%; }

/* Boxes - Vivid Style */
.box {
    border: 1px solid var(--border-dim);
    background-color: var(--surface-color);
    padding: 40px 30px 30px 30px; /* Top padding covers header area */
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    margin-bottom: 0; /* Handled by parent gap */
}

/* Decorative corner on Box */
.box::before {
    content: '';
    position: absolute;
    top: -1px;
    right: -1px;
    width: 20px;
    height: 20px;
    border-top: 2px solid var(--tertiary); /* Cyan Corner */
    border-right: 2px solid var(--tertiary);
}

.box::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: -1px;
    width: 10px;
    height: 10px;
    background: var(--border-dim);
    clip-path: polygon(0 0, 0% 100%, 100% 100%);
}

/* Box Header - Tape Label Style */
.box-header {
    position: absolute;
    top: -12px;
    left: 20px;
    background-color: var(--primary);
    color: #000;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid var(--primary);
    box-shadow: 4px 4px 0 rgba(0,0,0,0.5);
    z-index: 2;
}

/* Three Column Grid - Varied Colors */
.three {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

/* Differentiate the 3 boxes for vividness */
.three .box:nth-child(1) { border-top: 2px solid var(--tertiary); } /* Cyan Top */
.three .box:nth-child(1) .box-header { background-color: var(--tertiary); border-color: var(--tertiary); }

.three .box:nth-child(2) { border-top: 2px solid var(--secondary); } /* Orange Top */
.three .box:nth-child(2) .box-header { background-color: var(--secondary); border-color: var(--secondary); }

.three .box:nth-child(3) { border-top: 2px solid var(--primary); } /* Amber Top */

/* Img Text */
.img-text {
    display: flex;
    gap: 40px;
    align-items: stretch;
}

.img-wrapper {
    flex: 1.2;
    position: relative;
    border: 1px solid var(--border-dim);
    padding: 10px;
    background: #000;
}

.img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: grayscale(100%) sepia(20%) contrast(1.2);
    border: 1px solid #333;
}

.img-overlay {
    position: absolute;
    top: 20px;
    left: 20px;
    background: var(--secondary); /* Orange label */
    color: #000;
    font-weight: bold;
    padding: 4px 8px;
    font-size: 11px;
}

.text-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-right: 4px solid var(--border-dim);
    padding-right: 30px;
}

.text-content p {
    color: var(--text-dim);
    margin-bottom: 20px;
}

/* Sidebar Specifics */
.sidebar-header h2 {
    border-bottom: 2px solid var(--border-dim);
    padding-bottom: 10px;
    margin-bottom: 0;
}

.data-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: rgba(255,255,255,0.02);
    padding: 15px;
    border: 1px solid var(--border-dim);
}

.data-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.label { color: var(--text-dim); font-size: 11px; }
.value { color: var(--tertiary); font-weight: bold; font-size: 14px; } /* Cyan Values */

/* Progress Bars Mini */
.progress-bar-mini {
    height: 6px;
    width: 100%;
    background: #222;
    margin-top: 8px;
    position: relative;
}

.progress-bar-mini .bar {
    height: 100%;
    background-color: var(--tertiary); /* Cyan bars */
}

/* Oscilloscope */
.oscilloscope-container {
    border: 2px solid var(--border-dim);
    background: #080808;
    position: relative;
    height: 180px;
    margin-top: auto;
    box-shadow: inset 0 0 20px rgba(0,0,0,1);
}

.oscilloscope-container .box-header {
    background: var(--text-dim);
    color: #000;
    border-color: var(--text-dim);
    top: -10px;
    left: 10px;
}

/* Divider Line */
.line {
    height: 1px;
    background-color: var(--border-dim);
    width: 100%;
    margin: 20px 0; /* Non-zero margin */
    position: relative;
    display: flex;
    justify-content: flex-end;
}

.line-label {
    background: var(--bg-color);
    color: var(--secondary); /* Orange text on lines */
    font-size: 10px;
    padding-left: 15px;
    position: relative;
    top: -8px;
    font-weight: 700;
}

/* Retro List */
.retro-list {
    list-style: none;
    margin-top: 15px;
    max-width: 1fr;
}

.retro-list li {
    padding: 3px 0;
    border-bottom: 1px dashed #333;
    color: var(--text-dim);
    display: flex;
    align-items: center;
}

.retro-list li::before {
    content: '>';
    color: var(--secondary);
    margin-right: 10px;
}

/* Footer */
.footer {
    margin-top: 60px;
    color: var(--text-dim);
    font-size: 12px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    padding-top: 10px;
}

.status-indicator {
    color: var(--tertiary);
}

/* Animation Classes */
.fade-in-section {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease-out, transform 0.6s cubic-bezier(0, 0, 0.2, 1);
}

.fade-in-section.is-visible {
    opacity: 1;
    transform: none;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .layout-container {
        flex-direction: column;
        padding: 20px;
    }

    .sidebar { display: none; }

    .main-content {
        margin-left: 0;
        width: 100%;
        gap: 30px;
    }

    .three { grid-template-columns: 1fr; }

    .img-text { flex-direction: column; gap: 20px; }
    
    .text-content {
        border-right: none;
        border-top: 2px solid var(--secondary);
        padding-right: 0;
        padding-top: 20px;
    }
    
    .init-container { width: 90%; }
}