:root {
    --primary-red: #ff0844;
    --primary-dark: #0a0e27;
    --secondary-dark: #1a1e3a;
    --accent-cyan: #00d9ff;
    --accent-purple: #b537f2;
    --text-primary: #e8e8e8;
    --text-secondary: #a0a0a0;
    --success: #00ff88;
    --warning: #ffaa00;
    --error: #ff0844;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--primary-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Scanline Effect */
.scanline {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0) 50%,
        rgba(0, 0, 0, 0.05) 50%
    );
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.3;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    padding: 4rem 0;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(255, 8, 68, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.hero-content {
    z-index: 1;
}

/* Glitch Effect */
.glitch {
    font-family: 'Fira Code', monospace;
    font-size: 4rem;
    font-weight: 700;
    color: var(--primary-red);
    position: relative;
    text-shadow: 
        0.05em 0 0 var(--accent-cyan),
        -0.025em -0.05em 0 var(--accent-purple);
    animation: glitch 1s infinite;
}

@keyframes glitch {
    0% {
        text-shadow: 
            0.05em 0 0 var(--accent-cyan),
            -0.05em -0.025em 0 var(--accent-purple);
    }
    14% {
        text-shadow: 
            0.05em 0 0 var(--accent-cyan),
            -0.05em -0.025em 0 var(--accent-purple);
    }
    15% {
        text-shadow: 
            -0.05em -0.025em 0 var(--accent-cyan),
            0.025em 0.025em 0 var(--accent-purple);
    }
    49% {
        text-shadow: 
            -0.05em -0.025em 0 var(--accent-cyan),
            0.025em 0.025em 0 var(--accent-purple);
    }
    50% {
        text-shadow: 
            0.025em 0.05em 0 var(--accent-cyan),
            0.05em 0 0 var(--accent-purple);
    }
    99% {
        text-shadow: 
            0.025em 0.05em 0 var(--accent-cyan),
            0.05em 0 0 var(--accent-purple);
    }
    100% {
        text-shadow: 
            -0.025em 0 0 var(--accent-cyan),
            -0.025em -0.025em 0 var(--accent-purple);
    }
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--accent-cyan);
    margin-top: 1rem;
    font-weight: 300;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-top: 1.5rem;
    line-height: 1.8;
    max-width: 500px;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--primary-red), var(--accent-purple));
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s;
    border: 2px solid transparent;
    box-shadow: 0 0 20px rgba(255, 8, 68, 0.3);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(255, 8, 68, 0.5);
    border-color: var(--primary-red);
}

/* Terminal */
.terminal-window {
    background: var(--secondary-dark);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.terminal-header {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.75rem 1rem;
    display: flex;
    gap: 0.5rem;
}

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

.terminal-dot.red { background: #ff5f56; }
.terminal-dot.yellow { background: #ffbd2e; }
.terminal-dot.green { background: #27c93f; }

.terminal-body {
    padding: 1.5rem;
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
}

.terminal-line {
    margin-bottom: 0.75rem;
}

.prompt {
    color: var(--success);
    margin-right: 0.5rem;
}

.command {
    color: var(--text-primary);
}

.terminal-line.output {
    color: var(--text-secondary);
    padding-left: 1rem;
}

.success { color: var(--success); }
.info { color: var(--accent-cyan); }
.warning { color: var(--warning); }

/* Architecture Grid */
.overview {
    padding: 6rem 0;
}

.overview h2 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    background: linear-gradient(135deg, var(--primary-red), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.architecture-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.arch-card {
    background: var(--secondary-dark);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.arch-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-red), var(--accent-cyan));
    transform: scaleX(0);
    transition: transform 0.3s;
}

.arch-card:hover::before {
    transform: scaleX(1);
}

.arch-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(255, 8, 68, 0.2);
    border-color: var(--primary-red);
}

.arch-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.arch-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.arch-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Chapters Section */
.chapters {
    padding: 6rem 0;
    background: linear-gradient(180deg, transparent, rgba(255, 8, 68, 0.03));
}

.chapters h2 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.chapters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.chapter-card {
    background: var(--secondary-dark);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-decoration: none;
    color: inherit;
    transition: all 0.3s;
    position: relative;
    display: flex;
    flex-direction: column;
}

.chapter-card:hover {
    transform: translateX(10px);
    border-color: var(--primary-red);
    box-shadow: 0 5px 20px rgba(255, 8, 68, 0.3);
}

.chapter-number {
    font-family: 'Fira Code', monospace;
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-red);
    opacity: 0.3;
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.chapter-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.chapter-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    flex-grow: 1;
}

.chapter-arrow {
    color: var(--primary-red);
    font-size: 1.5rem;
    margin-top: 1rem;
    transition: transform 0.3s;
}

.chapter-card:hover .chapter-arrow {
    transform: translateX(5px);
}

/* Features */
.features {
    padding: 6rem 0;
}

.features h2 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-primary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-card {
    text-align: center;
    padding: 2rem;
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Footer */
.footer {
    padding: 3rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 4rem;
}

.footer-content {
    text-align: center;
    color: var(--text-secondary);
}

.footer-links {
    margin-top: 1rem;
}

.footer-links a {
    color: var(--accent-cyan);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--primary-red);
}

.footer-links span {
    margin: 0 1rem;
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 968px) {
    .hero {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-content {
        order: 2;
    }
    
    .hero-visual {
        order: 1;
    }
    
    .glitch {
        font-size: 3rem;
    }
    
    .hero-description {
        margin-left: auto;
        margin-right: auto;
    }
}

@media (max-width: 640px) {
    .container {
        padding: 0 1rem;
    }
    
    .glitch {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    .chapters-grid,
    .architecture-grid {
        grid-template-columns: 1fr;
    }
}