/* Homepage shell, styled to match the PaloSpring terminal surface. */
.home-terminal {
    --home-terminal-bg: #1e1e1d;
    --home-terminal-fg: #efefe8;
    --home-terminal-titlebar: #242424;
    color-scheme: dark;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: clamp(360px, 43vw, 540px);
    min-width: 0;
    min-height: 360px;
    max-height: 540px;
    overflow: hidden;
    color: var(--home-terminal-fg);
    background: var(--home-terminal-bg);
    border: 0;
    border-radius: 8px;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.24), 0 4px 12px rgba(0, 0, 0, 0.18);
    font-family: 'SF Mono C', 'Courier New', Courier, monospace;
    font-size: 0.8rem;
    line-height: 1.5;
    text-align: left;
}

.home-terminal__titlebar {
    position: relative;
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    min-height: 48px;
    padding: 0 16px;
    background: var(--home-terminal-titlebar);
}

.home-terminal__traffic-lights {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 9px;
}

.home-terminal__light {
    display: block;
    width: 13px;
    height: 13px;
    border-radius: 50%;
}

.home-terminal__light--close {
    background: #ff5f57;
    box-shadow: inset 0 0 0 1px #e0443e;
}

.home-terminal__light--minimize {
    background: #febc2e;
    box-shadow: inset 0 0 0 1px #dea123;
}

.home-terminal__light--zoom {
    background: #28c840;
    box-shadow: inset 0 0 0 1px #1aab29;
}

.home-terminal__window-title {
    position: absolute;
    left: 50%;
    display: flex;
    align-items: center;
    gap: 7px;
    max-width: calc(100% - 180px);
    min-width: 0;
    overflow: hidden;
    color: var(--home-terminal-fg);
    font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    transform: translateX(-50%);
}

.home-terminal__title-text {
    overflow: hidden;
    text-overflow: ellipsis;
}

.home-terminal__folder {
    display: block;
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.home-terminal__screen {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    overflow: auto;
    padding: 0.85rem 1rem 0.55rem;
    color: var(--home-terminal-fg);
    background: var(--home-terminal-bg);
    scrollbar-color: #555550 var(--home-terminal-bg);
    scrollbar-width: thin;
}

.home-terminal__history {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
}

.home-terminal__line,
.home-terminal__command {
    width: 100%;
    min-height: 1.5em;
    margin: 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.home-terminal__line--command {
    display: flex;
    align-items: baseline;
}

.home-terminal__line-prompt {
    flex: 0 0 auto;
    margin-right: 0.75em;
}

.home-terminal__command {
    display: flex;
    flex: 0 0 auto;
    align-items: baseline;
}

.home-terminal__prompt {
    flex: 0 0 auto;
    margin-right: 0.75em;
    color: var(--home-terminal-fg);
    white-space: pre;
}

.home-terminal__input {
    flex: 1 1 auto;
    width: 0;
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    outline: 0;
    color: var(--home-terminal-fg);
    background: transparent;
    caret-color: var(--home-terminal-fg);
    font: inherit;
    line-height: inherit;
}

.home-terminal__input::selection,
.home-terminal__line::selection {
    color: var(--home-terminal-fg);
    background: #4b4b46;
}

@media (max-width: 640px) {
    .home-terminal {
        height: 420px;
        min-height: 320px;
        max-height: 420px;
    }

    .home-terminal__titlebar {
        min-height: 42px;
        padding: 0 10px;
    }

    .home-terminal__traffic-lights {
        gap: 6px;
    }

    .home-terminal__light {
        width: 9px;
        height: 9px;
    }

    .home-terminal__window-title {
        max-width: calc(100% - 112px);
        gap: 5px;
        font-size: 11px;
    }

    .home-terminal__folder {
        width: 16px;
        height: 16px;
    }

    .home-terminal__screen {
        padding: 0.85rem 0.75rem 0.55rem;
        font-size: 0.72rem;
    }

    .home-terminal__prompt,
    .home-terminal__line-prompt {
        margin-right: 0.5em;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-terminal__screen {
        scroll-behavior: auto;
    }
}
