/* styles/spotlight.css — Omarchy-inspired interactive crazy background & spotlight stage */
.spotlight-stage {
  position: relative;
  width: 100%;
  height: calc(100vh - var(--header-height));
  height: calc(100dvh - var(--header-height));
  min-height: 440px;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border-subtle);
  user-select: none;
  -webkit-user-select: none;
  cursor: crosshair;
}

.spotlight-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
  display: block;
}

.spotlight-overlay {
  position: relative;
  z-index: 2;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 100%;
  padding: 28px 24px 24px;
}

.spotlight-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-radius: var(--radius-full);
  background: var(--phosphor-dim);
  border: 1px solid rgba(var(--accent-rgb, 255, 176, 0), 0.28);
  color: var(--hot);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  pointer-events: auto;
}

.spotlight-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--phosphor);
  box-shadow: 0 0 8px var(--phosphor);
  animation: spotlight-pulse 2.2s infinite ease-in-out;
}

@keyframes spotlight-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.8); }
}

.spotlight-center-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  pointer-events: none;
}

.spotlight-scroll-cue {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-decoration: none;
  pointer-events: auto;
  cursor: pointer;
  transition: color 0.15s ease, transform 0.15s ease;
}

.spotlight-scroll-cue:hover {
  color: var(--hot);
  transform: translateY(2px);
}

.scroll-cue-arrow { font-size: 13px; color: var(--phosphor); animation: cue-bounce 2s infinite ease-in-out; }

@keyframes cue-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

@media (max-width: 768px) {
  .spotlight-stage { height: calc(100svh - var(--header-height)); min-height: 420px; }
  .spotlight-overlay { padding: 20px 16px 20px; }
  .spotlight-badge { font-size: 10px; padding: 4px 10px; }
  .spotlight-tagline { font-size: 12px; margin-top: 8px; }
}

/* Card Spotlight (CSS-Driven) — Dynamic Border Glow & Surface Illumination */
@property --spotlight-radius {
  syntax: "<length>";
  inherits: true;
  initial-value: 350px;
}

.spotlight-card, .compare-card, .tui-showcase-container, .matrix-card,
.install-card, .eco-card, .terminal-install-box, .showcase-wrapper {
  --mouse-x: -999px;
  --mouse-y: -999px;
  --spotlight-radius: 350px;
  position: relative;
  transition: --spotlight-radius 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.compare-card-opinionated {
  --spotlight-border: rgba(148, 163, 184, 0.35);
  --spotlight-glow: rgba(203, 213, 225, 0.75);
  --spotlight-inner: rgba(148, 163, 184, 0.02);
}

.compare-card-idlescreen, .install-card-primary, .eco-card-highlight {
  --spotlight-border: rgba(var(--accent-rgb, 255, 176, 0), 0.65);
  --spotlight-glow: rgba(var(--hot-rgb, 255, 212, 71), 1);
  --spotlight-inner: rgba(var(--accent-rgb, 255, 176, 0), 0.055);
}

/* Attenuated Text-Reading Mode: Reduced Radius & Suppressed Glare over Text */
.spotlight-card.spotlight-over-text, .spotlight-over-text {
  --spotlight-radius: 120px;
  --spotlight-border: rgba(var(--accent-rgb, 255, 176, 0), 0.20);
  --spotlight-glow: rgba(var(--hot-rgb, 255, 212, 71), 0.38);
  --spotlight-inner: rgba(var(--accent-rgb, 255, 176, 0), 0.005);
}

.compare-card-opinionated.spotlight-over-text {
  --spotlight-radius: 120px;
  --spotlight-border: rgba(148, 163, 184, 0.16);
  --spotlight-glow: rgba(203, 213, 225, 0.30);
  --spotlight-inner: rgba(148, 163, 184, 0.004);
}

/* Border Spotlight Glow: Precisely masked to 1px border */
.spotlight-card::after, .compare-card::after, .tui-showcase-container::after,
.matrix-card::after, .install-card::after, .eco-card::after, .terminal-install-box::after, .showcase-wrapper::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  box-sizing: border-box;
  background: radial-gradient(
    var(--spotlight-radius) circle at var(--mouse-x) var(--mouse-y),
    var(--spotlight-glow) 0%,
    var(--spotlight-border) 25%,
    rgba(var(--accent-rgb, 255, 176, 0), 0.12) 50%,
    transparent 75%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 2;
}

/* Subtle Ambient Surface Highlight */
.spotlight-card:not(.tui-showcase-container)::before, .compare-card::before,
.matrix-card::before, .install-card::before, .eco-card::before, .terminal-install-box::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    calc(var(--spotlight-radius) * 1.1) circle at var(--mouse-x) var(--mouse-y),
    var(--spotlight-inner) 0%,
    transparent 65%
  );
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}

/* Active Reveal */
.spotlight-card.spotlight-active::after,
.compare-card.spotlight-active::after, .tui-showcase-container.spotlight-active::after,
.matrix-card.spotlight-active::after, .install-card.spotlight-active::after,
.eco-card.spotlight-active::after, .terminal-install-box.spotlight-active::after,
.showcase-wrapper.spotlight-active::after,
.spotlight-card:not(.tui-showcase-container).spotlight-active::before,
.compare-card.spotlight-active::before, .matrix-card.spotlight-active::before,
.install-card.spotlight-active::before, .eco-card.spotlight-active::before,
.terminal-install-box.spotlight-active::before {
  opacity: 1;
}

/* Suppress surface glare over text elements */
.spotlight-card.spotlight-over-text.spotlight-active::before,
.spotlight-over-text.spotlight-active::before {
  opacity: 0.12;
}

.matrix-card.spotlight-card:hover {
  border-color: var(--border-focus);
}

.tui-showcase-container.spotlight-card {
  overflow: visible;
}

.tui-showcase-container::before {
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
}

@media (prefers-reduced-motion: reduce) {
  .spotlight-card, .spotlight-card::after, .spotlight-card::before,
  .compare-card::after, .compare-card::before,
  .matrix-card::after, .matrix-card::before,
  .install-card::after, .install-card::before,
  .eco-card::after, .eco-card::before,
  .terminal-install-box::after, .terminal-install-box::before,
  .showcase-wrapper::after {
    transition: none;
  }
}
