/* Museum of Computing History — Dark retro theme */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #0a0a0f;
    --bg-card: #13131a;
    --bg-hover: #1a1a25;
    --text: #e0e0e8;
    --text-bright: #f0f0f8;
    --text-dim: #888;
    --accent: #00ff88;
    --accent-dim: #00cc6a;
    --border: #2a2a35;
    --card: #13131a;
    --nav-height: 64px;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Courier New', monospace;
    min-height: 100vh;
}

/* Header */
header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    height: var(--nav-height);
}

.header-inner {
    max-width: 1400px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 2rem; height: 100%;
}

.logo {
    color: var(--accent); font-size: 1.1rem; font-weight: bold;
    text-decoration: none;
    text-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

nav { display: flex; gap: 0.5rem; }

nav a {
    color: var(--text-dim); text-decoration: none;
    padding: 0.4rem 0.8rem; border: 1px solid transparent;
    border-radius: 4px; transition: all 0.2s; font-size: 0.85rem;
}

nav a:hover, nav a.active {
    color: var(--accent); border-color: var(--accent);
}

/* Main */
main {
    max-width: 1400px; margin: 0 auto;
    padding: calc(var(--nav-height) + 2rem) 2rem 2rem;
}

.container { max-width: 1200px; margin: 0 auto; }
.page-content { padding-top: 0; }

/* Buttons */
.btn { display: inline-block; padding: 10px 24px; border-radius: 8px; text-decoration: none; font-weight: 600; font-size: 0.9rem; transition: all 0.2s; }
.btn-primary { background: var(--accent); color: #000; }
.btn-primary:hover { background: #33ffaa; box-shadow: 0 0 20px rgba(0, 255, 136, 0.4); }
.btn-outline { border: 1px solid var(--accent); color: var(--accent); background: transparent; }
.btn-outline:hover { background: rgba(0, 255, 136, 0.1); }

/* Section title */
.section-title { color: var(--accent); font-size: 1.5rem; margin-bottom: 1rem; }

/* Hero */
.hero {
    text-align: center; padding: 3rem 1rem;
    border: 1px solid var(--border); border-radius: 8px;
    background: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
    margin-bottom: 2rem;
}

.hero h2 { color: var(--accent); font-size: 1.6rem; margin-bottom: 1rem; }
.hero p { color: var(--text-dim); max-width: 600px; margin: 0 auto 1.5rem; line-height: 1.6; }

/* Family Grid */
.families-grid h2 { color: var(--accent); margin-bottom: 1.5rem; }

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

.family-card {
    display: flex; gap: 1rem; padding: 1.2rem;
    background: var(--bg-card); border: 1px solid var(--border);
    border-left: 4px solid; border-radius: 6px;
    text-decoration: none; color: var(--text); transition: all 0.2s;
}

.family-card:hover { background: var(--bg-hover); transform: translateX(4px); }
.family-icon { font-size: 2rem; }
.family-info h3 { font-size: 1rem; margin-bottom: 0.3rem; }
.family-info p { color: var(--text-dim); font-size: 0.8rem; line-height: 1.4; }
.family-meta { color: var(--accent-dim); font-size: 0.75rem; }

/* Stats */
.stats {
    display: flex; justify-content: center; gap: 3rem;
    padding: 2rem; margin-top: 2rem;
}

.stat-box { text-align: center; }
.stat-number { display: block; font-size: 2.5rem; color: var(--accent); font-weight: bold; }
.stat-label { color: var(--text-dim); font-size: 0.85rem; }

/* Timeline page */
.timeline-controls {
    position: fixed; top: var(--nav-height); left: 0; right: 0; z-index: 90;
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.6rem 2rem;
    background: rgba(19, 19, 26, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}

.filter-bar { display: flex; gap: 0.8rem; align-items: center; flex-wrap: wrap; }
.filter-bar label { color: var(--text-dim); font-size: 0.8rem; }

.filter-bar select {
    background: var(--bg); color: var(--text);
    border: 1px solid var(--border); padding: 0.3rem 0.5rem;
    border-radius: 4px; font-family: inherit; font-size: 0.8rem;
}

.zoom-controls { display: flex; gap: 0.5rem; }

.zoom-controls button {
    background: var(--bg); color: var(--text);
    border: 1px solid var(--border); width: 32px; height: 32px;
    border-radius: 4px; cursor: pointer; font-size: 1.1rem;
}

.zoom-controls button:hover { border-color: var(--accent); color: var(--accent); }

#timeline-container {
    position: fixed; top: calc(var(--nav-height) + 44px);
    left: 0; right: 0; bottom: 0; overflow: hidden; background: var(--bg);
}

#timeline-svg { width: 100%; height: 100%; }

/* Tooltip */
.tooltip {
    position: absolute; background: #1a1a25;
    border: 1px solid var(--accent); border-radius: 6px;
    padding: 1rem; max-width: 350px; z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    pointer-events: none;
}

.tooltip h3 { color: var(--accent); margin-bottom: 0.3rem; }
.tt-year { color: var(--text-dim); font-size: 0.85rem; margin-bottom: 0.5rem; }
.tt-desc { font-size: 0.85rem; line-height: 1.4; margin-bottom: 0.5rem; }
.tt-emu.has-emu { color: var(--accent); font-size: 0.8rem; }
.tt-emu.no-emu { color: #f87171; font-size: 0.8rem; }
.tt-family { color: var(--text-dim); font-size: 0.8rem; }

/* Machine Detail */
.machine-detail { padding: 0; }
.machine-header { margin-bottom: 2rem; }
.machine-header h2 { color: var(--accent); font-size: 2rem; margin-bottom: 1rem; }
.machine-meta { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.badge {
    padding: 0.3rem 0.8rem; border-radius: 20px;
    font-size: 0.8rem; border: 1px solid var(--border);
}

.badge-year { background: #1e3a5f; color: #60a5fa; }
.badge-type { background: #3b1f5e; color: #c084fc; }
.badge-family { background: #1a3a2a; color: var(--accent); }
.badge-country { background: #3a2a1a; color: #fbbf24; }
.badge-emu { background: #1a3a2a; color: var(--accent); border-color: var(--accent); }
.badge-noemu { background: #3a1a1a; color: #f87171; }

.machine-body section {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 6px; padding: 1.5rem; margin-bottom: 1rem;
}

.machine-body h3 { color: var(--accent); margin-bottom: 0.8rem; }
.machine-body p { line-height: 1.6; }

.influence-list { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.influence-link {
    background: var(--bg); color: var(--accent); padding: 0.3rem 0.8rem;
    border: 1px solid var(--accent); border-radius: 4px;
    text-decoration: none; font-size: 0.85rem;
}
.influence-link:hover { background: var(--accent); color: #000; }

.btn-secondary {
    display: inline-block; border: 1px solid var(--accent);
    color: var(--accent); padding: 0.6rem 1.5rem;
    border-radius: 4px; text-decoration: none; margin-top: 2rem;
}

/* Footer */
footer {
    text-align: center; padding: 1.5rem;
    border-top: 1px solid var(--border);
    color: var(--text-dim); font-size: 0.8rem;
}

footer a { color: var(--accent); text-decoration: none; }
.credits { margin-top: 0.3rem; }

/* Scanlines */
body::after {
    content: ''; position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    background: repeating-linear-gradient(
        0deg, transparent, transparent 2px,
        rgba(0, 0, 0, 0.03) 2px, rgba(0, 0, 0, 0.03) 4px
    );
    pointer-events: none; z-index: 9999;
}

/* Responsive */
@media (max-width: 768px) {
    .header-inner { flex-direction: column; padding: 0.5rem 1rem; }
    nav { flex-wrap: wrap; justify-content: center; }
    .grid { grid-template-columns: 1fr; }
    main { padding-left: 1rem; padding-right: 1rem; }
}
