/* ===== RESET & BASE ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #0a0a1a;
    --surface: #111128;
    --surface2: #1a1a3e;
    --border: rgba(99, 102, 241, 0.15);
    --text: #e2e8f0;
    --text-dim: #94a3b8;
    --accent: #6366f1;
    --accent2: #06b6d4;
    --green: #10b981;
    --amber: #f59e0b;
    --red: #ef4444;
    --radius: 16px;
    --radius-sm: 10px;
}

html { scroll-behavior: smooth; }

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

#particleCanvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ===== GRADIENT TEXT ===== */
.gradient-text {
    background: linear-gradient(135deg, var(--accent), var(--accent2), var(--green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== HERO ===== */
.hero {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 100px 24px 60px;
    max-width: 800px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-block;
    padding: 6px 18px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid var(--border);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--accent);
    margin-bottom: 24px;
    letter-spacing: 0.5px;
    animation: fadeInDown 0.8s ease;
}

.hero-title {
    font-size: clamp(2.5rem, 7vw, 4.5rem);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 20px;
    animation: fadeInDown 0.8s ease 0.1s both;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-dim);
    max-width: 600px;
    margin: 0 auto 20px;
    animation: fadeInDown 0.8s ease 0.2s both;
}

.hero-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text-dim);
    animation: fadeInDown 0.8s ease 0.3s both;
}

.dot { opacity: 0.3; }

/* ===== SECTIONS ===== */
.section {
    position: relative;
    z-index: 1;
    max-width: 1100px;
    margin: 0 auto;
    padding: 60px 24px;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.section-desc {
    text-align: center;
    color: var(--text-dim);
    margin-bottom: 40px;
}

/* ===== RL DIAGRAM ===== */
.rl-diagram {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    grid-template-rows: auto auto auto;
    align-items: center;
    justify-items: center;
    gap: 10px;
    max-width: 700px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
}

.node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px 32px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.node:hover { transform: translateY(-4px) scale(1.05); }

.node-icon { font-size: 2.5rem; }
.node-label {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.5px;
}

.node-pulse {
    position: absolute;
    inset: -4px;
    border-radius: inherit;
    opacity: 0;
    animation: pulse 3s ease-in-out infinite;
}

.agent-node {
    grid-column: 1; grid-row: 1;
    background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(99,102,241,0.05));
    border: 1.5px solid rgba(99,102,241,0.3);
}
.agent-node .node-pulse { border: 2px solid var(--accent); }

.env-node {
    grid-column: 3; grid-row: 1;
    background: linear-gradient(135deg, rgba(6,182,212,0.15), rgba(6,182,212,0.05));
    border: 1.5px solid rgba(6,182,212,0.3);
}
.env-node .node-pulse { border: 2px solid var(--accent2); }

.reward-node {
    grid-column: 3; grid-row: 3;
    background: linear-gradient(135deg, rgba(16,185,129,0.15), rgba(245,158,11,0.05));
    border: 1.5px solid rgba(16,185,129,0.3);
}
.reward-node .node-pulse { border: 2px solid var(--green); }

.policy-node {
    grid-column: 1; grid-row: 3;
    background: linear-gradient(135deg, rgba(239,68,68,0.15), rgba(239,68,68,0.05));
    border: 1.5px solid rgba(239,68,68,0.3);
}
.policy-node .node-pulse { border: 2px solid var(--red); }

/* Arrows */
.arrow { position: relative; }

.arrow-action { grid-column: 2; grid-row: 1; }
.arrow-reward { grid-column: 3; grid-row: 2; }
.arrow-state  { grid-column: 2; grid-row: 3; }

.arrow-svg { width: 160px; height: 50px; }
.arrow-svg-v { width: 50px; height: 120px; }

.arrow-label, .arrow-label-v {
    display: block;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-top: -4px;
}

.arrow-path {
    animation: dashFlow 1.5s linear infinite;
}

@keyframes dashFlow {
    to { stroke-dashoffset: -24; }
}

/* Data particles */
.data-particle {
    position: absolute;
    width: 6px; height: 6px;
    border-radius: 50%;
    opacity: 0.7;
}

.dp1 {
    background: var(--accent);
    animation: particleFlow1 3s ease-in-out infinite;
    box-shadow: 0 0 10px var(--accent);
}
.dp2 {
    background: var(--green);
    animation: particleFlow2 3s ease-in-out infinite 1s;
    box-shadow: 0 0 10px var(--green);
}
.dp3 {
    background: var(--red);
    animation: particleFlow3 3s ease-in-out infinite 2s;
    box-shadow: 0 0 10px var(--red);
}

@keyframes particleFlow1 {
    0%   { top: 15%; left: 22%; opacity: 0; }
    10%  { opacity: 0.8; }
    50%  { top: 15%; left: 70%; opacity: 0.8; }
    60%  { opacity: 0; }
    100% { opacity: 0; }
}
@keyframes particleFlow2 {
    0%   { top: 50%; left: 72%; opacity: 0; }
    10%  { opacity: 0.8; }
    50%  { top: 85%; left: 72%; opacity: 0.8; }
    60%  { opacity: 0; }
    100% { opacity: 0; }
}
@keyframes particleFlow3 {
    0%   { top: 85%; left: 70%; opacity: 0; }
    10%  { opacity: 0.8; }
    50%  { top: 85%; left: 22%; opacity: 0.8; }
    60%  { opacity: 0; }
    100% { opacity: 0; }
}

/* ===== INFO PANEL ===== */
.info-panel {
    position: fixed;
    top: 0; right: -420px;
    width: 400px; height: 100vh;
    background: var(--surface);
    border-left: 1px solid var(--border);
    padding: 32px;
    z-index: 100;
    overflow-y: auto;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -20px 0 60px rgba(0,0,0,0.5);
}

.info-panel.open { right: 0; }

.info-close {
    position: absolute;
    top: 16px; right: 16px;
    background: none;
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
    width: 36px; height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.info-close:hover { background: rgba(255,255,255,0.05); }

.info-content h3 {
    font-size: 1.5rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.info-content p {
    color: var(--text-dim);
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.info-content .info-highlight {
    background: rgba(99,102,241,0.1);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin: 16px 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--accent);
}

.info-content ul {
    list-style: none;
    padding: 0;
}

.info-content ul li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    color: var(--text-dim);
    font-size: 0.9rem;
}

.info-content ul li::before {
    content: '→ ';
    color: var(--accent);
}

/* ===== CARDS ===== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    opacity: 0;
    transition: opacity 0.3s;
}

.card:hover {
    transform: translateY(-6px);
    border-color: rgba(99,102,241,0.3);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.card:hover::before { opacity: 1; }

.card-icon { font-size: 2rem; margin-bottom: 12px; }

.card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.card p {
    color: var(--text-dim);
    font-size: 0.9rem;
    line-height: 1.6;
}

.card-tag {
    display: inline-block;
    margin-top: 14px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(99,102,241,0.1);
    color: var(--accent);
    border: 1px solid rgba(99,102,241,0.2);
}

/* ===== ALGO CARDS ===== */
.algo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 24px;
}

.algo-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.algo-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(0,0,0,0.25);
}

.algo-header { margin-bottom: 16px; }

.algo-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(99,102,241,0.15);
    color: var(--accent);
}

.badge-green {
    background: rgba(16,185,129,0.15);
    color: var(--green);
}

.algo-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.algo-card p {
    color: var(--text-dim);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.algo-list { display: flex; flex-direction: column; gap: 12px; }

.algo-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(255,255,255,0.02);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255,255,255,0.04);
    transition: background 0.2s;
}

.algo-item:hover { background: rgba(255,255,255,0.05); }

.algo-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.algo-dot.q      { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.algo-dot.sarsa  { background: var(--accent2); box-shadow: 0 0 8px var(--accent2); }
.algo-dot.pg     { background: var(--green); box-shadow: 0 0 8px var(--green); }
.algo-dot.dqn    { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.algo-dot.dyna   { background: var(--green); box-shadow: 0 0 8px var(--green); }
.algo-dot.mcts   { background: var(--accent2); box-shadow: 0 0 8px var(--accent2); }
.algo-dot.mbpo   { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.algo-dot.world  { background: var(--accent); box-shadow: 0 0 8px var(--accent); }

.algo-item strong {
    display: block;
    font-size: 0.9rem;
}

.algo-item small {
    color: var(--text-dim);
    font-size: 0.78rem;
}

/* ===== DEMO / GRID WORLD ===== */
.demo-container {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 32px;
    align-items: start;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
}

.grid-world {
    display: grid;
    grid-template-columns: repeat(5, 60px);
    grid-template-rows: repeat(5, 60px);
    gap: 4px;
}

.grid-cell {
    width: 60px; height: 60px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    background: var(--surface2);
    border: 1px solid rgba(255,255,255,0.05);
    transition: all 0.3s;
    position: relative;
}

.grid-cell.wall {
    background: #1e1b4b;
    border-color: rgba(99,102,241,0.2);
}

.grid-cell.goal {
    background: rgba(16,185,129,0.15);
    border-color: rgba(16,185,129,0.3);
    animation: goalGlow 2s ease-in-out infinite alternate;
}

.grid-cell.obstacle {
    background: rgba(239,68,68,0.1);
    border-color: rgba(239,68,68,0.2);
}

.grid-cell.agent {
    background: rgba(99,102,241,0.2);
    border-color: rgba(99,102,241,0.5);
    box-shadow: 0 0 15px rgba(99,102,241,0.3);
}

.grid-cell .q-arrow {
    position: absolute;
    font-size: 0.6rem;
    color: rgba(255,255,255,0.3);
}
.q-arrow.up    { top: 2px; }
.q-arrow.down  { bottom: 2px; }
.q-arrow.left  { left: 4px; }
.q-arrow.right { right: 4px; }
.q-arrow.best  { color: var(--green); font-weight: bold; }

@keyframes goalGlow {
    from { box-shadow: 0 0 10px rgba(16,185,129,0.1); }
    to   { box-shadow: 0 0 25px rgba(16,185,129,0.3); }
}

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

.demo-info {
    display: flex;
    gap: 16px;
}

.demo-stat {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-sm);
    padding: 12px 18px;
    flex: 1;
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.stat-value {
    display: block;
    font-size: 1.4rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent);
}

.demo-legend {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--text-dim);
}

.legend-color {
    width: 12px; height: 12px;
    border-radius: 3px;
}

.demo-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #818cf8);
    color: white;
}
.btn-primary:hover {
    box-shadow: 0 4px 20px rgba(99,102,241,0.4);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(6,182,212,0.15);
    color: var(--accent2);
    border: 1px solid rgba(6,182,212,0.3);
}
.btn-secondary:hover { background: rgba(6,182,212,0.25); }

.btn-outline {
    background: transparent;
    color: var(--text-dim);
    border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.q-table-mini {
    background: rgba(0,0,0,0.2);
    border-radius: var(--radius-sm);
    padding: 16px;
}

.q-table-mini h4 {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 12px;
}

.q-values {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.q-val {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px;
    background: rgba(255,255,255,0.03);
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
}


/* ===== TIMELINE (Step-by-step) ===== */
.timeline {
    position: relative;
    max-width: 700px;
    margin: 0 auto;
    padding-left: 40px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 19px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--accent), var(--accent2), var(--green));
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    margin-bottom: 32px;
    opacity: 0;
    transform: translateX(-20px);
    animation: timelineIn 0.5s ease forwards;
}

.timeline-item:nth-child(1) { animation-delay: 0.1s; }
.timeline-item:nth-child(2) { animation-delay: 0.2s; }
.timeline-item:nth-child(3) { animation-delay: 0.3s; }
.timeline-item:nth-child(4) { animation-delay: 0.4s; }
.timeline-item:nth-child(5) { animation-delay: 0.5s; }
.timeline-item:nth-child(6) { animation-delay: 0.6s; }
.timeline-item:nth-child(7) { animation-delay: 0.7s; }
.timeline-item:nth-child(8) { animation-delay: 0.8s; }

@keyframes timelineIn {
    to { opacity: 1; transform: translateX(0); }
}

.timeline-marker {
    position: absolute;
    left: -40px;
    top: 4px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--surface);
    border: 2px solid var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.marker-done {
    border-color: var(--green);
    background: rgba(16, 185, 129, 0.15);
}

.timeline-num {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--accent);
}

.marker-done .timeline-num { color: var(--green); }

.timeline-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: all 0.3s;
}

.timeline-content:hover {
    border-color: rgba(99,102,241,0.3);
    box-shadow: 0 8px 30px rgba(0,0,0,0.25);
    transform: translateX(4px);
}

.timeline-icon {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.timeline-content h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.timeline-content p {
    color: var(--text-dim);
    font-size: 0.9rem;
    line-height: 1.6;
}

.timeline-detail {
    margin-top: 12px;
    padding: 10px 16px;
    background: rgba(99,102,241,0.06);
    border: 1px solid rgba(99,102,241,0.12);
    border-radius: var(--radius-sm);
    overflow-x: auto;
}

.timeline-detail code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    color: var(--accent);
    white-space: nowrap;
}

/* ===== RL VISUALIZATION ===== */
.viz-container {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 24px;
    align-items: start;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
}

#rlVizCanvas {
    border-radius: var(--radius-sm);
    background: #0d0d24;
    border: 1px solid rgba(255,255,255,0.05);
    width: 100%;
    max-width: 700px;
    height: auto;
    aspect-ratio: 7/4;
}

.viz-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 200px;
}

.viz-status {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.viz-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
}

.viz-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-dim);
    transition: background 0.3s;
}

.viz-dot.running {
    background: var(--green);
    box-shadow: 0 0 10px var(--green);
    animation: vizPulse 1s ease-in-out infinite;
}

@keyframes vizPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.viz-ep {
    font-size: 0.85rem;
    color: var(--text-dim);
}

.viz-ep strong {
    color: var(--accent);
    font-family: 'JetBrains Mono', monospace;
}

.viz-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.viz-legend-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.viz-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    color: var(--text-dim);
}

.vl-box {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    flex-shrink: 0;
}

/* ===== PROS & CONS ===== */
.proscons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 24px;
    margin-bottom: 48px;
}

.proscons-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.proscons-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(0,0,0,0.25);
}

.proscons-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
}

.pros-header {
    background: linear-gradient(135deg, rgba(16,185,129,0.12), rgba(16,185,129,0.03));
    border-bottom: 1px solid rgba(16,185,129,0.15);
}

.cons-header {
    background: linear-gradient(135deg, rgba(245,158,11,0.12), rgba(239,68,68,0.03));
    border-bottom: 1px solid rgba(245,158,11,0.15);
}

.proscons-icon { font-size: 1.5rem; }

.proscons-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
}

.proscons-list {
    list-style: none;
    padding: 8px 0;
}

.proscons-list li {
    padding: 14px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    transition: background 0.2s;
}

.proscons-list li:last-child { border-bottom: none; }

.proscons-list li:hover {
    background: rgba(255,255,255,0.02);
}

.pc-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.pros-card .pc-title { color: var(--green); }
.cons-card .pc-title { color: var(--amber); }

.pc-desc {
    color: var(--text-dim);
    font-size: 0.85rem;
    line-height: 1.5;
}

/* ===== USE CASES ===== */
.usecase-title {
    text-align: center;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 24px;
}

.usecase-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
}

.usecase-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 20px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
    transition: all 0.3s;
}

.usecase-item:hover {
    transform: translateY(-4px);
    border-color: rgba(99,102,241,0.3);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.usecase-emoji { font-size: 2rem; }

.usecase-item strong {
    font-size: 0.9rem;
}

.usecase-item small {
    color: var(--text-dim);
    font-size: 0.75rem;
}

/* ===== EQUATION CARD ===== */
.equation-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.equation {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(1rem, 2.5vw, 1.4rem);
    font-weight: 600;
    color: var(--text);
    padding: 24px;
    background: rgba(99,102,241,0.06);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(99,102,241,0.15);
    margin-bottom: 32px;
    overflow-x: auto;
}

.equation-parts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
}

.eq-part {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 16px;
    background: rgba(255,255,255,0.02);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255,255,255,0.04);
}

.eq-symbol {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.4rem;
    font-weight: 700;
}

.eq-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.eq-desc {
    color: var(--text-dim);
    font-size: 0.8rem;
}

/* ===== FOOTER ===== */
.footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 40px 24px;
    border-top: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 0.85rem;
}

.footer-sub {
    margin-top: 4px;
    font-size: 0.78rem;
    opacity: 0.6;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 0; transform: scale(1); }
    50%      { opacity: 0.4; transform: scale(1.08); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .rl-diagram {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 12px;
    }
    .node { grid-column: 1 !important; grid-row: auto !important; }
    .arrow { grid-column: 1 !important; grid-row: auto !important; }
    .arrow-svg { width: 120px; }
    .arrow-svg-v { transform: rotate(90deg); width: 120px; height: 50px; }
    .data-particle { display: none; }

    .demo-container {
        grid-template-columns: 1fr;
    }
    .grid-world {
        grid-template-columns: repeat(5, 50px);
        grid-template-rows: repeat(5, 50px);
        justify-self: center;
    }
    .grid-cell { width: 50px; height: 50px; font-size: 1.1rem; }
    .demo-info { flex-direction: column; }

    .info-panel { width: 100%; right: -100%; }

    .cards-grid { grid-template-columns: 1fr; }
    .algo-grid { grid-template-columns: 1fr; }
    .proscons-grid { grid-template-columns: 1fr; }
    .usecase-grid { grid-template-columns: repeat(2, 1fr); }

    .viz-container {
        grid-template-columns: 1fr;
    }

    .timeline { padding-left: 32px; }
    .timeline-marker { left: -32px; width: 30px; height: 30px; }
    .timeline-num { font-size: 0.75rem; }
}

