:root {
  --primary: #178afb;
  --primary-dark: #0f6fd1;
  --dark: #19202c;
  --text: #19202c;
  --muted: #5b6678;
  --line: #dfe5ee;
  --bg: #f6f8fb;
  --card: #ffffff;
  --radius: 14px;
  --shadow: 0 18px 48px rgba(25, 32, 44, 0.16);
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 Inter, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

#demo {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px 20px;
}

h1, h2 {
  font-family: Archivo, Inter, system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}

header { text-align: center; margin-bottom: 20px; }
header h1 { font-size: clamp(1.25rem, 2.4vw, 1.75rem); line-height: 1.2; }
header p { margin: 6px 0 0; color: var(--muted); }

/* Stage holds the frame and the floating tooltip. */
.stage {
  position: relative;
  display: flex;
  justify-content: center;
}

.frame {
  position: relative;
  width: 100%;
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.frame-desktop {
  border: 1px solid var(--line);
  border-radius: 12px;
}

.frame-desktop .chrome {
  display: flex;
  gap: 6px;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  background: #eef1f5;
  border-bottom: 1px solid var(--line);
}

.frame-desktop .chrome i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #cfd6e0;
}

.frame-desktop .screen { aspect-ratio: 1440 / 900; }

.frame-phone {
  width: min(100%, 340px);
  padding: 12px;
  border-radius: 44px;
  background: var(--dark);
}

.frame-phone .chrome { display: none; }

.frame-phone .screen {
  aspect-ratio: 390 / 844;
  border-radius: 32px;
  overflow: hidden;
  background: #fff;
}

.screen { position: relative; }

.screen img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Hotspot: transparent box over the real control, with a pulsing ring. */
.hotspot {
  position: absolute;
  padding: 0;
  border: 2px solid var(--primary);
  border-radius: 8px;
  background: rgba(23, 138, 251, 0.12);
  cursor: pointer;
  animation: pulse 1.8s ease-out infinite;
}

.hotspot:focus-visible { outline: 3px solid var(--dark); outline-offset: 3px; }

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(23, 138, 251, 0.55); }
  70% { box-shadow: 0 0 0 14px rgba(23, 138, 251, 0); }
  100% { box-shadow: 0 0 0 0 rgba(23, 138, 251, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .hotspot { animation: none; box-shadow: 0 0 0 4px rgba(23, 138, 251, 0.35); }
}

/* Tooltip */
.tip {
  position: absolute;
  z-index: 2;
  width: 300px;
  padding: 18px 18px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.tip .count {
  margin: 0 0 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
}

.tip h2 { font-size: 1.1rem; line-height: 1.25; }
.tip h2 + p { margin: 8px 0 14px; color: var(--muted); font-size: 0.95rem; }

.tip-actions { display: flex; justify-content: space-between; gap: 8px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  font: 600 0.95rem/1 Inter, system-ui, sans-serif;
  text-decoration: none;
  cursor: pointer;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: #fff; color: var(--text); border-color: var(--line); }
.btn-secondary:hover { border-color: #b9c3d1; }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn:focus-visible, .dot:focus-visible, .link:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }

/* Progress dots */
.dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
}

.dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #c9d2de;
  cursor: pointer;
}

.dot[aria-current] { background: var(--primary); width: 26px; border-radius: 5px; }

/* Closing call to action */
.cta {
  width: 100%;
  max-width: 640px;
  padding: 48px 32px;
  text-align: center;
  background: var(--dark);
  color: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.cta h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
.cta p { margin: 10px auto 24px; max-width: 30em; color: #c4cbd6; }
.cta-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

.link {
  margin-top: 20px;
  padding: 4px;
  border: 0;
  background: none;
  color: #c4cbd6;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.error { text-align: center; padding: 48px 0; color: var(--muted); }
.error a { color: var(--primary); font-weight: 600; }

/* Narrow: tooltip sits under the frame instead of floating. */
@media (max-width: 719px) {
  #demo { padding-top: 16px; }
  .stage { flex-direction: column; align-items: center; gap: 14px; }
  .tip { position: static; width: 100%; max-width: 420px; box-shadow: none; }
  .frame-phone { width: min(100%, 300px); }
  .frame-desktop .chrome { height: 20px; }
  .frame-desktop .chrome i { width: 7px; height: 7px; }
  .cta { padding: 32px 20px; }
}
