:root {
  --bg-primary: #1a1a2e;
  --bg-secondary: #16213e;
  --bg-card: #0f3460;
  --text-primary: #e0e0e0;
  --text-secondary: #a0a0b0;
  --accent: #e94560;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

header {
  text-align: center;
  padding: 2rem 1rem 1rem;
}

header h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 800px;
  padding: 0 1rem;
}

/* Spiral container */
#spiral-container {
  position: relative;
  width: 100%;
  max-width: 700px;
  aspect-ratio: 1;
}

#spiral {
  width: 100%;
  height: 100%;
}

/* Tooltip */
.tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 10;
  white-space: nowrap;
}

.tooltip.visible {
  opacity: 1;
}

/* Controls */
#controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  align-items: center;
  padding: 1rem 0;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

button {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.2s ease;
}

button:hover:not(:disabled) {
  background: var(--bg-secondary);
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

select {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
}

label {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* Slider */
#year-slider {
  width: 200px;
  accent-color: var(--accent);
}

#year-display {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  min-width: 3rem;
}

/* Legend */
#legend {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0 1.5rem;
}

.legend-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

#legend-gradient {
  border-radius: 4px;
}

/* Month labels in SVG */
.month-label {
  fill: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 12px;
  text-anchor: middle;
}

/* Year label in center */
.year-label {
  fill: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 28px;
  text-anchor: middle;
  dominant-baseline: central;
}

/* Arc highlight on slider */
.arc-highlight {
  stroke: rgba(255, 255, 255, 0.6);
  stroke-width: 1.5;
}

/* Footer */
footer {
  text-align: center;
  padding: 1rem;
  color: var(--text-secondary);
  font-size: 0.75rem;
}

footer a {
  color: var(--accent);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 600px) {
  header h1 {
    font-size: 1.3rem;
  }

  .subtitle {
    font-size: 0.8rem;
  }

  #controls {
    flex-direction: column;
  }

  #year-slider {
    width: 160px;
  }
}
