/* ── Reading progress bar (top of page, article only) ── */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #a855f7);
  z-index: 200;
  transition: width 0.1s linear;
  border-radius: 0 2px 2px 0;
}

/* ── Back to top button (left side, symmetric with vinyl player) ── */
.back-to-top {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s, transform 0.3s, color 0.2s, border-color 0.2s, background-color 0.3s, box-shadow 0.3s;
  z-index: 98;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
}

.back-to-top:hover {
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

@media (max-width: 600px) {
  .back-to-top {
    bottom: 60px;
    left: 16px;
    width: 44px;
    height: 44px;
    font-size: 1rem;
  }
}

/* ── Animated link underline (nav links) ── */
nav a::before {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

nav a:hover::before {
  transform: scaleX(1);
}

nav a.active::before {
  transform: scaleX(1);
}

/* ── Typing cursor on hero subtitle ── */
.hero p::after {
  content: "▌";
  color: var(--accent);
  animation: blink 1s step-end infinite;
  margin-left: 2px;
  font-weight: 300;
}

@keyframes blink {
  50% { opacity: 0; }
}
