/* Interactive homepage terminal. Global (not .razor.css) because terminal.js
   injects output nodes that wouldn't carry a CSS-isolation scope attribute. */

.terminal-stage {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 6vh;
}

/* The terminal stays intrinsically dark in both themes (a light terminal reads
   wrong), but it now wears the neutral "slate fog" palette — steel/fog instead
   of phosphor green — so it belongs to the same world as the rest of the site. */
.terminal-window {
    width: min(760px, 92vw);
    height: min(60vh, 520px);
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
    border: 1px solid #262a31;
    background: #0e1014;
    font-family: 'Source Code Pro', Menlo, Monaco, Consolas, monospace;
    font-size: 13px;
    line-height: 1.55;
}

/* title bar */
.terminal-window > header {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    padding: 0 12px;
    background: #16181d;
    border-bottom: 1px solid #262a31;
    flex: 0 0 auto;
}

    /* macOS traffic-light window dots — a small spot of colour on the chrome. */
    .terminal-window > header .button {
        width: 11px;
        height: 11px;
        border-radius: 50%;
    }

        .terminal-window > header .button.red { background: #ff5f56; }
        .terminal-window > header .button.yellow { background: #ffbd2e; }
        .terminal-window > header .button.green { background: #27c93f; }

    .terminal-window > header .title {
        position: absolute;
        left: 0;
        right: 0;
        text-align: center;
        color: #6d97c4;
        font-size: 12px;
        pointer-events: none;
    }

/* screen */
.terminal-window section.terminal {
    position: relative;
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 14px 16px;
    color: #c7ccd4;
    background: #0e1014;
    cursor: text;
}

    .terminal-window section.terminal .line {
        white-space: pre-wrap;
        word-break: break-word;
    }

    .terminal-window section.terminal a {
        color: #9aa3ae;
        text-decoration: none;
        border-bottom: 1px solid #383d45;
        transition: color 0.12s ease, border-color 0.12s ease;
    }

    .terminal-window section.terminal a:hover {
        color: #d7dbe2;
        border-bottom-color: #6a7079;
    }

    .terminal-window section.terminal b {
        color: #e2e6ec;
        font-weight: 600;
    }

    /* Echoed prompts from past commands wear the same slate-blue as the live
       prompt so the guest@mnmlengineer line reads consistently up the history. */
    .terminal-window .prompt-echo {
        color: #6d97c4;
        white-space: pre;
    }

    /* The live prompt (the line currently being typed) wears slate-blue so it's
       immediately distinguishable from every other line on the screen. */
    .terminal-window .prompt {
        color: #6d97c4;
        white-space: pre;
    }

    .terminal-window .accent { color: #d7dbe2; }
    .terminal-window .dir { color: #8fa0ad; }
    .terminal-window .err { color: #d08c87; }

    .terminal-window .input-line {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
    }

    .terminal-window .typed {
        white-space: pre-wrap;
        word-break: break-word;
    }

    /* block cursor */
    .terminal-window .cursor {
        display: inline-block;
        width: 8px;
        height: 1.05em;
        margin-left: 1px;
        background: #9aa3ae;
        vertical-align: text-bottom;
        animation: term-blink 1s steps(1) infinite;
    }

@keyframes term-blink {
    50% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .terminal-window .cursor { animation: none; }
}

/* invisible field that actually captures keystrokes (and the mobile keyboard) */
.terminal-window .hidden-input {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1.6em;
    border: 0;
    padding: 0;
    background: transparent;
    color: transparent;
    caret-color: transparent;
    outline: none;
    font: inherit;
}
