/* TMR Demo — Backdrop Color System (performance-tuned) */

:root {
  --tmr-assistant-blue: #1e3a8a;
  --tmr-assistant-purple: #5b21b6;
  --tmr-assistant-teal: #0f766e;
  --tmr-assistant-cyan: #22d3ee;
  --tmr-assistant-deep: #020617;

  --tmr-brand-blue: #3b82f6;
  --tmr-brand-red: #f87171;
  --tmr-brand-yellow: #facc15;
  --tmr-brand-green: #4ade80;

  --tmr-private-bg: #111827;
  --tmr-private-panel: rgba(31, 41, 55, 0.72);
  --tmr-private-border: rgba(148, 163, 184, 0.22);
  --tmr-private-text: #e5e7eb;
  --tmr-private-muted: #9ca3af;
  --tmr-private-glow: rgba(156, 163, 175, 0.12);

  --tmr-text: #f8fafc;
  --tmr-muted: #dbeafe;
  --tmr-soft: #bfdbfe;
  --tmr-line: rgba(255, 255, 255, 0.18);
  --tmr-accent: #60a5fa;
  --tmr-cyan: #67e8f9;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--tmr-text);
  background: var(--tmr-assistant-deep);
  position: relative;
  isolation: isolate;
}

.tmr-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  contain: strict;
}

/* Static base — no animated background-position (avoids full repaints) */
.tmr-backdrop__assistant {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 22%, rgba(34, 211, 238, 0.28) 0%, transparent 42%),
    radial-gradient(circle at 78% 14%, rgba(91, 33, 182, 0.32) 0%, transparent 46%),
    radial-gradient(circle at 62% 78%, rgba(15, 118, 110, 0.26) 0%, transparent 44%),
    radial-gradient(circle at 28% 68%, rgba(30, 58, 138, 0.34) 0%, transparent 50%),
    linear-gradient(135deg, #020617 0%, #0b1538 28%, #1a1147 52%, #0a2f35 78%, #020617 100%);
}

/* GPU-friendly pulse — transform/opacity only */
.tmr-backdrop__assistant::before {
  content: "";
  position: absolute;
  inset: -8%;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.08) 0%, transparent 52%),
    radial-gradient(circle at 30% 60%, rgba(34, 211, 238, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 70% 35%, rgba(91, 33, 182, 0.14) 0%, transparent 38%);
  opacity: 0.45;
  animation: tmr-galaxy-pulse 16s ease-in-out infinite;
  will-change: transform, opacity;
}

.tmr-backdrop__assistant::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 36%, rgba(255, 255, 255, 0.05) 50%, transparent 64%);
  opacity: 0.2;
  animation: tmr-sheen 14s ease-in-out infinite;
  will-change: transform, opacity;
}

@keyframes tmr-galaxy-pulse {
  0%,
  100% {
    opacity: 0.34;
    transform: scale(1) translate3d(0, 0, 0);
  }
  50% {
    opacity: 0.58;
    transform: scale(1.05) translate3d(-1%, 1%, 0);
  }
}

@keyframes tmr-sheen {
  0%,
  100% {
    transform: translate3d(-18%, 0, 0);
    opacity: 0.12;
  }
  50% {
    transform: translate3d(18%, 0, 0);
    opacity: 0.24;
  }
}

.brand-orb-layer {
  position: absolute;
  inset: 0;
}

/* Soft radial blobs — no filter: blur() */
.brand-orb {
  position: absolute;
  border-radius: 999px;
  opacity: 0.24;
  animation: tmr-orb-float 20s ease-in-out infinite;
  will-change: transform, opacity;
}

.brand-orb.blue {
  width: min(28vw, 280px);
  height: min(28vw, 280px);
  top: 10%;
  left: 4%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.42) 0%, rgba(59, 130, 246, 0.12) 42%, transparent 72%);
}

.brand-orb.red {
  width: min(22vw, 220px);
  height: min(22vw, 220px);
  top: 16%;
  right: 6%;
  background: radial-gradient(circle, rgba(248, 113, 113, 0.34) 0%, rgba(248, 113, 113, 0.1) 42%, transparent 72%);
  animation-delay: -5s;
}

.brand-orb.yellow {
  width: min(20vw, 200px);
  height: min(20vw, 200px);
  bottom: 20%;
  left: 12%;
  background: radial-gradient(circle, rgba(250, 204, 21, 0.28) 0%, rgba(250, 204, 21, 0.08) 42%, transparent 72%);
  animation-delay: -10s;
}

.brand-orb.green {
  width: min(24vw, 240px);
  height: min(24vw, 240px);
  bottom: 12%;
  right: 8%;
  background: radial-gradient(circle, rgba(74, 222, 128, 0.32) 0%, rgba(74, 222, 128, 0.1) 42%, transparent 72%);
  animation-delay: -15s;
}

@keyframes tmr-orb-float {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
    opacity: 0.18;
  }
  50% {
    transform: translate3d(0, -10px, 0);
    opacity: 0.28;
  }
}

.tmr-page {
  position: relative;
  z-index: 1;
}

.content .section {
  content-visibility: auto;
  contain-intrinsic-size: auto 320px;
}

body.privacy-mode {
  --tmr-text: var(--tmr-private-text);
  --tmr-muted: var(--tmr-private-muted);
  --tmr-soft: #cbd5e1;
  --tmr-line: var(--tmr-private-border);
  background: var(--tmr-private-bg);
}

body.privacy-mode .tmr-backdrop__assistant,
body.privacy-mode .tmr-backdrop__assistant::before,
body.privacy-mode .tmr-backdrop__assistant::after {
  animation: none;
  background: linear-gradient(180deg, #1f2937 0%, #111827 55%, #0b0f17 100%);
  opacity: 1;
}

body.privacy-mode .brand-orb-layer {
  display: none;
}

body.privacy-mode .badge,
body.privacy-mode .card,
body.privacy-mode .video-card,
body.privacy-mode .section,
body.privacy-mode .access-cta,
body.privacy-mode li {
  background: var(--tmr-private-panel) !important;
  border-color: var(--tmr-private-border) !important;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35) !important;
}

body.privacy-mode .video-card.featured {
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.4) !important;
}

body.privacy-mode .pill,
body.privacy-mode .access-button {
  background: linear-gradient(135deg, #6b7280, #9ca3af) !important;
  color: #111827 !important;
  box-shadow: 0 0 18px var(--tmr-private-glow) !important;
}

body.privacy-mode .mission {
  background: rgba(55, 65, 81, 0.55) !important;
  box-shadow: inset 0 0 0 1px var(--tmr-private-border) !important;
}

body.privacy-mode .tm {
  color: var(--tmr-private-muted);
}

body.privacy-mode footer {
  color: var(--tmr-private-muted);
}

.privacy-visual-toggle {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--tmr-line);
  background: rgba(15, 23, 42, 0.82);
  color: var(--tmr-muted);
  font: 600 12px/1.2 system-ui, sans-serif;
  cursor: pointer;
}

.privacy-visual-toggle:hover,
.privacy-visual-toggle:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.65);
  outline-offset: 2px;
}

body.privacy-mode .privacy-visual-toggle {
  background: rgba(31, 41, 55, 0.92);
  border-color: var(--tmr-private-border);
  color: var(--tmr-private-text);
}

@media (max-width: 900px) {
  .brand-orb.yellow,
  .brand-orb.green {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tmr-backdrop__assistant::before,
  .tmr-backdrop__assistant::after,
  .brand-orb {
    animation: none !important;
    will-change: auto;
  }
}

@media (max-width: 620px) {
  .privacy-visual-toggle {
    top: auto;
    bottom: 14px;
    right: 14px;
    font-size: 11px;
  }
}
