/* Home page «website design»: a site that builds itself while the visitor scrolls (views/site/_web-build.php,
   assets/js/home-webbuild.js). The stage reads data-stage 1–4 from the step in view. */
.wb { position: relative; z-index: 2; margin-top: 150px; overflow-x: clip; }
.wb__frame {
    position: relative;
    isolation: isolate;
    padding: 44px;
    border-radius: 36px;
    color: #fff;
    overflow: clip;
    background: radial-gradient(70% 80% at 85% 6%, #9B7BFF, transparent 70%), radial-gradient(60% 60% at 10% 100%, rgba(255, 122, 89, .35), transparent 70%), linear-gradient(150deg, #4C33C9, #22146B);
    box-shadow: 0 -18px 50px -30px rgba(17, 14, 45, .5), 0 34px 70px -34px rgba(34, 20, 107, .8);
}
html[dir="rtl"] .wb__frame { background: radial-gradient(70% 80% at 15% 6%, #9B7BFF, transparent 70%), radial-gradient(60% 60% at 90% 100%, rgba(255, 122, 89, .35), transparent 70%), linear-gradient(210deg, #4C33C9, #22146B); }
.wb__frame::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: radial-gradient(rgba(255, 255, 255, .14) 1px, transparent 1.5px);
    background-size: 22px 22px;
    -webkit-mask-image: linear-gradient(180deg, #000, transparent 70%);
    mask-image: linear-gradient(180deg, #000, transparent 70%);
}

/* --- header --- */
.wb__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; }
.wb__intro { max-width: 620px; }
.wb__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 6px 14px 6px 6px;
    border-radius: 30px;
    background: rgba(255, 255, 255, .14);
    font-size: 12px;
}
html[dir="rtl"] .wb__eyebrow { padding: 6px 6px 6px 14px; }
.wb__eyebrow-ico { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #fff; color: #5B3FD6; }
.wb__title { margin: 16px 0 8px; color: #fff; font-size: clamp(30px, 3.4vw, 46px); line-height: 1.3; }
.wb__lead { margin: 0; color: rgba(255, 255, 255, .8); font-size: 14px; line-height: 2.05; }
.wb__actions { display: flex; gap: 10px; flex-shrink: 0; }
.wb__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 15px;
    background: #fff;
    color: #22146B;
    font-size: 13px;
    font-weight: 700;
    transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease;
}
.wb__btn:hover { transform: translateY(-2px); box-shadow: 0 14px 26px -14px rgba(0, 0, 0, .6); }
.wb__btn--ghost { background: transparent; color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .4); }
.wb__btn--ghost:hover { background: rgba(255, 255, 255, .1); }

/* --- the story: steps beside the sticky stage --- */
.wb__story { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; margin-top: 20px; }
.wb__steps { display: flex; flex-direction: column; }
.wb-step {
    min-height: 62vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    opacity: .3;
    transition: opacity .5s ease;
    cursor: pointer;
}
.wb-step:last-child { min-height: 70vh; }
.wb-step.is-active { opacity: 1; }
.wb-step__top { display: flex; align-items: center; gap: 12px; }
.wb-step__num { font-size: 46px; line-height: 1; color: transparent; -webkit-text-stroke: 1.5px rgba(255, 255, 255, .9); }
.wb-step.is-active .wb-step__num { color: #fff; -webkit-text-stroke: 0; }
.wb-step__chip { padding: 4px 12px; border-radius: 20px; background: rgba(255, 255, 255, .14); font-size: 11px; }
.wb-step__title { margin: 16px 0 10px; color: #fff; font-size: clamp(20px, 2vw, 26px); line-height: 1.5; }
.wb-step__text { margin: 0; color: rgba(255, 255, 255, .78); font-size: 14px; line-height: 2.1; }
.wb__stage-wrap { position: relative; }
.wb__stage {
    position: sticky;
    top: max(100px, calc(50vh - 250px));
    height: 470px;
    margin-top: 60px;
    direction: ltr;
}

/* progress dots */
.wb-progress { position: absolute; top: 0; right: 0; display: flex; gap: 6px; }
.wb-progress i { width: 22px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .25); transition: background-color .4s ease, width .4s ease; }
.wb__stage[data-stage="1"] .wb-progress i[data-n="1"],
.wb__stage[data-stage="2"] .wb-progress i:nth-child(-n+2),
.wb__stage[data-stage="3"] .wb-progress i:nth-child(-n+3),
.wb__stage[data-stage="4"] .wb-progress i { background: #fff; }

/* --- the browser --- */
.wb-browser { position: absolute; top: 40px; left: 0; right: 70px; perspective: 1600px; }
.wb-browser__card { position: relative; transform-style: preserve-3d; transition: transform 1.1s cubic-bezier(.2, .7, .2, 1); }
.wb-browser__front, .wb-browser__back {
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 40px 70px -30px rgba(10, 6, 40, .8);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}
.wb-browser__front { position: relative; overflow: hidden; transform-style: preserve-3d; transition: background-color .6s ease, box-shadow .6s ease; }
.wb-browser__back { position: absolute; inset: 0; overflow: hidden; background: #140F38; transform: rotateY(180deg); }
.wb-bar { display: flex; align-items: center; gap: 5px; padding: 9px 12px; background: #EEEDF5; transition: opacity .5s ease; }
.wb-bar i { width: 8px; height: 8px; border-radius: 50%; background: #CAC7DA; }
.wb-bar i:nth-child(1) { background: #FF6B5E; }
.wb-bar i:nth-child(2) { background: #FFC23D; }
.wb-bar i:nth-child(3) { background: #3DCB6C; }
.wb-bar span { margin-left: 10px; padding: 2px 14px; border-radius: 8px; background: #fff; color: #6E6B85; font-size: 11px; }
.wb-browser__back .wb-bar { background: #1D1650; }
.wb-browser__back .wb-bar span { background: #2A2266; color: #CFC8FF; }
.wb-browser__back pre { margin: 0; padding: 18px 20px; color: #E6E1FF; font: 500 12px/1.9 MontserratLtr, monospace; white-space: pre-wrap; direction: ltr; text-align: left; }
.wb-browser__back .c1 { color: #FF8F73; }
.wb-browser__back .c2 { color: #9BD8FF; }
.wb-browser__back .c3 { color: #B9F5A6; }
.wb-browser__back .c4 { color: #8F87C9; }

/* the page inside: a wireframe at first */
.wb-page { display: flex; flex-direction: column; gap: 12px; padding: 14px; transform-style: preserve-3d; }
.wb-layer { position: relative; border-radius: 10px; border: 1.5px dashed #CFCBE3; transition: transform 1s cubic-bezier(.2, .7, .2, 1), background-color .6s ease, border-color .6s ease, box-shadow .6s ease; }
.wb-layer--nav { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.wb-layer--nav i { width: 34px; height: 6px; border-radius: 3px; background: #E4E2EE; }
.wb-logo { display: block; flex: none; width: 24px; height: 24px; border-radius: 8px; border: 1.5px dashed #CFCBE3; transition: background .6s ease, border-color .6s ease; }
.wb-cta-sm { display: block; width: 56px; height: 20px; margin-left: auto; border-radius: 7px; border: 1.5px dashed #CFCBE3; transition: background .6s ease, border-color .6s ease; }
.wb-layer--main { padding: 12px; }
.wb-hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 14px; align-items: center; }
.wb-h1 { display: block; width: 90%; height: 14px; margin-bottom: 8px; border-radius: 5px; background: #E4E2EE; transition: background-color .6s ease; }
.wb-h1--short { width: 62%; }
.wb-line { display: block; width: 86%; height: 6px; margin-bottom: 6px; border-radius: 3px; background: #EEEDF5; }
.wb-line--short { width: 55%; }
.wb-btn-mock { display: block; width: 86px; height: 24px; margin-top: 12px; border-radius: 8px; border: 1.5px dashed #CFCBE3; transition: background .6s ease, border-color .6s ease, transform .2s ease; }
.wb-hero__img { min-height: 118px; border-radius: 12px; border: 1.5px dashed #CFCBE3; background: repeating-linear-gradient(45deg, transparent 0 8px, #F3F2F8 8px 9px); transition: background .6s ease, border-color .6s ease; }
.wb-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.wb-cards span { height: 56px; border-radius: 10px; border: 1.5px dashed #CFCBE3; transition: background-color .6s ease, border-color .6s ease; }
.wb-layer--foot { display: flex; gap: 10px; padding: 10px; }
.wb-layer--foot i { width: 50px; height: 6px; border-radius: 3px; background: #E4E2EE; transition: background-color .6s ease; }

/* step 1: a cursor tries the page */
.wb-cursor { position: absolute; left: 30%; top: 70%; z-index: 3; opacity: 0; transition: opacity .4s ease; pointer-events: none; }
.wb__stage[data-stage="1"] .wb-cursor { opacity: 1; animation: wbCursor 4.5s ease-in-out infinite; }
@keyframes wbCursor {
    0% { left: 70%; top: 78%; }
    30% { left: 16%; top: 62%; }
    38%, 44% { left: 16%; top: 62%; transform: scale(.82); }
    50% { transform: none; }
    75% { left: 80%; top: 14%; }
    100% { left: 70%; top: 78%; }
}

/* step 2 onward: the brand's colours, type and images */
.wb__stage:not([data-stage="1"]) .wb-layer { border-color: transparent; }
.wb__stage:not([data-stage="1"]) .wb-logo { border-color: transparent; background: linear-gradient(135deg, #5B3FD6, #FF7A59); }
.wb__stage:not([data-stage="1"]) .wb-cta-sm,
.wb__stage:not([data-stage="1"]) .wb-btn-mock { border-color: transparent; background: #FF7A59; }
.wb__stage:not([data-stage="1"]) .wb-h1 { background: #110E2D; }
.wb__stage:not([data-stage="1"]) .wb-layer--nav i { background: #C9C3EC; }
.wb__stage:not([data-stage="1"]) .wb-hero__img { border-color: transparent; background: radial-gradient(circle at 70% 35%, #FFD166 0 14%, transparent 15%), linear-gradient(135deg, #5B3FD6, #9B7BFF 55%, #FF7A59); }
.wb__stage:not([data-stage="1"]) .wb-cards span { border-color: transparent; }
.wb__stage:not([data-stage="1"]) .wb-cards span:nth-child(1) { background: #EDE8FF; }
.wb__stage:not([data-stage="1"]) .wb-cards span:nth-child(2) { background: #FFE9E2; }
.wb__stage:not([data-stage="1"]) .wb-cards span:nth-child(3) { background: #DDF6F3; }
.wb__stage:not([data-stage="1"]) .wb-layer--foot { background: #110E2D; }
.wb__stage:not([data-stage="1"]) .wb-layer--foot i { background: rgba(255, 255, 255, .35); }
.wb-swatches { position: absolute; top: -6px; left: 0; display: flex; align-items: center; gap: 8px; opacity: 0; transform: translateY(10px); transition: opacity .5s ease, transform .5s ease; }
.wb-swatches i { width: 26px; height: 26px; border-radius: 50%; box-shadow: 0 0 0 3px rgba(255, 255, 255, .9); }
.wb-swatches i:nth-child(1) { background: #5B3FD6; }
.wb-swatches i:nth-child(2) { background: #FF7A59; }
.wb-swatches i:nth-child(3) { background: #FFD166; }
.wb-swatches i:nth-child(4) { background: #2EC4B6; }
.wb-swatches i:nth-child(5) { background: #110E2D; }
.wb-type { margin-left: 6px; padding: 2px 12px; border-radius: 10px; background: #fff; color: #22146B; font-size: 20px; }
.wb__stage[data-stage="2"] .wb-swatches { opacity: 1; transform: none; }

/* step 3: the page's layers pulled apart */
.wb__stage[data-stage="3"] .wb-browser__card { transform: rotateX(54deg) rotateZ(-34deg) scale(.8) translateY(-30px); }
.wb__stage[data-stage="3"] .wb-browser__front { overflow: visible; background: transparent; box-shadow: none; }
.wb__stage[data-stage="3"] .wb-bar { opacity: 0; }
.wb__stage[data-stage="3"] .wb-layer { background: #fff; box-shadow: 0 24px 30px -18px rgba(10, 6, 40, .7); }
.wb__stage[data-stage="3"] .wb-layer--foot { background: #110E2D; transform: translateZ(0); }
.wb__stage[data-stage="3"] .wb-layer--main { transform: translateZ(60px); }
.wb__stage[data-stage="3"] .wb-layer--nav { transform: translateZ(120px); }
.wb-layer::after {
    content: attr(data-label);
    position: absolute;
    top: 50%;
    right: 100%;
    margin-right: 14px;
    padding: 3px 10px;
    border-radius: 8px;
    background: #FFD166;
    color: #110E2D;
    font-size: 12px;
    white-space: nowrap;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity .4s ease;
    direction: rtl;
}
html[dir="ltr"] .wb-layer::after { direction: ltr; }
.wb__stage[data-stage="3"] .wb-layer::after { opacity: 1; transition-delay: .7s; }

/* step 4: the code behind it, the phone and the scores */
.wb__stage[data-stage="4"] .wb-browser__card { transform: rotateY(180deg) scale(.94); }
.wb-phone {
    position: absolute;
    right: 0;
    bottom: 40px;
    width: 128px;
    height: 250px;
    padding: 22px 10px 10px;
    border-radius: 24px;
    background: #fff;
    border: 5px solid #110E2D;
    box-shadow: 0 30px 50px -20px rgba(10, 6, 40, .8);
    opacity: 0;
    transform: translateX(40px) rotate(6deg);
    transition: opacity .6s ease .3s, transform .8s cubic-bezier(.2, .7, .2, 1) .3s;
}
.wb-phone__notch { position: absolute; top: 6px; left: 50%; width: 36px; height: 6px; margin-left: -18px; border-radius: 6px; background: #110E2D; }
.wb-phone .wb-logo { width: 18px; height: 18px; margin-bottom: 8px; border: 0; background: linear-gradient(135deg, #5B3FD6, #FF7A59); }
.wb-phone .wb-hero__img { min-height: 76px; margin-bottom: 10px; border: 0; background: radial-gradient(circle at 70% 35%, #FFD166 0 14%, transparent 15%), linear-gradient(135deg, #5B3FD6, #9B7BFF 55%, #FF7A59); }
.wb-phone .wb-h1 { height: 10px; background: #110E2D; }
.wb-phone .wb-btn-mock { width: 100%; height: 20px; border: 0; background: #FF7A59; }
.wb__stage[data-stage="4"] .wb-phone { opacity: 1; transform: none; }
.wb-gauges { position: absolute; left: 10px; bottom: 0; display: flex; gap: 12px; opacity: 0; transform: translateY(16px); transition: opacity .5s ease .5s, transform .6s ease .5s; }
.wb-gauge { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 12px 8px; border-radius: 16px; background: #fff; box-shadow: 0 16px 30px -16px rgba(10, 6, 40, .7); }
.wb-gauge svg { width: 54px; height: 54px; transform: rotate(-90deg); }
.wb-gauge__track { fill: none; stroke: #ECEAF6; stroke-width: 4; }
.wb-gauge__fill { fill: none; stroke: #2EC46F; stroke-width: 4; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset 1.4s cubic-bezier(.2, .7, .2, 1) .6s; }
.wb-gauge b { position: absolute; top: 26px; left: 50%; transform: translateX(-50%); color: #110E2D; font-size: 15px; line-height: 1; }
.wb-gauge small { color: #55536B; font-size: 11px; direction: rtl; }
html[dir="ltr"] .wb-gauge small { direction: ltr; }
.wb__stage[data-stage="4"] .wb-gauges { opacity: 1; transform: none; }
.wb__stage[data-stage="4"] .wb-gauge__fill { stroke-dashoffset: 0; }
.wb__stage[data-stage="4"] .wb-gauge:nth-child(2) .wb-gauge__fill { stroke-dashoffset: 2; }

/* --- related websites --- */
.wb__works { margin-top: 30px; padding-top: 30px; border-top: 1px solid rgba(255, 255, 255, .16); }
.wb__works-title { margin: 0 0 16px; color: #fff; font-size: 17px; }
.wb__works-row { display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 6px 2px 14px; }
.wb__works-row::-webkit-scrollbar { display: none; }
.wb-work { flex: 0 0 250px; scroll-snap-align: start; color: #fff; transition: transform .3s ease; }
.wb-work:hover { transform: translateY(-6px) rotate(-1deg); }
.wb-work__win { display: block; overflow: hidden; border-radius: 14px; background: #fff; box-shadow: 0 24px 40px -22px rgba(0, 0, 0, .7); }
.wb-work__shot { display: block; height: 150px; background-size: cover; background-position: top center; transition: background-position 3s ease; }
.wb-work:hover .wb-work__shot { background-position: bottom center; }
.wb-work__name { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px; font-weight: 700; }
.wb-work__name img { width: 22px; height: 22px; padding: 2px; border-radius: 50%; background: #fff; object-fit: contain; }

/* --- smaller screens: the stage (scaled to fit, see home-webbuild.js) above a swipeable row of steps --- */
@media (max-width: 991px) {
    .wb__frame { padding: 28px 20px; border-radius: 30px; }
    .wb__head { flex-direction: column; align-items: stretch; }
    .wb__story { display: flex; flex-direction: column; gap: 0; }
    .wb__stage-wrap { order: -1; position: relative; height: calc(470px * var(--wb-scale, .55)); margin-top: 26px; }
    .wb__stage { position: absolute; top: 0; left: 0; width: 600px; height: 470px; margin: 0; transform: scale(var(--wb-scale, .55)); transform-origin: 0 0; }
    .wb__steps { flex-direction: row; gap: 12px; margin: 18px -20px 0; padding: 0 20px 4px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
    .wb__steps::-webkit-scrollbar { display: none; }
    .wb-step, .wb-step:last-child { flex: 0 0 84%; min-height: 0; justify-content: flex-start; padding: 20px; border-radius: 22px; background: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); scroll-snap-align: center; opacity: .55; }
    .wb-step.is-active { background: rgba(255, 255, 255, .14); }
    .wb-step__num { font-size: 34px; }
}
@media (max-width: 575px) {
    .wb { margin-top: 110px; }
    .wb__actions { flex-wrap: wrap; }
    .wb__actions .wb__btn { flex: 1 1 auto; justify-content: center; }
    .wb-work { flex-basis: 220px; }
}
@media (prefers-reduced-motion: reduce) {
    .wb * { transition: none !important; animation: none !important; }
}
