/* Aimlink | React Bits ports (styles for assets/rb.js).
   Every effect here is a vanilla port of a component from the React Bits library (reactbits.dev, MIT + Commons Clause),
   re-drawn in Aimlink's tokens. Each one is opt-in from rb.js; without the script the page is exactly what the HTML says.
   Rules kept: lime only on dark, will-change only while a card is tilted, no animated width/height/top/left, nothing that only lives in a canvas,
   reduced motion gets the finished state. */

/* ───────────── shared ───────────── */
.rb-sw { display: inline-block; white-space: nowrap; }
.rb-ch { display: inline-block; }

/* ───────────── Counter (proof number): digits roll like an odometer ───────────── */
.rb-ctr { display: inline-flex; align-items: flex-start; }
.rb-ctr .rb-sep { display: block; height: 1em; line-height: 1; }
.rb-col { display: block; height: 1em; overflow: hidden; line-height: 1; text-align: center; }
.rb-strip { display: block; transition: transform 1700ms cubic-bezier(0.16, 1, 0.3, 1); transition-delay: calc(var(--k, 0) * 110ms); }
.rb-strip > span { display: block; height: 1em; line-height: 1; }

/* ───────────── GooeyNav (News: year links): a pill that stretches from link to link ───────────── */
.np-years { position: relative; }
.np-years > a { position: relative; z-index: 1; }
.rb-gloo {
  position: absolute; left: 0; top: 0; z-index: 0; width: 58px; height: 44px; border-radius: var(--radius-pill);
  background: var(--bg-alt); box-shadow: inset 0 0 0 1px var(--line); opacity: 0; pointer-events: none; transform-origin: 0 0;
  transition: opacity var(--duration-hover) var(--ease-hover);
}
.rb-gloo.is-on { opacity: 1; }

/* ───────────── BorderGlow (GO / CLUB / TARGET: the three numbers on dark).
   The hairline is a solid 1px bar inside the row. The border keeps its 1px of space but stays
   transparent, and the wash starts one pixel lower, so nothing can cover or clip the line. ───────────── */
.rb .rest-stats > div { position: relative; border-top-color: transparent; }
.rb .rest-stats > div::before {
  content: ""; position: absolute; z-index: 1; left: 0; right: 0; top: 0; height: 1px; pointer-events: none;
  background: var(--line); transition: background-color var(--duration-hover) var(--ease-hover);
}
.rb .rest-stats > div::after {
  content: ""; position: absolute; z-index: 0; left: 0; right: 0; top: 1px; height: 3.5rem; pointer-events: none; opacity: 0;
  background: radial-gradient(240px 3.5rem at var(--mx, 50%) 0, rgb(160 224 32 / 0.16), transparent 70%);
  transition: opacity var(--duration-hover) var(--ease-hover);
}
@media (hover: hover) and (pointer: fine) {
  .rb .rest-stats > div:hover { border-top-color: transparent; }
  .rb .rest-stats > div:hover::before { background: var(--text); }
  .rb .rest-stats > div:hover::after { opacity: 1; }
}

/* ───────────── SpotlightCard (GO / CLUB / TARGET: "Everything in …"): a soft light follows the pointer ───────────── */
.rb .index-group { position: relative; isolation: isolate; }
.rb .index-group::before {
  content: ""; position: absolute; inset: calc(var(--space-3) * -1) calc(var(--space-4) * -1); z-index: -1; border-radius: var(--radius-icon);
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgb(12 20 28 / 0.07), transparent 70%);
  opacity: 0; pointer-events: none; transition: opacity var(--duration-hover) var(--ease-hover);
}
@media (hover: hover) and (pointer: fine) { .rb .index-group:hover::before { opacity: 1; } }

/* ───────────── GlareHover (News: story pictures): one diagonal sheen across the picture ───────────── */
.np-media { position: relative; overflow: hidden; }
.np-media::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: linear-gradient(115deg, transparent 38%, rgb(255 255 255 / 0.3) 50%, transparent 62%) -140% 0 / 260% 100% no-repeat;
}
@media (hover: hover) and (pointer: fine) {
  .np-open:hover .np-media::after, .np-open:focus-visible .np-media::after {
    opacity: 1; background-position: 140% 0; transition: background-position 900ms var(--ease-out);
  }
}

/* ───────────── RubberSegment (Contact: "Who are you?"): one thumb stretches to the chosen chip ───────────── */
.cp-chips.rb-seg { position: relative; }
.cp-chips.rb-seg .cp-chip { position: relative; z-index: 1; }
.cp-chips.rb-seg :checked + .chip { background: transparent; box-shadow: inset 0 0 0 2px transparent; color: var(--action-fg); }
.rb-seg-thumb {
  position: absolute; left: 0; top: 0; z-index: 0; width: 100px; height: 44px; border-radius: var(--radius-pill);
  background: var(--action-bg); transform-origin: 0 0; pointer-events: none;
}

/* ───────────── StatusMark (Contact: Copy the address): the tick draws itself ───────────── */
.rb-check { display: none; width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.rb-check path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.rb-copied .rb-check { display: block; }
.rb-copied .rb-check path { animation: rb-tick 420ms var(--ease-out) 40ms forwards; }
@keyframes rb-tick { to { stroke-dashoffset: 0; } }

/* ───────────── WarmTooltip (the social icons): the first waits, the next ones are there at once ───────────── */
.rb-tip {
  position: fixed; left: 0; top: 0; z-index: var(--z-menu, 60); max-width: 16rem; padding: 7px 12px 6px; border-radius: 10px;
  background: var(--color-night); color: var(--color-snow); box-shadow: var(--shadow-md, 0 6px 20px rgb(12 20 28 / 0.28));
  font: 700 var(--type-label-size)/1.2 var(--font-text); letter-spacing: var(--type-label-tracking); text-transform: uppercase;
  white-space: nowrap; pointer-events: none; opacity: 0; transform: translate3d(var(--tx, 0), var(--ty, 0), 0) scale(0.94);
  transform-origin: 50% 100%; transition: opacity var(--duration-exit) var(--ease-out), transform var(--duration-exit) var(--ease-out);
}
.rb-tip.is-light { background: var(--color-snow); color: var(--color-night); }
.rb-tip.is-on { opacity: 1; transform: translate3d(var(--tx, 0), var(--ty, 0), 0) scale(1); }
.rb-tip.is-flip { transform-origin: 50% 0; }
.rb-tip.is-instant { transition-duration: 0ms; }

/* ───────────── ImageTrail (Contact hero): bullet holes follow the pointer ───────────── */
.rb-trail { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.rb-hole { position: absolute; width: 34px; height: 34px; margin: -17px 0 0 -17px; opacity: 0; animation: rb-hole 2200ms var(--ease-out) forwards; }
.rb-hole svg { display: block; width: 100%; height: 100%; }
.rb-hole::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid var(--color-lime); opacity: 0;
  animation: rb-hole-ring 620ms var(--ease-out) forwards;
}
@keyframes rb-hole {
  0% { opacity: 0; transform: scale(0.35) rotate(var(--r, 0deg)); }
  6% { opacity: 1; transform: scale(1.14) rotate(var(--r, 0deg)); }
  12% { transform: scale(1) rotate(var(--r, 0deg)); }
  70% { opacity: 0.92; transform: scale(1) rotate(var(--r, 0deg)); }
  100% { opacity: 0; transform: scale(1) rotate(var(--r, 0deg)); }
}
@keyframes rb-hole-ring { 0% { opacity: 0.85; transform: scale(0.5); } 100% { opacity: 0; transform: scale(2); } }

/* ───────────── MagnetLines (About: the closing call): a field of needles that all aim at you ───────────── */
.about-close { position: relative; overflow: clip; }
.about-close .container { position: relative; }
.rb-ml {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
  -webkit-mask-image: radial-gradient(ellipse 62% 70% at 50% 50%, transparent 0 34%, #000 78%);
  mask-image: radial-gradient(ellipse 62% 70% at 50% 50%, transparent 0 34%, #000 78%);
}
.rb-ml i {
  position: absolute; width: 2px; height: 22px; margin: -11px 0 0 -1px; border-radius: 2px;
  background: rgb(12 20 28 / 0.2); rotate: var(--a, 0deg);
}

/* ───────────── Noise (dark photo plates): film grain, still ───────────── */
.proof-plate, .rest-plate { overflow: clip; }
.close-plate, .bfc-plate-frame { position: relative; }
.rb-noise {
  position: absolute; inset: -64px; z-index: 1; pointer-events: none; background: var(--rb-noise) 0 0 / 128px 128px; opacity: 0.4;
}
.rb-noise.is-live { animation: rb-grain 900ms steps(1, end) infinite; }
@keyframes rb-grain {
  0% { transform: translate(0, 0); } 17% { transform: translate(-23px, 17px); } 34% { transform: translate(31px, -27px); }
  51% { transform: translate(-19px, -34px); } 68% { transform: translate(27px, 21px); } 85% { transform: translate(-37px, 5px); }
}

/* ───────────── TrueFocus (start page statement): a sight hops from word to word ───────────── */
.statement-line { position: relative; }
.rb-fw { display: inline-block; transition: opacity 320ms var(--ease-out); }
.rb-fw.is-dim { opacity: 0.32; }
.rb-focus { position: absolute; left: 0; top: 0; width: 0; height: 0; pointer-events: none; opacity: 0; transition: opacity 240ms var(--ease-out); }
.rb-focus.is-on { opacity: 1; }
.rb-focus i {
  position: absolute; left: 0; top: 0; width: 18px; height: 18px; border: 0 solid var(--text);
  transition: transform 460ms var(--ease-in-out);
}
.rb-focus.is-still i { transition: none; }
.rb-focus i:nth-child(1) { border-top-width: 3px; border-left-width: 3px; }
.rb-focus i:nth-child(2) { border-top-width: 3px; border-right-width: 3px; }
.rb-focus i:nth-child(3) { border-bottom-width: 3px; border-right-width: 3px; }
.rb-focus i:nth-child(4) { border-bottom-width: 3px; border-left-width: 3px; }

/* ───────────── ShinyText (accent words on dark): one sweep of light when the heading arrives ───────────── */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .rb-shine {
    background-image: linear-gradient(105deg, var(--emphasis) 36%, var(--color-white) 50%, var(--emphasis) 64%) !important;
    background-size: 300% 100%; background-position: 125% 0; background-repeat: no-repeat;
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
    animation: rb-shine 1300ms var(--ease-out) both;
  }
}
@keyframes rb-shine { from { background-position: 125% 0; } to { background-position: -25% 0; } }

/* ───────────── ScrollFloat / VariableProximity helpers ───────────── */
.rb-float .rb-ch { transform-origin: 50% 0; }
.rb-vp .rb-ch { text-align: center; }

/* ───────────── GradualBlur (dialogs): the text melts under the bottom edge ───────────── */
.rb-gblur { position: sticky; bottom: 0; z-index: 3; height: 64px; margin-top: -64px; pointer-events: none; }
.rb-gblur i { position: absolute; inset: 0; }
.rb-gblur i:nth-child(1) { backdrop-filter: blur(0.5px); -webkit-backdrop-filter: blur(0.5px); -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 25%, #000 50%, transparent 62%); mask-image: linear-gradient(180deg, transparent 0%, #000 25%, #000 50%, transparent 62%); }
.rb-gblur i:nth-child(2) { backdrop-filter: blur(1.5px); -webkit-backdrop-filter: blur(1.5px); -webkit-mask-image: linear-gradient(180deg, transparent 25%, #000 50%, #000 75%, transparent 87%); mask-image: linear-gradient(180deg, transparent 25%, #000 50%, #000 75%, transparent 87%); }
.rb-gblur i:nth-child(3) { backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); -webkit-mask-image: linear-gradient(180deg, transparent 50%, #000 75%); mask-image: linear-gradient(180deg, transparent 50%, #000 75%); }

@media (prefers-reduced-motion: reduce) {
  .rb-strip { transition: none; }
  .rb-noise.is-live { animation: none; }
  .rb-shine { animation: none; }
  .rb-hole, .rb-hole::after { animation: none; }
  .rb-tip, .rb-focus, .rb-focus i, .rb-fw { transition-duration: 0ms; }
}


/* ───────────── The Privacy, FAQ and Explainer pages ───────────── */
/* SpotlightCard on the ask cards ("Didn't find your answer?", "Questions about your data?", "Questions?" on Pricing): a soft light follows the pointer */
.rb .fq-ask, .rb .pv-ask, .rb .pr-ask { isolation: isolate; }
.rb .fq-ask::before, .rb .pv-ask::before, .rb .pr-ask::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%), rgb(84 120 32 / 0.14), transparent 70%);
  opacity: 0; pointer-events: none; transition: opacity var(--duration-hover) var(--ease-hover);
}
.rb .pv-ask { position: relative; }
@media (hover: hover) and (pointer: fine) { .rb .fq-ask:hover::before, .rb .pv-ask:hover::before, .rb .pr-ask:hover::before { opacity: 1; } }

/* RubberSegment on the FAQ filters: the pressed chip hands its fill to the thumb */
.fq-chips.rb-seg2 { position: relative; }
.fq-chips.rb-seg2 .chip { position: relative; z-index: 1; }
.fq-chips.rb-seg2 .chip[aria-pressed="true"] { background: transparent; box-shadow: inset 0 0 0 2px transparent; color: var(--action-fg); }
.fq-chips.rb-seg2 .rb-seg-thumb { opacity: 0; }

/* StatusMark on "Copy link": the tick draws itself in front of "Link copied" */
.fq-copy .rb-check { width: 14px; height: 14px; }

/* GlareHover on the films: one diagonal sheen across the picture */
.xp-video::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0;
  background: linear-gradient(115deg, transparent 38%, rgb(255 255 255 / 0.22) 50%, transparent 62%) -140% 0 / 260% 100% no-repeat;
}
@media (hover: hover) and (pointer: fine) {
  .xp-video:hover:not(:has(iframe))::after { opacity: 1; background-position: 140% 0; transition: background-position 900ms var(--ease-out); }
}

/* GradualBlur on the strip of guides: the cards melt under the right edge, so you can see there is more to swipe */
.xp-strip-wrap { position: relative; }
.xp-strip-wrap::before, .xp-strip-wrap::after { content: ""; position: absolute; top: 0; bottom: 0; right: 0; z-index: 2; pointer-events: none; }
.xp-strip-wrap::before { width: 120px; backdrop-filter: blur(1.5px); -webkit-backdrop-filter: blur(1.5px); -webkit-mask-image: linear-gradient(90deg, transparent, #000 70%); mask-image: linear-gradient(90deg, transparent, #000 70%); }
.xp-strip-wrap::after { width: 64px; backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); -webkit-mask-image: linear-gradient(90deg, transparent, #000 80%); mask-image: linear-gradient(90deg, transparent, #000 80%); }

/* MagicRings: the canvas takes over from the CSS rings (which stay as the still, without JS and with reduced motion) */
.rb-mr-on { background: none !important; }
.rb-mr { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* TiltedCard: the films lean towards the pointer (the lean is set by rb.js) */
.rb-tilt { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform 380ms var(--ease-out); }
.rb-tilt.is-tilting { will-change: transform; }
.rb-tilt:hover { transition-duration: 120ms; }
@media (prefers-reduced-motion: reduce) { .rb-tilt { transform: none !important; } }
