/* ── Reset & base ─────────────────────────────────────────────────────────── */

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

:root {
  --accent:       #6366f1;
  --accent-dark:  #4f46e5;
  --accent-light: #eef2ff;
  --text:         #0f172a;
  --text-muted:   #64748b;
  --bg:           #ffffff;
  --bg-alt:       #f8fafc;
  --border:       #e2e8f0;
  --radius:       12px;
  --radius-sm:    8px;
  --shadow:       0 1px 3px rgba(0,0,0,.07), 0 4px 12px rgba(0,0,0,.05);
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --max-w: 1100px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ── Layout helpers ───────────────────────────────────────────────────────── */

.container {
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 2.5rem);
}

/* ── Header ───────────────────────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.02em;
  text-decoration: none;
}

.logo:hover {
  text-decoration: none;
}

.logo-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34,197,94,.2);
  flex-shrink: 0;
  animation: logo-dot-pulse 2.5s ease-in-out infinite;
}

@keyframes logo-dot-pulse {
  0%, 100% { box-shadow: 0 0 0 0   rgba(34,197,94,.6); }
  50%       { box-shadow: 0 0 0 7px rgba(34,197,94,.0); }
}

nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

nav a {
  font-size: .9375rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color .15s;
}

nav a:hover {
  color: var(--text);
  text-decoration: none;
}

nav a.active {
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: .3rem .75rem;
}

.nav-github {
  display: flex;
  align-items: center;
  gap: .35rem;
  color: var(--text) !important;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .65rem 1.4rem;
  border-radius: var(--radius-sm);
  font-size: .9375rem;
  font-weight: 600;
  text-decoration: none;
  transition: all .15s ease;
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 2px rgba(99,102,241,.3), 0 4px 12px rgba(99,102,241,.2);
}

.btn-primary:hover {
  background: var(--accent-dark);
  box-shadow: 0 1px 3px rgba(79,70,229,.4), 0 6px 16px rgba(79,70,229,.25);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow);
}

.btn-secondary:hover {
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.btn-large {
  padding: .85rem 2rem;
  font-size: 1.0625rem;
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */

.hero {
  padding-block: clamp(4rem, 10vw, 7rem);
  text-align: center;
  background: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(99,102,241,.08), transparent);
}

.hero-badge {
  display: inline-block;
  padding: .3rem .85rem;
  background: var(--accent-light);
  color: var(--accent-dark);
  border-radius: 100px;
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .01em;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: clamp(2.25rem, 6vw, 3.75rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.035em;
  color: var(--text);
  margin-bottom: 1.25rem;
}

.hero-sub {
  max-width: 600px;
  margin-inline: auto;
  font-size: clamp(1rem, 2vw, 1.1875rem);
  color: var(--text-muted);
  margin-bottom: 2.25rem;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .875rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.hero-note {
  font-size: .8125rem;
  color: var(--text-muted);
}

/* ── Stats bar ────────────────────────────────────────────────────────────── */

.stats-bar {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}

.stats-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
  padding-block: 1.75rem;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-inline: 2.5rem;
}

.stat-value {
  font-size: 1.625rem;
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--text);
  line-height: 1.1;
}

.stat-label {
  font-size: .8125rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: .15rem;
}

.stat-divider {
  width: 1px;
  height: 2.5rem;
  background: var(--border);
}

/* ── Sections ─────────────────────────────────────────────────────────────── */

.section {
  padding-block: clamp(3.5rem, 8vw, 6rem);
}

.section-alt {
  background: var(--bg-alt);
}

.section-header {
  text-align: center;
  max-width: 640px;
  margin-inline: auto;
  margin-bottom: 3rem;
}

.section-header h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -.03em;
  margin-bottom: .625rem;
}

.section-tagline {
  font-size: 1.0625rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: .375rem;
}

.section-header p {
  color: var(--text-muted);
  font-size: 1.0625rem;
}

/* ── Sensor grid ──────────────────────────────────────────────────────────── */

.sensor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}

.sensor-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: box-shadow .2s, transform .2s;
}

.sensor-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,.1);
  transform: translateY(-2px);
}

.sensor-icon {
  width: 40px;
  height: 40px;
  background: var(--accent-light);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  color: var(--accent);
}

.sensor-icon svg {
  width: 22px;
  height: 22px;
}

.sensor-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: .375rem;
  letter-spacing: -.01em;
}

.sensor-card p {
  font-size: .9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── Steps ────────────────────────────────────────────────────────────────── */

.steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 680px;
  margin-inline: auto;
  counter-reset: steps;
}

.step {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: .1rem;
}

.step-body h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: .375rem;
  letter-spacing: -.01em;
}

.step-body p {
  color: var(--text-muted);
}

/* ── Requirements ─────────────────────────────────────────────────────────── */

.requirements-list {
  list-style: none;
  max-width: 540px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: .875rem;
}

.requirements-list li {
  display: flex;
  align-items: flex-start;
  gap: .625rem;
}

.req-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: .15rem;
  color: #22c55e;
}

.req-icon--note {
  color: var(--text-muted);
}

/* ── Installation CTA ─────────────────────────────────────────────────────── */

.installation-cta {
  display: flex;
  justify-content: center;
  margin-top: 2.5rem;
}

/* ── Footer ───────────────────────────────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 1.5rem;
  background: var(--bg);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
  font-size: .875rem;
  color: var(--text-muted);
}

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
  nav a:not(.nav-github) {
    display: none;
  }

  .stat {
    padding-inline: 1.5rem;
  }

  .stat-divider {
    display: none;
  }

  .stats-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    text-align: center;
  }

  .step {
    flex-direction: column;
    gap: .875rem;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}

/* ── Focus / accessibility ────────────────────────────────────────────────── */

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
