@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

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

body {
    font-family: 'VT323', monospace;
    background: linear-gradient(135deg, #1a1a1a, #0a0a0a);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.crt-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1000px;
    padding: 20px;
    box-sizing: border-box;
}

.crt-frame {
    position: relative;
    transform: rotateX(2deg);
}

.reset-button {
    position: absolute;
    top: -50px;
    right: 20px;
    background: linear-gradient(145deg, #c41e3a, #8b0020);
    border: 3px solid #2a2a2a;
    border-radius: 8px;
    padding: 10px 20px;
    color: #fff;
    font-family: 'VT323', monospace;
    font-size: 18px;
    letter-spacing: 2px;
    cursor: pointer;
    box-shadow:
        inset 0 -2px 5px rgba(0,0,0,0.5),
        0 2px 5px rgba(0,0,0,0.3);
    transition: all 0.2s;
    z-index: 10;
}

.reset-button:hover {
    background: linear-gradient(145deg, #e41e3a, #a00020);
    transform: translateY(1px);
    box-shadow:
        inset 0 -1px 3px rgba(0,0,0,0.5),
        0 1px 3px rgba(0,0,0,0.3);
}

.reset-button:active {
    transform: translateY(2px);
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.7);
    background: linear-gradient(145deg, #a00020, #600010);
}

.crt-bezel {
    background: linear-gradient(145deg, #3a3a3a, #1a1a1a);
    padding: clamp(20px, 3vw, 40px);
    border-radius: 30px;
    box-shadow:
        inset 0 0 50px rgba(0,0,0,0.5),
        0 20px 60px rgba(0,0,0,0.8),
        0 40px 80px rgba(0,0,0,0.6);
    position: relative;
    max-width: 95vw;
    max-height: 90vh;
}

.crt-bezel::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    background: linear-gradient(145deg, #2a2a2a, #151515);
    border-radius: 25px;
    z-index: -1;
}

.crt-screen {
    width: clamp(320px, 80vw, 900px);
    height: clamp(400px, 70vh, 675px);
    background: #0a0f0a;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    box-shadow:
        inset 0 0 100px rgba(0,255,100,0.1),
        inset 0 0 20px rgba(0,0,0,0.9),
        0 0 40px rgba(0,255,100,0.2);
}

.crt-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(
        ellipse at center,
        rgba(0,255,100,0.03) 0%,
        rgba(0,0,0,0.5) 100%
    );
    pointer-events: none;
}

.crt-screen::after {
    content: '';
    position: absolute;
    top: -20%;
    left: -20%;
    right: -20%;
    bottom: -20%;
    background: linear-gradient(
        0deg,
        transparent 0%,
        rgba(0,255,100,0.03) 50%,
        transparent 100%
    );
    animation: flicker 0.15s infinite;
    pointer-events: none;
}

.crt-content {
    position: relative;
    z-index: 2;
    padding: 40px;
    height: 100%;
    display: flex;
    flex-direction: column;
    color: #00ff66;
    text-shadow: 0 0 5px #00ff66;
}

.crt-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0,255,100,0.03) 2px,
        rgba(0,255,100,0.03) 4px
    );
    pointer-events: none;
    z-index: 3;
}

.crt-scanlines {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        transparent 50%,
        rgba(0,0,0,0.1) 50%
    );
    background-size: 100% 4px;
    animation: scanlines 8s linear infinite;
    pointer-events: none;
    z-index: 4;
}

.crt-header {
    text-align: center;
    margin-bottom: 30px;
}

.logo {
    width: 500px;
    height: auto;
    margin-bottom: 30px;
    filter: drop-shadow(0 0 15px rgba(255,255,255,0.3));
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    will-change: transform;
}

.main-nav {
    display: flex;
    justify-content: center;
    gap: 40px;
    font-size: 24px;
    letter-spacing: 3px;
}

.nav-link {
    color: #00ff66;
    text-decoration: none;
    position: relative;
    transition: all 0.3s;
}

.nav-link:hover {
    text-shadow: 0 0 10px #00ff66, 0 0 20px #00ff66;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    right: 0;
    height: 2px;
    background: #00ff66;
    box-shadow: 0 0 10px #00ff66;
}

.hero-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-top: -24px;
}

.terminal-text {
    text-align: center;
}

.typing-container {
    font-size: 48px;
    letter-spacing: 4px;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.prompt {
    margin-right: 10px;
    animation: pulse 2s infinite;
}

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

.cursor {
    animation: blink-cursor 1s infinite;
    margin-left: 5px;
}

.sub-text {
    font-size: 28px;
    letter-spacing: 2px;
    line-height: 1.6;
    opacity: 0.8;
}

.sub-text p {
    margin: 10px 0;
}

.crt-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid rgba(0,255,102,0.3);
}

.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 20px;
    letter-spacing: 2px;
}

.blink {
    animation: blink-cursor 1s infinite;
}

.monitor-controls {
    position: absolute;
    bottom: 20px;
    right: 40px;
    display: flex;
    gap: 15px;
    align-items: center;
}

.control-button {
    width: 30px;
    height: 30px;
    background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
    border-radius: 50%;
    box-shadow:
        inset 0 2px 4px rgba(255,255,255,0.1),
        0 2px 4px rgba(0,0,0,0.5);
}

.power-led {
    width: 10px;
    height: 10px;
    background: #00ff66;
    border-radius: 50%;
    box-shadow: 0 0 10px #00ff66;
    animation: led-pulse 2s infinite;
    margin-left: 10px;
}

.monitor-stand {
    width: clamp(120px, 20vw, 200px);
    height: clamp(60px, 10vh, 100px);
    background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
    margin: -20px auto 0;
    clip-path: polygon(20% 0%, 80% 0%, 100% 100%, 0% 100%);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    display: none;
}

@media (min-height: 700px) {
    .monitor-stand {
        display: block;
    }
}

@keyframes scanlines {
    0% { transform: translateY(0); }
    100% { transform: translateY(4px); }
}

@keyframes flicker {
    0% { opacity: 0.27861; }
    5% { opacity: 0.34769; }
    10% { opacity: 0.23604; }
    15% { opacity: 0.90626; }
    20% { opacity: 0.18128; }
    25% { opacity: 0.83891; }
    30% { opacity: 0.65583; }
    35% { opacity: 0.67807; }
    40% { opacity: 0.26559; }
    45% { opacity: 0.84693; }
    50% { opacity: 0.96019; }
    55% { opacity: 0.08594; }
    60% { opacity: 0.20313; }
    65% { opacity: 0.71988; }
    70% { opacity: 0.53455; }
    75% { opacity: 0.37288; }
    80% { opacity: 0.71428; }
    85% { opacity: 0.70419; }
    90% { opacity: 0.7003; }
    95% { opacity: 0.36108; }
    100% { opacity: 0.24387; }
}

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

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

@keyframes led-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes crt-shutdown {
    0% {
        transform: scaleY(1) scaleX(1);
        filter: brightness(1);
        opacity: 1;
    }
    20% {
        transform: scaleY(0.8) scaleX(1);
        filter: brightness(1.2);
    }
    40% {
        transform: scaleY(0.4) scaleX(1);
        filter: brightness(1.4);
    }
    60% {
        transform: scaleY(0.1) scaleX(0.8);
        filter: brightness(1.8);
    }
    80% {
        transform: scaleY(0.005) scaleX(0.3);
        filter: brightness(3);
    }
    90% {
        transform: scaleY(0.001) scaleX(0.001);
        filter: brightness(5);
    }
    100% {
        transform: scaleY(0) scaleX(0);
        filter: brightness(0);
        opacity: 0;
    }
}

@keyframes phosphor-fade {
    0% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 80px 40px #00ff66;
    }
    50% {
        opacity: 0.8;
        transform: scale(0.8);
        box-shadow: 0 0 60px 30px #00ff66;
    }
    100% {
        opacity: 0;
        transform: scale(0.3);
        box-shadow: 0 0 10px 5px transparent;
    }
}

@keyframes crt-poweron {
    0% {
        transform: scaleY(0) scaleX(0);
        filter: brightness(5);
        opacity: 0;
    }
    10% {
        transform: scaleY(0.001) scaleX(0.001);
        filter: brightness(5);
        opacity: 1;
    }
    20% {
        transform: scaleY(0.005) scaleX(0.1);
        filter: brightness(3);
    }
    40% {
        transform: scaleY(0.1) scaleX(0.5);
        filter: brightness(2);
    }
    60% {
        transform: scaleY(0.5) scaleX(0.9);
        filter: brightness(1.5);
    }
    80% {
        transform: scaleY(0.9) scaleX(1);
        filter: brightness(1.2);
    }
    90% {
        transform: scaleY(1.05) scaleX(1.02);
        filter: brightness(1.1);
    }
    100% {
        transform: scaleY(1) scaleX(1);
        filter: brightness(1);
    }
}

.crt-screen.shutting-down .crt-content {
    animation: crt-shutdown 1.5s ease-in forwards;
    transform-origin: center center;
}

.crt-screen.shutting-down::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: radial-gradient(circle, #00ff66, transparent);
    border-radius: 50%;
    opacity: 0;
    animation: phosphor-fade 3s ease-out 1.2s forwards;
    z-index: 100;
    pointer-events: none;
}

.crt-screen.powering-on .crt-content {
    animation: crt-poweron 2s ease-out forwards;
    transform-origin: center center;
}

.crt-screen.shutting-down .crt-overlay,
.crt-screen.shutting-down .crt-scanlines {
    animation: fadeOut 0.5s forwards;
}

.crt-screen.powering-on .crt-overlay,
.crt-screen.powering-on .crt-scanlines {
    animation: fadeIn 1s 1s forwards;
    opacity: 0;
}

@keyframes fadeOut {
    to { opacity: 0; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (max-width: 1024px) {
    .typing-container {
        font-size: clamp(24px, 4vw, 36px);
    }

    .sub-text {
        font-size: clamp(18px, 3vw, 24px);
    }

    .logo {
        width: clamp(300px, 50vw, 500px);
    }
}

@media (max-height: 650px) {
    .crt-content {
        padding: 20px;
    }

    .crt-header {
        margin-bottom: 30px;
    }

    .logo {
        width: 360px;
        margin-bottom: 20px;
    }
}