/* ==========================================================================
   Softrica Animated "How We Work" (Process Steps)
   Left: heading + notched photo that wipes to the active step's photo.
   Right: steps on a rail. The rail fills with scroll, circles lock in.
   ========================================================================== */

.softrica-hw {
    --hw-accent: #f2502c;
    --hw-fill: #f2502c;
    --hw-halo: rgba(242, 80, 44, .18);
    --hw-line: #d9d9df;
    --hw-node: 26px;
    --hw-node-top: 8px;
    --hw-node-border: #c9c9d1;
    --hw-node-dot: #9a9aa4;
    --hw-node-bg: #ffffff;
    --hw-rail-gap: 90px;
    --hw-sticky-top: 140px;
    --hw-radius: 34px;
    --hw-r-tl: 34px;
    --hw-r-tr: 34px;
    --hw-r-br: 34px;
    --hw-r-bl: 34px;
    --hw-notch-w: 42%;
    --hw-notch-h: 27%;
    --hw-dim: .38;
    --hw-ease: cubic-bezier(.22, .8, .2, 1);
    --hw-wipe: cubic-bezier(.77, 0, .18, 1);
    position: relative;
    width: 100%;
    box-sizing: border-box;
    color: #1b1b20;
}
.softrica-hw *,
.softrica-hw *::before,
.softrica-hw *::after { box-sizing: border-box; }

.softrica-hw-empty {
    padding: 28px;
    border: 1px dashed #c9c9d1;
    border-radius: 12px;
    text-align: center;
    color: #6b6b75;
}

/* ---------- Layout ---------- */
.softrica-hw__layout {
    display: grid;
    grid-template-columns: 40% minmax(0, 1fr);
    column-gap: 80px;
    align-items: start;
}
.softrica-hw__side { min-width: 0; }
.softrica-hw.is-sticky .softrica-hw__side {
    position: sticky;
    top: var(--hw-sticky-top);
}

/* JS-pinned fallback (used only when a parent blocks native sticky). */
.softrica-hw.is-sticky.is-js-pin .softrica-hw__side {
    position: relative;
    top: auto;
    will-change: transform;
}

/* ---------- Heading ---------- */
.softrica-hw__eyebrow {
    margin: 0 0 18px;
    font-size: 22px;
    line-height: 1.2;
}
.softrica-hw__title {
    margin: 0;
    font-size: 52px;
    font-weight: 800;
    line-height: 1.02;
    letter-spacing: -.5px;
    text-transform: uppercase;
    color: #1b1b20;
}
.softrica-hw__intro {
    margin: 22px 0 0;
    max-width: 46ch;
    font-size: 17px;
    line-height: 1.6;
    color: #5a5a63;
}

/* Title: each word rises out of its own mask (one orchestrated moment). */
.softrica-hw__w {
    display: inline-block;
    overflow: hidden;
    vertical-align: top;
    padding-bottom: .1em;
    margin-bottom: -.1em;
}
.softrica-hw__w > span { display: inline-block; }
.softrica-hw.has-js .softrica-hw__w > span {
    transform: translateY(110%);
    transition: transform 1s var(--hw-ease);
    transition-delay: calc(var(--hw-i, 0) * 70ms);
}
.softrica-hw.has-js.is-in .softrica-hw__w > span { transform: none; }

.softrica-hw.has-js .softrica-hw__eyebrow,
.softrica-hw.has-js .softrica-hw__intro {
    opacity: 0;
    transition: opacity .9s ease .25s;
}
.softrica-hw.has-js.is-in .softrica-hw__eyebrow,
.softrica-hw.has-js.is-in .softrica-hw__intro { opacity: 1; }

/* ---------- Photo ---------- */
.softrica-hw__media {
    position: relative;
    margin-top: 36px;
}
.softrica-hw__side > .softrica-hw__media:first-child { margin-top: 0; }

.softrica-hw__frame {
    position: relative;
    height: 400px;
    overflow: hidden;
    border-radius: var(--hw-r-tl) var(--hw-r-tr) var(--hw-r-br) var(--hw-r-bl);
    background-color: #e8e8ed;
    isolation: isolate;
}
/* Short screens: keep heading + photo inside the viewport while the column is fixed. */
.softrica-hw.is-sticky .softrica-hw__frame {
    max-height: max(230px, calc(100vh - var(--hw-sticky-top) - 340px));
}
/* JS replaces the radius with an exact notched outline. */
.softrica-hw.has-clip .softrica-hw__frame { border-radius: 0; }

.softrica-hw__slide {
    position: absolute;
    inset: 0;
    z-index: 0;
    visibility: hidden;
    clip-path: inset(100% 0 0 0);
    transition: clip-path 1.05s var(--hw-wipe), visibility 0s linear 1.1s;
}
.softrica-hw__slide img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    transform: scale(1.24);
    transition: transform 1.8s var(--hw-ease);
}
.softrica-hw__slide.is-active {
    visibility: visible;
    clip-path: inset(0 0 0 0);
    transition: clip-path 1.05s var(--hw-wipe), visibility 0s;
}
.softrica-hw__slide.is-active img { transform: scale(1); }
/* The slide being covered stays put underneath, drifting slightly for parallax. */
.softrica-hw__slide.is-leaving {
    visibility: visible;
    clip-path: inset(0 0 0 0);
    transition: none;
}
.softrica-hw__slide.is-leaving img {
    transform: scale(1.08);
    transition: transform 1.2s var(--hw-ease);
}

/* No JavaScript: show the first photo. */
.softrica-hw:not(.has-js) .softrica-hw__slide:first-child {
    visibility: visible;
    clip-path: none;
}
.softrica-hw:not(.has-js) .softrica-hw__slide:first-child img { transform: none; }

/* ---------- Counter (sits in the cut-out corner) ---------- */
.softrica-hw__counter {
    position: absolute;
    right: 0;
    bottom: 0;
    width: var(--hw-notch-w);
    height: var(--hw-notch-h);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding-left: 26px;
    pointer-events: none;
}
.softrica-hw__count-cur {
    display: inline-block;
    overflow: hidden;
    height: 1.05em;
    font-size: 46px;
    font-weight: 300;
    line-height: 1.05;
    font-variant-numeric: tabular-nums;
    color: #f2502c;
}
.softrica-hw__count-val { display: block; }
.softrica-hw__count-val.roll-up { animation: hw-roll-up .7s var(--hw-ease) both; }
.softrica-hw__count-val.roll-down { animation: hw-roll-down .7s var(--hw-ease) both; }
.softrica-hw__count-tot {
    font-size: 15px;
    letter-spacing: .04em;
    color: #8a8a94;
}
.softrica-hw.has-js .softrica-hw__counter { opacity: 0; transition: opacity .8s ease 1.1s; }
.softrica-hw.has-js.is-in .softrica-hw__counter { opacity: 1; }

/* Plain rounded photo: the counter becomes a small label on the photo. */
.softrica-hw.shape-rounded .softrica-hw__counter {
    right: 16px;
    bottom: 16px;
    width: auto;
    height: auto;
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .92);
}
.softrica-hw.shape-rounded .softrica-hw__count-cur { font-size: 26px !important; }

@keyframes hw-roll-up   { from { transform: translateY(85%);  opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes hw-roll-down { from { transform: translateY(-85%); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Steps + rail ---------- */
.softrica-hw__steps {
    position: relative;
    min-width: 0;
}
.softrica-hw__list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.softrica-hw__rail,
.softrica-hw__rail-fill {
    position: absolute;
    left: calc(var(--hw-node) / 2 - 1px);
    top: var(--hw-rail-top, 0px);
    height: var(--hw-rail-h, 100%);
    width: 2px;
    border-radius: 2px;
    pointer-events: none;
}
.softrica-hw__rail { background: var(--hw-line); }
.softrica-hw__rail-fill {
    background: var(--hw-fill);
    transform-origin: 50% 0;
    transform: scaleY(0);
    will-change: transform;
}

.softrica-hw__step {
    position: relative;
    margin: 0;
    padding: 0 0 0 calc(var(--hw-node) + var(--hw-rail-gap));
    min-height: 230px;
}
.softrica-hw__step:last-child { min-height: 0; }

/* Circle */
.softrica-hw__node {
    position: absolute;
    left: 0;
    top: var(--hw-node-top);
    z-index: 2;
    display: grid;
    place-items: center;
    width: var(--hw-node);
    height: var(--hw-node);
    margin: 0;
    padding: 0;
    border: 1.5px solid var(--hw-node-border);
    border-radius: 50%;
    background: var(--hw-node-bg);
    box-shadow: 0 0 0 0 var(--hw-halo);
    cursor: pointer;
    transition: border-color .45s ease, transform .6s var(--hw-ease), box-shadow .6s ease;
    -webkit-appearance: none;
    appearance: none;
}
.softrica-hw__node span {
    display: block;
    width: 28%;
    height: 28%;
    border-radius: 50%;
    background: var(--hw-node-dot);
    transition: background-color .45s ease, transform .6s var(--hw-ease);
}
.softrica-hw__node:focus-visible {
    outline: 2px solid var(--hw-fill);
    outline-offset: 3px;
}
.softrica-hw[data-click="no"] .softrica-hw__node { cursor: default; }

.softrica-hw__step.is-done .softrica-hw__node { border-color: var(--hw-fill); }
.softrica-hw__step.is-done .softrica-hw__node span { background: var(--hw-fill); }

.softrica-hw__step.is-active .softrica-hw__node {
    border-color: var(--hw-fill);
    transform: scale(1.18);
    box-shadow: 0 0 0 7px var(--hw-halo);
}
.softrica-hw__step.is-active .softrica-hw__node span {
    background: var(--hw-fill);
    transform: scale(1.9);
}
.softrica-hw__step.is-active .softrica-hw__node::after {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    border: 1.5px solid var(--hw-fill);
    opacity: 0;
    animation: hw-ping 1.3s ease-out .1s 1 both;
    pointer-events: none;
}
@keyframes hw-ping {
    0%   { transform: scale(1);   opacity: .7; }
    100% { transform: scale(2.3); opacity: 0; }
}

/* Step content */
.softrica-hw__body {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 20px;
    align-items: start;
}
.softrica-hw__num {
    display: block;
    min-width: .72em;
    margin-top: -.06em;
    font-size: 84px;
    font-weight: 300;
    line-height: .95;
    font-variant-numeric: tabular-nums;
    color: #f2502c;
}
.softrica-hw__copy { min-width: 0; padding-top: 2px; }
.softrica-hw__step-title {
    margin: 0 0 8px;
    font-size: 30px;
    font-weight: 800;
    line-height: 1.15;
    color: #1b1b20;
}
.softrica-hw__step-text {
    margin: 0;
    max-width: 44ch;
    font-size: 17px;
    line-height: 1.55;
    color: #55555e;
}

/* Reached / not-yet-reached states (only once JS is running). */
.softrica-hw.has-js .softrica-hw__body {
    transition: opacity .6s ease, transform .8s var(--hw-ease);
}
.softrica-hw.has-js.is-dim .softrica-hw__step .softrica-hw__body { opacity: var(--hw-dim); }
.softrica-hw.has-js.is-dim .softrica-hw__step.is-done .softrica-hw__body { opacity: .72; }
.softrica-hw.has-js.is-dim .softrica-hw__step.is-active .softrica-hw__body { opacity: 1; }

.softrica-hw.has-js .softrica-hw__num {
    transition: transform .8s var(--hw-ease);
    transform: translateY(10px);
}
.softrica-hw.has-js .softrica-hw__step.is-done .softrica-hw__num,
.softrica-hw.has-js .softrica-hw__step.is-active .softrica-hw__num { transform: none; }

/* Per-step photo for stacked layouts only. */
.softrica-hw__inline { display: none; }

/* ---------- Tablet / phone: stack the columns ---------- */
@media (max-width: 880px) {
    .softrica-hw__layout {
        grid-template-columns: minmax(0, 1fr) !important;
        row-gap: 36px;
    }
    .softrica-hw.is-sticky .softrica-hw__side { position: static; }
    .softrica-hw__media { display: none; }
    .softrica-hw__step { min-height: 0 !important; padding-bottom: 44px; }
    .softrica-hw__step:last-child { padding-bottom: 0; }
    .softrica-hw__inline {
        display: block;
        grid-column: 1 / -1;
        margin-top: 18px;
        overflow: hidden;
        border-radius: 18px;
        background: #e8e8ed;
        aspect-ratio: 16 / 10;
    }
    .softrica-hw__inline img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}
@media (max-width: 520px) {
    .softrica-hw__body { column-gap: 14px; }
}

/* ---------- Reduced motion: everything is simply shown ---------- */
@media (prefers-reduced-motion: reduce) {
    .softrica-hw *,
    .softrica-hw *::before,
    .softrica-hw *::after {
        animation: none !important;
        transition: none !important;
    }
    .softrica-hw.has-js .softrica-hw__w > span,
    .softrica-hw.has-js .softrica-hw__num { transform: none; }
    .softrica-hw.has-js .softrica-hw__eyebrow,
    .softrica-hw.has-js .softrica-hw__intro,
    .softrica-hw.has-js .softrica-hw__counter { opacity: 1; }
    .softrica-hw__slide img { transform: none; }
}
