/* ==========================================================================
   Design Tokens & CSS Variables
   ========================================================================== */
:root {
  --bg-primary: #07080c;
  --bg-secondary: #0d1017;
  --card-bg: rgba(15, 19, 28, 0.7);
  --card-border: rgba(255, 255, 255, 0.07);
  --card-border-hover: rgba(56, 189, 248, 0.25);
  
  --text-main: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-dim: #475569;
  
  --accent-cyan: #38bdf8;
  --accent-cyan-glow: rgba(56, 189, 248, 0.35);
  --accent-amber: #f59e0b;
  --accent-amber-glow: rgba(245, 158, 11, 0.35);
  
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  
  --transition-fast: 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   CSS Reset & Base
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  min-height: 100%;
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  position: relative;
}

/* ==========================================================================
   Background Canvas & Atmospheric Overlays
   ========================================================================== */
#ambient-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.ambient-glow {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60vw;
  height: 60vh;
  background: radial-gradient(
    circle at center,
    rgba(56, 189, 248, 0.06) 0%,
    rgba(30, 58, 138, 0.03) 45%,
    transparent 70%
  );
  filter: blur(60px);
  z-index: 1;
  pointer-events: none;
  animation: pulse-ambient 12s ease-in-out infinite alternate;
}

.vignette-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(
    circle at 50% 50%,
    transparent 40%,
    rgba(7, 8, 12, 0.75) 100%
  );
  z-index: 2;
  pointer-events: none;
}

@keyframes pulse-ambient {
  0% {
    opacity: 0.5;
    transform: translate(-50%, -50%) scale(0.9);
  }
  100% {
    opacity: 0.9;
    transform: translate(-50%, -50%) scale(1.15);
  }
}

/* ==========================================================================
   Layout Container
   ========================================================================== */
.page-container {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
}

.card-wrapper {
  position: relative;
  width: 100%;
  max-width: 580px;
  background: var(--card-bg);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 3rem 2.5rem;
  box-shadow: 
    0 0 0 1px rgba(255, 255, 255, 0.03),
    0 24px 68px -12px rgba(0, 0, 0, 0.7),
    0 4px 16px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: border-color var(--transition-smooth), box-shadow var(--transition-smooth);
}

.card-wrapper::before {
  content: "";
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  pointer-events: none;
}

.card-wrapper::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(
    320px circle at var(--mouse-x, -999px) var(--mouse-y, -999px),
    rgba(56, 189, 248, 0.25),
    transparent 75%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* ==========================================================================
   Status Badge
   ========================================================================== */
.status-badge-container {
  margin-bottom: 2rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.375rem 0.875rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  user-select: none;
}

.pulse-dot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 8px;
  height: 8px;
}

.core-dot {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent-amber);
  box-shadow: 0 0 10px var(--accent-amber);
}

.pulse-ring {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: var(--accent-amber-glow);
  opacity: 0.7;
  animation: radar-ping 2.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes radar-ping {
  0% {
    transform: scale(0.6);
    opacity: 0.8;
  }
  60%, 100% {
    transform: scale(2.2);
    opacity: 0;
  }
}

/* ==========================================================================
   Typography
   ========================================================================== */
.content-header {
  margin-bottom: 2.25rem;
}

.main-title {
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.035em;
  color: #ffffff;
  background: linear-gradient(180deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1rem;
}

.subtitle {
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text-secondary);
  max-width: 44ch;
  margin: 0 auto;
  font-weight: 300;
}

/* ==========================================================================
   Telemetry Panel
   ========================================================================== */
.telemetry-panel {
  width: 100%;
  background: rgba(10, 13, 20, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: 1.5rem 1.25rem 1.25rem;
  margin-bottom: 1.75rem;
}

.telemetry-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.telemetry-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.telemetry-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.telemetry-value {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-main);
}

.telemetry-value.text-accent {
  color: var(--accent-amber);
}

.telemetry-value.text-muted {
  color: var(--text-muted);
}

.font-mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

/* ==========================================================================
   Scan / Action Button
   ========================================================================== */
.action-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.btn-scan {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1.25rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: all var(--transition-smooth);
}

.btn-scan:hover {
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.3);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.15);
}

.btn-scan:active {
  transform: translateY(0);
}

.btn-scan:focus-visible {
  box-shadow: 0 0 0 2px var(--accent-cyan);
}

.scan-icon {
  width: 15px;
  height: 15px;
  color: var(--accent-cyan);
  transition: transform var(--transition-smooth);
}

.btn-scan.scanning .scan-icon {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.scan-feedback {
  min-height: 1.2rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity var(--transition-smooth), transform var(--transition-smooth);
  transform: translateY(3px);
}

.scan-feedback.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.content-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-dim);
  font-size: 0.78rem;
  user-select: none;
}

.footer-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-dim);
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 600px) {
  .card-wrapper {
    padding: 2.25rem 1.5rem;
    border-radius: var(--radius-md);
  }

  .telemetry-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
  }

  .telemetry-item {
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
    padding: 0 0.5rem;
  }

  .subtitle {
    font-size: 0.95rem;
  }
}
