:root {
    --bg-darkest: #060a12;
    --bg-dark: #0a0e17;
    --bg-panel: #0f1419;
    --bg-card: #111820;
    --border: #1a2332;
    --border-glow: #1e3a5f;
    --accent-green: #00ff88;
    --accent-cyan: #00bfff;
    --accent-magenta: #ff69b4;
    --accent-orange: #ffaa00;
    --accent-yellow: #ffd700;
    --accent-red: #ff4444;
    --text-primary: #e0e0e0;
    --text-muted: #888888;
    --text-dim: #556677;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg-darkest);
    color: var(--text-primary);
    font-family: 'IBM Plex Sans', system-ui, sans-serif;
    overflow-x: hidden;
    overflow-y: auto;
}

#root {
    min-height: 100vh;
}

.code-font {
    font-family: 'JetBrains Mono', monospace;
}

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

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

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2a3342;
}

/* Glow effects */
@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 10px rgba(0, 255, 136, 0.3); }
    50% { box-shadow: 0 0 20px rgba(0, 255, 136, 0.5), 0 0 40px rgba(0, 255, 136, 0.2); }
}

@keyframes canvas-glow {
    0%, 100% { box-shadow: 0 0 5px rgba(0, 255, 136, 0.2), inset 0 0 5px rgba(0, 255, 136, 0.05); }
    50% { box-shadow: 0 0 15px rgba(0, 255, 136, 0.4), inset 0 0 10px rgba(0, 255, 136, 0.1); }
}

@keyframes sweep {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

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

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

@keyframes float-glyph {
    0%, 100% { transform: translateY(0px) rotate(0deg); opacity: 0.04; }
    50% { transform: translateY(-12px) rotate(3deg); opacity: 0.08; }
}

@keyframes hero-line {
    from { width: 0; }
    to { width: 100%; }
}

.pulse-glow {
    animation: pulse-glow 2s ease-in-out infinite;
}

.canvas-running {
    animation: canvas-glow 3s ease-in-out infinite;
}

.pipeline-sweep {
    background: linear-gradient(90deg, transparent 0%, rgba(0,255,136,0.3) 50%, transparent 100%);
    background-size: 200% 100%;
    animation: sweep 1.5s linear infinite;
}

/* Tab styles */
.tab-active {
    border-bottom: 2px solid var(--accent-green);
    color: var(--accent-green);
}

.tab-inactive {
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
}

.tab-inactive:hover {
    color: var(--text-primary);
    border-bottom-color: var(--border);
}

/* Syntax highlighting classes */
.syn-keyword { color: #00bfff; }
.syn-region { color: #ffaa00; }
.syn-type { color: #ff69b4; }
.syn-string { color: #ffd700; }
.syn-comment { color: #4a7a5a; }
.syn-number { color: #7fccff; }
.syn-ident { color: #e0e0e0; }
.syn-paren { color: #555; }
.syn-effect { color: #b39ddb; }

/* Demo button styles */
.demo-tab {
    padding: 8px 18px;
    border-radius: 6px 6px 0 0;
    font-size: 13px;
    font-family: 'JetBrains Mono', monospace;
    border: 1px solid var(--border);
    border-bottom: none;
    background: var(--bg-dark);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    top: 1px;
}

.demo-tab:hover {
    border-color: var(--accent-cyan);
    color: var(--text-primary);
    background: var(--bg-panel);
}

.demo-tab-active {
    border-color: var(--accent-green);
    color: var(--accent-green);
    background: var(--bg-panel);
    z-index: 2;
}

/* Canvas fullscreen */
.canvas-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    z-index: 200 !important;
    width: 100vw !important;
    height: 100vh !important;
    border-radius: 0 !important;
    border: none !important;
    max-width: none !important;
    max-height: none !important;
}

.canvas-fullscreen canvas {
    width: 100% !important;
    height: 100% !important;
    border-radius: 0 !important;
}

/* Popup modal (for compiler output) */
.compile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: fadeIn 0.2s ease-out;
}

.compile-modal {
    background: #0c1018;
    border: 1px solid #1a2332;
    border-radius: 12px;
    max-width: 800px;
    width: 100%;
    max-height: 80vh;
    padding: 0;
    box-shadow: 0 0 40px rgba(0, 255, 136, 0.08), 0 20px 60px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    animation: slideUp 0.25s ease-out;
    overflow: hidden;
}

/* Spec sections */
.spec-heading {
    font-family: 'JetBrains Mono', monospace;
    font-size: 15px;
    font-weight: 700;
    color: #00bfff;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #1a2332;
}

.spec-subheading {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 600;
    color: #ffaa00;
    margin-bottom: 4px;
}

.spec-text {
    font-size: 14px;
    line-height: 1.7;
    color: #b8b8b8;
}

.spec-code {
    background: #0a0e17;
    border: 1px solid #1a2332;
    border-radius: 6px;
    padding: 12px 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12.5px;
    line-height: 1.55;
    color: #00ff88;
    overflow-x: auto;
    margin-top: 8px;
    white-space: pre;
}

.spec-callout {
    background: rgba(0, 255, 136, 0.05);
    border-left: 3px solid #00ff88;
    padding: 12px 16px;
    border-radius: 0 6px 6px 0;
    font-size: 13.5px;
    line-height: 1.65;
    color: #b0b0b0;
}

.spec-list {
    padding-left: 20px;
    margin-top: 6px;
    font-size: 13.5px;
    line-height: 1.75;
    color: #b0b0b0;
}

.spec-list li {
    margin-bottom: 3px;
}

.spec-inline-code {
    background: rgba(0, 191, 255, 0.1);
    border: 1px solid rgba(0, 191, 255, 0.2);
    border-radius: 3px;
    padding: 1px 5px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: #00bfff;
}

.spec-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
    font-size: 13px;
}

.spec-th {
    text-align: left;
    padding: 6px 12px;
    border-bottom: 1px solid #1a2332;
    color: #888;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.spec-td {
    padding: 5px 12px;
    border-bottom: 1px solid #111820;
    color: #c0c0c0;
}

/* Scrollable section styling */
.section-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Hero background pattern */
.hero-bg {
    position: relative;
    overflow: hidden;
}

.hero-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse 80% 60% at 50% 0%, rgba(0, 255, 136, 0.06) 0%, transparent 70%),
        radial-gradient(ellipse 60% 40% at 80% 60%, rgba(0, 191, 255, 0.04) 0%, transparent 60%);
    pointer-events: none;
}

/* Grid background for canvas area */
.canvas-area-bg {
    background: 
        linear-gradient(rgba(26, 35, 50, 0.3) 1px, transparent 1px),
        linear-gradient(90deg, rgba(26, 35, 50, 0.3) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* Stats bar */
.stats-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: rgba(15, 20, 25, 0.8);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-muted);
}

/* Pipeline stages */
.pipeline-stage {
    padding: 3px 8px;
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
    border-radius: 3px;
    color: var(--text-dim);
    background: rgba(15, 20, 25, 0.5);
    border: 1px solid var(--border);
    transition: all 0.15s;
}

.pipeline-stage-active {
    color: var(--accent-green);
    background: rgba(0, 255, 136, 0.1);
    border-color: rgba(0, 255, 136, 0.4);
    box-shadow: 0 0 8px rgba(0, 255, 136, 0.2);
}

.pipeline-stage-done {
    color: var(--accent-green);
    border-color: rgba(0, 255, 136, 0.2);
    opacity: 0.7;
}

/* Feature card */
.feature-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 24px;
    transition: all 0.3s;
}

.feature-card:hover {
    border-color: var(--border-glow);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .section-container {
        padding: 0 16px;
    }
    .demo-tab {
        padding: 6px 12px;
        font-size: 11px;
    }
    .feature-card {
        padding: 16px;
    }
}