/* EazeMyAPI — motion.css — Landing page supplemental animations */

/* ─── Scroll Progress Bar ──────────────────────────────────────── */
#scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, #2979ff 0%, #40c4ff 55%, #82b1ff 100%);
  z-index: 99999;
  pointer-events: none;
  will-change: width;
  border-radius: 0 2px 2px 0;
}

/* ─── Eyebrow Label Animated Shimmer ───────────────────────────── */
.eyebrow {
  background: linear-gradient(
    90deg,
    #82b1ff 0%,
    #40c4ff 30%,
    #e0f2ff 50%,
    #40c4ff 70%,
    #82b1ff 100%
  );
  background-size: 250% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: eyebrowFlow 4.5s linear infinite;
}
@keyframes eyebrowFlow {
  0%   { background-position: 150% center }
  100% { background-position: -150% center }
}

/* ─── Dashboard Shell Float ────────────────────────────────────── */
/* Adds Y-axis bob on top of the existing shellGlow box-shadow anim */
.am-shell {
  animation:
    shellGlow  4.5s ease-in-out infinite,
    shellFloat 8s   ease-in-out 1.4s infinite;
}
@keyframes shellFloat {
  0%, 100% { transform: translateY(0px) }
  50%       { transform: translateY(-10px) }
}

/* ─── Step Connector Arrow Breathe (desktop only) ──────────────── */
@media (min-width: 769px) {
  .step-h-arrow {
    animation: arrowBreathe 2.5s ease-in-out infinite;
  }
  @keyframes arrowBreathe {
    0%, 100% { opacity: .35; transform: translateX(0px) }
    50%       { opacity: 1;   transform: translateX(7px) }
  }
}

/* ─── Step Icon Box Spring-In ──────────────────────────────────── */
.step-h.vis .step-icon-box {
  animation: iconPop .55s cubic-bezier(.34, 1.56, .64, 1) .22s both;
}
@keyframes iconPop {
  from { transform: scale(0.5) rotate(-18deg); opacity: 0; }
  to   { transform: scale(1)   rotate(0deg);   opacity: 1; }
}

/* ─── Built-On Cards Stagger Reveal ────────────────────────────── */
.built-on-card {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity .5s ease,
    transform .55s cubic-bezier(.34, 1.2, .64, 1),
    border-color .2s,
    box-shadow .2s;
}
.built-on-card.vis {
  opacity: 1;
  transform: translateY(0);
}
.built-on-card:nth-child(1) { transition-delay: 0s   }
.built-on-card:nth-child(2) { transition-delay: .11s }
.built-on-card:nth-child(3) { transition-delay: .22s }
.built-on-card:nth-child(4) { transition-delay: .33s }

/* ─── URL Anatomy Segment Pop-In ───────────────────────────────── */
.url-card.vis .u-project { animation: segPop .45s cubic-bezier(.34, 1.56, .64, 1) .08s  both }
.url-card.vis .u-table   { animation: segPop .45s cubic-bezier(.34, 1.56, .64, 1) .18s  both }
.url-card.vis .u-version { animation: segPop .45s cubic-bezier(.34, 1.56, .64, 1) .28s  both }
.url-card.vis .u-action  { animation: segPop .45s cubic-bezier(.34, 1.56, .64, 1) .38s  both }
@keyframes segPop {
  from { opacity: 0; transform: translateY(-12px) scale(.75) }
  to   { opacity: 1; transform: translateY(0)      scale(1)  }
}

/* ─── Video Play Button Pulse Ring ─────────────────────────────── */
.vimeo-play {
  position: relative;
}
.vimeo-play::before {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 2px solid rgba(99, 102, 241, .3);
  animation: playRingPulse 2.6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes playRingPulse {
  0%, 100% { transform: scale(1);    opacity: .3 }
  50%       { transform: scale(1.2); opacity: .9 }
}

/* ─── Feature Card Deeper Hover ────────────────────────────────── */
.feat-card:hover {
  transform: translateY(-7px) !important;
  box-shadow:
    0 24px 64px rgba(41, 121, 255, .2),
    0 0 0 1px rgba(41, 121, 255, .22) !important;
}

/* ─── Stats Band Slide Up ───────────────────────────────────────── */
.stats {
  animation: statsBandIn .9s cubic-bezier(.4, 0, .2, 1) .3s both;
}
@keyframes statsBandIn {
  from { opacity: 0; transform: translateY(24px) }
  to   { opacity: 1; transform: translateY(0)    }
}

/* ══════════════════════════════════════════════════════════════════
   BACKGROUND MOTION ANIMATIONS
   ══════════════════════════════════════════════════════════════════ */


/* ─── Section Animated Background Glow ────────────────────────── */
/* Subtle color fog that breathes behind all .sec content */
.sec::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 18% 45%, rgba(41,121,255,.042) 0%, transparent 65%),
    radial-gradient(ellipse 55% 50% at 82% 60%, rgba(6,182,212,.03)   0%, transparent 65%);
  pointer-events: none;
  animation: secGlow 20s ease-in-out infinite alternate;
  will-change: transform, opacity;
}
@keyframes secGlow {
  0%   { opacity: .4; transform: scale(1)    translate(0px,   0px); }
  100% { opacity: 1;  transform: scale(1.14) translate(28px, -18px); }
}

/* Alternate sections get a different color palette + opposite phase */
.sec-alt::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 65% 55% at 75% 38%, rgba(99,102,241,.04)  0%, transparent 65%),
    radial-gradient(ellipse 55% 45% at 22% 65%, rgba(41,121,255,.032) 0%, transparent 65%);
  pointer-events: none;
  animation: secGlow 24s ease-in-out infinite alternate-reverse;
}

/* ─── Built-on section gets cyan-tinted glow ────────────────────── */
.built-on-sec::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 50%, rgba(6,182,212,.04) 0%, transparent 65%);
  pointer-events: none;
  animation: secGlow 16s ease-in-out infinite alternate;
}


/* ══════════════════════════════════════════════════════════════════
   DATA-FLOW HERO BACKGROUND  (hub-centric, from design handoff)
   Canvas + float cards — desktop only (≥1100px)
   ══════════════════════════════════════════════════════════════════ */

/* Hero canvas */
#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.2;
}

/* Hero center text — above float cards */
.hero-center {
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

/* ─── Center hub ──────────────────────────────────────────────── */
.df-hub {
  display: none;
  position: absolute;
  top: 50%; left: 50%;
  width: 150px; height: 150px;
  transform: translate(-50%, -50%);
  z-index: 4;
  border-radius: 30px;
  place-items: center;
  cursor: pointer;
  background: radial-gradient(120% 120% at 30% 25%, #1a2150 0%, #0a0c1e 70%);
  border: 1px solid rgba(120,150,255,.35);
  box-shadow: 0 0 0 1px rgba(90,120,255,.15), 0 0 60px 6px rgba(70,110,255,.35), inset 0 1px 0 rgba(255,255,255,.08);
  transition: transform .4s cubic-bezier(.2,.7,.2,1), box-shadow .4s, opacity .4s;
  opacity: 0.2;
  pointer-events: auto;
  display: none; /* shown at ≥1100px */
  align-items: center;
  justify-content: center;
}
.df-hub:hover {
  transform: translate(-50%, -50%) scale(1.06);
  opacity: 1;
  box-shadow: 0 0 0 1px rgba(120,150,255,.3), 0 0 90px 12px rgba(90,130,255,.55);
}
.df-hub-logo {
  width: 90px;
  height: auto;
  filter: drop-shadow(0 2px 14px rgba(90,130,255,.6));
  pointer-events: none;
  display: block;
}

/* ─── Float card base (shared by .card.db and .card.api) ──────── */
.df-float {
  display: none;
  position: absolute;
  z-index: 3;
  will-change: transform;
}
.df-float.card {
  border-radius: 15px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 14px 15px;
  cursor: pointer;
  background: linear-gradient(160deg, rgba(18,17,42,.62), rgba(9,9,22,.5));
  box-shadow: 0 16px 46px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.04);
  transform: translate(var(--px,0px), var(--py,0px));
  transition: transform .4s cubic-bezier(.2,.7,.2,1), box-shadow .4s, border-color .4s, opacity .4s;
  opacity: 0.2;
  pointer-events: auto;
  font-family: 'JetBrains Mono', monospace;
}
.df-float.card.db  { min-width: 210px; border: 1px solid rgba(150,110,255,.26); }
.df-float.card.api { min-width: 226px; width: max-content; border: 1px solid rgba(70,130,255,.28); }
.df-float.card.db:hover, .df-float.card.api:hover {
  transform: translate(var(--px,0px), var(--py,0px)) translateY(-5px) scale(1.035);
  opacity: 1;
}
.df-float.card.db:hover  { border-color: rgba(180,140,255,.6); box-shadow: 0 26px 70px rgba(110,60,230,.4); }
.df-float.card.api:hover { border-color: rgba(110,160,255,.6); box-shadow: 0 26px 70px rgba(40,90,230,.4); }
.df-float.card.api-put   { border-color: rgba(45,200,200,.3); }
.df-float.card.api-del   { border-color: rgba(235,80,110,.32); }

/* ─── DB card positions ───────────────────────────────────────── */
#d1 { top:  6%; left: 5%; }
#d2 { top: 26%; left: 7.5%; }
#d3 { top: 46%; left: 4.5%; }
#d4 { top: 64%; left: 9.5%; }

/* ─── API card positions ──────────────────────────────────────── */
#a1 { top: 10%; right: 4%; }
#a2 { top: 26.5%; right: 3%; }
#a3 { top: 43%; right: 4.5%; }
#a4 { top: 58%; right: 3%; }
#a5 { top: 73%; right: 6%; }

/* ─── DB card internals ───────────────────────────────────────── */
.df-hd {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 11px;
}
.df-ic { width: 20px; height: 20px; opacity: .92; }
.df-tname {
  font-family: 'Sora', sans-serif;
  font-weight: 600;
  font-size: 15px;
  color: #eef0ff;
  letter-spacing: -.01em;
}
.df-dot {
  margin-left: auto;
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.card.db .df-dot  { background: #7c5cff; box-shadow: 0 0 9px #7c5cff; }
.card.api .df-dot { background: #3b82f6; box-shadow: 0 0 9px #3b82f6; }

.df-r {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 0;
}
.df-cell {
  flex: none;
  width: 30px; height: 21px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  font-weight: 600;
  color: #b9a8ff;
  background: rgba(120,90,210,.14);
  border: 1px solid rgba(150,110,255,.28);
}
.df-bar {
  height: 7px;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(150,140,200,.32), rgba(120,110,170,.14));
  flex-shrink: 0;
}

/* ─── API card internals ──────────────────────────────────────── */
.df-api-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 13px;
}
.df-endpoint {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 500;
  color: #dfe6ff;
  white-space: nowrap;
}
.df-lock { margin-left: auto; opacity: .55; }

.df-api-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 0;
}

/* Globe icon (inline SVG as data URI) */
.df-globe {
  flex: none;
  width: 22px; height: 22px;
  opacity: .85;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22' fill='none'%3E%3Ccircle cx='11' cy='11' r='8' stroke='%237fb0ff' stroke-width='1.4'/%3E%3Cellipse cx='11' cy='11' rx='3.4' ry='8' stroke='%237fb0ff' stroke-width='1.2'/%3E%3Cpath d='M3 11h16M4.6 6.6h12.8M4.6 15.4h12.8' stroke='%237fb0ff' stroke-width='1.1'/%3E%3C/svg%3E");
}
.df-globe-del {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22' fill='none'%3E%3Ccircle cx='11' cy='11' r='8' stroke='%23ef8ba2' stroke-width='1.4'/%3E%3Cellipse cx='11' cy='11' rx='3.4' ry='8' stroke='%23ef8ba2' stroke-width='1.2'/%3E%3Cpath d='M3 11h16M4.6 6.6h12.8M4.6 15.4h12.8' stroke='%23ef8ba2' stroke-width='1.1'/%3E%3C/svg%3E");
}

/* ─── Method badges ───────────────────────────────────────────── */
.df-method {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .05em;
  padding: 5px 9px;
  border-radius: 7px;
  color: #fff;
  flex-shrink: 0;
}
.m-get  { background: linear-gradient(120deg,#2563eb,#3b82f6); box-shadow: 0 0 16px rgba(59,130,246,.5); }
.m-post { background: linear-gradient(120deg,#7c3aed,#9d5cf6); box-shadow: 0 0 16px rgba(139,92,246,.5); }
.m-put  { background: linear-gradient(120deg,#0e9aa6,#22d3cf); box-shadow: 0 0 16px rgba(34,211,207,.45); }
.m-del  { background: linear-gradient(120deg,#d61f4e,#f43f5e); box-shadow: 0 0 16px rgba(244,63,94,.5); }

/* ─── Ping animation (click feedback) ────────────────────────── */
@keyframes dfPingRing {
  40% { box-shadow: 0 0 0 3px rgba(120,160,255,.5), 0 26px 70px rgba(70,110,255,.5); }
}
.df-float.df-ping {
  animation: dfPingRing .8s cubic-bezier(.2,.7,.2,1);
}

/* ─── Show float cards + hub on wide viewports ────────────────── */
@media (min-width: 1100px) {
  .df-float { display: block; }
  .df-hub   { display: flex; }
}

/* ─── Respect reduced-motion ──────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .df-float.df-ping { animation: none !important; }
}

/* ─── Respect reduced-motion preferences ───────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .eyebrow,
  .am-shell,
  .step-h-arrow,
  .vimeo-play::before,
  .stats,
  .sec::before,
  .sec-alt::before,
  .built-on-sec::before {
    animation: none !important;
    opacity: 0 !important;
  }
  /* Keep the shellGlow only (no float) */
  .am-shell {
    animation: shellGlow 4.5s ease-in-out infinite !important;
    opacity: 1 !important;
  }
  .built-on-card {
    opacity: 1 !important;
    transform: none !important;
  }
  .url-card.vis .u-project,
  .url-card.vis .u-table,
  .url-card.vis .u-version,
  .url-card.vis .u-action,
  .step-h.vis .step-icon-box {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
