/* ==========================================================================
   PropertyRubix — Site-wide motion layer (all public pages)
   Pairs with assets/js/site-motion.js. Nothing here hides content by
   default: motion states are applied by JS at runtime only.
   ========================================================================== */

/* ── Scroll progress ──────────────────────────────────────────────────── */
#smProgress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 10050;
  transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, #f7cb46, #e5a93b 60%, #22c55e);
  box-shadow: 0 0 12px rgba(247, 203, 70, .55);
  pointer-events: none;
}

/* ── Page transition curtain ──────────────────────────────────────────── */
#smCurtain {
  position: fixed; inset: 0; z-index: 10060;
  display: grid; place-items: center;
  background: #0b1220;
  transform: translateY(100%);
  visibility: hidden;
  pointer-events: none;
}
#smCurtain::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 6px;
  background: linear-gradient(90deg, #f7cb46, #e5a93b);
}
.sm-curtain__mark {
  font: 800 clamp(1.6rem, 4vw, 2.6rem)/1 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  letter-spacing: -.04em; color: #fff; opacity: 0;
}
.sm-curtain__mark b { color: #f7cb46; font-weight: 800; }
.sm-curtain__mark i { color: #22c55e; font-style: normal; }

/* Arriving from an internal link: curtain covers the first paint, JS lifts it.
   Failsafe: it lifts by itself after 2.2s even if JS never runs. */
html.sm-enter #smCurtain { transform: none; visibility: visible; animation: smCurtainFailsafe .5s ease 2.2s forwards; }
html.sm-enter .sm-curtain__mark { opacity: 1; }
@keyframes smCurtainFailsafe { to { transform: translateY(-100%); visibility: hidden; } }

/* ── Helpers used while an element is animating ───────────────────────── */
.sm-anim { will-change: transform, opacity; }

/* ── Subtle global micro-interactions (desktop pointers only) ─────────── */
@media (hover: hover) and (pointer: fine) {
  main .btn:not(.btn-link):not(.btn-close):not(.dropdown-toggle) {
    transition: transform .3s cubic-bezier(.22, 1, .36, 1), box-shadow .3s, background-color .3s, color .3s, border-color .3s;
  }
  main .btn:not(.btn-link):not(.btn-close):not(.dropdown-toggle):hover { transform: translateY(-2px); }
}

@media (prefers-reduced-motion: reduce) {
  #smProgress, #smCurtain { display: none !important; }
}

/* Lenis smooth scroll (desktop) — overrides Bootstrap's scroll-behavior */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

/* ── Popular links band: 2-column grid on phones ─────────────────────── */
@media (max-width: 767.98px) {
  .pl-section { padding: 44px 0 !important; min-height: 0 !important; }
  .pl-section .pl-title { font-size: 1.6rem !important; margin-bottom: 24px !important; }
  .pl-section .pl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 4px 14px !important; }
  .pl-section .pl-grid a { display: block; padding: 7px 0; overflow-wrap: anywhere; }
}
