/* ============================================================
   MELIORIX SYSTEMS — home.css
   Premium showcase enhancements for the homepage:
   scroll progress · cursor spotlight · aurora hero · glass
   mockup · magnetic buttons · 3D tilt · card spotlight ·
   marquee · upgraded reveals · animated CTA.
   Motion follows ui-ux-pro-max: transform/opacity only,
   ease-out enter, staggered, reduced-motion safe.
   ============================================================ */

/* ---------- Scroll progress bar ---------- */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  z-index: 1200;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-green));
  box-shadow: 0 0 12px rgba(57,255,20,0.5);
  transition: width 0.1s linear;
}

/* ---------- Cursor spotlight (desktop) ---------- */
.cursor-glow {
  position: fixed;
  top: 0; left: 0;
  width: 480px; height: 480px;
  margin: -240px 0 0 -240px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(circle, rgba(0,170,255,0.10), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s ease;
  will-change: transform;
}
.cursor-glow.active { opacity: 1; }

/* ---------- Hero: split layout + aurora ---------- */
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 48px;
  text-align: left;
}
.hero-aurora {
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 120%;
  z-index: 0;
  pointer-events: none;
  filter: blur(80px);
  opacity: 0.55;
}
.hero-aurora span {
  position: absolute;
  display: block;
  border-radius: 50%;
  mix-blend-mode: screen;
}
.hero-aurora .a1 { width: 420px; height: 420px; top: 4%; left: 6%;  background: #00AAFF; animation: drift1 16s ease-in-out infinite; }
.hero-aurora .a2 { width: 360px; height: 360px; top: 30%; right: 8%; background: #39FF14; opacity: 0.5; animation: drift2 19s ease-in-out infinite; }
.hero-aurora .a3 { width: 300px; height: 300px; bottom: 0;  left: 38%; background: #0066cc; animation: drift3 22s ease-in-out infinite; }
@keyframes drift1 { 0%,100%{transform:translate(0,0) scale(1);} 50%{transform:translate(60px,40px) scale(1.15);} }
@keyframes drift2 { 0%,100%{transform:translate(0,0) scale(1);} 50%{transform:translate(-50px,30px) scale(1.1);} }
@keyframes drift3 { 0%,100%{transform:translate(0,0) scale(1);} 50%{transform:translate(30px,-40px) scale(1.2);} }

.hero .container { text-align: left; }
.hero-grid h1 { margin: 0 0 20px; max-width: none; }
.hero-grid .hero-subtitle { margin: 0 0 36px; }
.hero-grid .hero-actions { justify-content: flex-start; }

/* Badge pill */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: rgba(0,170,255,0.06);
  backdrop-filter: blur(8px);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.3px;
  color: var(--text-primary);
  margin-bottom: 28px;
  opacity: 0;
  animation: fadeUp 0.7s var(--ease) 0.1s forwards;
}
.hero-badge .live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 0 0 rgba(57,255,20,0.6);
  animation: pulseDot 2s infinite;
}
@keyframes pulseDot {
  0% { box-shadow: 0 0 0 0 rgba(57,255,20,0.55); }
  70% { box-shadow: 0 0 0 10px rgba(57,255,20,0); }
  100% { box-shadow: 0 0 0 0 rgba(57,255,20,0); }
}
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }

/* Shimmer accent on the typed headline */
.hero-grid h1 { color: var(--text-primary); }
.shimmer {
  background: linear-gradient(100deg, var(--accent-blue) 20%, var(--accent-green) 40%, #dfffd0 50%, var(--accent-green) 60%, var(--accent-blue) 80%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmerMove 4s linear infinite;
}
@keyframes shimmerMove { to { background-position: 200% center; } }

/* Trust row under hero actions */
.hero-trust {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 32px;
  color: var(--text-muted);
  font-size: 14px;
  opacity: 0;
  animation: fadeUp 0.8s var(--ease) 0.9s forwards;
}
.hero-trust .avatars { display: flex; }
.hero-trust .avatars span {
  width: 34px; height: 34px; border-radius: 50%;
  border: 2px solid var(--bg-deep);
  margin-left: -10px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 12px; color: #03260a;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-green));
}
.hero-trust .avatars span:first-child { margin-left: 0; }
.hero-trust .stars-mini { color: var(--accent-green); display: inline-flex; gap: 2px; }

/* ---------- Hero glass mockup ---------- */
.hero-visual { perspective: 1200px; position: relative; }
.mockup {
  position: relative;
  background: rgba(10,22,40,0.7);
  border: 1px solid var(--border);
  border-radius: 16px;
  backdrop-filter: blur(16px);
  box-shadow: 0 30px 80px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.05);
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform 0.2s var(--ease);
  opacity: 0;
  animation: mockIn 1s var(--ease) 0.4s forwards;
  animation-fill-mode: forwards;
}
@keyframes mockIn { from { opacity: 0; transform: translateY(40px) rotateX(8deg); } to { opacity: 1; transform: translateY(0) rotateX(0); } }
.mockup-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(5,13,26,0.5);
}
.mockup-bar i { width: 11px; height: 11px; border-radius: 50%; }
.mockup-bar i:nth-child(1){ background:#ff5f57; } .mockup-bar i:nth-child(2){ background:#febc2e; } .mockup-bar i:nth-child(3){ background:#28c840; }
.mockup-bar .url {
  margin-left: 12px; flex: 1; height: 22px; border-radius: 6px;
  background: rgba(0,170,255,0.08); border: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 10px;
  font-size: 11px; color: var(--text-muted); font-family: var(--font-body);
}
.mockup-body { padding: 20px; }
.mockup-kpis { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-bottom: 18px; }
.mockup-kpi { background: var(--bg-deep); border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
.mockup-kpi .k { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.mockup-kpi .v { font-family: var(--font-display); font-weight: 700; font-size: 20px; margin-top: 4px; }
.mockup-kpi .v.up { color: var(--accent-green); }
.mockup-kpi .v.blue { color: var(--accent-blue); }
.mockup-chart {
  height: 130px;
  display: flex; align-items: flex-end; gap: 8px;
  padding: 14px;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.mockup-chart .bar {
  flex: 1;
  border-radius: 5px 5px 0 0;
  background: linear-gradient(180deg, var(--accent-blue), rgba(0,170,255,0.15));
  transform-origin: bottom;
  animation: barGrow 1.4s var(--ease) backwards;
}
.mockup-chart .bar.green { background: linear-gradient(180deg, var(--accent-green), rgba(57,255,20,0.15)); }
@keyframes barGrow { from { transform: scaleY(0); opacity: 0.4; } to { transform: scaleY(1); opacity: 1; } }

/* sparkline inside mockup */
.mockup-spark { width: 100%; height: 46px; margin: 14px 0; display: block; overflow: visible; }
.mockup-spark .spark-line {
  fill: none;
  stroke: url(#sparkGrad);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
  animation: sparkDraw 1.6s var(--ease) 1s forwards;
}
.mockup-spark .spark-area { fill: url(#sparkFill); opacity: 0; animation: sparkFade 1s ease 2.2s forwards; }
.mockup-spark .spark-dot { fill: var(--accent-green); opacity: 0; animation: sparkFade 0.4s ease 2.4s forwards; }
@keyframes sparkDraw { to { stroke-dashoffset: 0; } }
@keyframes sparkFade { to { opacity: 1; } }

/* breathing glow on the highlighted bars (opacity/filter only — no transform conflict) */
.mockup-chart .bar.green { animation: barGrow 1.4s var(--ease) backwards, barPulse 2.6s ease-in-out 1.6s infinite; }
@keyframes barPulse { 0%,100% { filter: drop-shadow(0 0 0 rgba(57,255,20,0)); } 50% { filter: drop-shadow(0 0 8px rgba(57,255,20,0.6)); } }

/* floating glow card behind mockup */
.hero-visual::before {
  content: '';
  position: absolute;
  inset: 12% 8%;
  background: radial-gradient(circle at 50% 40%, rgba(0,170,255,0.25), transparent 70%);
  filter: blur(40px);
  z-index: -1;
}
/* floating mini badges around mockup */
.float-chip {
  position: absolute;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: rgba(10,22,40,0.9);
  border: 1px solid var(--border);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  font-size: 13px; font-weight: 600;
  box-shadow: 0 12px 30px rgba(0,0,0,0.4);
  z-index: 3;
}
.float-chip svg { color: var(--accent-green); }
.float-chip.c1 { top: -18px; right: 24px; animation: floaty 5s ease-in-out infinite; }
.float-chip.c2 { bottom: 28px; left: -26px; animation: floaty 6s ease-in-out infinite 1s; }
@keyframes floaty { 0%,100%{transform:translateY(0);} 50%{transform:translateY(-12px);} }

/* ---------- Upgraded reveal (blur + scale), homepage-wide ---------- */
.reveal { transform: translateY(36px) scale(0.985); filter: blur(6px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease), filter 0.7s var(--ease); }
.reveal.visible { transform: translateY(0) scale(1); filter: blur(0); }

/* ---------- Service cards: spotlight + tilt + animated border ---------- */
.services-grid { perspective: 1000px; }
.services-grid .service-card {
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  --mx: 50%; --my: 50%;
}
.services-grid .service-card::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(280px circle at var(--mx) var(--my), rgba(0,170,255,0.16), transparent 65%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.services-grid .service-card:hover::before { opacity: 1; }
.services-grid .service-card::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: var(--radius);
  padding: 1px;
  background: conic-gradient(from var(--angle, 0deg), transparent 60%, var(--accent-blue), var(--accent-green), transparent);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.services-grid .service-card:hover::after { opacity: 1; animation: spinBorder 4s linear infinite; }
@property --angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
@keyframes spinBorder { to { --angle: 360deg; } }
.service-card .icon-box { transition: transform 0.4s var(--ease), background 0.4s, color 0.4s; }
.service-card:hover .icon-box { transform: translateZ(30px) scale(1.08); }
.service-card h3, .service-card p, .service-card .more-link { transition: transform 0.4s var(--ease); }
.service-card:hover h3 { transform: translateZ(22px); }
.service-card:hover p { transform: translateZ(14px); }
.service-card:hover .more-link { transform: translateZ(18px); }

/* ---------- Stats: glow + animated underline ---------- */
#numbers .stat .num, #liczby .stat .num { position: relative; display: inline-block; }
#numbers .stat, #liczby .stat { position: relative; }
.stat .num::after {
  content: '';
  position: absolute; left: 50%; bottom: -10px;
  width: 0; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-green));
  transform: translateX(-50%);
  transition: width 0.8s var(--ease) 0.3s;
}
.stat.reveal.visible .num::after { width: 48px; }

/* ---------- Marquee (tech ticker) ---------- */
.marquee {
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 22px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track {
  display: flex;
  width: max-content;
  gap: 56px;
  animation: marqueeMove 28s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display);
  font-weight: 600; font-size: 22px;
  color: var(--text-muted);
  white-space: nowrap;
  transition: color 0.3s;
}
.marquee-track span:hover { color: var(--accent-blue); }
.marquee-track span svg { color: var(--accent-blue); }
@keyframes marqueeMove { to { transform: translateX(-50%); } }

/* ---------- Testimonials: infinite marquee ---------- */
.reviews-marquee {
  position: relative;
  overflow: hidden;
  margin-top: 8px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.reviews-track {
  display: flex;
  width: max-content;
  gap: 24px;
  padding: 16px 12px;
  animation: reviewsMove 40s linear infinite;
}
.reviews-marquee:hover .reviews-track { animation-play-state: paused; }
.reviews-track .review-card {
  width: 380px;
  flex-shrink: 0;
  transition: transform 0.4s var(--ease), border-color 0.4s, box-shadow 0.4s;
}
.reviews-track .review-card:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: var(--accent-blue);
  box-shadow: 0 0 30px rgba(0,170,255,0.18);
}
@keyframes reviewsMove { to { transform: translateX(-50%); } }

@media (max-width: 480px) { .reviews-track .review-card { width: 300px; } }

/* ---------- Advantages: animated icon ---------- */
.adv .icon-lg { transition: transform 0.4s var(--ease); }
.adv:hover .icon-lg { transform: translateY(-6px) rotate(-6deg) scale(1.1); }
.adv {
  border-radius: var(--radius);
  padding: 8px;
  transition: background 0.4s;
}

/* ---------- Process / Work stages (timeline) ---------- */
.process-timeline { position: relative; margin-top: 28px; }

/* horizontal time axis — runs through the step numbers */
.process-track,
.process-progress {
  position: absolute;
  top: 50px;
  left: 12.5%;
  height: 3px;
  border-radius: 3px;
  z-index: 0;
}
.process-track { right: 12.5%; background: var(--border); }
.process-progress {
  width: 75%;                       /* spans from node 1 to node 4 */
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-green));
  transform: scaleX(0);
  transform-origin: left center;
  box-shadow: 0 0 14px rgba(57, 255, 20, 0.35);
}
.process-timeline.in-view .process-progress {
  transform: scaleX(1);
  transition: transform 1.8s var(--ease);
}

.process-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  position: relative;
  z-index: 1;
}

.step {
  position: relative;
  padding: 28px 24px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  opacity: 0;                       /* revealed by the timeline */
  transition: transform 0.4s var(--ease), border-color 0.4s, box-shadow 0.4s;
}
/* each stage lands on the axis in sequence as the line is drawn */
.process-timeline.in-view .step {
  animation: stepIn 0.6s var(--ease) both;
}
.process-timeline.in-view .step:nth-child(1) { animation-delay: 0.15s; }
.process-timeline.in-view .step:nth-child(2) { animation-delay: 0.60s; }
.process-timeline.in-view .step:nth-child(3) { animation-delay: 1.05s; }
.process-timeline.in-view .step:nth-child(4) { animation-delay: 1.50s; }
@keyframes stepIn {
  from { opacity: 0; transform: translateY(30px) scale(0.97); filter: blur(5px); }
  to   { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
.step:hover {
  transform: translateY(-6px);
  border-color: rgba(0, 170, 255, 0.4);
  box-shadow: 0 22px 44px -24px rgba(0, 170, 255, 0.5);
}
.step-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-green));
  color: var(--bg-deep);
  margin-bottom: 18px;
  box-shadow: 0 0 0 6px var(--bg-card), 0 6px 18px -6px rgba(0, 170, 255, 0.6);
}
.step .step-icon { color: var(--accent-blue); margin-bottom: 14px; transition: transform 0.4s var(--ease); }
.step:hover .step-icon { transform: translateY(-4px) scale(1.1); color: var(--accent-green); }
.step h3 { margin-bottom: 10px; }
.step p { color: var(--text-muted); font-size: 15px; }

@media (max-width: 900px) {
  .process-grid { grid-template-columns: repeat(2, 1fr); }
  .process-track, .process-progress { display: none; }
}
@media (max-width: 560px) {
  .process-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .step { opacity: 1; animation: none !important; transform: none; filter: none; }
  .process-progress { transform: scaleX(1); transition: none; }
}

/* ---------- CTA: animated conic aurora ---------- */
.cta-final { isolation: isolate; }
.cta-aurora {
  position: absolute; inset: 0; z-index: -1;
  overflow: hidden;
  opacity: 0.5;
}
.cta-aurora::before {
  content: '';
  position: absolute;
  width: 140%; height: 140%;
  top: -20%; left: -20%;
  background: conic-gradient(from 0deg, transparent, rgba(0,170,255,0.25), transparent, rgba(57,255,20,0.2), transparent);
  animation: spinAurora 18s linear infinite;
}
@keyframes spinAurora { to { transform: rotate(360deg); } }

/* magnetic button helper (JS sets transform) */
[data-magnetic] { will-change: transform; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-grid h1, .hero-grid .hero-subtitle, .hero-grid .hero-actions { text-align: center; }
  .hero-grid .hero-actions, .hero-trust { justify-content: center; }
  .hero-grid .hero-badge { display: inline-flex; }
  .hero-grid > div:first-child { text-align: center; }
  .hero-visual { max-width: 460px; margin: 0 auto; }
}
@media (max-width: 768px) {
  .float-chip { display: none; }
  .cursor-glow { display: none; }
  .marquee-track span { font-size: 18px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .hero-aurora, .cta-aurora, .cursor-glow,
  .marquee-track, .float-chip,
  .shimmer, .hero-badge .live-dot,
  .mockup-chart .bar, .mockup, .hero-badge, .hero-trust {
    animation: none !important;
  }
  .hero-badge, .hero-trust, .mockup { opacity: 1 !important; transform: none !important; }
  .shimmer { -webkit-text-fill-color: var(--accent-green); color: var(--accent-green); }
  .services-grid .service-card:hover::after { animation: none; }
  .reveal { filter: none !important; transform: none !important; }
  .reviews-track { animation: none !important; }
  .reviews-marquee { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
  .mockup-spark .spark-line { stroke-dashoffset: 0 !important; animation: none !important; }
  .mockup-spark .spark-area, .mockup-spark .spark-dot { opacity: 1 !important; animation: none !important; }
  .mockup-chart .bar.green { animation: none !important; }
}
