/* ==========================================================================
   Nicolas Sanchez - Consent banner
   Self-contained. Reads the paper-theme tokens when present (light/dark)
   and falls back to a dark palette on pages that don't define them
   (e.g. the dossier-dark toolkit page). Loaded site-wide.
   ========================================================================== */

.ns-consent {
  --c-bg:     var(--bg2,   #14161b);
  --c-ink:    var(--ink,   #ececec);
  --c-ink2:   var(--ink2,  #a0a3aa);
  --c-ink3:   var(--ink3,  #6a6e78);
  --c-rule:   var(--rule,  #2a2d35);
  --c-accent: var(--accent,#e8a06e);

  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 10000;
  width: calc(100% - 48px);
  max-width: 420px;

  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.16, 0.84, 0.44, 1);
}
.ns-consent.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.ns-consent-card {
  position: relative;
  overflow: hidden;
  background: var(--c-bg);
  border: 1px solid var(--c-rule);
  border-radius: 14px;
  padding: 18px 20px 16px;
  box-shadow: 0 14px 44px -16px rgba(0, 0, 0, 0.55), 0 2px 8px -4px rgba(0, 0, 0, 0.3);
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
}
.ns-consent-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--c-accent);
  opacity: 0.85;
}

.ns-consent-eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10.5px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--c-ink3);
  margin-bottom: 11px;
}
.ns-consent-diamond { color: var(--c-accent); font-size: 9px; }

.ns-consent-text {
  font-size: 13px;
  line-height: 1.55;
  color: var(--c-ink2);
  margin: 0 0 12px;
}

.ns-consent-readout {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 11px 13px;
  margin-bottom: 14px;
  border: 1px solid var(--c-rule);
  border-radius: 8px;
  background: rgba(127, 127, 127, 0.05);
}
.ns-consent-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
}
.ns-consent-key {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--c-ink);
  font-weight: 500;
}
.ns-consent-key::before { content: '◆'; font-size: 8px; }
.ns-on  .ns-consent-key::before { color: #4a7c59; }
.ns-opt .ns-consent-key::before { color: var(--c-ink3); }
[data-theme="dark"] .ns-on .ns-consent-key::before { color: #6abf7b; }
.ns-consent-val { color: var(--c-ink3); letter-spacing: 0.2px; }

.ns-consent-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ns-consent-spacer { flex: 1; }
.ns-consent-link {
  font-size: 12px;
  color: var(--c-ink3);
  text-decoration: none;
  border-bottom: 1px solid var(--c-rule);
  transition: color 0.15s;
}
.ns-consent-link:hover { color: var(--c-ink); }

.ns-consent-btn {
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: opacity 0.2s, background 0.2s, border-color 0.2s, color 0.2s;
}
.ns-decline {
  background: transparent;
  color: var(--c-ink2);
  border-color: var(--c-rule);
}
.ns-decline:hover { color: var(--c-ink); border-color: var(--c-ink3); }
.ns-accept {
  background: var(--c-ink);
  color: var(--c-bg);
}
.ns-accept:hover { opacity: 0.85; }

/* Staggered reveal of the inner content once the card is up. */
.ns-consent.is-visible .ns-consent-eyebrow,
.ns-consent.is-visible .ns-consent-text,
.ns-consent.is-visible .ns-consent-readout,
.ns-consent.is-visible .ns-consent-actions {
  animation: ns-consent-rise 0.5s both;
}
.ns-consent.is-visible .ns-consent-eyebrow  { animation-delay: 0.06s; }
.ns-consent.is-visible .ns-consent-text     { animation-delay: 0.12s; }
.ns-consent.is-visible .ns-consent-readout  { animation-delay: 0.18s; }
.ns-consent.is-visible .ns-consent-actions  { animation-delay: 0.24s; }
@keyframes ns-consent-rise {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* Re-open control surfaced inside page content (e.g. privacy.html). */
.consent-manage {
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: var(--ink, #1a1815);
  color: var(--bg, #f5f2ec);
  transition: opacity 0.2s;
}
.consent-manage:hover { opacity: 0.85; }

@media (max-width: 520px) {
  .ns-consent { left: 12px; right: 12px; bottom: 12px; width: auto; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ns-consent { transition: opacity 0.2s ease; transform: none; }
  .ns-consent.is-visible { transform: none; }
  .ns-consent.is-visible .ns-consent-eyebrow,
  .ns-consent.is-visible .ns-consent-text,
  .ns-consent.is-visible .ns-consent-readout,
  .ns-consent.is-visible .ns-consent-actions { animation: none; }
}
