@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  --frame-bg-workspace: #ececef;
  --frame-bg-surface: #ffffff;
  --frame-bg-toolbar: #1a1a1e;
  --frame-bg-primary: #1a1a1e;
  --frame-accent: #7c5cfc;
  --frame-accent-hover: #6845f5;
  --frame-accent-glow: rgba(124, 92, 252, 0.35);
  --frame-text: #1a1a1e;
  --frame-text-muted: #9a9aa3;
  --frame-border: #e8e8ec;
}

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

code, kbd, pre, .font-mono {
  font-family: 'JetBrains Mono', monospace;
}

/* Custom glowing effects */
.glow-purple {
  box-shadow: 0 0 50px -10px rgba(124, 92, 252, 0.4);
}

.glow-purple-sm {
  box-shadow: 0 0 25px -5px rgba(124, 92, 252, 0.3);
}

.glass-dark {
  background: rgba(26, 26, 30, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.glass-light {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.gradient-mesh-dark {
  background-image: 
    radial-gradient(at 15% 15%, rgba(124, 92, 252, 0.18) 0px, transparent 50%),
    radial-gradient(at 85% 10%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
    radial-gradient(at 50% 85%, rgba(168, 85, 247, 0.12) 0px, transparent 50%);
}

.gradient-mesh-light {
  background-image: 
    radial-gradient(at 15% 15%, rgba(124, 92, 252, 0.09) 0px, transparent 50%),
    radial-gradient(at 85% 10%, rgba(59, 130, 246, 0.06) 0px, transparent 50%),
    radial-gradient(at 50% 85%, rgba(168, 85, 247, 0.07) 0px, transparent 50%);
}

/* Frame shadow tokens matching SnapCanvas design.md */
.frame-shadow {
  box-shadow: 0 22px 60px -15px rgba(0, 0, 0, 0.45), 0 0 1px 1px rgba(255, 255, 255, 0.1);
}

.frame-shadow-light {
  box-shadow: 0 18px 45px -10px rgba(0, 0, 0, 0.16), 0 0 1px 1px rgba(0, 0, 0, 0.05);
}

/* Subtle grid pattern */
.bg-grid-pattern {
  background-size: 32px 32px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
}

.bg-grid-pattern-light {
  background-size: 32px 32px;
  background-image: 
    linear-gradient(to right, rgba(0, 0, 0, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.04) 1px, transparent 1px);
}

/* Smooth transition utility */
.transition-smooth {
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
}
::-webkit-scrollbar-thumb {
  background: rgba(124, 92, 252, 0.4);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(124, 92, 252, 0.7);
}

/* Floating animation */
@keyframes floatSlow {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}

.animate-float {
  animation: floatSlow 6s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

.animate-glow {
  animation: pulseGlow 4s ease-in-out infinite;
}

/* Before / after comparison slider */
.compare-demo {
  width: 100%;
}

.compare-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  padding: 0.75rem;
  background: #fff;
  border: 1px solid #e4e4e7;
  border-bottom: 0;
  border-radius: 1.5rem 1.5rem 0 0;
}

@media (min-width: 640px) {
  .compare-nav {
    margin-bottom: 0.75rem;
    border-radius: 9999px;
    border-bottom: 1px solid #e4e4e7;
    padding: 0.4rem;
    gap: 0.35rem;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  }
}

.compare-nav__tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem;
  border-radius: 9999px;
  border: 0;
  background: transparent;
  color: #52525b;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.compare-nav__tab:hover {
  background: #f4f4f5;
  color: #1a1a1e;
}

.compare-nav__tab.is-active {
  background: #7c5cfc;
  color: #fff;
  box-shadow: 0 4px 14px rgba(124, 92, 252, 0.35);
}

.compare-nav__tab i {
  font-size: 0.75rem;
  opacity: 0.9;
}

.compare-slider {
  position: relative;
  width: 100%;
  overflow: hidden;
  user-select: none;
  touch-action: none;
  cursor: ew-resize;
  border-radius: 1rem;
  background: #18181b;
}

.compare-slider img {
  display: block;
  width: 100%;
  height: auto;
  max-width: none;
  pointer-events: none;
  -webkit-user-drag: none;
}

.compare-slider__after {
  display: block;
  width: 100%;
}

.compare-slider__before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 50%;
  overflow: hidden;
  z-index: 2;
}

.compare-slider__before img {
  position: absolute;
  inset: 0 auto 0 0;
  height: 100%;
  width: auto;
  max-width: none;
}

.compare-slider__handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: #fff;
  z-index: 3;
  transform: translateX(-50%);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.compare-slider__handle::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  background: #fff;
  border: 2px solid #7c5cfc;
  transform: translate(-50%, -50%);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%237c5cfc' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='15 18 9 12 15 6'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%237c5cfc' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'/%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat;
  background-position: 7px center, calc(100% - 7px) center;
  background-size: 14px 14px, 14px 14px;
}

.compare-slider__label {
  position: absolute;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 6px 12px;
  border-radius: 0.5rem;
  pointer-events: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  line-height: 1.2;
}

.compare-slider__label-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.compare-slider__label-sub {
  font-size: 10px;
  font-weight: 500;
  opacity: 0.85;
}

.compare-slider__label--before {
  left: 12px;
  bottom: 12px;
  top: auto;
  background: rgba(24, 24, 27, 0.82);
  color: #fff;
}

.compare-slider__label--after {
  right: 12px;
  top: 12px;
  background: #7c5cfc;
  color: #fff;
}
