:root {
    --bg: #050505;
    --text: #e0e0e0;
    --accent: #f4b400; /* Zcash Gold */
    --border: #333333;
    --font-mono: 'JetBrains Mono', monospace;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-mono);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

.grain {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.05;
    pointer-events: none;
    z-index: 1000;
}

h1, h2, h3 {
    text-transform: uppercase;
    font-weight: 800;
    margin: 0;
}

.hero {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom: 2px solid var(--border);
    text-align: center;
}

.hero h1 {
    font-size: clamp(3rem, 15vw, 10rem);
    line-height: 0.8;
}

.subtitle {
    margin-top: 1rem;
    color: var(--accent);
    font-weight: 700;
    letter-spacing: 0.3em;
}

.chapter {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    min-height: 100vh;
    border-bottom: 1px solid var(--border);
}

@media (max-width: 1024px) {
    .chapter { grid-template-columns: 1fr; }
}

.info-pane {
    padding: 5vw;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ch-num {
    font-size: 5rem;
    color: #1a1a1a;
    line-height: 1;
    margin-bottom: -1rem;
}

.info-pane h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    border-bottom: 4px solid var(--accent);
    display: inline-block;
}

.info-pane p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #aaa;
    margin-bottom: 1.5rem;
}

.interactive-pane {
    background: #080808;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4rem;
}

.interactive-area {
    width: 100%;
    max-width: 600px;
    background: var(--bg);
    border: 1px solid var(--border);
    position: relative;
}

.label {
    background: var(--border);
    color: #888;
    font-size: 0.7rem;
    padding: 0.5rem 1rem;
    text-transform: uppercase;
}

/* Lab 1: Waldo */
.waldo-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
}

#waldo-img {
    filter: grayscale(1) contrast(1.2) brightness(0.6);
    width: 100%; height: 100%; object-fit: cover;
}

#mask {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.98);
    cursor: crosshair;
}

.controls-noir {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border-top: 1px solid var(--border);
}

.status-box {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.status-label { font-size: 0.7rem; color: #666; }

.meter-bg {
    flex-grow: 1;
    height: 4px;
    background: #111;
}

.meter-fill {
    width: 0%;
    height: 100%;
    background: var(--accent);
    transition: width 0.1s;
}

button {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 1rem;
    font-family: var(--font-mono);
    font-weight: 800;
    cursor: pointer;
}

button:hover:not(:disabled) {
    background: var(--accent);
    color: var(--bg);
}

button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.result {
    padding: 1rem;
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
    min-height: 1.2rem;
}

.result.success { color: #00ff00; background: rgba(0,255,0,0.05); }
.result.error { color: #ff0000; background: rgba(255,0,0,0.05); }

/* Lab 2: Curves */
.curve-container {
    background: #000;
    width: 100%;
    height: 350px;
}

.curve-inputs {
    padding: 1rem;
    border-top: 1px solid var(--border);
}

.param { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.5rem; }
.param span { font-size: 0.8rem; color: var(--accent); }
input[type="range"] { flex-grow: 1; accent-color: var(--accent); background: #111; }

/* Lab 3: Circuits */
.circuit-ui {
    padding: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.wire-box { display: flex; align-items: center; gap: 1rem; }
.wire-box input {
    background: transparent;
    border: 1px solid var(--border);
    color: white;
    padding: 1rem;
    width: 100px;
    text-align: center;
    font-family: var(--font-mono);
}

.operator, .equal-sign { color: var(--accent); font-size: 1.5rem; }
.target-val { font-size: 3rem; font-weight: 800; }

/* Lab 4: Terminal */
.terminal-noir {
    background: #000;
}

.term-header {
    background: #111;
    padding: 0.5rem 1rem;
    font-size: 0.7rem;
    color: #444;
}

.term-body {
    padding: 2rem;
    color: #666;
    font-size: 0.9rem;
}

.dropzone {
    display: inline-block;
    min-width: 100px;
    border-bottom: 1px dashed #333;
    text-align: center;
}

.dropzone.hover { border-color: var(--accent); }

.draggables-noir {
    padding: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    border-top: 1px solid var(--border);
}

.drag-item {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    font-size: 0.8rem;
    cursor: grab;
}

.drag-item:hover { border-color: var(--accent); }

.noir-footer {
    padding: 10vh 5vw;
    text-align: center;
    color: #444;
    font-size: 0.8rem;
}

.noir-footer a { color: var(--accent); text-decoration: none; }

.ascii-art {
    font-size: 0.6rem;
    color: #222;
    white-space: pre;
    line-height: 1.2;
}
