/* ═══════════════════════════════════════════════════════════════════════════
   COMPONENTS - Shared reusable UI elements
═══════════════════════════════════════════════════════════════════════════ */

/* Note / callout boxes */
.note {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin: 20px 0;
  box-shadow: var(--shadow-sm);
  transition: border-left-color var(--duration) var(--ease),
              box-shadow var(--duration) var(--ease);
}

.note:hover {
  border-left-color: #60a5fa;
  box-shadow: var(--shadow-sm), inset 0 0 20px rgba(59,130,246,0.06);
}

.note p { margin: 8px 0; }
.note p:first-child { margin-top: 0; }
.note p:last-child { margin-bottom: 0; }
.note ul { margin: 8px 0; }

/* Inline code */
code {
  font-family: var(--font-mono);
  background: var(--bg-surface);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  border: 1px solid var(--border);
}

/* Horizontal rule */
hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}

/* Back to top floating button */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 48px;
  height: 48px;
  background: var(--gradient-aurora);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(59,130,246,0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: all 0.3s ease;
  z-index: 99;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  animation: pulse-ring 2s ease-out 1;
}

@keyframes pulse-ring {
  0% { box-shadow: 0 8px 24px rgba(59,130,246,0.3), 0 0 0 0 rgba(59,130,246,0.4); }
  70% { box-shadow: 0 8px 24px rgba(59,130,246,0.3), 0 0 0 12px rgba(59,130,246,0); }
  100% { box-shadow: 0 8px 24px rgba(59,130,246,0.3), 0 0 0 0 rgba(59,130,246,0); }
}

.back-to-top:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(59,130,246,0.5), var(--shadow-glow);
}

.back-to-top svg {
  width: 20px;
  height: 20px;
  color: #0a0f1a;
}

@media (max-width: 640px) {
  .back-to-top {
    bottom: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
  }
}

/* ── Warm Paper overrides for legal pages ── */
body.legal-page .note {
  background: rgba(180, 83, 9, 0.045);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid rgba(28, 26, 22, 0.14);
  border-left: 3px solid #b45309;
  box-shadow: none;
}

body.legal-page .note:hover {
  border-left-color: #92400e;
  box-shadow: none;
}

body.legal-page .back-to-top {
  background: #1c1a16;
  box-shadow: 0 8px 24px rgba(28, 26, 22, 0.25);
}

body.legal-page .back-to-top:hover {
  box-shadow: 0 12px 32px rgba(28, 26, 22, 0.35);
}

body.legal-page .back-to-top svg {
  color: #faf7f2;
}

/* The pulse-ring keyframes are tinted for the dark theme; skip them here. */
body.legal-page .back-to-top.visible {
  animation: none;
}

