:root {
    --bg: #0a0a0a;
    --text: #c8c8c8;
    --text-dim: #555;
    --red: #ff003c;
    --red-dim: #b00028;
    --red-glow: rgba(255, 0, 60, 0.6);
    --green: #00ff41;
    --green-dim: #008822;
    --font: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Scanline overlay */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0) 0px,
        rgba(0, 0, 0, 0) 1px,
        rgba(0, 0, 0, 0.15) 2px,
        rgba(0, 0, 0, 0.15) 3px
    );
    animation: scanline-move 8s linear infinite;
}

@keyframes scanline-move {
    0% { background-position: 0 0; }
    100% { background-position: 0 100px; }
}

/* Vignette */
.vignette {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 99;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.5) 100%);
}

/* Terminal container */
#terminal {
    width: 100%;
    max-width: 900px;
    height: 100vh;
    padding: 2rem 2.5rem;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

/* Boot output */
#boot-output {
    color: var(--red-dim);
    font-size: 13px;
    min-height: 0;
    overflow: hidden;
    transition: opacity 0.4s ease;
}

#boot-output .boot-line {
    white-space: pre;
}

#boot-output .boot-ok {
    color: var(--red);
}

#boot-output .boot-info {
    color: var(--text-dim);
}

/* Main content */
#main-content {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
    opacity: 0;
    transition: opacity 0.6s ease;
}

#main-content.visible {
    opacity: 1;
}

/* ASCII Art — Prism triangle (ANSI blocks) */
#ascii-art {
    color: var(--red);
    font-size: 22px;
    line-height: 1.1;
    letter-spacing: 0;
    margin-bottom: 1.5rem;
    text-shadow:
        0 0 5px var(--red-glow),
        0 0 12px var(--red-glow);
    white-space: pre;
    user-select: none;
}

/* Company name */
#text-block {
    flex-shrink: 0;
}

#company-name {
    color: var(--red);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-align: left;
    margin-bottom: 0.8rem;
    text-shadow:
        0 0 8px var(--red-glow),
        0 0 20px var(--red-glow);
    user-select: none;
}

/* Tagline */
#tagline {
    color: var(--text);
    font-size: 15px;
    letter-spacing: 0;
    text-transform: none;
    text-align: left;
    white-space: pre;
    min-width: 28ch;
}

/* Glitch effect */
.glitch {
    position: relative;
    animation: glitch-flicker 4s infinite;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.8;
    overflow: hidden;
}

.glitch::before {
    color: var(--red);
    animation: glitch-shift-1 3s infinite linear alternate;
    clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
    text-shadow: -2px 0 var(--red-dim);
}

.glitch::after {
    color: var(--red);
    animation: glitch-shift-2 2.5s infinite linear alternate;
    clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
    text-shadow: 2px 0 var(--red-dim);
}

@keyframes glitch-flicker {
    0%, 100% { opacity: 1; }
    92% { opacity: 1; }
    93% { opacity: 0.3; }
    94% { opacity: 1; }
    96% { opacity: 0.5; }
    97% { opacity: 1; }
}

@keyframes glitch-shift-1 {
    0%, 100% { transform: translate(0, 0); }
    20% { transform: translate(-1px, 0); }
    40% { transform: translate(1px, 0); }
    60% { transform: translate(-1px, 0); }
    80% { transform: translate(1px, 0); }
}

@keyframes glitch-shift-2 {
    0%, 100% { transform: translate(0, 0); }
    20% { transform: translate(1px, 0); }
    40% { transform: translate(-1px, 0); }
    60% { transform: translate(1px, 0); }
    80% { transform: translate(-1px, 0); }
}

/* Terminal prompt */
#terminal-prompt {
    font-size: 14px;
    margin-top: auto;
    padding-top: 1rem;
    opacity: 0;
    transition: opacity 0.4s ease;
}

#terminal-prompt.visible {
    opacity: 1;
}

#command-history {
    max-height: 30vh;
    overflow-y: auto;
    margin-bottom: 0.5rem;
}

#command-history .history-line {
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 0.15rem;
}

#command-history .cmd-input {
    color: var(--text);
}

#command-history .cmd-output {
    color: var(--text-dim);
}

#command-history .cmd-error {
    color: var(--red);
}

#command-history .cmd-red {
    color: var(--red);
}

#command-history .cmd-green {
    color: var(--green);
}

#prompt-line {
    white-space: pre-wrap;
    word-break: break-word;
}

.prompt-user {
    color: var(--red);
    text-shadow: 0 0 4px var(--red-glow);
}

.prompt-sep {
    color: var(--text-dim);
}

.prompt-path {
    color: #00aaff;
}

.prompt-symbol {
    color: var(--red);
}

#prompt-input {
    color: var(--text);
}

/* Cursor */
.cursor-blink {
    animation: blink 1s steps(2) infinite;
    color: var(--red);
}

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

/* Hidden input */
#hidden-input {
    position: fixed;
    top: 50%;
    left: 50%;
    opacity: 0;
    width: 1px;
    height: 1px;
    border: none;
    background: transparent;
    color: transparent;
    z-index: -1;
}

/* Scrollbar */
#command-history::-webkit-scrollbar {
    width: 4px;
}

#command-history::-webkit-scrollbar-track {
    background: transparent;
}

#command-history::-webkit-scrollbar-thumb {
    background: var(--red-dim);
    border-radius: 2px;
}

/* Responsive */
@media (max-width: 768px) {
    #terminal {
        padding: 1rem 1.2rem;
    }

    #main-content {
        flex-direction: column;
        gap: 1.2rem;
    }

    #ascii-art {
        font-size: 16px;
        line-height: 1.1;
    }

    #company-name {
        font-size: 20px;
        text-align: center;
    }

    #tagline {
        font-size: 12px;
        text-align: center;
        min-width: 0;
    }

    #boot-output {
        font-size: 11px;
    }

    #terminal-prompt {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    #ascii-art {
        font-size: 11px;
    }

    #company-name {
        font-size: 16px;
    }

    #tagline {
        font-size: 10px;
    }

    #terminal-prompt {
        font-size: 10px;
    }

    #boot-output {
        font-size: 9px;
    }
}

@media (max-height: 500px) {
    #ascii-art {
        font-size: 15px;
        margin-bottom: 0.5rem;
    }

    #company-name {
        font-size: 18px;
        margin-bottom: 0.3rem;
    }

    #tagline {
        font-size: 12px;
    }
}
