/* ============================================================
   TERMINAL — input, output, command responses, boot, status bar
   ============================================================ */

/* ---------- Terminal app ---------------------------------- */

#terminal-app {
    height: 100%;
    padding: 16px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.4;
    opacity: 0;
    transition: opacity 0.4s ease;
}

#terminal-app.is-visible {
    opacity: 1;
}

.output {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.output-block {
    padding: 4px 0;
    line-height: 1.625;
    animation: print-reveal 0.55s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes print-reveal {
    from { clip-path: inset(0 100% 0 0); opacity: 0; filter: brightness(1.4); }
    50%  { opacity: 1; filter: brightness(1.4); }
    to   { clip-path: inset(0 0 0 0); opacity: 1; filter: brightness(1); }
}

/* ---------- Prompt & input -------------------------------- */

.input-entry,
.input-line {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.input-entry { align-items: flex-start; }
.input-line  { align-items: center; margin-top: 8px; }

.prompt {
    flex-shrink: 0;
    font-weight: bold;
}

.input-entry__command {
    margin-left: 4px;
    word-break: break-all;
}

#terminal-input {
    flex: 1;
    min-width: 0;
    margin-left: 4px;
    padding: 0;
    border: none;
    outline: none;
    background: transparent;
    color: inherit;
    font: inherit;
    text-shadow: inherit;
    caret-color: var(--glow);
}

#terminal-input::placeholder {
    color: inherit;
    opacity: 0.5;
}

/* ---------- Text helpers used in command output ----------- */

.c-fg     { color: var(--fg); }
.c-green  { color: var(--green); }
.c-cyan   { color: var(--cyan); }
.c-blue   { color: var(--blue); }
.c-yellow { color: var(--yellow); }
.c-red    { color: var(--red); }
.c-purple { color: var(--purple); }

.bold  { font-weight: bold; }
.small { font-size: 12px; }
.muted { opacity: 0.8; }
.mt-sm { margin-top: 8px; }

.output p {
    margin: 0;
}

.output a {
    color: var(--blue);
    text-decoration: none;
}

.output a:hover {
    text-decoration: underline;
}

.output ul {
    margin: 0 0 0 8px;
    padding: 0;
    list-style: disc inside;
}

/* ---------- Response layouts ------------------------------ */

.section > * + * {
    margin-top: 16px;
}

.stack > * + * {
    margin-top: 4px;
}

.command-table__row {
    display: grid;
    grid-template-columns: 140px 1fr;
}

.theme-table__row {
    display: grid;
    grid-template-columns: 24px 120px 1fr;
    align-items: center;
}

.ascii-art {
    display: none;
    margin: 8px 0;
    font-family: inherit;
    font-size: 12px;
    line-height: 1.25;
    color: var(--green);
}

@media (min-width: 640px) {
    .ascii-art {
        display: block;
    }
}

.divider {
    border-top: 1px solid var(--purple);
}

/* ---------- Blinking cursor (boot screen) ----------------- */

.crt-cursor {
    display: inline-block;
    width: 0.55em;
    height: 1.05em;
    margin-left: 6px;
    vertical-align: text-bottom;
    background: var(--glow);
    box-shadow: 0 0 8px var(--glow);
    animation: cursor-blink 1.05s steps(2) infinite;
}

@keyframes cursor-blink {
    0%, 49%   { opacity: 1; }
    50%, 100% { opacity: 0; }
}

/* ---------- Boot sequence --------------------------------- */

#boot-sequence {
    position: absolute;
    inset: 0;
    z-index: 10;
    padding: 16px;
    overflow-y: auto;
    font-size: 14px;
    color: var(--fg);
    text-shadow: var(--glow-soft);
    transition: opacity 0.35s ease;
}

#boot-sequence.is-hidden {
    opacity: 0;
}

.boot-line {
    min-height: 1.2em;
    opacity: 0;
    white-space: pre;
    animation: boot-fade-in 0.12s ease-out forwards;
}

.boot-line--prompt {
    margin-top: 12px;
}

@keyframes boot-fade-in {
    from { opacity: 0; transform: translateY(-2px); }
    to   { opacity: 1; transform: translateY(0); }
}

.boot-ok   { color: var(--green); text-shadow: var(--glow-strong); }
.boot-warn { color: var(--yellow); }
.boot-info { color: var(--cyan); }
.boot-dim  { color: color-mix(in srgb, var(--fg) 55%, transparent); }

/* ---------- Status bar ------------------------------------ */

.status-bar {
    z-index: 40;
    display: flex;
    flex-shrink: 0;
    align-items: center;
    font-size: 11px;
    color: var(--fg);
    text-shadow: var(--glow-soft);
    background: color-mix(in srgb, var(--bg) 70%, #000);
    border-top: 1px solid color-mix(in srgb, var(--glow) 25%, transparent);
    backdrop-filter: blur(8px);
}

.status-segment {
    padding: 2px 10px;
    border-right: 1px solid color-mix(in srgb, var(--glow) 18%, transparent);
}

.status-segment--right {
    margin-left: auto;
    border-right: none;
}

.status-bar .led {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 4px;
    vertical-align: middle;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 4px var(--green);
    animation: led-pulse 1.6s ease-in-out infinite;
}

@keyframes led-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.35; }
}
