:root {
    --bg-dark: #050510;
    --glass-bg: rgba(20, 20, 35, 0.4);
    --glass-border: rgba(100, 150, 255, 0.1);
    --accent-neon: #00f0ff;
    --accent-purple: #9d00ff;
    --text-main: #f0f0f5;
    --text-muted: #8a8aab;
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --glow-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    overflow-x: hidden;
    line-height: 1.6;
}

/* Background Effects */
.background-aurora {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(157, 0, 255, 0.05), transparent 60%),
                radial-gradient(circle at 80% 20%, rgba(0, 240, 255, 0.05), transparent 50%);
    z-index: -2;
    animation: drift 20s infinite alternate ease-in-out;
}

.grid-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background-image: 
        linear-gradient(to right, rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: -1;
    perspective: 1000px;
}

@keyframes drift {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(-5%) scale(1.05); }
}

/* Glassmorphism Classes */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Navigation */
.devos-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 5%;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    background: rgba(5, 5, 16, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
}

.nav-brand {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
}

.glow-icon {
    color: var(--accent-neon);
    text-shadow: 0 0 10px var(--accent-neon);
}

.accent-text {
    background: linear-gradient(45deg, var(--accent-neon), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    margin-left: 30px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--accent-neon);
}

.nav-btn {
    padding: 8px 16px;
    border-radius: 8px;
    background: rgba(0, 240, 255, 0.1);
    border: 1px solid var(--accent-neon);
    color: var(--accent-neon) !important;
}

.nav-btn:hover {
    background: var(--accent-neon) !important;
    color: #000 !important;
    box-shadow: var(--glow-shadow);
}

/* Typography & Buttons */
h1, h2, h3 { font-family: var(--font-heading); }
.accent-gradient {
    background: linear-gradient(90deg, var(--accent-neon), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-family: var(--font-body);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
}

.btn-glow {
    background: var(--accent-neon);
    color: #000;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.5);
}

.btn-glow:hover {
    box-shadow: 0 0 25px rgba(0, 240, 255, 0.8);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--glass-border);
}

.btn-outline:hover {
    border-color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

/* Hero Section */
.hero-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 80vh;
    padding: 120px 5% 50px;
    margin: 0 2%;
    margin-top: 100px;
}

.hero-content {
    flex: 1;
    max-width: 600px;
}

.badge {
    display: inline-block;
    padding: 6px 12px;
    background: rgba(157, 0, 255, 0.2);
    border: 1px solid var(--accent-purple);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-purple);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero-title {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 20px;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 30px;
}

.metrics-row {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
}

.metric-card {
    background: rgba(0,0,0,0.4);
    border: 1px solid var(--glass-border);
    padding: 15px 20px;
    border-radius: 12px;
    flex: 1;
}

.metric-card h4 {
    font-size: 1.8rem;
    color: var(--accent-neon);
    margin-bottom: 5px;
}

.metric-card span {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero-visual {
    flex: 1;
    display: flex;
    justify-content: center;
    position: relative;
    perspective: 1000px;
}

.mesh-graphic {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(0,240,255,0.1) 0%, transparent 70%);
    border: 1px dashed var(--accent-neon);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 5rem;
    color: rgba(255,255,255,0.8);
    position: relative;
    transform: rotateX(20deg) rotateY(-20deg);
    animation: float 6s infinite ease-in-out;
}

.scan-line {
    position: absolute;
    width: 100%;
    height: 4px;
    background: var(--accent-neon);
    box-shadow: 0 0 10px var(--accent-neon);
    top: 10%;
    animation: scan 3s infinite linear;
}

@keyframes scan {
    0% { top: 10%; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 90%; opacity: 0; }
}

@keyframes float {
    0%, 100% { transform: rotateX(15deg) rotateY(-15deg) translateY(0); }
    50% { transform: rotateX(15deg) rotateY(-15deg) translateY(-20px); }
}

/* Features grid */
.feature-section {
    padding: 100px 5%;
}

.feature-section .section-header {
    text-align: center;
    margin-bottom: 60px;
}

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

.feature-card {
    padding: 40px 30px;
    transition: transform 0.3s;
}

.feature-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent-purple);
}

.icon-wrapper {
    font-size: 2.5rem;
    color: var(--accent-neon);
    margin-bottom: 20px;
}

.feature-card h3 {
    margin-bottom: 15px;
    color: white;
}

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

/* Algorithm Section */
.algorithm-section {
    margin: 100px 5%;
    padding: 0;
    display: flex;
    align-items: stretch;
    overflow: hidden;
}

.algo-image {
    flex: 1;
    background: rgba(0, 0, 0, 0.4);
    padding: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid var(--glass-border);
}

.algo-content {
    flex: 1;
    padding: 60px;
}

.algo-content h2 { margin-bottom: 20px; font-size: 2.5rem; }
.algo-content p { margin-bottom: 30px; color: var(--text-muted); font-size: 1.1rem; }

.algo-list { list-style: none; padding: 0; }
.algo-list li {
    margin-bottom: 15px;
    padding: 15px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    border: 1px solid var(--glass-border);
}

.text-green { color: #0f0; margin-right: 10px; }

/* Code Window */
.code-window {
    background: #0d0d1a;
    border-radius: 8px;
    border: 1px solid #1a1a3a;
    width: 100%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    font-family: var(--font-mono);
}

.window-header {
    background: #050510;
    padding: 10px 15px;
    border-bottom: 1px solid #1a1a3a;
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: center;
}

.window-header .dot {
    width: 12px; height: 12px; border-radius: 50%; margin-right: 8px;
}
.dot.red { background: #ff5f56; }
.dot.yel { background: #ffbd2e; }
.dot.grn { background: #27c93f; }
.window-header .title {
    margin-left: auto; margin-right: auto;
    color: var(--text-muted); font-size: 0.8rem;
}

.code-window pre {
    padding: 20px;
    overflow-x: auto;
    color: #a5d6ff;
    font-size: 0.9rem;
}

/* Architecture Flow */
.architecture-section {
    padding: 100px 5%;
    text-align: center;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 40px;
}

.flow-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.flow-node {
    padding: 30px 20px;
    width: 220px;
    text-align: center;
    transition: transform 0.3s;
}

.flow-node:hover {
    transform: translateY(-10px);
    border-color: var(--accent-neon);
}

.active-node {
    border-color: var(--accent-purple);
    box-shadow: 0 0 20px rgba(157, 0, 255, 0.2);
}

.node-icon {
    font-size: 2.5rem;
    color: var(--accent-neon);
    margin-bottom: 15px;
}

.flow-node h3 { font-size: 1.2rem; margin-bottom: 10px; }
.flow-node p { font-size: 0.9rem; color: var(--text-muted); }

.flow-connector {
    color: var(--text-muted);
    font-size: 1.5rem;
}

/* Simulation Section */
.simulation-section {
    margin: 80px 5%;
    padding: 50px;
}

.section-header { margin-bottom: 40px; }
.section-header p { color: var(--text-muted); max-width: 600px; margin-top: 10px; }

.sim-container {
    display: flex;
    gap: 40px;
}

.video-wrapper {
    flex: 2;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--glass-border);
    min-height: 480px;
    display: flex;
    justify-content: center;
    align-items: center;
}

canvas#output_canvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.loader {
    position: absolute;
    color: var(--text-muted);
    font-family: var(--font-heading);
    z-index: 10;
    pointer-events: none;
}

.sim-overlay {
    position: absolute;
    top: 20px; left: 20px; right: 20px;
    display: flex;
    justify-content: space-between;
}

.status-indicator {
    background: rgba(0,0,0,0.6);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--glass-border);
}

.dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: red;
}
.dot.live { background: #0f0; box-shadow: 0 0 8px #0f0; }

.hud-stats {
    display: flex;
    gap: 15px;
}

.stat {
    background: rgba(0,0,0,0.6);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    border: 1px solid var(--glass-border);
    font-family: monospace;
}
.stat .label { color: var(--accent-neon); }

.sim-controls {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.launch-btn { width: 100%; justify-content: center; font-size: 1.1rem; }

/* Control Panel */
.control-panel {
    padding: 20px;
}

.control-panel h3 {
    margin-bottom: 20px;
    font-size: 1rem;
    color: var(--accent-neon);
    display: flex; align-items: center; gap: 10px;
}

.toggle-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.toggle-switch {
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--text-main);
    font-size: 0.9rem;
    cursor: pointer;
}

.toggle-switch input { display: none; }

.slider {
    position: relative;
    width: 40px; height: 20px;
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
    transition: 0.3s;
}

.slider::before {
    content: '';
    position: absolute;
    height: 16px; width: 16px;
    left: 2px; bottom: 2px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}

.toggle-switch input:checked + .slider { background: var(--accent-neon); box-shadow: 0 0 10px var(--accent-neon); }
.toggle-switch input:checked + .slider::before { transform: translateX(20px); }

/* Terminal */
.terminal-box {
    background: #020205;
    border: 1px solid #1a1a3a;
    border-radius: 8px;
    flex: 1;
    display: flex;
    flex-direction: column;
    font-family: var(--font-mono);
}

.terminal-header {
    background: #111122;
    padding: 10px;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-bottom: 1px solid #1a1a3a;
    border-radius: 8px 8px 0 0;
}

.terminal-body {
    padding: 15px;
    font-size: 0.85rem;
    color: #4af626;
    overflow-y: auto;
    max-height: 250px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.terminal-body p { margin: 0; line-height: 1.4; }

/* Footer */
.devos-footer {
    text-align: center;
    padding: 30px;
    margin: 50px 5% 20px;
    font-size: 0.9rem;
}
.devos-footer .muted { color: var(--text-muted); font-size: 0.8rem; margin-top: 5px; }

/* Responsive */
@media (max-width: 1000px) {
    .algorithm-section { flex-direction: column; }
    .algo-image { border-right: none; border-bottom: 1px solid var(--glass-border); }
}

@media (max-width: 900px) {
    .sim-container { flex-direction: column; }
    .hero-section { flex-direction: column; text-align: center; padding-top: 150px; }
    .hero-actions { justify-content: center; }
    .hero-visual { margin-top: 50px; }
    .metrics-row { justify-content: center; flex-wrap: wrap; }
}
