/*
 * RahaJob motion layer
 * Pointer and scroll effects for the public pages, driven by site_motion.js and aous_aw_motion.js.
 * Light sky only. Every pointer effect needs a fine pointer; everything stops with reduced motion.
 */

:root {
    --rj-ease: cubic-bezier(0.16, 1, 0.3, 1);
    --rj-sky: 66, 153, 225;
    --rj-deep: 29, 111, 176;
}

/* ── Hero: a soft light and a dot grid that follow the pointer ───────── */

.hero_bg_grid,
.hero_bg_spot {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

/* the dots only show inside a circle around the pointer */
.hero_bg_grid {
    background-image: radial-gradient(rgba(var(--rj-deep), 0.22) 1px, transparent 1.4px);
    background-size: 22px 22px;
    -webkit-mask-image: radial-gradient(22rem 22rem at var(--hx, 50%) var(--hy, 40%), #000 0%, transparent 70%);
    mask-image: radial-gradient(22rem 22rem at var(--hx, 50%) var(--hy, 40%), #000 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.6s ease;
}

.hero_bg_spot {
    background: radial-gradient(34rem 34rem at var(--hx, 50%) var(--hy, 40%), rgba(255, 255, 255, 0.55) 0%, rgba(var(--rj-sky), 0.1) 35%, transparent 65%);
    opacity: 0;
    transition: opacity 0.6s ease;
}

.hero_area.is_pointer .hero_bg_grid,
.hero_area.is_pointer .hero_bg_spot {
    opacity: 1;
}

/* the orbs drift away from the pointer; translate keeps their own drift animation */
.hero_bg_orb {
    transition: translate 1.2s var(--rj-ease);
}

/* the changing word catches a slow light */
.hero_title_word.is_active {
    background-size: 220% 100%;
    animation: rjWordShine 6s ease-in-out infinite;
}

@keyframes rjWordShine {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* ── Hero search bar: a glowing edge under the pointer, a moving ring on focus ── */

.hero_area .hero_content .form_area .form_input_area[data-rj-glow]::before {
    content: "";
    position: absolute;
    inset: -1px;
    z-index: -1;
    padding: 1.5px;
    border-radius: inherit;
    background: radial-gradient(14rem 6rem at var(--gx, 50%) var(--gy, 50%), rgba(var(--rj-sky), 0.9), rgba(var(--rj-sky), 0) 90%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

.hero_area .hero_content .form_area .form_input_area[data-rj-glow].is_glow::before {
    opacity: 1;
}

.hero_area .hero_content .form_area .form_input_area[data-rj-glow]:focus-within::before {
    opacity: 1;
    background: conic-gradient(from var(--rj-turn, 0deg), rgba(var(--rj-sky), 0.1), rgba(var(--rj-sky), 0.95), rgba(var(--rj-deep), 0.5), rgba(var(--rj-sky), 0.1) 60%);
    animation: rjTurn 3.2s linear infinite;
}

@property --rj-turn {
    syntax: "<angle>";
    inherits: false;
    initial-value: 0deg;
}

@keyframes rjTurn {
    to {
        --rj-turn: 360deg;
    }
}

/* ── Hero quick categories: one after another, then they follow the pointer ── */

.hero_content .hero_quick_cats {
    animation: none;
}

.hero_quick_cat {
    animation: rjChipIn 0.7s var(--rj-ease) both;
    animation-delay: calc(0.5s + var(--i, 0) * 0.06s);
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, translate 0.45s var(--rj-ease);
}

@keyframes rjChipIn {
    from {
        opacity: 0;
        translate: 0 12px;
        filter: blur(4px);
    }

    to {
        opacity: 1;
        translate: 0 0;
        filter: none;
    }
}

/* once in, the pointer owns translate again */
.hero_quick_cat.is_in {
    animation: none;
}

.hsc_btn[data-aw-magnetic],
.hai_cta[data-aw-magnetic] {
    transition: background-color 0.2s ease, translate 0.45s var(--rj-ease);
}

/* ── Cards that rise one after another ([data-rj-rise] on the grid) ───── */

.rj_rise_ready>* {
    opacity: 0;
}

.rj_rise_ready.is_risen>* {
    animation: rjRise 0.9s var(--rj-ease) both;
    animation-delay: calc(var(--rj-i, 0) * 0.07s);
}

@keyframes rjRise {
    from {
        opacity: 0;
        translate: 0 28px;
    }

    to {
        opacity: 1;
        translate: 0 0;
    }
}

/* ── Tilt + light inside the card ([data-rj-tilt]) ───────────────────── */

.hjw_grid,
.hct_grid {
    perspective: 1400px;
}

[data-rj-tilt] {
    position: relative;
    rotate: var(--tx, 0) var(--ty, 0) 0 var(--ta, 0deg);
}

.hjw_card[data-rj-tilt] {
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, opacity 0.45s ease, rotate 0.5s var(--rj-ease);
}

.hct_card[data-rj-tilt] {
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, rotate 0.5s var(--rj-ease);
}

/* while the pointer moves the card follows it closely */
.hjw_card[data-rj-tilt].is_tilting {
    transition-duration: 0.2s, 0.2s, 0.2s, 0.45s, 0.12s;
}

.hct_card[data-rj-tilt].is_tilting {
    transition-duration: 0.2s, 0.2s, 0.2s, 0.12s;
}

[data-rj-tilt]::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    border-radius: inherit;
    background: radial-gradient(18rem 18rem at var(--mx, 50%) var(--my, 0%), rgba(var(--rj-sky), 0.12), transparent 60%);
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

[data-rj-tilt].is_tilting::after {
    opacity: 1;
}

/* ── Job card: the seeker's match score as a ring ────────────────────── */

.hjw_match {
    position: relative;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 3rem;
    height: 3rem;
}

.hjw_match svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    rotate: -90deg;
}

.hjw_match circle {
    fill: none;
    stroke-width: 3;
}

.hjw_match_bg {
    stroke: #e4effa;
}

.hjw_match_val {
    stroke: var(--accent-color);
    stroke-linecap: round;
    stroke-dasharray: 100;
    stroke-dashoffset: calc(100 - var(--match, 0));
    transition: stroke-dashoffset 1.4s var(--rj-ease) 0.3s;
}

.hjw_match b {
    color: #1d5f99;
    font-size: 0.72rem;
    font-weight: 600;
}

/* the ring fills when the card comes in */
.hjw_card.pre_reveal .hjw_match_val {
    stroke-dashoffset: 100;
}

/* ── Categories: the icon lifts and turns a little on hover ──────────── */

html:is([dir], :not([dir])) .hct_card .hct_icon {
    transition: transform 0.5s var(--rj-ease);
}

html:is([dir], :not([dir])) .hct_card:hover .hct_icon {
    transform: translateY(-4px) rotate(-6deg) scale(1.06);
}

/* ── Partners: the strip slows on hover and the logo under the pointer stands out ── */

.home_partners_scroller:hover .home_partners_track {
    animation-play-state: running;
}

.home_partners_track:hover .home_partners_logo img {
    filter: grayscale(1);
    opacity: 0.45;
}

.home_partners_track:hover .home_partners_logo a:hover img {
    filter: none;
    opacity: 1;
}

/* ── Enhance button: only the icon, the words slide out on hover ──── */

@media (min-width: 992px) {
    .enhance_fab {
        gap: 0;
        padding-inline: 0.55rem;
        transition: background 0.2s ease, transform 0.2s ease, gap 0.35s var(--rj-ease), padding 0.35s var(--rj-ease);
    }

    .enhance_fab_label {
        max-width: 0;
        overflow: hidden;
        white-space: nowrap;
        opacity: 0;
        transition: max-width 0.45s var(--rj-ease), opacity 0.25s ease;
    }

    .enhance_fab:hover,
    .enhance_fab:focus-visible {
        gap: 0.55rem;
        padding-inline: 0.55rem 1.15rem;
    }

    .enhance_fab:hover .enhance_fab_label,
    .enhance_fab:focus-visible .enhance_fab_label {
        max-width: 16rem;
        opacity: 1;
    }
}

/* ── Without motion everything shows as drawn ───────────────────────── */

@media (prefers-reduced-motion: reduce) {

    .hero_bg_grid,
    .hero_bg_spot {
        display: none;
    }

    .hero_title_word.is_active,
    .hero_quick_cat,
    .rj_rise_ready.is_risen>*,
    .hero_area .hero_content .form_area .form_input_area[data-rj-glow]:focus-within::before {
        animation: none;
    }

    .rj_rise_ready>* {
        opacity: 1;
    }

    [data-rj-tilt] {
        rotate: none;
    }
}

/* the hero search keeps a hairline edge, not a big drop shadow */
.hero_area .hero_content .form_area .form_input_area {
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05), inset 0 0 0 1px rgba(66, 153, 225, 0.14);
}

.hero_area .hero_content .form_area .btn_action .btn,
.hero_area .hero_content .form_area .btn_action .btn:hover {
    box-shadow: none;
}

.hero_area .hero_content .form_area .form_input_area:focus-within {
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 0 0 4px rgba(66, 153, 225, 0.12);
}
