:root {
    --bg: #0e0e0e;
    --surface: #1a1a1a;
    --border: #2a2a2a;
    --text: #d4c9b0;
    --text-muted: #5a5550;
    --accent: #c4a35a;
}

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'JetBrains Mono', monospace;
    padding: 20px;
}

.epoch-timeline {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin: 20px 0;
    width: 100%;
}

@media (max-width: 1200px) {
    .epoch-timeline {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 800px) {
    .epoch-timeline {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 500px) {
    .epoch-timeline {
        grid-template-columns: repeat(2, 1fr);
    }
}

.epoch-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 16px;
    color: var(--text-muted);
    cursor: pointer;
    font-family: monospace;
    transition: all 0.2s;
}

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

.epoch-btn.active {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
}

.epoch-info {
    text-align: center;
    margin: 20px auto;
    padding: 12px 24px;
    background: var(--surface);
    border-radius: 40px;
    width: fit-content;
}

.stats {
    display: flex;
    gap: 32px;
    justify-content: center;
    margin: 20px 0;
}

.stat {
    text-align: center;
}

.stat-val {
    font-size: 1.6rem;
    color: var(--accent);
    font-family: serif;
}

.detail-container {
    margin: 20px auto;
    max-width: 1400px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.detail-container.closed {
    display: none;
}

.detail-header {
    display: flex;
    justify-content: flex-end;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.close-detail {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 4px 12px;
    color: var(--text-muted);
    cursor: pointer;
}

.close-detail:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.detail-grid-wrapper {
    padding: 20px;
    min-height: 300px;
}

.detail-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    align-items: flex-start;
}

.detail-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    flex: 1 1 250px;
    max-width: 350px;
    min-height: 80px;
    cursor: pointer;
    transition: all 0.1s;
}

.detail-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.detail-card .year {
    color: var(--accent);
    font-weight: bold;
    margin-bottom: 8px;
}

.detail-card .event {
    font-size: 0.8rem;
    margin-bottom: 6px;
}

.detail-card .details {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.loader {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

#tt {
    position: fixed;
    background: #1e1c18;
    border: 1px solid var(--accent);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 12px;
    color: var(--text);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.1s;
    z-index: 9999;
    max-width: 280px;
}

#tt.show {
    opacity: 1;
}

.footer {
    margin-top: 40px;
    padding: 20px;
    text-align: center;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-muted);
}

.footer-links {
    margin-bottom: 12px;
}

.footer-links a {
    color: var(--accent);
    text-decoration: none;
    margin: 0 10px;
    font-size: 14px;
    font-family: 'JetBrains Mono', monospace;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--text);
}

/* MODAL STYLES */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}
.modal-overlay.hidden { display: none; }
.modal-content {
    background: var(--surface);
    border: 1px solid var(--accent);
    padding: 40px;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
    text-align: left;
}
.modal-close {
    position: absolute;
    top: 15px; right: 20px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}
.modal-close:hover { color: var(--accent); }
.modal-year { color: var(--accent); font-weight: bold; font-family: 'JetBrains Mono', monospace; letter-spacing: 1px; }
.modal-title { margin: 15px 0; font-size: 2rem; color: var(--text); font-family: 'Playfair Display', serif;}
.modal-details { color: #a9a297; line-height: 1.8; font-size: 1.1rem; white-space: pre-wrap; }

/* GROUP HEADERS */
.detail-group-header {
    width: 100%;
    flex-basis: 100%;
    margin-top: 30px;
    margin-bottom: 10px;
    font-size: 1.6rem;
    color: var(--accent);
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
    text-align: left;
    font-family: 'Playfair Display', serif;
}

/* INTRO BOX */
.intro-box {
    text-align: center;
    padding: 60px 40px;
    color: var(--text);
    max-width: 800px;
    margin: 0 auto;
}
.intro-box h2 {
    color: var(--text);
    margin-bottom: 20px;
    font-size: 2rem;
    font-family: 'Playfair Display', serif;
}
.intro-box p {
    font-size: 1.2rem;
    color: var(--accent);
}