/* Annexus pointer interactions (pairs with assets/js/interactions.js).
   Everything is scoped to fine pointers; base rules use :where() so page styles win. */

/* Accent -> spotlight colours (second stop = next colour in logo order) */
:where(.card, [data-spotlight]) { --spot-color: #2D90CF; --spot-color-2: #E53092; }
[data-accent="yellow"] { --spot-color: #F5D010; --spot-color-2: #F89A1C; }
[data-accent="orange"] { --spot-color: #F89A1C; --spot-color-2: #E53092; }
[data-accent="pink"]   { --spot-color: #E53092; --spot-color-2: #2D90CF; }
[data-accent="blue"]   { --spot-color: #2D90CF; --spot-color-2: #71BC7D; }
[data-accent="green"]  { --spot-color: #71BC7D; --spot-color-2: #F5D010; }

@property --tilt-x { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@property --tilt-y { syntax: '<angle>'; inherits: false; initial-value: 0deg; }

@media (hover: hover) and (pointer: fine) {
  /* Native cursor hidden only once JS has a live custom cursor; text fields keep the I-beam. */
  html.has-custom-cursor, html.has-custom-cursor * { cursor: none !important; }
  html.has-custom-cursor :is(input:not([type=button], [type=submit], [type=reset], [type=checkbox], [type=radio]), textarea, select, [contenteditable]) { cursor: auto !important; }

  .ix-dot, .ix-ring, .ix-trail { position: fixed; left: 0; top: 0; pointer-events: none; }
  .ix-trail { width: 100vw; height: 100vh; z-index: 2147483000; }
  .ix-dot, .ix-ring { will-change: transform; transition: opacity .2s ease; }
  .ix-ring { z-index: 2147483001; }
  .ix-dot {
    z-index: 2147483002; width: 6px; height: 6px; margin: -3px 0 0 -3px;
    border-radius: 50%; background: #fff; mix-blend-mode: difference;
  }
  .ix-ring__c {
    position: absolute; left: 0; top: 0; width: 36px; height: 36px;
    display: grid; place-items: center; border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .5); background: rgba(255, 255, 255, 0);
    transform: translate(-50%, -50%);
    transition: width .28s cubic-bezier(.2, .8, .2, 1), height .28s cubic-bezier(.2, .8, .2, 1),
      background-color .28s, border-color .28s, transform .18s ease;
  }
  .ix-ring__l {
    font: 600 11px/1 Outfit, system-ui, sans-serif; letter-spacing: .14em; text-transform: uppercase;
    color: #F4F5FA; white-space: nowrap; opacity: 0; transition: opacity .2s;
  }
  .ix-ring.is-hover .ix-ring__c {
    width: 64px; height: 64px; background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .7);
  }
  .ix-ring.is-label .ix-ring__c { width: 72px; height: 72px; background: rgba(5, 7, 13, .72); }
  .ix-ring.is-label .ix-ring__l { opacity: 1; }
  .ix-ring.is-down .ix-ring__c { transform: translate(-50%, -50%) scale(.78); }
  .ix-dot.is-down { opacity: .4; }
  .ix-dot.is-label { opacity: 0; }
  .is-hidden.ix-dot, .is-hidden.ix-ring, .is-native.ix-dot, .is-native.ix-ring { opacity: 0; }

  /* Spotlight cards: glow follows --mx/--my; ::after lights the 1px border via a mask. */
  :where(.card, [data-spotlight]) { position: relative; isolation: isolate; --mx: 50%; --my: 50%; }
  :where(.card, [data-spotlight])::before,
  :where(.card, [data-spotlight])::after {
    content: ""; position: absolute; border-radius: inherit; pointer-events: none;
    opacity: 0; transition: opacity .35s ease;
  }
  :where(.card, [data-spotlight])::before {
    inset: 0; z-index: -1;
    background: radial-gradient(var(--spot-size, 420px) circle at var(--mx) var(--my),
      color-mix(in srgb, var(--spot-color) 16%, transparent), transparent 62%);
  }
  :where(.card, [data-spotlight])::after {
    inset: calc(-1 * var(--spot-border, 1px)); padding: var(--spot-border, 1px); z-index: 1;
    background: radial-gradient(260px circle at var(--mx) var(--my),
      rgba(255, 255, 255, .9), var(--spot-color) 22%, var(--spot-color-2) 48%, transparent 72%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  }
  :where(.card, [data-spotlight]):hover::before,
  :where(.card, [data-spotlight]):hover::after { opacity: 1; }

  /* Tilt (class present only while active, so idle cards stay un-promoted) */
  :where([data-tilt].ix-tilt) { transform: perspective(900px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y)); }
}
