/* ============================================================
   onboarding.css — first-visit briefing modal
   5-step tour explaining: the case, the suspects, the format,
   the mechanic, the call-to-action. Fires once per device.
   Re-openable via the floating BRIEFING button.
   ============================================================ */

.brief-overlay {
  position: fixed;
  inset: 0;
  z-index: 9991;
  background: rgba(15, 12, 9, 0.92);
  backdrop-filter: blur(18px) saturate(1.05);
  -webkit-backdrop-filter: blur(18px) saturate(1.05);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 380ms cubic-bezier(0.22, 1, 0.36, 1);
}
.brief-overlay.is-open { display: flex; opacity: 1; }

.brief-card {
  background: var(--bg-elevated, #1a1612);
  border: 1px solid rgba(212, 169, 74, 0.28);
  border-radius: 18px;
  width: min(660px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  padding: 0;
  box-shadow: 0 40px 120px rgba(0,0,0,0.55), 0 0 0 1px rgba(212,169,74,0.08), 0 0 60px rgba(212,169,74,0.18);
  transform: scale(0.96) translateY(20px);
  opacity: 0;
  transition: transform 480ms cubic-bezier(0.22, 1, 0.36, 1), opacity 380ms;
}
.brief-overlay.is-open .brief-card {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.brief-stamp {
  position: absolute;
  top: -16px;
  left: 24px;
  background: var(--accent-secondary, #8b1a1a);
  color: var(--text-highlight, #f4d89a);
  padding: 6px 14px;
  font-family: var(--font-mono, "Courier Prime", monospace);
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  border-radius: 4px;
  transform: rotate(-3deg);
  box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}

.brief-card-inner { position: relative; }

.brief-image {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 18px 18px 0 0;
  display: block;
  background: var(--bg-base, #0f0c09);
  filter: saturate(0.92) contrast(1.06);
}
/* Witness stills are raw green-screen — route them through the same chroma-key
   pipeline the hero mesh uses. The `background: #0a0806` shows through where
   the filter has killed green pixels, so the subject appears to sit on an inky
   void instead of a lime backdrop. */
.brief-image[src*="/witnesses/"] {
  filter: url(#ccc-chroma-green) saturate(0.92) contrast(1.06);
  background: #0a0806;
}

.brief-body {
  padding: 32px clamp(20px, 4vw, 36px) 16px;
}

.brief-eyebrow {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent-primary, #d4a94a);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.brief-eyebrow__dot {
  width: 6px; height: 6px;
  background: var(--accent-secondary, #8b1a1a);
  border-radius: 50%;
  animation: brief-dot-pulse 2s ease-in-out infinite;
}
@keyframes brief-dot-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.brief-title {
  font-family: var(--font-display, var(--font-serif, Georgia, serif));
  font-variation-settings: "opsz" 144, "SOFT" 100, "wght" 700, "WONK" 1;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1.05;
  color: var(--text-highlight, #f4d89a);
  margin: 0 0 14px;
  letter-spacing: -0.02em;
}
.brief-title em {
  font-style: italic;
  color: var(--accent-primary, #d4a94a);
}
.brief-text {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-body, #d8cfc2);
  margin: 0 0 16px;
  max-width: 56ch;
}
.brief-text strong { color: var(--text-highlight, #f4d89a); font-weight: 600; }
.brief-text em { color: var(--accent-primary, #d4a94a); font-style: italic; }

.brief-list {
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}
.brief-list li {
  padding: 10px 0;
  border-top: 1px dashed rgba(212, 169, 74, 0.18);
  font-family: var(--font-mono, monospace);
  font-size: 13px;
  color: var(--text-body, #d8cfc2);
  display: flex;
  gap: 12px;
}
.brief-list li:first-child { border-top: none; padding-top: 0; }
.brief-list li::before {
  content: counter(brief, decimal-leading-zero);
  counter-increment: brief;
  color: var(--accent-primary, #d4a94a);
  font-weight: 700;
  flex-shrink: 0;
  min-width: 28px;
}
.brief-list { counter-reset: brief; }

/* Footer with progress + buttons */
.brief-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(20px, 4vw, 36px) 26px;
  border-top: 1px solid rgba(212, 169, 74, 0.15);
  flex-wrap: wrap;
  gap: 14px;
  background: rgba(15, 12, 9, 0.4);
  border-radius: 0 0 18px 18px;
}

.brief-progress {
  display: flex;
  gap: 6px;
  align-items: center;
}
.brief-pip {
  width: 26px;
  height: 3px;
  background: rgba(212, 169, 74, 0.22);
  border-radius: 2px;
  transition: background 260ms;
}
.brief-pip.is-active { background: var(--accent-primary, #d4a94a); }
.brief-pip.is-done { background: var(--accent-primary, #d4a94a); opacity: 0.55; }

.brief-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.brief-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 999px;
  font-family: var(--font-sans, Inter, sans-serif);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  transition: background 180ms, color 180ms, transform 180ms, border-color 180ms;
}
.brief-btn--primary {
  background: var(--accent-primary, #d4a94a);
  color: var(--text-inverse, #0f0c09);
}
.brief-btn--primary:hover {
  background: var(--text-highlight, #f4d89a);
  transform: translateY(-1px);
}
.brief-btn--ghost {
  border-color: rgba(212, 169, 74, 0.35);
  color: var(--text-highlight, #f4d89a);
}
.brief-btn--ghost:hover {
  border-color: var(--accent-primary, #d4a94a);
  color: var(--accent-primary, #d4a94a);
}
.brief-btn--text {
  color: var(--text-muted, #8a8073);
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 10px 8px;
}
.brief-btn--text:hover { color: var(--accent-primary, #d4a94a); }
.brief-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.brief-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: rgba(26, 22, 18, 0.85);
  border: 1px solid rgba(212, 169, 74, 0.2);
  border-radius: 50%;
  color: var(--text-highlight, #f4d89a);
  font-family: var(--font-mono, monospace);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  z-index: 4;
  transition: border-color 180ms, transform 180ms;
}
.brief-close:hover { border-color: var(--accent-primary, #d4a94a); transform: scale(1.06); }

/* Floating re-open button */
.brief-reopen {
  position: fixed;
  bottom: 24px;
  left: 80px; /* sits next to .sound-toggle */
  z-index: 86;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(26, 22, 18, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(212, 169, 74, 0.25);
  border-radius: 999px;
  color: var(--text-highlight, #f4d89a);
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 200ms, color 200ms, transform 200ms;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}
.brief-reopen.is-visible {
  opacity: 0.85;
  transform: translateY(0);
  pointer-events: auto;
}
.brief-reopen:hover {
  border-color: var(--accent-primary, #d4a94a);
  color: var(--accent-primary, #d4a94a);
  opacity: 1;
}
.brief-reopen__icon {
  width: 14px; height: 14px;
  border: 1px dashed currentColor;
  border-radius: 50%;
  position: relative;
}
.brief-reopen__icon::after {
  content: "?";
  position: absolute;
  inset: 0;
  display: grid; place-items: center;
  font-family: var(--font-display, Georgia, serif);
  font-style: italic;
  font-size: 10px;
  font-weight: 700;
}

@media (max-width: 540px) {
  .brief-card { border-radius: 14px; }
  .brief-image { border-radius: 14px 14px 0 0; }
  .brief-stamp { left: 16px; }
  .brief-footer { padding: 16px 20px 22px; }
  .brief-progress { order: 2; width: 100%; justify-content: center; }
  .brief-actions { order: 1; width: 100%; justify-content: space-between; }
  .brief-reopen { left: auto; right: 16px; bottom: 84px; }
}

@media (prefers-reduced-motion: reduce) {
  .brief-overlay,
  .brief-card,
  .brief-reopen { transition: opacity 200ms; transform: none; }
  .brief-eyebrow__dot { animation: none; }
}
