:root {
    --bg: #05060a;
    --bg-card: #0a0c14;
    --bg-card-hover: #0f1220;
    --text: #c8ccd8;
    --text-dim: #4a5068;
    --text-muted: #2a3048;
    --accent: #8b5cf6;
    --accent-glow: #a78bfa;
    --border: #141828;
    --border-focus: #8b5cf6;

    --human: #22c55e;
    --human-glow: rgba(34, 197, 94, 0.4);
    --bot: #ef4444;
    --bot-glow: rgba(239, 68, 68, 0.4);
    --ai: #8b5cf6;
    --ai-glow: rgba(139, 92, 246, 0.4);
    --dead: #1e2030;
    --dead-dim: #2a2d42;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    position: relative;
}

/* Scanline overlay */
.scanlines {
    pointer-events: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.03) 2px,
        rgba(0, 0, 0, 0.03) 4px
    );
    opacity: 0.5;
}

/* Header */
header {
    text-align: center;
    padding: 50px 20px 10px;
    background: linear-gradient(180deg, rgba(239, 68, 68, 0.04) 0%, transparent 100%);
}

header h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--text) 0%, var(--bot) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}

.subtitle {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    color: var(--bot);
    font-weight: 300;
}

.subtitle-detail {
    font-size: 0.88rem;
    color: var(--text-dim);
    margin-top: 6px;
}

/* Timeline */
.timeline-section {
    max-width: 700px;
    margin: 28px auto 0;
    padding: 0 20px;
}

.timeline-wrapper {
    text-align: center;
}

.timeline-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--text);
    display: block;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
    transition: color 0.3s;
}

.timeline-label.danger { color: var(--bot); }

#year-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

#year-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent);
    border: 3px solid var(--bg);
    box-shadow: 0 0 12px var(--ai-glow);
    cursor: grab;
    transition: transform 0.15s;
}

#year-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

#year-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent);
    border: 3px solid var(--bg);
    box-shadow: 0 0 12px var(--ai-glow);
    cursor: grab;
}

.timeline-ticks {
    display: flex;
    justify-content: space-between;
    padding: 6px 2px 0;
}

.timeline-ticks span {
    font-size: 0.6rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

.timeline-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 12px;
}

.timeline-hint {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Stats Bar */
.stats-bar {
    max-width: 960px;
    margin: 24px auto 0;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

.stat-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 12px;
    text-align: center;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.stat-item.highlight {
    border-color: rgba(34, 197, 94, 0.2);
}

.stat-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    display: block;
    line-height: 1.2;
}

.stat-value small {
    font-size: 0.7em;
    opacity: 0.6;
}

.stat-label {
    font-size: 0.62rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 4px;
    display: block;
}

.stat-bar {
    height: 3px;
    background: var(--border);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.stat-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.6s ease;
    width: 0%;
}

.stat-bar-fill.bot { background: var(--bot); }
.stat-bar-fill.ai { background: var(--ai); }
.stat-bar-fill.fake { background: #f59e0b; }
.stat-bar-fill.human { background: var(--human); }

/* Visualization */
.viz-section {
    max-width: 960px;
    margin: 24px auto 0;
    padding: 0 20px;
}

.viz-container {
    width: 100%;
    height: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    position: relative;
}

#network-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.viz-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 10px;
    flex-wrap: wrap;
}

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

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

.legend-dot.human { background: var(--human); box-shadow: 0 0 6px var(--human-glow); }
.legend-dot.bot { background: var(--bot); box-shadow: 0 0 6px var(--bot-glow); }
.legend-dot.ai { background: var(--ai); box-shadow: 0 0 6px var(--ai-glow); }
.legend-dot.dead { background: var(--dead-dim); }

/* Feed */
.feed-section {
    max-width: 640px;
    margin: 40px auto 0;
    padding: 0 20px;
}

.feed-section h2 {
    font-size: 1.15rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 4px;
}

.feed-desc {
    text-align: center;
    color: var(--text-dim);
    font-size: 0.8rem;
    margin-bottom: 16px;
}

.feed-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.feed-post {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    transition: border-color 0.2s;
    animation: fadeSlideIn 0.3s ease forwards;
    opacity: 0;
}

.feed-post:nth-child(1) { animation-delay: 0s; }
.feed-post:nth-child(2) { animation-delay: 0.05s; }
.feed-post:nth-child(3) { animation-delay: 0.1s; }
.feed-post:nth-child(4) { animation-delay: 0.15s; }
.feed-post:nth-child(5) { animation-delay: 0.2s; }
.feed-post:nth-child(6) { animation-delay: 0.25s; }
.feed-post:nth-child(7) { animation-delay: 0.3s; }
.feed-post:nth-child(8) { animation-delay: 0.35s; }

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

.feed-post.bot-post { border-left: 3px solid var(--bot); }
.feed-post.ai-post { border-left: 3px solid var(--ai); }
.feed-post.human-post { border-left: 3px solid var(--human); }
.feed-post.dead-post { border-left: 3px solid var(--dead-dim); opacity: 0.5; }

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.post-author {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text);
}

.post-tag {
    font-size: 0.58rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 2px 8px;
    border-radius: 6px;
}

.post-tag.human { background: rgba(34, 197, 94, 0.12); color: var(--human); }
.post-tag.bot { background: rgba(239, 68, 68, 0.12); color: var(--bot); }
.post-tag.ai { background: rgba(139, 92, 246, 0.12); color: var(--ai); }
.post-tag.dead { background: rgba(42, 45, 66, 0.5); color: var(--dead-dim); }

.post-body {
    font-size: 0.78rem;
    color: var(--text-dim);
    line-height: 1.5;
}

.post-meta {
    font-size: 0.62rem;
    color: var(--text-muted);
    margin-top: 6px;
}

/* Milestones */
.milestones-section {
    max-width: 700px;
    margin: 44px auto 0;
    padding: 0 20px;
}

.milestones-section h2 {
    font-size: 1.15rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 4px;
}

.milestones-desc {
    text-align: center;
    color: var(--text-dim);
    font-size: 0.8rem;
    margin-bottom: 20px;
}

.milestones-container {
    position: relative;
    padding-left: 24px;
}

.milestones-container::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--human), var(--bot));
    border-radius: 1px;
}

.milestone {
    position: relative;
    padding: 0 0 20px 20px;
}

.milestone::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 5px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--text-dim);
    background: var(--bg);
}

.milestone.active::before {
    border-color: var(--accent);
    background: var(--accent);
    box-shadow: 0 0 8px var(--ai-glow);
}

.milestone.past::before {
    border-color: var(--text-dim);
    background: var(--text-dim);
}

.milestone-year {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent-glow);
    margin-bottom: 2px;
}

.milestone-text {
    font-size: 0.82rem;
    color: var(--text);
    line-height: 1.4;
}

.milestone-detail {
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-top: 2px;
}

/* Buttons */
.btn-icon {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-icon:hover {
    border-color: var(--accent);
    color: var(--accent-glow);
}

.btn-icon.playing {
    border-color: var(--bot);
    color: var(--bot);
}

/* Hidden */
.hidden { display: none !important; }

/* Footer */
footer {
    text-align: center;
    padding: 40px 20px;
    border-top: 1px solid var(--border);
    margin-top: 40px;
}

footer p {
    color: var(--text-dim);
    font-size: 0.8rem;
    margin-bottom: 6px;
}

.footer-note {
    font-size: 0.7rem !important;
    opacity: 0.5;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* Responsive */
@media (max-width: 768px) {
    header { padding: 35px 16px 10px; }
    .stats-bar {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    .stat-value { font-size: 1.2rem; }
    .viz-container { height: 320px; }
    .timeline-label { font-size: 1.8rem; }
}

@media (max-width: 480px) {
    .stats-bar {
        grid-template-columns: repeat(2, 1fr);
    }
    .stat-item:last-child {
        grid-column: span 2;
    }
    .viz-container { height: 260px; }
    .timeline-label { font-size: 1.5rem; }
    .feed-post { padding: 10px 12px; }
}
