:root {
    --bg: #fdfdfd;
    --text: #1a1a1a;
    --primary: #2563eb;
    --secondary: #64748b;
    --border: #e2e8f0;
    --header-bg: #ffffff;
    --editor-bg: #1e1e1e;
    --editor-text: #d4d4d4;
    --card-bg: #ffffff;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

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

header {
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

h1 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.025em;
}

h1 span { color: var(--primary); }

nav a {
    margin-left: 2rem;
    text-decoration: none;
    color: var(--secondary);
    font-weight: 500;
    transition: color 0.2s;
}

nav a:hover { color: var(--primary); }

.disclaimer {
    background-color: #fef9c3;
    border-bottom: 1px solid #fde047;
    padding: 0.5rem 0;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 500;
    color: #854d0e;
}

.hero {
    text-align: center;
    padding: 4rem 0 2rem;
}

.hero h2 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    margin-bottom: 0.5rem;
}

.hero p {
    font-size: 1.25rem;
    color: var(--secondary);
}

.playground {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    height: 600px;
    margin-bottom: 4rem;
}

.editor-pane, .output-pane {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.pane-header {
    background: #f8fafc;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

textarea {
    flex: 1;
    border: none;
    padding: 1.5rem;
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    background-color: var(--editor-bg);
    color: var(--editor-text);
    resize: none;
    outline: none;
}

.output-pane .tab-content {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: none;
}

.output-pane .tab-content.active {
    display: block;
}

#preview {
    background: white;
}

pre {
    margin: 0;
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    background: #f8fafc;
}

.tabs {
    display: flex;
    gap: 0.5rem;
}

.tab-btn {
    background: none;
    border: none;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--secondary);
    cursor: pointer;
    border-radius: 4px;
}

.tab-btn.active {
    background: var(--primary);
    color: white;
}

/* Syntax Styles for Preview */
#preview h1 { border-bottom: 1px solid var(--border); padding-bottom: 0.3em; margin: 1em 0 0.5em; }
#preview h2 { margin: 1em 0 0.5em; }
#preview ul, #preview ol { padding-left: 2em; margin-bottom: 1em; }
#preview table { border-collapse: collapse; width: 100%; margin-bottom: 1em; }
#preview th, #preview td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
#preview th { background: #f8fafc; }
#preview pre { background: #f1f5f9; padding: 1em; border-radius: 4px; margin-bottom: 1em; }
#preview .math-inline { font-style: italic; color: #059669; }
#preview .math-block { text-align: center; margin: 1em 0; color: #059669; }
#preview header { background: #f1f5f9; padding: 1em; margin-bottom: 1em; border-radius: 4px; border: none; position: static; }

.syntax-brief {
    margin-bottom: 4rem;
}

.syntax-brief h3 {
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

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

.card {
    background: var(--card-bg);
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.card h4 {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.card code {
    display: block;
    background: #f1f5f9;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

footer {
    text-align: center;
    padding: 4rem 0;
    border-top: 1px solid var(--border);
    color: var(--secondary);
    font-size: 0.875rem;
}

@media (max-width: 768px) {
    .playground {
        grid-template-columns: 1fr;
        height: auto;
    }
    .hero h2 { font-size: 2rem; }
    textarea { height: 300px; }
}
