/* ═══════════════════════════════════════════════════════════════
   rekurrr. — Animations & Keyframes
   ═══════════════════════════════════════════════════════════════ */

/* ──────────────────────────────────────────────────────────────
   KEYFRAMES
   ────────────────────────────────────────────────────────────── */

/* Grain texture animation */
@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  10%       { transform: translate(-2%, -3%); }
  20%       { transform: translate(3%, 2%); }
  30%       { transform: translate(-1%, 4%); }
  40%       { transform: translate(4%, -1%); }
  50%       { transform: translate(-3%, 1%); }
  60%       { transform: translate(2%, -4%); }
  70%       { transform: translate(-4%, 3%); }
  80%       { transform: translate(1%, -2%); }
  90%       { transform: translate(3%, 4%); }
}

/* Pulse for badge dot and loading */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.4);
    opacity: 0.6;
  }
}

/* Pulse ring expanding */
@keyframes pulseRing {
  0% {
    transform: scale(1);
    opacity: 0.4;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

/* Bounce chevron down */
@keyframes bounceDown {
  0%, 100% {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
  50% {
    transform: translateX(-50%) translateY(8px);
    opacity: 0.5;
  }
}

/* Marquee infinite scroll */
@keyframes marqueeScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* Mesh background shift */
@keyframes meshShift {
  0% {
    background-position: 0% 50%;
    opacity: 0.8;
  }
  50% {
    background-position: 100% 50%;
    opacity: 1;
  }
  100% {
    background-position: 0% 50%;
    opacity: 0.8;
  }
}

/* Step progress line */
@keyframes lineProgress {
  from { width: 0%; }
  to   { width: 100%; }
}

/* Fade in */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Fade up */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade in scale */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Loading "rrr" pulse */
@keyframes rrrPulse {
  0%, 100% {
    opacity: 0.2;
    transform: scale(0.95);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
}

/* Pattern rotation slow */
@keyframes patternDrift {
  from { transform: rotate(0deg) translateX(0); }
  to   { transform: rotate(5deg) translateX(20px); }
}

/* Glow breathe */
@keyframes glowBreathe {
  0%, 100% {
    opacity: 0.08;
    transform: scale(1);
  }
  50% {
    opacity: 0.15;
    transform: scale(1.1);
  }
}

/* Floating orb */
@keyframes floatOrb {
  0%, 100% { transform: translateY(0) scale(1); }
  33%       { transform: translateY(-20px) scale(1.05); }
  66%       { transform: translateY(10px) scale(0.97); }
}

/* Counter odometer effect */
@keyframes odometer {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* Underline grow from left */
@keyframes underlineGrow {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

/* Loading bar */
@keyframes loadingBar {
  from { width: 0%; }
  to   { width: 100%; }
}

/* ──────────────────────────────────────────────────────────────
   LOADING SCREEN
   ────────────────────────────────────────────────────────────── */
.site-loader {
  position: fixed;
  inset: 0;
  background: var(--color-bg);
  z-index: 9998;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.site-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-logo {
  font-family: var(--font-display, 'Sora', sans-serif);
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--color-white, #fff);
  animation: rrrPulse 1.5s ease-in-out infinite;
}

.loader-logo span { color: var(--color-coral, #FF6B35); }

.loader-bar {
  width: 120px;
  height: 2px;
  background: var(--color-border, #2A2A2A);
  border-radius: 2px;
  overflow: hidden;
}

.loader-bar::after {
  content: '';
  display: block;
  height: 100%;
  background: var(--color-coral, #FF6B35);
  animation: loadingBar 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ──────────────────────────────────────────────────────────────
   ANIMATED BLOBS (hero background elements)
   ────────────────────────────────────────────────────────────── */
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  will-change: transform;
}

.blob-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(255,107,53,0.08), transparent 70%);
  top: -100px;
  right: -100px;
  animation: floatOrb 18s ease-in-out infinite;
}

.blob-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(59,130,246,0.04), transparent 70%);
  bottom: -50px;
  left: 10%;
  animation: floatOrb 22s ease-in-out infinite reverse;
}

.blob-3 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255,107,53,0.05), transparent 70%);
  top: 30%;
  left: 40%;
  animation: floatOrb 15s ease-in-out infinite 3s;
}

/* ──────────────────────────────────────────────────────────────
   PATTERN ANIMATIONS (SVG pattern backgrounds)
   ────────────────────────────────────────────────────────────── */
.pattern-bg--animate {
  animation: patternDrift 30s ease-in-out infinite alternate;
}

/* Gradient mask overlays for pattern fade */
.pattern-fade-bottom::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60%;
  background: linear-gradient(to top, var(--color-bg), transparent);
  pointer-events: none;
}

.pattern-fade-radial::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 30%, var(--color-bg) 85%);
  pointer-events: none;
}

/* ──────────────────────────────────────────────────────────────
   HOVER ANIMATIONS
   ────────────────────────────────────────────────────────────── */

/* Link underline animation */
.anim-underline {
  position: relative;
  text-decoration: none;
}

.anim-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-base, 250ms ease);
}

.anim-underline:hover::after {
  transform: scaleX(1);
}

/* Card hover lift */
.anim-lift {
  transition: transform var(--transition-base, 250ms ease),
              box-shadow var(--transition-base, 250ms ease);
}

.anim-lift:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

/* Coral glow on hover */
.anim-glow:hover {
  box-shadow: 0 0 30px rgba(255,107,53,0.2), 0 0 60px rgba(255,107,53,0.1);
}

/* ──────────────────────────────────────────────────────────────
   TYPING EFFECT (JS-powered via span injection)
   ────────────────────────────────────────────────────────────── */
.typing-cursor::after {
  content: '|';
  color: var(--color-coral, #FF6B35);
  animation: pulse 1s step-end infinite;
}

/* ──────────────────────────────────────────────────────────────
   COUNTER (JS adds class when in view)
   ────────────────────────────────────────────────────────────── */
.counter-wrap {
  overflow: hidden;
  display: inline-block;
}

/* ──────────────────────────────────────────────────────────────
   PARALLAX CONTAINER
   ────────────────────────────────────────────────────────────── */
[data-parallax] {
  will-change: transform;
}

/* ──────────────────────────────────────────────────────────────
   MAGNETIC BUTTON WRAPPER
   ────────────────────────────────────────────────────────────── */
.magnetic-wrap {
  position: relative;
  display: inline-block;
}

/* ──────────────────────────────────────────────────────────────
   PAGE TRANSITION
   ────────────────────────────────────────────────────────────── */
body {
  animation: fadeIn 0.4s ease forwards;
}

/* ──────────────────────────────────────────────────────────────
   PROCESS STEP VISUALS (CSS-only data viz)
   ────────────────────────────────────────────────────────────── */
.step-viz {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 2rem;
}

/* Step 1: Audit — data grid visualization */
.viz-audit {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  width: 160px;
}

.viz-audit .viz-cell {
  height: 20px;
  border-radius: 3px;
  background: var(--color-border);
  transition: background var(--transition-base);
}

.viz-audit .viz-cell.active { background: var(--color-coral); }
.viz-audit .viz-cell.success { background: var(--color-success); }
.viz-audit .viz-cell.warning { background: #F59E0B; }

/* Step 2: Strategy — node graph */
.viz-strategy {
  position: relative;
  width: 180px;
  height: 120px;
}

.viz-node {
  position: absolute;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-card);
  border: 2px solid var(--color-coral);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display, 'Sora', sans-serif);
  font-size: 0.625rem;
  font-weight: 700;
  color: var(--color-coral);
  animation: pulse 3s ease-in-out infinite;
}

.viz-node:nth-child(2) { animation-delay: 0.5s; }
.viz-node:nth-child(3) { animation-delay: 1s; }
.viz-node:nth-child(4) { animation-delay: 1.5s; }

.viz-line {
  position: absolute;
  height: 1px;
  background: linear-gradient(90deg, var(--color-coral), transparent);
  opacity: 0.4;
  transform-origin: left;
}

/* Step 3: Build — email template blocks */
.viz-build {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 140px;
}

.viz-block {
  height: 12px;
  border-radius: 3px;
  background: var(--color-border);
}

.viz-block.header {
  height: 28px;
  background: linear-gradient(135deg, var(--color-coral) 0%, rgba(255,107,53,0.3) 100%);
  animation: glowBreathe 2s ease-in-out infinite;
}

.viz-block.image  { height: 60px; background: var(--color-surface); }
.viz-block.wide   { width: 100%; background: var(--color-gray-700); }
.viz-block.med    { width: 75%; background: var(--color-gray-700); }
.viz-block.short  { width: 50%; background: var(--color-gray-700); }
.viz-block.cta    { height: 20px; width: 60%; background: rgba(255,107,53,0.4); border-radius: 10px; margin: 4px auto 0; }

/* Step 4: Optimize — line chart */
.viz-chart {
  position: relative;
  width: 160px;
  height: 80px;
}

.viz-chart svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* ──────────────────────────────────────────────────────────────
   INLINE DASHBOARD MOCKUP (CSS illustration)
   ────────────────────────────────────────────────────────────── */
.dashboard-mockup {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  width: 100%;
  font-family: var(--font-display, 'Sora', sans-serif);
}

.dashboard-mockup__header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-border);
}

.dashboard-mockup__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dashboard-mockup__dot:nth-child(1) { background: #EF4444; }
.dashboard-mockup__dot:nth-child(2) { background: #F59E0B; }
.dashboard-mockup__dot:nth-child(3) { background: #10B981; }

.dashboard-mockup__title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-gray-500);
  margin-left: auto;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.dashboard-stat {
  background: var(--color-card);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  text-align: center;
}

.dashboard-stat__label {
  font-size: 0.5625rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-gray-500);
  margin-bottom: 0.3em;
}

.dashboard-stat__value {
  font-size: 1rem;
  font-weight: 800;
  color: var(--color-white);
  letter-spacing: -0.03em;
}

.dashboard-stat__change {
  font-size: 0.5625rem;
  color: var(--color-success);
}

.dashboard-chart {
  height: 60px;
  background: var(--color-card);
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
}

.dashboard-chart__line {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  top: 0;
}

.dashboard-chart__line svg {
  width: 100%;
  height: 100%;
}

.dashboard-chart__line polyline {
  fill: none;
  stroke: var(--color-coral);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dashboard-chart__fill {
  fill: rgba(255,107,53,0.1);
  stroke: none;
}

/* ──────────────────────────────────────────────────────────────
   PRINT STYLES
   ────────────────────────────────────────────────────────────── */
@media print {
  body { background: white; color: black; }
  .site-header,
  .site-footer,
  .custom-cursor,
  .site-loader,
  body::before { display: none; }
  .container { max-width: 100%; }
}
