/* undo.sh — Terminal CRT Skeuomorphic */

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

:root {
    --phosphor: #33FF33;
    --dim-sage: #88AA88;
    --forest-comment: #607860;
    --desk: #2C2420;
    --error: #FF6B6B;
    --amber: #FFCC33;
    --bezel: #3A3A3A;
    --screen-bg: #0C1410;
}

body {
    background: var(--desk);
    margin: 0;
    overflow-x: hidden;
    font-family: 'Fira Code', monospace;
}

/* Desk surface */
.desk-surface {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    background:
        radial-gradient(ellipse at 50% 30%, rgba(60, 48, 36, 0.8), transparent 70%),
        radial-gradient(circle at 30% 70%, rgba(50, 40, 30, 0.4), transparent 50%),
        var(--desk);
}

/* Monitor */
.monitor {
    max-width: 860px;
    width: 100%;
}

/* Bezel */
.bezel {
    background: var(--bezel);
    padding: 40px;
    border-radius: 20px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        inset 0 -2px 0 rgba(0, 0, 0, 0.3);
}

/* Screen */
.screen {
    background: #000000;
    border-radius: 8px;
    padding: 32px;
    position: relative;
    overflow: hidden;
    min-height: 420px;
    transition: background 0.6s ease;
}

.screen.on {
    background: var(--screen-bg);
}

/* CRT overlay — scanlines and curvature */
.crt-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.15) 2px,
        rgba(0, 0, 0, 0.15) 4px
    );
    border-radius: 8px;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.screen.on .crt-overlay {
    opacity: 1;
}

/* Screen reflection */
.screen-reflection {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        ellipse at 30% 20%,
        rgba(255, 255, 255, 0.03),
        transparent 50%
    );
    pointer-events: none;
    z-index: 6;
}

/* Terminal content */
.terminal-content {
    position: relative;
    z-index: 4;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.screen.on .terminal-content {
    opacity: 1;
}

/* Command blocks */
.cmd-block {
    margin-bottom: 20px;
    opacity: 0;
    transform: translateY(4px);
}

.cmd-block.typed {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Text styles */
.prompt {
    color: var(--phosphor);
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 4px;
}

.command {
    color: var(--phosphor);
}

.output {
    color: var(--dim-sage);
    font-size: 14px;
    font-weight: 300;
    line-height: 1.5;
    margin-bottom: 2px;
    padding-left: 0;
}

.comment {
    color: var(--forest-comment);
    font-family: 'Recursive', sans-serif;
    font-weight: 300;
    font-size: 14px;
    font-style: italic;
    line-height: 1.5;
    margin-bottom: 2px;
}

.error {
    color: var(--error);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
}

.amber-output {
    color: var(--amber);
    font-size: 15px;
    font-weight: 400;
    line-height: 1.6;
    min-height: 24px;
}

/* Blinking cursor */
.cursor {
    display: inline-block;
    width: 8px;
    height: 16px;
    background: var(--phosphor);
    margin-left: 4px;
    vertical-align: text-bottom;
    animation: blink 1.2s step-end infinite;
    opacity: 0;
}

.cmd-block.typed:last-of-type .cursor,
.cmd-block.active .cursor {
    opacity: 1;
}

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

/* Monitor base */
.monitor-base {
    background: var(--bezel);
    margin: 0 60px;
    padding: 12px 24px;
    border-radius: 0 0 12px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* Power LED */
.power-led {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #333;
    transition: background 0.3s ease;
    box-shadow: none;
}

.power-led.on {
    background: var(--phosphor);
    box-shadow: 0 0 8px var(--phosphor), 0 0 16px rgba(51, 255, 51, 0.3);
    animation: ledPulse 3s ease-in-out infinite;
}

@keyframes ledPulse {
    0%, 100% { box-shadow: 0 0 8px var(--phosphor), 0 0 16px rgba(51, 255, 51, 0.3); }
    50% { box-shadow: 0 0 4px var(--phosphor), 0 0 8px rgba(51, 255, 51, 0.2); }
}

.version-label {
    font-family: 'Fira Code', monospace;
    font-size: 10px;
    color: #666;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
