:root {
    --bg: #0b0d0a;
    --panel: #0f120e;
    --panel-edge: #22301f;
    --fg: #c9f2c9;
    --fg-bright: #eafff0;
    --fg-dim: #5f8a5f;
    --fg-dim2: #3d5c3d;
    --accent: #7fff9f;
    --red: #ff6b6b;
    --mono: 'JetBrains Mono', 'Fira Code', ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: var(--mono);
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem 1rem;
}

.crt {
    position: relative;
    width: 100%;
    max-width: 640px;
}

.terminal {
    position: relative;
    background: var(--panel);
    border: 1px solid var(--panel-edge);
    border-radius: 2px;
}

.terminal:focus-within {
    border-color: var(--fg-dim);
}

.term-body {
    height: 56vh;
    max-height: 480px;
    min-height: 280px;
    overflow-y: auto;
    padding: 1.1rem 1.1rem 0.2rem;
}

.term-body::-webkit-scrollbar {
    width: 8px;
}

.term-body::-webkit-scrollbar-track {
    background: transparent;
}

.term-body::-webkit-scrollbar-thumb {
    background: var(--fg-dim2);
}

.line {
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.6;
    margin: 0 0 2px;
    font-size: 0.95rem;
}

.line.cmd {
    color: var(--fg-bright);
}

.line.cmd::before {
    content: "guest@jldev:~$ ";
    color: var(--fg-dim);
}

.line.out {
    color: var(--fg);
}

.line.bright {
    color: var(--fg-bright);
}

.line.dim {
    color: var(--fg-dim);
}

.line.dim2 {
    color: var(--fg-dim2);
    font-size: 0.85em;
}

.line.error {
    color: var(--red);
}

.line a {
    color: var(--fg-bright);
    text-decoration: none;
    border-bottom: 1px solid var(--fg-dim);
}

.line a:hover {
    border-color: var(--accent);
}

pre.banner {
    color: var(--accent);
    margin: 0 0 0.75rem;
    font-size: 0.9em;
    line-height: 1.3;
}

.term-input-line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.1rem 0.9rem;
    border-top: 1px solid var(--panel-edge);
}

.prompt {
    color: var(--fg-dim);
    flex-shrink: 0;
}

.cmd-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--fg-bright);
    font: inherit;
    caret-color: var(--accent);
    min-width: 0;
}

.cmd-input::selection {
    background: var(--fg-dim2);
}

.term-footer {
    text-align: center;
    margin-top: 0.9rem;
    font-size: 0.75rem;
}

.term-footer a {
    color: var(--fg-dim);
    text-decoration: none;
}

.term-footer a:hover {
    color: var(--accent);
}

@media (max-width: 480px) {
    body {
        font-size: 13px;
        padding: 1rem 0.5rem;
    }

    .term-body {
        height: 62vh;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        scroll-behavior: auto !important;
    }
}
