/* Advanced UI interactions — additive. Brand color stays on --color-primary. */

/* ---------- 5. Nav pill follow ---------- */
.nav {
  position: relative;
}
.nav-pill {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  border-radius: var(--radius);
  background: var(--color-primary-soft);
  pointer-events: none;
  opacity: 0;
}
.nav-link {
  position: relative;
  z-index: 1;
}
@media (min-width: 861px) {
  .nav-pill {
    display: block;
    transition: transform .32s cubic-bezier(.22, 1, .36, 1),
                width .32s cubic-bezier(.22, 1, .36, 1),
                height .32s cubic-bezier(.22, 1, .36, 1),
                opacity .2s ease;
  }
  .nav-pill.is-ready {
    opacity: 1;
  }
}
@media (max-width: 860px) {
  .nav-pill {
    display: none !important;
  }
  .nav-link[aria-current="page"] {
    background: var(--color-primary-soft);
  }
}

/* ---------- 3. Magnetic primary buttons ---------- */
.btn.magnet {
  position: relative;
  isolation: isolate;
}
.magnet-sizer {
  visibility: hidden;
  pointer-events: none;
  white-space: nowrap;
}
.magnet-face {
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
  background: var(--color-primary);
  border: 1px solid var(--color-primary);
  color: #fff;
  font: inherit;
  font-weight: inherit;
  pointer-events: none;
  will-change: transform;
  transition: transform .45s cubic-bezier(.22, 1, .36, 1),
              background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn.magnet.is-armed {
  /* paint lives on the face so the hit box can stay still */
  background: transparent;
  border-color: transparent;
  color: transparent;
  box-shadow: none;
}
.btn.magnet:hover .magnet-face {
  background: #fff;
  color: var(--color-primary);
}
@media (hover: none), (pointer: coarse) {
  .magnet-face {
    transform: none !important;
  }
}

/* ---------- 6. Feature-card color fill from the arrow ---------- */
.card--fill {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.card--fill > * {
  position: relative;
  z-index: 1;
}
.card--fill .card-arrow {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  width: 2.25rem;
  height: 2.25rem;
  min-width: 2.25rem;
  min-height: 2.25rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--color-border-strong);
  background: #fff;
  color: var(--color-ink);
  pointer-events: none;
}
.card--fill .card-arrow svg {
  width: 14px;
  height: 14px;
  display: block;
}
.card--fill::before {
  content: "";
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--color-primary);
  transform: scale(0);
  transform-origin: center;
  transition: transform .55s cubic-bezier(.22, 1, .36, 1);
  pointer-events: none;
}
.card--fill:hover::before,
.card--fill:focus-within::before,
.card--fill.is-preview-hover::before {
  transform: scale(28);
}
.card--fill:hover,
.card--fill:focus-within,
.card--fill.is-preview-hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow);
  color: #fff;
}
.card--fill:hover .card-index,
.card--fill:hover h3,
.card--fill:hover p,
.card--fill:hover .card-more,
.card--fill:hover li,
.card--fill:focus-within .card-index,
.card--fill:focus-within h3,
.card--fill:focus-within p,
.card--fill:focus-within .card-more,
.card--fill:focus-within li,
.card--fill.is-preview-hover .card-index,
.card--fill.is-preview-hover h3,
.card--fill.is-preview-hover p,
.card--fill.is-preview-hover .card-more {
  color: #fff;
}
.card--fill:hover .card-arrow,
.card--fill:focus-within .card-arrow,
.card--fill.is-preview-hover .card-arrow {
  background: transparent;
  border-color: rgba(255, 255, 255, .55);
  color: #fff;
}
a.card--link.card--fill:hover {
  transform: none;
  color: #fff;
}
.card--fill h3,
.card--fill .card-index {
  padding-right: 2.2rem;
}

/* ---------- 2. Custom cursor (fine pointer only, JS enables) ---------- */
html.has-custom-cursor,
html.has-custom-cursor * {
  cursor: none !important;
}
html.has-custom-cursor input,
html.has-custom-cursor textarea,
html.has-custom-cursor select,
html.has-custom-cursor option {
  cursor: text !important;
}
.ui-cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 4000;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: var(--color-ink);
  pointer-events: none;
  transform: translate3d(-100px, -100px, 0);
  transition: width .28s cubic-bezier(.22, 1, .36, 1),
              height .28s cubic-bezier(.22, 1, .36, 1),
              margin .28s cubic-bezier(.22, 1, .36, 1),
              background-color .2s ease,
              opacity .2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .02em;
  mix-blend-mode: normal;
}
.ui-cursor.is-view {
  width: 72px;
  height: 72px;
  margin: -36px 0 0 -36px;
  background: var(--color-primary);
}
.ui-cursor-label {
  opacity: 0;
  transform: scale(.8);
  transition: opacity .2s ease, transform .2s ease;
}
.ui-cursor.is-view .ui-cursor-label {
  opacity: 1;
  transform: scale(1);
}
.ui-cursor.is-hidden {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .nav-pill {
    transition: none;
  }
  .magnet-face {
    transition: none;
    transform: none !important;
  }
  .card--fill::before {
    transition: none;
  }
  .card--fill:hover::before,
  .card--fill:focus-within::before,
  .card--fill.is-preview-hover::before {
    /* instant fill: cover the card immediately */
    transform: scale(28);
  }
  .ui-cursor {
    transition: none;
  }
  .ui-cursor.is-view {
    /* no scale morph; keep a static circle if custom cursor is on */
    width: 72px;
    height: 72px;
    margin: -36px 0 0 -36px;
  }
}
