:root {
    /* BRANDING PALETTE (from documentation/branding.md) */
    --color-brand-deep-blue-1: #0b132b;
    /* Trust & Authority */
    --color-brand-deep-blue-2: #1c2541;
    /* Main Background (Dark) / Text (Light) */
    --color-brand-deep-blue-3: #3a506b;
    /* Secondary / Tertiary */
    --color-brand-sage: #5bc0be;
    /* Prevention & Sustainability (Primary) */
    --color-brand-warm-grey: #e2e8f0;
    /* Neutrality & System */

    /* FUNCTIONAL MAPPINGS */
    --color-primary: var(--color-brand-sage);
    --color-primary-hover: #4aa8a6;
    /* Derived darkened sage */

    --color-background-light: #f8f9fa;
    /* Standard light bg */
    --color-background-dark: var(--color-brand-deep-blue-1);
    /* Darkest Blue for body bg */

    --color-deep-blue-main: var(--color-brand-deep-blue-1);
    --color-deep-blue-secondary: var(--color-brand-deep-blue-2);
    --color-deep-blue-tertiary: var(--color-brand-deep-blue-3);

    --color-surface-light: #ffffff;
    --color-surface-dark: var(--color-brand-deep-blue-2);

    --color-text-light: var(--color-brand-deep-blue-2);
    --color-text-dark: var(--color-brand-warm-grey);

    --color-muted-light: #64748b;
    /* Slate */

    /* FONTS */
    --font-primary: 'Inter', sans-serif;
    --font-logo: 'Lucidity Expand', sans-serif;

    /* Bootstrap Overrides */
    --bs-primary: var(--color-brand-sage);
    --bs-body-color: var(--color-brand-deep-blue-2);
    --bs-body-bg: var(--color-background-light);
}

/* Theme Visibility Utilities */
body.dark .d-light-only {
    display: none !important;
}

body.dark .d-dark-only {
    display: inline-block !important;
}

body:not(.dark) .d-light-only {
    display: inline-block !important;
}

body:not(.dark) .d-dark-only {
    display: none !important;
}

body {
    font-family: var(--font-primary);
    background-color: var(--color-background-light);
    color: var(--color-text-light);
    transition: background-color 0.3s, color 0.3s;
}

body.dark {
    background-color: var(--color-deep-blue-main);
    color: var(--color-text-dark);
}

/* Dark Mode Overrides for Bootstrap Utilities */
body.dark .text-muted {
    color: #cbd5e1 !important;
    /* Light Slate Gray for readability */
}

body.dark h1,
body.dark h2,
body.dark h3,
body.dark h4,
body.dark h5,
body.dark h6 {
    color: var(--color-surface-light);
}

body.dark a.text-muted:hover {
    color: var(--color-primary) !important;
}

/* On-Brand Overrides for Bootstrap Utilities in Dark Mode */
body.dark .text-info {
    color: var(--color-primary) !important;
    /* Sage Green instead of Cyan */
}

body.dark .border-info {
    border-color: var(--color-primary) !important;
    /* Sage Green border */
}

body.dark .text-danger {
    color: #f87171 !important;
    /* Soft Red (Tailwind-like) for readability on dark */
    /* Branding doesn't specify red, but we need it for "Panel" tag visibility */
}

/* Navbar */
.navbar {
    background-color: rgba(28, 37, 65, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.navbar-brand {
    font-family: var(--font-primary);
    font-weight: 700;
    color: white !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.logo-box {
    width: 32px;
    height: 32px;
    background-color: var(--color-primary);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    margin-right: 8px;
}

.nav-link {
    color: #e2e8f0 !important;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--color-primary) !important;
}

/* Hero Section */
.hero-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    background-color: var(--color-deep-blue-secondary);
    padding-top: 80px;
    /* Offset for fixed navbar */
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 10;
}

/* text-gradient and blob fixes must be done where they appear, likely further down in file */

/* Animations */
.animate-blob {
    animation: blob 7s infinite;
}

.animation-delay-2000 {
    animation-delay: 2s;
}

.animation-delay-4000 {
    animation-delay: 4s;
}

@keyframes blob {
    0% {
        transform: translate(0px, 0px) scale(1);
    }

    33% {
        transform: translate(30px, -50px) scale(1.1);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }

    100% {
        transform: translate(0px, 0px) scale(1);
    }
}

.fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Buttons */
.btn-primary-custom {
    background-color: var(--color-primary);
    border: none;
    color: white;
    padding: 10px 24px;
    font-weight: 600;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(91, 192, 190, 0.2);
    transition: all 0.2s;
}

.btn-primary-custom:hover {
    background-color: var(--color-primary-hover);
    transform: translateY(-2px);
    color: white;
}

.btn-outline-custom {
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 24px;
    font-weight: 500;
    border-radius: 0.5rem;
    backdrop-filter: blur(4px);
    transition: all 0.2s;
}

.btn-outline-custom:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Cards */
.feature-card {
    background-color: white;
    border: 1px solid #f1f5f9;
    border-radius: 1rem;
    padding: 2rem;
    transition: all 0.3s;
    overflow: hidden;
    position: relative;
    height: 100%;
}

body.dark .feature-card {
    background-color: var(--color-deep-blue-secondary) !important;
    border-color: rgba(255, 255, 255, 0.05);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

body.dark .feature-card:hover {
    box-shadow: 0 10px 25px rgba(91, 192, 190, 0.1);
}

/* Board Card Dark Mode */
body.dark #board-grid .card {
    background-color: var(--color-deep-blue-secondary) !important;
    /* Darker tone */
    color: var(--color-text-dark);
}

body.dark #board-grid .card .text-dark {
    color: var(--color-surface-light) !important;
}

/* Global Card Dark Mode Override (Program, Speakers, Venue) */
body.dark .card {
    background-color: var(--color-deep-blue-secondary) !important;
    color: var(--color-surface-light);
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark .card .text-dark {
    color: var(--color-surface-light) !important;
}

body.dark .card .bg-light {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

/* Contact Form Dark Mode */
body.dark input.form-control,
body.dark textarea.form-control,
body.dark select.form-select {
    background-color: var(--color-deep-blue-main) !important;
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--color-surface-light);
}

body.dark input.form-control:focus,
body.dark textarea.form-control:focus,
body.dark select.form-select:focus {
    background-color: var(--color-deep-blue-main) !important;
    color: var(--color-surface-light);
    border-color: var(--color-primary);
}

/* Override bg-white utilities in dark mode for specific sections */
body.dark .bg-white {
    background-color: var(--color-deep-blue-secondary) !important;
}

body.dark .bg-light {
    background-color: var(--color-deep-blue-main) !important;
}

.icon-box {
    width: 56px;
    height: 56px;
    background-color: rgba(91, 192, 190, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    margin-bottom: 1.5rem;
    transition: transform 0.3s;
}

.feature-card:hover .icon-box {
    transform: scale(1.1);
}

/* Footer */
footer {
    background-color: #f8f9fa;
    border-top: 1px solid #e2e8f0;
    color: var(--color-muted-light);
}

body.dark footer {
    background-color: var(--color-deep-blue-main);
    border-color: rgba(255, 255, 255, 0.05);
    color: var(--color-muted-light);
}

.footer-heading {
    color: var(--color-text-light);
    font-weight: 700;
    margin-bottom: 1.5rem;
}

body.dark .footer-heading {
    color: white;
}

.social-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-muted-light);
    transition: all 0.3s;
}

body.dark .social-link {
    border-color: rgba(255, 255, 255, 0.1);
    background-color: rgba(255, 255, 255, 0.05);
}

.social-link:hover {
    background-color: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

/* Language Switcher */
.lang-switcher {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 9999px;
    padding: 0.25rem 0.75rem;
    background-color: rgba(255, 255, 255, 0.05);
}

.lang-option {
    font-size: 0.75rem;
    font-weight: 600;
    color: #cbd5e1;
    cursor: pointer;
    padding: 0 0.25rem;
}

.lang-option.active {
    color: var(--color-primary);
    font-weight: bold;
}

/* Timeline Component */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #e2e8f0;
}

body.dark .timeline::before {
    background-color: rgba(255, 255, 255, 0.1);
}

.timeline-item {
    position: relative;
    padding-bottom: 3rem;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -2.0rem;
    /* Adjusted for container padding */
    top: 1.5rem;
    /* Align with card top/time */
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--color-deep-blue-main);
    border: 3px solid white;
    z-index: 1;
    box-shadow: 0 0 0 2px var(--color-primary);
}

body.dark .timeline-dot {
    background-color: var(--color-primary);
    border-color: var(--color-deep-blue-main);
    box-shadow: 0 0 0 2px rgba(91, 192, 190, 0.3);
}

.timeline-dot.current {
    background-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(91, 192, 190, 0.2);
}

.timeline-dot.past {
    background-color: #cbd5e1;
    border-color: #f8f9fa;
    box-shadow: none;
}

/* Utilities */
.text-balance {
    text-wrap: balance;
}

.hover-lift {
    transition: transform 0.2s, box-shadow 0.2s;
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.bg-teal-soft {
    background-color: rgba(91, 192, 190, 0.1);
    /* Primary (Sage) with opacity */
}

.text-teal {
    color: var(--color-primary) !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .timeline {
        padding-left: 1.5rem;
    }

    .timeline::before {
        left: 0;
    }

    .timeline-dot {
        left: -1.9rem;
        /* Re-align with line */
        width: 12px;
        height: 12px;
        border-width: 2px;
    }
}