:root {
    --bg: #000000;
    --text-main: #00ff00;
    --text-muted: #00aa00;
    --border: #00ff00;
    --border-dim: #004400;
    --accent-red: #ff4444;
    --accent-dark-red: #ff6666;
    --accent-blue: #00e5ff;
    --code-bg: rgba(0, 255, 0, 0.03);
    --card-bg: #000000;
}

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

body {
    font-family: "Courier New", Courier, monospace;
    color: var(--text-main);
    background-color: var(--bg);
    line-height: 1.8;
    padding: 2.5rem 1.5rem;
    min-height: 100vh;
}

::selection {
    background-color: #00ff00;
    color: #000000;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #000000;
}
::-webkit-scrollbar-thumb {
    background: #004400;
    border: 1px solid #00ff00;
}

.container {
    max-width: 880px;
    margin: 0 auto;
    padding-right: 3rem;
}

.nav-back {
    margin-bottom: 2rem;
}

.nav-back a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: bold;
}

.nav-back a:hover {
    color: var(--text-main);
    text-decoration: underline;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    border-bottom: 2px solid var(--border);
    padding-bottom: 1.75rem;
    margin-bottom: 2.5rem;
}

.header-content {
    flex: 1;
}

.header-octogram {
    flex-shrink: 0;
    padding-top: 0.25rem;
}

/* Octogram */
.octogram {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: transform 0.2s;
}

.octogram:hover {
    transform: scale(1.05);
}

.line {
    height: 6px;
    width: 60px;
    background-color: #00ff00;
    box-shadow: 0 0 10px #00ff00, 0 0 20px #00ff00;
}

.one {
    background-color: transparent;
    box-shadow: none;
    display: flex;
    justify-content: space-between;
}

.one::before, .one::after {
    content: "";
    height: 100%;
    width: 45%;
    background-color: #00ff00;
    box-shadow: 0 0 10px #00ff00, 0 0 20px #00ff00;
}

.series-tag {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    text-shadow: 0 0 5px var(--text-main);
}

h1 {
    font-size: 2.2rem;
    line-height: 1.25;
    font-weight: 800;
    letter-spacing: -0.025em;
    margin-bottom: 0.75rem;
    color: var(--text-main);
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.4);
}

.subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    font-weight: 400;
    line-height: 1.5;
}

.byline {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-top: 0.85rem;
    font-weight: 500;
}

.byline strong {
    color: var(--text-main);
    font-weight: 700;
}

.essay-content p {
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
    color: var(--text-main);
    line-height: 1.8;
}

h2 {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 2.5rem 0 1.25rem 0;
    letter-spacing: -0.015em;
    border-left: 4px solid var(--border);
    padding-left: 0.75rem;
    color: var(--text-main);
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.4);
}

.callout-box {
    background-color: var(--code-bg);
    border: 1px solid var(--border);
    padding: 1.25rem;
    margin: 1.75rem 0;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.1);
}

.callout-box strong {
    color: var(--text-main);
    text-shadow: 0 0 3px var(--text-main);
}

/* Chart Styles */
.chart-container {
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 1.5rem 1rem 1rem 1rem;
    margin: 2.5rem 0;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.15);
}

.chart-header {
    margin-bottom: 1rem;
    padding-left: 0.5rem;
}

.chart-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    text-shadow: 0 0 5px var(--text-main);
}

.chart-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.chart-svg {
    width: 100%;
    height: auto;
    display: block;
}

.axis-label {
    font-family: "Courier New", Courier, monospace;
    font-size: 11px;
    fill: var(--text-muted);
}

.annotation-text {
    font-family: "Courier New", Courier, monospace;
    font-size: 11px;
    font-weight: 600;
}

.bold {
    font-weight: 800;
    font-size: 12px;
}

/* Table Styles */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 0.95rem;
    border: 1px solid var(--border);
}

th,
td {
    text-align: right;
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid var(--border-dim);
    color: var(--text-main);
    font-family: "Courier New", Courier, monospace;
}

th:first-child,
td:first-child {
    text-align: left;
}

th {
    background-color: rgba(0, 255, 0, 0.1);
    font-weight: 700;
    color: var(--text-main);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}

tr:hover {
    background-color: rgba(0, 255, 0, 0.04);
}

.surplus {
    color: var(--text-main);
    font-weight: 700;
    text-shadow: 0 0 5px var(--text-main);
}

.deficit {
    color: var(--accent-red);
    font-weight: 700;
    text-shadow: 0 0 5px rgba(255, 68, 68, 0.5);
}

footer {
    margin-top: 3.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    right: 0;
    top: 0;
    height: 100%;
    width: 200px;
    background: rgba(0, 0, 0, 0.9);
    border-left: 1px solid #00ff00;
    transform: translateX(100%);
    transition: transform 0.3s;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.sidebar.expanded {
    transform: translateX(0);
}

.sidebar-toggle {
    position: absolute;
    left: -40px;
    top: 20px;
    width: 40px;
    height: 40px;
    background: black;
    color: #00ff00;
    border: 1px solid #00ff00;
    border-right: none;
    font-family: inherit;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar a {
    color: #00ff00;
    text-decoration: none;
}

.sidebar a:hover {
    text-decoration: underline;
}

@media (max-width: 640px) {
    body {
        padding: 1.5rem 1rem;
    }
    .container {
        padding-right: 2rem;
    }
    header {
        flex-direction: column-reverse;
        gap: 1.5rem;
    }
    .header-octogram {
        align-self: flex-end;
    }
    th, td {
        padding: 0.5rem 0.4rem;
        font-size: 0.8rem;
    }
}
