/* ==========================================================================
   ALEYNIKFLOWS.RU — Phase 1.5 Premium Silicon Valley Engineering Design
   ========================================================================== */

/* 1. Base Setup & Geometric Grid */
:root {
  --bg-canvas: #FAFAFA;
  --surface: #FFFFFF;
  --text-primary: #0F172A;
  --text-muted: #64748B;
  --accent-blue: #2563EB;
  --accent-violet: #7C3AED;
  --border-subtle: rgba(15, 23, 42, 0.07);
  --border-hover: rgba(37, 99, 235, 0.25);
  --grid-line: rgba(0, 0, 0, 0.03);
}

html {
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body {
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

/* 40px Geometric Grid Pattern (3% opacity) */
.tech-grid-pattern {
  background-size: 40px 40px;
  background-image: 
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
}

/* ==========================================================================
   ANIMATION: Живой фон (Ambient Glow Floating Mesh)
   ========================================================================== */
@keyframes ambientGlowFloat {
  0% {
    transform: scale(1) translate(0px, 0px);
    opacity: 0.7;
  }
  33% {
    transform: scale(1.06) translate(15px, -20px);
    opacity: 0.85;
  }
  66% {
    transform: scale(0.96) translate(-12px, 15px);
    opacity: 0.75;
  }
  100% {
    transform: scale(1) translate(0px, 0px);
    opacity: 0.7;
  }
}

.ambient-glow-mesh {
  background-image: 
    radial-gradient(circle at 50% -5%, hsla(245, 85%, 94%, 0.7) 0%, hsla(210, 85%, 95%, 0.35) 40%, transparent 70%),
    radial-gradient(circle at 10% 28%, hsla(270, 75%, 96%, 0.55) 0%, transparent 45%),
    radial-gradient(circle at 90% 38%, hsla(215, 85%, 95%, 0.55) 0%, transparent 45%),
    radial-gradient(circle at 50% 82%, hsla(245, 80%, 96%, 0.45) 0%, transparent 55%);
  animation: ambientGlowFloat 20s ease-in-out infinite alternate;
  will-change: transform, opacity;
}

/* ==========================================================================
   ANIMATION: Staggered Fade-in при загрузке страницы
   ========================================================================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-16px) translateX(-50%);
  }
  to {
    opacity: 1;
    transform: translateY(0) translateX(-50%);
  }
}

.animate-fade-in-up {
  animation: fadeInUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.header-fade-in {
  animation: fadeInDown 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.stagger-1 { animation-delay: 0.08s; }
.stagger-2 { animation-delay: 0.16s; }
.stagger-3 { animation-delay: 0.24s; }
.stagger-4 { animation-delay: 0.32s; }
.stagger-5 { animation-delay: 0.40s; }

/* ==========================================================================
   CARD STYLES & PREMIER HOVER EFFECTS
   ========================================================================= */
.bento-card {
  position: relative;
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: 1.25rem;
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.32s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.32s ease;
  overflow: hidden;
}

/* Световой блик по рамке при наведении */
.bento-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.6), transparent);
  opacity: 0;
  transform: translateX(-100%);
  transition: opacity 0.3s ease, transform 0.6s ease;
  pointer-events: none;
}

.bento-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: 0 20px 40px -15px rgba(37, 99, 235, 0.09), 0 0 0 1px rgba(37, 99, 235, 0.12);
}

.bento-card:hover::before {
  opacity: 1;
  transform: translateX(100%);
}

/* Glassmorphism Cards */
.glass-card {
  background-color: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.28s ease,
              box-shadow 0.28s ease;
}

.glass-card:hover {
  transform: translateY(-3px);
  border-color: rgba(37, 99, 235, 0.2);
  box-shadow: 0 14px 30px -10px rgba(0, 0, 0, 0.06);
}

/* 2. Device Mockups Styling */

/* --- Mockup 1: Dark Smartphone (Kinetic Archive TMA) --- */
.phone-mockup-frame {
  background: #090D16;
  border-radius: 36px;
  padding: 12px;
  border: 1px solid #1E293B;
  box-shadow: 0 20px 40px -15px rgba(15, 23, 42, 0.28), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  max-width: 320px;
  width: 100%;
  margin: 0 auto;
}

.phone-screen {
  background: #0B0F19;
  border-radius: 26px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.phone-notch {
  width: 84px;
  height: 18px;
  background: #000000;
  border-radius: 12px;
  margin: 6px auto 10px;
}

/* --- Mockup 2: macOS Browser Window (Atelier Précision) --- */
.macos-window-frame {
  background: #FFFFFF;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 15px 35px -10px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  width: 100%;
}

.macos-traffic-light {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

/* --- Mockup 3: Event Graph Pipeline (Lead Capture) --- */
.pipeline-node {
  background: #FFFFFF;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  transition: all 0.2s ease;
}

.pipeline-node:hover {
  border-color: var(--accent-blue);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px -4px rgba(37, 99, 235, 0.12);
}

/* --- Mockup 4: Chat Interface (Barbershop AI Agent) --- */
.chat-bubble-incoming {
  background: #F1F5F9;
  color: #1E293B;
  border-radius: 16px 16px 16px 4px;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.45;
  max-width: 85%;
}

.chat-bubble-outgoing {
  background: #0F172A;
  color: #FFFFFF;
  border-radius: 16px 16px 4px 16px;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.45;
  max-width: 88%;
  margin-left: auto;
}

/* 3. Spotlight Command Palette Modal */
.spotlight-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.spotlight-backdrop.is-active {
  opacity: 1;
  pointer-events: auto;
}

.spotlight-container {
  background: #FFFFFF;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 18px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.04);
  width: 100%;
  max-width: 600px;
  overflow: hidden;
  transform: scale(0.96) translateY(8px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.spotlight-backdrop.is-active .spotlight-container {
  transform: scale(1) translateY(0);
}

/* Kbd keycap design */
kbd {
  font-family: 'JetBrains Mono', monospace;
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 11px;
  color: #475569;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.25);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.45);
}

/* Success Checkmark Animation */
@keyframes strokeAnimation {
  0% { stroke-dashoffset: 48; }
  100% { stroke-dashoffset: 0; }
}

.animate-checkmark {
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: strokeAnimation 0.5s cubic-bezier(0.65, 0, 0.45, 1) forwards 0.15s;
}

/* ==========================================================================
   ANIMATION: Shake validation error
   ========================================================================== */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-5px); }
}

.shake {
  animation: shake 0.4s ease-in-out;
}

/* ==========================================================================
   UI: Toast Notification
   ========================================================================== */
#toast-container {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 9999;
}

#toast-container.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-content {
    background: #1e293b;
    color: #fff;
    padding: 10px 20px;
    border-radius: 9999px;
    font-size: 13px;
    font-family: 'JetBrains Mono', monospace;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}
