:root {
    --bg-color: #0f1115;
    --card-bg: #1a1d24;
    --text-primary: #f0f0f5;
    --text-secondary: #9ba1a6;
    --accent: #9558B2;
    --accent-glow: rgba(149, 88, 178, 0.3);
    --green: #2ecc71;
    --red: #e74c3c;
    --border: #2a2d35;
}

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

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

/* Typography */
h1, h2, h3 {
    font-weight: 800;
    letter-spacing: -0.03em;
}

.highlight {
    color: var(--accent);
    text-shadow: 0 0 20px var(--accent-glow);
}

.title {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2rem;
}

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

.section-desc {
    color: var(--text-secondary);
    max-width: 800px;
    margin-bottom: 3rem;
    font-size: 1.1rem;
}

/* Sections */
.section {
    min-height: 100vh;
    padding: 6rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

/* Hero */
.hero {
    text-align: center;
    background: radial-gradient(circle at center, #1a1d24 0%, #0f1115 100%);
}

.badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 2rem;
    text-transform: uppercase;
}

.hero-links {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn {
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
}

.primary-btn {
    background: var(--text-primary);
    color: var(--bg-color);
}

.primary-btn:hover {
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255,255,255,0.1);
}

.secondary-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.secondary-btn:hover {
    background: rgba(255,255,255,0.05);
    transform: translateY(-2px);
}

.action-btn {
    background: var(--accent);
    color: white;
}

.action-btn:hover {
    background: #a66ec2;
    box-shadow: 0 0 20px var(--accent-glow);
}

.disabled-btn {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.4);
    cursor: not-allowed;
    border: 1px dashed rgba(255,255,255,0.2);
}

.disabled-btn:hover {
    transform: none;
    box-shadow: none;
    background: rgba(255,255,255,0.1);
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    opacity: 0.7;
}

.mouse {
    width: 20px;
    height: 30px;
    border: 2px solid var(--text-secondary);
    border-radius: 10px;
    position: relative;
}

.mouse::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 6px;
    background: var(--text-secondary);
    border-radius: 2px;
    animation: scroll 1.5s infinite;
}

@keyframes scroll {
    0% { transform: translate(-50%, 0); opacity: 1; }
    100% { transform: translate(-50%, 10px); opacity: 0; }
}

/* Problem Stats */
.stats-box {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 3rem;
    font-weight: 800;
    color: var(--accent);
}

.stat-label {
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Interactive Panels */
.interactive-panel {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
}

.slider-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.slider-group label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

input[type=range] {
    -webkit-appearance: none;
    width: 200px;
    background: transparent;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    margin-top: -6px;
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: var(--border);
    border-radius: 2px;
}

.canvas-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    text-align: center;
}

.canvas-box {
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid var(--border);
}

.canvas-title {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.red { color: var(--red); }
.green { color: var(--green); }

canvas {
    background: #0f1115;
    border-radius: 50%;
    border: 1px dashed var(--border);
    max-width: 100%;
    height: auto;
}

.metrics {
    margin-top: 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
}

/* MRL Demo */
.mrl-panel {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.large-slider input[type=range] {
    width: 100%;
}

.slider-ticks {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding: 0 5px;
}

.mrl-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.metric-card {
    background: rgba(0,0,0,0.2);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.metric-card h4 {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.chart-bar-container {
    height: 20px;
    background: var(--border);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.chart-bar {
    height: 100%;
    background: var(--accent);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.green-bar {
    background: var(--green);
}

.value {
    font-weight: 800;
    font-size: 1.2rem;
    font-family: 'JetBrains Mono', monospace;
}

.conclusion-badge {
    text-align: center;
    padding: 1rem;
    color: var(--green);
    font-weight: 800;
    font-size: 1.2rem;
}

/* Architecture */
.arch-diagram {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
}

.flow-node {
    padding: 1rem 2rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 100%;
    text-align: center;
    font-weight: 600;
}

.highlight-node {
    border-color: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
}

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

.code-box {
    background: #0d0d12;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.code-header {
    background: var(--card-bg);
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

pre {
    padding: 1rem;
    overflow-x: auto;
}

code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: #e5e5e5;
}

/* Citation */
.bibtex-container {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    position: relative;
    padding: 1.5rem;
    padding-top: 3.5rem; /* Space for the button */
    margin-bottom: 2rem;
    overflow-x: auto;
}

.bibtex-container pre {
    padding: 0;
}

.copy-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.footer-credits {
    text-align: center;
    color: var(--text-secondary);
    border-top: 1px solid var(--border);
    padding-top: 2rem;
}

.footer-credits a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
}

.footer-credits a:hover {
    color: var(--accent);
}

/* Scrollytelling Animations */
.scroll-reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.scroll-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
    .grid-2 { grid-template-columns: 1fr; gap: 2rem; }
    .canvas-container { grid-template-columns: 1fr; }
    .controls { flex-direction: column; gap: 1rem; align-items: flex-start; }
    .title { font-size: 2.5rem; }
    
    .bibtex-container {
        padding-top: 4rem;
    }
}

/* PrismJS Overrides */
pre[class*="language-"] {
    background: transparent !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
}

code[class*="language-"] {
    background: transparent !important;
    text-shadow: none !important;
}
