/* GENERATED from website-src/ — DO NOT EDIT. Run: npm run build:website (or npm run dev:website for hot reload) */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--nav-height) + 28px) 24px 72px;
  overflow: clip;
}

/* Soft, low-opacity "light source" blobs give the glass something to refract
   and turn the white-on-white canvas into a premium focal glow. */
.hero-bg {
  position: absolute;
  inset: 0;
  background:
    /* Focal bloom directly behind the demo card — the brightest, most saturated
       light so the translucent glass has something rich to refract and "float"
       over (otherwise the card reads white-on-white). Deepened and tightened
       toward the card's footprint so the shared .ds-glass-card material
       (backdrop-filter: saturate(200%)) actually refracts colour and the
       specular rim registers. */
    radial-gradient(
      ellipse 48% 46% at 50% 47%,
      rgba(0, 122, 255, 0.46) 0%,
      rgba(0, 122, 255, 0.26) 30%,
      rgba(0, 122, 255, 0.09) 52%,
      transparent 70%
    ),
    radial-gradient(
      ellipse 60% 44% at 22% 26%,
      rgba(0, 122, 255, 0.3) 0%,
      transparent 58%
    ),
    radial-gradient(
      ellipse 54% 42% at 82% 16%,
      rgba(64, 196, 255, 0.32) 0%,
      transparent 60%
    ),
    radial-gradient(
      ellipse 50% 46% at 78% 86%,
      rgba(175, 82, 222, 0.2) 0%,
      transparent 64%
    ),
    radial-gradient(
      ellipse 46% 40% at 16% 84%,
      rgba(94, 92, 230, 0.16) 0%,
      transparent 66%
    ),
    radial-gradient(
      ellipse 96% 74% at 50% 0%,
      rgba(0, 122, 255, 0.1) 0%,
      transparent 62%
    );
  z-index: 0;
}

@media (prefers-color-scheme: dark) {
.hero-bg {
    background:
      radial-gradient(
        ellipse 60% 40% at 26% 30%,
        rgba(10, 132, 255, 0.28) 0%,
        transparent 60%
      ),
      radial-gradient(
        ellipse 50% 38% at 80% 18%,
        rgba(100, 210, 255, 0.24) 0%,
        transparent 64%
      ),
      radial-gradient(
        ellipse 46% 40% at 70% 88%,
        rgba(175, 82, 222, 0.14) 0%,
        transparent 66%
      ),
      radial-gradient(
        ellipse 92% 72% at 50% 0%,
        rgba(10, 132, 255, 0.1) 0%,
        transparent 62%
      );
}
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: var(--content-width);
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero h1 {
  font-size: clamp(28px, 6vw, 72px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.04;
  margin-bottom: 20px;
}

.hero h1 .highlight {
  background: linear-gradient(135deg, var(--blue), var(--blue-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: clamp(17px, 2.2vw, 22px);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 20px;
  line-height: 1.5;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--radius-pill);
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  box-shadow: none;
}

.hero-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

@media (prefers-color-scheme: dark) {
  .hero-badge {
    background: rgba(44, 44, 46, 0.72);
    border-color: rgba(255, 255, 255, 0.08);
  }
}

.hero .demo-card {
  width: 100%;
}

/* ── Interactive preview (honest simulation) ─────────────────────── */
.demo-preview-note {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 14px 2px 0;
  text-align: center;
}
.demo-preview-note a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 600;
}
.demo-preview-note a:hover {
  text-decoration: underline;
}
.demo-live-tag {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  background: rgba(0, 122, 255, 0.1);
  border: 1px solid rgba(0, 122, 255, 0.18);
  border-radius: 5px;
  padding: 2px 6px;
  margin-left: 8px;
  vertical-align: middle;
}
.demo-device-preview {
  animation: device-cascade 0.45s var(--ds-ease-standard, ease) backwards;
  animation-delay: calc(var(--i, 0) * 70ms);
}
@keyframes device-cascade {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
/* Proof-of-life: the number ticks up (1px rise) and flashes a calm green so it
   reads as live telemetry, not a blink. */
[data-preview-char] {
  display: inline-block;
  font-variant-numeric: tabular-nums;
}
[data-preview-char].pulse {
  animation: value-pulse 0.5s var(--ease-standard);
}
@keyframes value-pulse {
  0% {
    color: var(--green);
    transform: translateY(1px);
    opacity: 0.6;
  }
  100% {
    color: inherit;
    transform: translateY(0);
    opacity: 1;
  }
}

/* The live-values heading receives focus on connect — keep the ring tidy. */
.demo-services h4:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--blue) 32%, transparent);
  outline-offset: 3px;
  border-radius: 6px;
}
.demo-services h4:focus:not(:focus-visible) {
  outline: none;
}
@media (prefers-reduced-motion: reduce) {
  /* Kill ALL decorative + infinite demo loops; keep the spinner legible but
     slow (a busy indicator is functional). The global kill-switch in
     glass-components.css / site.css also applies; this is explicit coverage. */
  .demo-device-preview,
  [data-preview-char].pulse,
  .demo-row-live-num.pulse,
  .demo-row-live-dot,
  .demo-services,
  .demo-body.transitioning,
  .hero-badge .dot,
  .demo-empty-state .empty-ping,
  .celebration,
  .celebration::before {
    animation: none !important;
  }
  .demo-status-dot {
    animation: none !important;
  }
  .demo-scan-btn .spinner {
    animation-duration: 1.4s !important;
  }
}

/* ============================================================
 Live Demo Section
 ============================================================ */
#demo {
  scroll-margin-top: var(--nav-height);
}

/* The hero centerpiece IS the shared Liquid-Glass pane (.ds-glass-card from
   src/shared/glass-components.css): material, specular rim, backdrop-filter and
   reduced-transparency fallback all come from the shared layer. We only add the
   home-specific footprint — a larger radius and a richer "lifted" float shadow
   so the card reads as floating over the coloured hero glow. */
.demo-card {
  isolation: isolate;
  border-radius: 24px;
  /* Float stack: the shared large elevation token (--ds-shadow-lg) + a coloured
     ambient bloom so the glass reads as clearly lifted off the page (focal
     richness), layered on top of the shared inset specular. A firmer top
     specular rim (bright 1px inset highlight) sharpens the glass edge against
     the deepened bloom behind it. */
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    var(--ds-shadow-lg),
    0 24px 50px -12px rgba(0, 70, 160, 0.3),
    0 40px 90px -30px rgba(80, 60, 180, 0.24),
    var(--ds-glass-inset-shadow);
  overflow: hidden;
  max-width: 720px;
  margin: 0 auto;
}

/* Lift the interactive content above the shared .ds-glass specular pseudo-
   elements (which are absolutely positioned and would otherwise paint over it). */
.demo-card > * {
  position: relative;
  z-index: 1;
}

.demo-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px 16px;
  background: color-mix(in srgb, var(--ds-glass-bg) 50%, transparent);
  border-bottom: 1px solid var(--ds-glass-border);
}

.demo-toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.demo-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--orange);
  transition: background 0.3s;
}

.demo-status-dot.active {
  background: var(--green);
}
.demo-status-dot.error {
  background: var(--red);
}

.demo-status-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Layout (inline-flex, gap, font, padding) comes from the shared .ds-badge;
   here we only add the demo's small-caps chip treatment + AA-safe default tint
   (state tones are swapped in via .demo-badge-* by setBadgeTone in home.js). */
.demo-toolbar-badge {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: 6px;
  background: rgba(0, 122, 255, 0.1);
  /* Darker than --blue so the 11px small-caps chip clears WCAG-AA on tint. */
  color: #0061cc;
  border: 1px solid rgba(0, 122, 255, 0.18);
}

@media (prefers-color-scheme: dark) {
  .demo-toolbar-badge {
    color: var(--blue);
  }
}

/* Badge tones driven by state (see setBadgeTone in home.js) — AA-compliant
   small-caps text on tinted fills. */
.demo-badge-info {
  background: rgba(0, 122, 255, 0.1);
  color: #0061cc;
  border-color: rgba(0, 122, 255, 0.18);
}
.demo-badge-live {
  background: rgba(52, 199, 89, 0.12);
  /* Darker green so the 11px small-caps "LIVE" chip clears WCAG-AA on its tint
     (4.9:1 vs the old #1f8f3d at 3.8:1). */
  color: #187a33;
  border-color: rgba(52, 199, 89, 0.24);
}
.demo-badge-warn {
  background: rgba(255, 149, 0, 0.14);
  color: #9a5a00;
  border-color: rgba(255, 149, 0, 0.26);
}

@media (prefers-color-scheme: dark) {
  .demo-badge-info {
    color: var(--blue);
  }
  .demo-badge-live {
    color: var(--green);
  }
  .demo-badge-warn {
    color: var(--orange);
  }
}

.demo-body {
  padding: 22px;
  min-height: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: min-height var(--ds-duration-normal) var(--ease-standard);
}

/* State-driven height: the idle card is compact (no reserved emptiness); it
   grows once devices cascade in and again when a connection streams values, so
   there's no layout shift but no dead space at rest either. */
.hero .demo-body {
  min-height: auto;
}
.demo-card.has-devices .demo-body {
  min-height: min(42svh, 380px);
}
.demo-card.has-connected .demo-body {
  min-height: min(56svh, 480px);
}

/* Built on the shared .btn .btn-lg .btn-primary (glass-blue fill, specular,
   hover lift, active scale, pill radius, focus ring + disabled state all come
   from site.css). Home only adds: full-width footprint, a taller tap target,
   and the scan-specific spinner/"Scanning..." swap. */
.demo-scan-btn {
  width: 100%;
  min-height: 56px;
}

/* Keep the label + spinner above .btn-primary's specular pseudo-layers. */
.demo-scan-btn .btn-text,
.demo-scan-btn .spinner {
  position: relative;
  z-index: 1;
}

.demo-scan-btn .spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}

.demo-scan-btn.scanning .spinner {
  display: block;
}
/* During the brief scan we keep the real .btn-text visible (home.js swaps its
   text to "Scanning…" via setScanButtonLabel) and let .btn's inline-flex
   justify-content:center + gap center the spinner + label as one group. We do
   NOT repurpose the specular ::after as a label: generated content on a
   <button> renders unreliably in Safari/WebKit and inherits inset:0 full-box
   semantics, which pushed the 18px spinner off-center. aria-busy + the
   #demoStatusLive aria-live region carry status for assistive tech. */

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

.demo-devices {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.demo-device {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  /* Nested-in-glass surfaces sit lighter/inset, not as their own opaque cards. */
  background: color-mix(in srgb, var(--ds-glass-bg) 64%, transparent);
  border-radius: var(--ds-radius-lg);
  border: 1px solid var(--ds-glass-border);
  cursor: pointer;
  transition:
    border-color 0.2s,
    box-shadow 0.2s,
    transform 0.2s,
    background 0.2s,
    opacity 0.2s;
  text-align: left;
}

.demo-device:hover {
  border-color: var(--blue);
  background: color-mix(in srgb, var(--ds-glass-bg) 88%, transparent);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.08);
  transform: translateY(-1px);
}

.demo-device.connected {
  border-color: var(--green);
  background: rgba(52, 199, 89, 0.1);
  box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.12);
}

/* De-emphasise rows that aren't the connected one for a clear selected read. */
.demo-device.dimmed {
  opacity: 0.5;
}
.demo-device.dimmed:hover {
  opacity: 1;
}

.demo-device:focus-visible,
.demo-scan-btn:focus-visible,
.demo-install-state .btn:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--blue) 32%, transparent);
  outline-offset: 3px;
}

@keyframes device-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.demo-device-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--blue), var(--blue-light));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  /* iOS app-icon feel: inner top highlight + faint coloured drop. */
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 2px 6px rgba(0, 122, 255, 0.25);
}

.demo-device-icon svg {
  width: 20px;
  height: 20px;
}

.demo-device-info {
  flex: 1;
  min-width: 0;
}

.demo-device-name {
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.demo-device-id {
  font-size: 12px;
  color: var(--text-secondary);
  font-family: var(--font);
}

.demo-device-rssi {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.demo-device-rssi.is-connected {
  color: var(--green);
  font-weight: 600;
}

/* Inline live readout chip in the connected device row — surfaces the PRIMARY
   characteristic (e.g. "72 bpm") above the fold so the proof-of-life ticks
   without scrolling to the full live-values panel below. */
.demo-device-rssi.has-live-value {
  flex-shrink: 0;
}
.demo-row-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 11px;
  border-radius: var(--radius-pill);
  background: rgba(52, 199, 89, 0.16);
  border: 1px solid rgba(52, 199, 89, 0.34);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 1px 4px rgba(52, 199, 89, 0.18);
}
.demo-row-live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.5);
  animation: row-live-pulse 1.8s ease-out infinite;
}
/* The live value is the PROOF — promote it to the most salient non-CTA element:
   large, high-contrast tabular-nums that visibly ticks (value-pulse). */
.demo-row-live-num {
  display: inline-block;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.01em;
  line-height: 1;
  /* Darker than --green so the bold readout clears WCAG-AA on the tinted pill. */
  color: #14793a;
  min-width: 3.2ch;
  text-align: right;
}
.demo-row-live-num.pulse {
  animation: value-pulse 0.5s var(--ease-standard);
}
@keyframes row-live-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.5);
  }
  70%,
  100% {
    box-shadow: 0 0 0 6px rgba(52, 199, 89, 0);
  }
}
@media (prefers-color-scheme: dark) {
  .demo-row-live-num {
    color: var(--green);
  }
}

/* Live-values well: pressed *into* the glass (inner shadow), not stacked on top
   — that depth contrast is peak Liquid Glass. */
.demo-services {
  margin-top: 0;
  padding: 18px;
  background: color-mix(in srgb, var(--ds-surface) 18%, transparent);
  border-radius: var(--ds-radius-lg);
  border: 1px solid var(--ds-glass-border);
  box-shadow:
    inset 0 1px 3px rgba(0, 0, 0, 0.08),
    inset 0 0 0 1px var(--ds-glass-border);
  animation: services-rise 0.34s var(--ease-emphasized) both;
}

@keyframes services-rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.demo-services h4 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.demo-service-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.demo-service-item:last-child {
  border-bottom: none;
}

.demo-service-name {
  font-weight: 500;
}

.demo-service-uuid {
  font-family: var(--font);
  font-size: 12px;
  color: var(--text-secondary);
}

/* Demo install state (inline, replaces overlay) */
.demo-install-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px;
  min-height: 240px;
  background: color-mix(in srgb, var(--ds-glass-bg) 70%, transparent);
  border: 1px solid var(--ds-glass-border);
  border-radius: var(--ds-radius-lg);
}

.demo-install-state .install-icon {
  margin-bottom: 20px;
}

.demo-install-state h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.demo-install-state p {
  color: var(--text-secondary);
  font-size: 15px;
  max-width: 360px;
  margin-bottom: 20px;
  line-height: 1.5;
}

.demo-install-state .install-waiting {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 16px;
}

/* Demo empty state (no devices yet) */
.demo-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 24px;
  border: 1px dashed var(--ds-glass-border);
  border-radius: var(--ds-radius-lg);
  background: color-mix(in srgb, var(--ds-glass-bg) 36%, transparent);
  min-height: 160px;
}

.demo-empty-state .empty-icon {
  margin-bottom: 16px;
}

/* Radar "ping": the concentric rings expand outward (the BLE-scan metaphor)
   rather than the whole icon scaling. */
.demo-empty-state .empty-ping {
  transform-box: fill-box;
  transform-origin: center;
  animation: empty-ping 2.4s ease-out infinite;
}
.demo-empty-state .empty-ping:nth-child(2) {
  animation-delay: 0.3s;
}
.demo-empty-state .empty-ping:nth-child(3) {
  animation-delay: 0.6s;
}

@keyframes empty-ping {
  0% {
    transform: scale(0.6);
    opacity: 0.5;
  }
  70%,
  100% {
    transform: scale(1.25);
    opacity: 0;
  }
}

.demo-empty-state h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

/* No extra opacity here — it compounds the contrast failure. Rely on the
   (bumped) solid secondary token only. */
.demo-empty-state p {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Transition animation */
.demo-body.transitioning {
  animation: crossFade 0.5s ease;
}

@keyframes crossFade {
  0% {
    opacity: 0.3;
  }
  100% {
    opacity: 1;
  }
}

@media (max-width: 580px) {
  .demo-install-state {
    padding: 32px 16px;
  }
  .demo-install-state .btn {
    width: 100%;
    justify-content: center;
  }
  .demo-empty-state {
    padding: 28px 16px;
  }
  .demo-body,
  .hero .demo-body {
    padding: 18px;
    min-height: 0;
  }
}

/* Demo event log */
.demo-log {
  margin-top: 4px;
  background: rgba(120, 120, 128, 0.08);
  border-radius: 16px;
  padding: 10px 14px;
  max-height: 120px;
  overflow-y: auto;
  font-family: var(--font);
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-secondary);
  border: 1px solid rgba(15, 23, 42, 0.05);
  scrollbar-width: thin;
}

.demo-log .log-line {
  display: flex;
  gap: 8px;
}
.demo-log .log-time {
  color: color-mix(in srgb, var(--text-secondary) 78%, transparent);
  flex-shrink: 0;
}
.demo-log .log-msg {
  word-break: break-word;
}
.demo-log .log-success {
  color: var(--green);
}
.demo-log .log-error {
  color: var(--red);
}
.demo-log .log-info {
  color: var(--blue);
}
.demo-log .log-warn {
  color: var(--orange);
}

.demo-log:empty {
  display: none;
}

/* Connect celebration — the emotional payoff. A brighter halo behind the card
   PLUS a one-shot specular sweep across the glass. The `.demo-card::before`
   specular layer is repurposed into a moving highlight for the sweep. */
.demo-card.celebration {
  position: relative;
}

.celebration::before {
  /* the existing specular rim becomes a sweeping highlight */
  background:
    linear-gradient(
      105deg,
      transparent 30%,
      rgba(255, 255, 255, 0.5) 50%,
      transparent 70%
    ),
    radial-gradient(
      ellipse at 50% 24%,
      rgba(255, 255, 255, 0.16) 0%,
      transparent 70%
    ) !important;
  background-size: 220% 100%, 100% 100% !important;
  background-repeat: no-repeat !important;
  animation: glass-sweep 0.9s var(--ease-standard);
}

@keyframes glass-sweep {
  from {
    background-position: -120% 0, 0 0;
  }
  to {
    background-position: 160% 0, 0 0;
  }
}

/* Coloured glow halo behind the card (sibling-free, uses an extra layer via
   box-shadow so we don't fight the specular pseudo-elements). */
.celebration {
  animation: celebrate-glow 1.9s ease forwards;
}

@keyframes celebrate-glow {
  0% {
    box-shadow: var(--ds-shadow-lg), var(--ds-glass-inset-shadow);
  }
  30% {
    box-shadow:
      0 0 0 1px rgba(52, 199, 89, 0.5),
      0 18px 60px rgba(52, 199, 89, 0.32),
      var(--ds-glass-inset-shadow);
  }
  100% {
    box-shadow: var(--ds-shadow-lg), var(--ds-glass-inset-shadow);
  }
}

/* ============================================================
 How It Works
 ============================================================ */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

@media (max-width: 768px) {
  .hero {
    /* Kill the full-viewport vertical-centred hero on small screens: the demo
       card + its live value must LEAD in the first viewport at rest, not sit
       below a tall centred copy stack. */
    min-height: auto;
    align-items: flex-start;
    justify-content: flex-start;
    padding: calc(var(--nav-height) + 16px) 16px 40px;
  }

  .hero h1 {
    font-size: clamp(26px, 7vw, 34px);
    margin-bottom: 12px;
  }

  .hero-sub {
    font-size: 16px;
    margin-bottom: 14px;
  }

  .demo-microlabel {
    margin-bottom: 12px;
  }

  .hero .demo-body {
    min-height: auto;
  }
  .demo-card.has-devices .demo-body {
    min-height: min(40svh, 360px);
  }
  .demo-card.has-connected .demo-body {
    min-height: min(54svh, 440px);
  }

  .demo-card {
    border-radius: 24px;
  }

  .demo-toolbar {
    padding: 16px 18px 14px;
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .steps-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

@media (max-width: 480px) {
  .step-card {
    padding: 28px 24px;
  }
  .step-card h3 {
    font-size: 18px;
  }
  .step-card p {
    font-size: 14px;
    overflow-wrap: break-word;
  }
  .step-code pre {
    font-size: 12px;
    white-space: pre-wrap;
    word-break: break-all;
  }
  .hero {
    padding: calc(var(--nav-height) + 12px) 16px 32px;
  }
  .hero h1 {
    font-size: clamp(24px, 7.4vw, 30px);
    margin-bottom: 10px;
  }
  .hero h1 br {
    display: none;
  }
  .hero-sub {
    font-size: 15px;
    margin-bottom: 12px;
    line-height: 1.45;
  }
  .hero-badge {
    margin-bottom: 12px;
    font-size: 13px;
  }
  .demo-microlabel {
    margin-bottom: 10px;
  }
  .demo-card {
    border-radius: 20px;
  }
  .hero-cta-code {
    gap: 6px;
    padding-left: 12px;
  }
  .hero-cta-snippet {
    /* No max-width clamp: let the full package name show and wrap inside the
       pill on narrow screens instead of being cut off mid-string. */
    max-width: none;
    font-size: 12px;
    line-height: 1.4;
  }
  .demo-toolbar {
    padding: 14px 16px 12px;
  }
  .demo-toolbar-badge {
    order: 3;
  }
  .hero .demo-body,
  .demo-body {
    padding: 16px;
    gap: 14px;
    min-height: 0;
  }
  .demo-scan-btn {
    min-height: 52px;
    border-radius: 16px;
  }
  .demo-device {
    padding: 14px;
    gap: 12px;
  }
  .demo-device-id,
  .demo-service-uuid,
  .demo-log {
    font-size: 11px;
  }
  .demo-services,
  .demo-install-state,
  .demo-empty-state {
    border-radius: 16px;
  }
  .section {
    padding: 0 16px;
  }
  .section-pad {
    padding-top: 48px;
    padding-bottom: 48px;
  }
  .dev-code-block pre {
    font-size: 12px;
    white-space: pre-wrap;
    word-break: break-all;
  }
}

.step-card {
  text-align: center;
  padding: 40px 28px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  transition:
    transform 0.3s,
    box-shadow 0.3s;
  opacity: 0;
  transform: translateY(20px);
  overflow-wrap: break-word;
  min-width: 0;
}

.step-card.visible {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}

.step-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.step-card.visible:hover {
  transform: translateY(-4px);
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--blue-light));
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 20px;
}

.step-card h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
}

.step-card p {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.55;
}



.step-icon-wrap {
  margin-bottom: 20px;
}

.step-icon-wrap svg {
  margin: 0 auto;
}

/* ============================================================
 For Developers
 ============================================================ */
#developers {
  scroll-margin-top: var(--nav-height);
}

.dev-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

@media (max-width: 768px) {
  .dev-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

.dev-code-block {
  background: #1c1c1e;
  border-radius: var(--radius);
  overflow: hidden;
}

.dev-code-tabs {
  display: flex;
  border-bottom: 1px solid #38383a;
}

.dev-code-tab {
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 600;
  color: #a1a1a6;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  transition:
    color 0.2s,
    background 0.2s;
  border-bottom: 2px solid transparent;
}

.dev-code-tab.active {
  color: #f5f5f7;
  border-bottom-color: var(--blue);
}

.dev-code-tab:hover {
  color: #f5f5f7;
}

.dev-code-content {
  padding: 20px 24px;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.7;
  color: #f5f5f7;
  overflow-x: auto;
  min-height: 200px;
}

.dev-code-content[hidden] {
  display: none;
}

.dev-code-content .kw {
  color: #ff7ab2;
}
.dev-code-content .str {
  color: #fc6a5d;
}
.dev-code-content .cmt {
  color: #6c7986;
}
.dev-code-content .fn {
  color: #67b7d1;
}
.dev-code-content .tag {
  color: #fc6a5d;
}
.dev-code-content .attr {
  color: #d0a8ff;
}

.dev-info h3 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 16px;
}

.dev-info p {
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 16px;
}

.dev-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 24px;
  margin-bottom: 24px;
}

.dev-badge {
  padding: 6px 14px;
  border-radius: 980px;
  font-size: 13px;
  font-weight: 500;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  box-shadow: none;
}

.dev-callout {
  margin-top: 24px;
  padding: 20px;
  border-radius: var(--radius-sm);
  background: rgba(0, 122, 255, 0.06);
  border: 1px solid rgba(0, 122, 255, 0.15);
}

.dev-callout p {
  color: var(--text);
  font-size: 14px;
  margin-bottom: 0;
}

.dev-callout strong {
  color: var(--blue);
}

/* ============================================================
 Contact CTA (replaces Developer Signup)
 ============================================================ */
.contact-section {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 24px;
  text-align: left;
}

.contact-row {
  display: flex;
  gap: 12px;
}

@media (max-width: 600px) {
  .contact-row {
    flex-direction: column;
  }
}

.contact-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.contact-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}

.contact-input,
.contact-textarea {
  width: 100%;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
}

.contact-textarea {
  min-height: 112px;
  resize: vertical;
  line-height: 1.5;
}

.contact-input:focus,
.contact-textarea:focus {
  border-color: var(--blue);
}

.contact-input::placeholder,
.contact-textarea::placeholder {
  color: var(--text-secondary);
}

/* Visuals (glass-blue fill, specular, hover) come from .btn .btn-primary; the
   form just left-aligns it and squares the corners to match the inputs. */
.contact-btn {
  align-self: flex-start;
  border-radius: var(--radius-sm);
}

.contact-note {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ============================================================
 Who's This For + iOS Superpowers grid
 ============================================================ */
.whofor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 28px;
}

.superpowers-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 16px;
  margin-top: 28px;
}

@media (max-width: 900px) {
  .superpowers-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .superpowers-grid {
    grid-template-columns: 1fr;
  }
}

.whofor-card {
  padding: 22px 22px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  /* Grid/flex items default to min-width:auto, so this card couldn't shrink below
     the min-content width of its <pre> code one-liner (white-space:pre) — blowing the
     grid past the viewport and causing horizontal page scroll on iPhone widths.
     min-width:0 lets the card shrink and the inner <pre> scroll on its own. */
  min-width: 0;
}

.whofor-card h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.whofor-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

.whofor-card .step-code {
  margin-top: auto;
  min-width: 0;
  width: 100%;
}

.whofor-card .step-code code {
  font-size: 12px;
  font-family: var(--mono);
  color: var(--text);
}

.highlight-code {
  font-family: var(--mono);
  font-size: 0.85em;
  padding: 0.08em 0.3em;
  border-radius: 7px;
  background: var(--ds-glass-bg);
  border: 1px solid var(--ds-glass-border);
  box-shadow: var(--ds-glass-inset-shadow);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: var(--text);
}

@media (prefers-reduced-transparency: reduce) {
  .highlight-code {
    background: var(--surface);
    border-color: var(--border);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* ============================================================
 Installation Wizard Modal (adapted from existing)
 ============================================================ */
.wizard-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
}

.wizard-modal.open {
  display: flex;
  animation: fadeIn 0.3s ease;
}

.wizard-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.wizard-panel {
  position: relative;
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-saturate) blur(40px);
  backdrop-filter: var(--glass-saturate) blur(40px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  width: 90%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
  animation: slideUp 0.4s ease;
  padding: 40px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes slideUp {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.wizard-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-saturate) blur(var(--glass-blur));
  backdrop-filter: var(--glass-saturate) blur(var(--glass-blur));
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.2s,
    transform 0.2s;
  font-family: var(--font);
}

.wizard-close:hover {
  background: rgba(255, 255, 255, 0.55);
  transform: rotate(90deg);
}

@media (prefers-color-scheme: dark) {
  .wizard-close:hover {
    background: rgba(40, 40, 42, 0.7);
  }
}

.wizard-panel h2 {
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
}

.wizard-panel .wizard-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 32px;
}

.wizard-progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-bottom: 32px;
  overflow: hidden;
}

.wizard-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--blue-light));
  border-radius: 2px;
  transition: width 0.4s ease;
}

.wizard-step {
  text-align: center;
  animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.wizard-step-icon {
  margin-bottom: 20px;
}

.wizard-step h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 12px;
}

.wizard-step p {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.6;
  max-width: 400px;
  margin: 0 auto 24px;
}

.wizard-btns {
  display: flex;
  gap: 12px;
  margin-top: 32px;
}

.wizard-btns .btn {
  flex: 1;
  justify-content: center;
}

.wizard-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 20px auto;
}

@media (max-width: 600px) {
  .wizard-panel {
    width: 100%;
    max-height: 100dvh;
    border-radius: 0;
    padding: 24px;
  }
}

/* ============================================================
 Scroll-reveal utility
 ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.7s ease,
    transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-color-scheme: dark) {
  /* .demo-card material/shadow now derive from the shared .ds-glass dark tokens.
     Soften the bright top specular rim so it reads as a subtle edge highlight
     on the dark glass rather than a hard white line. */
  .demo-card {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.14),
      var(--ds-shadow-lg),
      0 24px 50px -12px rgba(0, 70, 160, 0.3),
      0 40px 90px -30px rgba(80, 60, 180, 0.24),
      var(--ds-glass-inset-shadow);
  }
  .demo-toolbar {
    background: rgba(255, 255, 255, 0.03);
    border-bottom-color: rgba(255, 255, 255, 0.08);
  }

  .demo-toolbar-badge {
    background: rgba(10, 132, 255, 0.14);
    border-color: rgba(10, 132, 255, 0.18);
  }

  .demo-device,
  .demo-services,
  .demo-install-state,
  .demo-empty-state {
    background: rgba(44, 44, 46, 0.56);
    border-color: rgba(255, 255, 255, 0.08);
  }

  .demo-empty-state {
    background: rgba(44, 44, 46, 0.34);
  }

  .demo-device:hover {
    background: rgba(58, 58, 60, 0.8);
  }

  .demo-device.connected {
    background: rgba(48, 209, 88, 0.12);
  }

  .demo-log {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.06);
  }

  .step-code pre {
    background: rgba(28, 28, 30, 0.94);
    color: #f5f5f7;
    border-color: rgba(255, 255, 255, 0.08);
  }

  .step-code .copy-btn {
    background: rgba(58, 58, 60, 0.86);
    border-color: rgba(255, 255, 255, 0.08);
  }

  .step-code .copy-btn:hover {
    background: rgba(72, 72, 74, 0.96);
    color: #fff;
  }
}

/* ============================================================
 Demo micro-label, full-demo link, and trust band
 ============================================================ */
.demo-microlabel {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin: 0 auto 16px;
}

/* Device-maker sub-deck: one neutral line under the hero so hardware owners
   self-identify (audience a). AA-safe secondary text, no status claim. */
.hero-devicemaker {
  margin: 16px auto 0;
  max-width: 560px;
  text-align: center;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--text-secondary);
}

.demo-fulllink {
  margin: 16px auto 0;
  text-align: center;
  font-size: 14px;
}
.demo-fulllink a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 600;
}
.demo-fulllink a:hover {
  text-decoration: underline;
}

.trust-band {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 18px;
  max-width: 760px;
  /* Pulled tight under the primary CTA so the honest signals sit at the fold. */
  margin: 16px auto 0;
  padding: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}
.trust-band li {
  display: inline-flex;
  align-items: center;
}
.trust-band li + li::before {
  content: "·";
  margin-right: 18px;
  color: color-mix(in srgb, var(--text-secondary) 55%, transparent);
}

/* ============================================================
 Conversion CTA directly under the demo (next to the WOW)
 ============================================================ */
.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 16px;
  margin: 24px auto 0;
}

/* Shown by home.js only when Web Bluetooth already works here (extension active
   or native browser) — it replaces the "Add to Safari" install CTA so we never
   prompt an install the visitor doesn't need. Hidden by default; the [hidden]
   rule wins over the base display so there's no pre-JS flash. */
.hero-active-cue {
  flex-basis: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
}

.hero-active-cue[hidden] {
  display: none;
}

.hero-active-cue-check {
  color: var(--green, #34c759);
  font-weight: 800;
}

.hero-cta-primary {
  flex-shrink: 0;
}

.hero-cta-secondary {
  flex-shrink: 0;
}

.hero-cta-code {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 14px;
  border-radius: var(--radius-pill);
  background: var(--ds-glass-bg);
  border: 1px solid var(--ds-glass-border);
  box-shadow: var(--ds-glass-inset-shadow);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  backdrop-filter: blur(12px) saturate(160%);
  max-width: 100%;
}

/* Disambiguates the developer one-liner from the end-user install button
   (Hick's-law): the pill is explicitly framed as "the code you add". */
.hero-cta-code-label {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-secondary);
  white-space: nowrap;
}

@media (prefers-reduced-transparency: reduce) {
  .hero-cta-code {
    background: var(--surface);
    border-color: var(--border);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* Reading the full package name IS the conversion act for developers, so the
   one-liner must stay legible end-to-end. Allow it to wrap onto a second line
   rather than truncating with an ellipsis; the pill grows to fit cleanly. */
.hero-cta-snippet {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.hero-cta-copy {
  flex-shrink: 0;
  appearance: none;
  border: 1px solid var(--ds-accent-border);
  background: var(--ds-accent-fill);
  color: #0061cc;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  min-height: 32px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.hero-cta-copy:hover {
  background: var(--ds-accent-fill-pressed);
}

.hero-cta-copy.copied {
  color: var(--green);
  border-color: rgba(52, 199, 89, 0.3);
  background: rgba(52, 199, 89, 0.12);
}

@media (prefers-color-scheme: dark) {
  .hero-cta-copy {
    color: var(--blue);
  }
}

.demo-trustline {
  margin: 14px auto 0;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  max-width: 560px;
  line-height: 1.5;
}

.demo-trustline .highlight-code {
  font-size: 0.92em;
}

/* Per-row "Tap to connect" hint — token-based, no inline styles. */
.demo-badge-hint {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ============================================================
 Sticky thumb-zone CTA (mobile)
 ============================================================ */
.sticky-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 900;
  display: none;
  gap: 10px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--glass-bg);
  border-top: 1px solid var(--glass-border);
  -webkit-backdrop-filter: var(--glass-saturate) blur(20px);
  backdrop-filter: var(--glass-saturate) blur(20px);
  box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.1);
  transform: translateY(110%);
  transition: transform 0.32s var(--ease-standard);
}

.sticky-cta.visible {
  transform: translateY(0);
}

.sticky-cta .btn {
  flex: 1;
  min-height: 48px;
  justify-content: center;
}

@media (prefers-reduced-transparency: reduce) {
  .sticky-cta {
    background: var(--surface);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@media (max-width: 768px) {
  /* Only reveal the sticky bar on mobile (thumb-zone); JS toggles .visible. */
  .sticky-cta:not([hidden]) {
    display: flex;
  }
  /* Reserve room so the fixed bar never hides the footer's last row. */
  body[data-nav-page="home"] .footer {
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .sticky-cta {
    transition: none;
  }
}

/* a11y: in-text links inside who-for cards need a non-color distinction (axe link-in-text-block) */
.whofor-card p a:not(.btn):not(.page-card-cta) {
  text-decoration: underline;
  text-decoration-thickness: 1px;
}
