:root {
    --color-bg: #FAFAFA;
    --color-text: #111;
    --color-accent: #00CC33;
    --color-accent-dim: rgba(0, 204, 51, 0.08);
    --color-grid: rgba(0, 204, 51, 0.08);
    --font-mono: 'IBM Plex Mono', 'Courier New', monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-mono);
    min-height: 100vh;
    overflow-x: hidden;

    /* Graph Paper Background */
    background-image:
        linear-gradient(var(--color-grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--color-grid) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* --- LAYOUT WITH SIDEBAR --- */
.page-wrapper {
    display: flex;
}

/* --- NAVIGATION SIDEBAR --- */
.nav-sidebar {
    width: 180px;
    min-height: 100vh;
    padding: 40px 20px;
    border-right: 1px solid #DDD;
    position: fixed;
    left: 0;
    top: 0;
    background: rgba(250, 250, 250, 0.95);
    z-index: 100;
}

.nav-sidebar h3 {
    font-size: 0.7rem;
    color: #888;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-sidebar ul {
    list-style: none;
}

.nav-sidebar li {
    margin-bottom: 10px;
}

.nav-sidebar a {
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.85rem;
    display: block;
    padding: 5px 0;
    transition: 0.2s;
}

.nav-sidebar a:hover {
    color: var(--color-accent);
    padding-left: 5px;
}

.nav-sidebar a::before {
    content: "> ";
    color: var(--color-accent);
}

/* --- MAIN CONTAINER --- */
.container {
    max-width: 700px;
    margin: 0 auto;
    padding: 60px 40px;
    margin-left: 200px;
    /* Offset for sidebar */
    position: relative;
}

/* The main vertical line on the left */
.container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 20px;
    width: 2px;
    height: 100%;
    background: var(--color-accent);
}

/* --- HEADER --- */
.header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    padding-left: 30px;
    position: relative;
}

/* Connector from main line to header */
.header::before {
    content: "";
    position: absolute;
    top: 30px;
    left: -20px;
    width: 50px;
    height: 2px;
    background: var(--color-accent);
}

.header-text h1 {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 5px;
}

.header-text .protocol {
    font-size: 1.8rem;
    font-weight: 700;
}

/* VIEW SOURCE link after header */
.view-source-link {
    display: inline-block;
    margin-left: 30px;
    margin-bottom: 40px;
    color: var(--color-accent);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: bold;
    border: 1px solid var(--color-accent);
    padding: 3px 10px;
}

.view-source-link:hover {
    background: var(--color-accent);
    color: #000;
}

/* --- LOG ENTRIES --- */
.log-entry {
    position: relative;
    margin-bottom: 40px;
    padding: 20px;
    padding-left: 30px;
    background: var(--color-bg);
    border: 1px solid #DDD;
    border-left: none;
}

/* Connector line from main bus to entry */
.log-entry::before {
    content: "";
    position: absolute;
    top: 25px;
    left: -30px;
    width: 30px;
    height: 2px;
    background: var(--color-accent);
}

/* Node dot on the bus */
.log-entry::after {
    content: "";
    position: absolute;
    top: 22px;
    left: -36px;
    width: 8px;
    height: 8px;
    background: var(--color-bg);
    border: 2px solid var(--color-accent);
    border-radius: 50%;
}

.log-title {
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    color: #555;
}

.log-date {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 8px;
}

/* Tags */
.log-tags {
    margin-bottom: 10px;
}

.tag {
    display: inline-block;
    font-size: 0.65rem;
    padding: 2px 6px;
    margin-right: 5px;
    background: var(--color-accent-dim);
    border: 1px solid var(--color-accent);
    color: var(--color-accent);
    cursor: pointer;
    transition: 0.2s;
}

.tag:hover {
    background: var(--color-accent);
    color: #000;
}

.log-content {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #333;
    min-height: 1.6em;
    /* For typing effect */
}

.log-link {
    display: inline-block;
    margin-top: 15px;
    color: var(--color-accent);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: bold;
    border: 1px solid var(--color-accent);
    padding: 2px 8px;
}

.log-link:hover {
    background: var(--color-accent);
    color: #000;
}

/* ASCII 3D Cube */
.ascii-cube {
    position: fixed;
    right: 150px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    line-height: 1;
    color: var(--color-accent);
    white-space: pre;
    font-family: var(--font-mono);
    z-index: 50;
    text-shadow: 0 0 5px rgba(0, 204, 51, 0.5);
}

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
    .nav-sidebar {
        display: none;
    }

    .container {
        margin-left: auto;
    }

    .ascii-cube {
        right: 20px;
        font-size: 0.4rem;
    }
}