/* ── Interactive Homepage Demo ────────────────────────────────────────────────
   A guided, fully scripted client-side walkthrough of a real focus session —
   mirrors the actual Quick Launch card, active-session page, and distraction
   overlay (dashboard.css / flow.css classes) so it reads as "this is
   literally what happens," not an invented mockup. No backend calls, no AI,
   no cost, nothing that can be abused on a public page. */

.demo-section {
  padding: clamp(3rem, 8vw, 5rem) clamp(1rem, 4vw, 2.5rem) clamp(2rem, 6vw, 3.5rem);
}

.demo-section-sub {
  color: var(--muted);
  max-width: 56ch;
  margin: 0.75rem auto 0;
}

.demo-stage {
  max-width: 760px;
  margin: 2.5rem auto 0;
}

/* Control bar (play button) */
.demo-control-bar {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.demo-play-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  white-space: nowrap;
  font-size: 1.05rem;
  padding: 1rem 2.25rem;
}

/* Guided step caption — deliberately loud: this is the thing telling the
   viewer what they're watching, so it needs to win against the browser
   mockup below it, not blend into the background. */
.demo-step-caption {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.4rem;
  margin-bottom: 1rem;
  background: rgba(224, 86, 253, 0.14);
  border: 2px solid rgba(224, 86, 253, 0.45);
  border-radius: var(--radius-lg);
  box-shadow: 0 0 30px rgba(224, 86, 253, 0.15);
}

.demo-step-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 800;
}

.demo-step-text {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.demo-progress-dots {
  margin: 0 0 1.25rem;
}

.demo-progress-dots .split-dot {
  width: 10px;
  height: 10px;
}

/* Fake browser window */
.demo-browser {
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid rgba(123, 47, 190, 0.3);
  box-shadow: 0 20px 60px rgba(6,0,15,0.5), 0 0 60px rgba(123,47,190,0.12);
  background: rgba(17, 8, 32, 0.85);
}

.demo-browser-topbar {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.7rem 1rem;
  background: rgba(0,0,0,0.3);
  border-bottom: 1px solid rgba(123,47,190,0.2);
}

.demo-browser-dots {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

.demo-browser-dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
}

.demo-tab-strip {
  display: flex;
  gap: 0.4rem;
  flex: 1;
  min-width: 0;
}

.demo-tab {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  font-size: 0.72rem;
  color: var(--muted);
  background: rgba(255,255,255,0.03);
  border: 1px solid transparent;
  max-width: 160px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: background 200ms ease, color 200ms ease;
}

.demo-tab.active {
  background: rgba(123,47,190,0.18);
  color: var(--text);
  border-color: rgba(224,86,253,0.25);
}

.demo-tab-favicon {
  flex-shrink: 0;
  display: inline-flex;
}

/* Browser body / stage for the screens */
.demo-browser-body {
  position: relative;
  min-height: 420px;
  padding: clamp(1.5rem, 5vw, 2.5rem);
  display: flex;
  align-items: center;
  justify-content: center;
}

.demo-screen {
  width: 100%;
  text-align: center;
}

/* Mini Quick Launch replica (setup screen) */
.demo-mini-quick-launch {
  max-width: 360px;
  margin: 0 auto;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.demo-mini-quick-launch .quick-launch-header {
  margin-bottom: 0;
}

.demo-fake-textarea {
  min-height: 3.2rem;
  padding: 0.7rem 0.9rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(123,47,190,0.3);
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: var(--text);
  text-align: left;
}

.demo-caret {
  display: inline-block;
  width: 1px;
  height: 1em;
  background: var(--accent);
  vertical-align: middle;
  margin-left: 1px;
  animation: demo-caret-blink 0.9s step-end infinite;
}

@keyframes demo-caret-blink {
  50% { opacity: 0; }
}

.demo-mini-quick-launch .ql-launch-btn {
  width: 100%;
  transition: transform 120ms ease;
}

.demo-mini-quick-launch .ql-launch-btn.demo-btn-pressed {
  transform: scale(0.96);
}

/* Active-session replica */
.demo-eyebrow {
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.demo-timer-display {
  font-size: clamp(1.5rem, 5vw, 1.9rem) !important;
}

.demo-points-wrap {
  max-width: 280px;
  margin: 0 auto;
}

/* "Working in a document" replica — the tab the user is actually in while
   TaskGalaxy watches quietly from the corner HUD below, instead of the whole
   tab being taken over by the TaskGalaxy app UI. */
.demo-doc-focus {
  max-width: 420px;
  margin: 0 auto 0.85rem;
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
}

.demo-doc-focus span {
  color: var(--text);
  font-weight: 600;
}

.demo-doc {
  max-width: 420px;
  margin: 0 auto;
  text-align: left;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(123,47,190,0.25);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.demo-doc-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 0.9rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid rgba(123,47,190,0.2);
}

.demo-doc-body {
  padding: 1rem 1.1rem 1.4rem;
  min-height: 5.5rem;
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--muted);
}

.demo-work-hud {
  max-width: 420px;
  margin: 1rem auto 0;
  padding: 0.75rem 0.9rem;
  background: rgba(17, 8, 32, 0.7);
  border: 1px solid rgba(224,86,253,0.25);
  border-radius: var(--radius-lg);
  box-shadow: 0 0 30px rgba(123,47,190,0.1);
}

.demo-work-hud-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.demo-work-hud-timer {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
}

/* Tab 2 fake site content — a TikTok-style vertical video feed */
.demo-fake-tiktok {
  max-width: 200px;
  margin: 0 auto;
  text-align: center;
}

.demo-fake-tiktok-header {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

.demo-fake-tiktok-video {
  width: 160px;
  height: 240px;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, rgba(123,47,190,0.35), rgba(224,86,253,0.2) 60%, rgba(0,0,0,0.4));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: rgba(255,255,255,0.7);
}

.demo-fake-site-line {
  height: 9px;
  border-radius: 99px;
  background: rgba(255,255,255,0.08);
  margin-bottom: 0.6rem;
}

/* Distraction overlay replica — mirrors the real extension overlay */
.demo-distraction-overlay {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(5, 0, 13, 0.92);
  backdrop-filter: blur(12px);
  animation: fade-in 0.25s ease forwards;
  z-index: 10;
}

.demo-distraction-modal {
  max-width: 320px;
  padding: clamp(1.75rem, 5vw, 2.25rem) clamp(1.5rem, 4vw, 2rem);
  background: rgba(12, 4, 24, 0.99);
  border: 1px solid rgba(224, 86, 253, 0.3);
  border-radius: var(--radius-xl);
  box-shadow: 0 0 60px rgba(224,86,253,0.18);
}

.demo-distraction-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  background: linear-gradient(135deg, rgba(123,47,190,0.3), rgba(224,86,253,0.22));
  border: 1px solid rgba(224,86,253,0.4);
}

.demo-distraction-modal h3 {
  font-size: 1.15rem;
  margin-bottom: 0.6rem;
}

.demo-distraction-modal p {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 auto 0.5rem;
}

.demo-distraction-backlink {
  font-size: 0.72rem !important;
  color: var(--subtle) !important;
}

.demo-distraction-cta {
  margin-top: 0.75rem;
  width: 100%;
  padding: 0.7rem 1rem;
  border: none;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: default;
}

/* Animated fake cursor */
.demo-cursor {
  position: absolute;
  top: 0;
  left: 0;
  width: 20px;
  height: 20px;
  pointer-events: none;
  z-index: 20;
  opacity: 0;
  transition: transform 0.9s cubic-bezier(0.4,0,0.2,1), opacity 0.3s ease;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,0.6));
}

.demo-cursor svg { width: 100%; height: 100%; display: block; }

.demo-cursor::after {
  content: '';
  position: absolute;
  top: 10px;
  left: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(224,86,253,0.55);
  transform: scale(0);
  opacity: 0;
}

.demo-cursor.demo-cursor-click::after {
  animation: demo-click-pulse 0.5s ease-out;
}

@keyframes demo-click-pulse {
  0%   { transform: scale(0.3); opacity: 0.9; }
  100% { transform: scale(2.4); opacity: 0; }
}

/* Points penalty flash (shared numeric flash used by the points display) */
.demo-points-penalty {
  animation: demo-points-flash 0.6s ease;
}

@keyframes demo-points-flash {
  0%   { color: var(--danger); transform: scale(1.25); }
  100% { color: var(--accent); transform: scale(1); }
}

/* Complete screen */
.demo-complete-title { font-size: 1.4rem !important; }
.demo-complete-points { font-size: 2.6rem !important; }

/* Post-demo actions */
.demo-actions {
  display: none;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .demo-browser-body { min-height: 460px; }
  .demo-tab { max-width: 110px; }
}
