/* graphers.dev - Complete Styling */

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

/* Color Palette */
:root {
    --canvas-void: #0a0a0f;
    --surface-panel: #141419;
    --text-primary: #d4d4d8;
    --node-cyan: #22d3ee;
    --edge-indigo: #818cf8;
    --accent-lime: #a3e635;
    --warning-amber: #fbbf24;
    --terminal-border: #27272a;
    --syntax-purple: #c084fc;
    --syntax-gray: #52525b;
    --terminal-header: #1c1c22;
}

html, body {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--canvas-void);
    color: var(--text-primary);
    line-height: 1.75;
}

/* ===== HERO SECTION ===== */

.hero-container {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

#graph-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: block;
    z-index: 1;
}

.hero-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
    pointer-events: none;
}

#hero-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--text-primary);
    text-shadow: 0 0 40px rgba(34, 211, 238, 0.3);
}

/* Terminal Panel */
.terminal-panel {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 600px;
    background: var(--surface-panel);
    border: 1px solid var(--terminal-border);
    border-radius: 8px;
    overflow: hidden;
    z-index: 20;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.terminal-header {
    height: 36px;
    padding: 0 12px;
    background: var(--terminal-header);
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--terminal-border);
}

.terminal-dots {
    display: flex;
    gap: 8px;
}

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

.dot.red {
    background: #ff5f57;
}

.dot.yellow {
    background: #febc2e;
}

.dot.green {
    background: #28c840;
}

.terminal-title {
    flex: 1;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--syntax-gray);
    font-weight: 400;
}

.terminal-body {
    padding: 24px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    letter-spacing: 0.02em;
    color: var(--text-primary);
    position: relative;
    max-height: 250px;
    overflow-y: auto;
}

.code-block {
    word-break: break-word;
    white-space: pre-wrap;
}

/* Syntax Highlighting */
.keyword {
    color: var(--syntax-purple);
    font-weight: 700;
}

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

.function {
    color: var(--node-cyan);
}

.property {
    color: var(--accent-lime);
}

.string {
    color: var(--accent-lime);
}

/* Blinking Cursor */
.cursor {
    display: inline-block;
    width: 8px;
    height: 1.2em;
    background: var(--text-primary);
    margin-left: 4px;
    vertical-align: -2px;
    animation: blink 0.6s infinite;
}

@keyframes blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

/* ===== FEATURES SECTION ===== */

.features-container {
    position: relative;
    background: var(--canvas-void);
    padding: 120px 40px;
    z-index: 30;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    max-width: 1400px;
    margin: 0 auto;
}

.feature-card {
    background: rgba(20, 20, 25, 0.5);
    border: 1px solid var(--terminal-border);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.3s ease;
}

.feature-card:hover {
    border-color: var(--edge-indigo);
}

.feature-viz {
    width: 100%;
    height: 200px;
    background: rgba(10, 10, 15, 0.8);
    border-bottom: 1px solid var(--terminal-border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.small-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.feature-content {
    padding: 24px;
}

.feature-card h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--node-cyan);
    margin-bottom: 12px;
}

.feature-card p {
    font-size: 0.95rem;
    color: var(--syntax-gray);
    line-height: 1.6;
}

/* ===== PLAYGROUND SECTION ===== */

.playground-container {
    position: relative;
    background: var(--canvas-void);
    padding: 120px 40px;
    z-index: 30;
}

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

.playground-header h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1.25rem, 3vw, 2rem);
    font-weight: 600;
    color: var(--accent-lime);
    margin-bottom: 12px;
}

.playground-header p {
    font-size: 0.95rem;
    color: var(--syntax-gray);
}

.playground-split {
    display: grid;
    grid-template-columns: 2fr 3fr;
    gap: 0;
    max-width: 1400px;
    margin: 0 auto;
    height: 500px;
    border: 1px solid var(--terminal-border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--surface-panel);
}

.playground-editor {
    display: flex;
    flex-direction: column;
    background: var(--surface-panel);
    border-right: 1px solid var(--terminal-border);
}

.editor-header {
    height: 36px;
    padding: 0 12px;
    background: var(--terminal-header);
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--terminal-border);
}

.editor-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--syntax-gray);
    font-weight: 400;
    letter-spacing: 0.02em;
}

.code-editor {
    flex: 1;
    background: var(--surface-panel);
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    letter-spacing: 0.02em;
    border: none;
    padding: 24px;
    resize: none;
    outline: none;
    white-space: pre;
    overflow-wrap: normal;
    overflow: auto;
}

.code-editor::selection {
    background: rgba(129, 140, 248, 0.3);
}

.playground-canvas-container {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 10, 15, 0.8);
}

.playground-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* ===== RESPONSIVE ===== */

@media (max-width: 1024px) {
    .features-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .playground-split {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 600px;
    }

    .playground-editor {
        height: 300px;
        border-right: none;
        border-bottom: 1px solid var(--terminal-border);
    }

    .playground-canvas-container {
        height: 300px;
    }

    .terminal-panel {
        bottom: 40px;
        width: 95%;
        max-width: 90vw;
    }
}

@media (max-width: 768px) {
    .terminal-panel {
        display: none;
    }

    #hero-title {
        font-size: clamp(1.5rem, 4vw, 2.5rem);
    }

    .features-container,
    .playground-container {
        padding: 80px 20px;
    }

    .features-grid {
        gap: 20px;
    }

    .feature-card h3 {
        font-size: 1.125rem;
    }
}

/* ===== SCROLLING CONTENT OVER CANVAS ===== */

#hero-section {
    position: relative;
    z-index: 1;
}

#hero-section::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(10, 10, 15, 0.1) 50%,
        rgba(10, 10, 15, 0.5) 100%
    );
    pointer-events: none;
    z-index: -1;
}

/* Node Pulse Animation */
@keyframes node-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.4);
    }
    100% {
        box-shadow: 0 0 0 8px rgba(34, 211, 238, 0);
    }
}

.node-pulse {
    animation: node-pulse 2s infinite;
}

/* Grid Pattern Background */
@keyframes grid-slide {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 40px 40px;
    }
}

/* General Scrolling Behavior */
section {
    position: relative;
}
