:root {
    --terminal-green: #00ff66;
    --terminal-green-dim: #00b84a;
    --terminal-black: #020403;
    --terminal-border: #073d1c;
}

* {
    box-sizing: border-box;
}

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

body {
    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;

    background:
        radial-gradient(
            circle at center,
            #07160d 0%,
            #020704 40%,
            #000 85%
        );

    color: var(--terminal-green);

    font-family:
        "DejaVu Sans Mono",
        "Liberation Mono",
        "Courier New",
        monospace;
}

/*
 * Very subtle CRT scanlines.
 */
body::after {
    content: "";

    position: fixed;
    inset: 0;

    pointer-events: none;

    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.08),
        rgba(0, 0, 0, 0.08) 1px,
        transparent 1px,
        transparent 3px
    );

    opacity: 0.5;
}

/*
 * Ambient green glow behind the terminal.
 */
body::before {
    content: "";

    position: fixed;

    width: 60vw;
    height: 40vh;

    background: rgba(0, 255, 102, 0.07);

    filter: blur(100px);

    pointer-events: none;
}

.terminal {
    width: min(900px, calc(100vw - 40px));
    min-height: 300px;

    position: relative;
    z-index: 1;

    background: rgba(0, 5, 2, 0.96);

    border: 1px solid var(--terminal-border);
    border-radius: 8px;

    overflow: hidden;

    box-shadow:
        0 0 2px rgba(0, 255, 102, 0.7),
        0 0 25px rgba(0, 255, 102, 0.12),
        0 0 80px rgba(0, 255, 102, 0.06),
        inset 0 0 30px rgba(0, 255, 102, 0.025);
}

.terminal-bar {
    height: 38px;

    position: relative;

    display: flex;
    align-items: center;

    background: #060806;

    border-bottom: 1px solid #102416;
}

.terminal-buttons {
    position: absolute;
    left: 14px;

    display: flex;
    gap: 7px;
}

.terminal-buttons span {
    width: 10px;
    height: 10px;

    border: 1px solid #275834;
    border-radius: 50%;

    background: #08120b;
}

.terminal-title {
    width: 100%;

    text-align: center;

    color: #52785c;

    font-size: 12px;

    user-select: none;
}

.terminal-body {
    padding: 30px 32px;

    font-size: clamp(14px, 2vw, 18px);
    line-height: 1.6;

    text-shadow:
        0 0 4px rgba(0, 255, 102, 0.85),
        0 0 10px rgba(0, 255, 102, 0.35);
}

.terminal-line {
    display: flex;
    align-items: baseline;

    white-space: nowrap;
}

.prompt {
    flex: none;

    margin-right: 0.7em;

    color: var(--terminal-green);

    font-weight: bold;
}

.typing {
    display: inline-block;

    width: 0;

    overflow: hidden;

    white-space: nowrap;

    animation:
        typing 2.8s steps(26, end) 1.2s forwards;
}

.cursor {
    display: inline-block;

    width: 0.65em;
    height: 1.15em;

    margin-left: 3px;

    vertical-align: -0.15em;

    background: var(--terminal-green);

    box-shadow:
        0 0 5px rgba(0, 255, 102, 0.9),
        0 0 12px rgba(0, 255, 102, 0.5);

    animation: blink 0.85s step-end infinite;
}

@keyframes typing {
    from {
        width: 0;
    }

    to {
        width: 26ch;
    }
}

@keyframes blink {
    0%,
    48% {
        opacity: 1;
    }

    49%,
    100% {
        opacity: 0;
    }
}

@media (max-width: 600px) {
    .terminal {
        width: calc(100vw - 24px);
        min-height: 240px;
    }

    .terminal-body {
        padding: 24px 18px;

        font-size: 13px;
    }
}

/*
 * Respect users who disable motion.
 */
@media (prefers-reduced-motion: reduce) {
    .typing {
        width: 26ch;

        animation: none;
    }

    .cursor {
        animation: none;
    }
}
