:root {
    color-scheme: dark;
    --terminal-bg: #05070d;
    --terminal-shell: #090d14;
    --terminal-line: rgba(96, 112, 146, 0.2);
    --terminal-accent: #79c0ff;
    --terminal-accent-2: #8b949e;
    --terminal-success: #7ee787;
    --terminal-warning: #d29922;
    --terminal-danger: #ff7b72;
    --terminal-text: #c9d1d9;
    --terminal-muted: #8b949e;
    --terminal-soft: #6e7681;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
}

body {
    overflow: hidden;
    background: #010409;
    color: var(--terminal-text);
    font-family: "JetBrains Mono", monospace;
    font-size: 14px;
    line-height: 1.55;
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
}

body::before {
    opacity: 0.03;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 22px 22px;
}

body::after {
    opacity: 0.08;
    background: linear-gradient(transparent 0%, rgba(255, 255, 255, 0.04) 50%, transparent 100%);
    animation: scanline 10s linear infinite;
}

.terminal-shell {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    background: linear-gradient(180deg, rgba(7, 10, 16, 0.98) 0%, rgba(2, 5, 10, 1) 100%);
}

.terminal-noise {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.035;
    background-image:
        radial-gradient(circle at 20% 20%, rgba(121, 192, 255, 0.18), transparent 18%),
        radial-gradient(circle at 80% 18%, rgba(126, 231, 135, 0.08), transparent 18%),
        radial-gradient(circle at 50% 100%, rgba(201, 209, 217, 0.05), transparent 24%);
}

.terminal-session {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    max-width: 1220px;
    margin: 0 auto;
    padding: 14px 18px 0;
    overflow: hidden;
}

.terminal-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 10px;
    color: var(--terminal-muted);
    font-size: 0.82rem;
    letter-spacing: 0.02em;
}

.meta-user {
    color: var(--terminal-accent);
}

.meta-state {
    color: var(--terminal-success);
    text-transform: lowercase;
}

.terminal-scrollback {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    padding: 8px 0 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(141, 138, 255, 0.45) transparent;
}

.terminal-scrollback::-webkit-scrollbar {
    width: 10px;
}

.terminal-scrollback::-webkit-scrollbar-thumb {
    background: rgba(141, 138, 255, 0.45);
    border-radius: 999px;
}

.ascii-logo {
    margin: 0 0 14px;
    color: #a5b4fc;
    font-size: clamp(0.42rem, 0.66vw, 0.78rem);
    line-height: 1.08;
    text-shadow: 0 0 8px rgba(121, 192, 255, 0.2);
    white-space: pre;
}

.intro-block {
    margin-bottom: 10px;
}

.terminal-line,
.boot-line,
.history-row,
.command-fragment,
.output-fragment {
    margin: 0;
}

.terminal-line {
    color: var(--terminal-text);
}

.terminal-line-muted {
    color: var(--terminal-muted);
}

.divider {
    margin: 10px 0 12px;
    border-top: 1px dashed rgba(110, 118, 129, 0.42);
}

.boot-sequence,
.terminal-history {
    display: grid;
    gap: 6px;
}

.boot-line,
.history-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    min-height: 1.35rem;
}

.boot-line::before,
.history-row.command::before {
    content: ">";
    color: var(--terminal-text);
}

.boot-line.is-ready .output-fragment,
.status-ok {
    color: var(--terminal-success);
}

.output-fragment {
    color: var(--terminal-text);
}

.terminal-history {
    padding-bottom: 18px;
}

.history-row.output {
    padding-left: 20px;
}

.history-row.system .output-fragment {
    color: var(--terminal-accent-2);
}

.history-row.error .output-fragment {
    color: var(--terminal-danger);
}

.history-row.warning .output-fragment {
    color: var(--terminal-warning);
}

.history-row.support-card {
    display: block;
    padding-left: 20px;
}

.support-card {
    display: grid;
    gap: 4px;
    padding-left: 2px;
}

.support-card-line {
    display: grid;
    grid-template-columns: minmax(140px, 180px) 1fr;
    gap: 12px;
    align-items: baseline;
}

.support-card-key {
    color: var(--terminal-soft);
}

.support-card-value {
    color: var(--terminal-text);
    word-break: break-word;
}

.terminal-input-bar {
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 0;
    padding: 12px 0 14px;
    border-top: 1px solid rgba(110, 118, 129, 0.14);
    background:
        linear-gradient(180deg, rgba(2, 5, 10, 0) 0%, rgba(2, 5, 10, 0.92) 35%),
        linear-gradient(180deg, rgba(9, 13, 20, 0.95) 0%, rgba(5, 7, 13, 0.98) 100%);
    backdrop-filter: blur(10px);
}

.terminal-prompt {
    color: var(--terminal-success);
    font-size: 0.94rem;
    white-space: nowrap;
}

.terminal-input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    color: var(--terminal-text);
    background: transparent;
    font: inherit;
    font-size: 0.94rem;
    caret-color: var(--terminal-success);
}

.terminal-input::placeholder {
    color: rgba(147, 162, 197, 0.52);
}

.typing-cursor::after {
    content: "";
    display: inline-block;
    width: 10px;
    height: 1.1em;
    margin-left: 6px;
    transform: translateY(2px);
    background: rgba(87, 255, 142, 0.9);
    animation: blink 0.9s steps(1) infinite;
}

@media (max-width: 900px) {
    .terminal-session {
        padding: 12px 14px 0;
    }

    .support-card-line {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .terminal-input-bar {
        align-items: center;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 10px;
    }

    .terminal-prompt,
    .terminal-input {
        font-size: 0.86rem;
    }
}

@media (max-width: 520px) {
    .terminal-session {
        padding: 10px 12px 0;
    }

    .terminal-input-bar {
        gap: 8px;
        padding: 10px 0 12px;
    }

    .terminal-prompt,
    .terminal-input {
        font-size: 0.8rem;
    }
}

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

@keyframes scanline {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(100%);
    }
}
