/* -------------------------------------------------------------------------- */
/* GrittyTruth: The Fortress Design System v2.0                               */
/* Premium Industrial Aesthetic | Antigravity Managed                         */
/* -------------------------------------------------------------------------- */

:root {
    /* PRIMARY THEME: Field Grade (High Visibility Light) */
    --bg-dark: #F9FAFB;
    /* Bright, clean canvas to minimize glare */
    --bg-panel: #FFFFFF;
    /* Pure white panels for clarity */
    --border-industrial: #101828;
    /* Sharp Charcoal borders for structure */
    --border-bright: #344054;
    /* Distinct interactive boundaries */
    --accent-yellow: #854D0E;
    /* Deep Industrial Gold (WCAG 4.5:1 Contrast on White) */
    --accent-caution: #EAB308;
    /* Bright yellow reserved for background blocks */
    --accent-red: #D92D20;
    /* High-contrast Signal Red */
    --text-primary: #0A0D12;
    /* Absolute Black for primary data */
    --text-muted: #1F2937;
    /* Deep Grey (Slate-800) for secondary labels - Fixes Grey on Grey */
    --text-secondary: #4B5563;
    /* Medium Grey (Slate-600) only for very large text */
    --sidebar-bg: #FFFFFF;
    --nav-bg: rgba(249, 250, 251, 0.9);
    --sidebar-width: 280px;
    --transition-fast: 0.1s ease;
    --transition-standard: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* OS-LEVEL DARK MODE OVERRIDE (Command Center) */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-dark: #0A0B0C;
        --bg-panel: #141618;
        --border-industrial: #2D3135;
        --border-bright: #4A4F55;
        --accent-yellow: #FFD700;
        --accent-red: #FE4A49;
        --text-primary: #FFFFFF;
        --text-muted: #8E969F;
        --sidebar-bg: #0A0B0C;
        --nav-bg: rgba(10, 11, 12, 0.8);
    }
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    margin: 0;
    transition: background-color 0.3s ease, color 0.3s ease;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Digital scanline texture overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        repeating-linear-gradient(0deg, transparent, transparent 1.5px, rgba(0, 0, 0, 0.015) 1.5px, rgba(0, 0, 0, 0.015) 3px),
        repeating-linear-gradient(90deg, transparent, transparent 1.5px, rgba(0, 0, 0, 0.015) 1.5px, rgba(0, 0, 0, 0.015) 3px);
    pointer-events: none;
    z-index: 9999;
    opacity: 0.4;
}

@media (prefers-color-scheme: dark) {
    body::before {
        background:
            repeating-linear-gradient(0deg, transparent, transparent 1.5px, rgba(255, 255, 255, 0.008) 1.5px, rgba(255, 255, 255, 0.008) 3px),
            repeating-linear-gradient(90deg, transparent, transparent 1.5px, rgba(255, 255, 255, 0.008) 1.5px, rgba(255, 255, 255, 0.008) 3px);
        opacity: 1;
    }
}

h1 {
    font-size: clamp(2.5rem, 8vw, 6rem);
}

h2 {
    font-size: clamp(1.5rem, 5vw, 4rem);
}

h1,
h2,
h3,
h4 {
    font-family: 'Inter', sans-serif;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: -0.04em;
    margin: 0;
}

.heavy-title {
    font-weight: 950;
    letter-spacing: -0.05em;
    line-height: 0.95;
}

.mono-data {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
}

/* Structural Layout */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-panel);
    border-right: 2px solid var(--border-industrial);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-100%);
}

.sidebar.is-visible {
    transform: translateX(0);
}

@media (min-width: 1024px) {
    .sidebar {
        position: sticky;
        transform: translateX(0);
    }
}

.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 0;
    position: relative;
    width: 100%;
}

@media (min-width: 1024px) {
    .main-content {
        width: calc(100% - var(--sidebar-width));
    }
}

/* High-Visibility Industrial Accent Text */
.industrial-text-accent {
    color: var(--accent-yellow);
    font-weight: 900;
}

.industrial-bg-accent {
    background-color: var(--accent-caution);
    color: #000;
}

.industrial-panel {
    background: var(--bg-panel);
    border: 1.5px solid var(--border-industrial);
    /* Thickened for visibility */
    position: relative;
    transition: var(--transition-standard);
    box-shadow: 0 4px 12px rgba(16, 24, 40, 0.08);
}

/* Premium Glass Effect on Hover */
.industrial-panel:hover {
    border-color: var(--border-bright);
    box-shadow: 0 8px 32px rgba(16, 24, 40, 0.1);
}

@media (prefers-color-scheme: dark) {
    .industrial-panel {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }

    .industrial-panel:hover {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    }
}

/* Rivets with Glow */
.rivet {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #98A2B3;
    /* Slate rivet for light mode */
    border: 1px solid #D0D5DD;
    box-shadow: inset 1px 1px 1px rgba(0, 0, 0, 0.05);
    z-index: 2;
    transition: background 0.3s ease;
}

@media (prefers-color-scheme: dark) {
    .rivet {
        background: #3A3F44;
        border: 1px solid #000;
        box-shadow: inset 1px 1px 1px rgba(255, 255, 255, 0.1);
    }
}

.rivet-tl {
    top: 6px;
    left: 6px;
}

.rivet-tr {
    top: 6px;
    right: 6px;
}

.rivet-bl {
    bottom: 6px;
    left: 6px;
}

.rivet-br {
    bottom: 6px;
    right: 6px;
}

/* In-Card Rivets (offset from edge) */
.industrial-panel .rivet-tl {
    top: 8px;
    left: 8px;
}

.industrial-panel .rivet-tr {
    top: 8px;
    right: 8px;
}

.industrial-panel .rivet-bl {
    bottom: 8px;
    left: 8px;
}

.industrial-panel .rivet-br {
    bottom: 8px;
    right: 8px;
}

.rivet.accent {
    background: var(--accent-yellow);
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.6);
    border-color: #000;
}

/* Sidebar Styling */
.sidebar-item {
    padding: 1rem 1.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: var(--transition-standard);
    border-left: 3px solid transparent;
}

.sidebar-item:hover {
    color: var(--text-primary);
    background: rgba(16, 24, 40, 0.03);
    border-left-color: var(--border-bright);
}

.sidebar-item.active {
    color: var(--accent-yellow);
    background: rgba(255, 215, 0, 0.05);
    border-left-color: var(--accent-yellow);
}

/* High Fidelity Buttons */
.industrial-btn {
    background: var(--accent-yellow);
    color: #000;
    border: none;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.75rem 1.5rem;
    transition: var(--transition-standard);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.1);
}

.industrial-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.2);
    background: #FFEA00;
}

.industrial-btn:active {
    transform: translateY(1px);
}

.industrial-btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--border-industrial);
    font-weight: 900;
    text-transform: uppercase;
    padding: 0.75rem 1.5rem;
    transition: var(--transition-standard);
    cursor: pointer;
}

.industrial-btn-secondary:hover {
    border-color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #000;
}

::-webkit-scrollbar-thumb {
    background: var(--border-industrial);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-bright);
}

/* Utility Animations */
@keyframes pulse-soft {

    0%,
    100% {
        opacity: 0.8;
    }

    50% {
        opacity: 0.4;
    }
}

.animate-pulse-soft {
    animation: pulse-soft 2s infinite;
}

/* Gradients and Overlays */
.gradient-overlay {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.8) 100%);
}

.glow-yellow {
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.2));
}

/* Mobile Top Nav Trigger */
.mobile-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: var(--bg-panel);
    border-bottom: 2px solid var(--border-industrial);
    position: sticky;
    top: 0;
    z-index: 500;
}

@media (min-width: 1024px) {
    .mobile-top-bar {
        display: none;
    }
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 900;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}

/* Responsive Grid Fixes */
@media (max-width: 640px) {
    .px-8 {
        padding-left: 1.25rem !important;
        padding-right: 1.25rem !important;
    }

    .py-10 {
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
    }

    .text-6xl {
        font-size: 2.75rem !important;
    }

    .text-8xl {
        font-size: 3.5rem !important;
    }
}