/* ===== CSS Variables & Reset ===== */
:root {
  --bg: #0a0a1a;
  --surface: #12122a;
  --surface2: #1a1a3a;
  --text: #e0e0f0;
  --text-muted: #8888aa;
  --accent: #6c5ce7;
  --accent-glow: rgba(108, 92, 231, 0.5);
  --accent2: #00d2ff;
  --accent3: #ff6b6b;
  --gold: #ffd700;
  --timeline-line: #2a2a4a;
  --node-size: 14px;
  --node-active-size: 22px;
  --radius: 10px;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

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

html {
  font-size: 16px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ===== Layout ===== */
.app-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 24px 40px;
}

/* ===== Header ===== */
.header {
  text-align: center;
  margin-bottom: 16px;
}

.header h1 {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent2), var(--accent), var(--accent3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.header .subtitle {
  font-size: 0.92rem;
  color: var(--text-muted);
}

.header .source-attribution {
  font-size: 0.78rem;
  color: var(--text-muted);
  opacity: 0.7;
  margin-top: 2px;
  font-style: italic;
}

/* ===== Controls ===== */
.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 20px;
  background: var(--surface);
  border-radius: var(--radius);
  margin-bottom: 18px;
  border: 1px solid rgba(108, 92, 231, 0.2);
}

.control-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.2s;
  flex-shrink: 0;
}

.control-btn:hover {
  background: var(--accent);
  transform: scale(1.05);
  box-shadow: 0 0 14px var(--accent-glow);
}

.control-btn:active {
  transform: scale(0.95);
}

.control-btn.active {
  background: var(--accent);
  box-shadow: 0 0 16px var(--accent-glow);
}

.control-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  pointer-events: none;
}

.speed-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.speed-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.speed-value {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent2);
  min-width: 38px;
  text-align: center;
}

.progress-info {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-left: auto;
  white-space: nowrap;
}

/* ===== Main Timeline Area ===== */
.timeline-section {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px 24px 22px;
  margin-bottom: 18px;
  border: 1px solid rgba(108, 92, 231, 0.15);
  position: relative;
  overflow: hidden;
}

/* Current Event Card */
.current-event {
  background: var(--surface2);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 22px;
  border-left: 4px solid var(--accent2);
  transition: opacity 0.35s, transform 0.35s;
  min-height: 80px;
}

.current-event.has-media {
  display: flex;
  align-items: flex-start;
  gap: 22px;
}

.event-media {
  flex: 0 0 200px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.event-image {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid rgba(108, 92, 231, 0.25);
  display: block;
}

.event-credit {
  font-size: 0.66rem;
  line-height: 1.35;
  color: var(--text-muted);
  opacity: 0.85;
}

.event-credit a {
  color: var(--accent2);
  text-decoration: none;
}

.event-credit a:hover {
  text-decoration: underline;
}

.event-text {
  flex: 1 1 auto;
  min-width: 0;
}

.current-event .event-date-badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 8px;
  letter-spacing: 0.04em;
}

.current-event .event-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: #fff;
}

.current-event .event-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.current-event.fade-out {
  opacity: 0;
  transform: translateY(-8px);
}

/* Timeline Progress Bar */
.timeline-track {
  position: relative;
  height: 60px;
  margin-bottom: 8px;
  cursor: pointer;
}

.timeline-track .track-line {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--timeline-line);
  border-radius: 2px;
  transform: translateY(-50%);
}

.timeline-track .track-fill {
  position: absolute;
  top: 50%;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 2px;
  transform: translateY(-50%);
  transition: width 0.15s ease-out;
  box-shadow: 0 0 8px var(--accent-glow);
}

/* Nodes on timeline */
.timeline-nodes {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.timeline-node {
  position: absolute;
  top: 50%;
  width: var(--node-size);
  height: var(--node-size);
  border-radius: 50%;
  background: var(--timeline-line);
  border: 2px solid var(--surface2);
  transform: translate(-50%, -50%);
  transition: all 0.25s;
  cursor: pointer;
  z-index: 2;
}

.timeline-node.revealed {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow);
}

.timeline-node.active {
  width: var(--node-active-size);
  height: var(--node-active-size);
  background: var(--accent2);
  border-color: var(--accent2);
  box-shadow: 0 0 18px rgba(0, 210, 255, 0.7);
  z-index: 3;
}

.timeline-node:hover {
  transform: translate(-50%, -50%) scale(1.5);
  box-shadow: 0 0 14px var(--accent-glow);
  z-index: 4;
}

/* Acceleration markers */
.timeline-markers {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 2px;
}

.timeline-marker {
  font-size: 0.62rem;
  color: var(--text-muted);
  white-space: nowrap;
  transform: translateX(-50%);
  opacity: 0.6;
}

/* Acceleration curve indicator */
.acceleration-indicator {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
  opacity: 0.8;
}

.acceleration-indicator .curve-icon {
  display: inline-block;
  margin-right: 4px;
  color: var(--accent2);
}

/* ===== AI Capability Curve ===== */
.capability-panel {
  background: var(--surface2);
  border-radius: var(--radius);
  padding: 16px 18px 12px;
  margin-bottom: 22px;
  border: 1px solid rgba(0, 210, 255, 0.15);
}

.capability-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.capability-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.capability-readout {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}

.capability-tier {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--accent2);
  transition: color 0.3s;
}

.capability-index {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.capability-chart-area {
  width: 100%;
}

.capability-chart {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.capability-chart .chart-grid {
  stroke: rgba(136, 136, 170, 0.15);
  stroke-width: 1;
}

.capability-chart .chart-axis {
  stroke: rgba(136, 136, 170, 0.35);
  stroke-width: 1.2;
}

.capability-chart .chart-tier-label {
  fill: var(--text-muted);
  font-size: 16px;
  font-family: var(--font);
  opacity: 0.75;
}

.capability-chart .chart-x-label {
  fill: var(--text-muted);
  font-size: 16px;
  font-family: var(--font);
  opacity: 0.7;
}

.capability-chart .chart-ghost {
  fill: none;
  stroke: rgba(136, 136, 170, 0.25);
  stroke-width: 2;
  stroke-dasharray: 4 5;
}

.capability-chart .chart-fill {
  stroke: none;
}

.capability-chart .chart-line {
  fill: none;
  stroke: url(#capGradient);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 5px var(--accent-glow));
}

.capability-chart .chart-dot {
  fill: var(--accent2);
  stroke: #fff;
  stroke-width: 1.5;
  filter: drop-shadow(0 0 6px rgba(0, 210, 255, 0.8));
  transition: cx 0.25s ease-out, cy 0.25s ease-out;
}

.capability-chart .chart-dot.hidden {
  display: none;
}

.capability-caption {
  font-size: 0.72rem;
  color: var(--text-muted);
  opacity: 0.75;
  margin-top: 6px;
  line-height: 1.45;
}

/* ===== Event List Section ===== */
.event-list-section {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid rgba(108, 92, 231, 0.15);
  overflow: hidden;
}

.event-list-header {
  padding: 14px 20px;
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(108, 92, 231, 0.15);
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.event-list-header .event-count {
  font-size: 0.78rem;
  opacity: 0.7;
  font-weight: 400;
}

.event-list {
  max-height: 420px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.event-list::-webkit-scrollbar {
  width: 6px;
}

.event-list::-webkit-scrollbar-track {
  background: transparent;
}

.event-list::-webkit-scrollbar-thumb {
  background: var(--surface2);
  border-radius: 3px;
}

.event-list::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

.event-list-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 20px;
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: 1px solid rgba(108, 92, 231, 0.08);
  position: relative;
}

.event-list-item:hover {
  background: var(--surface2);
}

.event-list-item.active {
  background: rgba(108, 92, 231, 0.15);
  border-left: 3px solid var(--accent2);
}

.event-list-item .list-date {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  min-width: 72px;
  padding-top: 2px;
}

.event-list-item .list-content {
  flex: 1;
  min-width: 0;
}

.event-list-item .list-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.event-list-item .list-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, margin-top 0.3s ease;
}

.event-list-item:hover .list-desc,
.event-list-item.active .list-desc {
  max-height: 80px;
  margin-top: 4px;
}

.event-list-item .list-index {
  font-size: 0.68rem;
  color: var(--text-muted);
  opacity: 0.4;
  min-width: 24px;
  text-align: right;
  padding-top: 2px;
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 16px 0 0;
  font-size: 0.72rem;
  color: var(--text-muted);
  opacity: 0.5;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .app-container {
    padding: 12px 14px 28px;
  }

  .controls {
    gap: 8px;
    padding: 10px 14px;
  }

  .control-btn {
    width: 34px;
    height: 34px;
  }

  .control-btn svg {
    width: 15px;
    height: 15px;
  }

  .current-event {
    padding: 14px 16px;
  }

  .current-event.has-media {
    flex-direction: column;
    gap: 14px;
  }

  .event-media {
    flex-basis: auto;
    width: 100%;
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
  }

  .event-image {
    width: 120px;
    height: 90px;
    flex-shrink: 0;
  }

  .event-credit {
    align-self: center;
  }

  .current-event .event-title {
    font-size: 1.1rem;
  }

  .timeline-section {
    padding: 18px 14px 16px;
  }

  .timeline-track {
    height: 46px;
  }

  .event-list {
    max-height: 300px;
  }

  .event-list-item .list-date {
    min-width: 56px;
    font-size: 0.7rem;
  }

  .event-list-item .list-title {
    font-size: 0.85rem;
  }

  .timeline-node {
    width: 10px;
    height: 10px;
  }

  .timeline-node.active {
    width: 17px;
    height: 17px;
  }

  .speed-label {
    display: none;
  }
}

@media (max-width: 480px) {
  .header h1 {
    font-size: 1.35rem;
  }

  .controls {
    flex-wrap: nowrap;
    gap: 6px;
    padding: 8px 10px;
    overflow-x: auto;
  }

  .control-btn {
    width: 30px;
    height: 30px;
    font-size: 0.9rem;
  }

  .control-btn svg {
    width: 14px;
    height: 14px;
  }

  .progress-info {
    font-size: 0.7rem;
  }

  .event-list-item {
    padding: 10px 14px;
    gap: 8px;
  }

  .timeline-marker {
    font-size: 0.55rem;
  }
}
