:root {
    --bg: #060709;
    --card-bg: rgba(13, 15, 20, 0.7);
    --border: rgba(255, 255, 255, 0.08);
    
    /* MÀU ĐẶC TRƯNG CÁC NÚT MẠNG */
    --c-oxytocin: #ff2a55;
    --c-doremon: #00e5ff;
    --c-geng: #e5b869;
    --c-engine: #10b981;
    --c-mind: #a855f7;

    --text: #94a3b8;
    --text-bright: #f8fafc;
    --font-main: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-main);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding-bottom: 60px;
    overflow-x: hidden;
}

/* KHUNG 3D MẠNG TINH THỂ */
.lattice-stage {
    width: 100%;
    max-width: 900px;
    height: 380px;
    position: relative;
    margin-top: 15px;
    cursor: grab;
}

.lattice-stage:active {
    cursor: grabbing;
}

#latticeCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

.lattice-hint {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: #475569;
    letter-spacing: 0.5px;
    pointer-events: none;
    white-space: nowrap;
}

/* KHUNG NỘI DUNG */
.container {
    max-width: 820px;
    width: 100%;
    padding: 0 20px;
    z-index: 2;
}

.site-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 24px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 40px;
}

.coord-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 1.5px;
    color: var(--c-mind);
    margin-bottom: 6px;
}

.author-name {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-bright);
    letter-spacing: -0.5px;
}

.author-bio {
    color: var(--text);
    font-size: 0.95rem;
    margin-top: 4px;
}

.btn-console {
    color: var(--text);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: all 0.25s;
}

.btn-console:hover {
    color: #fff;
    border-color: var(--c-mind);
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.3);
}

.section-block { margin-bottom: 44px; }

.section-title {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 2px;
    color: #475569;
    margin-bottom: 18px;
}

.grid-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

/* THẺ CARD DỰ ÁN */
.project-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 22px;
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.project-card:hover {
    transform: translateY(-3px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    margin-bottom: 12px;
}

.node-id { font-weight: 600; }
.card-oxytocin .node-id { color: var(--c-oxytocin); }
.card-doremon .node-id  { color: var(--c-doremon); }
.card-geng .node-id     { color: var(--c-geng); }
.card-engine .node-id   { color: var(--c-engine); }

.project-tag { color: #64748b; }

.project-title {
    color: var(--text-bright);
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.project-desc {
    color: var(--text);
    font-size: 0.88rem;
    line-height: 1.55;
    margin-bottom: 18px;
}

.card-footer { font-family: var(--font-mono); font-size: 0.8rem; }
.card-link { text-decoration: none; font-weight: 500; }
.card-link:hover { text-decoration: underline; }

.link-oxytocin { color: var(--c-oxytocin); }
.link-doremon  { color: var(--c-doremon); }
.link-geng     { color: var(--c-geng); }
.muted-mono    { color: #475569; }

/* HOVER GẮN ĐÈN TINH THỂ */
.card-oxytocin:hover { border-color: var(--c-oxytocin); box-shadow: 0 0 24px rgba(255, 42, 85, 0.2); }
.card-doremon:hover  { border-color: var(--c-doremon); box-shadow: 0 0 24px rgba(0, 229, 255, 0.2); }
.card-geng:hover     { border-color: var(--c-geng); box-shadow: 0 0 24px rgba(229, 184, 105, 0.2); }
.card-engine:hover   { border-color: var(--c-engine); box-shadow: 0 0 24px rgba(16, 185, 129, 0.2); }

/* BẢNG LOG DATABASE */
.notes-table { display: flex; flex-direction: column; gap: 8px; }

.note-row {
    display: flex;
    align-items: center;
    padding: 12px 18px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s;
}

.note-row:hover {
    border-color: rgba(168, 85, 247, 0.4);
    background: rgba(168, 85, 247, 0.05);
    transform: translateX(4px);
}

.note-date {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: #64748b;
    width: 95px;
    flex-shrink: 0;
}

.note-title { flex-grow: 1; font-size: 0.92rem; color: var(--text-bright); }
.note-cat { font-family: var(--font-mono); font-size: 0.68rem; padding: 2px 6px; border-radius: 4px; color: var(--c-mind); background: rgba(168, 85, 247, 0.1); }

.site-footer {
    display: flex;
    justify-content: space-between;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: #475569;
}

@media(max-width: 640px) {
    .grid-cards { grid-template-columns: 1fr; }
    .site-header { flex-direction: column; gap: 14px; }
    .lattice-stage { height: 280px; }
}