.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--nav-height) + 48px) 24px 96px;
  overflow: clip;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      ellipse 92% 72% at 50% 0%,
      rgba(0, 122, 255, 0.09) 0%,
      transparent 62%
    ),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.58) 0%,
      rgba(255, 255, 255, 0) 42%
    ),
    radial-gradient(
      ellipse 42% 34% at 82% 16%,
      rgba(90, 200, 250, 0.08) 0%,
      transparent 72%
    );
  z-index: 0;
}

@media (prefers-color-scheme: dark) {
.hero-bg {
    background:
      radial-gradient(
        ellipse 92% 72% at 50% 0%,
        rgba(10, 132, 255, 0.16) 0%,
        transparent 62%
      ),
      linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.04) 0%,
        rgba(255, 255, 255, 0) 42%
      ),
      radial-gradient(
        ellipse 42% 34% at 82% 16%,
        rgba(100, 210, 255, 0.1) 0%,
        transparent 72%
      );
}
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: min(var(--content-width), 1120px);
  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 48px;
  line-height: 1.55;
}

.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%;
}

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

.demo-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.72));
  border-radius: calc(var(--radius) + 8px);
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.1);
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.08);
  max-width: 720px;
  margin: 0 auto;
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.demo-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px 16px;
  background: rgba(255, 255, 255, 0.44);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.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);
}

.demo-toolbar-badge {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(0, 122, 255, 0.08);
  color: var(--blue);
  border: 1px solid rgba(0, 122, 255, 0.12);
}

.demo-body {
  padding: 22px;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hero .demo-body {
  min-height: min(50svh, 480px);
}

.demo-scan-btn {
  width: 100%;
  min-height: 56px;
  padding: 16px 20px;
  background: linear-gradient(180deg, rgba(0, 122, 255, 0.94), rgba(0, 122, 255, 0.82));
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition:
    transform 0.2s,
    box-shadow 0.2s,
    opacity 0.2s,
    background 0.2s;
  font-family: var(--font);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 14px 30px rgba(0, 122, 255, 0.18);
}

.demo-scan-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(0, 122, 255, 0.98), rgba(0, 122, 255, 0.86));
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(0, 122, 255, 0.2);
}

.demo-scan-btn:disabled {
  opacity: 0.56;
  cursor: not-allowed;
  box-shadow: none;
}

.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;
}
.demo-scan-btn.scanning .btn-text {
  display: none;
}
.demo-scan-btn.scanning::after {
  content: "Scanning...";
}

@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;
  background: rgba(255, 255, 255, 0.64);
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  cursor: pointer;
  transition:
    border-color 0.2s,
    box-shadow 0.2s,
    transform 0.2s,
    background 0.2s;
  animation: device-in 0.4s ease both;
  text-align: left;
}

.demo-device:hover {
  border-color: var(--blue);
  background: rgba(255, 255, 255, 0.84);
  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.08);
  box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.08);
}

.demo-device:focus-visible,
.demo-scan-btn:focus-visible,
.demo-install-state .btn:focus-visible {
  outline: 3px solid rgba(0, 122, 255, 0.32);
  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;
}

.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);
}

.demo-services {
  margin-top: 0;
  padding: 18px;
  background: rgba(255, 255, 255, 0.56);
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  animation: device-in 0.3s ease both;
}

.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: rgba(255, 255, 255, 0.46);
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: 20px;
}

.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: 40px 24px;
  border: 1px dashed rgba(15, 23, 42, 0.12);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.3);
  min-height: 180px;
}

.demo-empty-state .empty-icon {
  margin-bottom: 16px;
  animation: empty-pulse 3s ease-in-out infinite;
}

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

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

.demo-empty-state p {
  font-size: 14px;
  color: var(--text-secondary);
  opacity: 0.7;
}

/* 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;
}

/* Celebration animation */
.celebration {
  position: relative;
}

.celebration::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: calc(var(--radius) + 4px);
  background: linear-gradient(
    135deg,
    var(--green),
    var(--blue-light),
    var(--blue)
  );
  z-index: -1;
  opacity: 0;
  animation: celebrate-glow 1.8s ease forwards;
}

@keyframes celebrate-glow {
  0% {
    opacity: 0;
  }
  30% {
    opacity: 0.18;
  }
  100% {
    opacity: 0;
  }
}

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

@media (max-width: 768px) {
  .hero {
    min-height: auto;
    padding: calc(var(--nav-height) + 20px) 16px 48px;
  }

  .hero .demo-body {
    min-height: min(44svh, 400px);
  }

  .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 br {
    display: none;
  }
  .hero-sub {
    font-size: 16px;
    margin-bottom: 28px;
  }
  .hero-badge {
    margin-bottom: 16px;
    font-size: 13px;
  }
  .demo-card {
    border-radius: 20px;
  }
  .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-code {
  margin-top: 16px;
  position: relative;
}

.step-code pre {
  background: color-mix(in srgb, var(--bg) 78%, var(--surface));
  color: var(--text);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 13px;
  text-align: left;
  overflow-x: auto;
  white-space: pre;
  border: 1px solid var(--border);
}

.step-code .copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font);
  transition:
    background 0.2s,
    color 0.2s;
}

.step-code .copy-btn:hover {
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
}
.step-code .copy-btn.copied {
  color: var(--green);
}

.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);
}

/* ============================================================
 Developer Signup
 ============================================================ */
.signup-section {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
}

.signup-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}

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

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

.signup-input {
  flex: 1;
  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;
}

.signup-input:focus {
  border-color: var(--blue);
}

.signup-input::placeholder {
  color: var(--text-secondary);
}

.signup-btn {
  padding: 14px 32px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: var(--glass-bg-prominent);
  color: #fff;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.2s,
    box-shadow 0.2s;
  white-space: nowrap;
  -webkit-backdrop-filter: var(--glass-saturate) blur(var(--glass-blur));
  backdrop-filter: var(--glass-saturate) blur(var(--glass-blur));
}

.signup-btn:hover {
  background: rgba(0, 122, 255, 0.7);
  box-shadow: 0 4px 20px rgba(0, 122, 255, 0.3);
}
.signup-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.signup-result {
  margin-top: 24px;
  padding: 20px;
  border-radius: var(--radius-sm);
  background: rgba(52, 199, 89, 0.06);
  border: 1px solid rgba(52, 199, 89, 0.2);
  text-align: left;
}

.signup-result[hidden] {
  display: none;
}

.signup-result h4 {
  color: var(--green);
  font-size: 16px;
  margin-bottom: 12px;
}

.signup-key {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  padding: 12px 16px;
  background: var(--surface);
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.signup-key button {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  font-family: var(--font);
}

.signup-snippet-label {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.signup-snippet {
  margin-top: 12px;
}

.signup-snippet pre {
  background: #1c1c1e;
  color: #f5f5f7;
  padding: 16px 20px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.6;
  overflow-x: auto;
}

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

/* ============================================================
 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 {
    background: linear-gradient(180deg, rgba(28, 28, 30, 0.9), rgba(28, 28, 30, 0.76));
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 28px 72px rgba(0, 0, 0, 0.32);
  }

  .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;
  }
}

/* ============================================================
TestFlight Smart App Banner
============================================================ */
.tf-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1001;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  background: rgba(250, 250, 250, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.12);
  animation: tf-slide-in 0.3s ease-out;
}

body[data-tf-banner] {
  padding-top: 52px;
}

body[data-tf-banner] .nav {
  top: 52px;
}

.tf-banner-close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  font-size: 20px;
  color: var(--text-secondary, #8e8e93);
  cursor: pointer;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.tf-banner-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.tf-banner-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.tf-banner-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.tf-banner-text strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #1d1d1f);
}

.tf-banner-text span {
  font-size: 11px;
  color: var(--text-secondary, #8e8e93);
}

.tf-banner-action {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 14px;
  border-radius: 14px;
  background: var(--accent, #007AFF);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.tf-banner-out {
  animation: tf-slide-out 0.25s ease-in forwards;
}

@keyframes tf-slide-in {
  from { transform: translateY(-100%); }
  to   { transform: translateY(0); }
}

@keyframes tf-slide-out {
  from { transform: translateY(0); }
  to   { transform: translateY(-100%); }
}

@media (prefers-color-scheme: dark) {
  .tf-banner {
    background: rgba(28, 28, 30, 0.82);
    border-bottom-color: rgba(255, 255, 255, 0.1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tf-banner,
  .tf-banner-out {
    animation: none;
  }
}

@media (min-width: 768px) {
  .tf-banner {
    display: none;
  }
  body[data-tf-banner] {
    padding-top: 0;
  }
  body[data-tf-banner] .nav {
    top: 0;
  }
}
