/* CSS Variables */
:root {
    --bg-deep: #0d1117;
    --bg-surface: rgba(22, 27, 34, 0.85);
    --border-color: #30363d;
    --text-primary: #c9d1d9;
    --text-muted: #8b949e;
    --accent-teal: #00f2fe;
    --error-red: #ff7b72;
    --font-mono: 'Fira Code', monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-mono);
    background-color: var(--bg-deep);
    color: var(--text-primary);
    line-height: 1.6;
    padding-top: 60px; 
    overflow-x: hidden;
}

/* ------------- NAVIGATION ------------- */
.bs-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 65px;
    background-color: #010409; /* Deep system dark */
    border-bottom: 1px solid #30363d;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    z-index: 1000;
    /* Force system sans-serif for the UI shell */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

/* Left Group */
.bs-nav-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.bs-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: #ffffff;
    font-weight: 600;
    font-size: 1rem;
}

.bs-brand svg {
    transition: fill 0.2s ease;
}

.bs-brand:hover svg path {
    fill: #ffffff;
}

.bs-nav-links {
    display: flex;
    gap: 0.25rem;
    margin-left: 0.5rem;
}

.bs-nav-links a {
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.bs-nav-links a:hover {
    background-color: rgba(177, 186, 196, 0.12);
}

/* Right Group */
.bs-nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Auth Buttons */
.bs-auth-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bs-btn-login {
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
}

.bs-btn-login:hover {
    color: rgba(255,255,255,0.7);
}

.bs-btn-signup {
    color: #c9d1d9;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 5px 12px;
    border: 1px solid #30363d;
    border-radius: 6px;
    background-color: #21262d;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.bs-btn-signup:hover {
    background-color: #30363d;
    border-color: #8b949e;
    color: #ffffff;
}

/* Mobile Responsiveness */
@media (max-width: 900px) {
    .bs-nav-links, .bs-search, .bs-auth-links {
        display: none;
    }
}

/* The Global Canvas - Deep background technical watermark */
.global-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: url('./blacksand.jpg') no-repeat center center;
    background-size: cover;
    opacity: 0.08;
    z-index: -1;
    pointer-events: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

/* Typography */
h1, h2, h3 {
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 1rem;
}

p {
    margin-bottom: 1.5rem;
    color: var(--text-muted);
}

a {
    color: var(--accent-teal);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

a:hover {
    opacity: 0.8;
}

/* Buttons */
.btn-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.2s ease;
}

.btn-primary {
    border-color: var(--accent-teal);
    color: var(--accent-teal);
}

.btn:hover {
    background: var(--border-color);
    color: #ffffff;
}

/* ------------- INDEX PAGE ------------- */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
    background: linear-gradient(to bottom, rgba(13, 17, 23, 0.6) 0%, rgba(13, 17, 23, 0.9) 70%, var(--bg-deep) 100%),
                url('./lionrock.jpg') no-repeat center center;
    background-size: cover;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 4rem);
    max-width: 800px;
    line-height: 1.2;
    text-shadow: 0 4px 20px rgba(0,0,0,0.8);
}

.hero p {
    font-size: clamp(1rem, 2vw, 1.25rem);
    max-width: 650px;
    color: var(--text-primary);
}

.tech-showcase {
    text-align: center;
    padding: 6rem 2rem;
}

.code-block {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 2rem;
    border-radius: 4px;
    text-align: left;
    max-width: 700px;
    margin: 2rem auto 0;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow-x: auto;
}

.code-block code { color: #79c0ff; }
.code-block .keyword { color: #ff7b72; }
.code-block .string { color: #a5d6ff; }

.pillars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 2rem;
    border-radius: 4px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    transition: border-color 0.3s ease;
}

.card:hover { border-color: var(--accent-teal); }
.card h3 { font-size: 1.25rem; color: #ffffff; }
.card .model {
    margin-top: auto;
    font-size: 0.85rem;
    color: var(--accent-teal);
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    margin-bottom: 1rem;
}

/* ------------- PLATFORM PAGE ------------- */
.page-header {
    text-align: center;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.feature-section {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 4px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.feature-section h2 { color: var(--accent-teal); }

/* ------------- 404 PAGE ------------- */
.error-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
}

.error-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 3rem 2rem;
    border-radius: 4px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    max-width: 500px;
    width: 100%;
}

.error-code {
    color: var(--error-red);
    font-size: 4rem;
    font-weight: 600;
    line-height: 1;
    margin-bottom: 0.5rem;
}

/* ------------- FOOTER ------------- */
.footer {
    text-align: center;
    border-top: 1px solid var(--border-color);
    padding-top: 4rem;
    padding-bottom: 2rem;
    margin-top: 4rem;
}

.footer h2 { font-size: 2rem; }
.footer-nav {
    margin: 2rem 0;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    font-size: 0.9rem;
}
.micro-copy {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2rem;
}

/* ------------- DEPLOYED INFRASTRUCTURE (OUR WORK) ------------- */

.bs-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

.work-header {
    max-width: 700px;
    margin-bottom: 4rem;
}

.work-header h1 {
    font-size: 3rem;
    color: #ffffff;
    margin-bottom: 1rem;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.work-header p {
    font-size: 1.15rem;
    color: #8b949e;
    line-height: 1.6;
}

.case-studies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 2rem;
}

.bs-case-card {
    background-color: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.bs-case-card:hover {
    border-color: #8b949e;
    transform: translateY(-2px);
}

.case-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.case-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

.case-badge.civic {
    background-color: rgba(0, 242, 254, 0.1);
    color: #00f2fe;
    border: 1px solid rgba(0, 242, 254, 0.2);
}

.case-badge.operator {
    background-color: rgba(165, 214, 255, 0.1);
    color: #a5d6ff;
    border: 1px solid rgba(165, 214, 255, 0.2);
}

.case-status {
    color: #8b949e;
}

.bs-case-card h2 {
    font-size: 1.75rem;
    color: #ffffff;
    margin-bottom: 1rem;
}

.case-desc {
    color: #8b949e;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    flex-grow: 1;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.tech-tag {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    background-color: #161b22;
    border: 1px solid #30363d;
    color: #c9d1d9;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
}

.case-footer {
    border-top: 1px solid #30363d;
    padding-top: 1.5rem;
}

.app-store-btn {
    display: inline-block;
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.app-store-btn:hover {
    color: #00f2fe;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .case-studies-grid {
        grid-template-columns: 1fr;
    }
    .bs-case-card {
        padding: 1.5rem;
    }
    .work-header h1 {
        font-size: 2.25rem;
    }
}

/* ------------- PRODUCT & SYSTEM LAYOUT ------------- */

.bs-layout {
    display: flex;
    min-height: calc(100vh - 65px);
    max-width: 1400px;
    margin: 0 auto;
    background-color: var(--bg-deep); 
}

/* Sidebar Index */
.bs-sidebar {
    width: 280px;
    flex-shrink: 0;
    border-right: 1px solid #30363d;
    padding: 2rem 1.5rem;
    position: sticky;
    top: 65px;
    height: calc(100vh - 65px);
    overflow-y: auto;
    background-color: #010409;
}

.sidebar-group {
    margin-bottom: 2rem;
}

.sidebar-group h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #8b949e;
    margin-bottom: 0.75rem;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.sidebar-group nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar-group a {
    color: #c9d1d9;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.sidebar-group a:hover {
    background-color: rgba(177, 186, 196, 0.12);
    color: #ffffff;
}

.sidebar-group a.active {
    background-color: rgba(0, 242, 254, 0.1); 
    color: #00f2fe;
    font-weight: 600;
}

/* Main Content Area */
.bs-content {
    flex-grow: 1;
    padding: 3rem 4rem;
    max-width: 900px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

.bs-content section {
    margin-bottom: 4rem;
}

.bs-content h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #ffffff;
    line-height: 1.2;
}

.bs-content h2 {
    font-size: 1.75rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #ffffff;
    border-bottom: 1px solid #30363d;
    padding-bottom: 0.5rem;
}

.bs-content h3 {
    font-size: 1.25rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-family: var(--font-mono); 
    color: #c9d1d9;
}

.bs-content p {
    color: #8b949e;
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.bs-content ul {
    color: #8b949e;
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.bs-content li {
    margin-bottom: 0.5rem;
}

.bs-content strong {
    color: #c9d1d9;
}

.bs-divider {
    border: 0;
    height: 1px;
    background: #30363d;
    margin: 3rem 0;
}

/* Code Specific Overrides */
.bs-content .code-block {
    background: #161b22;
    border: 1px solid #30363d;
    padding: 1.25rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    overflow-x: auto;
}

.bs-content code {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: #c9d1d9;
}

/* Syntax Highlighting */
.code-block .keyword { color: #ff7b72; } 
.code-block .string { color: #a5d6ff; }  
.code-block .number { color: #79c0ff; }  

/* Inline code */
.bs-content p code, .bs-content li code {
    background: rgba(177, 186, 196, 0.15);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

/* Mobile Responsiveness */
@media (max-width: 900px) {
    .bs-layout {
        flex-direction: column;
    }
    
    .bs-sidebar {
        width: 100%;
        height: auto;
        position: relative;
        top: 0;
        border-right: none;
        border-bottom: 1px solid #30363d;
        padding: 1.5rem;
    }
    
    .bs-content {
        padding: 2rem 1.5rem;
    }
}