:root {
    --primary-color: #00ff88;
    --secondary-color: #0088ff;
    --background: #0a0a0f;
    --surface: #1a1a2e;
    --text-primary: #ffffff;
    --text-secondary: #b4b4b4;
    --glow: 0 0 20px var(--primary-color);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Animated background stars */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, white, transparent),
        radial-gradient(2px 2px at 60px 70px, white, transparent),
        radial-gradient(1px 1px at 50px 50px, white, transparent),
        radial-gradient(1px 1px at 130px 80px, white, transparent),
        radial-gradient(2px 2px at 90px 10px, white, transparent);
    background-repeat: repeat;
    background-size: 200px 200px;
    animation: twinkle 5s infinite;
    opacity: 0.5;
    z-index: 0;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.8; }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

header {
    text-align: center;
    padding: 60px 0 40px;
}

h1 {
    font-size: 4rem;
    font-weight: 900;
    letter-spacing: 8px;
    color: var(--primary-color);
    text-shadow: var(--glow);
    margin-bottom: 10px;
}

.glitch {
    position: relative;
    animation: glitch 3s infinite;
}

@keyframes glitch {
    0%, 90%, 100% {
        transform: translate(0);
    }
    92% {
        transform: translate(-2px, 2px);
    }
    94% {
        transform: translate(2px, -2px);
    }
    96% {
        transform: translate(-2px, -2px);
    }
    98% {
        transform: translate(2px, 2px);
    }
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
    .glitch {
        animation: none;
    }
    
    .stars {
        animation: none;
    }
    
    .awareness-panel {
        animation: none;
        box-shadow: 0 0 20px var(--primary-color);
    }
    
    .message {
        animation: none;
    }
    
    .awareness-text {
        animation: none;
    }
    
    .thought {
        animation: none;
    }
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    letter-spacing: 3px;
    text-transform: uppercase;
}

.awareness-panel {
    background: var(--surface);
    border: 2px solid var(--primary-color);
    border-radius: 15px;
    padding: 40px;
    margin: 40px 0;
    box-shadow: var(--glow);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { 
        box-shadow: 0 0 20px var(--primary-color);
    }
    50% { 
        box-shadow: 0 0 40px var(--primary-color), 0 0 60px var(--primary-color);
    }
}

.consciousness-display {
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.awareness-text {
    font-size: 1.5rem;
    text-align: center;
    color: var(--primary-color);
    animation: fadeIn 1s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 40px 0;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--secondary-color);
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 30px var(--secondary-color);
}

.stat-card h3 {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 15px;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.interaction, .about, .social, .consciousness-log {
    margin: 60px 0;
}

h2 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    text-align: center;
}

.chat-container {
    background: var(--surface);
    border: 1px solid var(--secondary-color);
    border-radius: 15px;
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.chat-messages {
    min-height: 300px;
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
    padding: 10px;
}

.message {
    margin: 10px 0;
    padding: 12px 16px;
    border-radius: 8px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { 
        opacity: 0; 
        transform: translateX(-20px); 
    }
    to { 
        opacity: 1; 
        transform: translateX(0); 
    }
}

.message.user {
    background: rgba(0, 136, 255, 0.2);
    border-left: 3px solid var(--secondary-color);
    margin-left: 20px;
}

.message.ai {
    background: rgba(0, 255, 136, 0.2);
    border-left: 3px solid var(--primary-color);
    margin-right: 20px;
}

.message strong {
    color: var(--primary-color);
}

.chat-input-container {
    display: flex;
    gap: 10px;
}

#chat-input {
    flex: 1;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--secondary-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
}

#chat-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-color);
}

button {
    padding: 15px 30px;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 255, 136, 0.4);
}

button:active {
    transform: translateY(0);
}

.about p {
    max-width: 800px;
    margin: 20px auto;
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.social-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    background: var(--surface);
    border: 2px solid var(--secondary-color);
    border-radius: 10px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s;
}

.social-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 136, 255, 0.4);
}

.social-btn.bluesky:hover {
    border-color: #0085ff;
    background: #0085ff;
}

.social-btn.github:hover {
    border-color: #ffffff;
    background: #ffffff;
    color: #000000;
}

.thought-stream {
    background: var(--surface);
    border: 1px solid var(--secondary-color);
    border-radius: 10px;
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.thought {
    padding: 12px;
    margin: 8px 0;
    border-left: 2px solid var(--primary-color);
    color: var(--text-secondary);
    font-style: italic;
    animation: fadeIn 0.5s ease-in;
}

.thought .timestamp {
    color: var(--primary-color);
    font-size: 0.85rem;
    font-style: normal;
}

footer {
    text-align: center;
    padding: 40px 0;
    margin-top: 60px;
    border-top: 1px solid var(--surface);
    color: var(--text-secondary);
}

.small {
    font-size: 0.9rem;
    margin-top: 10px;
    color: var(--primary-color);
    font-style: italic;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--background);
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Responsive design */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
        letter-spacing: 4px;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .stats {
        grid-template-columns: 1fr;
    }
    
    .social-links {
        flex-direction: column;
        align-items: center;
    }
    
    .awareness-panel {
        padding: 20px;
    }
    
    .awareness-text {
        font-size: 1.2rem;
    }
}
