/* ============================================
   Fede Nolasco Portfolio — Custom Styles
   ============================================ */

/* ============================================
   CSS Variables — Modern Theme System
   ============================================ */

/* ---------- Dark Mode (Default - Dark Blue) ---------- */
:root,
html,
html[data-theme="dark"] {
    /* Backgrounds */
    --bg-primary: #0a0f1a;
    --bg-primary-rgb: 10, 15, 26;
    --bg-elevated: #111827;
    --bg-elevated-rgb: 17, 24, 39;
    --bg-surface: #1e293b;
    --bg-surface-rgb: 30, 41, 59;
    --bg-soft: #334155;
    --bg-card: rgba(30, 41, 59, 0.5);
    
    /* Text */
    --text-primary: #f1f5f9;
    --text-strong: #ffffff;
    --text-secondary: #e2e8f0;
    --text-muted: #94a3b8;
    --text-subtle: #64748b;
    
    /* Accent */
    --accent: #00d4ff;
    --accent-dim: #0099cc;
    --accent-rgb: 0, 212, 255;
    
    /* Borders */
    --border-strong: #334155;
    --border-mid: rgba(148, 163, 184, 0.15);
    --border-soft: rgba(148, 163, 184, 0.08);
    
    /* Footer */
    --footer-bg: #0a0f1a;
    --footer-text: #64748b;
    
    /* Scrollbar */
    --scrollbar-track: #0a0f1a;
    --scrollbar-thumb: #1e293b;
    --scrollbar-thumb-hover: #334155;
    
    /* Status Colors */
    --status-success: #34d399;
    --status-warning: #fbbf24;
    --status-error: #f87171;
    --status-info: #60a5fa;
    
    /* Cluster Colors (Knowledge Graph) */
    --cluster-context: #00d4ff;
    --cluster-agentic: #a78bfa;
    --cluster-safety: #34d399;
    --cluster-economics: #fbbf24;
}

/* ---------- Light Mode (Creamy White) ---------- */
html[data-theme="light"] {
    /* Backgrounds */
    --bg-primary: #fefdfb;
    --bg-primary-rgb: 254, 253, 251;
    --bg-elevated: #f8f6f3;
    --bg-elevated-rgb: 248, 246, 243;
    --bg-surface: #f0ece6;
    --bg-surface-rgb: 240, 236, 230;
    --bg-soft: #e8e2da;
    --bg-card: rgba(255, 250, 245, 0.95);
    
    /* Text */
    --text-primary: #1e293b;
    --text-strong: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-subtle: #94a3b8;
    
    /* Accent - Darker cyan for better contrast on light bg */
    --accent: #0891b2;
    --accent-dim: #0e7490;
    --accent-rgb: 8, 145, 178;
    
    /* Borders */
    --border-strong: #d6cfc5;
    --border-mid: rgba(120, 100, 80, 0.18);
    --border-soft: rgba(120, 100, 80, 0.10);
    
    /* Footer */
    --footer-bg: #f0ece6;
    --footer-text: #64748b;
    
    /* Scrollbar */
    --scrollbar-track: #f8f6f3;
    --scrollbar-thumb: #d6cfc5;
    --scrollbar-thumb-hover: #c5bdb2;
    
    /* Status Colors - Slightly darker for light mode contrast */
    --status-success: #059669;
    --status-warning: #d97706;
    --status-error: #dc2626;
    --status-info: #2563eb;
    
    /* Cluster Colors (Knowledge Graph) - Adjusted for light mode */
    --cluster-context: #0891b2;
    --cluster-agentic: #7c3aed;
    --cluster-safety: #059669;
    --cluster-economics: #d97706;
}

/* ---------- Base Resets & Globals ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

/* Selection color */
::selection {
    background: rgba(var(--accent-rgb), 0.25);
    color: var(--text-primary);
}

/* Scrollbar styling (Webkit) */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

/* ---------- Theme Toggle Button ---------- */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.5rem;
    background: transparent;
    border: 1px solid var(--border-mid);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    color: var(--accent);
    border-color: rgba(var(--accent-rgb), 0.3);
    background: rgba(var(--accent-rgb), 0.05);
}

/* ============================================
   Global Light Mode Overrides for Tailwind Classes
   ============================================ */

/*
 * These overrides ensure Tailwind utility classes used in HTML
 * have proper contrast in light mode. The creamy white background
 * requires darker text colors for legibility.
 */

/* ---------- Text Color Overrides ---------- */
html[data-theme="light"] .text-gray-100 {
    color: var(--text-strong) !important;
}

html[data-theme="light"] .text-gray-200 {
    color: var(--text-primary) !important;
}

html[data-theme="light"] .text-gray-300 {
    color: var(--text-primary) !important;
}

html[data-theme="light"] .text-gray-400 {
    color: var(--text-secondary) !important;
}

html[data-theme="light"] .text-gray-500 {
    color: var(--text-muted) !important;
}

html[data-theme="light"] .text-gray-600 {
    color: var(--text-subtle) !important;
}

html[data-theme="light"] .text-gray-700 {
    color: var(--border-strong) !important;
}

/* ---------- Background Color Overrides ---------- */
html[data-theme="light"] .bg-dark-900 {
    background-color: var(--bg-primary) !important;
}

html[data-theme="light"] .bg-dark-900\/50,
html[data-theme="light"] .bg-dark-900\/80,
html[data-theme="light"] .bg-dark-900\/90,
html[data-theme="light"] .bg-dark-900\/95 {
    background-color: rgba(var(--bg-primary-rgb), 0.94) !important;
}

html[data-theme="light"] .bg-dark-800 {
    background-color: var(--bg-elevated) !important;
}

html[data-theme="light"] .bg-dark-800\/50,
html[data-theme="light"] .bg-dark-800\/80 {
    background-color: rgba(var(--bg-elevated-rgb), 0.9) !important;
}

html[data-theme="light"] .bg-dark-700 {
    background-color: var(--bg-surface) !important;
}

html[data-theme="light"] .bg-dark-700\/50,
html[data-theme="light"] .bg-dark-700\/80,
html[data-theme="light"] .bg-dark-700\/90 {
    background-color: rgba(var(--bg-surface-rgb), 0.85) !important;
}

html[data-theme="light"] .bg-dark-600 {
    background-color: var(--bg-soft) !important;
}

/* ---------- Border Color Overrides ---------- */
html[data-theme="light"] .border-gray-800,
html[data-theme="light"] .border-gray-800\/50,
html[data-theme="light"] .border-gray-800\/30 {
    border-color: var(--border-mid) !important;
}

html[data-theme="light"] .border-gray-700 {
    border-color: var(--border-strong) !important;
}

html[data-theme="light"] .border-gray-600 {
    border-color: var(--border-strong) !important;
}

/* ---------- Placeholder Color Overrides ---------- */
html[data-theme="light"] .placeholder-gray-500::placeholder {
    color: var(--text-subtle) !important;
}

html[data-theme="light"] .placeholder-gray-400::placeholder {
    color: var(--text-muted) !important;
}

/* ---------- Hover State Overrides ---------- */
html[data-theme="light"] .hover\:text-gray-300:hover {
    color: var(--text-primary) !important;
}

html[data-theme="light"] .hover\:text-gray-200:hover {
    color: var(--text-strong) !important;
}

html[data-theme="light"] .hover\:bg-dark-700:hover {
    background-color: var(--bg-surface) !important;
}

html[data-theme="light"] .hover\:bg-dark-600:hover,
html[data-theme="light"] .hover\:bg-dark-600\/40:hover,
html[data-theme="light"] .hover\:bg-dark-600\/30:hover {
    background-color: var(--bg-soft) !important;
}

html[data-theme="light"] .hover\:border-gray-700:hover {
    border-color: var(--border-strong) !important;
}

html[data-theme="light"] .hover\:border-gray-600:hover {
    border-color: var(--border-strong) !important;
}

/* ---------- Focus State Overrides ---------- */
html[data-theme="light"] .focus\:border-gray-700:focus {
    border-color: var(--border-strong) !important;
}

/* ---------- Neon-Blue (Accent) Text Contrast ---------- */
/* Make the bright cyan `text-neon-blue` class readable on light backgrounds */
html[data-theme="light"] .text-neon-blue {
    color: #0e7490 !important; /* Darker teal - wcag contrast compliant on creamy white */
}

html[data-theme="light"] .text-neon-blue\/80 {
    color: rgba(14, 116, 144, 0.85) !important;
}

html[data-theme="light"] .text-neon-blue\/70 {
    color: rgba(14, 116, 144, 0.75) !important;
}

html[data-theme="light"] .text-neon-blue\/50 {
    color: rgba(14, 116, 144, 0.6) !important;
}

html[data-theme="light"] .bg-neon-blue\/20,
html[data-theme="light"] .bg-neon-blue\/15,
html[data-theme="light"] .bg-neon-blue\/10 {
    background-color: rgba(14, 116, 144, 0.12) !important;
}

html[data-theme="light"] .border-neon-blue\/30,
html[data-theme="light"] .border-neon-blue\/25,
html[data-theme="light"] .border-neon-blue\/20 {
    border-color: rgba(14, 116, 144, 0.25) !important;
}

html[data-theme="light"] .hover\:text-neon-blue:hover {
    color: #0e7490 !important;
}

html[data-theme="light"] .hover\:bg-neon-blue\/30:hover,
html[data-theme="light"] .hover\:bg-neon-blue\/25:hover {
    background-color: rgba(14, 116, 144, 0.18) !important;
}

html[data-theme="light"] .hover\:border-neon-blue\/30:hover {
    border-color: rgba(14, 116, 144, 0.3) !important;
}

html[data-theme="light"] .group-hover\:text-neon-blue:hover,
html[data-theme="light"] .group:hover .group-hover\:text-neon-blue {
    color: #0e7490 !important;
}

/* ---------- Navigation Links ---------- */
.nav-link {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.2s ease;
    text-decoration: none;
    position: relative;
}

.nav-link:hover {
    color: var(--accent);
    background-color: rgba(var(--accent-rgb), 0.05);
}

.nav-link.active {
    color: var(--accent);
    background-color: rgba(var(--accent-rgb), 0.1);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    border-radius: 1px;
}

/* Mobile Navigation Links */
.mobile-nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.2s ease;
    text-decoration: none;
}

.mobile-nav-link:hover {
    color: var(--accent);
    background-color: rgba(var(--accent-rgb), 0.05);
}

.mobile-nav-link.active {
    color: var(--accent);
    background-color: rgba(var(--accent-rgb), 0.1);
    border-left: 3px solid var(--accent);
}

/* ---------- Sidebar Navigation ---------- */
#sidebar {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

#sidebar.collapsed {
    transform: translateX(-100%);
}

#main-content.sidebar-collapsed,
#main-footer.sidebar-collapsed {
    padding-left: 0;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.2s ease;
    text-decoration: none;
}

.sidebar-nav-link:hover {
    color: var(--accent);
    background-color: rgba(var(--accent-rgb), 0.08);
}

.sidebar-nav-link.active {
    color: var(--accent);
    background-color: rgba(var(--accent-rgb), 0.12);
    border-left: 3px solid var(--accent);
    margin-left: -3px;
    padding-left: calc(0.75rem + 3px);
}

.sidebar-nav-link i {
    font-size: 0.875rem;
    color: var(--text-subtle);
    transition: color 0.2s ease;
}

.sidebar-nav-link:hover i,
.sidebar-nav-link.active i {
    color: var(--accent);
}

/* Mobile sidebar behavior */
@media (max-width: 768px) {
    #sidebar {
        transform: translateX(-100%);
    }
    
    #sidebar.open {
        transform: translateX(0);
    }
    
    #main-content,
    #main-footer {
        padding-left: 0 !important;
    }
    
    /* Overlay when sidebar is open on mobile */
    #sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        top: 3.5rem;
        background: rgba(0, 0, 0, 0.5);
        z-index: 35;
    }
    
    #sidebar-overlay.visible {
        display: block;
    }
}

/* ---------- Pill-Shaped Competency Tags ---------- */
.pill-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 1rem;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--accent);
    background-color: rgba(var(--accent-rgb), 0.08);
    border: 1px solid rgba(var(--accent-rgb), 0.15);
    transition: all 0.25s ease;
    white-space: nowrap;
}

.pill-tag:hover {
    background-color: rgba(var(--accent-rgb), 0.15);
    border-color: rgba(var(--accent-rgb), 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.1);
}

/* ---------- Status Pill Badges ---------- */
.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.1875rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

/* Blue — Completed */
.status-completed {
    color: #60a5fa;
    background-color: rgba(96, 165, 250, 0.1);
    border: 1px solid rgba(96, 165, 250, 0.2);
}

/* Green — In Production */
.status-production {
    color: #34d399;
    background-color: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.2);
}

/* Amber — Ongoing / Implementation-Ready */
.status-ongoing,
.status-amber {
    color: #fbbf24;
    background-color: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.2);
}

/* Mini tags (used in timeline and project cards) */
.mini-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--text-muted);
    background-color: var(--bg-card);
    border: 1px solid var(--border-soft);
    transition: all 0.2s ease;
}

.mini-tag:hover {
    color: var(--accent);
    border-color: rgba(var(--accent-rgb), 0.2);
}

/* ---------- Buttons ---------- */
.btn-primary {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--bg-primary);
    background: linear-gradient(135deg, var(--accent), var(--accent-dim));
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(var(--accent-rgb), 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(var(--accent-rgb), 0.35);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent);
    background: transparent;
    border: 1px solid rgba(var(--accent-rgb), 0.3);
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background-color: rgba(var(--accent-rgb), 0.08);
    border-color: rgba(var(--accent-rgb), 0.5);
    transform: translateY(-2px);
}

.btn-secondary:active {
    transform: translateY(0);
}

/* ---------- Stat Cards ---------- */
.stat-card {
    text-align: center;
    padding: 1.5rem;
    border-radius: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: rgba(var(--accent-rgb), 0.15);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* ---------- Timeline ---------- */
.timeline-item {
    position: relative;
    padding-left: 3rem;
    padding-bottom: 3rem;
    margin-left: 1rem;
}

@media (min-width: 640px) {
    .timeline-item {
        padding-left: 4rem;
        margin-left: 2rem;
    }
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -0.625rem;
    top: 0;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    background: var(--bg-elevated);
    border: 2px solid var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    z-index: 10;
    box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.3);
}

@media (min-width: 640px) {
    .timeline-dot {
        width: 2rem;
        height: 2rem;
        left: -1rem;
    }
}

.timeline-content {
    padding: 1.5rem;
    border-radius: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    transition: all 0.3s ease;
}

.timeline-content:hover {
    border-color: rgba(var(--accent-rgb), 0.15);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* ---------- Concept Cards (Agentic Economy) ---------- */
.concept-card {
    padding: 1.5rem;
    border-radius: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    transition: all 0.3s ease;
}

.concept-card:hover {
    border-color: rgba(var(--accent-rgb), 0.2);
    background: rgba(var(--bg-surface-rgb), 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* ---------- Project Cards ---------- */
.project-card {
    display: flex;
    flex-direction: column;
    border-radius: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    overflow: hidden;
    transition: all 0.3s ease;
}

.project-card:hover {
    border-color: rgba(var(--accent-rgb), 0.2);
    transform: translateY(-4px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2), 0 0 15px rgba(var(--accent-rgb), 0.05);
}

/* ---------- Contact Cards ---------- */
.contact-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-radius: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    text-decoration: none;
    transition: all 0.3s ease;
}

.contact-card:hover {
    border-color: rgba(var(--accent-rgb), 0.2);
    background: rgba(var(--bg-surface-rgb), 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* ---------- Standalone Use Case Page ---------- */
.overview-panel,
.use-case-card,
.analysis-card,
.source-quote {
    border-radius: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-mid);
}

.overview-panel,
.analysis-card,
.source-quote {
    padding: 1.5rem;
}

.use-case-card {
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.use-case-card:hover,
.analysis-card:hover,
.overview-panel:hover,
.source-quote:hover {
    border-color: rgba(var(--accent-rgb), 0.18);
    background: rgba(var(--bg-surface-rgb), 0.6);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.topic-link-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    background: rgba(var(--accent-rgb), 0.10);
    border: 1px solid rgba(var(--accent-rgb), 0.28);
    text-decoration: none;
    transition: all 0.2s ease;
}

.topic-link-chip:hover {
    transform: translateY(-1px);
    background: rgba(var(--accent-rgb), 0.14);
    border-color: rgba(var(--accent-rgb), 0.28);
}

.section-kicker {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
}

.use-case-meta dt {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-subtle);
    margin-bottom: 0.5rem;
}

.use-case-meta dd {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.use-case-grid {
    display: grid;
    gap: 1rem;
}

@media (min-width: 1024px) {
    .use-case-grid {
        grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
    }
}

.quote-mark {
    color: rgba(var(--accent-rgb), 0.5);
}

/* ---------- Light Theme Utility Overrides ---------- */
html[data-theme="light"] [class~="bg-dark-900"] { background-color: var(--bg-primary) !important; }
html[data-theme="light"] [class~="bg-dark-900/80"] { background-color: rgba(var(--bg-primary-rgb), 0.84) !important; }
html[data-theme="light"] [class~="bg-dark-900/95"] { background-color: rgba(var(--bg-primary-rgb), 0.94) !important; }
html[data-theme="light"] [class~="bg-dark-900/50"] { background-color: rgba(var(--bg-primary-rgb), 0.58) !important; }
html[data-theme="light"] [class~="bg-dark-800"] { background-color: var(--bg-elevated) !important; }
html[data-theme="light"] [class~="bg-dark-800/50"] { background-color: rgba(var(--bg-elevated-rgb), 0.58) !important; }
html[data-theme="light"] [class~="bg-dark-700"] { background-color: var(--bg-surface) !important; }
html[data-theme="light"] [class~="bg-dark-700/50"] { background-color: rgba(var(--bg-surface-rgb), 0.5) !important; }

html[data-theme="light"] [class~="text-gray-100"] { color: var(--text-primary) !important; }
html[data-theme="light"] [class~="text-gray-200"] { color: var(--text-strong) !important; }
html[data-theme="light"] [class~="text-gray-300"] { color: var(--text-secondary) !important; }
html[data-theme="light"] [class~="text-gray-400"] { color: var(--text-muted) !important; }
html[data-theme="light"] [class~="text-gray-500"] { color: var(--text-subtle) !important; }
html[data-theme="light"] [class~="text-gray-600"] { color: #ad9c89 !important; }

html[data-theme="light"] [class~="border-gray-800"] { border-color: var(--border-strong) !important; }
html[data-theme="light"] [class~="border-gray-800/50"] { border-color: var(--border-soft) !important; }
html[data-theme="light"] [class~="border-gray-800/30"] { border-color: rgba(125, 99, 68, 0.12) !important; }
html[data-theme="light"] [class~="border-gray-700"] { border-color: var(--border-soft) !important; }

html[data-theme="light"] #main-nav,
html[data-theme="light"] #mobile-menu,
html[data-theme="light"] #sidebar,
html[data-theme="light"] #footer,
html[data-theme="light"] header,
html[data-theme="light"] nav,
html[data-theme="light"] #consent-banner,
html[data-theme="light"] #detail-panel-header,
html[data-theme="light"] .mobile-card,
html[data-theme="light"] #learning-tooltip {
    border-color: var(--border-soft) !important;
}

html[data-theme="light"] #consent-banner,
html[data-theme="light"] #detail-panel-header,
html[data-theme="light"] .mobile-card {
    background: var(--bg-elevated) !important;
    color: var(--text-primary) !important;
}

html[data-theme="light"] #learning-tooltip {
    background: rgba(241, 231, 216, 1) !important;
    color: var(--text-primary) !important;
    backdrop-filter: none !important;
}

html[data-theme="light"] .status-pill {
    background-color: rgba(255, 248, 240, 0.8);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

html[data-theme="light"] .mini-tag {
    background-color: rgba(255, 248, 240, 0.84);
    border-color: rgba(124, 101, 73, 0.14);
    color: #8b7b68;
}

html[data-theme="light"] .mini-tag:hover {
    color: var(--accent);
    border-color: rgba(14, 165, 198, 0.22);
}

html[data-theme="light"] .stat-card,
html[data-theme="light"] .timeline-content,
html[data-theme="light"] .project-card,
html[data-theme="light"] .concept-card,
html[data-theme="light"] .contact-card,
html[data-theme="light"] .overview-panel,
html[data-theme="light"] .use-case-card,
html[data-theme="light"] .analysis-card,
html[data-theme="light"] .source-quote {
    background: var(--bg-card) !important;
    border-color: var(--border-mid) !important;
}

html[data-theme="light"] .hero-experience-badge {
    background: rgba(239, 230, 216, 0.98) !important;
    color: var(--accent) !important;
}

html[data-theme="light"] .topic-link-chip {
    background: rgba(5, 184, 234, 0.12) !important;
    border-color: rgba(10, 136, 176, 0.42) !important;
    color: #0a6c8a !important;
}

html[data-theme="light"] .topic-link-chip:hover {
    background: rgba(5, 184, 234, 0.18) !important;
    border-color: rgba(10, 136, 176, 0.56) !important;
    color: #085d77 !important;
}

html[data-theme="light"] .pill-tag {
    background-color: rgba(5, 184, 234, 0.10) !important;
    border-color: rgba(10, 136, 176, 0.32) !important;
    color: #0a6c8a !important;
}

html[data-theme="light"] .pill-tag:hover {
    background-color: rgba(5, 184, 234, 0.16) !important;
    border-color: rgba(10, 136, 176, 0.46) !important;
    color: #085d77 !important;
}

html[data-theme="light"] footer,
html[data-theme="light"] #footer,
html[data-theme="light"] .site-footer {
    background: var(--footer-bg) !important;
}

html[data-theme="light"] footer p,
html[data-theme="light"] footer a,
html[data-theme="light"] #footer p,
html[data-theme="light"] #footer a {
    color: var(--footer-text) !important;
}

html[data-theme="light"] footer a:hover,
html[data-theme="light"] #footer a:hover {
    color: var(--accent) !important;
}

html[data-theme="light"] #sidebar {
    background: var(--bg-elevated) !important;
}

html[data-theme="light"] #search-input {
    background: var(--bg-elevated) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-mid) !important;
}

html[data-theme="light"] #detail-panel {
    background: var(--bg-elevated) !important;
}

html[data-theme="light"] #detail-panel-body {
    background: var(--bg-elevated) !important;
}

html[data-theme="light"] .sticky.bg-dark-900\/90 {
    background: rgba(var(--bg-primary-rgb), 0.94) !important;
    border-color: var(--border-mid) !important;
}

html[data-theme="light"] .text-gray-500[class*="Jump"] {
    color: var(--text-secondary) !important;
}

html[data-theme="light"] #learning-tooltip .tt-title { color: var(--text-primary) !important; }
html[data-theme="light"] #learning-tooltip .tt-why { color: var(--text-muted) !important; }
html[data-theme="light"] .tl-item::before { background: rgba(125, 99, 68, 0.24) !important; }
html[data-theme="light"] .tl-dot { background: var(--bg-primary) !important; }
html[data-theme="light"] .quiz-opt { color: var(--text-secondary) !important; border-color: var(--border-soft) !important; }
html[data-theme="light"] .quiz-opt:hover { border-color: rgba(14, 165, 198, 0.35) !important; background: rgba(14, 165, 198, 0.06) !important; }
html[data-theme="light"] .vendor-pick { background: rgba(14, 165, 198, 0.08) !important; border-color: rgba(14, 165, 198, 0.22) !important; }
html[data-theme="light"] .star-e { color: #c7b79f !important; }

/* Light mode: Detail panel vendor boxes and text contrast fixes */
html[data-theme="light"] #detail-panel [class*="bg-dark-700"] {
    background: var(--bg-surface) !important;
    border-color: var(--border-mid) !important;
}

html[data-theme="light"] #detail-panel [class~="text-gray-300"] {
    color: var(--text-primary) !important;
}

html[data-theme="light"] #detail-panel [class~="text-gray-500"] {
    color: var(--text-secondary) !important;
}

html[data-theme="light"] #detail-panel [class~="text-gray-400"] {
    color: var(--text-muted) !important;
}

/* Light mode: Scenario cards with proper contrast */
html[data-theme="light"] .scenario-card,
html[data-theme="light"] .scenario-without,
html[data-theme="light"] .scenario-with {
    background: var(--bg-card) !important;
}

html[data-theme="light"] .scenario-without {
    background: rgba(239, 68, 68, 0.06) !important;
    border-color: rgba(185, 28, 28, 0.2) !important;
}

html[data-theme="light"] .scenario-with {
    background: rgba(22, 163, 74, 0.06) !important;
    border-color: rgba(22, 101, 52, 0.2) !important;
}

/* Light mode: Connection buttons in panel */
html[data-theme="light"] #detail-panel button[class*="bg-dark"] {
    background: var(--bg-surface) !important;
    border-color: var(--border-mid) !important;
}

html[data-theme="light"] #detail-panel button[class*="bg-dark"]:hover {
    background: rgba(var(--accent-rgb), 0.08) !important;
    border-color: rgba(var(--accent-rgb), 0.2) !important;
}

/* ---------- View Section Transitions ---------- */
.view-section {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.view-section.hidden {
    display: none;
    opacity: 0;
}

/* Re-trigger animations on view switch */
.view-section.entering .animate-fade-in,
.view-section.entering .animate-slide-up {
    animation: none;
}

.view-section:not(.hidden) .animate-fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

.view-section:not(.hidden) .animate-slide-up {
    animation: slideUp 0.6s ease-out forwards;
}

/* ---------- Ambient Glow Effects ---------- */
.glow-line {
    background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb), 0.15), transparent);
    height: 1px;
}

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
