/* ============================================================
   RADAR — UNDER CONSTRUCTION OVERLAY
   Full-bleed WebGL caustic grid + centered glass card.
   Sits under navbar, hides <main>.
   ============================================================ */

body.radar-page main,
body.radar-page .state-filter-banner,
body.radar-page #toastContainer {
  display: none !important;
}

body.radar-page {
  overflow: hidden;
}

.radar-construction {
  position: fixed;
  inset: var(--navbar-height, 48px) 0 0 0;
  z-index: 1;
  overflow: hidden;
  background: #05070a;
  isolation: isolate;
  display: grid;
  place-items: center;
  padding: clamp(1.5rem, 4vw, 4rem);
  color: #eaf6f3;
  font-family: var(--font-sans);
}

.radar-construction canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}

.rc-vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 60% at 50% 50%, transparent 0%, rgba(0, 0, 0, 0.55) 70%, rgba(0, 0, 0, 0.9) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, transparent 15%, transparent 85%, rgba(0, 0, 0, 0.5) 100%);
}

.rc-content {
  position: relative;
  z-index: 2;
  max-width: 780px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1rem, 2.4vw, 1.75rem);
  animation: rcFade 1.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes rcFade {
  from { opacity: 0; transform: translateY(12px); filter: blur(6px); }
  to   { opacity: 1; transform: translateY(0);    filter: blur(0); }
}

.rc-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1fffc8;
  box-shadow: 0 0 0 0 rgba(31, 255, 200, 0.7);
  animation: rcPulse 1.8s ease-out infinite;
}

@keyframes rcPulse {
  0%   { box-shadow: 0 0 0 0 rgba(31, 255, 200, 0.6), 0 0 12px rgba(31, 255, 200, 0.8); }
  70%  { box-shadow: 0 0 0 12px rgba(31, 255, 200, 0), 0 0 12px rgba(31, 255, 200, 0.8); }
  100% { box-shadow: 0 0 0 0 rgba(31, 255, 200, 0); }
}

/* Title */
.rc-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(2.4rem, 6.2vw, 5.25rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin: 0;
  color: #f4fffb;
  text-wrap: balance;
}

.rc-title-line {
  display: block;
  transform-origin: center;
}

.rc-title-accent {
  font-style: italic;
  background: linear-gradient(
    100deg,
    #7effd6 0%,
    #1fffc8 28%,
    #00e6b4 52%,
    #5ff0cc 78%,
    #aeffe4 100%
  );
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 24px rgba(0, 230, 180, 0.35));
  animation: rcShimmer 6s linear infinite;
}

@keyframes rcShimmer {
  0%   { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

/* Subtitle */
.rc-sub {
  max-width: 56ch;
  margin: 0;
  font-size: clamp(1.05rem, 1.2vw, 1.2rem);
  line-height: 1.65;
  color: rgba(234, 246, 243, 0.86);
  font-weight: 400;
  text-shadow: 0 1px 16px rgba(0, 0, 0, 0.55);
}

/* Progress */
.rc-progress {
  width: min(440px, 100%);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.25rem;
}

.rc-progress-track {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
  box-shadow: 0 1px 16px rgba(0, 0, 0, 0.4) inset;
}

.rc-progress-bar {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(90deg, rgba(0, 230, 180, 0) 0%, #1fffc8 50%, rgba(0, 230, 180, 0) 100%);
  box-shadow: 0 0 20px rgba(31, 255, 200, 0.7);
  border-radius: 999px;
  animation: rcBar 4.2s cubic-bezier(0.7, 0, 0.3, 1) infinite;
}

@keyframes rcBar {
  0%   { left: -30%; width: 30%; }
  50%  { left: 35%;  width: 50%; }
  100% { left: 100%; width: 30%; }
}

.rc-progress-label {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  color: rgba(234, 246, 243, 0.88);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.6);
}

/* Actions */
.rc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 0.5rem;
}

.rc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.4rem;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.005em;
  text-decoration: none;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              background 0.25s, border-color 0.25s, box-shadow 0.25s, color 0.25s;
  will-change: transform;
}

.rc-btn-primary {
  background: #00e6b4;
  color: #02140f;
  font-weight: 600;
}

.rc-btn-primary:hover {
  transform: translateY(-1px);
  background: #7effd6;
}

/* Corner scan markers */
.rc-scan {
  position: absolute;
  inset: 1.5rem;
  pointer-events: none;
  z-index: 2;
}

.rc-scan span {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(0, 230, 180, 0.5);
  opacity: 0.7;
}

.rc-scan span:nth-child(1) { top: 0; left: 0; border-right: none; border-bottom: none; }
.rc-scan span:nth-child(2) { top: 0; right: 0; border-left: none; border-bottom: none; }
.rc-scan span:nth-child(3) { bottom: 0; left: 0; border-right: none; border-top: none; }
.rc-scan span:nth-child(4) { bottom: 0; right: 0; border-left: none; border-top: none; }

@media (max-width: 640px) {
  .rc-scan { inset: 0.75rem; }
  .rc-scan span { width: 16px; height: 16px; }
  .rc-actions { width: 100%; flex-direction: column; }
  .rc-actions .rc-btn { width: 100%; }
}

/* Reduced motion — keep a beautiful static gradient */
@media (prefers-reduced-motion: reduce) {
  .radar-construction canvas { display: none; }
  .radar-construction {
    background:
      radial-gradient(ellipse 80% 60% at 50% 35%, rgba(0, 137, 110, 0.35), transparent 60%),
      radial-gradient(ellipse 60% 50% at 80% 80%, rgba(0, 230, 180, 0.18), transparent 65%),
      radial-gradient(ellipse 60% 50% at 20% 75%, rgba(0, 90, 120, 0.22), transparent 70%),
      #05070a;
  }
  .rc-title-accent { animation: none; }
  .rc-progress-bar { animation: none; width: 72%; left: 0; }
  .rc-pulse { animation: none; box-shadow: 0 0 14px rgba(31, 255, 200, 0.9); }
  .rc-content { animation: none; }
}

/* Light theme: overlay stays dark — it's a cinematic takeover */
[data-theme="light"] .radar-construction {
  background: #05070a;
}
