:root {
    /* PALETTE: THE BIO-DIGITAL VOID */
    --void: #050505;
    --chrome: #E0E0E0;
    --biolum: #F0F0F0;
    --glitch-red: #FF4433;
    --glass-border: rgba(255, 255, 255, 0.08);

    /* TYPOGRAPHY */
    --font-human: 'Inter', sans-serif;
    --font-machine: 'Space Grotesk', sans-serif;
}

* {
    box-sizing: border-box;
    /* Custom cursor handling via canvas interaction */
}

/* CUSTOM CURSOR */
#sovereign-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 24px;
    height: 24px;
    border: 1px solid var(--chroma);
    /* Fallback or new var */
    border-color: var(--glitch-red);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: exclusion;
    transition: width 0.2s, height 0.2s, background-color 0.2s;
}

/* Hover State for Interactables (requires JS class toggle 'active') */
#sovereign-cursor.active {
    width: 10px;
    height: 10px;
    background-color: var(--glitch-red);
    border: none;
}

/* BRAND IDENTIFIER */
#sovereign-logo {
    position: fixed;
    top: 40px;
    left: 40px;
    width: 48px;
    height: 48px;
    z-index: 999;
    pointer-events: auto;
    /* Optional: Add hover glow */
    transition: filter 0.3s ease;
}

#sovereign-logo:hover {
    filter: drop-shadow(0 0 8px rgba(255, 68, 51, 0.6));
}

/* THEME TOGGLE */
#theme-toggle {
    position: fixed;
    top: 48px;
    /* Aligned with Logo (Center 64px) */
    right: 40px;
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid transparent;
    /* Hidden by default */
    border-radius: 50%;
    /* Or zero if we want to match valid rects */
    cursor: pointer;
    z-index: 1000;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--chrome);
    opacity: 0.5;
    /* Less obvious */
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease, opacity 0.3s ease, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: auto;
}

#theme-toggle:hover {
    background: rgba(255, 68, 51, 0.05);
    border-color: var(--glitch-red);
    color: var(--glitch-red);
    opacity: 1;
}

/* LIGHT MODE OVERRIDES */
body.light-mode {
    --void: #FFFFFF;
    --chrome: #111111;
    --biolum: #222222;
    --glass-border: rgba(0, 0, 0, 0.1);
}

/* Light Mode Card Overrides */
body.light-mode .doctrine-card {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
}

body.light-mode .doctrine-card:hover {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
}

body.light-mode .card-text {
    color: #444444;
}

body.light-mode .card-index {
    color: #888888;
}

/* Fix cursor color inversion in light mode */
body.light-mode #sovereign-cursor {
    mix-blend-mode: normal;
}

/* Ensure canvas dots are dark in light mode logic (handled in JS), 
   but we can also force text colors here just in case */

body,
html {
    margin: 0;
    padding: 0;
    background-color: var(--void);
    color: var(--chrome);
    font-family: var(--font-human);
    font-weight: 200;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    height: 100%;
    transition: background-color 0.6s cubic-bezier(0.16, 1, 0.3, 1), color 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* KERNEL CANVAS (The Tensor Membrane) */
#shadow-kernel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
}

/* UI LAYER */
#sovereign-root {
    position: relative;
    z-index: 10;
    pointer-events: none;
    /* Let clicks pass to the membrane */
}

/* HERO SECTION */
#monolith-hero {
    height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    mix-blend-mode: exclusion;
    /* Interacts with the membrane */
}

.manifesto-text {
    font-family: var(--font-machine);
    font-size: 6vw;
    /* Massive Scale */
    font-weight: 300;
    letter-spacing: -0.06em;
    line-height: 0.85;
    color: var(--biolum);
    margin: 0;
    text-transform: uppercase;
}

.mark-container {
    margin-top: 4vh;
    border-top: 1px solid var(--biolum);
    padding-top: 1vh;
}

.the-mark {
    font-family: var(--font-machine);
    font-size: 12px;
    letter-spacing: 1em;
    color: var(--biolum);
    opacity: 0.8;
}

.accent-dot {
    color: var(--glitch-red);
}

/* DOCTRINE SECTION */
#doctrine-section {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10vw;
}

.doctrine-copy {
    background: rgba(5, 5, 5, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    padding: 4rem;
    max-width: 800px;
    pointer-events: auto;
    /* Enable interaction here */
}

.doctrine-title {
    font-family: var(--font-machine);
    font-size: 2rem;
    color: var(--glitch-red);
    margin-bottom: 2rem;
    letter-spacing: 0.1em;
}

.doctrine-text {
    font-size: 1.2rem;
    line-height: 1.6;
    color: #888;
}

/* TELEMETRY FOOTER */
#telemetry-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    font-family: var(--font-machine);
    font-size: 10px;
    letter-spacing: 0.1em;
    color: #444;
    text-transform: uppercase;
    pointer-events: auto;
}

.telemetry-stream span {
    margin-right: 30px;
}

/* Access Point */
.access-point input {
    background: transparent;
    border: none;
    border-bottom: 1px solid #333;
    color: var(--biolum);
    font-family: var(--font-machine);
    font-size: 10px;
    text-align: right;
    outline: none;
    width: 150px;
}


/* DOCTRINE SECTION REFACTOR */
#doctrine-section {
    min-height: auto;
    /* Remove 100vh constraint */
    padding: 15vh 5vw;
    display: block;
    /* Default block flow */
    position: relative;
    z-index: 2;
}

.doctrine-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* THESIS BLOCK */
.thesis-block {
    text-align: center;
    margin-bottom: 10vh;
    /* Reduced from 15vh */
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.thesis-text {
    font-size: 1.5rem;
    /* Larger introduction */
    line-height: 1.6;
    color: var(--chrome);
    /* Brighter */
    margin-bottom: 3rem;
    font-weight: 300;
    transition: color 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes glitch-pulse {
    0% {
        transform: translate(0);
        opacity: 1;
    }

    92% {
        transform: translate(0);
        opacity: 1;
    }

    93% {
        transform: translate(-2px, 1px);
        opacity: 0.8;
    }

    94% {
        transform: translate(2px, -1px);
        opacity: 1;
    }

    95% {
        transform: translate(-1px, 2px);
        opacity: 0.9;
    }

    96% {
        transform: translate(0);
        opacity: 1;
    }

    100% {
        transform: translate(0);
        opacity: 1;
    }
}

.warning-label {
    display: inline-block;
    font-family: var(--font-machine);
    font-size: 1rem;
    color: var(--void);
    background-color: var(--glitch-red);
    padding: 0.5rem 1.5rem;
    letter-spacing: 0.2em;
    font-weight: 700;
    margin-bottom: 1rem;
    box-shadow: 0 0 15px rgba(255, 68, 51, 0.4);
    animation: glitch-pulse 4s infinite;
}

.thesis-sub {
    font-family: var(--font-machine);
    font-size: 0.8rem;
    color: var(--glitch-red);
    opacity: 0.8;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* SECTION HEADER */
.section-header {
    font-family: var(--font-machine);
    font-size: 1rem;
    color: #888;
    /* Slightly brighter */
    letter-spacing: 0.5em;
    text-align: center;
    margin-bottom: 5rem;
    position: relative;
}

.section-header::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 1px;
    background-color: var(--glitch-red);
}

/* DOCTRINE GRID */
.doctrine-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .doctrine-grid {
        grid-template-columns: 1fr;
    }

    .manifesto-text {
        font-size: 12vw;
        /* Adjust Hero for mobile */
    }
}

.doctrine-card {
    background: rgba(10, 10, 10, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    padding: 3rem;
    position: relative;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    /* Snappier */
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    /* Depth */
    pointer-events: auto;
    /* Restores Interaction */
}

.doctrine-card:hover {
    border-color: var(--biolum);
    /* Chrome White Glow */
    background: rgba(25, 25, 25, 0.8);
    transform: translateY(-5px);
    box-shadow: 0 0 15px rgba(224, 224, 224, 0.1);
    /* Chrome Sheen */
}

.card-index {
    font-family: var(--font-machine);
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 1.5rem;
    letter-spacing: 0.1em;
}

.doctrine-card:hover .card-index {
    color: var(--glitch-red);
}

.card-title {
    font-family: var(--font-machine);
    font-size: 1.2rem;
    color: var(--biolum);
    margin-bottom: 1.5rem;
    letter-spacing: 0.1em;
    font-weight: 400;
}

.card-text {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #CCCCCC;
    /* Increased Legibility */
    text-align: justify;
}