.home-nav {
    padding: 1rem 2rem;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 100;
}

.home-nav a {
    color: var(--bio-green);
    text-decoration: none;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    font-weight: bold;
    letter-spacing: 1px;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.home-nav a:hover {
    opacity: 1;
}

:root {
    /* Biology Inspired Dark Theme */
    --bg-color: #080808;
    --container-bg: #0f0f0f;
    --text-color: #b0b0b0;
    --heading-color: #ffffff;
    
    /* Biological Accent Colors */
    --bio-green: #00ff88;  /* Life / Chlorophyll */
    --dna-blue: #00aaff;   /* Helix / Aqueous */
    --rna-purple: #a855f7; /* Transcription */
    --protein-gold: #fbbf24; /* Translation / Nanomachines */
    --cell-pink: #ff0055;  /* Membrane / Energy */
    --crispr-red: #ff4d4d; /* CRISPR / Gene Editing */
    --evolution-orange: #f97316; /* Natural Selection */
    --virus-lime: #a3e635; /* Rogue Code */
    --immune-cyan: #22d3ee; /* Defense */
    --math-purple: #c084fc; /* Mathematical Biology */
    
    --success: var(--bio-green);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--bg-color);
    max-width: 800px;
    margin: 0 auto;
    padding: 4rem 2rem;
    font-size: 18px;
}

h1, h2, h3 {
    color: var(--heading-color);
    font-weight: 300;
    letter-spacing: 0.05em;
}

h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid #333;
    padding-bottom: 1rem;
}

h2 {
    font-size: 2rem;
    margin-top: 5rem;
    margin-bottom: 1.5rem;
}

.part-header {
    margin-top: 6rem;
    margin-bottom: 1rem;
    padding-top: 3rem;
    border-top: 1px solid #333;
    text-align: center;
}

.part-header h3 {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: #555;
    margin-bottom: 0.3rem;
}

.part-header p {
    font-size: 1.4rem;
    color: #888;
    font-weight: 300;
    margin-bottom: 0;
}

p {
    margin-bottom: 1.5rem;
}

.term {
    font-family: "Courier New", monospace;
    font-weight: bold;
    color: #fff;
    background: #222;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 1px;
}

/* Minimalist Interactive Containers */
.interactive-container {
    background: var(--container-bg);
    padding: 2rem;
    border: 1px solid #222;
    border-radius: 12px;
    margin: 3rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-canvas-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 3rem 0 4rem 0;
}

canvas {
    background: var(--bg-color);
    border: 1px solid #222;
    border-radius: 8px;
    max-width: 100%;
}

.hero-canvas {
    border: none;
    background: transparent;
}

/* Controls */
.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
    margin-top: 2rem;
    width: 100%;
}

.control-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: "Courier New", monospace;
    font-size: 0.9rem;
    color: #888;
}

.control-group span {
    color: #fff;
    font-weight: bold;
}

button {
    padding: 0.8rem 1.5rem;
    font-family: "Courier New", monospace;
    font-size: 0.9rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #000;
    background-color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: 0.2s;
}

button:hover {
    background-color: #ccc;
}

/* Table of Contents */
.toc {
    border: 1px solid #222;
    border-radius: 12px;
    padding: 1.5rem 2rem;
    margin: 3rem 0;
    background: var(--container-bg);
}

.toc-title {
    font-family: "Courier New", monospace;
    font-size: 0.85rem;
    letter-spacing: 3px;
    color: #555;
    margin-bottom: 0.8rem !important;
}

.toc ol {
    counter-reset: toc-counter;
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-part {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #555;
    margin-top: 1rem;
    margin-bottom: 0.3rem;
    padding-top: 0.5rem;
    border-top: 1px solid #1a1a1a;
}

.toc li {
    counter-increment: toc-counter;
    margin-bottom: 0.5rem;
    font-family: "Courier New", monospace;
    font-size: 0.85rem;
}

.toc li::before {
    content: counter(toc-counter, decimal-leading-zero) ". ";
    color: #555;
}

.toc a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.2s;
}

.toc a:hover {
    color: #fff;
}

/* Section Category Tags */
.section-tag {
    display: inline-block;
    font-family: "Courier New", monospace;
    font-size: 0.7rem;
    letter-spacing: 2px;
    padding: 3px 10px;
    border-radius: 3px;
    margin-bottom: -0.5rem;
    background: #1a1a1a;
    color: #666;
    border: 1px solid #333;
}

.tag-genetics { color: var(--bio-green); border-color: rgba(0, 255, 136, 0.2); }
.tag-molecular { color: var(--dna-blue); border-color: rgba(0, 170, 255, 0.2); }
.tag-regulation { color: var(--rna-purple); border-color: rgba(168, 85, 247, 0.2); }
.tag-crispr { color: var(--crispr-red); border-color: rgba(255, 77, 77, 0.2); }
.tag-cellular { color: var(--cell-pink); border-color: rgba(255, 0, 85, 0.2); }
.tag-energy { color: var(--protein-gold); border-color: rgba(251, 191, 36, 0.2); }
.tag-evolution { color: var(--evolution-orange); border-color: rgba(249, 115, 22, 0.2); }
.tag-virus { color: var(--virus-lime); border-color: rgba(163, 230, 53, 0.2); }
.tag-immune { color: var(--immune-cyan); border-color: rgba(34, 211, 238, 0.2); }
.tag-math { color: var(--math-purple); border-color: rgba(192, 132, 252, 0.2); }

/* Footer */
footer {
    margin-top: 6rem;
    padding: 2rem 0;
    border-top: 1px solid #222;
    text-align: center;
}

footer p {
    font-family: "Courier New", monospace;
    font-size: 0.8rem;
    color: #444;
    letter-spacing: 2px;
}

/* Responsive */
@media (max-width: 640px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
}
