/* --- CORE VARIABLES --- */
:root {
    /* KEYBOARD ACCESSIBILITY */
    --focus-ring: 2px solid var(--plasma);
    --focus-offset: 4px;

    --accent: #3498db;
    --plasma: #00e5ff;
    --bg: #0b1116;
    --card-bg: rgba(255, 255, 255, 0.05);
    --text: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.88);
    /* Increased from 0.7 for A11Y Contrast */
    --nav: rgba(11, 17, 22, 0.85);
    --row-hover: rgba(0, 229, 255, 0.08);
    --border: rgba(255, 255, 255, 0.12);
    --tab-inactive: rgba(255, 255, 255, 0.07);
    --track-bg: rgba(255, 255, 255, 0.1);
    --on-plasma: #060A0D;

    /* SHARED HUD VARIABLES (Match JS) */
    --hud-bg: rgba(10, 15, 20, 0.95);
}



/* REDUCED MOTION (A11Y) */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* --- ACCESSIBILITY: CUSTOM FOCUS --- */
*:focus-visible {
    outline: 2px solid var(--plasma);
    outline-offset: 4px;
    border-radius: 2px;
}

/* Remove default focus for mouse users */
*:focus:not(:focus-visible) {
    outline: none;
}

/* --- SPACING VARIABLES --- */
:root {
    --spacing-mobile-overlay-bottom: 80px;
    --spacing-mobile-card-bottom: 60px;
    --spacing-project-top: 75px;
}


[data-theme="light"] {
    --bg: #f1f5f9;
    --card-bg: rgba(255, 255, 255, 0.85);
    --text: #000000;
    --text-main: #000000;
    --text-muted: #333333;
    --nav: rgba(255, 255, 255, 0.98);
    --plasma: #1e40af;
    --row-hover: rgba(30, 64, 175, 0.05);
    --border: rgba(0, 0, 0, 0.15);
    --tab-inactive: rgba(0, 0, 0, 0.04);
    --track-bg: rgba(0, 0, 0, 0.06);
    --on-plasma: #ffffff;
    --hud-bg: rgba(245, 245, 250, 0.95);
}

/* --- KEYBOARD ACCESSIBILITY: FOCUS INDICATORS --- */
/* Remove default outline to use custom focus styles */
*:focus {
    outline: none;
}

/* Modern focus-visible (only shows on keyboard navigation, not mouse clicks) */
*:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-offset);
    border-radius: 4px;
}

/* Specific focus styles for interactive elements */
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid var(--plasma);
    outline-offset: 2px;
}

/* Focus for cards and clickable containers */
.chaos-img:focus-visible,
.project-card:focus-visible,
.tab-btn:focus-visible,
.docs-tab:focus-visible {
    outline: 3px solid var(--plasma);
    outline-offset: 4px;
    box-shadow: 0 0 0 4px rgba(0, 229, 255, 0.2);
}

/* Skip link (will be added to header.php) */
.skip-link {
    position: absolute;
    top: -100px;
    left: 20px;
    background: var(--plasma);
    color: var(--on-plasma);
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    z-index: 100000;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 20px;
    outline: 3px solid var(--text);
    outline-offset: 2px;
}


/* --- SKELETON LOADERS --- */
.main {
    padding-top: 75px;
}

.skeleton-loader {
    padding: 40px;
    min-height: 400px;
    max-width: 800px;
    margin: 0 auto;
    animation: fadeIn 0.3s ease;
}

.skeleton-header {
    height: 32px;
    width: 60%;
    margin: 0 auto 20px;
    background: linear-gradient(90deg,
            var(--card-bg) 0%,
            rgba(255, 255, 255, 0.1) 50%,
            var(--card-bg) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

.skeleton-badges {
    height: 24px;
    width: 40%;
    margin: 0 auto 30px;
    background: linear-gradient(90deg,
            var(--card-bg) 0%,
            rgba(255, 255, 255, 0.1) 50%,
            var(--card-bg) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite 0.2s;
    border-radius: 12px;
}

.skeleton-text {
    height: 16px;
    width: 100%;
    margin-bottom: 12px;
    background: linear-gradient(90deg,
            var(--card-bg) 0%,
            rgba(255, 255, 255, 0.1) 50%,
            var(--card-bg) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite 0.4s;
    border-radius: 4px;
}

.skeleton-text.short {
    width: 70%;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* --- ENHANCED CARD ANIMATIONS --- */
.project-card {
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 12px 40px rgba(0, 229, 255, 0.15);
}

.script-item {
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.script-item:hover {
    transform: translateX(4px);
    box-shadow: -4px 0 0 var(--plasma);
}

.script-item.loading {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 0.8;
    }
}

/* Accessibility: Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {

    .skeleton-header,
    .skeleton-badges,
    .skeleton-text {
        animation: none !important;
        background: var(--card-bg) !important;
    }

    .project-card:hover,
    .script-item:hover {
        transform: none !important;
    }

    .script-item.loading {
        animation: none !important;
    }
}


/* --- UNIFIED DOCS STYLING --- */
.project-docs-container {
    padding: 20px;
    color: var(--text);
}

.project-docs-container .header-section {
    border-bottom: 1px solid var(--border);
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.project-docs-container h1 {
    font-size: 2.2rem;
    color: var(--text);
    margin: 0;
}

.project-docs-container .status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    background: rgba(0, 229, 255, 0.1);
    color: var(--plasma);
    border: 1px solid var(--plasma);
    margin: 10px 0;
    text-align: center;
}

/* This ensures the HTML from chaos.html looks the same everywhere */
.project-content h2 {
    font-size: 1.5rem;
    color: var(--plasma);
    border-left: 4px solid var(--plasma);
    padding-left: 15px;
    margin-top: 30px;
}

/* ACCESSIBILITY FOCUS RING */
:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-offset);
    border-radius: 4px;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    width: 100%;
}

body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100%;
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Segoe UI', system-ui, sans-serif;
    overflow-x: hidden;
}

/* BACKGROUND CANVAS */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease-in;
    object-fit: cover;
}

#bg-canvas.loaded {
    opacity: 1;
}

#home {
    padding-top: 75px;
    /* Default Desktop Spacing */
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Force children to center */
#home .home-intro,
#home h1,
#home h2,
#home p,
#home .glass-card {
    text-align: center;
    width: 100%;
    /* Default Full Width (constrained by section max-width) */
    max-width: 850px !important;
    /* Explicitly match section width */
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
    /* Ensure padding doesn't expand width */
}

#home p {
    text-align: center;
    margin-bottom: 0px !important;
    /* Reduced space below Legacy text */
}

/* --- MOBILE OVERRIDES (max-width: 768px) --- */
@media (max-width: 768px) {
    #home {
        padding-top: 20px !important;
    }

    /* Force children to center on mobile explicitly */
    #home h1,
    #home h2,
    #home p,
    #home .glass-card {
        text-align: center !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        box-sizing: border-box;
    }

    #home .glass-card {
        padding: 20px 10px !important;
        /* Ensure generic padding but allow text to fill */
    }

    #home .glass-card {
        max-width: 100% !important;
        /* Allow it to fill the margin-constrained space */
    }
}

#hud-wrapper {
    position: fixed;
    z-index: 10000;
    bottom: 55px;
    right: 20px;
    width: 390px;
    display: flex;
    flex-direction: column;
    pointer-events: none;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    border-radius: 8px;
    backdrop-filter: blur(12px);
    color: var(--hud-text);
    background: var(--hud-bg);
    border: 1px solid var(--border);
    box-sizing: border-box;
}

#hud-wrapper.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.hud-header:hover {
    filter: brightness(1.2);
}

.hud-container {
    max-height: 70vh;
    overflow-y: auto;
    border-radius: 0 0 8px 8px;
    scrollbar-width: thin;
    scrollbar-color: #444 #111;
}

.hud-grid {
    display: grid;
    grid-template-columns: 110px 1fr 45px;
    gap: 6px 10px;
    align-items: center;
    padding: 15px;
}

.hud-group {
    grid-column: 1 / -1;
    font-size: 12px;
    font-weight: 800;
    color: var(--label-color);
    opacity: 0.8;
    border-bottom: 1px solid var(--border);
    margin-top: 15px;
    padding-bottom: 4px;
    text-transform: uppercase;
}

.hud-group.first {
    margin-top: 0;
}

.hud-grid label {
    font-size: 13px;
    color: var(--label-color);
    text-align: left;
    white-space: nowrap;
    font-weight: 600;
}

.hud-grid span {
    font-family: monospace;
    font-size: 12px;
    color: var(--plasma);
    text-align: right;
}

/* Control the height of the Options List */
.hud-grid {
    /* 1. Set the maximum height you want */
    max-height: 600px;

    /* 2. Enable scrolling if the list is longer than the height */
    overflow-y: auto;

    /* Optional: Add padding so scrollbar doesn't overlap text */
    padding-right: 5px;
}

.hud-select {
    width: 100%;
    background: var(--btn-bg);
    color: var(--hud-text);
    border: 1px solid var(--track-bg);
    padding: 6px;
    border-radius: 4px;
    font-size: 13px;
}

.btn-row {
    grid-column: 1 / -1;
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.chaos-btn {
    flex: 1;
    padding: 12px;
    background: var(--btn-bg);
    color: var(--hud-text);
    border: 1px solid var(--track-bg);
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    transition: all 0.2s;
    text-align: center;
    user-select: none;
}

.chaos-btn:hover {
    background: var(--btn-hover);
    border-color: var(--label-color);
}

.chaos-btn.active {
    background: rgba(0, 100, 255, 0.3);
    border-color: #0088ff;
    color: #00ffff;
}

/* --- CUSTOM SLIDERS --- */
input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    background: transparent;
    margin: 0;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 14px;
    width: 14px;
    border-radius: 50%;
    background: var(--plasma);
    margin-top: -5px;
    cursor: pointer;
    box-shadow: 0 0 6px var(--plasma);
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    background: var(--track-bg);
    border-radius: 2px;
}

input[type=range]::-moz-range-thumb {
    height: 14px;
    width: 14px;
    border: none;
    border-radius: 50%;
    background: var(--plasma);
    cursor: pointer;
    box-shadow: 0 0 6px var(--plasma);
}

input[type=range]::-moz-range-track {
    width: 100%;
    height: 4px;
    background: var(--track-bg);
    border-radius: 2px;
}

/* --- TOGGLE SWITCHES --- */
.debug-grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
}

.debug-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.1);
    padding: 6px 8px;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.debug-item span {
    font-size: 13px;
    color: var(--label-color);
    font-weight: 600;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 18px;
    vertical-align: middle;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--track-bg);
    border-radius: 18px;
    transition: .3s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: .3s;
}

input:checked+.slider {
    background-color: var(--plasma);
}

input:checked+.slider:before {
    transform: translateX(16px);
}

/* --- FPS STATS BOX --- */
#chaos-stats {
    position: fixed;
    z-index: 100001;
    font-family: 'Consolas', monospace;
    font-weight: bold;
    background: var(--hud-bg);
    color: var(--plasma);
    padding: 12px 15px;
    /* Slightly more padding for the wider look */
    display: none;
    cursor: pointer;
    user-select: none;
    box-shadow: -2px 2px 15px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    box-sizing: border-box;

    /* Desktop Position & Fixed Width */
    top: 52px !important;
    /* Adjusted to clear nav bar */
    right: 21px;
    width: 358px !important;
    /* Increased width, forced override */
    text-align: left;
    border-radius: 8px;
    border-left: 3px solid var(--plasma);
    transition: width 0.3s ease;
}

/* Ensure the internal graph also fills the new width */
#stats-hist {
    display: block;
    background: var(--stats-graph-bg);
    margin-bottom: 8px;
    width: 100% !important;
    height: 40px;
    /* Explicit height for better visibility */
    border-radius: 4px;
}

.stats-row-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}

#stats-fps {
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 1px;
}

#stats-details {
    font-size: 13px;
    font-weight: bold;
    color: var(--label-color);
}

#stats-details span {
    color: var(--stats-val-norm);
}

#stats-details .sep {
    color: var(--stats-sep);
    margin: 0 4px;
}

#stats-hist {
    display: block;
    background: var(--stats-graph-bg);
    margin-bottom: 6px;
    width: 100%;
    border-radius: 2px;
}

#stats-diag {
    font-size: 12px;
    color: var(--label-color);
    border-top: 1px solid var(--border);
    padding-top: 6px;
    line-height: 1.6;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 15px;
}

.val-norm {
    color: var(--stats-val-norm);
}

.val-accent1 {
    color: var(--stats-val-1);
}

.val-accent2 {
    color: var(--stats-val-2);
}

/* --- FLOATING ACTION BUTTONS (Shared Styles) --- */
.settings-btn,
#docs-toggle {
    position: fixed;
    bottom: 20px;
    width: 28px;
    height: 28px;
    background: var(--hud-bg);
    border: 2px solid var(--accent);
    border-radius: 50%;
    color: var(--accent);
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    cursor: pointer;
    z-index: 10001;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    user-select: none;
    font-weight: bold;
    font-family: 'Consolas', monospace;
    padding: 0;
    margin: 0;
    box-sizing: content-box;
}

/* Specific Positioning */
#docs-toggle {
    left: 20px;
    bottom: 20px;
}

.settings-btn {
    right: 20px;
    left: auto;
}

/* Hover Effects */
.settings-btn:hover,
#docs-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px var(--accent);
    background: rgba(0, 229, 255, 0.1);
}

.settings-btn:hover {
    transform: rotate(90deg) scale(1.1);
}


.pulse-anim {
    animation: chaos-pulse 0.6s ease-in-out 3;
}

@keyframes chaos-pulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 10px var(--plasma);
    }

    50% {
        transform: scale(1.3);
        box-shadow: 0 0 25px var(--plasma);
    }
}

/* --- TOOLTIP --- */
.chaos-tooltip {
    position: fixed;
    background: var(--hud-bg);
    color: var(--plasma);
    border: 1px solid var(--plasma);
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 11px;
    pointer-events: none;
    z-index: 999999;
    display: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    max-width: 200px;
}

/* --- MOBILE OVERRIDES (UI SPECIFIC) --- */
@media (max-width: 768px) {

    /* Menu Position */
    #hud-wrapper {
        width: 96vw;
        max-width: 420px;
        left: 50%;
        right: auto;
        bottom: 15px;
        transform: translateX(-50%) translateY(110%);
        border-radius: 12px 12px 0 0;
    }

    #hud-wrapper.visible {
        transform: translateX(-50%) translateY(0);
    }

    .hud-container {
        max-height: 42vh;
    }

    .hud-grid {
        padding: 10px;
        gap: 8px 5px;
    }

    /* Fonts & Spacing */
    .hud-group {
        font-size: 10px;
        margin-top: 10px;
    }

    .hud-grid label {
        font-size: 11px;
    }

    .hud-grid span {
        font-size: 10px;
    }

    .hud-select {
        font-size: 11px;
    }

    .debug-item span {
        font-size: 11px;
    }

    .chaos-btn {
        font-size: 11px;
        padding: 10px;
    }

    .hud-header {
        padding: 20px;
        font-size: 16px;
    }

    /* Shared Mobile Styles for Floating Buttons */
    .settings-btn,
    #docs-toggle {
        width: 30px !important;
        height: 30px !important;
        font-size: 20px !important;
        bottom: 39px !important;
    }

    /* Specific positioning */
    .settings-btn {
        right: 20px !important;
        left: auto !important;
    }

    #docs-toggle {
        left: 20px !important;
        bottom: 39px !important;
    }

    input[type=range] {
        height: 30px;
    }

    input[type=range]::-webkit-slider-thumb {
        width: 22px;
        height: 22px;
        margin-top: -9px;
    }

    /* Stats Box Mobile */
    #chaos-stats {
        top: 50px;
        left: 0;
        right: 0;
        bottom: auto;
        width: 100%;
        max-width: 100%;
        border-left: none;
        border-right: none;
        border-radius: 0;
        padding: 8px 15px;
    }


    /* Hide Diagnostics on Mobile */
    #stats-diag {
        display: none !important;
    }

    /* Show Graph on Mobile */
    #stats-hist,
    #stats-details {
        display: block !important;
    }
}

/* NAVIGATION */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: var(--nav);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

nav a {
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 5px 8px;
    transition: color 0.3s;
}

nav a:hover {
    color: var(--plasma);
}

.theme-btn {
    border: 1px solid var(--plasma);
    background: transparent;
    color: var(--text);
    padding: 4px 12px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.3s ease;
    margin-left: 5px;
}

/* HAMBURGER MENU (Mobile Only) */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1002;
}

.hamburger span {
    width: 22px;
    height: 2px;
    background: var(--text);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

@media (max-width: 600px) {
    .hamburger {
        display: flex;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--nav);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 20px;
        gap: 15px;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        border-bottom: 1px solid var(--border);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        text-align: center;
        /* Center the menu items */
    }

    .nav-links.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-links a {
        padding: 12px 0;
        border-bottom: 1px solid var(--border);
        display: block;
        text-align: center;
    }

    .nav-links a:last-child {
        border-bottom: none;
    }
}

.theme-btn:hover {
    background: var(--plasma);
    color: var(--on-plasma);
    font-weight: bold;
}

/* MAIN LAYOUT */
main {
    position: relative;
    z-index: 10;
    width: 100%;
    padding-top: 0;
}

section {
    padding: 35px 20px;
    max-width: 850px;
    margin: 0 auto;
}

.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 35px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

/* TYPOGRAPHY */
h1 {
    font-size: 2.2rem;
    margin-bottom: 10px;
    line-height: 1.2;
    color: var(--text);
}

h1 span {
    display: block;
    font-size: 1.1rem;
    opacity: 0.8;
    font-weight: 400;
    color: var(--plasma);
    margin-top: 5px;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    border-left: 4px solid var(--plasma);
    padding-left: 15px;
    color: var(--text);
}

h3 {
    font-size: 1.1rem;
    margin-top: 20px;
    color: var(--plasma);
    margin-bottom: 10px;
}

p {
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 15px;
}

/* TABS */
.tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    padding: 10px 10px 15px 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-btn {
    background: var(--tab-inactive);
    border: none;
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
    color: var(--text);
    /* A11Y Fix: Ensure tabs use high contrast text */
}

.tab-btn:hover {
    background: var(--row-hover);
    color: var(--text);
}

.tab-btn.active {
    background: var(--plasma);
    color: var(--on-plasma);
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* BUTTONS */
a[style*="background: var(--plasma)"] {
    background: var(--plasma) !important;
    color: var(--on-plasma) !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    border-radius: 8px;
    transition: filter 0.2s, transform 0.2s, box-shadow 0.2s;
    display: inline-block;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

a[style*="background: var(--plasma)"]:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

/* TABLES */
.table-container {
    margin-top: 10px;
    overflow-x: auto;
}

.career-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    min-width: 600px;
}

.career-table th {
    text-align: left;
    padding: 12px;
    border-bottom: 2px solid var(--plasma);
    color: var(--plasma);
    font-weight: 600;
}

.career-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    vertical-align: top;
}

.career-table tr:hover td {
    background: var(--row-hover);
    color: var(--text);
}

.career-table a {
    color: var(--plasma);
    text-decoration: none;
    border-bottom: 1px dotted var(--plasma);
    transition: opacity 0.2s;
}

.career-table a:hover {
    opacity: 0.8;
    border-bottom: 1px solid var(--plasma);
}

/* TABLE COLUMN ALIGNMENT */
.col-year {
    width: 15%;
}

.col-role {
    width: 25%;
}

.col-loc {
    width: 20%;
}

.col-35 {
    width: 35%;
}

/* UTILITIES */
.clean-link {
    color: inherit;
    text-decoration: none !important;
}

.clean-link:hover {
    text-decoration: none !important;
}

.text-plasma {
    color: var(--plasma);
}

.text-main {
    color: var(--text);
}

.italic {
    font-style: italic;
}

.text-error {
    color: #ff4444;
}

.text-center {
    text-align: center;
}

.btn-plasma {
    padding: 12px 30px;
    background: var(--plasma);
    color: var(--on-plasma);
    text-decoration: none;
    border-radius: 30px;
    display: inline-block;
    font-weight: 700;
}

/* SKILLS */
.skill-pct {
    font-size: 0.8rem;
    opacity: 0.8;
    font-weight: 700;
    color: var(--plasma);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.skill-item {
    background: rgba(0, 0, 0, 0.1);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.skill-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

.skill-bar-bg {
    width: 100%;
    height: 8px;
    background: var(--track-bg);
    border-radius: 4px;
    overflow: hidden;
}

.skill-bar-fill {
    height: 100%;
    background: var(--plasma);
    width: 0;
    transition: width 1s ease-out;
    border-radius: 4px;
}

[data-theme="dark"] .skill-bar-fill {
    box-shadow: 0 0 12px var(--plasma);
}

/* DOWNLOADS */
.category-header {
    margin-top: 30px;
    margin-bottom: 10px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    padding-bottom: 5px;
}

.script-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.script-item {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s ease;
}

.script-item:last-child {
    border-bottom: none;
}

.script-item:hover {
    background: var(--row-hover);
    border-radius: 8px;
    padding-left: 10px;
    padding-right: 10px;
}

@media (min-width: 769px) {
    .script-item:hover {
        margin: 0 -10px;
    }
}

.file-info {
    display: flex;
    flex-direction: column;
}

.file-link {
    color: var(--plasma);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    word-break: break-all;
    line-height: 1.3;
}

.file-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 3px;
}

.dl-badge {
    background: rgba(128, 128, 128, 0.1);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* GALLERY & LIGHTBOX */
.gallery-grid {
    column-count: 3;
    column-gap: 15px;
    margin-top: 15px;
}

.gallery-item {
    display: inline-block;
    width: 100%;
    margin-bottom: 15px;
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
    cursor: zoom-in;
    background: rgba(0, 0, 0, 0.1);
}

.gallery-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.gallery-item::after {
    content: "©Felix Bourier";
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 0.6rem;
    color: #fff;
    background: rgba(0, 0, 0, 0.6);
    padding: 2px 8px;
    border-radius: 10px;
    pointer-events: none;
    opacity: 0.8;
    transition: opacity 0.3s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.gallery-img {
    width: 100%;
    height: auto;
    display: block;
}

.gallery-desc {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 0.75rem;
    padding: 8px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.gallery-item:hover .gallery-desc {
    opacity: 1;
}

#lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#lightbox.open {
    display: flex;
    opacity: 1;
}

/* Main Visual Image */
.slide-visual img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    transition: transform 0.3s ease;
}

.slide-visual img:hover {
    transform: scale(1.02);
}

#lightbox img {
    max-width: 90%;
    max-height: 80vh;
    border-radius: 4px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#lightbox.open img {
    transform: scale(1);
}

#lightbox p {
    color: #fff;
    margin-top: 15px;
    font-size: 1.1rem;
    text-align: center;
    max-width: 80%;
    background: rgba(0, 0, 0, 0.6);
    /* Added bg for better contrast */
    padding: 10px;
    border-radius: 4px;
}

.lb-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 2.5rem;
    cursor: pointer;
    user-select: none;
}

/* FOOTER SPACER */
.footer-spacer {
    height: 100vh !important;
    width: 100%;
    pointer-events: none;
}

footer {
    text-align: center;
    padding: 50px 20px;
    padding-top: 6px;
    padding-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.85rem;
    position: relative;
    z-index: 100;
    border-top: 1px solid var(--border);
    margin-top: 100vh;
    background: var(--bg);
}

/* --- HARMONIZED DOCUMENTATION OVERLAY --- */
:root {
    --ov-accent: var(--plasma);
    --ov-bg: var(--nav);
    --ov-card: var(--card-bg);
    --ov-border: var(--border);
    --ov-text: var(--text);
    --ov-text-dim: var(--text-muted);
    /* Default Dark Mode Backdrop */
    --ov-backdrop: rgba(0, 0, 0, 0.85);
}

/* Light Mode Override for Backdrop */
[data-theme="light"] {
    --ov-backdrop: rgba(255, 255, 255, 0.85);
}

/* Light mode overlay variables are defined with main theme above (line 36-48) */
/* Overlay variables inherit from theme: --ov-accent uses --plasma, etc. */

/* Base IDs for both overlays (index and about) */
#chaos-docs,
#doc-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--ov-backdrop);
    /* Theme-aware background */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 10001;
    display: flex;
    justify-content: center;
    /* Horizontally Center */
    overflow-y: auto;
    transition: opacity 0.3s ease;
}

#chaos-docs.hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

/* Override the docs-content padding when it contains docs-body */
#chaos-docs .docs-content {
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: none !important;
    /* Let child control width */
    overflow: visible !important;
    justify-content: flex-start !important;
    /* Align left */
    padding: 60px 20px !important;
    /* 60px from top */
}

#chaos-docs .overlay-footer-copyright {
    margin-top: 50px !important;
    padding-top: 20px !important;
    border-top: 1px solid var(--border) !important;
    /* Use regular theme variable */
    color: var(--text-muted) !important;
    /* Use regular theme variable */
    font-size: 0.75rem !important;
    text-align: center !important;
    letter-spacing: 0.5px !important;
    line-height: 1.5 !important;
    opacity: 0.8 !important;
}

#chaos-docs .overlay-footer-copyright p {
    margin: 0 !important;
    color: var(--text-muted) !important;
}


#chaos-docs #docs-body {
    background: var(--card-bg) !important;
    border: 2px solid var(--border) !important;
    border-radius: 20px !important;
    padding: 50px !important;
    /* MATCH */
    width: 100% !important;
    /* MATCH */
    max-width: 900px !important;
    /* MATCH */
    backdrop-filter: blur(15px) !important;
    -webkit-backdrop-filter: blur(15px) !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5) !important;
    color: var(--text) !important;
    margin: 0 auto !important;
    /* Center it */
    overflow-x: hidden !important;
    /* Prevent horizontal scroll */
    box-sizing: border-box !important;
}

/* Ensure the overlay container handles scrolling */
#chaos-docs {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    display: flex !important;
    align-items: flex-start !important;
    justify-content: center !important;
    padding: 60px 20px !important;
    /* Top/bottom spacing */
    scrollbar-color: var(--ov-accent, var(--plasma)) var(--ov-card, var(--bg));
}

#chaos-docs .docs-nav {
    margin-bottom: 0 !important;
}

#chaos-docs .docs-section {
    padding-top: 15px !important;
    /* Consistent spacing */
}

/* Content containers */
.docs-content,
.overlay-inner-container {
    position: relative;
    width: 100%;
    max-width: 900px;
    padding: 80px 40px;
}

/* The actual card inside */
#docs-body,
.overlay-glass-card {
    background: var(--ov-card);
    border: 2px solid var(--ov-border);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    color: var(--ov-text);
    will-change: backdrop-filter;
}

/* Remove will-change after transition for performance */
.overlay-glass-card:not(:hover) {
    will-change: auto;
}

/* 2. Center the Status Badge */
.status-badge {
    display: block !important;
    width: fit-content !important;
    margin: 0 auto 20px auto !important;
    /* Centers it horizontally */
    text-align: center;
}

/* 3. Center the Tech Badges / Stack Container */
.tech-stack-container,
.tech-badge-container {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 10px;
    width: 100% !important;
    margin: 20px auto !important;
}

/* 4. Ensure individual Tech Badges center themselves */
.tech-badge {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 5px !important;
    /* Prevents badges from sticking to edges */
}

/* THEME-AWARE TEXT LOGIC */
#docs-body h1,
#doc-render-target h1 {
    font-size: 2.5rem;
    margin: 0 0 10px 0;
    color: var(--ov-text);
}

#docs-body h2,
#doc-render-target h2 {
    color: var(--ov-accent) !important;
    margin-top: 30px;
    border-left: 4px solid var(--ov-accent);
    padding-left: 15px;
}

#docs-body h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: var(--ov-text);
    text-align: center;
}

/* Normal Text Color for Documentation H3 */
#docs-body h3 {
    color: var(--ov-text) !important;
    margin-top: 20px;
    border: none;
}

/* Overlay Title (for documentation headers) */
.overlay-title {
    font-size: 2.5rem;
    margin: 0 0 10px 0;
    color: var(--ov-text);
    text-align: center;
    font-family: var(--font-stack);
    font-weight: 700;
    display: block;
}

/* Project Description Text */
.project-desc-text {
    color: var(--ov-text-dim) !important;
    line-height: 1.6;
    font-size: 1.1rem;
    margin-bottom: 30px;
    font-weight: 300;
    text-align: center;
}

/* Documentation Body Content */
.doc-body-content .param>strong,
.doc-body-content .parameter-item>strong {
    color: var(--ov-accent) !important;
    display: block;
    margin-bottom: 8px;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    font-weight: 800;
}

#docs-body p,
#docs-body li,
#doc-render-target p,
#doc-render-target li {
    color: var(--ov-text-dim) !important;
    line-height: 1.6;
}

/* Centering Stack Icons and Badge */
.tech-stack-container {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 12px !important;
    margin: 20px auto !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* Targeting common tag/icon classes from JSON renderers */
.tech-stack-container>* {
    display: inline-flex !important;
    margin: 0 !important;
    /* Removes potential left-side offset */
}

/* Ensure individual tags/icons behave as flex items */
.tech-stack-container span,
.tech-stack-container div,
.tech-stack-container .tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Nested Logic for Project HTML */
.doc-body-content .param>strong,
.doc-body-content .parameter-item>strong {
    color: var(--ov-accent) !important;
    display: block;
    margin-bottom: 8px;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    font-weight: 800;
}

#docs-body p,
#docs-body li,
.project-desc-text {
    color: var(--ov-text-dim) !important;
    line-height: 1.6;
}

/* Optional: Centering the Status Badge above the content */
.status-badge {
    display: block;
    width: fit-content;
    margin: 0 auto 20px auto;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--tab-inactive);
    color: var(--ov-accent) !important;
    border: 1px solid var(--ov-accent) !important;
    text-transform: uppercase;
    text-align: center;
}

.tech-badge,
.tag {
    background: var(--tab-inactive);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--ov-text-dim) !important;
    border: 1px solid var(--ov-border);
    margin-right: 8px;
    margin-bottom: 8px;
    display: inline-block;
    font-weight: 600;
}

/* Close Buttons */
#docs-close,
.close-overlay-btn {
    position: fixed;
    top: 30px;
    right: 40px;
    font-size: 45px;
    color: #fff;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 10002;
    transition: color 0.3s;
}

#docs-close:hover,
.close-overlay-btn:hover {
    color: var(--ov-accent);
}

.param-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 15px;
    margin-top: 25px;
}

.param {
    background: rgba(255, 255, 255, 0.03);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--ov-border);
}

/* --- GLOBAL CARD STYLE (Ensures Centering) --- */
#docs-body,
.overlay-glass-card {
    background: var(--ov-card);
    border: 1px solid var(--ov-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 60px 40px;
    width: 95%;
    max-width: 900px;
    margin: 40px auto;
    /* CENTERS HORIZONTALLY */
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow-wrap: break-word;
}

/* --- STANDARD DOCUMENTATION UI COMPONENTS --- */
.docs-nav {
    display: flex;
    border-bottom: 2px solid var(--border);
    margin-bottom: 0;
    flex-wrap: wrap;
    justify-content: center;
    padding-bottom: 0;
}

.docs-tab {
    padding: 10px 15px;
    cursor: pointer;
    color: var(--text-muted);
    font-weight: bold;
    font-size: 14px;
    transition: 0.2s;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    margin-bottom: -2px;
}

.docs-tab:hover {
    color: var(--text);
}

.docs-tab.active {
    color: var(--plasma);
    border-color: var(--plasma);
}

.docs-section {
    display: none;
    animation: fadeIn 0.3s;
    padding-top: 15px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.docs-section.active {
    display: block;
}

.feature-list {
    list-style: none;
    padding: 0;
}

.feature-list li {
    padding-left: 20px;
    position: relative;
    margin-bottom: 8px;
    color: var(--text-muted);
}

.feature-list li::before {
    content: "▸";
    position: absolute;
    left: 0;
    color: var(--plasma);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 800px) {

    /* Fix mobile overlay centering & scrolling */
    #chaos-docs {
        align-items: flex-start !important;
        /* Allow top-down scrolling */
        padding: 40px 0 var(--spacing-mobile-overlay-bottom) 0 !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .docs-content,
    .overlay-inner-container {
        padding: 20px 10px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    #chaos-docs .docs-content {
        padding: 20px 10px !important;
    }

    /* Glass card: Center horizontally with margins */
    #docs-body,
    #chaos-docs #docs-body,
    .overlay-glass-card {
        box-sizing: border-box !important;
        padding: 25px 20px !important;
        margin: 20px auto var(--spacing-mobile-card-bottom) auto !important;
        /* Top margin + Bottom margin + Auto Horizontal */
        width: calc(100% - 30px) !important;
        /* Not 100% - allows seeing the centering */
        max-width: 600px !important;
        position: relative;
        left: 0;
        right: 0;
    }

    #docs-close,
    .close-overlay-btn {
        top: 15px;
        right: 20px;
        font-size: 35px;
    }

    footer {
        text-align: center;
        padding: 50px 20px;
        padding-top: 8px;
        padding-bottom: 144px;
        color: var(--text-muted);
        font-size: 0.75rem;
        position: relative;
        z-index: 100;
        border-top: 1px solid var(--border);
        background: var(--bg);
        margin-top: 100vh;
    }
}



/* --- OVERLAY FOOTER COPYRIGHT (UNIFIED) --- */
.doc-copyright {
    margin-top: 50px;
    padding-top: 20px;
    border-top: 1px solid var(--ov-border);
    text-align: center;
    font-size: 0.7rem;
    color: var(--ov-text-dim);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    opacity: 0.8;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block !important;
}

/* Ensure it stacks nicely on mobile */
@media (max-width: 600px) {
    .doc-copyright {
        font-size: 0.6rem;
        margin-top: 30px;
    }
}

/* RESPONSIVE DESIGN */
@media (max-width: 768px) {
    nav {
        padding: 8px 0;
        gap: 8px;
        justify-content: center;
    }

    nav a {
        font-size: 0.75rem;
        padding: 4px 6px;
    }

    section {
        padding: 30px 10px;
    }

    .glass-card {
        padding: 15px;
    }

    h1 {
        font-size: 1.6rem;
    }

    h1 span {
        font-size: 0.85rem;
    }

    .tabs {
        flex-wrap: wrap;
        overflow-x: visible;
        justify-content: center;
        gap: 10px;
    }

    .tab-btn {
        flex-grow: 1;
        text-align: center;
        font-size: 0.8rem;
        padding: 8px 10px;
    }

    .career-table,
    .career-table tbody,
    .career-table tr,
    .career-table td {
        display: block;
        width: 100%;
        box-sizing: border-box;
        min-width: 0;
    }

    .career-table thead {
        display: none;
    }

    .career-table tr {
        margin-bottom: 20px;
        border: 1px solid var(--border);
        border-radius: 12px;
        background: transparent;
        padding: 15px;
    }

    .career-table td:nth-child(2) {
        font-size: 1rem;
        font-weight: bold;
        color: var(--text);
        padding: 0 0 5px 0;
        border: none;
    }

    .career-table td:nth-child(1),
    .career-table td:nth-child(3) {
        display: inline-block;
        width: auto;
        font-size: 0.75rem;
        color: var(--plasma);
        padding: 0;
        border: none;
        margin-right: 10px;
        font-weight: 600;
        opacity: 0.9;
    }

    .career-table td:nth-child(1)::after {
        content: " • ";
        color: var(--text-muted);
        margin-left: 10px;
    }

    .career-table td:nth-child(4) {
        margin-top: 10px;
        padding: 10px 0 0 0;
        border-top: 1px solid var(--border);
        color: var(--text-muted);
        line-height: 1.4;
        font-size: 0.85rem;
    }

    .script-item {
        grid-template-columns: 1fr;
        align-items: flex-start;
        gap: 5px;
    }

    .dl-badge {
        margin-top: 5px;
        align-self: flex-start;
    }

    .gallery-grid {
        column-count: 2;
    }
}



/* CENTER TABS AND REMOVE ALL GAPS */
.docs-nav {
    justify-content: center !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

.docs-tab {
    margin-bottom: -2px !important;
}

.docs-content {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.docs-section {
    padding-top: 15px !important;
    margin-top: 0 !important;
}

/* Target the first heading in the section to remove its top margin */
.docs-section>h2:first-child,
.docs-section>h3:first-child,
.docs-section>p:first-child,
.docs-section>*:first-child {
    margin-top: 0 !important;
    padding-top: 15px !important;
}

/* Constrain all docs content to card width */
.docs-content,
.docs-section {
    max-width: 100% !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
}

/* Make tables responsive */
.docs-section table,
.param-table {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed !important;
    word-wrap: break-word !important;
}

.docs-section td,
.docs-section th {
    overflow-wrap: break-word !important;
    word-break: break-word !important;
}

/* Constrain grids */
.param-grid,
.docs-section .param-grid {
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* --- GLOBAL OVERLAY STATE MANAGEMENT --- */
body.overlay-mode {
    overflow: hidden !important;
    height: 100vh;
}

/* Hide elements when overlay is active */
body.overlay-mode footer,
body.overlay-mode nav,
body.overlay-mode #docs-toggle,
body.overlay-mode .settings-btn,
body.overlay-mode .theme-btn {
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Ensure the overlay itself remains visible */
body.overlay-mode #chaos-docs,
body.overlay-mode #doc-overlay {
    visibility: visible !important;
    pointer-events: auto !important;
}

/* Custom Scrollbar Styling - Matches Theme */

/* For Webkit browsers (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 12px;
    /* Width of vertical scrollbar */
    height: 12px;
    /* Height of horizontal scrollbar */
}

::-webkit-scrollbar-track {
    background: var(--bg);
    /* Use your theme background */
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--plasma);
    /* Use your accent color */
    border-radius: 10px;
    border: 2px solid var(--bg);
    /* Creates padding effect */
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text);
    /* Lighter on hover */
}

::-webkit-scrollbar-thumb:active {
    background: var(--plasma);
    /* Accent color when dragging */
}

/* For Firefox */
* {
    scrollbar-width: thin;
    /* 'auto' or 'thin' */
    scrollbar-color: var(--plasma) var(--bg);
    /* thumb color, track color */
}

/* Optional: Specific styling for overlay scrollbar */
#chaos-docs::-webkit-scrollbar-thumb {
    background: var(--ov-accent, var(--plasma));
    /* Use overlay accent if available */
}


/* Optional: Hide scrollbar on mobile but keep functionality */
@media (max-width: 768px) {
    ::-webkit-scrollbar {
        width: 6px;
        /* Thinner on mobile */
    }
}


/* Ensure all child elements respect container width */
.docs-section>* {
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Specific fix for code blocks and pre elements */
.docs-section pre,
.docs-section code,
.equation-block {
    max-width: 100% !important;
    overflow-x: auto !important;
    box-sizing: border-box !important;
}

/* Fix for lists */
.docs-section ul,
.docs-section ol {
    padding-right: 20px !important;
    box-sizing: border-box !important;
}

#chaos-docs.hidden {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
}

/* Remove any lingering backdrop effects */
body:not(:has(#chaos-docs:not(.hidden))) {
    backdrop-filter: none !important;
}

/* Ensure body overflow is reset */
body {
    overflow: auto !important;
}

/* Only lock overflow when overlay is open */
body:has(#chaos-docs:not(.hidden)) {
    overflow: hidden !important;
}

/* GALLERY SAVE BUTTON - NO FOCUS RING */
.chaos-grid-dl:focus,
.chaos-grid-dl:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

/* --- SKELETON LOADING UI --- */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.05) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
    border-radius: 4px;
    display: block;
}

[data-theme='light'] .skeleton {
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.05) 25%, rgba(0, 0, 0, 0.1) 50%, rgba(0, 0, 0, 0.05) 75%);
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
    width: 100%;
}

.skeleton-title {
    height: 2.5rem;
    width: 60%;
    margin: 0 auto 20px auto;
}

.skeleton-badge {
    height: 1.5rem;
    width: 30%;
    margin: 0 auto 30px auto;
}


/* --- COMMAND PALETTE (CMD+K) --- */
#cmd-palette {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 15vh;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    /* A11Y FIX */
    transition: opacity 0.2s ease, visibility 0.2s ease;
    font-family: "Inter", system-ui, sans-serif;
}

#cmd-palette.cmd-visible {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    /* A11Y FIX */
}

.cmd-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

.cmd-modal {
    position: relative;
    width: 600px;
    max-width: 90%;
    background: #1a1f24;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(-20px);
    transition: transform 0.2s ease;
}

#cmd-palette.cmd-visible .cmd-modal {
    transform: translateY(0);
}

.cmd-header {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    gap: 12px;
}

.cmd-icon {
    font-size: 1.2rem;
    filter: grayscale(1);
}

#cmd-input {
    flex-grow: 1;
    background: transparent;
    border: none;
    font-family: inherit;
    color: #fff;
    font-size: 1.1rem;
    outline: none;
    caret-color: #00e5ff;
}

.cmd-badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    color: #888;
    font-family: monospace;
}

.cmd-results {
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
}

.cmd-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    border-radius: 8px;
    cursor: pointer;
    color: #ccc;
    transition: all 0.1s;
    text-decoration: none;
    border-left: 3px solid transparent;
}

.cmd-item.active,
.cmd-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border-left-color: #00e5ff;
}

.cmd-item-type {
    font-size: 0.75rem;
    opacity: 0.5;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-left: auto;
}

.cmd-footer {
    padding: 8px 20px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.75rem;
    color: #666;
    display: flex;
    gap: 15px;
}

.cmd-footer strong {
    color: #888;
}

/* --- SEO UTILITY CLASSES --- */
.text-center {
    text-align: center !important;
}

.mb-20 {
    margin-bottom: 20px !important;
}

.mb-15 {
    margin-bottom: 15px !important;
}

.mb-12 {
    margin-bottom: 12px !important;
}

.mb-6 {
    margin-bottom: 6px !important;
}

.mb-5 {
    margin-bottom: 5px !important;
}

.mb-2 {
    margin-bottom: 2px !important;
}

.mt-10 {
    margin-top: 10px !important;
}

.mt-15 {
    margin-top: 15px !important;
}

.mt-30 {
    margin-top: 30px !important;
}

.mt-35 {
    margin-top: 35px !important;
}

.mt-40 {
    margin-top: 40px !important;
}

.mt-50 {
    margin-top: 50px !important;
}

.gap-8 {
    gap: 8px !important;
}

.gap-10 {
    gap: 10px !important;
}

.gap-15 {
    gap: 15px !important;
}

.opacity-50 {
    opacity: 0.5 !important;
}

.opacity-70 {
    opacity: 0.7 !important;
}

.opacity-80 {
    opacity: 0.8 !important;
}

.opacity-85 {
    opacity: 0.85 !important;
}

.fw-600 {
    font-weight: 600 !important;
}

.fw-700 {
    font-weight: 700 !important;
}

.fw-bold {
    font-weight: bold !important;
}

.fs-small {
    font-size: 0.75rem !important;
}

.fs-xsmall {
    font-size: 0.65rem !important;
}

.fs-medium {
    font-size: 0.8rem !important;
}

.fs-large {
    font-size: 1rem !important;
}

.fs-h1 {
    font-size: 1.4rem !important;
}

.fs-h2 {
    font-size: 1.2rem !important;
}

.fs-36 {
    font-size: 36px !important;
}

.lh-1-2 {
    line-height: 1.2 !important;
}

.lh-1-4 {
    line-height: 1.4 !important;
}

.lh-1-5 {
    line-height: 1.5 !important;
}

.d-flex {
    display: flex !important;
}

.inline-flex {
    display: inline-flex !important;
}

.items-center {
    align-items: center !important;
}

.items-baseline {
    align-items: baseline !important;
}

.justify-between {
    justify-content: space-between !important;
}

.flex-wrap {
    flex-wrap: wrap !important;
}

.white-nowrap {
    white-space: nowrap !important;
}

.w-full {
    width: 100% !important;
}

.border-none {
    border: none !important;
}

.br-8 {
    border-radius: 8px !important;
}

.br-30 {
    border-radius: 30px !important;
}

.p-20 {
    padding: 20px !important;
}

.pt-15 {
    padding-top: 15px !important;
}

.pt-50 {
    padding-top: 50px !important;
}

.text-main {
    color: var(--text-main) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.text-dim {
    color: var(--ov-text-dim) !important;
}

.text-accent {
    color: var(--ov-accent) !important;
}

.text-plasma {
    color: var(--plasma) !important;
}

.bg-glass {
    background: rgba(255, 255, 255, 0.05) !important;
}

.border-main {
    border: 1px solid var(--border) !important;
}

.border-top-main {
    border-top: 1px solid var(--ov-border) !important;
}

.border-top-dashed {
    border-top: 1px dashed var(--ov-border) !important;
}

.transition-all {
    transition: all 0.2s ease !important;
}

.mt-15 {
    margin-top: 15px !important;
}

.mt-30 {
    margin-top: 30px !important;
}

.mt-35 {
    margin-top: 35px !important;
}

.mt-40 {
    margin-top: 40px !important;
}

.mt-50 {
    margin-top: 50px !important;
}

.gap-8 {
    gap: 8px !important;
}

.gap-10 {
    gap: 10px !important;
}

.gap-15 {
    gap: 15px !important;
}

.opacity-50 {
    opacity: 0.5 !important;
}

.opacity-70 {
    opacity: 0.7 !important;
}

.opacity-80 {
    opacity: 0.8 !important;
}

.opacity-85 {
    opacity: 0.85 !important;
}

.fw-600 {
    font-weight: 600 !important;
}

.fw-700 {
    font-weight: 700 !important;
}

.fw-bold {
    font-weight: bold !important;
}

.fs-small {
    font-size: 0.75rem !important;
}

.fs-xsmall {
    font-size: 0.65rem !important;
}

.fs-medium {
    font-size: 0.8rem !important;
}

.fs-large {
    font-size: 1rem !important;
}

.fs-h1 {
    font-size: 1.4rem !important;
}

.fs-h2 {
    font-size: 1.2rem !important;
}

.fs-36 {
    font-size: 36px !important;
}

.lh-1-2 {
    line-height: 1.2 !important;
}

.lh-1-4 {
    line-height: 1.4 !important;
}

.lh-1-5 {
    line-height: 1.5 !important;
}

.d-flex {
    display: flex !important;
}

.inline-flex {
    display: inline-flex !important;
}

.items-center {
    align-items: center !important;
}

.items-baseline {
    align-items: baseline !important;
}

.justify-between {
    justify-content: space-between !important;
}

.flex-wrap {
    flex-wrap: wrap !important;
}

.white-nowrap {
    white-space: nowrap !important;
}

.w-full {
    width: 100% !important;
}

.border-none {
    border: none !important;
}

.br-8 {
    border-radius: 8px !important;
}

.br-30 {
    border-radius: 30px !important;
}

.p-20 {
    padding: 20px !important;
}

.pt-15 {
    padding-top: 15px !important;
}

.pt-50 {
    padding-top: 50px !important;
}

.text-main {
    color: var(--text-main) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.text-dim {
    color: var(--ov-text-dim) !important;
}

.text-accent {
    color: var(--ov-accent) !important;
}

.text-plasma {
    color: var(--plasma) !important;
}

.bg-glass {
    background: rgba(255, 255, 255, 0.05) !important;
}

.border-main {
    border: 1px solid var(--border) !important;
}

.border-top-main {
    border-top: 1px solid var(--ov-border) !important;
}

.border-top-dashed {
    border-top: 1px dashed var(--ov-border) !important;
}

.transition-all {
    transition: all 0.2s ease !important;
}

.transition-transform {
    transition: transform 0.2s !important;
}

.no-underline {
    text-decoration: none !important;
}

/* --- HOME SECTION MOBILE OVERRIDES --- */
@media (max-width: 768px) {
    #home {
        padding-top: 20px !important;
    }

    .home-intro {
        font-size: 26px !important;
        margin-bottom: 5px !important;
    }

    #home h1 {
        font-size: 1.4rem !important;
    }

    #home h2 {
        font-size: 1rem !important;
        line-height: 1.4 !important;
        margin-bottom: 10px !important;
    }

    #home p {
        font-size: 0.75rem !important;
    }

    #home .glass-card {
        padding: 20px !important;
    }
}

/* --- MISSION SECTION (LLM/SEO) --- */
.social-btn:hover {
    border-color: var(--plasma) !important;
    color: var(--plasma) !important;
    background: rgba(0, 229, 255, 0.1) !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.performance-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.desktop-stats {
    padding-right: 15px;
    border-right: 1px solid var(--ov-border);
}

/* --- GLOBAL UTILITIES & STATS --- */
.performance-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.desktop-stats {
    padding-right: 15px;
    border-right: 1px solid var(--ov-border);
}

.fs-medium {
    font-size: 1rem;
}

.fs-large {
    font-size: 1.2rem;
}

.fs-h1 {
    font-size: 2.5rem;
}

.fs-h2 {
    font-size: 1.8rem;
}

.fs-36 {
    font-size: 36px;
}

.lh-1-2 {
    line-height: 1.2;
}

.lh-1-4 {
    line-height: 1.4;
}

.lh-1-5 {
    line-height: 1.5;
}

.d-flex {
    display: flex;
}

.inline-flex {
    display: inline-flex;
}

.items-center {
    align-items: center;
}

.items-baseline {
    align-items: baseline;
}

.justify-between {
    justify-content: space-between;
}

.flex-wrap {
    flex-wrap: wrap;
}

.white-nowrap {
    white-space: nowrap;
}

.w-full {
    width: 100%;
}

.border-none {
    border: none;
}

.br-8 {
    border-radius: 8px;
}

.br-30 {
    border-radius: 30px;
}

.p-20 {
    padding: 20px;
}

.pt-15 {
    padding-top: 15px;
}

.pt-50 {
    padding-top: 50px;
}

.text-main {
    color: var(--text-main);
}

.text-muted {
    color: var(--text-muted);
}

.text-dim {
    color: var(--ov-text-dim);
}

.text-accent {
    color: var(--ov-accent);
}

.text-plasma {
    color: var(--plasma);
}

.bg-glass {
    background: rgba(255, 255, 255, 0.05);
}

.border-main {
    border: 1px solid var(--border);
}

.border-top-main {
    border-top: 1px solid var(--ov-border);
}

.border-top-dashed {
    border-top: 1px dashed var(--ov-border);
}

.transition-all {
    transition: all 0.2s ease;
}

.transition-transform {
    transition: transform 0.2s;
}

.no-underline {
    text-decoration: none;
}

/* --- MOBILE OVERRIDES (max-width: 768px) --- */
@media (max-width: 768px) {
    .performance-grid {
        grid-template-columns: 1fr;
    }

    .desktop-stats {
        padding-right: 0;
        border-right: none;
        border-bottom: 1px solid var(--ov-border);
        padding-bottom: 20px;
        margin-bottom: 5px;
    }

    #home {
        padding-top: 20px !important;
    }

    .home-intro {
        font-size: 26px !important;
        margin-bottom: 5px !important;
    }

    #home h1 {
        font-size: 1.4rem !important;
    }

    #home h2 {
        font-size: 1rem !important;
        line-height: 1.4 !important;
        margin-bottom: 10px !important;
    }

    #home p {
        font-size: 0.75rem !important;
    }

    #home .glass-card {
        padding: 20px !important;
    }

    .fs-medium {
        font-size: 0.8rem !important;
    }

    .fs-large {
        font-size: 1rem !important;
    }
}

/* --- MISSION SECTION --- */
.social-btn:hover {
    border-color: var(--plasma) !important;
    color: var(--plasma) !important;
    background: rgba(0, 229, 255, 0.1) !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* --- FOOTER & SLIDESHOW STYLES --- */
.overlay-footer-copyright {
    margin-top: 50px;
    padding-top: 20px;
    border-top: 1px solid var(--ov-border);
    color: var(--ov-text-dim);
    font-size: 0.75rem;
    text-align: center;
    letter-spacing: 0.5px;
    line-height: 1.5;
    opacity: 0.8;
}

@media (max-width: 600px) {
    .overlay-footer-copyright {
        font-size: 0.65rem;
        margin-top: 30px;
    }
}

.hero-slideshow-container {
    position: relative;
    margin: 30px 0;
    z-index: 5;
}

.hero-slideshow {
    display: grid;
    grid-template-areas: 'stack';
    min-height: 250px;
    align-items: center;
}

.hero-slide {
    grid-area: stack;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s cubic-bezier(0.19, 1, 0.22, 1), transform 0.8s cubic-bezier(0.19, 1, 0.22, 1), filter 0.8s ease;
    transform: scale(1.02) translateY(10px);
    filter: blur(4px) saturate(0.8);
    width: 100%;
}

.hero-slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 3;
    transform: scale(1) translateY(0);
    filter: blur(0) saturate(1);
}

.hero-slide.leaving {
    opacity: 0;
    z-index: 1;
    transform: scale(0.98) translateY(-5px);
    filter: blur(2px);
    visibility: visible;
}

/* Slide Content Layout */
.hero-slide-content {
    display: flex;
    flex-direction: row;
    gap: 30px;
    align-items: center;
    text-align: left;
}

.slide-text {
    flex: 1;
}

.br-30 {
    border-radius: 30px;
}

.p-20 {
    padding: 20px;
}

.pt-15 {
    padding-top: 15px;
}

.pt-50 {
    padding-top: 50px;
}

.text-main {
    color: var(--text-main);
}

.text-muted {
    color: var(--text-muted);
}

.text-dim {
    color: var(--ov-text-dim);
}

.text-accent {
    color: var(--ov-accent);
}

.text-plasma {
    color: var(--plasma);
}

.bg-glass {
    background: rgba(255, 255, 255, 0.05);
}

.border-main {
    border: 1px solid var(--border);
}

.border-top-main {
    border-top: 1px solid var(--ov-border);
}

.border-top-dashed {
    border-top: 1px dashed var(--ov-border);
}

.transition-all {
    transition: all 0.2s ease;
}

.transition-transform {
    transition: transform 0.2s;
}

.no-underline {
    text-decoration: none;
}

/* --- MOBILE OVERRIDES (max-width: 768px) --- */
@media (max-width: 768px) {
    .performance-grid {
        grid-template-columns: 1fr;
    }

    .desktop-stats {
        padding-right: 0;
        border-right: none;
        border-bottom: 1px solid var(--ov-border);
        padding-bottom: 20px;
        margin-bottom: 5px;
    }

    #home {
        padding-top: 20px !important;
    }

    .home-intro {
        font-size: 26px !important;
        margin-bottom: 5px !important;
    }

    #home h1 {
        font-size: 1.4rem !important;
    }

    #home h2 {
        font-size: 1rem !important;
        line-height: 1.4 !important;
        margin-bottom: 10px !important;
    }

    #home p {
        font-size: 0.75rem !important;
    }

    #home .glass-card {
        padding: 20px !important;
    }

    .fs-medium {
        font-size: 0.8rem !important;
    }

    .fs-large {
        font-size: 1rem !important;
    }
}

/* --- MISSION SECTION --- */
.social-btn:hover {
    border-color: var(--plasma) !important;
    color: var(--plasma) !important;
    background: rgba(0, 229, 255, 0.1) !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* --- FOOTER & SLIDESHOW STYLES --- */
.overlay-footer-copyright {
    margin-top: 50px;
    padding-top: 20px;
    border-top: 1px solid var(--ov-border);
    color: var(--ov-text-dim);
    font-size: 0.75rem;
    text-align: center;
    letter-spacing: 0.5px;
    line-height: 1.5;
    opacity: 0.8;
}

@media (max-width: 600px) {
    .overlay-footer-copyright {
        font-size: 0.65rem;
        margin-top: 30px;
    }
}

.hero-slideshow-container {
    position: relative;
    margin: 30px 0;
    z-index: 5;
}

.hero-slideshow {
    display: grid;
    grid-template-areas: 'stack';
    min-height: 250px;
    align-items: center;
}

.hero-slide {
    grid-area: stack;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s cubic-bezier(0.19, 1, 0.22, 1), transform 0.8s cubic-bezier(0.19, 1, 0.22, 1), filter 0.8s ease;
    transform: scale(1.02) translateY(10px);
    filter: blur(4px) saturate(0.8);
    width: 100%;
}

.hero-slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 3;
    transform: scale(1) translateY(0);
    filter: blur(0) saturate(1);
}

.hero-slide.leaving {
    opacity: 0;
    z-index: 1;
    transform: scale(0.98) translateY(-5px);
    filter: blur(2px);
    visibility: visible;
}

/* Slide Content Layout */
.hero-slide-content {
    display: flex;
    flex-direction: row;
    gap: 30px;
    align-items: center;
    text-align: left;
}

.slide-text {
    flex: 1;
}

.slide-visual {
    flex: 0 0 320px;
    text-align: center;
}

@media (max-width: 900px) {
    .hero-slide-content {
        flex-direction: column;
        text-align: left !important;
        align-items: flex-start !important;
    }

    .slide-visual {
        flex: 0 0 auto;
    }
}

.slideshow-dots {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 25px;
}

.slideshow-dots .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(127, 127, 127, 0.2);
    border: 2px solid rgba(127, 127, 127, 0.3);
    cursor: pointer;
    transition: all 0.4s;
}

.slideshow-dots .dot.active {
    width: 30px;
    border-radius: 6px;
    background: var(--plasma);
    border-color: var(--plasma);
    box-shadow: 0 0 15px var(--plasma);
}

/* --- LEGAL SECTION --- */
.legal-card {
    text-align: center;
}

.legal-muted {
    color: var(--text-muted);
    margin-bottom: 20px;
}

.legal-btn {
    background: var(--plasma);
    color: var(--on-plasma);
    padding: 12px 30px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.95rem;
    display: inline-block;
    transition: transform 0.2s;
}

.legal-btn:hover {
    transform: scale(1.05);
}

.legal-err {
    color: #ff4444;
}

/* --- CRITICAL RESTORATION: Theme & Images --- */
html[data-theme='light'] .dark-mode-only {
    display: none !important;
}

html:not([data-theme='light']) .light-mode-only {
    display: none !important;
}

.theme-img {
    width: 100% !important;
    max-width: 320px !important;
    height: auto !important;
    object-fit: cover;
}

/* --- RESTORED SLIDESHOW STATUS --- */
.slideshow-status {
    position: absolute;
    top: 0;
    right: 0;
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.7;
    padding: 5px 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

/* RESTORED SLIDESHOW STATUS WITH ICONS */
.slideshow-status::after {
    /* Default: Scrolling */
    content: '▶ Scrolling';
    font-weight: bold;
}

.hero-slideshow-container.paused .slideshow-status::after {
    content: '⏸ Pause';
}

.hero-slideshow-container.locked .slideshow-status::after {
    content: '🔒 Locked';
    color: var(--plasma);
    opacity: 1;
}

/* --- RESTORED AUDIT GRID --- */
.audit-grid-16 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 10px;
    text-align: left;
    font-size: 0.65rem;
}

@media (min-width: 768px) {
    .audit-grid-16 {
        grid-template-columns: repeat(4, 1fr);
        font-size: 0.67rem;
    }
}

/* --- FOOTER & SOCIAL LINKS --- */

footer {
    text-align: center;
    padding: 30px 20px;
    margin-top: 40px;
    border-top: 1px solid var(--border);
    width: 100%;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.social-links {
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    gap: 5px;
}

.social-links a {
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    opacity: 0.8;
}

.social-links a:hover {
    color: var(--plasma);
    opacity: 1;
    transform: translateY(-1px);
}