/* ═══════════════════════════════════════════════
   LIBRARY — Hub page styles

   The Taoist approach: CSS owns all transforms.
   JS never touches style.transform. No conflicts.
   ═══════════════════════════════════════════════ */

#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════════ */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2rem;
  padding: calc(6vh + 40px) clamp(1.5rem, 5vw, 5rem) 3vh;
  max-width: 1200px;
  margin: 0 auto;
  z-index: 1;
}

/* ── Hero: left panel — title + connect ──────── */
.hero-left { text-align: left; }

/* ── Hero: right panel — patronage QR ───────── */
.hero-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  padding: 1rem 1.25rem 0.9rem;
  background: rgba(201, 169, 110, 0.04);
  border: 1px solid rgba(201, 169, 110, 0.14);
  border-radius: 12px;
  opacity: 0;
  animation: fadeUp 0.7s 0.7s ease forwards;
  flex-shrink: 0;
}

.hero-support-label {
  font-family: var(--font-ui);
  font-size: 0.56rem;
  letter-spacing: 0.16em;
  color: var(--gold-dim);
  margin-bottom: 0.2rem;
}

#hero-zap-qr {
  image-rendering: pixelated;
  width: 120px;
  height: 120px;
  border-radius: 6px;
  display: none; /* shown by JS after render */
}

.hero-zap-addr {
  font-family: var(--font-code);
  font-size: 0.56rem;
  color: var(--gold-dim);
  text-decoration: none;
  letter-spacing: 0.03em;
  transition: color 0.2s;
  text-align: center;
  max-width: 160px;
  word-break: break-all;
}
.hero-zap-addr:hover { color: var(--gold-bright); }

.hero-support-sub {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-style: italic;
  color: var(--text-dim);
  opacity: 0.7;
  text-align: center;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.6rem);
  font-weight: 700;
  color: var(--gold-bright);
  letter-spacing: 0.02em;
  line-height: 1.12;
  margin-bottom: 0.4rem;
  text-shadow: 0 0 80px rgba(201, 169, 110, 0.35);
  opacity: 0; transform: translateY(20px);
  animation: fadeUp 0.8s 0.15s ease forwards;
}

.hero .tagline {
  font-family: var(--font-heading);
  font-size: clamp(0.85rem, 1.8vw, 1.1rem);
  font-style: italic;
  color: var(--text-dim);
  opacity: 0; transform: translateY(14px);
  animation: fadeUp 0.8s 0.35s ease forwards;
}

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════
   SOVEREIGN IDENTITY — Connect button + modal
   ═══════════════════════════════════════════════ */
.identity-bar {
  margin-top: 1.2rem;
  display: flex;
  justify-content: center;
  opacity: 0;
  animation: fadeUp 0.6s 0.55s ease forwards;
}

.identity-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 1rem 0.35rem 0.75rem;
  background: transparent;
  border: 1px solid rgba(201,169,110,0.3);
  border-radius: 99px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.identity-btn:hover {
  border-color: rgba(201,169,110,0.7);
  color: var(--gold-bright);
}
.identity-dot {
  font-size: 1rem;
  line-height: 1;
  transition: color 0.3s;
}

/* Modal backdrop */
.nostr-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(10,10,20,0.82);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.nostr-modal-backdrop[hidden] { display: none; }

/* Modal card */
.nostr-modal {
  position: relative;
  background: var(--surface);
  border: 1px solid rgba(201,169,110,0.25);
  border-radius: 1rem;
  padding: 2rem 1.75rem 1.75rem;
  max-width: 360px;
  width: 100%;
  text-align: center;
  box-shadow: 0 32px 80px rgba(0,0,0,0.6);
}

.nostr-modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.9rem;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.2rem 0.4rem;
}
.nostr-modal-close:hover { color: var(--text); }

.nostr-modal-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--gold-bright);
  margin-bottom: 0.4rem;
}

.nostr-modal-sub {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin: 0 0 1.2rem;
}

/* QR code canvas */
.nostr-qr-wrap {
  margin: 0 auto 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
#nostr-qr-canvas {
  border-radius: 0.5rem;
  background: #faf6f0;
  display: block;
  max-width: 200px;
  height: auto;
  image-rendering: pixelated; /* keep QR modules crisp */
}
.nostr-qr-hint {
  font-size: 0.73rem;
  color: var(--text-dim);
  margin: 0;
}

/* Mobile deep link button */
.nostr-open-btn {
  display: block;
  margin: 0.5rem auto 0.75rem;
  padding: 0.6rem 1.4rem;
  background: var(--gold-bright);
  color: #0a0a14;
  border-radius: 99px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-decoration: none;
  font-weight: 600;
  transition: opacity 0.15s;
}
.nostr-open-btn[hidden] { display: none; }
.nostr-open-btn:hover { opacity: 0.85; }

.nostr-divider {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin: 0.75rem 0 0.6rem;
  letter-spacing: 0.04em;
}

/* Paste row */
.nostr-paste-row {
  display: flex;
  gap: 0.4rem;
}
.nostr-paste-input {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(201,169,110,0.2);
  border-radius: 0.45rem;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.45rem 0.65rem;
  outline: none;
  min-width: 0;
}
.nostr-paste-input:focus { border-color: rgba(201,169,110,0.55); }
.nostr-paste-btn {
  background: rgba(201,169,110,0.15);
  border: 1px solid rgba(201,169,110,0.3);
  border-radius: 0.45rem;
  color: var(--gold-bright);
  font-size: 1rem;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  transition: background 0.15s;
}
.nostr-paste-btn:hover { background: rgba(201,169,110,0.28); }

.nostr-status {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin: 0.6rem 0 0;
  min-height: 1.2em;
}

.nostr-get-wallet {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
}

.nostr-get-label {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  opacity: 0.6;
}

.nostr-get-link {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--gold-bright);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: opacity 0.2s;
}
.nostr-get-link:hover { opacity: 0.75; }

/* Connected view */
.nostr-pubkey {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--gold-bright);
  word-break: break-all;
  margin: 0.5rem 0 1rem;
}
.nostr-disconnect-btn {
  background: transparent;
  border: 1px solid rgba(201,169,110,0.3);
  border-radius: 99px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.4rem 1.2rem;
  cursor: pointer;
  letter-spacing: 0.08em;
  transition: border-color 0.2s, color 0.2s;
}
.nostr-disconnect-btn:hover {
  border-color: rgba(201,169,110,0.6);
  color: var(--gold-bright);
}

/* ═══════════════════════════════════════════════
   COMPASS — Horizontal pills
   Trail always visible (dim). No max-width hack.
   ═══════════════════════════════════════════════ */
.compass-strip {
  position: relative;
  z-index: 1;
  padding: 0 0 1rem;
  opacity: 0;
  animation: fadeUp 0.6s 0.5s ease forwards;
}

.compass-scroll {
  display: flex;
  gap: 0.5rem;
  padding: 0.6rem 1.5rem;
  overflow-x: auto;
  scrollbar-width: none;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 1100px;
  margin: 0 auto;
}
.compass-scroll::-webkit-scrollbar { display: none; }

.compass-pill {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 20px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.5s ease, background 0.5s ease, box-shadow 0.5s ease;
  cursor: pointer;
}

.compass-pill:hover {
  border-color: rgba(201,169,110,0.2);
  background: var(--sacred);
}

.compass-pill.active {
  border-color: rgba(201,169,110,0.35);
  background: rgba(201,169,110,0.08);
  box-shadow: 0 0 16px rgba(201,169,110,0.06);
}

.compass-icon {
  font-size: 0.5rem;
  color: var(--gold-dim);
}

.compass-name {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gold-bright);
  white-space: nowrap;
}

.compass-trail {
  font-family: var(--font-ui);
  font-size: 0.48rem;
  color: var(--text-dim);
  letter-spacing: 0.02em;
  white-space: nowrap;
  opacity: 0.35;
  transition: opacity 0.4s ease;
}

.compass-pill:hover .compass-trail,
.compass-pill.active .compass-trail {
  opacity: 0.8;
}

/* ═══════════════════════════════════════════════
   LABORATORY — Compact inline
   ═══════════════════════════════════════════════ */
.lab-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem 1.5rem;
  position: relative;
  z-index: 1;
}

.lab-grid {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.lab-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid rgba(201,169,110,0.15);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
  flex: 1;
  min-width: 240px;
  max-width: 340px;
}

.lab-card:hover {
  border-color: rgba(201,169,110,0.35);
  box-shadow: 0 4px 20px rgba(201,169,110,0.08), 0 4px 16px rgba(0,0,0,0.12);
}

.lab-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(201,169,110,0.1);
  border: 1px solid rgba(201,169,110,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem;
  color: var(--gold-bright);
  flex-shrink: 0;
  animation: labPulse 3s ease-in-out infinite;
}

@keyframes labPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201,169,110,0); }
  50% { box-shadow: 0 0 8px 2px rgba(201,169,110,0.12); }
}

.lab-info { flex: 1; min-width: 0; }

.lab-title {
  font-family: var(--font-heading);
  font-size: 0.9rem; font-weight: 600;
  color: var(--gold-bright); line-height: 1.2;
}

.lab-desc {
  font-family: var(--font-body);
  font-size: 0.72rem; color: var(--text-dim); line-height: 1.4;
}

.lab-badge {
  font-family: var(--font-code);
  font-size: 0.5rem;
  color: var(--gold);
  letter-spacing: 0.06em;
  margin-top: 0.2rem;
  text-transform: uppercase;
}

/* ═══════════════════════════════════════════════
   BOOK GRID
   ═══════════════════════════════════════════════ */
.books-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem 4rem;
  position: relative;
  z-index: 1;
}

.section-label {
  font-family: var(--font-code);
  font-size: 0.6rem;
  color: var(--gold-dim);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 1.2rem;
}

.books-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}

/* ═══════════════════════════════════════════════
   BOOK CARD — Compact. CSS owns all transforms.
   ═══════════════════════════════════════════════ */
.book-card {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
  display: block;
  color: inherit;

  /* Reveal animation */
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.4s ease var(--reveal-delay, 0s),
    transform 0.4s ease var(--reveal-delay, 0s),
    border-color 0.4s ease,
    box-shadow 0.4s ease;
}

.book-card.revealed {
  opacity: 1;
  transform: translateY(0);
}

.book-card:hover {
  border-color: rgba(201,169,110,0.25);
  box-shadow: 0 6px 24px rgba(0,0,0,0.12), 0 0 16px rgba(201,169,110,0.06);
}

/* ── Path filtering ─────────────────────────── */
/* Non-path cards collapse smoothly */
.book-card.not-in-path {
  display: none;
}

.books-grid.path-active .book-card.in-path {
  opacity: 1;
}

/* Category filtering */
.book-card.filtered-out {
  display: none;
}

/* ── Card header: Adinkra symbol + progress ── */
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0.8rem 0.3rem;
}

.card-symbol {
  width: 28px;
  height: 28px;
  opacity: 0.6;
}

.card-symbol svg {
  width: 100%;
  height: 100%;
}

.card-header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
}

.card-topic {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.08em;
  opacity: 0.85;
  text-transform: uppercase;
  font-weight: 600;
  white-space: nowrap;
}

.card-pct {
  font-family: var(--font-code);
  font-size: 0.52rem;
  color: var(--card-accent, var(--gold-dim));
  letter-spacing: 0.04em;
  opacity: 0.7;
}

/* ── Card body ───────────────────────────────── */
.card-body {
  padding: 0 0.8rem 0.8rem;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--gold-bright);
  line-height: 1.25;
  margin-bottom: 0.3rem;
}

.card-desc {
  font-family: var(--font-body);
  font-size: 0.72rem;
  color: var(--text-dim);
  line-height: 1.45;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  font-family: var(--font-code);
  font-size: 0.5rem;
  color: var(--text-dim);
  letter-spacing: 0.03em;
}

.card-meta strong { color: var(--gold-dim); font-weight: 500; }

/* ═══════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════ */
.footer {
  text-align: center;
  padding: 1.5rem;
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--text-dim);
  font-style: italic;
  position: relative;
  z-index: 1;
}

.footer a { color: var(--gold-dim); text-decoration: none; }
.footer a:hover { color: var(--gold); }

/* ═══════════════════════════════════════════════
   CONTINUE READING BANNER
   ═══════════════════════════════════════════════ */
.continue-banner {
  max-width: 1100px;
  margin: 0 auto 1rem;
  padding: 0 1rem;
  position: relative;
  z-index: 1;
  opacity: 0; transform: translateY(15px);
  animation: fadeUp 0.6s 0.2s ease forwards;
}
.continue-banner a {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.7rem 1.2rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 3px solid var(--continue-accent, var(--gold));
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}
.continue-banner a:hover {
  border-color: var(--continue-accent, var(--gold));
  box-shadow: 0 6px 24px rgba(0,0,0,0.2);
}
.continue-info { flex: 1; }
.continue-label {
  font-family: var(--font-code);
  font-size: 0.55rem; color: var(--gold-dim);
  letter-spacing: 0.15em; text-transform: uppercase;
  margin-bottom: 0.15rem;
}
.continue-title {
  font-family: var(--font-heading);
  font-size: 0.95rem; font-weight: 600; color: var(--gold-bright);
}
.continue-progress {
  font-family: var(--font-code);
  font-size: 0.58rem; color: var(--text-dim); margin-top: 0.1rem;
}
.continue-arrow {
  font-size: 1.1rem; color: var(--gold-dim);
  transition: transform 0.3s ease;
}
.continue-banner a:hover .continue-arrow { transform: translateX(3px); }

/* ═══════════════════════════════════════════════
   THE HERALD — What's New banner
   ═══════════════════════════════════════════════ */
.herald-banner {
  max-width: 1100px;
  margin: 0 auto 1rem;
  padding: 0 1rem;
  position: relative;
  z-index: 1;
  opacity: 0; transform: translateY(15px);
  animation: fadeUp 0.6s 0.3s ease forwards;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.herald-summary {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.55rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold-dim);
  border-radius: 10px;
}
.herald-icon {
  font-size: 0.8rem; color: var(--gold);
}
.herald-text {
  flex: 1;
  font-family: var(--font-body);
  font-size: 0.78rem; color: var(--text-dim);
}
.herald-toggle, .herald-dismiss {
  background: none; border: none; cursor: pointer;
  color: var(--text-dim); font-size: 0.8rem;
  padding: 0.15rem 0.3rem; border-radius: 4px;
  transition: color 0.2s ease;
}
.herald-toggle:hover, .herald-dismiss:hover { color: var(--gold); }
.herald-details {
  margin-top: 0.4rem;
  padding: 0.5rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.herald-entry {
  display: flex; gap: 0.8rem; align-items: baseline;
  padding: 0.3rem 0;
}
.herald-entry + .herald-entry { border-top: 1px solid var(--border-subtle); }
.herald-date {
  font-family: var(--font-code);
  font-size: 0.55rem; color: var(--gold-dim);
  white-space: nowrap;
}
.herald-desc {
  font-family: var(--font-body);
  font-size: 0.72rem; color: var(--text);
}

/* ═══════════════════════════════════════════════
   SCROLL CERTIFICATE — Celebration overlay
   ═══════════════════════════════════════════════ */
.celebration-overlay {
  position: fixed; inset: 0; z-index: 10001;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(12px);
}
.celebration-modal {
  position: relative;
  width: min(520px, 92vw);
  background: var(--bg-elevated);
  border: 1px solid var(--gold-dim);
  border-radius: 16px;
  padding: 0;
  overflow: hidden;
  text-align: center;
}
.celebration-close {
  position: absolute; top: 0.8rem; right: 1rem; z-index: 1;
  background: none; border: none; cursor: pointer;
  color: var(--text-dim); font-size: 1.4rem;
  transition: color 0.2s;
}
.celebration-close:hover { color: var(--gold); }
#celebration-canvas {
  width: 100%; height: 120px;
  display: block;
}
.celebration-content { padding: 0 2rem 1.5rem; }
.celebration-title {
  font-family: var(--font-code);
  font-size: 0.6rem; color: var(--gold);
  letter-spacing: 0.2em; text-transform: uppercase;
  margin-bottom: 0.3rem;
}
.celebration-path {
  font-family: var(--font-display);
  font-size: 1.8rem; color: var(--gold-bright);
  margin-bottom: 0.8rem;
}
.celebration-books {
  font-family: var(--font-heading);
  font-size: 0.78rem; color: var(--text-dim);
  line-height: 1.8;
  margin-bottom: 0.6rem;
}
.celebration-book { white-space: nowrap; }
.celebration-subtitle {
  font-family: var(--font-body);
  font-size: 0.72rem; color: var(--text-dim);
  font-style: italic;
  margin-bottom: 1rem;
}
.celebration-actions {
  display: flex; gap: 0.6rem; justify-content: center;
  margin-bottom: 1rem;
}
.celebration-download {
  background: var(--gold-dim); color: var(--bg);
  border: none; border-radius: 8px;
  padding: 0.5rem 1.2rem;
  font-family: var(--font-code);
  font-size: 0.6rem; letter-spacing: 0.08em;
  cursor: pointer; transition: background 0.2s;
}
.celebration-download:hover { background: var(--gold); }
.celebration-download:disabled { opacity: 0.6; cursor: not-allowed; }
.celebration-dismiss {
  background: none; border: 1px solid var(--border);
  border-radius: 8px; padding: 0.5rem 1.2rem;
  color: var(--text-dim);
  font-family: var(--font-code);
  font-size: 0.6rem; cursor: pointer;
  transition: color 0.2s;
}
.celebration-dismiss:hover { color: var(--gold); }
.celebration-lightning { margin-top: 0.5rem; }
.celebration-zap {
  font-family: var(--font-code);
  font-size: 0.55rem; color: var(--gold-dim);
  text-decoration: none;
  transition: color 0.2s;
}
.celebration-zap:hover { color: var(--gold-bright); }

/* ═══════════════════════════════════════════════
   APPRENTICESHIP QUIZ — "Find Your Path" overlay
   ═══════════════════════════════════════════════ */
.quiz-overlay {
  position: fixed; inset: 0; z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
}
.quiz-modal {
  position: relative;
  width: min(480px, 92vw);
  max-height: 85vh; overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
}
.quiz-close {
  position: absolute; top: 0.8rem; right: 1rem;
  background: none; border: none; cursor: pointer;
  color: var(--text-dim); font-size: 1.4rem;
  transition: color 0.2s;
}
.quiz-close:hover { color: var(--gold); }
.quiz-header { text-align: center; margin-bottom: 1.5rem; }
.quiz-title {
  font-family: var(--font-display);
  font-size: 1.6rem; color: var(--gold-bright);
}
.quiz-subtitle {
  font-family: var(--font-body);
  font-size: 0.8rem; color: var(--text-dim); margin-top: 0.3rem;
}
.quiz-question {
  font-family: var(--font-heading);
  font-size: 1.15rem; color: var(--text-bright);
  text-align: center; margin-bottom: 1.2rem;
}
.quiz-options { display: flex; flex-direction: column; gap: 0.5rem; }
.quiz-option {
  display: block; width: 100%;
  padding: 0.7rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.82rem;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, background 0.2s;
}
.quiz-option:hover {
  border-color: var(--gold-dim);
  background: var(--bg-elevated);
}
.quiz-progress {
  text-align: center; margin-top: 1rem;
  font-family: var(--font-code);
  font-size: 0.55rem; color: var(--text-dim);
  letter-spacing: 0.1em; text-transform: uppercase;
}

/* Quiz result */
.quiz-result-title {
  font-family: var(--font-display);
  font-size: 1.3rem; color: var(--gold-bright);
  text-align: center;
}
.quiz-result-subtitle {
  font-family: var(--font-body);
  font-size: 0.75rem; color: var(--text-dim);
  text-align: center; margin: 0.3rem 0 1.2rem;
}
.quiz-weeks { display: flex; flex-direction: column; gap: 0.6rem; }
.quiz-week {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-subtle);
}
.quiz-week-num {
  font-family: var(--font-code);
  font-size: 0.55rem; color: var(--gold-dim);
  letter-spacing: 0.12em; text-transform: uppercase;
  margin-bottom: 0.3rem;
}
.quiz-week-book {
  display: block;
  padding: 0.3rem 0.6rem;
  font-family: var(--font-heading);
  font-size: 0.82rem; color: var(--text);
  text-decoration: none;
  border-left: 2px solid var(--card-accent, var(--gold-dim));
  margin-bottom: 0.2rem;
  transition: color 0.2s;
}
.quiz-week-book:hover { color: var(--gold-bright); }
.quiz-week-letters {
  font-family: var(--font-code);
  font-size: 0.52rem; color: var(--text-dim);
}
.quiz-actions {
  display: flex; gap: 0.6rem; margin-top: 1.2rem; justify-content: center;
}
.quiz-done {
  background: var(--gold-dim) !important;
  color: var(--bg) !important;
  border-color: var(--gold) !important;
  font-weight: 600;
}
.quiz-retake {
  background: none; border: 1px solid var(--border);
  border-radius: 10px; padding: 0.5rem 1rem;
  color: var(--text-dim); cursor: pointer;
  font-family: var(--font-body); font-size: 0.75rem;
  transition: color 0.2s;
}
.quiz-retake:hover { color: var(--gold); }

/* ── Curriculum section (above book grid) ────── */
.curriculum-section {
  max-width: 1100px;
  margin: 0 auto 1.5rem;
  padding: 0 1rem;
  position: relative; z-index: 1;
  opacity: 0; transform: translateY(15px);
  animation: fadeUp 0.6s 0.2s ease forwards;
}
.curriculum-header {
  display: flex; align-items: center; gap: 0.6rem;
  margin-bottom: 0.6rem;
}
.curriculum-label {
  font-family: var(--font-code);
  font-size: 0.55rem; color: var(--gold);
  letter-spacing: 0.15em; text-transform: uppercase;
}
.curriculum-meta {
  font-family: var(--font-code);
  font-size: 0.52rem; color: var(--text-dim);
  flex: 1;
}
.curriculum-retake {
  background: none; border: none; cursor: pointer;
  color: var(--text-dim); font-size: 0.9rem;
  transition: color 0.2s;
}
.curriculum-retake:hover { color: var(--gold); }
.curriculum-timeline {
  display: flex; gap: 0.5rem;
  overflow-x: auto;
  padding: 0.3rem 0 0.6rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.curriculum-week {
  flex: 0 0 auto;
  min-width: 160px; max-width: 220px;
  padding: 0.6rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.curriculum-week-marker {
  font-family: var(--font-code);
  font-size: 0.5rem; color: var(--gold-dim);
  letter-spacing: 0.12em; text-transform: uppercase;
  margin-bottom: 0.4rem;
}
.curriculum-book {
  display: flex; align-items: baseline; gap: 0.3rem;
  padding: 0.25rem 0;
  text-decoration: none;
  border-left: 2px solid var(--card-accent, var(--gold-dim));
  padding-left: 0.5rem;
  margin-bottom: 0.2rem;
}
.curriculum-book-title {
  font-family: var(--font-heading);
  font-size: 0.72rem; color: var(--text);
  transition: color 0.2s;
}
.curriculum-book:hover .curriculum-book-title { color: var(--gold-bright); }
.curriculum-book-pct {
  font-family: var(--font-code);
  font-size: 0.48rem; color: var(--gold);
  white-space: nowrap;
}

/* Quiz pill glow */
.quiz-pill { border-color: var(--gold-dim); }
.quiz-pill .compass-icon { color: var(--gold); }

/* ═══════════════════════════════════════════════
   LIBRARY CONTROLS
   ═══════════════════════════════════════════════ */
.library-controls {
  max-width: 1100px;
  margin: 0 auto 0.8rem;
  padding: 0 1rem;
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  align-items: center;
  position: relative;
  z-index: 1;
}
.lib-stats {
  width: 100%; text-align: center;
  font-family: var(--font-code);
  font-size: 0.55rem; color: var(--text-dim);
  letter-spacing: 0.06em; margin-bottom: 0.3rem;
}

.ctrl-categories { width: 100%; justify-content: center; flex-wrap: wrap; }
.ctrl-count { opacity: 0.5; font-size: 0.45rem; margin-left: 0.1rem; }

.lib-search {
  flex: 1; min-width: 160px;
  padding: 0.45rem 0.8rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.8rem;
  outline: none;
  transition: border-color 0.3s ease;
}
.lib-search:focus { border-color: var(--gold-dim); }
.lib-search::placeholder { color: var(--text-dim); opacity: 0.6; }

.ctrl-group { display: flex; gap: 0.2rem; }
.ctrl-btn {
  padding: 0.35rem 0.6rem;
  background: var(--bg);
  border: 1px solid var(--border-subtle);
  border-radius: 5px;
  color: var(--text-dim);
  font-family: var(--font-code);
  font-size: 0.55rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.3s ease, color 0.3s ease, background 0.3s ease;
  white-space: nowrap;
}
.ctrl-btn:hover { border-color: var(--border); color: var(--text); }
.ctrl-btn.active {
  background: rgba(201,169,110,0.08);
  border-color: rgba(201,169,110,0.2);
  color: var(--gold);
}

/* ═══════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════ */
@media (max-width: 900px) {
  .books-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Single-column hero on narrow screens */
@media (max-width: 720px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    padding: calc(5vh + 40px) 1.5rem 2.5vh;
    gap: 1.5rem;
  }
  .hero-left { text-align: center; }
  .hero-right { width: 100%; max-width: 280px; margin: 0 auto; }
  .identity-bar { justify-content: center; }
}

@media (max-width: 580px) {
  .compass-scroll { flex-wrap: nowrap; justify-content: flex-start; padding: 0.5rem 1rem; }
  .compass-trail { display: none; }
  .books-section { padding: 0 0.6rem 3rem; }
  .books-grid { grid-template-columns: repeat(2, 1fr); gap: 0.4rem; }
  .card-title { font-size: 0.8rem; }
  .card-header { padding: 0.5rem 0.6rem 0.2rem; }
  .card-body { padding: 0 0.6rem 0.6rem; }
  .lab-section { padding: 0 0.6rem 1rem; }
  .lab-card { min-width: 100%; }
  .lab-desc { display: none; }
}

@media (max-width: 380px) {
  .books-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════
   NOSTR CEREMONY — first-connect math moment
   ═══════════════════════════════════════════════ */
.nostr-ceremony-math {
  font-family: monospace;
  font-size: 0.72rem;
  color: var(--gold, #c9a96e);
  letter-spacing: 0.04em;
  margin: 0.75rem 0 0.25rem;
  opacity: 0.9;
}
.nostr-ceremony-sub {
  font-size: 0.75rem;
  color: var(--text-dim, #888);
  margin: 0 0 0.75rem;
  line-height: 1.5;
}
.nostr-ceremony-link {
  color: var(--gold, #c9a96e);
}
.nostr-attestations {
  font-size: 0.75rem;
  color: var(--gold, #c9a96e);
  margin: 0.25rem 0 0.5rem;
  letter-spacing: 0.06em;
}

/* ═══════════════════════════════════════════════
   LIGHTNING FOOTER
   ═══════════════════════════════════════════════ */
.footer-lightning {
  color: var(--text-ghost, #555);
  font-size: 0.72rem;
}
.footer-lnaddr {
  color: var(--gold, #c9a96e);
  text-decoration: none;
}
.footer-lnaddr:hover { text-decoration: underline; }

/* ═══════════════════════════════════════════════
   SOVEREIGN COMPASS — completion + next badges
   ═══════════════════════════════════════════════ */
.done-mark {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 0.6rem;
  color: var(--card-accent, #c9a96e);
  opacity: 0.8;
}
.card-symbol { position: relative; }

.sovereign-done {
  opacity: 1;
}
.sovereign-done::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(201,169,110,0.25);
  pointer-events: none;
}

.next-badge {
  font-size: 0.58rem;
  font-family: monospace;
  letter-spacing: 0.08em;
  color: var(--card-accent, #c9a96e);
  background: rgba(201,169,110,0.1);
  border: 1px solid rgba(201,169,110,0.2);
  border-radius: 3px;
  padding: 1px 5px;
  margin-left: auto;
  white-space: nowrap;
  align-self: flex-start;
}
.card-header { display: flex; align-items: flex-start; }

#compass-your-path {
  border-color: rgba(201,169,110,0.4);
  background: rgba(201,169,110,0.06);
}

/* ── Community pill — distinct from lab, has network feel ── */
.community-pill {
  border-color: rgba(201,169,110,0.35);
  background: rgba(201,169,110,0.05);
}
.community-pill:hover {
  border-color: rgba(201,169,110,0.65);
  background: rgba(201,169,110,0.1);
}
.community-pill .compass-icon { color: var(--gold-bright); }
