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

:root {
    --primary-green: #00ff88;
    --primary-green-dim: #00cc6a;
    --bg-dark: #0a0e0d;
    --bg-darker: #050707;
    --terminal-bg: #0d1210;
    --terminal-border: #1a2622;
    --text-gray: #7a8a85;
    --text-dim: #4a5a55;
}

body {
    background: radial-gradient(ellipse at top, var(--bg-dark) 0%, var(--bg-darker) 100%);
    font-family: 'JetBrains Mono', 'Courier New', Courier, Monaco, monospace;
    overflow: hidden;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Animated background grid */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 255, 136, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 136, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    animation: gridMove 20s linear infinite;
    pointer-events: none;
    opacity: 0.4;
}

@keyframes gridMove {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(60px, 60px);
    }
}

/* Ambient glow effect */
body::after {
    content: "";
    position: fixed;
    top: 50%;
    left: 50%;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(0, 255, 136, 0.08) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    pointer-events: none;
    animation: ambientPulse 8s ease-in-out infinite;
}

@keyframes ambientPulse {
    0%, 100% {
        opacity: 0.3;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

.terminal-window {
    width: 90%;
    max-width: 1100px;
    background: linear-gradient(135deg, var(--terminal-bg) 0%, #0a0d0b 100%);
    border: 1px solid var(--terminal-border);
    border-radius: 12px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.7),
        0 0 80px rgba(0, 255, 136, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.03),
        inset 0 0 100px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    position: relative;
    z-index: 10;
    backdrop-filter: blur(10px);
    animation: windowAppear 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes windowAppear {
    0% {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.terminal-header {
    background: linear-gradient(180deg, rgba(26, 38, 34, 0.8) 0%, rgba(15, 20, 18, 0.9) 100%);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(0, 255, 136, 0.1);
    gap: 20px;
    backdrop-filter: blur(10px);
}

.terminal-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.terminal-buttons span {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    display: inline-block;
    position: relative;
    transition: all 0.3s ease;
}

.terminal-buttons span::after {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-close {
    background: linear-gradient(135deg, #ff5f57 0%, #ff4743 100%);
    box-shadow: 0 0 8px rgba(255, 95, 87, 0.4);
}

.btn-minimize {
    background: linear-gradient(135deg, #ffbd2e 0%, #ffaa00 100%);
    box-shadow: 0 0 8px rgba(255, 189, 46, 0.4);
}

.btn-maximize {
    background: linear-gradient(135deg, #28ca42 0%, #20a035 100%);
    box-shadow: 0 0 8px rgba(40, 202, 66, 0.4);
}

.terminal-title {
    color: var(--text-gray);
    font-size: 0.875rem;
    flex: 1;
    text-align: center;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.terminal-container {
    padding: 3rem 2.5rem;
    min-height: 320px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.terminal-line {
    color: var(--text-gray);
    font-size: clamp(0.875rem, 1.5vw, 1rem);
    margin-bottom: 1.5rem;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
    font-weight: 500;
    letter-spacing: -0.02em;
    animation: lineAppear 0.6s ease 0.3s both;
}

@keyframes lineAppear {
    0% {
        opacity: 0;
        transform: translateX(-10px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.prompt {
    color: var(--primary-green);
    font-weight: 600;
}

.separator {
    color: var(--text-dim);
    margin: 0 3px;
}

.path {
    color: #57d7ff;
    font-weight: 500;
}

.dollar {
    color: var(--text-gray);
    margin: 0 8px;
}

.command {
    color: #ffd93d;
    font-weight: 500;
}

.terminal-output {
    color: var(--primary-green);
    font-size: clamp(1.25rem, 3vw, 2.25rem);
    line-height: 1.6;
    margin-top: 2rem;
    font-weight: 600;
    letter-spacing: -0.03em;
    text-shadow: 
        0 0 20px rgba(0, 255, 136, 0.6),
        0 0 40px rgba(0, 255, 136, 0.3),
        0 0 60px rgba(0, 255, 136, 0.15);
    animation: pulse 4s ease-in-out infinite;
}

.output-prefix {
    color: var(--text-dim);
    font-size: 0.75em;
    margin-right: 12px;
    text-shadow: none;
    font-weight: 500;
    letter-spacing: 0.05em;
}

#typed-text {
    display: inline-block;
}

/* Premium blinking cursor */
.cursor {
    display: inline-block;
    width: 0.5em;
    height: 1em;
    background: linear-gradient(180deg, var(--primary-green) 0%, var(--primary-green-dim) 100%);
    margin-left: 6px;
    animation: cursorBlink 1s step-end infinite;
    vertical-align: text-bottom;
    box-shadow: 
        0 0 20px rgba(0, 255, 136, 0.8),
        0 0 40px rgba(0, 255, 136, 0.4);
    border-radius: 2px;
}

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

/* Sophisticated pulsating effect */
@keyframes pulse {
    0%, 100% {
        text-shadow: 
            0 0 20px rgba(0, 255, 136, 0.6),
            0 0 40px rgba(0, 255, 136, 0.3),
            0 0 60px rgba(0, 255, 136, 0.15);
        opacity: 0.92;
    }
    50% {
        text-shadow: 
            0 0 30px rgba(0, 255, 136, 0.8),
            0 0 60px rgba(0, 255, 136, 0.5),
            0 0 90px rgba(0, 255, 136, 0.25);
        opacity: 1;
    }
}

/* Scanline effect */
.terminal-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.08),
        rgba(0, 0, 0, 0.08) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    opacity: 0.5;
}

/* Responsive - Tablet */
@media (max-width: 1024px) {
    .terminal-window {
        width: 92%;
        max-width: 900px;
    }
    
    .terminal-container {
        padding: 2.5rem 2rem;
    }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    body::after {
        width: 500px;
        height: 500px;
    }
    
    .terminal-window {
        width: 95%;
        border-radius: 10px;
    }
    
    .terminal-container {
        padding: 2rem 1.5rem;
        min-height: 280px;
    }
    
    .terminal-header {
        padding: 14px 16px;
    }
    
    .terminal-title {
        font-size: 0.8rem;
    }
    
    .terminal-buttons span {
        width: 12px;
        height: 12px;
    }
    
    .cursor {
        width: 0.45em;
        margin-left: 4px;
    }
    
    .terminal-line {
        font-size: 0.8rem;
        margin-bottom: 1.2rem;
    }
    
    .terminal-output {
        margin-top: 1.5rem;
        line-height: 1.5;
    }
    
    .output-prefix {
        display: block;
        margin-bottom: 0.5rem;
        margin-right: 0;
    }
}

/* Responsive - Small Mobile */
@media (max-width: 480px) {
    .terminal-window {
        width: 96%;
        border-radius: 8px;
    }
    
    .terminal-container {
        padding: 1.75rem 1.25rem;
        min-height: 240px;
    }
    
    .terminal-header {
        padding: 12px 14px;
        gap: 12px;
    }
    
    .terminal-title {
        font-size: 0.7rem;
    }
    
    .terminal-buttons {
        gap: 8px;
    }
    
    .terminal-buttons span {
        width: 11px;
        height: 11px;
    }
    
    .terminal-line {
        font-size: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .dollar {
        margin: 0 6px;
    }
    
    .terminal-output {
        font-size: clamp(1rem, 5vw, 1.5rem);
        margin-top: 1.25rem;
    }
    
    .cursor {
        width: 0.4em;
        margin-left: 3px;
    }
}

/* Ultra small screens */
@media (max-width: 360px) {
    .terminal-container {
        padding: 1.5rem 1rem;
    }
    
    .terminal-line {
        font-size: 0.7rem;
    }
    
    .output-prefix {
        font-size: 0.65em;
    }
}

/* Landscape mobile optimization */
@media (max-height: 600px) and (orientation: landscape) {
    .terminal-container {
        padding: 1.5rem 2rem;
        min-height: 200px;
    }
    
    .terminal-output {
        margin-top: 1rem;
        font-size: clamp(1rem, 3vw, 1.5rem);
    }
    
    .terminal-line {
        margin-bottom: 0.75rem;
    }
}

/* High DPI screens optimization */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    body {
        -webkit-font-smoothing: subpixel-antialiased;
    }
    
    .terminal-window {
        border-width: 0.5px;
    }
}
