:root {
    /* NEXXU Base */
    --accent: #c8ff00;
    --accent-dim: rgba(200, 255, 0, 0.06);
    --accent-mid: rgba(200, 255, 0, 0.15);

    /* NEXXU-APP */
    --app-bg: #000000;
    --app-surface: #0a0a0a;

    /* NEXXU-BOX */
    --box-primary: #2563EB;
    --box-secondary: #6B7280;
    --box-dim: rgba(37, 99, 235, 0.06);
    --box-mid: rgba(37, 99, 235, 0.15);

    /* NEXXU-VAULT */
    --vault-primary: #EF4444;
    --vault-secondary: #F59E0B;
    --vault-dim: rgba(239, 68, 68, 0.06);
    --vault-mid: rgba(239, 68, 68, 0.15);

    /* NEXXU-HEALTH */
    --health-primary: #10B981;
    --health-secondary: #A855F7;
    --health-dim: rgba(16, 185, 129, 0.06);
    --health-mid: rgba(16, 185, 129, 0.15);

    /* NEXXU-CRAFT */
    --craft-primary: #F97316;
    --craft-secondary: #4B5563;
    --craft-dim: rgba(249, 115, 22, 0.06);
    --craft-mid: rgba(249, 115, 22, 0.15);

    /* NEXXU-LEGAL */
    --legal-primary: #8B5CF6;
    --legal-secondary: #FCD34D;
    --legal-dim: rgba(139, 92, 246, 0.06);
    --legal-mid: rgba(139, 92, 246, 0.15);

    /* NEXXU-EDU */
    --edu-primary: #FBBF24;
    --edu-secondary: #3B82F6;
    --edu-dim: rgba(251, 191, 36, 0.06);
    --edu-mid: rgba(251, 191, 36, 0.15);

    /* Theme Defaults (Dark) */
    --bg: #050505;
    --card: #0c0c0c;
    --elevated: #141414;
    --border: #1a1a1a;
    --border-light: #252525;
    --text: #f0f0f0;
    --text-muted: #a3a3a3;
    --text-dim: #737373;
    --text-faint: #525252;

    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'Space Mono', monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--current-primary, var(--accent));
}

/* Utility */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(5, 5, 5, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

.brand {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand svg {
    width: 24px;
    height: 24px;
    stroke: var(--current-primary, var(--accent));
    transition: stroke 0.3s;
}

.brand span {
    color: var(--current-primary, var(--accent));
}

.nav-links {
    display: flex;
    gap: 24px;
    align-items: center;
}

.nav-separator {
    width: 1px;
    height: 24px;
    background-color: var(--border-light);
    margin: 0 8px;
}

.nav-links a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--current-primary, var(--accent));
}

.mobile-toggle {
    display: none;
    cursor: pointer;
    color: var(--text);
}

/* Hero */
.hero {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    padding-top: 64px;
}

#hero-orb {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: -1;
    width: 100%;
    height: 100%;
}

.hero-content-wrapper {
    position: relative;
    z-index: 10;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.typewriter-container {
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    margin-top: 100px;
    /* Moved down */
}

#typewriter-text {
    font-family: var(--font-mono);
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 700;
    color: var(--text);
    margin: 0;
    background: none;
    -webkit-text-fill-color: var(--text);
    line-height: 1.2;
}

.hidden-content {
    opacity: 0;
    transform: scale(0.1);
    /* Start as a point behind the orb */
    transition: opacity 1.5s cubic-bezier(0.16, 1, 0.3, 1), transform 1.5s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    z-index: 1;
}

.hidden-content.visible {
    opacity: 1;
    transform: scale(1);
    /* Fly forward into view */
    pointer-events: all;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.hero-bg {
    display: none;
    /* Removed in favor of Canvas Orb */
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 24px;
    background: linear-gradient(135deg, var(--text), var(--text-dim));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.btn-primary {
    background: var(--current-primary, var(--accent));
    color: #000;
    box-shadow: 0 0 20px var(--current-dim, var(--accent-dim));
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px var(--current-mid, var(--accent-mid));
}

/* Features/Grid */
.feature-card {
    background: var(--card);
    border: 1px solid var(--border);
    padding: 32px;
    border-radius: 12px;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    /* For links */
    color: var(--text);
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: var(--current-primary, var(--accent));
    background: var(--elevated);
}

.card-icon {
    margin-bottom: 16px;
    color: var(--current-primary, var(--accent));
    display: flex;
    align-items: center;
}

.card-icon svg {
    width: 40px;
    height: 40px;
    stroke-width: 1.5;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.card-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Mock Content Placeholders */
.placeholder-media {
    width: 100%;
    aspect-ratio: 16/9;
    background: var(--elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    margin: 40px 0;
}

/* Footer */
footer {
    border-top: 1px solid var(--border);
    padding: 40px 0;
    margin-top: 80px;
    background: var(--card);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
}

.footer-col h4 {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 16px;
    letter-spacing: 1px;
    color: var(--text);
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    margin-bottom: 8px;
}

.footer-col a {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-col a:hover {
    color: var(--current-primary, var(--accent));
}

/* Subsystem Specific Overrides */
/* Applied via body classes or specific styles on pages */
body.health {
    --current-primary: var(--health-primary);
    --current-dim: var(--health-dim);
    --current-mid: var(--health-mid);
}

body.vault {
    --current-primary: var(--vault-primary);
    --current-dim: var(--vault-dim);
    --current-mid: var(--vault-mid);
}

body.box {
    --current-primary: var(--box-primary);
    --current-dim: var(--box-dim);
    --current-mid: var(--box-mid);
}

body.craft {
    --current-primary: var(--craft-primary);
    --current-dim: var(--craft-dim);
    --current-mid: var(--craft-mid);
}

body.legal {
    --current-primary: var(--legal-primary);
    --current-dim: var(--legal-dim);
    --current-mid: var(--legal-mid);
}

body.edu {
    --current-primary: var(--edu-primary);
    --current-dim: var(--edu-dim);
    --current-mid: var(--edu-mid);
}

body.app {
    --current-primary: var(--accent);
    --bg: var(--app-bg);
    --card: var(--app-surface);
}

/* Mobile */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }

    .navbar {
        height: auto;
        min-height: 64px;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: flex-start;
        padding: 8px 16px;
        gap: 6px 8px;
        background: rgba(5, 5, 5, 0.8);
        backdrop-filter: blur(12px);
        border-bottom: 1px solid var(--border);
    }

    .nav-links {
        display: contents;
    }

    .nav-links a:first-child {
        margin-left: 12px;
    }

    .nav-links a {
        font-size: 0.85rem;
        padding: 4px 6px;
        white-space: nowrap;
        color: var(--text) !important;
        opacity: 1 !important;
    }

    .nav-separator {
        display: none;
    }

    .mobile-toggle {
        display: none;
    }

    .hero {
        min-height: auto;
        padding-top: 80px;
        padding-bottom: 40px;
    }

    .hero h1 {
        font-size: 2rem;
        line-height: 1.3;
        word-wrap: break-word;
    }

    .hero p {
        font-size: 1rem;
        line-height: 1.6;
        max-width: 100%;
    }

    .hero .subheading {
        font-size: 0.75rem;
    }
}

/* Progressive Navigation States */
.nav-links a[data-page] {
    transition: opacity 0.6s ease, filter 0.6s ease, pointer-events 0s;
}

.nav-links a.nav-locked {
    opacity: 0.15;
    filter: grayscale(0.8);
    pointer-events: none;
    cursor: default;
}

.nav-links a.nav-dimmed {
    opacity: 0.4;
    filter: grayscale(0.5);
}

.nav-links a.nav-visible {
    opacity: 1;
    filter: grayscale(0);
}

@keyframes navUnlock {
    0% {
        opacity: 0.15;
        filter: grayscale(0.8);
        transform: scale(0.95);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        filter: grayscale(0);
        transform: scale(1);
    }
}

.nav-links a.nav-unlocking {
    animation: navUnlock 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Animations */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.animate {
    animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

/* ═══════════════════════════════════════════════════ */
/* Investor Opt-in Modal */
/* ═══════════════════════════════════════════════════ */
.investor-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.investor-modal-overlay.active {
    display: flex;
    opacity: 1;
}

.investor-modal {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.investor-modal-overlay.active .investor-modal {
    transform: scale(1);
}

.investor-modal h2 {
    margin: 0 0 20px 0;
    font-size: 1.8rem;
    color: var(--text);
}

.investor-modal p {
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 16px;
}

.investor-modal .warning {
    background: rgba(255, 152, 0, 0.1);
    border: 1px solid rgba(255, 152, 0, 0.3);
    border-radius: 8px;
    padding: 16px;
    margin: 24px 0;
    color: #FFA500;
    font-size: 0.9rem;
}

.investor-modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
}

.investor-modal-actions button {
    flex: 1;
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.investor-modal-actions .btn-accept {
    background: var(--current-primary, var(--accent));
    color: #000;
}

.investor-modal-actions .btn-accept:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--current-primary, var(--accent));
}

.investor-modal-actions .btn-decline {
    background: var(--elevated);
    border: 1px solid var(--border);
    color: var(--text);
}

.investor-modal-actions .btn-decline:hover {
    background: var(--border);
}

/* Admin Panel */
/* ═══════════════════════════════════════════════════ */
.admin-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 360px;
    height: 100vh;
    background: var(--card);
    border-left: 1px solid var(--border);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
}

.admin-panel.open {
    transform: translateX(0);
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border);
    background: var(--elevated);
}

.admin-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

.admin-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.admin-close:hover {
    background: var(--border);
    color: var(--text);
}

.admin-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}

.admin-tab {
    flex: 1;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

.admin-tab:hover {
    color: var(--text);
    background: var(--elevated);
}

.admin-tab.active {
    color: var(--current-primary, var(--accent));
    border-bottom-color: var(--current-primary, var(--accent));
}

.admin-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.admin-content.hidden {
    display: none;
}

.admin-section h4 {
    margin: 0 0 20px 0;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-dim);
}

.admin-control {
    margin-bottom: 20px;
}

.admin-control label {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 8px;
    color: var(--text-muted);
}

.admin-control label span {
    color: var(--current-primary, var(--accent));
    font-weight: 600;
}

.admin-control input[type="range"] {
    width: 100%;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
}

.admin-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--current-primary, var(--accent));
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s;
}

.admin-control input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.admin-control input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--current-primary, var(--accent));
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: transform 0.2s;
}

.admin-control input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.2);
}

.color-group {
    margin-bottom: 20px;
    padding: 12px;
    background: var(--elevated);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.color-group h5 {
    margin: 0 0 8px 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}

.color-group input[type="color"] {
    width: 100%;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    background: var(--bg);
}

.admin-btn {
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    background: var(--elevated);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.admin-btn:hover {
    background: var(--border);
    border-color: var(--current-primary, var(--accent));
    color: var(--current-primary, var(--accent));
}

/* Admin Trigger (hidden in footer) */
.admin-trigger {
    position: absolute;
    width: 20px;
    height: 20px;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

.admin-trigger:hover {
    opacity: 0.1;
}

.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.2s;
}

.delay-3 {
    animation-delay: 0.3s;
}