/* 80s Synthwave Style */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --neon-blue: #32DEED;
    --neon-pink: #F72DE3;
    --dark-bg: #0a0a0a;
    --grid-color: rgba(50, 222, 237, 0.2);
    --text-glow: 0 0 10px currentColor;
}

@keyframes neon-flicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

@keyframes scan {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}

@keyframes grid-move {
    0% { transform: translateY(0); }
    100% { transform: translateY(50px); }
}

@keyframes glitch {
    0%, 100% { 
        text-shadow: 
            0.05em 0 0 var(--neon-pink),
            -0.05em 0 0 var(--neon-blue),
            0 0 20px var(--neon-pink);
    }
    50% {
        text-shadow: 
            -0.05em 0 0 var(--neon-pink),
            0.05em 0 0 var(--neon-blue),
            0 0 25px var(--neon-blue);
    }
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink {
    50% { opacity: 0; }
}

@keyframes progress {
    0% { width: 0%; }
    100% { width: 90%; }
}

@keyframes float {
    0%, 100% { transform: translateY(0) translateX(0); }
    25% { transform: translateY(-20px) translateX(10px); }
    50% { transform: translateY(10px) translateX(-5px); }
    75% { transform: translateY(-10px) translateX(-10px); }
}

body {
    font-family: 'Orbitron', monospace;
    background: var(--dark-bg);
    color: #fff;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* Scanlines effect */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15),
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 2px
    );
}

.scanlines::before {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        0deg,
        transparent 0%,
        rgba(255, 255, 255, 0.03) 50%,
        transparent 100%
    );
    animation: scan 8s linear infinite;
}

/* Grid background */
.grid-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 200%;
    background-image: 
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: grid-move 10s linear infinite;
    opacity: 0.3;
    z-index: 0;
}

/* Particles */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.particles span {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--neon-pink);
    box-shadow: 0 0 10px var(--neon-pink);
    animation: float 20s infinite ease-in-out;
}

.particles span:nth-child(odd) {
    background: var(--neon-blue);
    box-shadow: 0 0 10px var(--neon-blue);
}

.particles span:nth-child(1) { top: 10%; left: 20%; animation-delay: 0s; }
.particles span:nth-child(2) { top: 20%; left: 80%; animation-delay: 2s; }
.particles span:nth-child(3) { top: 60%; left: 10%; animation-delay: 4s; }
.particles span:nth-child(4) { top: 80%; left: 70%; animation-delay: 6s; }
.particles span:nth-child(5) { top: 30%; left: 50%; animation-delay: 8s; }
.particles span:nth-child(6) { top: 70%; left: 30%; animation-delay: 10s; }
.particles span:nth-child(7) { top: 50%; left: 90%; animation-delay: 12s; }
.particles span:nth-child(8) { top: 90%; left: 20%; animation-delay: 14s; }
.particles span:nth-child(9) { top: 40%; left: 60%; animation-delay: 16s; }
.particles span:nth-child(10) { top: 15%; left: 40%; animation-delay: 18s; }

/* Navigation */
.navbar {
    position: relative;
    z-index: 10;
    padding: 30px 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--neon-blue);
    box-shadow: 0 2px 20px rgba(50, 222, 237, 0.5);
}

.logo-container {
    position: relative;
}

.logo-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 60px;
    background: radial-gradient(ellipse at center, var(--neon-pink) 0%, transparent 70%);
    filter: blur(20px);
    opacity: 0.5;
    animation: neon-flicker 2s infinite;
}

.logo {
    font-family: 'Audiowide', cursive;
    font-size: 36px;
    font-weight: 900;
    letter-spacing: 4px;
    color: var(--neon-blue);
    text-shadow: 
        0 0 10px var(--neon-blue),
        0 0 20px var(--neon-blue),
        0 0 30px var(--neon-blue);
    position: relative;
    z-index: 1;
}

.logo-sub {
    display: block;
    font-size: 14px;
    letter-spacing: 8px;
    color: var(--neon-pink);
    text-shadow: 
        0 0 5px var(--neon-pink),
        0 0 10px var(--neon-pink);
    margin-top: -5px;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.music-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid var(--neon-blue);
    color: var(--neon-blue);
    padding: 8px 12px;
    font-family: 'Orbitron', monospace;
    font-size: 10px;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.music-toggle:hover {
    border-color: var(--neon-pink);
    color: var(--neon-pink);
    box-shadow: 0 0 15px rgba(247, 45, 227, 0.3);
}

.music-toggle.active {
    background: rgba(247, 45, 227, 0.1);
    border-color: var(--neon-pink);
    color: var(--neon-pink);
    box-shadow: 0 0 15px rgba(247, 45, 227, 0.5);
}

.music-toggle.active .music-icon {
    animation: neon-flicker 0.5s infinite;
}

.music-icon {
    font-size: 14px;
}

.music-text {
    font-weight: 400;
}

.nav-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    letter-spacing: 2px;
    color: var(--neon-blue);
}

.status-indicator {
    width: 8px;
    height: 8px;
    background: var(--neon-blue);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--neon-blue);
    animation: neon-flicker 1s infinite;
}

/* Hero */
.hero {
    position: relative;
    z-index: 5;
    padding: 50px 40px 30px 40px;
    min-height: calc(90vh - 100px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.hero-content {
    text-align: center;
    margin-bottom: 50px;
}

.neon-frame {
    padding: 40px;
    border: 2px solid var(--neon-pink);
    position: relative;
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 
        inset 0 0 30px rgba(247, 45, 227, 0.2),
        0 0 30px rgba(247, 45, 227, 0.3);
}

.neon-frame::before,
.neon-frame::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid var(--neon-blue);
}

.neon-frame::before {
    top: -10px;
    left: -10px;
    border-right: none;
    border-bottom: none;
}

.neon-frame::after {
    bottom: -10px;
    right: -10px;
    border-left: none;
    border-top: none;
}

.hero-title {
    font-size: 42px;
    margin-bottom: 15px;
    line-height: 1.1;
}

.glitch {
    position: relative;
    color: var(--neon-pink);
    letter-spacing: 8px;
    animation: glitch 2s infinite;
}

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

.glitch::before {
    animation: glitch-1 0.5s infinite;
    color: var(--neon-blue);
    z-index: -1;
}

.glitch::after {
    animation: glitch-2 0.5s infinite;
    color: var(--neon-pink);
    z-index: -2;
}

@keyframes glitch-1 {
    0%, 100% { clip: rect(0, 900px, 0, 0); }
    25% { clip: rect(20px, 900px, 40px, 0); }
    50% { clip: rect(40px, 900px, 60px, 0); }
    75% { clip: rect(60px, 900px, 80px, 0); }
}

@keyframes glitch-2 {
    0%, 100% { clip: rect(0, 900px, 0, 0); }
    25% { clip: rect(60px, 900px, 80px, 0); }
    50% { clip: rect(20px, 900px, 40px, 0); }
    75% { clip: rect(40px, 900px, 60px, 0); }
}

.hero-subtitle {
    display: block;
    font-size: 24px;
    color: var(--neon-blue);
    letter-spacing: 4px;
    margin-top: 10px;
    text-shadow: var(--text-glow);
}

.intro-text {
    color: var(--neon-blue);
    font-size: 14px;
    letter-spacing: 2px;
    margin: 20px 0;
    opacity: 0.8;
}

/* Terminal */
.terminal-window {
    background: #000;
    border: 1px solid var(--neon-blue);
    border-radius: 8px;
    overflow: hidden;
    margin-top: 25px;
    box-shadow: 0 0 20px rgba(50, 222, 237, 0.3);
    max-width: 550px;
    margin-left: auto;
    margin-right: auto;
}

.terminal-header {
    background: #222;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--neon-blue);
}

.terminal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.terminal-dot.red { background: var(--neon-pink); box-shadow: 0 0 5px var(--neon-pink); }
.terminal-dot.yellow { background: var(--neon-blue); box-shadow: 0 0 5px var(--neon-blue); }
.terminal-dot.green { background: #00FFF0; box-shadow: 0 0 5px #00FFF0; }

.terminal-title {
    margin-left: auto;
    font-size: 12px;
    color: var(--neon-blue);
    opacity: 0.7;
}

.terminal-content {
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.terminal-line {
    color: var(--neon-blue);
    margin-bottom: 10px;
    opacity: 0;
    animation: fadeIn 0.5s forwards;
}

.terminal-line:nth-child(1) { animation-delay: 0.5s; }
.terminal-line:nth-child(2) { animation-delay: 1s; }
.terminal-line:nth-child(3) { animation-delay: 1.5s; }

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

.blink {
    animation: blink 1s infinite;
}

/* Tools Preview */
.tools-preview {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 24px;
    color: var(--neon-pink);
    letter-spacing: 3px;
    margin-bottom: 35px;
    text-shadow: var(--text-glow);
}

.bracket {
    color: var(--neon-blue);
}

.experiment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    padding: 0 20px;
}

.experiment-card {
    position: relative;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid var(--neon-blue);
    padding: 25px;
    transition: all 0.3s;
    cursor: pointer;
}

/* Retro computer hover effects */
.experiment-card:hover {
    transform: translateY(-2px);
    background: rgba(0, 20, 40, 0.9);
}

/* C64/Amiga style scanline effect on hover */
.experiment-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(50, 222, 237, 0.1) 2px,
        rgba(50, 222, 237, 0.1) 4px
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.experiment-card:hover::before {
    opacity: 1;
    animation: retro-scan 0.8s ease-out;
}

/* Retro CRT monitor effect */
@keyframes retro-scan {
    0% {
        background-position: 0 -100px;
        opacity: 0;
    }
    50% {
        opacity: 0.8;
    }
    100% {
        background-position: 0 0;
        opacity: 0.4;
    }
}

/* Retro border effect on hover */
.card-border {
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: none;
    border: 2px solid transparent;
    z-index: -1;
    opacity: 0;
    transition: all 0.3s;
}

.experiment-card:hover .card-border {
    opacity: 1;
    border-color: var(--neon-blue);
    animation: retro-border 1s ease-out;
}

/* C64 style border animation */
@keyframes retro-border {
    0% {
        border-color: var(--neon-blue);
        filter: brightness(1);
    }
    25% {
        border-color: var(--neon-pink);
        filter: brightness(1.3);
    }
    50% {
        border-color: #00ff00;
        filter: brightness(1.1);
    }
    75% {
        border-color: #ffff00;
        filter: brightness(1.2);
    }
    100% {
        border-color: var(--neon-blue);
        filter: brightness(1);
    }
}

/* App-specific retro hover effects */
.app-link:hover {
    transform: translateY(-2px) scale(1.01);
    background: linear-gradient(
        45deg,
        rgba(0, 20, 40, 0.9),
        rgba(0, 30, 60, 0.9)
    );
}

.app-link:active {
    transform: translateY(-2px) scale(1.01);
    transition: all 0.1s;
}

/* Coming soon card with retro effect */
.coming-soon {
    opacity: 0.7;
    cursor: default;
}

.coming-soon:hover {
    transform: translateY(-1px);
    background: rgba(40, 40, 0, 0.6);
}

.coming-soon:hover::before {
    opacity: 0.3;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 3px,
        rgba(255, 255, 0, 0.1) 3px,
        rgba(255, 255, 0, 0.1) 6px
    );
}

/* Retro text glow effect on hover */
.experiment-card:hover h4 {
    color: var(--neon-blue);
    text-shadow: 
        0 0 5px currentColor,
        -1px -1px 0 #000,
        1px 1px 0 rgba(50, 222, 237, 0.5);
    animation: retro-text-flicker 0.1s ease-in-out 3;
}

@keyframes retro-text-flicker {
    0%, 100% {
        opacity: 1;
        text-shadow: 
            0 0 5px currentColor,
            -1px -1px 0 #000,
            1px 1px 0 rgba(50, 222, 237, 0.5);
    }
    50% {
        opacity: 0.9;
        text-shadow: 
            0 0 3px currentColor,
            -1px -1px 0 #000,
            1px 1px 0 rgba(50, 222, 237, 0.3);
    }
}

/* Retro loading bar effect */
.app-link:hover .progress-fill {
    background: linear-gradient(
        90deg,
        #00ff00,
        #00aa00,
        #00ff00
    );
    animation: retro-loading 2s ease-in-out infinite;
    box-shadow: 
        0 0 10px #00ff00,
        inset 0 0 5px rgba(0, 0, 0, 0.5);
}

@keyframes retro-loading {
    0%, 100% {
        background: linear-gradient(90deg, #00ff00, #00aa00, #00ff00);
        box-shadow: 0 0 10px #00ff00, inset 0 0 5px rgba(0, 0, 0, 0.5);
    }
    33% {
        background: linear-gradient(90deg, #00aa00, #00ff00, #00aa00);
        box-shadow: 0 0 15px #00ff00, inset 0 0 3px rgba(0, 0, 0, 0.3);
    }
    66% {
        background: linear-gradient(90deg, #00ff00, #00ff00, #00aa00);
        box-shadow: 0 0 12px #00ff00, inset 0 0 4px rgba(0, 0, 0, 0.4);
    }
}

/* Retro border styles moved above */

.card-content h4 {
    color: var(--neon-blue);
    font-size: 18px;
    letter-spacing: 2px;
    margin-bottom: 15px;
    text-shadow: var(--text-glow);
}

.experiment-status {
    color: var(--neon-pink);
    font-size: 12px;
    letter-spacing: 1px;
    margin-bottom: 20px;
    opacity: 0.8;
}

.progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--neon-blue), var(--neon-pink));
    animation: progress 3s ease-out forwards;
    box-shadow: 0 0 10px currentColor;
}

.progress-fill.delay-1 { animation-delay: 0.5s; }
.progress-fill.delay-2 { animation-delay: 1s; }

.progress-fill.complete {
    width: 100%;
    background: linear-gradient(90deg, #00ff88, var(--neon-blue));
    animation: none;
    box-shadow: 0 0 15px #00ff88;
}

/* App icon styles */
.app-icon {
    font-size: 40px;
    text-align: center;
    margin-bottom: 12px;
    filter: drop-shadow(0 0 10px currentColor);
}

.app-description {
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    line-height: 1.3;
    margin-bottom: 12px;
    font-family: 'Orbitron', monospace;
    letter-spacing: 0.5px;
}

/* App tags */
.app-tags {
    display: flex;
    gap: 8px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.tag {
    background: rgba(50, 222, 237, 0.2);
    color: var(--neon-blue);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    letter-spacing: 1px;
    border: 1px solid rgba(50, 222, 237, 0.3);
    transition: all 0.3s;
}

.app-link:hover .tag {
    background: rgba(0, 255, 0, 0.2);
    color: #00ff00;
    border-color: #00ff00;
    text-shadow: 0 0 5px #00ff00;
    transform: translateY(-1px);
    animation: retro-tag-blink 0.5s ease-in-out 2;
}

@keyframes retro-tag-blink {
    0%, 100% {
        background: rgba(0, 255, 0, 0.2);
        color: #00ff00;
    }
    50% {
        background: rgba(0, 255, 0, 0.4);
        color: #ffffff;
    }
}

/* Loading animation for app cards */
@keyframes app-load {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.app-link {
    animation: app-load 0.6s ease-out forwards;
}

.app-link[data-app="rtrader"] {
    animation-delay: 0.3s;
}

/* Pulse effect for online status */
@keyframes pulse-online {
    0%, 100% {
        color: #00ff88;
        text-shadow: 0 0 10px #00ff88;
    }
    50% {
        color: #00cc66;
        text-shadow: 0 0 20px #00ff88;
    }
}

.app-link .experiment-status {
    animation: pulse-online 2s infinite;
}

/* Company Info */
.company-info {
    text-align: center;
    margin-top: 50px;
    padding-bottom: 30px;
}

.company-text {
    font-size: 14px;
    letter-spacing: 2px;
    color: var(--neon-blue);
    margin-bottom: 10px;
}

.company-link {
    color: var(--neon-pink);
    text-decoration: none;
    transition: all 0.3s;
}

.company-link:hover {
    text-shadow: 0 0 20px var(--neon-pink);
}

.year {
    font-size: 12px;
    color: #666;
    letter-spacing: 4px;
}

/* Audio element (hidden) */
#background-music {
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        padding: 20px;
        flex-direction: column;
        gap: 20px;
    }
    
    .nav-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .music-toggle {
        font-size: 9px;
        padding: 6px 10px;
    }
    
    .logo {
        font-size: 28px;
    }
    
    .hero {
        padding: 40px 20px;
    }
    
    .neon-frame {
        padding: 30px 20px;
    }
    
    .hero-title {
        font-size: 32px;
    }
    
    .hero-subtitle {
        font-size: 18px;
    }
    
    .experiment-grid {
        grid-template-columns: 1fr;
    }
}