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

body {
  background: #0a0a0c;
  color: #ccc;
  font-family: system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Top bar */

#top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  padding: 16px;
  z-index: 5;
  background: linear-gradient(to bottom, #0a0a0c 60%, transparent);
  pointer-events: none;
}

#filters {
  display: flex;
  gap: 4px;
  pointer-events: all;
}

.filter-btn {
  background: #1a1a1a;
  border: 1px solid #333;
  color: #777;
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.filter-btn:hover {
  border-color: #555;
  color: #bbb;
}

.filter-btn.active {
  background: #222;
  border-color: #666;
  color: #ddd;
}

/* Timeline */

#timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  padding: 80px 40px 60px;
}

/* Central axis */

#timeline-axis {
  position: absolute;
  left: 50%;
  top: 80px;
  bottom: 60px;
  width: 1px;
  background: linear-gradient(to bottom, transparent, #2a2a2e 3%, #2a2a2e 97%, transparent);
  transform: translateX(-0.5px);
}

/* Year / month markers on the axis */

.axis-year {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  color: #555;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  z-index: 2;
  pointer-events: none;
}

.axis-year::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #1a1a1e;
  border: 1.5px solid #444;
}

.axis-year span {
  position: relative;
  display: inline-block;
  background: #0a0a0c;
  padding: 2px 10px;
}

.axis-month {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  pointer-events: none;
}

.axis-month::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 1px;
  background: linear-gradient(to right, transparent, #2a2a2e, transparent);
}

.axis-month-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #333;
  margin: 0 auto;
  position: relative;
}

.axis-month-label {
  color: #444;
  font-size: 10px;
  text-align: center;
  margin-top: 4px;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.axis-month.past .axis-month-dot {
  background: #555;
}

.axis-month.past .axis-month-label {
  color: #666;
}

.axis-month.past::before {
  background: linear-gradient(to right, transparent, #444, transparent);
}

/* Timeline items (book entries) */

#timeline-items {
  position: relative;
  z-index: 3;
}

.tl-item {
  position: absolute;
  width: calc(50% - 40px);
  transition: opacity 0.3s;
}

.tl-item.left {
  left: 0;
  text-align: right;
}

.tl-item.right {
  right: 0;
  text-align: left;
}

/* Connectors are created dynamically in JS */


/* Duration tracks beside the axis */

#track-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  pointer-events: none;
}

.tl-track {
  position: absolute;
  border-radius: 2px;
  background: var(--track-color);
  opacity: 0.35;
  transition: opacity 0.3s;
}

/* Small circle at top (end date / finish) */
.tl-track::before {
  content: "";
  position: absolute;
  top: -3px;
  left: 50%;
  transform: translateX(-50%);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--track-color);
  box-shadow: 0 0 6px var(--track-color);
}

/* Large circle at bottom (start date / beginning) */
.tl-track::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--track-color);
  box-shadow: 0 0 8px var(--track-color);
}

/* Card */

.tl-card {
  display: inline-block;
  text-align: left;
  background: rgba(20, 20, 24, 0.7);
  border: 1px solid #1e1e22;
  border-radius: 8px;
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.2s;
  max-width: 100%;
}

.tl-card:hover {
  background: rgba(28, 28, 34, 0.9);
  border-color: #333;
}

.tl-title {
  font-size: 14px;
  font-weight: 500;
  color: #ddd;
  margin-bottom: 3px;
  line-height: 1.3;
}

.tl-author {
  font-size: 12px;
  color: #666;
  margin-bottom: 6px;
}

.tl-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tl-status {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid;
}

.tl-status[data-status="прочитал"] {
  color: #4aba70;
  border-color: rgba(74, 186, 112, 0.3);
}

.tl-status[data-status="читаю"] {
  color: #e8c547;
  border-color: rgba(232, 197, 71, 0.3);
}

.tl-status[data-status="хочу прочитать"] {
  color: #c45c5c;
  border-color: rgba(196, 92, 92, 0.3);
}

.tl-dates {
  font-size: 11px;
  color: #555;
}

.tl-rating {
  font-size: 12px;
  color: #e8c547;
  letter-spacing: 1px;
}

.tl-categories {
  font-size: 10px;
  color: #444;
  margin-top: 4px;
}

/* Dimmed state */

.tl-item.dimmed {
  opacity: 0.08;
  pointer-events: none;
}

/* No-date section */

#no-date-section {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid #1a1a1e;
  text-align: center;
}

#no-date-label {
  color: #333;
  font-size: 12px;
  letter-spacing: 1px;
  margin-bottom: 20px;
}

#no-date-items {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

#no-date-items .tl-card {
  width: 240px;
}

/* "Now" marker */

.axis-now {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  pointer-events: none;
}

.axis-now-line {
  width: 40px;
  height: 1px;
  margin: 0 auto;
  background: linear-gradient(to right, transparent, #e8c547, transparent);
  opacity: 0.5;
}

.axis-now-label {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  color: #e8c547;
  font-size: 10px;
  letter-spacing: 1px;
  text-align: center;
  padding-bottom: 4px;
  opacity: 0.6;
  white-space: nowrap;
}

/* Book panel (same as site1) */

#book-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 360px;
  height: 100vh;
  background: rgba(22, 22, 26, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.5);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  padding: 32px 24px;
  z-index: 10;
}

#book-panel.open {
  transform: translateX(0);
}

#panel-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: #888;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

#panel-close:hover {
  color: #fff;
}

.book-cover {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  margin-bottom: 20px;
  border-radius: 4px;
}

.book-title {
  font-size: 20px;
  font-weight: 600;
  color: #eee;
  margin-bottom: 8px;
}

.book-author {
  font-size: 14px;
  color: #999;
  margin-bottom: 16px;
}

.book-status {
  font-size: 13px;
  color: #4aba70;
  margin-bottom: 8px;
  text-transform: capitalize;
}

.book-rating {
  font-size: 18px;
  color: #e8c547;
  margin-bottom: 8px;
  letter-spacing: 2px;
}

.book-dates {
  font-size: 12px;
  color: #777;
  margin-bottom: 16px;
}

.book-notes {
  font-size: 13px;
  color: #bbb;
  line-height: 1.6;
  margin-bottom: 20px;
}

.book-quotes blockquote {
  font-size: 13px;
  color: #999;
  font-style: italic;
  border-left: 2px solid #444;
  padding-left: 12px;
  margin-bottom: 12px;
  line-height: 1.5;
}

@media (max-width: 640px) {
  #timeline {
    padding: 80px 16px 60px;
  }

  .tl-item {
    width: calc(50% - 24px);
  }

  #book-panel {
    width: 100vw;
  }
}
