:root {
    --ivory: #f7f3ec;
    --card: #faf8f3;
    --espresso: #231f1b;
    --espresso-soft: #8c8377;
    --olive: #6b7b5b;
    --olive-deep: #4f5b43;
    --gold: #bfa77a;
    --gold-soft: #d9c7ad;
    --line: #d8cdbb;
    --danger: #a14b3a;
    --shadow: 0 16px 32px rgb(35 31 27 / .14);
    --radius-sm: 10px;
    --radius-md: 13px;
    --radius-lg: 20px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    position: relative;
    background: var(--ivory);
    color: var(--espresso);
    font: 400 16px/1.6 "IBM Plex Sans Arabic", sans-serif;
    text-rendering: optimizeLegibility;

    &::before {
        content: "";
        position: fixed;
        inset: 0;
        z-index: 0;
        pointer-events: none;
        opacity: .35;
        background-image: radial-gradient(var(--gold-soft) 1px, transparent 1px);
        background-size: 26px 26px;
    }
}

button,
input {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
}

button {
    border: 0;
}

:focus-visible {
    outline: 2px solid var(--olive);
    outline-offset: 3px;
}

h1,
h2,
h3,
p {
    margin: 0;
}

.container {
    width: min(1120px, calc(100% - 48px));
    margin-inline: auto;
}

header {
    position: relative;
    z-index: 1;
    padding-block: 28px;

    .header-inner {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        text-align: center;
    }

    .brand-logo {
        width: auto;
        height: 38px;
        display: block;
    }

    .header-tagline {
        color: var(--espresso-soft);
        font-size: 9.5px;
        font-weight: 600;
        letter-spacing: .14em;
        text-transform: uppercase;
    }
}

.hero {
    position: relative;
    z-index: 1;
    padding-block: 32px 64px;
    overflow: clip;

    .hero-watermark {
        position: absolute;
        z-index: 0;
        top: -30px;
        right: -40px;
        width: 230px;
        height: auto;
        opacity: .05;
        pointer-events: none;
        transform: rotate(-6deg);
    }

    .hero-inner {
        position: relative;
        z-index: 1;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: clamp(32px, 6vw, 84px);
    }

    .hero-text {
        flex: 1 1 56%;
        max-width: 650px;
    }

    .eyebrow {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        margin-block-end: 16px;
        color: var(--olive-deep);
        font-size: 13px;
        font-weight: 600;

        img {
            flex: none;
        }
    }

    h1 {
        max-width: 680px;
        font-size: clamp(30px, 5vw, 48px);
        font-weight: 700;
        line-height: 1.35;
        text-wrap: balance;
    }

    .subhead {
        max-width: 630px;
        margin-block-start: 18px;
        color: var(--espresso-soft);
        font-size: 16px;
        line-height: 1.85;
    }

    .hero-cta {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin-block-start: 28px;
        padding: 14px 28px;
        border-radius: var(--radius-sm);
        background: var(--olive);
        color: #fff;
        font-weight: 600;
        text-decoration: none;
        transition: background .18s ease, transform .18s ease, box-shadow .18s ease;

        &:hover {
            background: var(--olive-deep);
            transform: translateY(-2px);
            box-shadow: 0 10px 24px rgb(79 91 67 / .16);
        }
    }

    .hero-number {
        position: relative;
        display: inline-block;
        inline-size: 6ch;
        min-inline-size: 6ch;
        text-align: start;
        isolation: isolate;
        margin-inline: 3px;
        color: var(--olive-deep);
        font-family: "El Messiri", sans-serif;
        font-weight: 700;
        line-height: 1;
        white-space: nowrap;
        font-variant-numeric: tabular-nums;
        transform: translateZ(0);

        &::before {
            content: "";
            position: absolute;
            inset: 55% -8px -5px;
            z-index: -1;
            border-radius: 999px;
            background: rgb(191 167 122 / .22);
            transform: scaleX(.92);
            filter: blur(8px);
        }

        &.is-counting {
            animation: numberLift .75s cubic-bezier(.16, .8, .3, 1);
        }

        &--revenue {
            color: var(--espresso);

            &::before {
                background: rgb(107 123 91 / .22);
            }
        }
    }

    .hero-visual {
        position: relative;
        flex: 0 0 min(42vw, 420px);
        width: min(42vw, 420px);
        aspect-ratio: 1;
        margin: 0;
        isolation: isolate;
    }

    .visual-orbit,
    .visual-pulse,
    .visual-core {
        position: absolute;
    }

    .visual-orbit {
        inset: 0;
        width: 100%;
        height: 100%;
        overflow: visible;
        animation: orbitSpin 18s linear infinite;

        circle,
        ellipse,
        path {
            stroke: var(--line);
            stroke-width: 1.2;
            opacity: .9;
        }

        ellipse {
            stroke-dasharray: 5 8;
        }

        path {
            stroke: var(--gold-soft);
            stroke-dasharray: 3 10;
        }
    }

    .visual-pulse {
        inset: 50% auto auto 50%;
        width: 150px;
        aspect-ratio: 1;
        border: 1px solid rgb(107 123 91 / .15);
        border-radius: 50%;
        transform: translate(-50%, -50%);
        animation: corePulse 3.2s ease-in-out infinite;
    }

    .visual-core {
        inset: 50% auto auto 50%;
        display: grid;
        place-items: center;
        width: 148px;
        aspect-ratio: 1;
        padding: 18px;
        border: 1px solid var(--line);
        border-radius: 50%;
        background:
            radial-gradient(circle at 30% 25%, rgb(255 255 255 / .9), transparent 45%),
            var(--card);
        box-shadow: 0 18px 40px rgb(35 31 27 / .12);
        text-align: center;
        transform: translate(-50%, -50%);
        animation: coreFloat 4.8s ease-in-out infinite;

        span {
            color: var(--espresso-soft);
            font-size: 11px;
        }

        strong {
            margin-top: -4px;
            color: var(--olive-deep);
            font-family: "El Messiri", sans-serif;
            font-size: 21px;
            line-height: 1.2;
        }

        small {
            padding: 4px 9px;
            border-radius: 999px;
            background: var(--gold-soft);
            color: var(--espresso);
            font-size: 11px;
            font-weight: 700;
            font-variant-numeric: tabular-nums;
        }
    }

    .visual-icon {
        flex: 0 0 34px;
        width: 34px;
        aspect-ratio: 1;
        display: grid;
        place-items: center;
        border-radius: 11px;
        background: var(--gold-soft);
        color: var(--espresso);

        svg {
            width: 18px;
            height: 18px;
            stroke: currentColor;
            stroke-width: 1.8;
            stroke-linecap: round;
            stroke-linejoin: round;
        }
    }

    @media (max-width: 899px) {
        .hero-inner {
            flex-direction: column;
            text-align: center;
        }

        .hero-text {
            display: grid;
            justify-items: center;
        }

        .hero-visual {
            width: min(88vw, 380px);
            flex-basis: auto;
        }

        .subhead {
            margin-inline: auto;
        }
    }

    @media (max-width: 560px) {
        padding-block-end: 48px;

        .hero-inner {
            gap: 34px;
        }

        .hero-visual {
            width: min(90vw, 340px);
        }

        .visual-core {
            width: 132px;
        }

        .visual-pulse {
            width: 136px;
        }
    }
}

.stats {
    position: relative;
    z-index: 1;
    border-block: 1px solid var(--line);
    background: rgb(35 31 27 / .045);

    .stats-inner {
        display: flex;
        align-items: center;
        justify-content: center;
        padding-block: 30px;
    }

    .stat {
        min-width: 180px;
        padding-inline-end: 36px;
        margin-inline-end: 36px;
        border-inline-end: 1px solid var(--line);
        text-align: center;

        &:last-child {
            padding-inline-end: 0;
            margin-inline-end: 0;
            border-inline-end: 0;
        }
    }

    .stat-value {
        min-inline-size: 7ch;
        font-variant-numeric: tabular-nums;
        display: block;
        color: var(--olive-deep);
        font-family: "IBM Plex Sans Arabic", sans-serif;
        font-size: 28px;
        font-weight: 700;
        line-height: 1.2;
        font-variant-numeric: tabular-nums;

        &[data-counter].is-counting {
            animation: statPop .55s cubic-bezier(.16, .8, .3, 1);
        }
    }

    .stat-label {
        display: block;
        margin-top: 5px;
        color: var(--espresso-soft);
        font-size: 13px;
    }

    @media (max-width: 899px) {
        .stats-inner {
            flex-direction: column;
            padding-block: 26px;
        }

        .stat {
            padding: 0 0 16px;
            margin: 0 0 16px;
            border-inline-end: 0;
            border-bottom: 1px solid var(--line);

            &:last-child {
                padding: 0;
                margin: 0;
                border-bottom: 0;
            }
        }
    }
}

.form-section {
    position: relative;
    z-index: 1;
    padding-block: 64px 80px;
}

.form-card {
    width: min(100%, 520px);
    margin-inline: auto;
    padding: 34px 30px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--card);
    box-shadow: var(--shadow);

    .form-progress {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        margin-block-end: 28px;
    }

    .progress-step {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        color: rgb(30 30 30 / .45);
        font-size: 13px;
        font-weight: 600;

        &.active {
            color: var(--olive-deep);

            .progress-dot {
                border-color: var(--olive-deep);
                background: var(--olive-deep);
                color: #fff;
            }
        }
    }

    .progress-dot {
        width: 28px;
        aspect-ratio: 1;
        display: inline-grid;
        place-items: center;
        border: 1px solid rgb(30 30 30 / .15);
        border-radius: 50%;
        font-size: 12px;
        transition: .2s ease;
    }

    .progress-line {
        width: 45px;
        height: 1px;
        background: rgb(30 30 30 / .12);
    }

    form {
        margin: 0;
    }

    .form-step {
        animation: stepIn .24s ease both;
    }

    .field-group-title {
        margin-block-end: 22px;
        text-align: center;

        h2,
        h3 {
            margin: 0;
            font-family: "El Messiri", sans-serif;
            font-size: 23px;
            line-height: 1.5;
        }

        p {
            margin-block-start: 8px;
            color: rgb(30 30 30 / .58);
            font-size: 14px;
            line-height: 1.8;
        }
    }

    .field,
    fieldset.field {
        min-inline-size: 0;
        margin: 0 0 16px;
        padding: 0;
        border: 0;

        >label,
        >legend {
            display: block;
            width: 100%;
            margin-block-end: 7px;
            padding: 0;
            color: var(--espresso);
            font-size: 13px;
            font-weight: 600;

            i {
                color: #8b4f4f;
                font-style: normal;
            }
        }
    }

    .field-hint {
        display: block;
        margin-top: 7px;
        color: rgb(30 30 30 / .48);
        font-size: 12px;
        line-height: 1.6;
    }

    input[type="text"],
    input[type="tel"],
    input[type="email"],
    select {
        width: 100%;
        min-height: 48px;
        padding: 12px 14px;
        border: 1px solid var(--line);
        border-radius: var(--radius-sm);
        background: #fff;
        color: var(--espresso);
        font-size: 15px;
        transition: border-color .18s ease, box-shadow .18s ease;

        &::placeholder {
            color: #b9ac9a;
        }

        &:focus {
            outline: none;
            border-color: var(--olive);
            box-shadow: 0 0 0 3px rgb(107 123 91 / .1);
        }
    }

    select {
        appearance: none;
        padding-inline-end: 40px;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%236b7b5b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: left 14px center;
        cursor: pointer;

        &:invalid {
            color: #b9ac9a;
        }

        option {
            color: var(--espresso);
        }
    }

    .option.minor-option {
        margin-top: 14px;

        >label {
            min-height: 0;
            gap: 8px;
            padding: 2px 0;
            border: 0;
            background: none;
            color: rgb(30 30 30 / .55);
            font-size: 12.5px;

            &:hover {
                transform: none;
                color: rgb(30 30 30 / .75);
            }
        }

        >input:checked+label {
            background: none;
            box-shadow: none;
            color: var(--espresso);
        }

        .custom-check {
            width: 16px;
            height: 16px;
            border-radius: 5px;
        }
    }

    .option-grid {
        display: grid;
        gap: 10px;
        margin-top: 10px;

        &.two-cols {
            grid-template-columns: repeat(2, minmax(0, 1fr));
        }
    }

    .option {
        position: relative;

        >input {
            position: absolute;
            width: 1px;
            height: 1px;
            opacity: 0;
            pointer-events: none;
        }

        >label {
            min-height: 52px;
            width: 100%;
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 12px 15px;
            border: 1px solid rgb(30 30 30 / .12);
            border-radius: var(--radius-md);
            background: rgb(255 255 255 / .6);
            color: var(--espresso);
            cursor: pointer;
            font-size: 14px;
            line-height: 1.65;
            transition: border-color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease;
            user-select: none;

            &:hover {
                border-color: rgb(79 92 67 / .38);
                transform: translateY(-1px);
            }
        }

        >input:checked+label {
            border-color: var(--olive-deep);
            background: rgb(79 92 67 / .08);
            box-shadow: 0 0 0 1px rgb(79 92 67 / .07);
        }

        >input:focus-visible+label {
            outline: 2px solid var(--olive);
            outline-offset: 2px;
        }
    }

    .custom-radio,
    .custom-check {
        flex: 0 0 auto;
        width: 19px;
        height: 19px;
        display: inline-grid;
        place-items: center;
        border: 1.5px solid rgb(30 30 30 / .26);
        background: #fff;
        transition: .18s ease;
    }

    .custom-radio {
        border-radius: 50%;
    }

    .custom-check {
        border-radius: 6px;
    }

    .option>input[type="radio"]:checked+label .custom-radio::after {
        content: "";
        width: 9px;
        height: 9px;
        border-radius: 50%;
        background: var(--olive-deep);
    }

    .option>input[type="checkbox"]:checked+label .custom-check {
        border-color: var(--olive-deep);
        background: var(--olive-deep);

        &::after {
            content: "✓";
            color: #fff;
            font-size: 12px;
            font-weight: 700;
            line-height: 1;
        }
    }

    .other-input {
        margin-top: 10px;
    }

    .summary-note {
        margin-top: 16px;
        padding: 13px 15px;
        border-radius: 12px;
        background: rgb(79 92 67 / .06);
        color: rgb(30 30 30 / .66);
        font-size: 13px;
        line-height: 1.8;
    }

    .form-actions {
        display: flex;
        gap: 10px;
        align-items: center;
        margin-top: 24px;
    }

    .submit-btn,
    .secondary-btn {
        min-height: 52px;
        padding: 0 20px;
        border-radius: var(--radius-md);
        cursor: pointer;
        font-size: 15px;
        font-weight: 700;
        transition: background .18s ease, border-color .18s ease, transform .18s ease, opacity .18s ease;

        &:disabled {
            opacity: .6;
            cursor: not-allowed;
            transform: none;
        }
    }

    .submit-btn {
        flex: 1;
        background: var(--olive);
        color: #fff;

        &:hover:not(:disabled) {
            background: var(--olive-deep);
            transform: translateY(-1px);
        }
    }

    .secondary-btn {
        flex: 0 0 auto;
        border: 1px solid rgb(30 30 30 / .12);
        background: transparent;
        color: var(--espresso);

        &:hover:not(:disabled) {
            background: rgb(30 30 30 / .04);
        }
    }

    .privacy {
        margin-top: 14px;
        color: #a89a86;
        font-size: 12px;
        text-align: center;
    }

    .form-error {
        margin-top: 12px;
        color: var(--danger);
        font-size: 13px;
        text-align: center;
    }

    @media (max-width: 560px) {
        padding: 30px 20px;

        .option-grid.two-cols {
            grid-template-columns: 1fr;
        }

        .form-actions {
            flex-direction: column-reverse;
            align-items: stretch;
        }

        .secondary-btn {
            width: 100%;
        }
    }
}

footer {
    position: relative;
    z-index: 1;
    padding-block: 36px 28px;
    text-align: center;

    .footer-mark {
        display: block;
        width: 80px;
        height: auto;
        margin: 0 auto 12px;
    }

    .footer-brand {
        font-size: 14px;
        font-weight: 600;
    }

    .footer-tagline {
        margin-top: 6px;
        color: var(--olive-deep);
        font-family: "El Messiri", serif;
        font-size: 15px;
        font-weight: 500;
    }

    .contact-rows {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
        margin-top: 26px;
    }

    .contact-row {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 18px;
        border: 1px solid var(--line);
        border-radius: var(--radius-sm);
        background: var(--card);
        color: var(--espresso);
        font-size: 13px;
        text-decoration: none;
        transition: border-color .18s ease, transform .18s ease;

        &:hover {
            border-color: var(--olive);
            transform: translateY(-1px);
        }
    }

    .contact-label {
        font-weight: 600;
    }

    .contact-number {
        color: var(--olive-deep);
        font-weight: 600;
    }
}

.popup-modal {
    width: min(440px, calc(100% - 40px));
    margin: auto;
    padding: 36px 30px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--card);
    box-shadow: var(--shadow);
    color: var(--espresso);
    text-align: center;
    animation: popupScale .3s cubic-bezier(.34, 1.56, .64, 1) both;

    &::backdrop {
        background: rgb(35 31 27 / .6);
        backdrop-filter: blur(4px);
    }

    >svg {
        display: block;
        margin: 0 auto 18px;
    }

    h2 {
        margin-bottom: 12px;
        font-size: 24px;
        font-weight: 700;
    }

    p {
        margin-bottom: 24px;
        color: var(--espresso-soft);
        font-size: 15px;
        line-height: 1.7;
    }

    .popup-cta-btn {
        width: 100%;
        min-height: 52px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 14px;
        border-radius: var(--radius-sm);
        background: var(--olive);
        color: #fff;
        cursor: pointer;
        font-family: inherit;
        font-size: 16px;
        font-weight: 700;
        text-decoration: none;
        box-shadow: 0 6px 18px rgb(79 91 67 / .2);
        transition: background .18s ease, transform .18s ease;

        &:hover {
            background: var(--olive-deep);
            transform: translateY(-1px);
        }
    }

    .close-popup-btn {
        position: absolute;
        inset: 14px auto auto 14px;
        padding: 4px;
        background: transparent;
        color: var(--espresso-soft);
        cursor: pointer;
        font-size: 22px;
        line-height: 1;

        &:hover {
            color: var(--espresso);
        }
    }
}

@keyframes stepIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes popupScale {
    from {
        opacity: 0;
        transform: scale(.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes numberLift {
    0% {
        transform: translateY(5px) scale(.96);
    }

    55% {
        transform: translateY(-2px) scale(1.035);
    }

    100% {
        transform: translateY(0) scale(1);
    }
}

@keyframes statPop {
    0% {
        transform: translateY(4px);
        opacity: .6;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes orbitSpin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes corePulse {

    0%,
    100% {
        opacity: .35;
        transform: translate(-50%, -50%) scale(.94);
    }

    50% {
        opacity: .8;
        transform: translate(-50%, -50%) scale(1.04);
    }
}

@keyframes coreFloat {

    0%,
    100% {
        transform: translate(-50%, -50%) translateY(0);
    }

    50% {
        transform: translate(-50%, -50%) translateY(-7px);
    }
}

@keyframes nodeFloat {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-7px) rotate(-1deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}