:root {
    --bg-color: #0a0a0f;
    --line-color: rgba(255, 255, 255, 0.05);
    --terminal-bg: rgba(15, 15, 22, 0.7);
    --terminal-header: rgba(30, 30, 40, 0.8);
    --accent-color: #00f2ff;
    --accent-glow: rgba(0, 242, 255, 0.3);
    --text-color: #e2e8f0;
    --text-dim: #94a3b8;
}

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

html {
    background-color: var(--bg-color);
}

body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: transparent;
    font-family: 'Inter', sans-serif;
    color: var(--text-color);
    cursor: default;
}

#canvas-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

#hero-hint {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-dim);
    font-size: 0.8rem;
    letter-spacing: 0.2rem;
    text-transform: uppercase;
    font-weight: 300;
    animation: pulse 2s ease-in-out infinite;
    pointer-events: none;
    z-index: 10;
}

@keyframes pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

#terminal-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, transparent, rgba(0, 0, 0, 0.6));
    backdrop-filter: blur(8px);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.5s;
}

#terminal-modal.visible {
    opacity: 1;
    visibility: visible;
}

.terminal-window {
    width: 750px;
    max-width: 90vw;
    height: 450px;
    max-height: 80vh;
    background: var(--terminal-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(0, 242, 255, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.95) translateY(20px);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

#terminal-modal.visible .terminal-window {
    transform: scale(1) translateY(0);
}

.terminal-header {
    height: 40px;
    background: var(--terminal-header);
    display: flex;
    align-items: center;
    padding: 0 16px;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.traffic-lights {
    display: flex;
    gap: 8px;
    z-index: 2;
}

.traffic-lights span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.traffic-lights .red { background: #ff5f56; }
.traffic-lights .yellow { background: #ffbd2e; }
.traffic-lights .green { background: #27c93f; }

.terminal-title {
    position: absolute;
    width: 100%;
    text-align: center;
    left: 0;
    font-size: 11px;
    color: var(--text-dim);
    font-weight: 500;
    letter-spacing: 0.05rem;
    pointer-events: none;
}

.terminal-body {
    flex: 1;
    padding: 24px;
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    color: var(--text-color);
    overflow-y: auto;
    line-height: 1.6;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.terminal-body::-webkit-scrollbar {
    width: 6px;
}

.terminal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.prompt {
    color: var(--accent-color);
    font-weight: 500;
    margin-right: 10px;
    text-shadow: 0 0 10px var(--accent-glow);
}

.cursor {
    display: inline-block;
    width: 9px;
    height: 18px;
    background-color: var(--accent-color);
    margin-left: 2px;
    vertical-align: middle;
    animation: blink 1s step-end infinite;
    box-shadow: 0 0 12px var(--accent-color);
}

@keyframes blink {
    from, to { opacity: 1; }
    50% { opacity: 0; }
}

.terminal-line {
    margin-bottom: 6px;
}

.system-msg {
    color: var(--text-dim);
    font-style: italic;
}

#terminal-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.command-result {
    color: #cbd5e1;
    margin-bottom: 8px;
    white-space: pre-wrap;
}

.terminal-link {
    color: var(--accent-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.terminal-link:hover {
    border-bottom-color: var(--accent-color);
    text-shadow: 0 0 8px var(--accent-glow);
}

.hidden {
    display: none !important;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .terminal-window {
        width: 95vw;
        height: 60vh;
        max-height: 500px;
    }

    .terminal-body {
        padding: 16px;
        font-size: 13px;
    }

    .terminal-header {
        height: 36px;
    }

    .traffic-lights span {
        width: 10px;
        height: 10px;
    }

    #hero-hint {
        bottom: 20px;
        font-size: 0.7rem;
        letter-spacing: 0.15rem;
    }
}

@media (max-width: 480px) {
    .terminal-window {
        height: 70vh;
    }

    .terminal-title {
        display: none; /* Hide title on very small screens to save space */
    }

    .prompt {
        margin-right: 6px;
    }
}
