/* ==========================================================================
   UI Animations & Motion Lab Stylesheet (animations.css)
   u-muu.com Design System compliant (Dark Minimalist / Swiss Style)
   ========================================================================== */

:root {
  --motion-scale: 1;
}

html[data-anim-speed="2"] {
  --motion-scale: 0.5;
}

html[data-anim-speed="1"] {
  --motion-scale: 1;
}

html[data-anim-speed="0.5"] {
  --motion-scale: 2;
}

html[data-anim-speed="0.25"] {
  --motion-scale: 4;
}

/* Global Animation Pause */
html[data-motion-paused="true"] .anim-stage,
html[data-motion-paused="true"] .anim-stage *,
html[data-motion-paused="true"] .anim-stage *::before,
html[data-motion-paused="true"] .anim-stage *::after {
  animation-play-state: paused !important;
}

/* Reduced Motion Simulator & OS Preference */
html[data-reduced-motion="true"] .anim-stage,
html[data-reduced-motion="true"] .anim-stage *,
html[data-reduced-motion="true"] .anim-stage *::before,
html[data-reduced-motion="true"] .anim-stage *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}

@media (prefers-reduced-motion: reduce) {
  .anim-stage,
  .anim-stage *,
  .anim-stage *::before,
  .anim-stage *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --------------------------------------------------------------------------
   Top Header Bar
   -------------------------------------------------------------------------- */
.anim-topbar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  position: relative;
  z-index: 10;
}

.anim-topbar-brand {
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.anim-topbar-path {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-weight: 400;
  padding: 0.15rem 0.45rem;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
}

.anim-topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.anim-topbar-link {
  display: inline-flex;
  align-items: center;
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  transition: color var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
}

.anim-topbar-link:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background: var(--bg-card-hover);
}

/* --------------------------------------------------------------------------
   Page Container & Breadcrumb
   -------------------------------------------------------------------------- */
.animations-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.5rem 1.5rem 5rem;
  position: relative;
  z-index: 2;
}

.sc-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}

.sc-breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
  position: relative;
  padding-bottom: 2px;
  transition: color var(--transition-fast);
}

.sc-breadcrumb a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--text-primary);
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.sc-breadcrumb a:hover {
  color: var(--text-primary);
}

.sc-breadcrumb a:hover::after {
  width: 100%;
}

.sc-breadcrumb-sep {
  color: var(--text-tertiary);
  font-size: 0.75rem;
}

.sc-breadcrumb-current {
  color: var(--text-primary);
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   Hero Section
   -------------------------------------------------------------------------- */
.anim-hero {
  margin-bottom: 2.25rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.anim-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  margin-bottom: 1rem;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--pulse-dot-bg);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--pulse-dot-bg);
  animation: pulseGlow 2s infinite ease-in-out;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.anim-title {
  font-size: clamp(1.9rem, 4vw, 2.55rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  line-height: 1.18;
}

.anim-desc {
  font-size: 0.98rem;
  color: var(--text-secondary);
  max-width: 740px;
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.anim-stats-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.anim-stat-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.84rem;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
}

.anim-stat-item svg {
  color: var(--text-primary);
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Sticky Motion Lab Toolbar
   -------------------------------------------------------------------------- */
.anim-toolbar {
  position: sticky;
  top: 0.85rem;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  background: rgba(18, 18, 21, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.2rem;
  margin-bottom: 2.75rem;
  box-shadow: var(--shadow-md);
}

.toolbar-top {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.search-box {
  position: relative;
  flex: 1;
}

.search-box svg {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
}

.search-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.85rem 0.55rem 2.3rem;
  font-size: 0.875rem;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  font-family: inherit;
}

.search-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08);
}

.search-shortcut-hint {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.68rem;
  font-family: var(--font-mono);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  color: var(--text-tertiary);
  pointer-events: none;
}

.motion-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.customizer-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  flex-wrap: wrap;
}

.customizer-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.customizer-pill-group {
  display: flex;
  gap: 3px;
  background: var(--bg-card);
  padding: 2px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.customizer-opt-btn {
  background: transparent;
  border: none;
  font-size: 0.72rem;
  color: var(--text-secondary);
  padding: 0.22rem 0.52rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-mono);
}

.customizer-opt-btn:hover {
  color: var(--text-primary);
}

.customizer-opt-btn.active {
  background: var(--bg-subtle);
  color: var(--text-primary);
  font-weight: 600;
}

.playback-btn-group {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.ctrl-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-family: var(--font-mono);
  padding: 0.26rem 0.6rem;
  border-radius: 5px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.ctrl-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background: var(--bg-card-hover);
}

.ctrl-btn.active {
  background: var(--accent-solid);
  color: var(--accent-invert);
  border-color: var(--accent-solid);
  font-weight: 600;
}

.accent-color-pills {
  display: flex;
  gap: 6px;
  align-items: center;
}

.accent-pill {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
  padding: 0;
}

.accent-pill:hover {
  transform: scale(1.2);
}

.accent-pill.active {
  border-color: #ffffff;
  transform: scale(1.15);
  box-shadow: 0 0 8px currentColor;
}

.category-nav {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  padding-top: 0.3rem;
  scrollbar-width: none;
}

.category-nav::-webkit-scrollbar {
  display: none;
}

.cat-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
  font-family: inherit;
}

.cat-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.cat-btn.active {
  color: var(--accent-invert);
  background: var(--accent-solid);
  font-weight: 600;
}

/* Empty State */
.anim-empty-state {
  text-align: center;
  padding: 3.5rem 1.5rem;
  background: var(--bg-card);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  margin-bottom: 3rem;
}

.anim-empty-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.anim-empty-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1.2rem;
}

/* --------------------------------------------------------------------------
   Section & Card Layout
   -------------------------------------------------------------------------- */
.anim-section {
  margin-bottom: 3.75rem;
  scroll-margin-top: 120px;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.7rem;
  margin-bottom: 1.4rem;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.section-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.section-num {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  color: var(--text-tertiary);
  font-weight: 600;
}

.anim-section-title {
  font-size: 1.28rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.component-count {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}

.anim-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.4rem;
}

@media (max-width: 640px) {
  .anim-grid {
    grid-template-columns: 1fr;
  }
  .search-shortcut-hint {
    display: none;
  }
  .anim-topbar-link {
    display: none;
  }
}

.anim-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  position: relative;
}

.anim-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.card-header {
  padding: 1rem 1.2rem 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  background: rgba(255, 255, 255, 0.01);
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.card-title {
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--text-primary);
}

.card-header-actions {
  display: flex;
  gap: 0.32rem;
  align-items: center;
  flex-shrink: 0;
}

.card-badge {
  font-size: 0.66rem;
  font-family: var(--font-mono);
  padding: 0.14rem 0.45rem;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.card-replay-btn,
.card-code-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.14rem 0.44rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.card-replay-btn:hover,
.card-code-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.06);
}

.card-desc {
  font-size: 0.79rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.anim-stage {
  padding: 1.4rem 1.2rem;
  background-color: var(--bg-surface);
  background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 16px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.95rem;
  min-height: 205px;
  position: relative;
  overflow: hidden;
}

.card-footer-meta {
  padding: 0.55rem 1.15rem;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  background: rgba(0, 0, 0, 0.22);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-tertiary);
}

.stage-helper-text {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  text-align: center;
  font-family: var(--font-mono);
}

.anim-action-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-size: 0.75rem;
  font-family: var(--font-mono);
  padding: 0.38rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.anim-action-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-solid);
}

.anim-action-btn:active {
  transform: scale(0.97);
}

.stage-pill-row {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: center;
}

.stage-pill {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.24rem 0.55rem;
  border-radius: 5px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.stage-pill:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.stage-pill.active {
  background: var(--accent-solid);
  color: var(--accent-invert);
  border-color: var(--accent-solid);
  font-weight: 600;
}

/* ==========================================================================
   CATEGORY 01: ENTRANCE & TRANSITIONS
   ========================================================================== */

/* 1. Staggered Cascade */
.demo-stagger-list {
  width: 100%;
  max-width: 270px;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.demo-stagger-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.65rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  opacity: 0;
  transform: translateY(12px);
  filter: blur(4px);
}

.demo-stagger-list.is-playing .demo-stagger-row {
  animation: staggerEnter calc(0.45s * var(--motion-scale)) cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: calc(var(--i) * 75ms * var(--motion-scale));
}

@keyframes staggerEnter {
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

.stagger-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-solid);
  flex-shrink: 0;
}

.stagger-line {
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.16);
}
.stagger-line.w-sm { width: 42%; }
.stagger-line.w-md { width: 58%; }
.stagger-line.w-lg { width: 70%; }
.stagger-line.w-xl { width: 82%; }

.stagger-tag {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  color: var(--text-tertiary);
}

/* 2. Clip-Path Reveal */
.demo-clip-box {
  width: 100%;
  max-width: 270px;
  height: 98px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: clip-path calc(0.65s * var(--motion-scale)) cubic-bezier(0.77, 0, 0.175, 1),
              opacity calc(0.35s * var(--motion-scale)) ease;
}

.demo-clip-box[data-clip-dir="bottom"]:not(.is-revealed) {
  clip-path: inset(100% 0 0 0);
}
.demo-clip-box[data-clip-dir="left"]:not(.is-revealed) {
  clip-path: inset(0 100% 0 0);
}
.demo-clip-box[data-clip-dir="circle"]:not(.is-revealed) {
  clip-path: circle(0% at 50% 50%);
}
.demo-clip-box.is-revealed {
  clip-path: inset(0 0 0 0);
}
.demo-clip-box[data-clip-dir="circle"].is-revealed {
  clip-path: circle(85% at 50% 50%);
}

.demo-clip-inner {
  text-align: center;
  transform: scale(1.12);
  transition: transform calc(0.65s * var(--motion-scale)) cubic-bezier(0.16, 1, 0.3, 1);
}

.demo-clip-box.is-revealed .demo-clip-inner {
  transform: scale(1);
}

.demo-clip-kicker {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--accent-solid);
  letter-spacing: 0.12em;
  margin-bottom: 0.25rem;
}

.demo-clip-headline {
  font-size: 1rem;
  color: var(--text-primary);
  font-weight: 700;
}

/* 3. 3D Flip Card */
.demo-flip-scene {
  width: 240px;
  height: 112px;
  perspective: 900px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.demo-flip-card {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform calc(0.65s * var(--motion-scale)) cubic-bezier(0.34, 1.56, 0.64, 1);
}

.demo-flip-scene.is-flipped .demo-flip-card {
  transform: rotateY(180deg);
}

.demo-flip-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.75rem;
}

.demo-flip-back {
  transform: rotateY(180deg);
  background: linear-gradient(145deg, #1e1e24, #141418);
  border-color: var(--accent-solid);
}

.flip-chip {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  background: var(--bg-subtle);
  color: var(--accent-solid);
}

.demo-flip-face strong {
  font-size: 0.88rem;
  color: var(--text-primary);
}

.flip-sub {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-tertiary);
}

/* 4. CSS Grid Expand */
.demo-grid-accordion {
  width: 100%;
  max-width: 280px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.demo-grid-trigger {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.75rem 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-family: inherit;
}

.demo-grid-chevron {
  transition: transform calc(0.35s * var(--motion-scale)) cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--text-secondary);
}

.demo-grid-accordion.is-open .demo-grid-chevron {
  transform: rotate(180deg);
}

.demo-grid-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows calc(0.38s * var(--motion-scale)) cubic-bezier(0.16, 1, 0.3, 1);
}

.demo-grid-accordion.is-open .demo-grid-panel {
  grid-template-rows: 1fr;
}

.demo-grid-panel-inner {
  overflow: hidden;
  opacity: 0;
  transition: opacity calc(0.3s * var(--motion-scale)) ease;
}

.demo-grid-accordion.is-open .demo-grid-panel-inner {
  opacity: 1;
}

.demo-grid-panel-inner p {
  padding: 0 0.9rem 0.85rem;
  font-size: 0.76rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* ==========================================================================
   CATEGORY 02: HOVER & POINTER INTERACTIONS
   ========================================================================== */

/* 5. Cursor Spotlight Card */
.demo-spotlight-card {
  --mx: 50%;
  --my: 50%;
  width: 100%;
  max-width: 270px;
  height: 120px;
  border-radius: var(--radius-sm);
  padding: 1px;
  position: relative;
  background: radial-gradient(220px circle at var(--mx) var(--my), var(--accent-solid), var(--border-subtle) 65%);
  cursor: crosshair;
}

.demo-spotlight-content {
  width: 100%;
  height: 100%;
  border-radius: calc(var(--radius-sm) - 1px);
  background: radial-gradient(200px circle at var(--mx) var(--my), rgba(255, 255, 255, 0.09), #141418 70%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.75rem;
}

.spotlight-kicker {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--accent-solid);
  letter-spacing: 0.08em;
}

.demo-spotlight-content strong {
  font-size: 0.85rem;
  color: var(--text-primary);
}

.spotlight-coords {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-tertiary);
}

/* 6. Magnetic Pull Button */
.demo-magnetic-zone {
  width: 230px;
  height: 106px;
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.demo-magnetic-btn {
  padding: 0.65rem 1.35rem;
  border-radius: var(--radius-full);
  background: var(--accent-solid);
  color: var(--accent-invert);
  border: none;
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
  transition: transform calc(0.45s * var(--motion-scale)) cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow calc(0.3s * var(--motion-scale)) ease;
  will-change: transform;
}

.demo-magnetic-btn.is-tracking {
  transition: transform 0.08s linear;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
}

.demo-magnetic-text {
  display: inline-block;
  pointer-events: none;
  transition: transform calc(0.45s * var(--motion-scale)) cubic-bezier(0.22, 1, 0.36, 1);
}

.demo-magnetic-btn.is-tracking .demo-magnetic-text {
  transition: transform 0.08s linear;
}

/* 7. 3D Pointer Tilt */
.demo-tilt-card {
  width: 240px;
  height: 120px;
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, #1b1b20, #121216);
  border: 1px solid var(--border-strong);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-style: preserve-3d;
  transition: transform calc(0.45s * var(--motion-scale)) cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.demo-tilt-card.is-tilting {
  transition: transform 0.06s linear;
}

.demo-tilt-sheen {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(160px circle at var(--sx, 50%) var(--sy, 50%), rgba(255, 255, 255, 0.22), transparent 65%);
  transition: opacity 0.25s ease;
}

.demo-tilt-card.is-tilting .demo-tilt-sheen {
  opacity: 1;
}

.demo-tilt-body {
  text-align: center;
  transform: translateZ(20px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.22rem;
}

.tilt-badge {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--accent-solid);
  border: 1px solid var(--border-subtle);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

.demo-tilt-body strong {
  font-size: 0.92rem;
  color: var(--text-primary);
}

.demo-tilt-body span:last-child {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-tertiary);
}

/* 8. Sliding Pill Nav */
.demo-pill-nav {
  position: relative;
  display: inline-flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 4px;
}

.demo-pill-indicator {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  border-radius: var(--radius-full);
  background: var(--accent-solid);
  transition: transform calc(0.36s * var(--motion-scale)) cubic-bezier(0.34, 1.4, 0.64, 1),
              width calc(0.36s * var(--motion-scale)) cubic-bezier(0.34, 1.4, 0.64, 1);
  z-index: 1;
}

.demo-pill-tab {
  position: relative;
  z-index: 2;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 500;
  padding: 0.4rem 0.72rem;
  cursor: pointer;
  transition: color calc(0.22s * var(--motion-scale)) ease;
  font-family: inherit;
}

.demo-pill-tab.active {
  color: var(--accent-invert);
  font-weight: 600;
}

/* ==========================================================================
   CATEGORY 03: MICRO-INTERACTIONS
   ========================================================================== */

/* 9. Heart Burst */
.demo-heart-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.demo-heart-btn {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.demo-heart-btn.is-liked {
  color: #f43f5e;
  border-color: rgba(244, 63, 94, 0.55);
}

.demo-heart-btn.is-liked .demo-heart-svg {
  fill: #f43f5e;
}

.demo-heart-btn.is-bursting .demo-heart-svg {
  animation: heartPop calc(0.5s * var(--motion-scale)) cubic-bezier(0.17, 0.89, 0.32, 1.49);
}

@keyframes heartPop {
  0% { transform: scale(0.7); }
  45% { transform: scale(1.38); }
  100% { transform: scale(1); }
}

.demo-heart-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid #f43f5e;
  opacity: 0;
  pointer-events: none;
}

.demo-heart-btn.is-bursting .demo-heart-ring {
  animation: heartRing calc(0.5s * var(--motion-scale)) ease-out;
}

@keyframes heartRing {
  0% { transform: scale(0.5); opacity: 0.9; }
  100% { transform: scale(1.55); opacity: 0; }
}

.demo-heart-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.demo-heart-particles i {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  margin: -2.5px 0 0 -2.5px;
  border-radius: 50%;
  background: #f43f5e;
  opacity: 0;
}

.demo-heart-particles i:nth-child(1) { --ang: 0deg; }
.demo-heart-particles i:nth-child(2) { --ang: 45deg; background: #fb7185; }
.demo-heart-particles i:nth-child(3) { --ang: 90deg; }
.demo-heart-particles i:nth-child(4) { --ang: 135deg; background: #fbbf24; }
.demo-heart-particles i:nth-child(5) { --ang: 180deg; }
.demo-heart-particles i:nth-child(6) { --ang: 225deg; background: #fb7185; }
.demo-heart-particles i:nth-child(7) { --ang: 270deg; }
.demo-heart-particles i:nth-child(8) { --ang: 315deg; background: #fbbf24; }

.demo-heart-btn.is-bursting .demo-heart-particles i {
  animation: particleBurst calc(0.55s * var(--motion-scale)) cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes particleBurst {
  0% {
    opacity: 1;
    transform: rotate(var(--ang)) translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: rotate(var(--ang)) translateY(-34px) scale(0.2);
  }
}

.demo-heart-count {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

/* 10. SVG Checkmark Draw */
.demo-check-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
}

.demo-check-circle {
  stroke: var(--accent-solid);
  stroke-dasharray: 145;
  stroke-dashoffset: 145;
  opacity: 0.35;
}

.demo-check-path {
  stroke: var(--accent-solid);
  stroke-dasharray: 36;
  stroke-dashoffset: 36;
}

.demo-check-btn.is-checked .demo-check-circle {
  animation: drawCircle calc(0.45s * var(--motion-scale)) ease-out forwards;
}

.demo-check-btn.is-checked .demo-check-path {
  animation: drawCheck calc(0.32s * var(--motion-scale)) cubic-bezier(0.16, 1, 0.3, 1) calc(0.28s * var(--motion-scale)) forwards;
}

@keyframes drawCircle {
  to {
    stroke-dashoffset: 0;
    opacity: 1;
  }
}

@keyframes drawCheck {
  to {
    stroke-dashoffset: 0;
  }
}

/* 11. Validation Error Shake */
.demo-shake-form {
  width: 100%;
  max-width: 270px;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.demo-shake-input-row {
  display: flex;
  gap: 0.45rem;
}

.demo-shake-input {
  flex: 1;
  min-width: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 0.42rem 0.6rem;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.demo-shake-form.is-error .demo-shake-input {
  border-color: #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.demo-shake-form.is-shaking {
  animation: errorShake calc(0.42s * var(--motion-scale)) cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes errorShake {
  10%, 90% { transform: translate3d(-2px, 0, 0); }
  20%, 80% { transform: translate3d(5px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-7px, 0, 0); }
  40%, 60% { transform: translate3d(7px, 0, 0); }
}

.demo-shake-msg {
  font-size: 0.72rem;
  color: #f87171;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity calc(0.25s * var(--motion-scale)) ease, transform calc(0.25s * var(--motion-scale)) ease;
}

.demo-shake-form.is-error .demo-shake-msg {
  opacity: 1;
  transform: translateY(0);
}

/* 12. Ripple & Morphing Submit */
.demo-morph-btn {
  position: relative;
  overflow: hidden;
  width: 176px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: var(--accent-solid);
  color: var(--accent-invert);
  border: none;
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: width calc(0.35s * var(--motion-scale)) cubic-bezier(0.16, 1, 0.3, 1),
              border-radius calc(0.35s * var(--motion-scale)) cubic-bezier(0.16, 1, 0.3, 1),
              background calc(0.25s * var(--motion-scale)) ease,
              color calc(0.25s * var(--motion-scale)) ease;
}

.demo-morph-btn.is-loading {
  width: 42px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--accent-solid);
  color: var(--accent-solid);
}

.demo-morph-btn.is-success {
  width: 140px;
  border-radius: var(--radius-full);
  background: #22c55e;
  color: #052e16;
}

.morph-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.22);
  transform: scale(0);
  animation: morphRipple calc(0.55s * var(--motion-scale)) linear;
  pointer-events: none;
}

@keyframes morphRipple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

.morph-spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: var(--accent-solid);
  animation: spinOrbit calc(0.75s * var(--motion-scale)) linear infinite;
}

/* ==========================================================================
   CATEGORY 04: LOADING & PROGRESS
   ========================================================================== */

/* 13. Skeleton Shimmer */
.demo-skeleton-card {
  width: 100%;
  max-width: 270px;
  min-height: 76px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  position: relative;
}

.demo-skel-view,
.demo-loaded-view {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: opacity calc(0.3s * var(--motion-scale)) ease;
}

.demo-loaded-view {
  position: absolute;
  inset: 0.85rem;
  opacity: 0;
  pointer-events: none;
}

.demo-skeleton-card[data-loaded="true"] .demo-skel-view {
  opacity: 0;
  pointer-events: none;
}

.demo-skeleton-card[data-loaded="true"] .demo-loaded-view {
  opacity: 1;
  pointer-events: auto;
}

.skel-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  flex-shrink: 0;
}

.skel-lines {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
}

.skel-line {
  height: 8px;
  border-radius: 4px;
}

.skel-line.w-70 { width: 70%; }
.skel-line.w-90 { width: 92%; }
.skel-line.w-45 { width: 45%; }

.skel-shimmer {
  position: relative;
  overflow: hidden;
  background: var(--bg-subtle);
}

.skel-shimmer::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.14), transparent);
  animation: shimmerSweep calc(1.5s * var(--motion-scale)) infinite linear;
}

@keyframes shimmerSweep {
  to {
    transform: translateX(100%);
  }
}

.loaded-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-strong);
}

.loaded-meta {
  display: flex;
  flex-direction: column;
}

.loaded-meta strong {
  font-size: 0.85rem;
  color: var(--text-primary);
}

.loaded-meta span {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

/* 14. Geometric Loaders */
.demo-loader-stage {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.demo-loader-stage > div {
  display: none;
}

.demo-loader-stage[data-loader="orbit"] .loader-orbit {
  display: block;
  position: relative;
  width: 44px;
  height: 44px;
}

.orbit-ring-outer,
.orbit-ring-inner {
  position: absolute;
  border-radius: 50%;
  border: 2px solid transparent;
}

.orbit-ring-outer {
  inset: 0;
  border-top-color: var(--accent-solid);
  border-right-color: var(--accent-solid);
  animation: spinOrbit calc(1.1s * var(--motion-scale)) linear infinite;
}

.orbit-ring-inner {
  inset: 9px;
  border-bottom-color: var(--text-secondary);
  border-left-color: var(--text-secondary);
  animation: spinOrbitReverse calc(0.8s * var(--motion-scale)) linear infinite;
}

@keyframes spinOrbit {
  to { transform: rotate(360deg); }
}

@keyframes spinOrbitReverse {
  to { transform: rotate(-360deg); }
}

.demo-loader-stage[data-loader="dots"] .loader-dots {
  display: flex;
  gap: 8px;
}

.loader-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-solid);
  animation: dotBounce calc(1.1s * var(--motion-scale)) ease-in-out infinite;
}

.loader-dots span:nth-child(2) { animation-delay: calc(0.15s * var(--motion-scale)); }
.loader-dots span:nth-child(3) { animation-delay: calc(0.3s * var(--motion-scale)); }

@keyframes dotBounce {
  0%, 80%, 100% { transform: scale(0.45); opacity: 0.35; }
  40% { transform: scale(1); opacity: 1; }
}

.demo-loader-stage[data-loader="bars"] .loader-bars {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 34px;
}

.loader-bars span {
  width: 5px;
  height: 100%;
  border-radius: 3px;
  background: var(--accent-solid);
  animation: eqBar calc(0.95s * var(--motion-scale)) ease-in-out infinite;
}

.loader-bars span:nth-child(2) { animation-delay: calc(0.12s * var(--motion-scale)); }
.loader-bars span:nth-child(3) { animation-delay: calc(0.24s * var(--motion-scale)); }
.loader-bars span:nth-child(4) { animation-delay: calc(0.36s * var(--motion-scale)); }

@keyframes eqBar {
  0%, 100% { transform: scaleY(0.25); opacity: 0.45; }
  50% { transform: scaleY(1); opacity: 1; }
}

/* 15. Circular Radial Progress */
.demo-ring-wrap {
  position: relative;
  width: 88px;
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.demo-ring-svg {
  transform: rotate(-90deg);
}

.demo-ring-track {
  stroke: var(--bg-subtle);
}

.demo-ring-fill {
  stroke: var(--accent-solid);
  stroke-dasharray: 226.19;
  stroke-dashoffset: 56.55;
  transition: stroke-dashoffset calc(0.55s * var(--motion-scale)) cubic-bezier(0.16, 1, 0.3, 1);
}

.demo-ring-value {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

/* 16. Infinite Marquee */
.demo-marquee-viewport {
  width: 100%;
  max-width: 300px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent);
}

.demo-marquee-track {
  display: flex;
  gap: 0.55rem;
  width: max-content;
  animation: marqueeScroll calc(14s * var(--motion-scale)) linear infinite;
}

.demo-marquee-viewport:hover .demo-marquee-track {
  animation-play-state: paused;
}

@keyframes marqueeScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.marquee-chip {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.38rem 0.7rem;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  white-space: nowrap;
}

/* ==========================================================================
   CATEGORY 05: TEXT & NUMERIC MOTION
   ========================================================================== */

/* 17. Cipher Scramble */
.demo-scramble-text {
  font-family: var(--font-mono);
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  padding: 0.55rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  min-width: 230px;
  text-align: center;
}

/* 18. Masked Line Reveal */
.demo-mask-lines {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

.mask-line-clip {
  overflow: hidden;
  line-height: 1.25;
}

.mask-line-item {
  display: inline-block;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  transform: translateY(115%);
}

.demo-mask-lines.is-playing .mask-line-item {
  animation: maskLineUp calc(0.65s * var(--motion-scale)) cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: calc(var(--d) * 120ms * var(--motion-scale));
}

@keyframes maskLineUp {
  to {
    transform: translateY(0);
  }
}

/* 19. Typewriter & Caret */
.demo-typewriter-box {
  width: 100%;
  max-width: 280px;
  background: #0d0d10;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 40px;
}

.typewriter-prompt {
  color: var(--accent-solid);
  font-weight: 700;
}

.typewriter-caret {
  width: 2px;
  height: 1em;
  background: var(--accent-solid);
  animation: caretBlink calc(0.85s * var(--motion-scale)) steps(1) infinite;
}

@keyframes caretBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* 20. Rolling Counter */
.demo-counter-display {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
}

.demo-counter-num {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.demo-counter-unit {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-tertiary);
}

/* ==========================================================================
   CATEGORY 06: EASING & PHYSICS LAB
   ========================================================================== */

/* 21. Easing Curve Race */
.demo-race-lanes {
  width: 100%;
  max-width: 280px;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.race-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.race-label {
  width: 58px;
  font-family: var(--font-mono);
  font-size: 0.67rem;
  color: var(--text-secondary);
  text-align: right;
}

.race-track {
  flex: 1;
  height: 16px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  position: relative;
  padding: 2px;
}

.race-puck {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-solid);
  transform: translateX(0);
  transition-property: transform;
  transition-duration: calc(0.9s * var(--motion-scale));
}

.demo-race-lanes.is-finished .race-puck {
  transform: translateX(192px);
}

@media (max-width: 400px) {
  .demo-race-lanes.is-finished .race-puck {
    transform: translateX(150px);
  }
}

.p-linear { transition-timing-function: linear; }
.p-easeout { transition-timing-function: ease-out; }
.p-expo { transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1); }
.p-spring { transition-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1); }

/* 22. Bezier Visualizer Lab */
.demo-bezier-wrap {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  width: 100%;
  max-width: 285px;
}

.demo-bezier-svg {
  flex-shrink: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
}

.demo-bezier-right {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.demo-bezier-preview-track {
  height: 22px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 4px;
  display: flex;
  align-items: center;
}

.demo-bezier-ball {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-solid);
  transform: translateX(0);
  transition-property: transform;
  transition-duration: calc(0.85s * var(--motion-scale));
  transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

.demo-bezier-ball.at-end {
  transform: translateX(132px);
}

.demo-bezier-copy {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 0.35rem 0.5rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  cursor: pointer;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: border-color var(--transition-fast), color var(--transition-fast);
}

.demo-bezier-copy:hover {
  border-color: var(--accent-solid);
  color: var(--text-primary);
}

/* 23. Spring Physics Drag */
.demo-spring-arena {
  width: 100%;
  max-width: 270px;
  height: 98px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
}

.spring-origin-cross {
  width: 14px;
  height: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  position: absolute;
  pointer-events: none;
}

.demo-spring-puck {
  width: 56px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--accent-solid);
  color: var(--accent-invert);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  user-select: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
  will-change: transform;
}

.demo-spring-puck:active {
  cursor: grabbing;
}

/* 24. Ambient Mesh Glow */
.demo-ambient-frame {
  width: 100%;
  max-width: 270px;
  height: 120px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: #0d0d11;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ambient-orb {
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  filter: blur(26px);
  opacity: 0.55;
  pointer-events: none;
}

.orb-a {
  background: radial-gradient(circle, var(--accent-solid), transparent 70%);
  top: -30px;
  left: -15px;
  animation: ambientDriftA calc(7s * var(--motion-scale)) ease-in-out infinite alternate;
}

.orb-b {
  background: radial-gradient(circle, #38bdf8, transparent 70%);
  bottom: -35px;
  right: -15px;
  animation: ambientDriftB calc(9s * var(--motion-scale)) ease-in-out infinite alternate;
}

@keyframes ambientDriftA {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(110px, 45px) scale(1.25); }
}

@keyframes ambientDriftB {
  0% { transform: translate(0, 0) scale(1.1); }
  100% { transform: translate(-110px, -40px) scale(0.9); }
}

.demo-ambient-glass {
  position: relative;
  z-index: 2;
  padding: 0.7rem 1.15rem;
  border-radius: var(--radius-sm);
  background: rgba(18, 18, 22, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.ambient-pill {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--accent-solid);
  letter-spacing: 0.1em;
}

.demo-ambient-glass strong {
  font-size: 0.85rem;
  color: var(--text-primary);
}

/* ==========================================================================
   Code Inspector Modal & Toast (Shared Showcase Design)
   ========================================================================== */
.code-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s;
}

.code-modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.code-modal-card {
  background: #141417;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 680px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.code-modal-overlay.open .code-modal-card {
  transform: scale(1) translateY(0);
}

.code-modal-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
}

.code-modal-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.code-modal-heading {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.code-modal-tabs {
  display: flex;
  gap: 0.4rem;
}

.code-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-family: var(--font-mono);
  padding: 0.28rem 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.code-tab-btn.active {
  background: var(--bg-subtle);
  color: var(--text-primary);
  border-color: var(--border-subtle);
  font-weight: 600;
}

.code-pre-box {
  background: #0d0d10;
  padding: 1.2rem;
  max-height: 380px;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #e4e4e7;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  border-bottom: 1px solid var(--border-subtle);
}

.code-modal-footer {
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.2);
}

.code-modal-note {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}

.anim-copy-btn {
  background: var(--text-primary);
  color: var(--accent-invert);
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.78rem;
  padding: 0.45rem 0.95rem;
  cursor: pointer;
  transition: opacity var(--transition-fast);
}

.anim-copy-btn:hover {
  opacity: 0.88;
}

.sc-toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 2000;
  display: flex;
  flex-direction: column-reverse;
  gap: 0.75rem;
  pointer-events: none;
}

.sc-toast {
  pointer-events: auto;
  background: #18181b;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.1rem;
  min-width: 280px;
  max-width: 360px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  position: relative;
  overflow: hidden;
  transform: translateY(20px) scale(0.95);
  opacity: 0;
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: transform 0.25s, opacity 0.25s;
}

.sc-toast.hiding {
  transform: translateX(100%);
  opacity: 0;
}

@keyframes toastIn {
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.sc-toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--text-primary);
  width: 100%;
  transform-origin: left;
  animation: toastProgress linear forwards;
}

@keyframes toastProgress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

.sc-toast-icon { flex-shrink: 0; margin-top: 1px; }
.sc-toast-text { flex: 1; }
.sc-toast-title { font-size: 0.84rem; font-weight: 600; color: var(--text-primary); margin-bottom: 0.15rem; }
.sc-toast-msg { font-size: 0.76rem; color: var(--text-secondary); }

.sc-toast-close {
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 0.2rem;
  border-radius: 4px;
}

.sc-toast-close:hover {
  color: var(--text-primary);
}

.anim-footer {
  margin-top: 2rem;
}
