/* ==========================================================================
   Malloc · Enhancement layer
   --------------------------------------------------------------------------
   Additive polish on top of theme.css. Loaded AFTER theme.css so it only
   refines; it never re-declares base layout. Every rule is scoped to an
   .enh-* hook or a specific component so removing this file restores the
   original design exactly.

   Principles (Refactoring UI / Weinschenk / Norman):
   - hierarchy with weight + color before size
   - motion is sparing, purposeful, and honours prefers-reduced-motion
   - every interactive element has a visible signifier (hover/focus state)
   ========================================================================== */

:root {
  --enh-primary: #00cac4;
  --enh-secondary: #7a6eec;
  --enh-android: #2281d9;
  --enh-ios: #7a6eec;

  --enh-ease: cubic-bezier(.22, .61, .36, 1);
  --enh-ease-out: cubic-bezier(.16, 1, .3, 1);

  --enh-shadow-sm: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --enh-shadow-md: 0 6px 16px -6px rgba(16, 24, 40, .14), 0 12px 32px -12px rgba(16, 24, 40, .16);
  --enh-shadow-lg: 0 24px 48px -18px rgba(16, 24, 40, .22), 0 8px 20px -12px rgba(16, 24, 40, .14);

  --enh-ring: 0 0 0 .25rem rgba(0, 202, 196, .35);
}

/* --------------------------------------------------------------------------
   1. Scroll reveal — opt-in via .enh-reveal (JS adds .is-in when visible)
   -------------------------------------------------------------------------- */
.enh-reveal {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity .7s var(--enh-ease-out),
    transform .7s var(--enh-ease-out);
  will-change: opacity, transform;
}

.enh-reveal.is-in {
  opacity: 1;
  transform: none;
}

/* stagger children: JS sets --enh-i on each item */
.enh-reveal[style*="--enh-i"] {
  transition-delay: calc(var(--enh-i, 0) * 90ms);
}

/* --------------------------------------------------------------------------
   2. Hero — aurora wash + gradient headline accent + floating mockup
   -------------------------------------------------------------------------- */
.enh-hero-aurora {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.enh-hero-aurora::before,
.enh-hero-aurora::after {
  content: "";
  position: absolute;
  width: 46rem;
  height: 46rem;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .28;
  will-change: transform;
}

.enh-hero-aurora::before {
  top: -18rem;
  right: -12rem;
  background: radial-gradient(circle at 30% 30%, var(--enh-secondary), transparent 62%);
  animation: enh-drift-a 22s var(--enh-ease) infinite alternate;
}

.enh-hero-aurora::after {
  bottom: -22rem;
  left: -14rem;
  background: radial-gradient(circle at 60% 40%, var(--enh-primary), transparent 62%);
  animation: enh-drift-b 26s var(--enh-ease) infinite alternate;
}

@keyframes enh-drift-a {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-3rem, 2.5rem, 0) scale(1.12); }
}

@keyframes enh-drift-b {
  from { transform: translate3d(0, 0, 0) scale(1.05); }
  to   { transform: translate3d(3rem, -2rem, 0) scale(1); }
}

/* gradient text accent — use once per view, on the word that carries meaning */
.enh-gradient-text {
  background: linear-gradient(100deg, var(--enh-secondary) 0%, var(--enh-primary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* floating device mockup */
.enh-float {
  animation: enh-float 7s ease-in-out infinite;
}

@keyframes enh-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-14px); }
}

/* --------------------------------------------------------------------------
   3. Buttons — lift, sheen, ripple, focus ring
   -------------------------------------------------------------------------- */
.btn {
  transition:
    transform .25s var(--enh-ease),
    box-shadow .25s var(--enh-ease),
    background-color .25s var(--enh-ease),
    border-color .25s var(--enh-ease);
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--enh-ring);
}

.btn-primary:hover {
  box-shadow: 0 10px 24px -10px rgba(0, 202, 196, .6);
}

/* store badges are images inside a .btn — keep them steady but lift the row */
.btn:has(img):hover {
  transform: translateY(-3px);
  box-shadow: var(--enh-shadow-md);
}

/* ripple (JS-injected span) */
.enh-ripple {
  position: relative;
  overflow: hidden;
}

.enh-ripple > .enh-ripple-ink {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  background: rgba(255, 255, 255, .42);
  pointer-events: none;
  animation: enh-ripple .6s var(--enh-ease-out) forwards;
}

@keyframes enh-ripple {
  to { transform: scale(2.6); opacity: 0; }
}

/* --------------------------------------------------------------------------
   4. Cards — hover lift + accent reveal (feature / testimonial / logo cards)
   -------------------------------------------------------------------------- */
.enh-card {
  transition:
    transform .35s var(--enh-ease),
    box-shadow .35s var(--enh-ease),
    border-color .35s var(--enh-ease);
  border: 1px solid transparent;
}

.enh-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--enh-shadow-lg);
  border-color: rgba(var(--ar-primary-rgb), .35);
}

/* accent underline that grows on hover */
.enh-card--accent {
  position: relative;
  overflow: hidden;
}

.enh-card--accent::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, var(--enh-secondary), var(--enh-primary));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .4s var(--enh-ease-out);
}

.enh-card--accent:hover::after {
  transform: scaleX(1);
}

/* carousel cards: pause drift on hover so the user can read */
.swiper-slide .card:hover {
  box-shadow: var(--enh-shadow-md);
  transform: translateY(-4px);
  transition: transform .3s var(--enh-ease), box-shadow .3s var(--enh-ease);
}

/* --------------------------------------------------------------------------
   5. Feature icon tiles — tinted rounded square behind the glyph
   -------------------------------------------------------------------------- */
.enh-icon-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 1rem;
  font-size: 1.5rem;
  background: linear-gradient(140deg, rgba(122, 110, 236, .16), rgba(0, 202, 196, .16));
  color: var(--enh-secondary);
  transition: transform .35s var(--enh-ease), background .35s var(--enh-ease), color .35s var(--enh-ease);
}

.enh-icon-tile--android {
  background: linear-gradient(140deg, rgba(34, 129, 217, .16), rgba(0, 202, 196, .16));
  color: var(--enh-android);
}

.enh-card:hover .enh-icon-tile,
.col:hover > .enh-icon-tile {
  transform: translateY(-2px) scale(1.06);
  background: linear-gradient(140deg, var(--enh-secondary), var(--enh-primary));
  color: #fff;
}

/* --------------------------------------------------------------------------
   6. Stats — accent figure + subtle divider
   -------------------------------------------------------------------------- */
.enh-stat .display-3 {
  background: linear-gradient(120deg, var(--enh-secondary), var(--enh-primary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}

/* --------------------------------------------------------------------------
   7. Accordion — smooth chevron + hover affordance
   -------------------------------------------------------------------------- */
.accordion-button {
  transition: background-color .25s var(--enh-ease), color .25s var(--enh-ease);
}

.accordion-button:not(.collapsed) {
  color: var(--enh-primary);
}

.accordion-button::after {
  transition: transform .35s var(--enh-ease-out);
}

.accordion-item {
  transition: box-shadow .3s var(--enh-ease), transform .3s var(--enh-ease);
}

.accordion-item:hover {
  box-shadow: var(--enh-shadow-sm);
}

/* --------------------------------------------------------------------------
   8. Timeline for process steps (iOS "we thought of everything")
   -------------------------------------------------------------------------- */
.enh-steps {
  position: relative;
}

.enh-steps::before {
  content: "";
  position: absolute;
  left: .875rem;
  top: 1.5rem;
  bottom: 1.5rem;
  width: 2px;
  background: linear-gradient(180deg, rgba(122, 110, 236, .55), rgba(0, 202, 196, .55));
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 1.1s var(--enh-ease-out);
}

.enh-steps.enh-timeline-in::before {
  transform: scaleY(1);
}

/* --------------------------------------------------------------------------
   9. Top scroll-progress bar (JS-injected)
   -------------------------------------------------------------------------- */
.enh-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  z-index: 1080;
  background: linear-gradient(90deg, var(--enh-secondary), var(--enh-primary));
  transition: width .1s linear;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   10. Section headings — tighter, more deliberate
   -------------------------------------------------------------------------- */
.enh-section-title {
  letter-spacing: -.02em;
  line-height: 1.12;
}

/* --------------------------------------------------------------------------
   11. Respect reduced motion — disable all non-essential movement
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .enh-reveal,
  .enh-float,
  .enh-hero-aurora::before,
  .enh-hero-aurora::after,
  .enh-card,
  .enh-icon-tile,
  .enh-steps::before {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}
