:root {
  --bg: #0f0f13;
  --card: #0f1720;
  --accent: #ff5a5f;
  --text: #e6eef3;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  min-height: 100vh;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family:
    system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    'Helvetica Neue',
    Arial,
    sans-serif;
  background: linear-gradient(180deg, var(--bg), #071126);
  color: var(--text);
  padding: 1rem;
}

/* Header */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1200px;
  margin: 0 auto 2rem;
}

header h1 {
  margin: 0;
  font-size: 2rem;
  background: linear-gradient(135deg, #ff006e, #8338ec);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tagline {
  margin: 0.25rem 0 0 0;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
}

/* Buttons */
button {
  background: var(--accent);
  border: none;
  color: #fff;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

button:hover {
  background: #ff7074;
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

/* Main content */
main {
  max-width: 1200px;
  margin: 0 auto;
}

/* Timeline */
#timeline-container {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.timeline-controls {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

.timeline-mode-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
}

.timeline-mode-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

#timeline {
  overflow-x: auto;
  overflow-y: visible;
}

/* Timeline SVG */
#timeline svg {
  text-rendering: optimizeLegibility;
  max-width: 100%;
  height: auto;
  font-family: inherit;
}

.membership-bar {
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.membership-bar:hover,
.membership-bar:focus {
  opacity: 1 !important;
  outline: 2px solid rgba(255, 255, 255, 0.4);
  outline-offset: 2px;
}

/* Legend */
#legend {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#legend h3 {
  margin: 0 0 0.75rem 0;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.legend-swatch {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* Network view */
#network-container {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
  padding: 1.5rem;
  min-height: 600px;
}

.network-hint {
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
  margin: 0 0 1rem 0;
  font-style: italic;
}

#network {
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: grab;
}

#network:active {
  cursor: grabbing;
}

#network svg {
  border-radius: 8px;
}

.network-node {
  cursor: pointer;
  transition: all 0.2s ease;
}

.network-node circle,
.network-node rect {
  transition: all 0.2s ease;
}

.network-node:hover circle,
.network-node:hover rect {
  filter: brightness(1.2);
}

.network-tooltip {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  font-family: inherit;
}

/* Footer */
footer p {
  text-align: center;
  color: rgba(255, 255, 255, 0.3);
  font-size: 0.85rem;
  margin-top: 2rem;
}

/* Accessibility */
.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  position: static;
  width: auto;
  height: auto;
  padding: 0.5rem;
  background: #fff;
  color: #000;
}

/* Focus styles */
:focus {
  outline: 3px solid #ffd166;
  outline-offset: 2px;
}

button:focus {
  outline: 3px solid #ffd166;
  outline-offset: 2px;
}

/* Tooltip */
.timeline-tooltip {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  font-family: inherit;
}

/* Album markers */
.album-marker {
  cursor: pointer;
  transition: r 0.2s ease;
}
