/* Home page intro slider (views/site/index.php, assets/js/home-intro.js).
   The wheel on one side drives everything: the ring around the active service fills in one autoplay
   delay (--in-dur), a beam carries a spark to the stage, and the stage tells that service's process in
   the same time - four steps light up one by one while the ring closes. */

/* the wheel is pulled past the page edge on purpose; clip it there so the page never scrolls sideways */
[data-intro] {
    overflow-x: clip;
}
[data-intro] .banner .swiper-slide {
    cursor: pointer;
}

/* ---- ring around the active service's icon: starts at the top, closes in one cycle ---- */
[data-intro] .in-icon {
    position: relative;
}
[data-intro] .in-ring {
    position: absolute;
    inset: -4px;
    width: calc(100% + 8px);
    height: calc(100% + 8px);
    transform: rotate(-90deg);
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s;
}
[data-intro] .in-ring circle {
    fill: none;
    stroke: #EE5D38;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
}
[data-intro] .banner .in-fill .in-ring {
    opacity: 1;
}
[data-intro] .banner .in-fill .in-ring circle {
    animation: inRing var(--in-dur, 7000ms) linear forwards;
}
@keyframes inRing {
    to { stroke-dashoffset: 0; }
}

/* ---- beam from the active service to the stage's platform ---- */
.in-beam {
    position: absolute;
    inset: 0;
    z-index: 5; /* over the wheel's indicator, which sits right in its way */
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
    opacity: 0;
    transition: opacity .4s;
}
.in-beam.is-on {
    opacity: 1;
}
.in-beam-path {
    fill: none;
    stroke: url(#inBeamGrad);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-dasharray: 4 8;
    animation: inBeamFlow 1s linear infinite reverse;
}
.in-beam-glow {
    fill: none;
    stroke: url(#inBeamGrad);
    stroke-width: 8;
    stroke-linecap: round;
    opacity: .12;
    filter: blur(4px);
}
.in-beam-dot {
    fill: #fff;
    stroke: #EE5D38;
    stroke-width: 3;
    opacity: 0;
    filter: drop-shadow(0 0 6px #EE5D38);
}
.in-beam-dot.is-flying {
    opacity: 1;
}
@keyframes inBeamFlow {
    to { stroke-dashoffset: 24; }
}
@media (max-width: 1279px) {
    .in-beam {
        display: none;
    }
}

/* ===== the stage ===== */
[data-intro] .tab-content.active {
    animation: none;
}
.hs-wrap {
    position: relative;
}
.hs {
    position: relative;
    z-index: 1;
    padding: 32px 36px 26px;
    border-radius: 32px;
    color: #fff;
    background:
        radial-gradient(420px circle at 22% 38%, rgba(238, 93, 56, .22), transparent 70%),
        radial-gradient(rgba(255, 255, 255, .06) 1px, transparent 1.4px) 0 0 / 18px 18px,
        linear-gradient(150deg, #0E0B26, #1C1747 55%, #241E58);
    box-shadow: 0 34px 70px -34px rgba(17, 14, 45, .8);
}
[dir="ltr"] .hs {
    background:
        radial-gradient(420px circle at 78% 38%, rgba(238, 93, 56, .22), transparent 70%),
        radial-gradient(rgba(255, 255, 255, .06) 1px, transparent 1.4px) 0 0 / 18px 18px,
        linear-gradient(210deg, #0E0B26, #1C1747 55%, #241E58);
}
.hs-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
    align-items: center;
    gap: 22px;
}

/* copy */
.hs-en {
    color: #FF9A6B;
    font-family: Montserrat, MontserratBold, sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
}
[dir="rtl"] .hs-en {
    text-align: right;
}
.hs-title {
    margin-top: 6px;
    font-size: 32px;
    line-height: 1.45;
    color: #fff;
}
.hs-desc {
    margin-top: 12px;
    font-size: 14px;
    line-height: 2.05;
    color: rgba(255, 255, 255, .66);
    text-align: justify;
}
[data-intro] .hs-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
}
[data-intro] .hs-chips li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 999px;
    color: #fff;
    background: rgba(255, 255, 255, .06);
    font-size: 12.5px;
    line-height: 1.7;
}
[data-intro] .hs-chips li::before {
    content: none;
}
[data-intro] .hs-chips svg {
    color: #EE5D38;
}

/* the service's picture, floating over a glowing platform */
.hs-visual {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}
.hs-halo {
    position: absolute;
    top: 46%;
    left: 50%;
    width: 86%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, .95), rgba(255, 255, 255, .55) 45%, rgba(255, 255, 255, 0) 70%);
    transform: translate(-50%, -50%);
}
.hs-orbit {
    position: absolute;
    top: 46%;
    left: 50%;
    width: 98%;
    aspect-ratio: 1;
    border: 1.5px dashed rgba(255, 255, 255, .16);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: hsSpin 40s linear infinite;
}
.hs-orbit-2 {
    width: 74%;
    border-color: rgba(238, 93, 56, .35);
    animation-duration: 28s;
    animation-direction: reverse;
}
@keyframes hsSpin {
    to { transform: translate(-50%, -50%) rotate(1turn); }
}
.hs-art {
    position: relative;
    z-index: 2;
    width: auto;
    max-width: 92%;
    max-height: 250px;
    filter: drop-shadow(0 24px 22px rgba(0, 0, 0, .35));
}
.hs-pad {
    position: absolute;
    bottom: 6%;
    left: 50%;
    z-index: 1;
    width: 72%;
    height: 46px;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(238, 93, 56, .7), rgba(238, 93, 56, .15) 55%, transparent 72%);
    transform: translateX(-50%);
}
.hs-pad span {
    position: absolute;
    inset: 0;
    border: 2px solid rgba(255, 154, 107, .7);
    border-radius: 50%;
    animation: hsPad 2.4s ease-out infinite;
}
.hs-pad.is-hit {
    animation: hsHit .6s ease-out;
}
@keyframes hsPad {
    from { transform: scale(.6); opacity: 1; }
    to { transform: scale(1.25); opacity: 0; }
}
@keyframes hsHit {
    0% { filter: brightness(1); }
    35% { filter: brightness(2.2); }
    100% { filter: brightness(1); }
}

/* ---- process: four steps lit one by one in the same 7 s as the ring ---- */
[data-intro] .hs-steps {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 22px 0 0;
    padding: 0;
    list-style: none;
}
.hs-track {
    position: absolute;
    top: 20px;
    left: 12.5%;
    right: 12.5%;
    height: 3px;
    border-radius: 3px;
    background: rgba(255, 255, 255, .1);
}
.hs-track span {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(270deg, #EE5D38, #FF9A6B);
    transform: scaleX(0);
    transform-origin: right;
}
[dir="ltr"] .hs-track span {
    background: linear-gradient(90deg, #EE5D38, #FF9A6B);
    transform-origin: left;
}
[data-intro] .hs-step {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}
[data-intro] .hs-step::before {
    content: none;
}
.hs-step-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 2px solid rgba(255, 255, 255, .2);
    border-radius: 50%;
    color: rgba(255, 255, 255, .6);
    background: #19143F;
    font-size: 15px;
}
.hs-step-label {
    color: rgba(255, 255, 255, .5);
    font-size: 12.5px;
    line-height: 1.6;
}
[data-intro] .tab-content.active .hs-track span {
    animation: hsTrack var(--in-dur, 7000ms) linear forwards;
}
/* step k lights at (k + 1) quarters of the cycle; the last one together with the ring closing */
[data-intro] .tab-content.active .hs-step-dot {
    animation: hsDot .35s cubic-bezier(.3, 1.6, .5, 1) forwards;
    animation-delay: calc(var(--in-dur, 7000ms) * (var(--k) + 1) / 4 - 350ms);
}
[data-intro] .tab-content.active .hs-step-label {
    animation: hsLabel .35s ease forwards;
    animation-delay: calc(var(--in-dur, 7000ms) * (var(--k) + 1) / 4 - 350ms);
}
@keyframes hsTrack {
    to { transform: scaleX(1); }
}
@keyframes hsDot {
    0% { transform: scale(.85); }
    100% {
        transform: scale(1);
        color: #fff;
        border-color: #fff;
        background: #EE5D38;
        box-shadow: 0 0 0 6px rgba(238, 93, 56, .2), 0 0 22px rgba(238, 93, 56, .7);
    }
}
@keyframes hsLabel {
    to { color: #fff; }
}
[data-intro].in-hold .tab-content.active .hs-track span,
[data-intro].in-hold .tab-content.active .hs-step-dot,
[data-intro].in-hold .tab-content.active .hs-step-label,
[data-intro].in-hold .banner .in-fill .in-ring circle {
    animation-play-state: paused;
}

/* ---- foot: the service's projects, count, actions ---- */
.hs-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px 18px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px dashed rgba(255, 255, 255, .12);
}
.hs-works {
    display: flex;
    align-items: center;
    padding-inline-start: 6px;
}
.hs-work {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 64px;
    margin-inline-start: -12px;
    border: 2px solid #fff;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 20px -10px rgba(0, 0, 0, .7);
    transform: rotate(calc((var(--k) - 1.5) * 4deg));
    transition: transform .3s cubic-bezier(.3, 1.5, .5, 1);
}
.hs-work:first-child {
    margin-inline-start: 0;
}
.hs-work img {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    object-fit: cover;
}
.hs-work img.is-logo {
    width: 72%;
    height: auto;
    object-fit: contain;
}
.hs-work:hover,
.hs-work:focus-visible {
    z-index: 5;
    transform: translateY(-8px) rotate(0) scale(1.12);
    outline: none;
}
.hs-work[data-tip]::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    padding: 4px 10px;
    border-radius: 8px;
    color: #110E2D;
    background: #fff;
    font-size: 11px;
    line-height: 1.6;
    white-space: nowrap;
    opacity: 0;
    transform: translate(-50%, 4px);
    transition: opacity .2s, transform .2s;
    pointer-events: none;
}
.hs-work:hover::after,
.hs-work:focus-visible::after {
    opacity: 1;
    transform: translate(-50%, 0);
}
.hs-work-more {
    color: #fff;
    background: linear-gradient(135deg, #EE5D38, #FF7A4C);
    font-size: 14px;
    font-weight: 700;
}
.hs-count {
    display: flex;
    flex-direction: column;
}
.hs-count strong {
    font-size: 22px;
    line-height: 1.2;
}
.hs-count span {
    color: rgba(255, 255, 255, .55);
    font-size: 11.5px;
}
.hs-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-inline-start: auto;
}
.hs-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: 13px;
    font-size: 13.5px;
    font-weight: 700;
    transition: transform .2s, background .2s;
}
.hs-btn:hover {
    transform: translateY(-2px);
}
.hs-btn-main {
    color: #fff;
    background: linear-gradient(135deg, #EE5D38, #FF7A4C);
    box-shadow: 0 12px 24px -12px rgba(238, 93, 56, .95);
}
.hs-btn-ghost {
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .22);
    background: rgba(255, 255, 255, .05);
}
.hs-btn-ghost:hover {
    background: rgba(255, 255, 255, .12);
}

/* ---- each service comes up from below, the way the wheel turns ---- */
[data-intro] .tab-content.active .hs-wrap {
    animation: hsIn .6s cubic-bezier(.2, .8, .2, 1) both;
}
[data-intro] .tab-content.active .hs-art {
    animation: hsArtIn .8s cubic-bezier(.2, .8, .2, 1) .1s both, hsFloat 6s ease-in-out .9s infinite;
}
[data-intro] .tab-content.active .hs-copy > * {
    animation: hsCopyIn .55s cubic-bezier(.2, .8, .2, 1) both;
}
[data-intro] .tab-content.active .hs-copy > :nth-child(2) { animation-delay: .06s; }
[data-intro] .tab-content.active .hs-copy > :nth-child(3) { animation-delay: .12s; }
[data-intro] .tab-content.active .hs-copy > :nth-child(4) { animation-delay: .18s; }
[data-intro] .tab-content.active .hs-work {
    animation: hsCopyIn .5s cubic-bezier(.3, 1.4, .5, 1) both;
    animation-delay: calc(var(--k) * 70ms + 250ms);
}
@keyframes hsIn {
    from { opacity: 0; translate: 0 34px; }
    to { opacity: 1; translate: 0 0; }
}
@keyframes hsArtIn {
    from { opacity: 0; transform: translateY(50px) scale(.9); }
    to { opacity: 1; transform: none; }
}
@keyframes hsCopyIn {
    from { opacity: 0; translate: 0 16px; }
    to { opacity: 1; translate: 0 0; }
}
@keyframes hsFloat {
    0%, 100% { translate: 0 0; }
    50% { translate: 0 -10px; }
}

@media (max-width: 1279px) {
    .hs-title {
        font-size: 28px;
    }
}
@media (max-width: 909px) {
    .hs {
        padding: 24px 18px 20px;
        border-radius: 26px;
    }
    .hs-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    .hs-visual {
        order: -1;
        min-height: 230px;
    }
    .hs-art {
        max-height: 200px;
    }
    .hs-title {
        font-size: 24px;
    }
    .hs-desc {
        font-size: 13.5px;
    }
    .hs-step-dot {
        width: 36px;
        height: 36px;
        font-size: 13px;
    }
    .hs-track {
        top: 17px;
    }
    .hs-step-label {
        font-size: 11px;
    }
    .hs-actions {
        width: 100%;
        margin-inline-start: 0;
    }
    .hs-btn {
        flex: 1;
        justify-content: center;
    }
}
@media (prefers-reduced-motion: reduce) {
    .hs-orbit,
    .hs-pad span,
    [data-intro] .tab-content.active .hs-wrap,
    [data-intro] .tab-content.active .hs-art,
    [data-intro] .tab-content.active .hs-copy > *,
    [data-intro] .tab-content.active .hs-work,
    .in-beam-path,
    [data-intro] .banner .in-fill .in-ring circle {
        animation: none;
    }
    [data-intro] .tab-content.active .hs-step-dot,
    [data-intro] .tab-content.active .hs-step-label,
    [data-intro] .tab-content.active .hs-track span {
        animation-duration: 1ms;
        animation-delay: 0s;
    }
}

/* ---- two tabs stacked on the stage's top edge, exactly like the "Karzaan AI" box (ai.css .ai-frame__tab) ---- */
.hs-layer {
    position: relative;
    display: block;
    height: 20px;
    border-radius: 30px 30px 0 0;
    box-shadow: 0 -6px 24px -10px rgba(17, 14, 45, .35);
}
.hs-layer-1 {
    margin: 0 59px;
    background: #3A3466;
}
.hs-layer-2 {
    margin: 0 30px;
    background: #2B2652;
}
@media (max-width: 909px) {
    .hs-layer-1 {
        margin: 0 40px;
    }
    .hs-layer-2 {
        margin: 0 20px;
    }
}

/* ---- the notch facing the wheel, part of the stage: the beam plugs in here (--ny from home-intro.js) ---- */
.hs-notch {
    position: absolute;
    top: calc(var(--ny, 50%) - 36px);
    inset-inline-start: -33px;
    z-index: 2;
    width: 34px;
    height: 72px;
    background:
        radial-gradient(rgba(255, 255, 255, .06) 1px, transparent 1.4px) 0 0 / 18px 18px,
        #1B1645;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 74' preserveAspectRatio='none'%3E%3Cpath transform='translate(0 74) rotate(-90)' d='M73.603 0H0C14.1842 0 27.3009 7.53381 34.4478 19.7859L36.8642 23.9282L39.2806 19.7859C46.4065 7.57007 59.4669 0.0443115 73.603 0Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 74' preserveAspectRatio='none'%3E%3Cpath transform='translate(0 74) rotate(-90)' d='M73.603 0H0C14.1842 0 27.3009 7.53381 34.4478 19.7859L36.8642 23.9282L39.2806 19.7859C46.4065 7.57007 59.4669 0.0443115 73.603 0Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
    transition: top .45s cubic-bezier(.2, .8, .2, 1);
}
[dir="ltr"] .hs-notch {
    transform: scaleX(-1);
}
.hs-notch.is-hit {
    animation: hsNotchHit .7s ease-out;
}
@keyframes hsNotchHit {
    0% { filter: brightness(1); }
    35% { filter: brightness(1.9) drop-shadow(0 0 8px rgba(238, 93, 56, .9)); }
    100% { filter: brightness(1); }
}
@media (max-width: 1279px) {
    .hs-notch {
        display: none;
    }
}

/* ---- richer beam: a comet running along it and beads of energy flowing to the stage ---- */
.in-beam-comet {
    fill: none;
    stroke: #FFB48F;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 26 600;
    filter: drop-shadow(0 0 5px #EE5D38);
    /* the comet runs from the wheel toward the stage */
    animation: inComet 1.8s cubic-bezier(.5, 0, .5, 1) infinite;
}
@keyframes inComet {
    from { stroke-dashoffset: 26; }
    to { stroke-dashoffset: calc(var(--len, 600) * -1); }
}
.in-beam-bead {
    fill: #FF9A6B;
    filter: drop-shadow(0 0 4px #EE5D38);
}
.in-beam-glow {
    stroke-width: 10;
    opacity: .16;
}
@media (prefers-reduced-motion: reduce) {
    .in-beam-comet {
        animation: none;
        opacity: 0;
    }
    .in-beam-bead {
        display: none;
    }
}
