:root {
  /* Glimeo brand palette — violet #7C3AED (see sites/glimeo/assets/glimeo.css) */
  --bg: #0a0a0f;
  --surface: #121217;
  --border: rgba(255, 255, 255, 0.1);
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --accent: #7c3aed;
  --accent-2: #a78bfa;
  --accent-glow: rgba(124, 58, 237, 0.5);
  --radius: 12px;
  --aspect: 56.25%;
  --chrome-h: 44px;
  --topnav-h: 42px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body.embed-mode .page-header,
body.embed-mode .embed-note { display: none; }
/* Embeds get a fixed host frame, so the demo fills it exactly instead of deriving
   its height from width — otherwise the iframe grows a scrollbar. */
body.embed-mode { overflow: hidden; }
body.embed-mode .page {
  max-width: none;
  padding: 0;
  height: 100vh;
}
body.embed-mode .demo-wrap {
  height: 100%;
  padding-bottom: 0;
  border-radius: 0;
  box-shadow: none;
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  text-decoration: none;
}
.brand img { width: 28px; height: 28px; }
.cta-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), #6d28d9);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.cta-link:hover { filter: brightness(1.06); }

.demo-wrap {
  position: relative;
  width: 100%;
  padding-bottom: calc(var(--aspect) + var(--chrome-h) + var(--topnav-h));
  height: 0;
  border-radius: calc(var(--radius) + 4px);
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--border), 0 24px 80px rgba(0, 0, 0, 0.55);
  background: var(--surface);
  container-type: inline-size;
  container-name: demo;
}

.demo-topnav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topnav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 12px;
  background: rgba(14, 14, 19, 0.98);
  border-bottom: 1px solid var(--border);
  z-index: 6;
}
.topnav-btns { display: flex; gap: 6px; align-items: center; }
.topnav-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.topnav-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent-2);
  background: rgba(124, 58, 237, 0.18);
}
.topnav-btn:disabled { opacity: 0.32; cursor: default; }
.topnav-btn .arrow { font-size: 14px; line-height: 1; }
.topnav-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.demo-stage {
  position: absolute;
  top: var(--topnav-h);
  left: 0;
  right: 0;
  bottom: var(--chrome-h);
  background: #0d0d12;
  container-type: inline-size;
  container-name: stage;
}
.demo-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.22, 0.61, 0.36, 1);
  transform: scale(0.98);
}
.demo-slide.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
  z-index: 2;
}
.demo-slide.is-leaving {
  opacity: 0;
  transform: scale(1.02);
}
.slide-fit {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.72s cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: transform;
}
.slide-fit img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}
.slide-overlays {
  position: absolute;
  pointer-events: none;
}
.slide-overlays > * { pointer-events: auto; }
/* Tooltip is chrome, not scene: it lives outside .slide-fit so camera zoom can't scale it. */
.demo-slide > .tooltip { pointer-events: auto; }

.hotspot {
  position: absolute;
  border: 2px solid var(--accent-2);
  background: rgba(124, 58, 237, 0.16);
  box-shadow: 0 0 0 0 var(--accent-glow);
  cursor: pointer;
  animation: pulse 2.2s ease-in-out infinite;
  z-index: 3;
  padding: 0;
}
.hotspot--pill { border-radius: 999px; }
.hotspot--rect { border-radius: var(--hs-radius, 10px); }
.hotspot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  border: 1px solid rgba(167, 139, 250, 0.4);
  pointer-events: none;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); }
  50% { box-shadow: 0 0 0 8px rgba(124, 58, 237, 0); }
}

.tooltip {
  --tip-title: clamp(12px, 3.6cqw, 17px);
  --tip-body: clamp(11px, 2.9cqw, 13.5px);
  position: absolute;
  z-index: 4;
  display: flex;
  flex-direction: column;
  max-height: min(58cqh, 64%);
  width: min(34cqw, 320px);
  /* Floor keeps the card readable inside small embeds without bloating large ones. */
  min-width: min(230px, 40cqw);
  padding: 11px 13px 9px;
  border-radius: var(--radius);
  background: linear-gradient(155deg, rgba(124, 58, 237, 0.97), rgba(76, 29, 149, 0.96));
  color: #fff;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(167, 139, 250, 0.25);
  backdrop-filter: blur(8px);
}
.tooltip--compact { width: min(31cqw, 290px); }
.tooltip--wide { width: min(36cqw, 360px); }

.tooltip-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 3px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
}
.tooltip-scroll::-webkit-scrollbar { width: 4px; }
.tooltip-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
}
.tooltip h2 {
  font-size: var(--tip-title);
  line-height: 1.28;
  font-weight: 700;
  margin-bottom: 5px;
  letter-spacing: -0.01em;
}
.tooltip-kicker {
  font-size: clamp(9px, 2.2cqw, 11px);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.82;
  margin-bottom: 4px;
}
.tooltip p {
  font-size: var(--tip-body);
  line-height: 1.45;
  opacity: 0.94;
}
.tooltip-foot {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
  padding-top: 7px;
}
.tooltip-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 8px;
  background: #fff;
  color: var(--accent);
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
  transition: transform 0.15s ease;
}
.tooltip-cta:hover { transform: translateX(2px); }
.tooltip--body-only h2 { display: none; }
.tooltip.is-tight { --tip-body: clamp(10px, 2.6cqw, 12px); }
.tooltip.is-tighter { --tip-body: clamp(9.5px, 2.4cqw, 11px); }

.demo-chrome {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--chrome-h);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 14px;
  background: rgba(14, 14, 19, 0.97);
  border-top: 1px solid var(--border);
  z-index: 5;
}
.dots {
  display: flex;
  gap: 4px;
  align-items: center;
  width: min(280px, 72%);
}
.progress-seg {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  border: none;
  padding: 0;
  cursor: pointer;
  background: rgba(148, 163, 184, 0.22);
  transition: background 0.25s ease, transform 0.2s ease;
}
.progress-seg.is-done { background: rgba(124, 58, 237, 0.6); }
.progress-seg.is-active {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleY(1.35);
}
.progress-seg:hover { background: rgba(167, 139, 250, 0.6); }

/* Legacy dot fallback */
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.35);
  border: none;
  padding: 0;
  cursor: pointer;
}
.dot.is-active { background: var(--accent); }
.dot:hover { background: var(--accent-2); }

.embed-note {
  margin-top: 16px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}
.embed-note code {
  font-size: 12px;
  background: rgba(255,255,255,0.06);
  padding: 2px 6px;
  border-radius: 4px;
}

@container stage (max-width: 760px) {
  .tooltip {
    --tip-title: clamp(11px, 3.4cqw, 15px);
    --tip-body: clamp(9.5px, 2.7cqw, 12px);
    padding: 9px 11px 8px;
  }
  .tooltip-kicker { font-size: clamp(8px, 2cqw, 10px); }
  .tooltip-cta { width: 26px; height: 26px; font-size: 13px; }
}

/* Only when the stage is genuinely phone-sized: full-bleed the tooltip. */
@container stage (max-width: 440px) {
  .tooltip {
    max-height: 46%;
    width: auto !important;
    left: 6px !important;
    right: 6px !important;
  }
}
@container stage (max-width: 560px) {
  .topnav-btn span.lbl { display: none; }
}

body.calibrate-mode .hotspot {
  animation: none;
  cursor: move;
  border-color: #fbbf24;
  background: rgba(251, 191, 36, 0.15);
}
body.calibrate-mode .hotspot::after { border-color: rgba(251, 191, 36, 0.5); }
.calibrate-bar {
  display: none;
  position: absolute;
  top: var(--topnav-h);
  left: 0;
  right: 0;
  z-index: 7;
  padding: 6px 10px;
  background: rgba(251, 191, 36, 0.12);
  border-bottom: 1px solid rgba(251, 191, 36, 0.35);
  font-size: 11px;
  color: #fde68a;
  line-height: 1.4;
}
body.calibrate-mode .calibrate-bar { display: block; }
body.calibrate-mode .demo-stage { top: calc(var(--topnav-h) + 72px); }
body.calibrate-mode .demo-wrap {
  padding-bottom: calc(var(--aspect) + var(--chrome-h) + var(--topnav-h) + 72px);
}
.calibrate-bar code {
  font-size: 10px;
  color: #fef3c7;
  word-break: break-all;
}
.calibrate-bar button {
  margin-top: 4px;
  margin-right: 6px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(251, 191, 36, 0.5);
  background: rgba(0, 0, 0, 0.3);
  color: #fde68a;
  font-size: 11px;
  cursor: pointer;
}
.calibrate-bar .cal-btn-save {
  border-color: rgba(167, 139, 250, 0.7);
  background: rgba(124, 58, 237, 0.28);
  color: #ede9fe;
  font-weight: 600;
}
.calibrate-bar .cal-save-hint {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  color: rgba(253, 230, 138, 0.85);
}
.hs-handle {
  display: none;
  position: absolute;
  width: 10px;
  height: 10px;
  background: #fbbf24;
  border: 1px solid #000;
  border-radius: 2px;
  z-index: 5;
  cursor: nwse-resize;
}
body.calibrate-mode .hs-handle { display: block; }
.hs-handle.se { right: -5px; bottom: -5px; cursor: se-resize; }
body.calibrate-mode .tooltip { opacity: 0.35; pointer-events: none; }
body.calibrate-mode.calibrate-tooltips .tooltip {
  opacity: 1;
  pointer-events: auto;
  cursor: move;
  outline: 2px solid #fbbf24;
  outline-offset: 2px;
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.35);
}
body.calibrate-mode.calibrate-tooltips .hotspot {
  animation: none;
  opacity: 0.35;
  pointer-events: none;
}
body.calibrate-mode .slide-overlays { cursor: crosshair; }
body.calibrate-mode.calibrate-tooltips .slide-overlays { cursor: default; }
.cal-target-btn {
  margin-right: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(251, 191, 36, 0.5);
  background: rgba(0, 0, 0, 0.3);
  color: #fde68a;
  font-size: 11px;
  cursor: pointer;
}
.cal-target-btn.is-active {
  background: rgba(251, 191, 36, 0.35);
  color: #fffbeb;
}
.cal-draw-preview {
  display: none;
  position: absolute;
  border: 2px dashed #fbbf24;
  background: rgba(251, 191, 36, 0.1);
  pointer-events: none;
  z-index: 4;
}
body.calibrate-mode .cal-draw-preview.is-active { display: block; }

/* Animated cursor */
.demo-cursor {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  z-index: 8;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.65s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.demo-cursor.is-visible { opacity: 1; }
.demo-cursor__pointer {
  position: absolute;
  left: -2px;
  top: -2px;
  width: 22px;
  height: 22px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M5 3l14 9.5-6.2 1.4L9.8 20 5 3z' fill='%23fff' stroke='%23041018' stroke-width='1.5' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
}
.demo-cursor__ripple {
  position: absolute;
  left: 4px;
  top: 4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(167, 139, 250, 0.85);
  opacity: 0;
  transform: scale(0.4);
}
.demo-cursor.is-clicking .demo-cursor__ripple {
  animation: cursorRipple 0.55s ease-out;
}

@keyframes cursorRipple {
  0% { opacity: 0.9; transform: scale(0.35); }
  100% { opacity: 0; transform: scale(1.8); }
}

/* End CTA card */
.demo-outro {
  position: absolute;
  inset: 0;
  z-index: 9;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(10, 10, 15, 0.62);
  backdrop-filter: blur(6px);
  animation: outroIn 0.5s ease;
}
.demo-outro[hidden] { display: none !important; }
.demo-outro__card {
  max-width: 360px;
  width: 100%;
  padding: 22px 24px;
  border-radius: 16px;
  background: rgba(22, 22, 28, 0.94);
  border: 1px solid rgba(167, 139, 250, 0.28);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  text-align: center;
}
.demo-outro__kicker {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-2);
  margin-bottom: 8px;
}
.demo-outro__headline {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 8px;
  color: var(--text);
}
.demo-outro__sub {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 18px;
  line-height: 1.45;
}
.demo-outro__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}
.demo-outro__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #6d28d9);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
}
.demo-outro__cta:hover { filter: brightness(1.06); }
.demo-outro__replay {
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}
.demo-outro__replay:hover { color: var(--accent-2); }

@keyframes outroIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .slide-fit,
  .demo-slide,
  .demo-cursor {
    transition: none !important;
  }
  .demo-cursor { display: none; }
  .demo-outro { animation: none; }
}
