/* ==========================================================================
   ehyong-motion.css : interaction layer (28 Nov 2026)
   Effects adapted from the Magic UI Pro style, rebuilt in plain CSS/JS in the
   ehyong gold-on-dark palette. Nothing here changes colours, type, spacing
   or layout. Every rule is scoped to html.em-on, which ehyong-motion.js adds
   only when the visitor has not asked for reduced motion. Without the script
   the page renders exactly as before.
   ========================================================================== */

/* 1. Gold shine on primary buttons (Magic UI "shiny / rainbow button")
      A soft light sweeps across the gold button twice after load and once on
      every hover. The glow underneath grows on hover. */
html.em-on :is(.btn-primary, .cta) { position: relative; overflow: hidden; isolation: isolate; }
html.em-on :is(.btn-primary, .cta)::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 250, 235, .62) 48%, rgba(255, 250, 235, .62) 52%, transparent 70%);
  transform: translateX(-130%);
  animation: em-shine 1.15s cubic-bezier(.4, 0, .2, 1) 1.2s 2 both;
}
html.em-on :is(.btn-primary, .cta):is(:hover, :focus-visible)::after { animation: em-shine-h .85s cubic-bezier(.4, 0, .2, 1) both; }
html.em-on .cta { transition: box-shadow .3s ease, transform .3s ease; }
html.em-on .cta:is(:hover, :focus-visible) { box-shadow: 0 16px 44px -10px rgba(214, 174, 103, .55); }
html.em-on .btn-primary:is(:hover, :focus-visible):not(:disabled) { box-shadow: 0 18px 50px -6px rgba(214, 174, 103, .5); }
@keyframes em-shine   { from { transform: translateX(-130%); } to { transform: translateX(130%); } }
@keyframes em-shine-h { from { transform: translateX(-130%); } to { transform: translateX(130%); } }

/* 2. Gold sheen on the gold hero text (Magic UI "aurora text", in brand gold)
      Only on text that is already gold; it stays gold, the light just moves. */
html.em-on .em-sheen {
  background: linear-gradient(100deg, currentColor 0%, currentColor 38%, #FFF4DA 50%, currentColor 62%, currentColor 100%);
  background-size: 250% 100%; background-position: 100% 0;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: em-sheen 3.4s ease-in-out .6s 3 both;
}
@keyframes em-sheen { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* 3. Blur-fade on scroll (Magic UI "blur fade")
      Only for blocks that start below the first screen, so nothing the
      visitor sees on arrival (and nothing Google measures for LCP) waits. */
html.em-on .em-r { opacity: 0; transform: translate3d(0, 18px, 0); filter: blur(6px); }
html.em-on .em-r.em-in {
  opacity: 1; transform: none; filter: none;
  transition: opacity .7s cubic-bezier(.2, .7, .2, 1), transform .7s cubic-bezier(.2, .7, .2, 1), filter .7s ease;
  transition-delay: var(--em-d, 0ms);
}
@media (max-width: 760px) {           /* phones: fade and lift only, blur is costly on small GPUs */
  html.em-on .em-r { filter: none; transform: translate3d(0, 12px, 0); }
}

/* 4. Number ticker: the stats count up once when they come into view.
      Width is locked to the final number so nothing shifts. */
html.em-on .em-num { font-variant-numeric: tabular-nums; display: inline-block; }

/* 5. Spotlight cards (Magic UI "magic card"): a soft gold light follows the
      cursor inside a card. Mouse and trackpad only; touch screens skip it. */
@media (hover: hover) and (pointer: fine) {
  html.em-on .em-spot { isolation: isolate; }
  html.em-on .em-spot.em-rel { position: relative; }
  html.em-on .em-spot::before {
    content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
    background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(214, 174, 103, var(--em-spot-a, .13)), transparent 46%);
    opacity: 0; transition: opacity .35s ease;
  }
  html.em-on .em-spot:hover::before { opacity: 1; }
  html.em-on .em-spot:hover { border-color: rgba(214, 174, 103, .42) !important; }
  html.em-light .em-spot { --em-spot-a: .16; }
}

/* 6. Border beam on the enquiry form (Magic UI "border beam"):
      a thin gold light travels round the form's border while it is on screen. */
@property --em-a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
html.em-on .em-beam { position: relative; isolation: isolate; }
html.em-on .em-beam::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; padding: 1px;
  background: conic-gradient(from var(--em-a), transparent 0 78%, rgba(214, 174, 103, .2) 84%, #F0D7A1 92%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: em-beam 7s linear infinite paused;
}
html.em-on .em-beam.em-live::after { animation-play-state: running; }
@keyframes em-beam { to { --em-a: 360deg; } }

@media print {
  html.em-on .em-r { opacity: 1 !important; transform: none !important; filter: none !important; }
  html.em-on .em-beam::after, html.em-on :is(.btn-primary, .cta)::after { display: none; }
}
