/* ============================================================
   HOOLA — interaction enhancement layer
   Nickster Pty Ltd · October 2026

   Custom cursor · magnetic buttons · counting figures ·
   scroll progress · nav underline · card hovers ·
   freelancer enquiry form

   Additive only. No existing layout, spacing, content or colour
   is changed. Every rule is gated behind a class that
   enhance.js puts on <html>, so with JS off the site renders
   exactly as it does today. Delete the two files and the two
   tags per page to revert.
   ============================================================ */

/* ---------------------------------------------------------
   1. Custom cursor
   --------------------------------------------------------- */
#fx-dot,
#fx-ring {
  position: fixed;
  top: 0; left: 0;
  z-index: 9999;
  pointer-events: none;
  border-radius: 50%;
  opacity: 0;
  mix-blend-mode: difference;
  will-change: transform;
}
#fx-dot {
  width: 7px; height: 7px;
  margin: -3.5px 0 0 -3.5px;
  background: #fff;
  transition:
    background .2s ease,
    width .2s cubic-bezier(.2, .7, .2, 1),
    height .2s cubic-bezier(.2, .7, .2, 1),
    margin .2s cubic-bezier(.2, .7, .2, 1);
}
#fx-ring {
  width: 40px; height: 40px;
  margin: -20px 0 0 -20px;
  border: 1px solid rgba(255, 255, 255, .7);
  transition:
    width .3s cubic-bezier(.2, .7, .2, 1),
    height .3s cubic-bezier(.2, .7, .2, 1),
    margin .3s cubic-bezier(.2, .7, .2, 1),
    opacity .3s ease;
}
.fx-cursor #fx-dot,
.fx-cursor #fx-ring { opacity: 1; }
.fx-cursor.fx-cur-lg #fx-ring {
  width: 84px; height: 84px;
  margin: -42px 0 0 -42px;
}

/* Over a real link or button the dot takes the brand blue, and
   drops out of difference blending to do it — difference would
   render #157ff6 as orange against the white sections. Normal
   blending keeps it the same blue everywhere. */
.fx-cursor.fx-cur-link #fx-dot {
  background: var(--blue);
  mix-blend-mode: normal;
  width: 10px; height: 10px;
  margin: -5px 0 0 -5px;
}

.fx-cursor,
.fx-cursor a,
.fx-cursor button { cursor: none; }

/* Keyboard users, form fields and the open dialog all need a
   real pointer back. */
.fx-cursor a:focus-visible,
.fx-cursor button:focus-visible { cursor: auto; }
.fx-cursor.fx-modal-open,
.fx-cursor.fx-modal-open a,
.fx-cursor.fx-modal-open button { cursor: auto; }
.fx-cursor.fx-modal-open #fx-dot,
.fx-cursor.fx-modal-open #fx-ring { opacity: 0; }

/* Never on touch — the dot would lag a tap by a frame and then
   sit stranded wherever the finger last lifted. */
@media (hover: none), (pointer: coarse) {
  #fx-dot, #fx-ring { display: none !important; }
  .fx-cursor, .fx-cursor a, .fx-cursor button { cursor: auto; }
}

/* ---------------------------------------------------------
   2. Magnetic buttons
   Movement is written as an inline transform by enhance.js.
   The existing .btn:hover lift is preserved — enhance.js folds
   the -2px into the same transform rather than overriding it.
   --------------------------------------------------------- */
.fx-magnetic .btn-hero,
.fx-magnetic .btn { will-change: transform; }

.fx-magnetic .btn-hero .rule {
  transform-origin: 0 50%;
  transition: transform .4s cubic-bezier(.2, .7, .2, 1);
}
.fx-magnetic .btn-hero:hover .rule { transform: scaleX(1.25); }

.fx-magnetic .btn-hero .tri { transition: transform .4s cubic-bezier(.2, .7, .2, 1); }
.fx-magnetic .btn-hero:hover .tri { transform: translateX(4px); }

/* ---------------------------------------------------------
   3. Counting figures
   Tabular numerals stop the width jittering while counting.
   --------------------------------------------------------- */
.fx-count .nstat .fig { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------
   4. Scroll progress
   --------------------------------------------------------- */
#fx-progress {
  position: fixed;
  left: 0; right: 0; top: 0;
  height: 2px;
  background: var(--blue);
  transform: scaleX(0);
  transform-origin: 0 50%;
  z-index: 9998;
  opacity: 0;
  transition: opacity .3s ease;
}
.fx-progress #fx-progress { opacity: 1; }

/* ---------------------------------------------------------
   5. Nav underline
   position: relative only — no offsets, so nothing moves.
   --------------------------------------------------------- */
.fx-nav .nav-links a { position: relative; }
.fx-nav .nav-links a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--blue);
  transform: scaleX(0);
  transform-origin: 100% 50%;
  transition: transform .45s cubic-bezier(.2, .7, .2, 1);
}
.fx-nav .nav-links a:hover::after,
.fx-nav .nav-links a:focus-visible::after {
  transform: scaleX(1);
  transform-origin: 0 50%;
}

/* Off in the mobile slide-out panel, where it reads as a stray
   rule rather than an underline. */
@media (max-width: 900px) {
  .fx-nav .nav-links a::after { display: none; }
}

/* ---------------------------------------------------------
   6. Card hovers — Our Approach and The Promise
   Deliberately restrained: a short lift, a tone shift, and on
   the approach cards the blue the number already uses.
   --------------------------------------------------------- */
.fx-cards .acard {
  transition:
    transform .45s cubic-bezier(.2, .7, .2, 1),
    border-color .35s ease,
    box-shadow .45s ease;
}
.fx-cards .acard:hover {
  transform: translateY(-4px);
  border-color: #c2dcfb;
  box-shadow: 0 12px 28px -20px rgba(21, 127, 246, .45);
}

.fx-cards .pstat {
  transition:
    transform .45s cubic-bezier(.2, .7, .2, 1),
    background-color .35s ease,
    border-color .35s ease;
}
.fx-cards .pstat:hover {
  transform: translateY(-4px);
  background-color: rgba(0, 0, 0, .34);
  border-color: rgba(255, 255, 255, .85);
}

/* ---------------------------------------------------------
   7. Freelancer enquiry
   Button sits in the black .footer-cta block; the dialog is
   appended to <body> so no stacking context can trap it.
   --------------------------------------------------------- */
#fx-freelance-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: calc(var(--u) * .6);
  height: max(44px, calc(var(--u) * 2.8));
  padding: 0 calc(var(--u) * 1.6);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .45);
  border-radius: 2px;
  color: #fff;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: max(10.5px, calc(var(--u) * .66));
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .25s ease, border-color .25s ease;
}
#fx-freelance-btn:hover,
#fx-freelance-btn:focus-visible {
  background: rgba(255, 255, 255, .12);
  border-color: #fff;
}
#fx-freelance-btn .dot {
  width: 5px; height: 5px; flex: none;
  border-radius: 50%;
  background: var(--blue);
}

#fx-modal[hidden] { display: none !important; }
#fx-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-left, 0px));
  padding-block: 24px;
}
#fx-modal-veil {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .72);
  backdrop-filter: blur(5px);
  animation: fxVeil .3s ease both;
}
@keyframes fxVeil { from { opacity: 0; } to { opacity: 1; } }

#fx-modal-panel {
  position: relative;
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: #0b0b0c;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 4px;
  padding: clamp(26px, 4vw, 44px);
  color: #fff;
  animation: fxPanel .4s cubic-bezier(.16, 1, .3, 1) both;
}
@keyframes fxPanel {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

#fx-modal-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 50%;
  color: rgba(255, 255, 255, .75);
  font-size: 17px; line-height: 1;
  cursor: pointer;
  transition: border-color .2s ease, color .2s ease;
}
#fx-modal-close:hover,
#fx-modal-close:focus-visible { border-color: #fff; color: #fff; }

#fx-modal .fx-eyebrow {
  display: flex; align-items: center; gap: 14px;
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: rgba(255, 255, 255, .55);
  margin: 0 0 12px;
}
#fx-modal .fx-eyebrow::after {
  content: ''; flex: 1; height: 1px;
  background: rgba(255, 255, 255, .2);
}
#fx-modal h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(34px, 6vw, 50px);
  line-height: .92;
  margin: 0;
  text-transform: uppercase;
}
#fx-modal h2 em { font-style: normal; color: var(--blue); }
#fx-modal .fx-lead {
  font-size: 13px;
  line-height: 1.65;
  color: #8f8f8f;
  margin: 14px 0 26px;
  max-width: 42ch;
}

.fx-field { margin-bottom: 20px; }
.fx-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
@media (max-width: 520px) { .fx-row { grid-template-columns: 1fr; gap: 0; } }

.fx-field label {
  display: block;
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .55);
  margin-bottom: 7px;
}
.fx-field input,
.fx-field textarea {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, .22);
  border-radius: 0;
  padding: 9px 0;
  color: #fff;
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 14px;
  transition: border-color .25s ease;
}
.fx-field textarea { resize: vertical; min-height: 92px; line-height: 1.6; }
.fx-field input:focus,
.fx-field textarea:focus {
  outline: none;
  border-bottom-color: var(--blue);
}
.fx-field input::placeholder,
.fx-field textarea::placeholder { color: rgba(255, 255, 255, .25); }
.fx-field.invalid input,
.fx-field.invalid textarea { border-bottom-color: #e2574c; }
.fx-err {
  display: none;
  font-size: 11px;
  color: #e2574c;
  margin-top: 6px;
}
.fx-field.invalid .fx-err { display: block; }

/* Honeypot — off-screen rather than display:none, which some bots
   check for. Never focusable, never announced. */
.fx-pot {
  position: absolute;
  left: -9999px;
  width: 1px; height: 1px;
  overflow: hidden;
}

#fx-modal-submit {
  width: 100%;
  height: 48px;
  margin-top: 6px;
  background: var(--blue-btn);
  border: 1px solid var(--blue-btn);
  border-radius: 2px;
  color: #fff;
  font-family: var(--font-body);
  font-size: 11.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .25s ease;
}
#fx-modal-submit:hover,
#fx-modal-submit:focus-visible { background: #1b8bf0; }
#fx-modal-submit[disabled] { opacity: .5; cursor: default; }

#fx-modal-note {
  font-size: 11px;
  line-height: 1.6;
  color: #6a6a6a;
  margin: 14px 0 0;
}

#fx-modal-done { text-align: left; }
#fx-modal-done .tick {
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--blue);
  border-radius: 50%;
  color: var(--blue);
  font-size: 20px;
  margin-bottom: 18px;
}

/* ---------------------------------------------------------
   Reduced motion
   --------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  #fx-ring { transition: opacity .3s ease; }
  .fx-nav .nav-links a::after { transition: none; }
  .fx-cards .acard:hover,
  .fx-cards .pstat:hover { transform: none; }
  #fx-modal-veil, #fx-modal-panel { animation: none; }
}

/* ---------------------------------------------------------
   Print
   --------------------------------------------------------- */
@media print {
  #fx-dot, #fx-ring, #fx-progress,
  #fx-freelance-btn, #fx-modal { display: none !important; }
}
