/* Prevent horizontal overflow on narrow viewports */
html, body {
  overflow-x: hidden;
}

:root {
  --font-display: Arial, "SF Pro Display", system-ui, -apple-system, sans-serif;
  --font-body: Arial, system-ui, sans-serif;

  --color-bg: #f5f7fa;
  --color-text: #160042;
  --color-text-muted: #6b7094;
  --color-accent: #642eff;
  --color-accent-light: rgba(100, 46, 255, 0.1);

  --trigger-circle-size: 280px;
  --stage-radius: 20px;
  --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Scoped box-sizing to demo only (avoid affecting Webflow) */
.demo-container *,
.demo-container *::before,
.demo-container *::after {
  box-sizing: border-box;
}

/* Standalone body styles (only apply when demo is loaded directly) */
body.demo-standalone {
  margin: 0;
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

/* When embedded in the homepage, the section wrapper replaces body centering */
.demo-section {
  background-color: #f5f7fa;
  padding: 92px 5%;
  border-bottom: 1px solid #e4e6f1;
  overflow: hidden;
}

.demo-section .demo-container {
  margin: 0 auto;
}

.demo-section-header {
  text-align: center;
  margin-bottom: 48px;
}

.demo-section-header h2 {
  font-size: 40px;
  line-height: 1.3;
  color: #160042;
  margin: 0 0 16px;
}

.demo-section-header p {
  font-size: 18px;
  line-height: 1.6;
  color: #6b7094;
  margin: 0;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Post-completion CTA */
.demo-cta {
  text-align: center;
  margin-top: 40px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.demo-cta.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.demo-cta a {
  display: inline-flex;
}

/* Tap trigger button (Play / Replay Demo) — styled but hidden by default */
.tap-trigger {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 36px;
  background: #1a1b1f;
  color: #fff;
  border: none;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  min-height: 48px;
  white-space: nowrap;
  transition: background 0.2s ease;
  /* Overlay on top of stage */
  position: absolute;
  z-index: 16;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Touch devices: show at idle for tap-to-start */
.touch-mode .tap-trigger {
  display: flex;
}

.tap-trigger:hover {
  background: #32343a;
}

.tap-trigger:active {
  background: #43464d;
}

.tap-trigger svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.touch-mode .trigger-area {
  display: none !important;
}

/* Simulated cursor for touch autoplay */
.simulated-cursor {
  position: absolute;
  width: 22px;
  height: 36px;
  z-index: 9;
  pointer-events: none;
  opacity: 0;
  filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, 0.35));
  transition: opacity 0.3s ease;
}

.simulated-cursor.is-visible {
  opacity: 1;
}

/* Click ripple effect */
.click-ripple {
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(100, 46, 255, 0.3);
  transform: translate(-50%, -50%) scale(0);
  pointer-events: none;
  z-index: 9;
  animation: rippleExpand 0.5s ease-out forwards;
}

@keyframes rippleExpand {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(2); opacity: 0; }
}

/* Radiating wave rings on dock icon click */
.click-wave-ring {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2.5px solid rgba(100, 46, 255, 0.8);
  background: transparent;
  transform: translate(-50%, -50%) scale(0);
  pointer-events: none;
  z-index: 9;
  animation: waveExpand 0.7s ease-out forwards;
}

@keyframes waveExpand {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 1;
    border-color: rgba(100, 46, 255, 0.9);
  }
  50% {
    opacity: 0.7;
    border-color: rgba(100, 46, 255, 0.6);
  }
  100% {
    transform: translate(-50%, -50%) scale(5);
    opacity: 0;
    border-color: rgba(100, 46, 255, 0.1);
  }
}

/* Mobile overlay */
.demo-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #160042;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.demo-overlay.is-open {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
  gap: 16px;
}

.demo-overlay .demo-container {
  width: 100%;
  max-width: 1140px;
}

.demo-overlay .demo-timeline,
.demo-overlay .step-instruction {
  color: rgba(255, 255, 255, 0.9);
}

.demo-overlay .step-instruction {
  color: rgba(255, 255, 255, 0.8);
}

.demo-overlay .timeline-step {
  color: rgba(255, 255, 255, 0.5);
}

.demo-overlay .timeline-step.is-active {
  color: rgba(255, 255, 255, 0.95);
}

.demo-overlay .timeline-step.is-complete {
  color: rgba(255, 255, 255, 0.95);
}

.demo-overlay .step-number {
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.5);
}

.demo-overlay-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: background 0.2s ease;
}

.demo-overlay-close:hover {
  background: rgba(255, 255, 255, 0.25);
}

.demo-overlay .demo-cta {
  color: white;
}

.demo-overlay .demo-cta a {
  background: #642eff;
  color: white;
  padding: 14px 32px;
  border-radius: 50px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  display: inline-block;
  transition: background 0.2s ease;
}

.demo-overlay .demo-cta a:hover {
  background: #7342ff;
}

/* ========================================
   Demo Container
   ======================================== */
.demo-container {
  width: 100%;
  max-width: 1140px;
  display: grid;
  gap: 0;
  position: relative;
}

.demo-container[data-state="active"],
.demo-container[data-state="step-1"],
.demo-container[data-state="step-2"],
.demo-container[data-state="step-3"],
.demo-container[data-state="complete"] {
  gap: 1.5rem;
}

/* ========================================
   Trigger Area (Initial State)
   ======================================== */
.trigger-area {
  position: absolute;
  inset: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3rem;
  padding: 2rem 3rem;
  background: rgba(0, 0, 0, 0.55);
  border-radius: var(--stage-radius);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.demo-container[data-state="active"] .trigger-area,
.demo-container[data-state="step-1"] .trigger-area,
.demo-container[data-state="step-2"] .trigger-area,
.demo-container[data-state="step-3"] .trigger-area,
.demo-container[data-state="complete"] .trigger-area {
  opacity: 0;
  pointer-events: none;
  position: absolute;
  transform: scale(0.95);
}

.trigger-copy {
  flex: 1;
  max-width: 400px;
}

.trigger-copy h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: #fff;
}

.trigger-copy p {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.75);
  margin: 0;
  line-height: 1.5;
}

/* Trigger Circle */
.trigger-circle {
  position: relative;
  width: var(--trigger-circle-size);
  height: var(--trigger-circle-size);
}

.circle-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.circle-track {
  stroke: rgba(255, 255, 255, 0.35);
  stroke-dasharray: 8 8;
}

.circle-progress {
  stroke: #fff;
  stroke-linecap: round;
  stroke-dasharray: 603;
  stroke-dashoffset: 603;
  transition: stroke-dashoffset 0.1s linear;
}

.demo-container[data-state="hovering"] .circle-track {
  stroke-dasharray: none;
  stroke: rgba(255, 255, 255, 0.25);
}

/* Circle Cursor */
.circle-cursor {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0.5;
  animation: cursorPulse 1.5s ease-in-out infinite;
  transition: opacity 0.2s ease;
}

.demo-container[data-state="hovering"] .circle-cursor {
  animation: none;
  opacity: 0;
}

@keyframes cursorPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.2; }
}

/* ========================================
   Timeline
   ======================================== */
.demo-timeline {
  opacity: 0;
  height: 0;
  overflow: hidden;
  transform: translateY(-10px);
  pointer-events: none;
  transition: opacity 0.4s ease 0.3s, transform 0.4s ease 0.3s, height 0.4s ease 0.3s;
}

.demo-container[data-state="active"] .demo-timeline,
.demo-container[data-state="step-1"] .demo-timeline,
.demo-container[data-state="step-2"] .demo-timeline,
.demo-container[data-state="step-3"] .demo-timeline,
.demo-container[data-state="complete"] .demo-timeline {
  opacity: 1;
  height: auto;
  overflow: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.demo-timeline ol {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  position: relative;
  color: var(--color-text-muted);
  transition: color var(--transition-smooth);
}

.timeline-step::after {
  content: "";
  position: absolute;
  right: -20px;
  width: 40px;
  height: 2px;
  background: #d1d1d6;
}

.timeline-step:last-child::after {
  display: none;
}

.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e8e8ed;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
  transition: background var(--transition-smooth), color var(--transition-smooth);
}

.step-label {
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
}

/* Active step */
.timeline-step.is-active {
  color: var(--color-text);
}

.timeline-step.is-active .step-number {
  background: var(--color-accent);
  color: white;
}

/* Completed step */
.timeline-step.is-complete {
  color: var(--color-text);
}

.timeline-step.is-complete .step-number {
  background: #34c759;
  color: white;
}

.timeline-step.is-complete .step-number::before {
  content: "✓";
  font-size: 0.75rem;
}

.timeline-step.is-complete .step-number span {
  display: none;
}

/* ========================================
   Step Instruction
   ======================================== */
.step-instruction {
  text-align: center;
  font-size: 1.1rem;
  color: var(--color-text);
  margin: 0;
  min-height: 0;
  height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 0.3s ease, transform 0.3s ease, height 0.3s ease;
}

.demo-container[data-state="step-1"] .step-instruction,
.demo-container[data-state="step-2"] .step-instruction,
.demo-container[data-state="step-3"] .step-instruction,
.demo-container[data-state="complete"] .step-instruction {
  opacity: 1;
  height: auto;
  min-height: 1.5em;
  overflow: visible;
  transform: translateY(0);
}

/* ========================================
   Desktop Stage
   ======================================== */
.desktop-stage {
  position: relative;
  border-radius: var(--stage-radius);
  background: linear-gradient(145deg, #2c2c2e, #1c1c1e);
  overflow: hidden;
  width: 1100px;
  max-width: 100%;
  height: 710px;
  isolation: isolate;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25);

  /* Stage is always visible; trigger overlay sits on top in idle */
  opacity: 1;
  transform: scale(1);
  transform-origin: center center;
  pointer-events: auto;
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), height 0.6s ease, box-shadow 0.6s ease;
}

/* Stage is visible in all states — no idle collapse needed */

/* macOS Menu Bar */
.menu-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 25px;
  padding: 0 10px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
  font-size: 13.5px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.95);
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(25px) saturate(180%);
  z-index: 10;
  letter-spacing: 0.01em;
}

.menu-bar-left {
  display: flex;
  align-items: center;
  gap: 0;
}

.menu-bar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.menu-item {
  padding: 0 11px;
  height: 25px;
  display: flex;
  align-items: center;
  cursor: default;
  border-radius: 4px;
  transition: background 0.1s ease;
}

.menu-item:hover {
  background: rgba(255, 255, 255, 0.15);
}

.menu-item.apple-logo {
  padding: 0 8px 0 6px;
}

.menu-item.apple-logo svg {
  display: block;
  fill: rgba(255, 255, 255, 0.92);
}

.menu-item.app-name {
  font-weight: 600;
}

.desktop-wallpaper {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(45, 45, 48, 0.3), rgba(28, 28, 30, 0.1)),
    url("wallpaper.webp") center / cover;
  z-index: 0;
}

/* ========================================
   App Window (Email Client)
   ======================================== */
.app-window {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: 880px;
  height: 520px;
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
  color: #1d1d1f;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 5;
  display: flex;
  flex-direction: column;
}

.app-window.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.window-titlebar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 14px;
  background: #f5f5f7;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.traffic-light {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.traffic-light.red { background: #ff5f57; }
.traffic-light.yellow { background: #febc2e; }
.traffic-light.green { background: #28c840; }

.window-title {
  margin-left: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1d1d1f;
}

/* Split view body */
.window-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Inbox sidebar */
.window-sidebar {
  width: 320px;
  background: #fafafa;
  border-right: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.sidebar-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1d1d1f;
}

.sidebar-badge {
  padding: 3px 10px;
  border-radius: 12px;
  background: var(--color-accent);
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
}

.window-list {
  display: flex;
  flex-direction: column;
  padding: 8px;
  gap: 2px;
  overflow-y: auto;
  flex: 1;
}

.window-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
  background: transparent;
  transition: background 0.15s ease;
  cursor: pointer;
}

.window-row:hover {
  background: rgba(0, 0, 0, 0.04);
}

.window-row.is-selected {
  background: var(--color-accent-light);
}

.row-unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-accent);
  margin-top: 6px;
  flex-shrink: 0;
}

.row-content {
  flex: 1;
  min-width: 0;
}

.window-row-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3px;
}

.row-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #1d1d1f;
}

.row-time {
  font-size: 0.7rem;
  color: #8e8e93;
  flex-shrink: 0;
}

.row-subject {
  font-size: 0.8rem;
  font-weight: 500;
  color: #1d1d1f;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-preview {
  font-size: 0.75rem;
  color: #8e8e93;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Preview pane */
.window-preview {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  overflow: hidden;
}

.preview-header {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.preview-subject {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1d1d1f;
  margin-bottom: 8px;
}

.preview-meta {
  display: flex;
  gap: 12px;
  font-size: 0.85rem;
}

.preview-sender {
  font-weight: 600;
  color: #1d1d1f;
}

.preview-date {
  color: #8e8e93;
}

.preview-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  font-size: 0.95rem;
  line-height: 1.65;
  color: #333;
}

.preview-body p {
  margin: 0 0 1em;
}

.preview-body p:last-child {
  margin-bottom: 0;
}

.preview-signature {
  margin-top: 1.5em;
  color: #6e6e73;
  font-style: italic;
}

/* ========================================
   Cursor Cluster
   ======================================== */
.cursor-cluster {
  position: absolute;
  top: 0;
  left: 0;
  transform: translate(-999px, -999px);
  pointer-events: none;
  z-index: 8;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.cursor-cluster.is-visible {
  opacity: 1;
}

.cluster-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cluster-time {
  display: flex;
  align-items: flex-start;
}

.time-value {
  font-family: "SF Pro Display", -apple-system, sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: #000;
  text-shadow:
    -2px -1px 0 #fff,
    2px -1px 0 #fff,
    -2px 1px 0 #fff,
    2px 1px 0 #fff,
    0 0 8px rgba(255, 255, 255, 0.8);
  line-height: 1;
}

.cluster-icons {
  display: flex;
  gap: 6px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.cluster-icons.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.cluster-icons.is-hidden {
  opacity: 0;
  transform: translateY(8px);
}

.cluster-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}

.cluster-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cluster-icon.is-pulsing {
  animation: iconPulse 0.4s ease-in-out alternate 3;
}

@keyframes iconPulse {
  from { transform: scale(1); }
  to { transform: scale(1.08); }
}

/* ========================================
   Dock
   ======================================== */
.dock {
  position: absolute;
  bottom: 13px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  opacity: 0;
  z-index: 6;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
}

.dock.is-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

@keyframes dockSlideOut {
  0% {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
  100% {
    transform: translateX(-50%) translateY(100px);
    opacity: 0;
  }
}

.dock.is-hidden {
  animation: dockSlideOut 0.4s ease-in forwards;
}

.dock-glass {
  position: absolute;
  inset: 32px -16px -8px -16px; /* Top 32px to hide bounce space, sides/bottom as before */
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.dock-icons {
  display: flex;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 40px 16px 8px 16px; /* 40px top for bounce space, 8px bottom */
  position: relative;
  overflow: visible; /* Allow bounce above container */
}

.dock-icon {
  width: 52px;
  height: 52px; /* Natural icon size */
  position: relative;
  cursor: pointer;
}

.dock-icon-inner {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  position: relative;
  transition: transform 0.2s ease;
}

.dock-icon:hover .dock-icon-inner {
  transform: translateY(-4px) scale(1.05);
}

.dock-icon-inner img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 12px;
}

.dock-icon.is-bouncing .dock-icon-inner {
  animation: dockBounce 0.6s ease-in-out infinite;
  transition: none;
}

@keyframes dockBounce {
  0%, 100% {
    transform: translateY(0) scaleY(1);
  }
  25% {
    transform: translateY(-28px) scaleY(1.02);
  }
  50% {
    transform: translateY(-32px) scaleY(1);
  }
  75% {
    transform: translateY(-28px) scaleY(0.98);
  }
}

.dock-badge {
  position: absolute;
  bottom: 36px; /* 52px icon height - 18px badge height + 2px overlap */
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #ff3b30;
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.dock-icon.has-badge .dock-badge {
  opacity: 1;
  transform: scale(1);
}

/* Badge overlay - positioned inside the Mail icon's dock-icon-inner */
.dock-badge-overlay {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #ff3b30;
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 10;
  pointer-events: none;
}

.dock-badge-overlay.is-visible {
  opacity: 1;
  transform: scale(1);
}

/* Dock indicator dot */
.dock-icon::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.dock-icon.is-running::after {
  opacity: 1;
}

/* ========================================
   Play Again Button
   ======================================== */
.play-again {
  position: absolute;
  top: 16px;
  left: 16px;
  transform: translateY(20px);
  padding: 12px 28px;
  border: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  z-index: 7;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s ease;
}

.play-again:hover {
  background: rgba(255, 255, 255, 1);
}

.play-again.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 1200px) {
  .desktop-stage {
    width: 100%;
    height: auto;
    min-height: 500px;
    aspect-ratio: 1100 / 710;
  }

  .app-window {
    width: 90%;
    max-width: 800px;
    height: auto;
    min-height: 400px;
  }
}

@media (max-width: 900px) {
  .trigger-area {
    flex-direction: column;
    text-align: center;
    gap: 2rem;
    padding: 1.5rem;
  }

  .trigger-copy {
    max-width: none;
  }

  :root {
    --trigger-circle-size: 220px;
  }

  .demo-timeline ol {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .timeline-step::after {
    display: none;
  }

  .app-window {
    flex-direction: column;
    height: auto;
    max-height: 85%;
  }

  .window-sidebar {
    width: 100%;
    max-height: 200px;
    border-right: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  }

  .window-preview {
    min-height: 250px;
    overflow-y: auto;
  }
}

@media (max-width: 767px) {
  .demo-section {
    padding: 60px 5%;
  }

  .demo-section-header h2 {
    font-size: 32px;
  }

  .demo-section-header p {
    font-size: 16px;
  }
}

@media (max-width: 600px) {
  body.demo-standalone {
    padding: 1rem;
  }

  :root {
    --trigger-circle-size: 180px;
  }

  .trigger-copy h2 {
    font-size: 1.4rem;
  }

  .step-label {
    display: none;
  }

  .step-instruction {
    font-size: 0.95rem;
    padding: 0 1rem;
  }
}
