/* --- Global Variables (Earthy & Professional Palette) --- */
:root {
    --bg-color: #f4f1ea;        
    --surface-color: #ffffff;   
    --text-primary: #2d2a26;    
    --text-secondary: #635e59;  
    --accent-color: #314a3e;    
    --accent-hover: #4a6b5d;    
    --accent-light: #e6dfd3;    
    --link-color: #2b6777;      
    --radius: 8px;
    --transition: all 0.3s ease;
}

/* --- Engineer Mode Variables (Terminal Dark Mode) --- */
body.engineer-mode {
    --bg-color: #0d1117;        
    --surface-color: #161b22;   
    --text-primary: #c9d1d9;    
    --text-secondary: #8b949e;  
    --accent-color: #39d353;    
    --accent-hover: #2ea043;    
    --accent-light: #30363d;    
    --link-color: #58a6ff;      
}

/* --- Base Reset & Typography --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    background-color: var(--bg-color);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.4s ease, color 0.4s ease;
}
.container { max-width: 900px; margin: 0 auto; padding: 0 20px; }
.text-center { text-align: center; }

/* Apply monospace to headers in Engineer Mode */
body.engineer-mode h1, 
body.engineer-mode h2, 
body.engineer-mode h3, 
body.engineer-mode .stat-number, 
body.engineer-mode .focus-label, 
body.engineer-mode th {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 30px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.95rem;
    letter-spacing: 0.5px;
}
.btn-primary {
    background-color: var(--accent-color);
    color: #ffffff;
    border: 2px solid var(--accent-color);
}
.btn-primary:hover {
    background-color: transparent;
    color: var(--accent-color);
}
/* Ensure dark text on bright green buttons in Engineer Mode */
body.engineer-mode .btn-primary { color: #0d1117; font-weight: 700;}
body.engineer-mode .btn-primary:hover { color: var(--accent-color); background: transparent; }

/* --- Hero Section --- */
.hero {
    background-color: var(--surface-color);
    padding: 80px 0 50px;
    text-align: center;
    transition: background-color 0.4s ease;
}
.hero h1 {
    font-size: 2.75rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 10px;
    color: var(--accent-color);
    transition: color 0.4s ease;
}
.subtitle {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--link-color);
    margin-bottom: 20px;
    transition: color 0.4s ease;
}
.summary {
    max-width: 750px;
    margin: 0 auto;
    font-size: 1.15rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 30px;
    transition: opacity 0.3s ease, color 0.4s ease; /* Smooth text swap */
}
.hero-actions {
    margin-top: 20px;
}

/* --- Live Telemetry Strip --- */
.live-telemetry {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.9rem;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.5);
    padding: 10px 20px;
    border-radius: 30px;
    border: 1px solid var(--accent-light);
    transition: background-color 0.4s ease, border-color 0.4s ease;
}
body.engineer-mode .live-telemetry { background: transparent; }
.telemetry-item {
    display: flex;
    align-items: center;
    color: var(--text-primary);
    font-weight: 600;
}
.pulse-dot {
    height: 10px;
    width: 10px;
    background-color: #2e7d32; 
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
    box-shadow: 0 0 0 rgba(46, 125, 50, 0.4);
    animation: pulse 2s infinite;
}
body.engineer-mode .pulse-dot { background-color: #39d353; box-shadow: 0 0 0 rgba(57, 211, 83, 0.4); }
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(46, 125, 50, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(46, 125, 50, 0); }
    100% { box-shadow: 0 0 0 0 rgba(46, 125, 50, 0); }
}
body.engineer-mode .pulse-dot { animation: pulse-dark 2s infinite; }
@keyframes pulse-dark {
    0% { box-shadow: 0 0 0 0 rgba(57, 211, 83, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(57, 211, 83, 0); }
    100% { box-shadow: 0 0 0 0 rgba(57, 211, 83, 0); }
}
.focus-label { color: var(--link-color); margin-right: 6px; transition: color 0.4s ease;}
.cursor { animation: blink 1s step-end infinite; color: var(--accent-color); font-weight: bold;}
@keyframes blink { 50% { opacity: 0; } }
.divider { margin: 0 10px; color: var(--accent-light); transition: color 0.4s ease;}

/* --- Impact Bar (Metrics) --- */
.impact-bar {
    background-color: var(--accent-color);
    color: var(--surface-color);
    padding: 30px 0;
    border-bottom: 4px solid var(--link-color);
    transition: background-color 0.4s ease, border-color 0.4s ease;
}
.impact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    text-align: center;
}
.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 5px;
    color: var(--surface-color);
    transition: color 0.4s ease;
}
.stat-label {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    transition: color 0.4s ease;
}
/* Ensure dark text on bright green background in Engineer Mode */
body.engineer-mode .impact-bar { color: #0d1117; }
body.engineer-mode .stat-number, body.engineer-mode .stat-label { color: #0d1117; font-weight: 700;}

/* --- Navigation & Toggle Switch --- */
.sticky-nav {
    background-color: var(--surface-color);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--accent-light);
    padding: 15px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: background-color 0.4s ease, border-color 0.4s ease;
}
.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}
.nav-links { display: flex; justify-content: center; gap: 25px; }
.nav-links a {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.nav-links a:hover { color: var(--accent-color); }

/* Switch UI */
.mode-toggle-container {
    display: flex;
    align-items: center;
    gap: 10px;
}
.mode-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    transition: color 0.4s ease;
}
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--accent-light);
    transition: .4s;
}
.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}
input:checked + .slider { background-color: var(--accent-color); }
input:checked + .slider:before { transform: translateX(20px); }
.slider.round { border-radius: 34px; }
.slider.round:before { border-radius: 50%; }

/* --- Sections --- */
.section { padding: 80px 0; border-bottom: 1px solid var(--accent-light); transition: border-color 0.4s ease;}
.section h2 { font-size: 2rem; margin-bottom: 40px; color: var(--accent-color); letter-spacing: -0.5px; text-align: center; transition: color 0.4s ease;}

/* --- Services Grid --- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}
.service-card {
    background: var(--surface-color);
    padding: 30px;
    border-radius: var(--radius);
    text-align: center;
    border: 1px solid var(--accent-light);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
    transition: background-color 0.4s ease, border-color 0.4s ease, transform 0.3s ease, box-shadow 0.3s ease;
}
.service-card:hover { transform: translateY(-5px); box-shadow: 0 8px 25px rgba(0, 0, 0, 0.06); border-color: var(--link-color); }
.service-icon { font-size: 2.5rem; margin-bottom: 15px; }
.service-card h3 { font-size: 1.2rem; color: var(--text-primary); margin-bottom: 15px; transition: color 0.4s ease;}
.service-card p { font-size: 0.95rem; color: var(--text-secondary); transition: color 0.4s ease;}

/* --- Case Studies --- */
.case-card {
    background: var(--surface-color);
    padding: 30px;
    border-radius: var(--radius);
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    border-left: 4px solid var(--accent-color);
    transition: background-color 0.4s ease, border-color 0.4s ease;
}
.case-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 20px; flex-wrap: wrap; }
.case-header h3 { font-size: 1.35rem; color: var(--text-primary); transition: color 0.4s ease;}
.client { color: var(--link-color); font-size: 0.95rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; transition: color 0.4s ease;}
.case-card ul { padding-left: 20px; color: var(--text-secondary); line-height: 1.7; transition: color 0.4s ease;}
.case-card li { margin-bottom: 12px; }

/* --- Artifacts Section --- */
.artifact-container {
    background: var(--surface-color);
    padding: 30px;
    border-radius: var(--radius);
    border: 1px solid var(--accent-light);
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
    transition: background-color 0.4s ease, border-color 0.4s ease;
}
.pdf-card {
    background-color: var(--bg-color);
    padding: 40px 20px;
    border-radius: var(--radius);
    border: 2px dashed var(--accent-light);
    margin-bottom: 25px;
    transition: background-color 0.4s ease, border-color 0.4s ease;
}
.pdf-card:hover {
    border-color: var(--link-color);
    background-color: #faf7f2;
}
body.engineer-mode .pdf-card:hover { background-color: rgba(255,255,255,0.05); }
.pdf-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}
.pdf-card h3 {
    font-size: 1.35rem;
    margin-bottom: 20px;
    color: var(--text-primary);
    transition: color 0.4s ease;
}
.artifact-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
    transition: color 0.4s ease;
}

/* --- Education/Credentials Grid --- */
.edu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}
.edu-item {
    background: var(--surface-color);
    padding: 25px;
    border-radius: var(--radius);
    text-align: center;
    border: 1px solid var(--accent-light);
    transition: background-color 0.4s ease, border-color 0.4s ease;
}
.edu-item h4 { font-size: 1.05rem; margin-bottom: 8px; color: var(--text-primary); transition: color 0.4s ease;}
.edu-item p { font-size: 0.9rem; color: var(--text-secondary); font-weight: 500; transition: color 0.4s ease;}

/* --- Call to Action Section --- */
.cta-section {
    background-color: var(--surface-color);
    padding: 80px 20px;
    border-bottom: 1px solid var(--accent-light);
    transition: background-color 0.4s ease, border-color 0.4s ease;
}
.cta-section h2 {
    font-size: 2.25rem;
    color: var(--accent-color);
    margin-bottom: 20px;
    letter-spacing: -0.5px;
    transition: color 0.4s ease;
}
.cta-section p {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 35px;
    line-height: 1.6;
    transition: color 0.4s ease;
}

/* --- Footer --- */
footer { text-align: center; padding: 50px 20px; color: var(--text-secondary); font-size: 0.9rem; transition: color 0.4s ease;}

/* --- Dynamic Query Dashboard --- */
.dynamic-metrics {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.d-metric {
    background-color: var(--surface-color);
    border: 1px solid var(--accent-light);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
    transition: background-color 0.4s ease, border-color 0.4s ease, color 0.4s ease;
}
.d-val {
    color: var(--accent-color);
    font-size: 1rem;
    margin-left: 5px;
    transition: color 0.4s ease;
}

/* --- Data Table & Controls --- */
.controls { margin-bottom: 20px; display: flex; justify-content: flex-end; }
.search-input { width: 100%; max-width: 400px; padding: 14px 20px; border: 1px solid var(--accent-light); border-radius: 30px; font-size: 0.95rem; font-family: inherit; transition: var(--transition); background-color: var(--surface-color); color: var(--text-primary); }
.search-input:focus { outline: none; border-color: var(--link-color); box-shadow: 0 0 0 3px rgba(43, 103, 119, 0.15); }
.table-container { width: 100%; overflow-x: auto; background: var(--surface-color); border-radius: var(--radius); border: 1px solid var(--accent-light); transition: background-color 0.4s ease, border-color 0.4s ease;}
.data-table { width: 100%; border-collapse: collapse; text-align: left; min-width: 800px; }
.data-table th, .data-table td { padding: 18px 16px; border-bottom: 1px solid var(--accent-light); font-size: 0.95rem; transition: border-color 0.4s ease, color 0.4s ease; color: var(--text-primary);}
.data-table th { background-color: var(--bg-color); color: var(--accent-color); font-weight: 700; position: sticky; top: 0; text-transform: uppercase; font-size: 0.85rem; letter-spacing: 0.5px; transition: background-color 0.4s ease, color 0.4s ease;}
.data-table tbody tr { transition: background-color 0.2s; }
body:not(.engineer-mode) .data-table tbody tr:hover { background-color: #fbfaf8; }
body.engineer-mode .data-table tbody tr:hover { background-color: rgba(255,255,255,0.05); }
.badge { display: inline-block; padding: 6px 10px; background-color: var(--accent-light); color: var(--text-primary); border-radius: 4px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.5px; transition: background-color 0.4s ease, color 0.4s ease;}