:root {
    --bg-color: #000000;
    --text-color: #ffd400;
}

body.light-mode {
    --bg-color: #ffd400;
    --text-color: #000000;
}

body.dark-mode {
    --text-color: #ffd400;
}

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

html {
    height: 100%;
    overscroll-behavior: none;
    -webkit-text-size-adjust: none;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
    height: 100vh;
    /* Fallback */
    height: 100dvh;
    width: 100vw;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: fixed;
    /* Lock body scroll */
    top: 0;
    left: 0;
    touch-action: none;
    /* Disable default touch actions */
    -webkit-touch-callout: none;
    /* Prevent scrollbars */
}

/* Background Effect */
body::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(30, 30, 30, 1) 0%, #000 70%);
    opacity: 0.4;
    z-index: -1;
    animation: rotateBg 60s linear infinite;
}

@keyframes rotateBg {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Main Visual handled by #canvas-container */
#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 1;
}

/* Social Icons */
.social-icons {
    position: absolute;
    top: 2rem;
    right: 2rem;
    display: flex;
    gap: 1.5rem;
    z-index: 10;
}

.social-icons a {
    color: var(--text-color);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid var(--text-color);
    backdrop-filter: blur(5px);
}

.social-icons a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.social-icons svg {
    width: 20px;
    height: 20px;
}

/* SOTA Link Styles */
a {
    color: #ffd400;
    text-decoration: none;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-bottom: 1px solid rgba(255, 212, 0, 0.3);
    text-shadow: 0 0 8px rgba(255, 212, 0, 0.2);
}

a:hover {
    color: #fff;
    border-bottom-color: #ffd400;
    text-shadow: 0 0 12px rgba(255, 212, 0, 0.6);
}

/* Light Mode Link Styles */
body.light-mode a {
    color: #000;
    border-bottom-color: rgba(0, 0, 0, 0.3);
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
}

body.light-mode a:hover {
    color: #333;
    border-bottom-color: #000;
    text-shadow: 0 0 12px rgba(0, 0, 0, 0.3);
}

/* Page Network Specific Styles */
/* Page Network Specific Styles */
.auto-label {
    position: fixed;
    pointer-events: none;
    z-index: 90;
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
    white-space: pre-line;
    line-height: 1.1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    opacity: 0;

    /* Instant IN, 1s Fade OUT - Base Transition */
    transition: opacity 1s ease-in-out, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* DEFAULT (Dark Mode): Black Text, Yellow Border */
    color: #000;
    text-shadow:
        -1.5px -1.5px 0 #ffd400,
        1.5px -1.5px 0 #ffd400,
        -1.5px 1.5px 0 #ffd400,
        1.5px 1.5px 0 #ffd400,
        0px 2px 4px rgba(255, 212, 0, 0.3);
}

/* Light Mode Override: Yellow Text, Black Border (Original) */
body.light-mode .auto-label {
    color: #ffd400;
    text-shadow:
        -1.5px -1.5px 0 #000,
        1.5px -1.5px 0 #000,
        -1.5px 1.5px 0 #000,
        1.5px 1.5px 0 #000,
        0px 2px 4px rgba(0, 0, 0, 0.5);
}

/* When active (handled by JS setting opacity: 1), we want instant appearance */
.auto-label.visible {
    transition: opacity 0s, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Icon Label Styling for Contact Nodes */
.auto-label.icon-label {
    padding: 8px;
}

.auto-label.icon-label svg {
    display: block;
    filter: drop-shadow(0 0 3px rgba(255, 212, 0, 0.6));
}

body.light-mode .auto-label.icon-label svg {
    filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.6));
}

.floating-label {
    display: none;
}

/* Hide legacy label */

.subpage-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 100px;
    overflow-y: auto;
}

.subpage-overlay.active {
    opacity: 1;
    visibility: visible;
}

.content-container {
    width: 90%;
    max-width: 800px;
    color: #fff;
    font-size: 1.1rem;
    line-height: 1.6;
    padding-bottom: 50px;
}

.content-container h1 {
    color: #ffd400;
    margin-bottom: 2rem;
    font-size: clamp(1.8rem, 4vw, 3rem);
    border-bottom: 2px solid #ffd400;
    padding-bottom: 1rem;
}



/* SOTA Navigation */
.sota-nav-container {
    position: fixed;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* The Trigger Button (FAB) */
.nav-trigger {
    width: 64px;
    height: 64px;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 212, 0, 0.3);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.nav-trigger:hover {
    transform: scale(1.05);
    /* Gently grow */
    border-color: rgba(255, 212, 0, 0.8);
    box-shadow: 0 0 25px rgba(255, 212, 0, 0.2);
}

/* Hamburger Icon */
.icon-hamburger {
    position: absolute;
    width: 24px;
    height: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s ease;
}

.icon-hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: #ffd400;
    transition: all 0.3s ease;
}

/* Menu Open State (Hamburger -> X) */
.sota-nav-container.menu-open .icon-hamburger span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.sota-nav-container.menu-open .icon-hamburger span:nth-child(2) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mini Network Icon (Back Button) */
.icon-back-network {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transform: scale(0.5) rotate(-90deg);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: none;
}

.sota-nav-container.mode-subpage .nav-trigger {
    background: #ffd400;
    border-color: #ffd400;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    background: #ffd400;
    box-shadow: 0 0 5px rgba(255, 212, 0, 0.5);
    animation: floatBubble 2s infinite ease-in-out;
}

.sota-nav-container.mode-subpage .bubble {
    background: #000;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

.b1 {
    width: 11px;
    height: 11px;
    top: 19px;
    left: 27px;
    animation-delay: 0s;
}

.b2 {
    width: 8px;
    height: 8px;
    top: 38px;
    left: 17px;
    animation-delay: 0.3s;
}

.b3 {
    width: 7px;
    height: 7px;
    top: 34px;
    left: 41px;
    animation-delay: 0.6s;
}

@keyframes floatBubble {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-3px);
    }
}

/* Subpage Mode: Switch Icons */
.sota-nav-container.mode-subpage .icon-hamburger {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}

.sota-nav-container.mode-subpage .icon-back-network {
    opacity: 1;
    transform: scale(1) rotate(0);
}

/* Navigation Menu (The Pop-up List) */
.nav-menu {
    position: absolute;
    bottom: 80px;
    /* Start above the trigger */
    background: rgba(10, 10, 10, 0.85);
    /* Darker glass */
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 160px;

    /* Animation Initial State */
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.9);
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    transform-origin: bottom center;
}

.sota-nav-container.menu-open .nav-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.nav-menu button {
    background: transparent;
    border: none;
    color: #aeaeae;
    padding: 12px 20px;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    width: 100%;
}

.nav-menu button:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.nav-menu button.active {
    color: #000;
    background: #ffd400;
    box-shadow: 0 0 15px rgba(255, 212, 0, 0.3);
    font-weight: 700;
}

.loader {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100px;
    color: #ffd400;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.loader::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #ffd400;
    border-top-color: transparent;
    border-radius: 50%;
    margin-left: 1rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   RESPONSIVE DESIGN - MOBILE FIRST
   ============================================ */

/* Mobile Devices (320px - 767px) */
@media (max-width: 767px) {

    /* Social Icons - Move to bottom and enlarge for touch */
    .social-icons {
        top: auto;
        bottom: 5.5rem;
        right: 1rem;
        gap: 1rem;
    }

    .social-icons a {
        width: 48px;
        height: 48px;
    }

    .social-icons svg {
        width: 24px;
        height: 24px;
    }

    /* Filter Bar - Horizontal scroll on mobile */
    .filter-bar {
        bottom: 1rem;
        left: 1rem;
        right: 1rem;
        transform: none;
        max-width: calc(100vw - 2rem);
        overflow-x: auto;
        overflow-y: hidden;
        justify-content: flex-start;
        padding: 10px 16px;
        gap: 0.5rem;
        scrollbar-width: none;
        /* Firefox */
        -ms-overflow-style: none;
        /* IE/Edge */
    }

    .filter-bar::-webkit-scrollbar {
        display: none;
        /* Chrome/Safari */
    }

    .filter-bar button {
        flex-shrink: 0;
        font-size: 0.75rem;
        padding: 10px 16px;
        white-space: nowrap;
    }

    /* Return Logo - Ensure touch-friendly */
    .return-logo {
        top: 1rem;
        left: 1rem;
        width: 48px;
        height: 48px;
    }

    /* Subpage Overlay - Reduce top padding */
    .subpage-overlay {
        padding-top: 80px;
    }

    /* Content Container - More width on mobile */
    .content-container {
        width: 95%;
        font-size: 1rem;
        line-height: 1.7;
        padding-bottom: 30px;
    }

    .content-container h1 {
        margin-bottom: 1.5rem;
        padding-bottom: 0.75rem;
    }

    /* Floating Label - Smaller on mobile */
    .floating-label {
        font-size: 0.75rem;
        padding: 6px 12px;
        max-width: 200px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* Tablet Devices (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {

    /* Social Icons - Slightly larger */
    .social-icons {
        gap: 1.25rem;
    }

    .social-icons a {
        width: 44px;
        height: 44px;
    }

    /* Filter Bar - Optimized spacing */
    .filter-bar {
        gap: 0.75rem;
        padding: 10px 20px;
    }

    .filter-bar button {
        min-width: 48px;
        min-height: 48px;
    }

    /* Content Container */
    .content-container {
        width: 85%;
        font-size: 1.05rem;
    }
}

/* Landscape Mobile (only when really short) */
@media (max-height: 500px) and (orientation: landscape) {
    .filter-bar {
        bottom: 0.5rem;
        padding: 8px 12px;
    }

    .filter-bar button {
        font-size: 0.7rem;
        padding: 8px 12px;
    }

    .social-icons {
        bottom: 4rem;
        gap: 0.75rem;
    }

    .social-icons a {
        width: 40px;
        height: 40px;
    }

    .return-logo {
        top: 0.5rem;
        left: 0.5rem;
        width: 40px;
        height: 40px;
    }

    .subpage-overlay {
        padding-top: 60px;
    }
}