@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

:root {
  --bg: #0a0a0f;
  --surface: #0e0e16;
  --border: #1e1e2e;
  --text-primary: #f0f0f0;
  --text-muted: #555;
  --accent: #7c6aff;
  --font: 'Inter', system-ui, sans-serif;
}

body {
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(124,106,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124,106,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  color: var(--text-primary);
  font-family: var(--font);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  height: 350px;
  background: radial-gradient(ellipse, rgba(124,106,255,0.1) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

#app {
  width: 100%;
  max-width: 480px;
  padding: 2rem 1.25rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  position: relative;
  z-index: 1;
}

/* Purple haze bloom on tap/click */
.haze-blob {
  position: fixed;
  border-radius: 50%;
  width: 320px;
  height: 320px;
  background: radial-gradient(ellipse, rgba(124,106,255,0.18) 0%, rgba(124,106,255,0.06) 40%, transparent 70%);
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0);
  filter: blur(32px);
  z-index: 999;
  animation: none;
}

.haze-blob.active {
  animation: haze-bloom 900ms ease-out forwards;
}

@keyframes haze-bloom {
  0%   { transform: translate(-50%, -50%) scale(0);   opacity: 1; }
  40%  { transform: translate(-50%, -50%) scale(1);   opacity: 0.85; }
  100% { transform: translate(-50%, -50%) scale(1.4); opacity: 0; }
}

/* Header */
#top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#app-name {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.5;
}

/* Hero */
#hero {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-top: 0.5rem;
}

#hero h1 {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

#hero h1 span {
  color: var(--accent);
}

#hero p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 300px;
}

#sensor-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s infinite;
}

#sensor-count {
  font-size: 0.75rem;
  color: var(--text-muted);
}

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

/* Divider */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, #7c6aff22, transparent);
}

/* Cards */
#cards {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.section-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.4;
  margin-bottom: 0.75rem;
  display: block;
}

.sensor-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.1rem;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s;
}

.sensor-card:hover {
  border-color: #7c6aff55;
}

.sensor-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #7c6aff08 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.sensor-card:hover::after {
  opacity: 1;
}

.live-dot {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s infinite;
}

.card-icon {
  font-size: 1.1rem;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #0a0a12;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.card-body h2 {
  font-size: 0.88rem;
  font-weight: 600;
  color: #e0e0f0;
}

.card-body p {
  font-size: 0.73rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.card-tags {
  display: flex;
  gap: 0.3rem;
  margin-top: 0.35rem;
  flex-wrap: wrap;
}

.tag {
  font-size: 0.62rem;
  color: #7c6aff88;
  background: #7c6aff0a;
  border: 1px solid #7c6aff22;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
}

.badge {
  font-size: 0.62rem;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  margin-top: 0.35rem;
  align-self: flex-start;
}

.badge-available {
  color: #6bffb8aa;
  background: #6bffb80a;
  border: 1px solid #6bffb822;
}

.badge-unsupported {
  color: #ff6b6b88;
  background: #ff6b6b0a;
  border: 1px solid #ff6b6b22;
}

.card-arrow {
  font-size: 0.85rem;
  color: #2a2a3a;
  flex-shrink: 0;
  transition: color 0.15s, transform 0.15s;
}

.sensor-card:hover .card-arrow {
  color: var(--accent);
  transform: translateX(3px);
}

/* Footer */
#footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  color: #2a2a3a;
  padding-top: 1rem;
}

.footer-dot { opacity: 0.4; }