/* ==========================================================================
   mujun.wiki — Memphis Design Knowledge Arcade
   Color Palette: #1A1A20, #3A3A40, #F05078, #3080F0, #F0C020, #30D090, #FAFAFE, #E8E8EC
   Fonts: Barlow Condensed (display), Inter (body), Space Mono (tags)
   ========================================================================== */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    color: #3A3A40;
    background: #FAFAFE;
    overflow-x: hidden;
    line-height: 1.8;
    font-size: clamp(0.9rem, 1.1vw, 1rem);
}

/* --- Memphis Background Shapes --- */
.memphis-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.memphis-shape {
    position: absolute;
    opacity: 0.15;
    animation: memphis-float 20s infinite ease-in-out;
}

.memphis-shape.circle {
    border-radius: 50%;
    border: 4px solid;
}

.memphis-shape.triangle {
    width: 0;
    height: 0;
    border-left: 25px solid transparent;
    border-right: 25px solid transparent;
    border-bottom: 43px solid;
    background: none !important;
}

.memphis-shape.zigzag {
    width: 80px;
    height: 4px;
    background: none !important;
    border-bottom: 4px dotted;
}

.memphis-shape.squiggle {
    width: 60px;
    height: 30px;
    border: 4px solid;
    border-color: transparent transparent currentColor transparent;
    border-radius: 0 0 50% 50%;
}

.memphis-shape.cross {
    width: 4px;
    height: 30px;
    position: absolute;
}

.memphis-shape.cross::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 4px;
    background: inherit;
    top: 13px;
    left: -13px;
}

.memphis-shape.dot {
    border-radius: 50%;
    width: 12px;
    height: 12px;
}

@keyframes memphis-float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-20px) rotate(5deg); }
    50% { transform: translateY(-10px) rotate(-3deg); }
    75% { transform: translateY(-25px) rotate(7deg); }
}

/* --- SVG Curve Connectors --- */
.curve-connectors {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.curve-connectors.visible {
    opacity: 1;
}

.curve-connector {
    fill: none;
    stroke-width: 2;
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    animation: draw-curve 2s ease forwards;
}

@keyframes draw-curve {
    to { stroke-dashoffset: 0; }
}

@keyframes oscillate-curve {
    0%, 100% { stroke-dashoffset: 0; }
    50% { stroke-dashoffset: 8; }
}

/* --- HUD Panel Base --- */
.hud-panel {
    position: fixed;
    background: rgba(250, 250, 254, 0.95);
    backdrop-filter: blur(8px);
    z-index: 10;
    border: 3px solid;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.6s ease;
}

/* --- Top Bar --- */
.top-bar {
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    border-color: #F05078;
    border-top: none;
    border-left: none;
    border-right: none;
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 24px;
    transform: translateY(-100%);
}

.top-bar.visible {
    transform: translateY(0);
}

.logo {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: #1A1A20;
    letter-spacing: 2px;
    white-space: nowrap;
    flex-shrink: 0;
}

.logo-dot {
    color: #F05078;
}

.categories {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
}

.cat-btn {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    padding: 6px 14px;
    border: 2px solid #E8E8EC;
    border-radius: 20px;
    background: transparent;
    color: #3A3A40;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.cat-btn:hover {
    border-color: #F05078;
    color: #F05078;
}

.cat-btn.active {
    background: #F05078;
    border-color: #F05078;
    color: #FAFAFE;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #E8E8EC;
    border-radius: 20px;
    padding: 6px 14px;
    margin-left: auto;
    flex-shrink: 0;
}

.search-icon {
    flex-shrink: 0;
}

.search-box input {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    border: none;
    background: transparent;
    outline: none;
    color: #1A1A20;
    width: 140px;
}

.search-box input::placeholder {
    color: #3A3A40;
    opacity: 0.6;
}

/* --- Left Panel --- */
.left-panel {
    top: 64px;
    left: 0;
    bottom: 40px;
    width: 220px;
    border-color: #30D090;
    border-top: none;
    border-bottom: none;
    border-left: none;
    padding: 20px 16px;
    overflow-y: auto;
    transform: translateX(-100%);
}

.left-panel.visible {
    transform: translateX(0);
}

.panel-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    color: #1A1A20;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 12px;
}

.nav-list {
    list-style: none;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #3A3A40;
    transition: background 0.2s ease, color 0.2s ease;
}

.nav-item:hover {
    background: rgba(48, 208, 144, 0.1);
}

.nav-item.active {
    background: rgba(48, 208, 144, 0.15);
    color: #1A1A20;
    font-weight: 400;
}

.nav-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.nav-separator {
    height: 2px;
    background: #E8E8EC;
    margin: 16px 0;
}

.topic-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.topic-tag {
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    padding: 4px 10px;
    border: 2px solid #E8E8EC;
    border-radius: 14px;
    cursor: pointer;
    color: #F05078;
    transition: all 0.2s ease;
}

.topic-tag:hover {
    border-color: #F05078;
    background: rgba(240, 80, 120, 0.08);
}

/* --- Right Panel --- */
.right-panel {
    top: 64px;
    right: 0;
    bottom: 40px;
    width: 220px;
    border-color: #3080F0;
    border-top: none;
    border-bottom: none;
    border-right: none;
    padding: 20px 16px;
    overflow-y: auto;
    transform: translateX(100%);
}

.right-panel.visible {
    transform: translateX(0);
}

.related-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.related-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.related-item:hover {
    background: rgba(48, 128, 240, 0.1);
}

.related-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.related-name {
    font-size: 0.85rem;
    color: #3A3A40;
}

.connections-visual {
    margin: 4px 0;
}

.mini-graph {
    width: 100%;
    height: auto;
}

.stats-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-value {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 1.4rem;
    color: #1A1A20;
}

.stat-label {
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    color: #3A3A40;
    text-transform: uppercase;
}

/* --- Bottom Bar --- */
.bottom-bar {
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    border-color: #F0C020;
    border-bottom: none;
    border-left: none;
    border-right: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    font-size: 0.75rem;
    transform: translateY(100%);
}

.bottom-bar.visible {
    transform: translateY(0);
}

.status-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #30D090;
}

.status-dot.pulse {
    animation: status-pulse 2s infinite;
}

@keyframes status-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(48, 208, 144, 0.5); }
    50% { box-shadow: 0 0 8px 4px rgba(48, 208, 144, 0.2); }
}

.status-text {
    font-family: 'Space Mono', monospace;
    color: #3A3A40;
}

.status-center {
    display: flex;
    align-items: center;
    gap: 6px;
}

.breadcrumb {
    font-family: 'Space Mono', monospace;
    color: #3A3A40;
    cursor: pointer;
    transition: color 0.2s ease;
}

.breadcrumb:hover {
    color: #F05078;
}

.breadcrumb.active {
    color: #F05078;
}

.breadcrumb-sep {
    color: #E8E8EC;
}

.status-right {
    display: flex;
    align-items: center;
}

/* --- Center Content --- */
.center-content {
    margin: 64px 220px 40px 220px;
    padding: 24px 32px;
    position: relative;
    z-index: 5;
    min-height: calc(100vh - 104px);
}

/* --- Hero Section --- */
.hero-section {
    height: calc(100vh - 128px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    text-align: center;
}

.hero-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.hero-shape {
    position: absolute;
    animation: hero-rotate 12s infinite linear;
}

@keyframes hero-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.hero-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 6rem);
    color: #1A1A20;
    letter-spacing: 6px;
    position: relative;
    z-index: 1;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.hero-title.visible {
    opacity: 1;
    transform: translateY(0);
}

.hero-dot {
    color: #F05078;
}

.hero-subtitle {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 2vw, 1.4rem);
    color: #3A3A40;
    margin-top: 12px;
    position: relative;
    z-index: 1;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease 0.3s, transform 0.8s ease 0.3s;
}

.hero-subtitle.visible {
    opacity: 1;
    transform: translateY(0);
}

.hero-tagline {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    position: relative;
    z-index: 1;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease 0.6s, transform 0.8s ease 0.6s;
}

.hero-tagline.visible {
    opacity: 1;
    transform: translateY(0);
}

.tag-label {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    padding: 6px 16px;
    border: 2px solid #E8E8EC;
    border-radius: 20px;
    color: #3A3A40;
    transition: all 0.3s ease;
}

.tag-label:nth-child(1) { transition-delay: 0.7s; }
.tag-label:nth-child(2) { transition-delay: 0.85s; }
.tag-label:nth-child(3) { transition-delay: 1s; }

.tag-label:hover {
    border-color: #F05078;
    color: #F05078;
}

/* --- Content Sections --- */
.content-section {
    margin-bottom: 48px;
}

.section-heading {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    color: #1A1A20;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.heading-accent {
    width: 6px;
    height: 32px;
    border-radius: 3px;
    flex-shrink: 0;
}

/* --- Entry Cards Grid --- */
.entries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.entry-card {
    background: #FAFAFE;
    border: 3px solid #E8E8EC;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    cursor: pointer;
    position: relative;
}

.entry-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(26, 26, 32, 0.1);
}

.entry-card.featured {
    animation: pulse-attention 2s infinite;
}

@keyframes pulse-attention {
    0%, 100% { box-shadow: 0 0 0 0 rgba(240, 80, 120, 0.0); }
    50% { box-shadow: 0 0 16px rgba(240, 80, 120, 0.2); }
}

.entry-card:hover.featured {
    animation: none;
    box-shadow: 0 8px 24px rgba(26, 26, 32, 0.12);
}

.card-accent {
    height: 6px;
    width: 100%;
}

.card-body {
    padding: 20px;
}

.card-tag {
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    color: #F05078;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 1.3rem;
    color: #1A1A20;
    margin: 8px 0;
}

.card-excerpt {
    font-size: 0.9rem;
    color: #3A3A40;
    line-height: 1.7;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 2px solid #E8E8EC;
}

.meta-date, .meta-links {
    font-family: 'Space Mono', monospace;
    font-size: 0.65rem;
    color: #3A3A40;
    opacity: 0.7;
}

/* --- Entries List --- */
.entries-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.list-entry {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
    border: 2px solid transparent;
}

.list-entry:hover {
    background: rgba(48, 128, 240, 0.06);
    border-color: #E8E8EC;
}

.list-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.list-body {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.list-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 500;
    font-size: 1rem;
    color: #1A1A20;
}

.list-tag {
    font-family: 'Space Mono', monospace;
    font-size: 0.65rem;
    color: #F05078;
    padding: 2px 8px;
    border: 1px solid #E8E8EC;
    border-radius: 10px;
}

.list-date {
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    color: #3A3A40;
    opacity: 0.6;
    flex-shrink: 0;
}

/* --- Archive Grid --- */
.archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}

.archive-cell {
    background: #FAFAFE;
    border: 3px solid #E8E8EC;
    border-radius: 12px;
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.archive-cell:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(26, 26, 32, 0.08);
}

.archive-cell[data-category="design"]:hover { border-color: #F05078; }
.archive-cell[data-category="philosophy"]:hover { border-color: #30D090; }
.archive-cell[data-category="technology"]:hover { border-color: #3080F0; }
.archive-cell[data-category="culture"]:hover { border-color: #F0C020; }
.archive-cell[data-category="science"]:hover { border-color: #30D090; }

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

.archive-count {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 2.4rem;
    color: #1A1A20;
    display: block;
    line-height: 1;
}

.archive-label {
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    color: #3A3A40;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- Card hide/show for category filter --- */
.entry-card.hidden,
.list-entry.hidden {
    display: none;
}

/* --- Scrollbar --- */
.left-panel::-webkit-scrollbar,
.right-panel::-webkit-scrollbar,
.center-content::-webkit-scrollbar {
    width: 4px;
}

.left-panel::-webkit-scrollbar-thumb,
.right-panel::-webkit-scrollbar-thumb,
.center-content::-webkit-scrollbar-thumb {
    background: #E8E8EC;
    border-radius: 2px;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .left-panel {
        width: 180px;
    }
    .right-panel {
        width: 180px;
    }
    .center-content {
        margin-left: 180px;
        margin-right: 180px;
    }
}

@media (max-width: 768px) {
    .left-panel,
    .right-panel {
        display: none;
    }
    .center-content {
        margin-left: 0;
        margin-right: 0;
        padding: 16px;
    }
    .top-bar {
        padding: 0 12px;
        gap: 12px;
    }
    .categories {
        display: none;
    }
    .entries-grid {
        grid-template-columns: 1fr;
    }
    .archive-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .hero-title {
        font-size: clamp(2.2rem, 10vw, 4rem);
    }
}

/* --- Selection Color --- */
::selection {
    background: rgba(240, 80, 120, 0.2);
    color: #1A1A20;
}
