/* ============================================
   🍮 PUDDING-INSPIRED MODERN THEME
   Editorial, Immersive, Typographic
   ============================================ */

:root {
    --bg-dark: #121212;
    --bg-card: #1e1e1e;
    --text-primary: #ededed;
    --text-secondary: #a0a0a0;
    --accent: #ff6600;
    /* Keeping the Mengxi orange but as an accent */
    --accent-soft: rgba(255, 102, 0, 0.1);
    --font-serif: 'EB Garamond', serif;
    --font-sans: 'Inter', -apple-system, sans-serif;
}

body.theme-knowledge {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    font-size: 18px;
    /* Larger base size like Pudding */
    transition: background-color 0.3s ease;
}

/* Container Refinement */
.u-container {
    max-width: 800px;
    /* More centered, focused reading */
    margin: 4rem auto;
    padding: 0 20px;
    background-color: transparent !important;
}

/* Header Overhaul */
.hn-header {
    background: transparent !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem 0 !important;
}

.hn-header-content {
    justify-content: center;
    flex-direction: column;
    gap: 1rem;
}

.hn-logo {
    display: none !important;
    /* Minimalist approach */
}

.hn-title {
    font-family: var(--font-serif);
    font-size: 2.5rem !important;
    color: var(--text-primary) !important;
    text-align: center;
    margin: 0 !important;
}

.hn-nav {
    justify-content: center;
}

.hn-nav a {
    color: var(--text-secondary) !important;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: color 0.2s;
}

.hn-nav a:hover {
    color: var(--accent) !important;
    text-decoration: none !important;
}

/* List Optimization */
.hn-list {
    margin-top: 4rem;
}

.hn-item-container {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 12px;
    padding: 2rem !important;
    margin-bottom: 1.5rem !important;
    transition: transform 0.2s, border-color 0.2s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.hn-item-container:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
}

.hn-rank {
    display: none !important;
    /* Non-hierarchical feel */
}

.votearrow {
    display: none !important;
}

.hn-title a {
    font-family: var(--font-serif);
    font-size: 1.5rem !important;
    font-weight: 500 !important;
    color: var(--text-primary) !important;
    line-height: 1.2;
}

.hn-meta {
    padding-left: 0 !important;
    margin-top: 0.8rem;
    font-size: 0.85rem !important;
    color: var(--text-secondary) !important;
}

/* Search Bar Transformation */
.hn-search-input {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: white !important;
    padding: 1.2rem !important;
    border-radius: 50px !important;
    font-family: var(--font-sans) !important;
    font-size: 1rem !important;
    transition: all 0.3s;
}

.hn-search-input:focus {
    outline: none;
    border-color: var(--accent) !important;
    background: rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 0 20px rgba(255, 102, 0, 0.15);
}

/* Typography for Article Content */
article.prose {
    background: transparent !important;
    padding: 0 !important;
    margin-top: 4rem !important;
    border: none !important;
}

article h1 {
    font-family: var(--font-serif);
    font-size: 3.5rem !important;
    line-height: 1.1;
    margin-bottom: 2rem !important;
}

article .meta-header {
    border-bottom-color: rgba(255, 255, 255, 0.1) !important;
    margin-bottom: 3rem !important;
}

/* Animation for Scrollytelling Feel */
.reveal-item {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal-item.active {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   🌌 NEXUS NODE & PORTAL STYLES
   ============================================ */

.nexus-node-container {
    position: fixed;
    width: 60px;
    height: 60px;
    z-index: 1000;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

.nexus-pulse {
    width: 12px;
    height: 12px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 15px var(--accent);
    animation: nexusPulse 2s infinite ease-in-out;
}

.nexus-label {
    margin-top: 8px;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--accent);
    background: rgba(0, 0, 0, 0.6);
    padding: 2px 6px;
    border: 1px solid var(--accent);
    white-space: nowrap;
    opacity: 0.7;
}

@keyframes nexusPulse {
    0% {
        transform: scale(1);
        opacity: 1;
        box-shadow: 0 0 5px var(--accent);
    }

    50% {
        transform: scale(1.5);
        opacity: 0.5;
        box-shadow: 0 0 20px var(--accent);
    }

    100% {
        transform: scale(1);
        opacity: 1;
        box-shadow: 0 0 5px var(--accent);
    }
}

.nexus-portal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nexus-portal-content {
    background: #151515;
    border: 1px solid var(--accent);
    width: 90%;
    max-width: 600px;
    padding: 3rem;
    position: relative;
    box-shadow: 0 0 50px rgba(255, 102, 0, 0.2);
}

.nexus-portal-title {
    font-family: var(--font-serif);
    font-size: 2rem;
    color: var(--accent);
    margin: 0;
}

.nexus-close-btn {
    background: transparent;
    border: 1px solid var(--text-secondary);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 4px 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.nexus-close-btn:hover {
    color: white;
    border-color: white;
}

.nexus-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.nexus-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    text-decoration: none !important;
    transition: all 0.3s;
}

.nexus-item:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    transform: translateX(5px);
}

.nexus-item-emoji {
    font-size: 1.5rem;
}

.nexus-item-text {
    font-family: var(--font-sans);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.nexus-coordinates {
    margin-top: 2rem;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-secondary);
    opacity: 0.5;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
}