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

:root {
  --bg: #0a0a0f;
  --bg-card: #141420;
  --bg-card-hover: #1a1a2e;
  --text: #e8e8f0;
  --text-muted: #8888a0;
  --border: #2a2a40;
  --timeline-line: #2a2a40;
  --history: #4a9eff;
  --history-bg: rgba(74, 158, 255, 0.08);
  --history-border: rgba(74, 158, 255, 0.25);
  --science: #34d399;
  --science-bg: rgba(52, 211, 153, 0.08);
  --science-border: rgba(52, 211, 153, 0.25);
  --math: #f59e0b;
  --math-bg: rgba(245, 158, 11, 0.08);
  --math-border: rgba(245, 158, 11, 0.25);
  --literature: #a78bfa;
  --literature-bg: rgba(167, 139, 250, 0.08);
  --literature-border: rgba(167, 139, 250, 0.25);
  --modal-bg: #16162a;
  --overlay: rgba(0, 0, 0, 0.7);
  --filter-bg: #111120;
  --filter-active: #1e1e35;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

.site-header {
  text-align: center;
  padding: 60px 20px 30px;
}

.site-title {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #4a9eff, #a78bfa, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.site-subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-top: 8px;
}

.filter-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--filter-bg);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.filter-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.filter-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.filter-btn:hover {
  background: var(--filter-active);
  color: var(--text);
}

.filter-btn.active {
  background: var(--filter-active);
  color: var(--text);
  border-color: var(--text-muted);
}

.filter-btn.active[data-filter="history"] { border-color: var(--history); color: var(--history); }
.filter-btn.active[data-filter="science"] { border-color: var(--science); color: var(--science); }
.filter-btn.active[data-filter="math"] { border-color: var(--math); color: var(--math); }
.filter-btn.active[data-filter="literature"] { border-color: var(--literature); color: var(--literature); }

.filter-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.history-dot { background: var(--history); }
.science-dot { background: var(--science); }
.math-dot { background: var(--math); }
.literature-dot { background: var(--literature); }

.card-count {
  color: var(--text-muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.timeline-container {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

.timeline-line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--timeline-line);
  transform: translateX(-50%);
}

.timeline {
  position: relative;
}

.era-marker {
  text-align: center;
  padding: 30px 0 20px;
  position: relative;
  z-index: 2;
}

.era-marker span {
  display: inline-block;
  background: var(--bg);
  padding: 6px 20px;
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-muted);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.timeline-item {
  position: relative;
  width: 45%;
  padding: 0 0 30px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.timeline-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.timeline-item.hidden {
  display: none !important;
}

.timeline-item:nth-child(odd) {
  margin-left: 55%;
}

.timeline-item:nth-child(even) {
  margin-left: 0;
  text-align: right;
}

.timeline-item::before {
  content: '';
  position: absolute;
  top: 20px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg);
  z-index: 3;
}

.timeline-item:nth-child(odd)::before {
  left: -32px;
}

.timeline-item:nth-child(even)::before {
  right: -32px;
}

.timeline-item.category-history::before { border-color: var(--history); background: var(--history-bg); }
.timeline-item.category-science::before { border-color: var(--science); background: var(--science-bg); }
.timeline-item.category-math::before { border-color: var(--math); background: var(--math-bg); }
.timeline-item.category-literature::before { border-color: var(--literature); background: var(--literature-bg); }

.timeline-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.timeline-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.category-history .timeline-card { border-color: var(--history-border); }
.category-science .timeline-card { border-color: var(--science-border); }
.category-math .timeline-card { border-color: var(--math-border); }
.category-literature .timeline-card { border-color: var(--literature-border); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 8px;
}

.card-year {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}

.card-category-tag {
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.tag-history { background: var(--history-bg); color: var(--history); }
.tag-science { background: var(--science-bg); color: var(--science); }
.tag-math { background: var(--math-bg); color: var(--math); }
.tag-literature { background: var(--literature-bg); color: var(--literature); }

.card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.card-summary {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Future Section */
.future-section {
  position: relative;
  z-index: 2;
  margin-top: 60px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}

.future-heading {
  text-align: center;
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 30px;
  color: var(--text-muted);
}

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

.future-tile {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.future-tile::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--history), var(--science), var(--math), var(--literature));
  opacity: 0.5;
}

.future-tile:hover {
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.future-decade {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.future-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--modal-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px;
  max-width: 560px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.25s ease;
}

.modal-overlay.open .modal {
  transform: scale(1) translateY(0);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.modal-category {
  display: inline-block;
  font-size: 0.7rem;
  padding: 4px 12px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  margin-bottom: 16px;
}

.modal-year {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.3;
}

.modal-detail {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* Responsive */
@media (max-width: 768px) {
  .site-title { font-size: 2rem; }
  .site-header { padding: 40px 16px 20px; }

  .timeline-line { left: 24px; }

  .timeline-item,
  .timeline-item:nth-child(odd),
  .timeline-item:nth-child(even) {
    width: calc(100% - 50px);
    margin-left: 50px;
    text-align: left;
  }

  .timeline-item::before,
  .timeline-item:nth-child(odd)::before,
  .timeline-item:nth-child(even)::before {
    left: -32px;
    right: auto;
  }

  .filter-bar { padding: 10px 12px; gap: 8px; }
  .filter-btn { padding: 6px 12px; font-size: 0.8rem; }
  .future-grid { grid-template-columns: 1fr 1fr; }
  .modal { padding: 24px; }
  .modal-title { font-size: 1.2rem; }
}

@media (max-width: 480px) {
  .future-grid { grid-template-columns: 1fr; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
