:root {
    --bg-color: #080b11;   /* Business Mode: Midnight blue-black (avarre.com) */
    --term-green: #38bdf8;  /* Neon cyan text */
    --term-cyan: #7dd3fc;   /* Bright sky cyan */
    --term-purple: #c084fc;
    --term-amber: #fde047;  /* Bright electric yellow */
    --font-mono: 'Fira Code', monospace;
    --border-color: rgba(56, 189, 248, 0.4);
}

/* Theme Éole OS Overrides (Artist Mode / eole.me) */
body.theme-eole {
    --bg-color: #16100c;   /* Artist Mode: Sienna brown-black (eole.me) */
    --term-green: #f5f2eb;  /* Warm off-white text */
    --term-cyan: #e2875c;   /* Terracotta / peach accent */
    --term-purple: #f0ab8d; /* Warm peach */
    --term-amber: #facc15;  /* Warm gold */
    --border-color: rgba(226, 135, 92, 0.45);
}

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

body {
    background-color: var(--bg-color);
    color: var(--term-green);
    font-family: var(--font-mono);
    font-weight: 500;
    min-height: 100vh;
    padding: 1.5rem;
    position: relative;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* Scanline CRT overlay */
.scanlines {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.18) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.02), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.02));
    background-size: 100% 3px, 6px 100%;
    pointer-events: none;
    z-index: 10;
}

.terminal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--term-cyan);
    transition: border-color 0.4s ease;
}

.terminal-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.output-buffer {
    line-height: 1.55;
    font-size: 0.95rem;
    font-weight: 500;
}

.line { margin-bottom: 0.4rem; }
.prompt { color: var(--term-cyan); font-weight: 700; }
.command { color: #ffffff; font-weight: 700; }
.response { color: var(--term-green); font-weight: 500; white-space: pre-wrap; word-break: break-word; }
.highlight { color: #fde047; font-weight: 700; text-shadow: 0 0 5px rgba(253, 224, 71, 0.4); }
.accent { color: var(--term-purple); font-weight: 700; }
.term-link {
    color: var(--term-cyan);
    text-decoration: underline;
    font-weight: 700;
    cursor: pointer;
    word-break: break-all;
    transition: color 0.2s ease, text-shadow 0.2s ease;
}
.term-link:hover {
    color: #ffffff;
    text-shadow: 0 0 8px var(--term-cyan);
}

.input-line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    margin-top: 0.25rem;
    margin-bottom: 0.75rem;
}

.input-line input {
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-family: var(--font-mono);
    font-size: 0.98rem;
    font-weight: 700;
    flex-grow: 1;
    caret-color: var(--term-green);
}

/* CRT Curved Screen & Glass Reflection Overlay */
.crt-vignette {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 12;
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.75), inset 0 0 25px rgba(0, 0, 0, 0.85);
    background: radial-gradient(circle at 50% 50%, rgba(0,0,0,0) 70%, rgba(0,0,0,0.35) 90%, rgba(0,0,0,0.85) 100%),
                linear-gradient(135deg, rgba(255,255,255,0.035) 0%, rgba(255,255,255,0) 40%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

/* Physical CRT Tube Curvature & Barrel Distortion */
.crt-screen-wrapper {
    position: relative;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    transition: transform 0.4s ease, border-radius 0.4s ease, filter 0.4s ease;
}

body.crt-active .crt-vignette {
    opacity: 1;
}

body.crt-active .crt-screen-wrapper {
    transform: perspective(1000px) rotateX(0.3deg) scale(0.99);
    border-radius: 18px / 26px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.7), inset 0 0 20px rgba(0, 0, 0, 0.5);
    filter: contrast(1.08) brightness(1.04);
    overflow: hidden;
    padding: 1.25rem 2rem;
}

/* Canvas overlay for Matrix / Wind animation */
#fx-canvas {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 1;
}
#fx-canvas.active { opacity: 0.45; }

.switch-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.55rem;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--term-amber);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}
.switch-btn:hover, .switch-btn:active {
    background: rgba(56, 189, 248, 0.25);
    border-color: var(--term-amber);
    transform: translateY(-1px);
}
body.theme-eole .switch-btn {
    background: rgba(226, 135, 92, 0.15);
}

.ascii-banner {
    font-family: var(--font-mono);
    white-space: pre;
    overflow-x: auto;
    font-size: clamp(0.36rem, 2.05vw, 0.95rem);
    line-height: 1.12;
    margin: 0.5rem 0;
    max-width: 100%;
    color: var(--term-cyan);
    letter-spacing: -0.5px;
    -webkit-overflow-scrolling: touch;
}

.term-table {
    font-family: var(--font-mono);
    white-space: pre;
    overflow-x: auto;
    font-size: clamp(0.44rem, 2.1vw, 0.95rem);
    line-height: 1.25;
    margin: 0.4rem 0;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

.term-hr {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
    opacity: 0.5;
    color: var(--border-color);
    margin: 0.25rem 0;
}

@media (max-width: 640px) {
    body { padding: 0.25rem; }
    body.crt-active .crt-screen-wrapper {
        transform: none; /* Flat rendering for crisp mobile fonts */
        border-radius: 6px;
        padding: 0.75rem 0.85rem;
    }
    .terminal-header {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        gap: 0.4rem;
        font-size: 0.82rem;
        font-weight: 700;
        padding-bottom: 0.5rem;
        margin-bottom: 0.75rem;
    }
    .output-buffer { font-size: 0.88rem; font-weight: 500; line-height: 1.5; padding-bottom: 1rem; }
    .line.response { font-size: 0.88rem; font-weight: 500; word-break: break-word; }
    .input-line { font-size: 0.95rem; font-weight: 700; gap: 0.35rem; margin-top: 0.4rem; }
    .input-line input { font-size: 16px; font-weight: 700; } /* 16px prevents iOS Safari auto-zoom on input focus */
    .prompt { font-size: 0.84rem; word-break: break-all; }
}
