/* ============= Typedge — micro animations ============= */

/* ---------- Desktop nav: animated active dot ---------- */
.nav { position: relative; }
.nav .nav-dot{
  position:absolute;
  width:.5em; height:.5em; border-radius:50%;
  background:#000;
  left:0; bottom:-.35em;                  /* sit below the label */
  transform:translateX(0);
  transition:transform .28s cubic-bezier(.22,.61,.36,1), left .28s cubic-bezier(.22,.61,.36,1);
  pointer-events:none;
}
@media (prefers-reduced-motion: reduce){
  .nav .nav-dot{ transition:none; }
}

/* ---------- Mobile menu overlay (enter/exit + stagger) ---------- */
.mobile-menu .mm-inner{
  opacity:0;
  transform:translateY(12px);
  will-change: transform, opacity;
}
.mobile-menu .mm-nav .mm-link,
.mobile-menu .mm-social a{
  opacity:0;
  transform:translateY(6px);
  will-change: transform, opacity;
}

/* OPENING */
.mobile-menu[data-state="opening"] .mm-inner{
  animation: mmIn .36s cubic-bezier(.22,.61,.36,1) forwards;
}
.mobile-menu[data-state="opening"] .mm-nav .mm-link{
  animation: mmFadeUp .42s cubic-bezier(.22,.61,.36,1) forwards;
  animation-delay: calc(var(--i, 0) * 60ms);
}
.mobile-menu[data-state="opening"] .mm-social a{
  animation: mmFadeUp .42s cubic-bezier(.22,.61,.36,1) forwards;
  animation-delay: calc(180ms + var(--i, 0) * 60ms);
}

/* OPEN (steady) */
.mobile-menu[data-state="open"] .mm-inner,
.site-header.menu-open ~ .mobile-menu .mm-inner{
  opacity:1; transform:none;
}
.mobile-menu[data-state="open"] .mm-nav .mm-link,
.site-header.menu-open ~ .mobile-menu .mm-nav .mm-link,
.mobile-menu[data-state="open"] .mm-social a,
.site-header.menu-open ~ .mobile-menu .mm-social a{
  opacity:1; transform:none;
}

/* CLOSING */
.mobile-menu[data-state="closing"] .mm-inner{
  animation: mmOut .28s cubic-bezier(.4,.1,.2,1) forwards;
}
.mobile-menu[data-state="closing"] .mm-nav .mm-link,
.mobile-menu[data-state="closing"] .mm-social a{
  animation: mmFadeDown .24s cubic-bezier(.4,.1,.2,1) forwards;
  animation-delay: calc(var(--i, 0) * 40ms);
}

/* Keyframes */
@keyframes mmIn{
  from{ opacity:0; transform:translateY(16px); }
  to  { opacity:1; transform:translateY(0); }
}
@keyframes mmOut{
  from{ opacity:1; transform:translateY(0); }
  to  { opacity:0; transform:translateY(10px); }
}
@keyframes mmFadeUp{
  from{ opacity:0; transform:translateY(8px); }
  to  { opacity:1; transform:translateY(0); }
}
@keyframes mmFadeDown{
  from{ opacity:1; transform:translateY(0); }
  to  { opacity:0; transform:translateY(6px); }
}

@media (prefers-reduced-motion: reduce){
  .mobile-menu .mm-inner,
  .mobile-menu .mm-nav .mm-link,
  .mobile-menu .mm-social a{
    animation:none !important;
    transition:none !important;
    opacity:1 !important;
    transform:none !important;
  }
}

/* Hide the animated nav dot on phones */
@media (max-width: 760px){
  .nav .nav-dot,
  .nav .nav-ink{ display:none; }
  .nav a.active::after{ content: normal; }
}

/* ================= Reveal on scroll (flicker-free) ================= */
/* Gate the hidden baseline behind .rv-ready so we can pre-mark above-the-fold
   elements as visible in JS before enabling the hidden state for everything else. */
.rv-ready .reveal{
  opacity: 0;
  transform: translateY(14px);
  filter: blur(1px);
  transition:
    opacity .48s ease,
    transform .48s cubic-bezier(.22,.61,.36,1),
    filter .48s ease;
  transition-delay: var(--rv-delay, 0ms);
  will-change: transform, opacity, filter;
}

/* directions (optional, via data-rv attr) */
.rv-ready .reveal[data-rv="up"]    { transform: translateY(14px); }
.rv-ready .reveal[data-rv="down"]  { transform: translateY(-14px); }
.rv-ready .reveal[data-rv="left"]  { transform: translateX(16px); }
.rv-ready .reveal[data-rv="right"] { transform: translateX(-16px); }

.rv-ready .reveal.reveal-in{
  opacity: 1;
  transform: none;
  filter: none;
}

/* prefers-reduced-motion: just show */
@media (prefers-reduced-motion: reduce){
  .reveal{ opacity:1 !important; transform:none !important; filter:none !important; transition:none !important; }
}

/* ================= Micro polish ================= */
@media (min-width: 761px){
  .home-cards .card,
  .services-grid .svc-card,
  .ins-card,
  .cards .card {
    transition: transform .22s cubic-bezier(.22,.61,.36,1), box-shadow .22s ease;
    will-change: transform;
  }
  .home-cards .card:hover,
  .services-grid .svc-card:hover,
  .ins-card:hover,
  .cards .card:hover {
    transform: translateY(-3px);
    box-shadow: 0 24px 48px rgba(0,0,0,.10);
  }
}
/* ===== Footer + mobile-overlay socials — hover micro-motion ===== */
/* Put transitions on the base element so any hover style from styles.css animates */
.social a, .mm-social a{
  transition:
    transform .18s cubic-bezier(.22,.61,.36,1),
    box-shadow .20s ease,
    filter .20s ease,
    background-color .20s ease,
    border-color .20s ease,
    color .20s ease;
  will-change: transform, box-shadow, filter;
  transform-origin: center;
}

/* Desktop / trackpad hover only */
@media (hover: hover) and (pointer: fine){
  .social a:hover, .mm-social a:hover{
    transform: translateY(-2px) scale(1.08);
    filter: brightness(1.08) saturate(1.05);
    box-shadow: 0 12px 24px rgba(0,0,0,.12);
  }
  .social a:active, .mm-social a:active{
    transform: translateY(0) scale(1.02);
    box-shadow: 0 8px 16px rgba(0,0,0,.08);
  }
}

/* Keep strong keyboard focus */
.social a:focus-visible{
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Motion safety */
@media (prefers-reduced-motion: reduce){
  .social a, .mm-social a{ transition: none !important; }
}

/* Motion safety */
    will-change: transform, box-shadow, filter;
  }
  .social a:hover{
    transform: translateY(-1px) scale(1.06);
    filter: brightness(1.08) saturate(1.05);
    box-shadow: 0 12px 24px rgba(0,0,0,.12);
    background:#000; color:#fff; border-color:#000; /* keeps your invert */
  }
  .social a:active{
    transform: translateY(0) scale(1.02);
    box-shadow: 0 8px 16px rgba(0,0,0,.08);
  }
}

/* Keyboard focus stays strong and accessible */
.social a:focus-visible{
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Motion safety */
@media (prefers-reduced-motion: reduce){
  .social a{ transition: none !important; }
}

/* ========= CTA glow / press refinement ========= */

/* Desktop / precise pointers: soft glow + lift */
@media (hover: hover) and (pointer: fine){
  a.btn, button.btn,
  a.btn-pill, button.btn-pill,
  .btn-oval, .spa-cta__btn{
    transition:
      transform .18s cubic-bezier(.22,.61,.36,1),
      box-shadow .22s ease,
      filter .22s ease;
    will-change: transform, box-shadow;
  }
  a.btn:hover, button.btn:hover,
  a.btn-pill:hover, button.btn-pill:hover,
  .btn-oval:hover, .spa-cta__btn:hover{
    /* soft accent-tinted glow + tiny lift */
    transform: translateY(-2px);
    box-shadow:
      0 14px 34px rgba(111, 12, 226, .20),
      0 3px 10px rgba(0,0,0,.06);
    filter: saturate(1.04);
  }
  a.btn:active, button.btn:active,
  a.btn-pill:active, button.btn-pill:active,
  .btn-oval:active, .spa-cta__btn:active{
    transform: translateY(0); /* settle down on press */
    box-shadow:
      0 8px 20px rgba(111, 12, 226, .16),
      0 2px 6px rgba(0,0,0,.04);
  }
}

/* Mobile / coarse pointers: quick, ripple-less nudge (no heavy shadows) */
@media (hover: none){
  a.btn, button.btn,
  a.btn-pill, button.btn-pill,
  .btn-oval, .spa-cta__btn{
    transition: transform .10s ease-out;
  }
  a.btn:active, button.btn:active,
  a.btn-pill:active, button.btn-pill:active,
  .btn-oval:active, .spa-cta__btn:active{
    transform: translateY(1px) scale(.992);
  }
}

/* A11y: keep strong focus ring from base CSS; no extra motion needed here */
/* ===== Header easing refinement ===== */
.site-header{
  --hdr-ease: cubic-bezier(.22,.61,.36,1); /* default */
  transition:
    transform .28s var(--hdr-ease),
    opacity   .28s ease,
    box-shadow .20s ease;
}
.site-header.is-hiding { --hdr-ease: cubic-bezier(.40,0,.20,1); } /* crisper hide */
.site-header.is-showing{ --hdr-ease: cubic-bezier(.20,.80,.20,1); } /* smoother return */
/* ================= Testimonials — subtle motion polish ================= */

/* Slide: fade + slight lift on enter (CSS-only, uses existing .is-active) */
.testimonial .t-slide{
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity   .32s cubic-bezier(.22,.61,.36,1),
    transform .32s cubic-bezier(.22,.61,.36,1);
}
.testimonial .t-slide.is-active{
  opacity: 1;
  transform: translateY(0);
}

/* Arrows: micro-move + soft shadow on hover, tidy press on click */
.testimonial .t-btn{
  transition:
    transform .16s cubic-bezier(.22,.61,.36,1),
    box-shadow .20s ease,
    border-color .20s ease;
}
.testimonial .t-btn:hover{
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(0,0,0,.18);
  border-color:#fff;
}
.testimonial .t-btn:active{
  transform: translateY(0);
  box-shadow:none;
}

/* Dots: gentle scale for active, responsive hover/focus ring */
.testimonial .t-dot{
  transform: scale(.92);
  transition:
    transform .18s cubic-bezier(.22,.61,.36,1),
    background-color .20s ease,
    box-shadow .20s ease;
}
.testimonial .t-dot.is-active{
  transform: scale(1);
  background:#fff;
}
.testimonial .t-dot:hover,
.testimonial .t-dot:focus-visible{
  transform: scale(1.05);
  background:#fff;
  box-shadow: 0 0 0 3px rgba(255,255,255,.28);
  outline: none;
}

/* Motion safety */
@media (prefers-reduced-motion: reduce){
  .testimonial .t-slide{ opacity:1; transform:none; transition:none; }
  .testimonial .t-btn,
  .testimonial .t-dot{ transition:none; }
}
/* ===== Home projects — ultra-light 3D tilt (desktop only) ===== */
@media (hover: hover) and (pointer: fine){
  /* give the grid a perspective so the cards can tilt */
  .home-cards{ perspective: 1200px; }

  /* smooth transform pipeline on cards + media */
  .home-cards .card{
    transform-style: preserve-3d;
    transition: transform .22s cubic-bezier(.22,.61,.36,1), box-shadow .22s ease;
    will-change: transform;
  }
  .home-cards .card .card-media img{
    transition: transform .32s cubic-bezier(.22,.61,.36,1), filter .28s ease;
    transform-origin: center;
    will-change: transform, filter;
  }

  /* the subtle tilt */
  .home-cards .card:hover{
    transform: translateY(-3px) rotateX(.6deg) rotateY(.6deg);
    box-shadow: 0 28px 52px rgba(0,0,0,.12);
  }
  .home-cards .card:hover .card-media img{
    transform: scale(1.03);
    filter: saturate(1.04);
  }
}

/* motion safety */
@media (prefers-reduced-motion: reduce){
  .home-cards .card,
  .home-cards .card .card-media img{
    transition: none !important;
    transform: none !important;
    box-shadow: none !important;
  }
}
/* ================= Page transition micro-fade ================= */

/* Initial: hide main/footer until JS marks page ready (fast flash → fade in) */
body:not(.pt-ready) main,
body:not(.pt-ready) .site-footer{
  opacity: 0;
}

/* Fade in once ready */
.pt-ready main,
.pt-ready .site-footer{
  opacity: 1;
  transition: opacity .28s ease;
}

/* Fade out on exit */
.pt-exit main,
.pt-exit .site-footer{
  opacity: 0;
  transition: opacity .20s ease;
}

/* Motion safety */
@media (prefers-reduced-motion: reduce){
  body:not(.pt-ready) main,
  body:not(.pt-ready) .site-footer{
    opacity: 1; /* no initial hide */
  }
  .pt-ready main,
  .pt-ready .site-footer,
  .pt-exit  main,
  .pt-exit  .site-footer{
    transition: none;
    opacity: 1;
  }
}


/* CURSOR ANIMATION */
/* ===== Glass Cursor — smaller idle circle; same pill size on hover ===== */
@media (pointer: fine){
  .cursor-capsule{
    position: fixed;
    left: 0; top: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;

    /* smaller idle circle */
    width: 32px;
    height: 32px;
    min-width: 32px;

    border-radius: 9999px;
    pointer-events: none;
    z-index: 9999;

    /* glass look */
    background: rgba(255,255,255,.14);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
    backdrop-filter: blur(12px) saturate(140%);
    border: none;
    box-shadow: 0 10px 28px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.28);

    /* start offscreen; JS positions it */
    transform: translate3d(-200px,-200px,0);
    transition:
      width .24s cubic-bezier(.22,.61,.36,1),
      height .24s cubic-bezier(.22,.61,.36,1),
      border-radius .24s cubic-bezier(.22,.61,.36,1),
      background-color .18s ease,
      box-shadow .18s ease;
    will-change: transform, width, height, border-radius;
  }

  .cursor-capsule .label{
    display: none; /* hidden at rest */
    font-family: "Satoshi", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-weight: var(--w-medium, 600);
    font-size: 12px;
    line-height: 1;
    letter-spacing: .02em;
    color: #111;
    white-space: nowrap;
    user-select: none;
    padding: 0 14px; /* pill side padding */
  }

  /* Pill state (same size as before) */
  .cursor-capsule.is-pill{
    height: 40px;                /* horizontal ellipse */
    border-radius: 9999px;
    background: rgba(255,255,255,.78);
    box-shadow: 0 12px 30px rgba(0,0,0,.20), inset 0 1px 0 rgba(255,255,255,.55);
  }
  .cursor-capsule.is-pill .label{
    display: block;
  }
}

@supports not ((-webkit-backdrop-filter: blur(10px)) or (backdrop-filter: blur(10px))){
  .cursor-capsule{ background: rgba(255,255,255,.25); }
}

@media (prefers-reduced-motion: reduce){
  .cursor-capsule{ transition: none; }
}
/* Kill switch for pages that shouldn't show the custom cursor */
.no-custom-cursor .cursor-capsule{ display:none !important; }
/* Hide custom cursor on touch / coarse pointer devices */
@media (hover: none), (pointer: coarse){
  .cursor-capsule{ display:none !important; }
  body { cursor: auto !important; } /* make sure default cursor is used */
}

/* Also respect your manual kill switch */
.no-custom-cursor .cursor-capsule{ display:none !important; }
