.terminal-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    height: auto;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    color: rgb(0,0,1);
    font-family: monospace;
    font-size: 0.9rem;
    line-height: 1;
    opacity: 0.62;
}

.terminal-trigger:hover,
.terminal-trigger:focus {
    color: #6d6968;
    opacity: 1;
    outline: 1px solid #000;
    outline-offset: 3px;
}

.terminal-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.28);
    z-index: 2000;
}

.terminal-overlay[hidden] {
    display: none;
}

.portfolio-terminal {
    width: min(100%, 720px);
    max-height: min(680px, calc(100vh - 40px));
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    border: 1px solid #000;
    box-shadow: 6px 6px #000000;
    color: rgb(0,0,1);
}

.terminal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 12px;
    border-bottom: 1px solid #000;
}

.terminal-header h2 {
    margin: 0;
    font-family: "Kalam", cursive;
    font-size: 1.25rem;
    line-height: 1;
}

.terminal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background-color: #ffffff;
    border: 1px solid #000;
    box-shadow: 2px 2px #000000;
    color: rgb(0,0,1);
}

.terminal-close:hover,
.terminal-close:focus {
    color: #6d6968;
}

.terminal-body {
    min-height: 300px;
    overflow-y: auto;
    padding: 14px;
    font-family: monospace;
    font-size: 0.94rem;
    line-height: 1.45;
}

.terminal-output {
    display: grid;
    gap: 8px;
}

.terminal-line {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.terminal-line.command {
    color: #222;
}

.terminal-line.muted {
    color: #555;
}

.terminal-form {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: 8px;
}

.terminal-prompt {
    flex: 0 0 auto;
    font-weight: 700;
}

.terminal-form input {
    min-width: 0;
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    color: rgb(0,0,1);
    font: inherit;
    caret-color: rgb(0,0,1);
}

body.terminal-open {
    overflow: hidden;
}

@media (max-width: 767px) {
    .terminal-overlay {
        align-items: flex-end;
        padding: 12px;
    }

    .portfolio-terminal {
        max-height: calc(100vh - 24px);
        box-shadow: 4px 4px #000000;
    }

    .terminal-body {
        min-height: 260px;
        font-size: 0.84rem;
    }

    .terminal-form {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .terminal-prompt {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .terminal-overlay,
    .portfolio-terminal {
        transition: none;
    }
}
