/*
 * Tareef Core Software: site theme.
 * Loaded after styles.css (Bootstrap 5 + Freelancer base). Colours, type and motion follow
 * the approved identity: night ink, core violet, data cyan, paper and mist, IBM Plex type.
 */

:root {
    --tc-ink: #0B1026;
    --tc-ink-2: #10183A;
    --tc-ink-3: #18224D;
    --tc-violet: #5B4BDB;
    --tc-violet-light: #A498FF;
    --tc-indigo: #3A57D8;
    --tc-cyan: #22D3EE;
    --tc-paper: #F5F7FB;
    --tc-white: #FFFFFF;
    --tc-mist: #94A3B8;
    --tc-sub: #5A6488;
    --tc-line: rgba(11, 16, 38, 0.09);
    --tc-line-dark: rgba(255, 255, 255, 0.1);
    --tc-grad: linear-gradient(135deg, #5B4BDB 0%, #22D3EE 100%);
    --tc-radius: 12px;
    --tc-radius-lg: 20px;
    --tc-shadow: 0 1px 2px rgba(11, 16, 38, 0.04), 0 10px 30px -12px rgba(11, 16, 38, 0.1);
    --tc-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
    --tc-font-en: "IBM Plex Sans", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --tc-font-ar: "IBM Plex Sans Arabic", "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
    --tc-font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --tc-font: var(--tc-font-en);
    --tc-dir: 1;
    --tc-nav-h: 72px;
}

html[lang="ar"] {
    --tc-font: var(--tc-font-ar);
    --tc-dir: -1;
}

/* Base ------------------------------------------------------------------ */

html {
    scroll-padding-top: var(--tc-nav-h);
}

body {
    font-family: var(--tc-font);
    font-size: 1.0625rem;
    line-height: 1.7;
    color: var(--tc-ink);
    background: var(--tc-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--tc-font);
    color: inherit;
}

html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3,
html[lang="ar"] h4, html[lang="ar"] h5, html[lang="ar"] h6 {
    letter-spacing: 0;
}

h1, h2 {
    text-wrap: balance;
}

p, li {
    text-wrap: pretty;
}

a {
    color: var(--tc-violet);
}

::selection {
    background: rgba(34, 211, 238, 0.3);
}

:focus-visible {
    outline: 2px solid var(--tc-violet);
    outline-offset: 3px;
}

#mainNav :focus-visible,
.hero-section :focus-visible,
.bg-ink :focus-visible,
.cta-section :focus-visible,
.site-footer :focus-visible {
    outline-color: var(--tc-cyan);
}

.skip-link {
    position: fixed;
    top: 10px;
    inset-inline-start: 10px;
    z-index: 2000;
    padding: 10px 16px;
    border-radius: 10px;
    background: var(--tc-white);
    color: var(--tc-ink);
    font-weight: 600;
    text-decoration: none;
    transform: translateY(-160%);
    transition: transform 0.2s;
}

.skip-link:focus {
    transform: none;
}

.grad-text {
    background-image: linear-gradient(90deg, var(--tc-violet-light), var(--tc-cyan));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

html[dir="rtl"] .grad-text {
    background-image: linear-gradient(270deg, var(--tc-violet-light), var(--tc-cyan));
}

/* Eyebrow labels: spaced capitals in English, never letter-spaced in Arabic */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-family: var(--tc-font-mono);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    line-height: 1.4;
    text-transform: uppercase;
    color: var(--tc-violet);
}

.eyebrow::before {
    content: "";
    flex: none;
    width: 22px;
    height: 2px;
    border-radius: 2px;
    background: var(--tc-grad);
}

html[lang="ar"] .eyebrow {
    font-family: var(--tc-font-ar);
    font-size: 0.95rem;
    letter-spacing: 0;
}

.hero-section .eyebrow,
.bg-ink .eyebrow,
.cta-section .eyebrow {
    color: var(--tc-cyan);
}

/* Buttons --------------------------------------------------------------- */

.tc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 52px;
    padding: 0 26px;
    border: 1px solid transparent;
    border-radius: var(--tc-radius);
    font: inherit;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s var(--tc-ease), box-shadow 0.25s, background-color 0.2s, border-color 0.2s, color 0.2s;
}

.tc-btn-primary {
    position: relative;
    isolation: isolate;
    color: var(--tc-white);
    background: linear-gradient(135deg, var(--tc-violet), var(--tc-indigo));
    box-shadow: 0 12px 30px -12px rgba(91, 75, 219, 0.8);
}

.tc-btn-primary::before {
    content: "";
    position: absolute;
    inset: -2px;
    z-index: -1;
    border-radius: inherit;
    background: var(--tc-grad);
    filter: blur(14px);
    opacity: 0;
    transition: opacity 0.3s;
}

.tc-btn-primary:hover,
.tc-btn-primary:focus-visible {
    color: var(--tc-white);
    transform: translateY(-2px);
}

.tc-btn-primary:hover::before,
.tc-btn-primary:focus-visible::before {
    opacity: 0.7;
}

.tc-btn-ghost {
    color: var(--tc-white);
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.22);
}

.tc-btn-ghost:hover,
.tc-btn-ghost:focus-visible {
    color: var(--tc-white);
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.5);
}

.btn-arrow {
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transform: scaleX(var(--tc-dir));
    transition: translate 0.2s var(--tc-ease);
}

.tc-btn:hover .btn-arrow,
.project-next:hover .btn-arrow {
    translate: calc(var(--tc-dir) * 4px) 0;
}

/* Navigation ------------------------------------------------------------ */

#mainNav {
    padding: 14px 0;
    font-family: var(--tc-font);
    font-weight: 500;
    background: rgba(11, 16, 38, 0.6);
    -webkit-backdrop-filter: saturate(140%) blur(14px);
    backdrop-filter: saturate(140%) blur(14px);
    border-bottom: 1px solid transparent;
    transition: padding 0.3s, background-color 0.3s, border-color 0.3s;
}

#mainNav.navbar-shrink {
    padding: 8px 0;
    background: rgba(11, 16, 38, 0.9);
    border-bottom-color: var(--tc-line-dark);
}

#mainNav > .container {
    justify-content: flex-start;
    gap: 12px;
}

#mainNav .navbar-brand {
    display: flex;
    align-items: center;
    padding: 0;
    margin: 0;
    font-size: inherit;
}

.brand-logo {
    display: block;
    width: auto;
    height: 40px;
}

html[lang="ar"] .brand-logo-en,
html:not([lang="ar"]) .brand-logo-ar {
    display: none;
}

#mainNav .navbar-nav {
    gap: 2px;
    margin: 0;
}

#mainNav .navbar-nav li.nav-item a.nav-link {
    position: relative;
    padding: 8px 14px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.95rem;
    transition: color 0.2s, background-color 0.2s;
}

#mainNav .navbar-nav li.nav-item a.nav-link:hover,
#mainNav .navbar-nav li.nav-item a.nav-link:focus-visible {
    color: var(--tc-white);
    background: rgba(255, 255, 255, 0.06);
}

#mainNav .navbar-nav li.nav-item a.nav-link.active,
#mainNav .navbar-nav > li.nav-item > a.nav-link.active,
#mainNav .navbar-nav > li.nav-item > a.nav-link.active:hover,
#mainNav .navbar-nav > li.nav-item > a.nav-link.active:focus {
    color: var(--tc-white);
    background: transparent;
}

#mainNav .navbar-nav li.nav-item a.nav-link.active::after {
    content: "";
    position: absolute;
    inset-inline: 14px;
    bottom: 2px;
    height: 2px;
    border-radius: 2px;
    background: var(--tc-grad);
}

.language-switcher {
    display: inline-flex;
    align-items: center;
    padding: 3px;
    border: 1px solid var(--tc-line-dark);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
}

.lang-btn {
    min-width: 44px;
    padding: 5px 12px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: rgba(255, 255, 255, 0.78);
    font-family: var(--tc-font-ar);
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.lang-btn[data-lang="en"] {
    font-family: var(--tc-font-en);
}

.lang-btn:hover {
    color: var(--tc-white);
}

.lang-btn.active {
    background: var(--tc-white);
    color: var(--tc-ink);
}

#mainNav .navbar-toggler {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--tc-line-dark);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--tc-white);
    font-size: inherit;
}

#mainNav .navbar-toggler svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
}

#mainNav .navbar-toggler:focus {
    box-shadow: none;
}

@media (min-width: 992px) {
    #mainNav .navbar-toggler {
        display: none;
    }
}

@media (max-width: 991.98px) {
    .language-switcher {
        order: 1;
        margin-inline-start: auto;
    }

    #mainNav .navbar-toggler {
        order: 2;
    }

    #mainNav .navbar-collapse {
        order: 3;
        flex-basis: 100%;
    }

    #mainNav .navbar-nav {
        margin-top: 12px;
        padding: 8px;
        border: 1px solid var(--tc-line-dark);
        border-radius: 14px;
        background: var(--tc-ink-2);
    }

    #mainNav .navbar-nav li.nav-item a.nav-link {
        padding: 12px 14px;
    }

    #mainNav .navbar-nav li.nav-item a.nav-link.active::after {
        inset-inline: 14px auto;
        width: 18px;
        bottom: 8px;
    }
}

@media (min-width: 992px) {
    #mainNav .navbar-collapse {
        order: 1;
    }

    #mainNav .navbar-nav {
        margin-inline-start: auto;
    }

    .language-switcher {
        order: 2;
        margin-inline-start: 10px;
    }

    #mainNav .navbar-brand,
    #mainNav.navbar-shrink .navbar-brand {
        font-size: inherit;
    }
}

@media (max-width: 380px) {
    .brand-logo {
        height: 34px;
    }

    .lang-btn {
        min-width: 38px;
        padding: 5px 9px;
    }
}

/* Hero ------------------------------------------------------------------ */

.hero-section {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: center;
    min-height: min(100svh, 940px);
    padding: calc(var(--tc-nav-h) + 56px) 0 96px;
    overflow: hidden;
    background: var(--tc-ink);
    color: var(--tc-white);
}

.hero-section::before {
    content: "";
    position: absolute;
    z-index: -2;
    top: 50%;
    inset-inline-end: -260px;
    width: 980px;
    height: 980px;
    transform: translateY(-50%);
    background: radial-gradient(closest-side, rgba(91, 75, 219, 0.36), rgba(34, 211, 238, 0.08) 58%, transparent 74%);
    pointer-events: none;
}

.hero-section::after {
    content: "";
    position: absolute;
    z-index: -2;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 56px 56px;
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%);
    mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%);
    pointer-events: none;
}

.hero-canvas {
    position: absolute;
    z-index: -1;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    -webkit-mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0.4), #000 65%);
    mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0.4), #000 65%);
}

html[dir="rtl"] .hero-canvas {
    -webkit-mask-image: linear-gradient(270deg, rgba(0, 0, 0, 0.4), #000 65%);
    mask-image: linear-gradient(270deg, rgba(0, 0, 0, 0.4), #000 65%);
}

.hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    gap: 56px;
    align-items: center;
}

.hero-copy h1 {
    margin: 22px 0 0;
    font-size: clamp(2.2rem, 1.2rem + 3vw, 3.5rem);
    font-weight: 600;
    line-height: 1.14;
    letter-spacing: -0.02em;
}

html[lang="ar"] .hero-copy h1 {
    font-size: clamp(2.1rem, 1.2rem + 2.8vw, 3.4rem);
    font-weight: 700;
    line-height: 1.4;
}

.hero-copy .lead {
    max-width: 36em;
    margin: 22px 0 0;
    font-size: clamp(1.05rem, 0.95rem + 0.4vw, 1.25rem);
    font-weight: 400;
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.74);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 36px;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    max-width: 560px;
    margin-top: 48px;
}

.stat-box {
    padding: 16px 18px;
    border: 1px solid var(--tc-line-dark);
    border-radius: var(--tc-radius);
    background: rgba(255, 255, 255, 0.035);
}

.stat-num {
    display: inline-block;
    direction: ltr;
    unicode-bidi: isolate;
    font-family: var(--tc-font-mono);
    font-size: clamp(1.6rem, 1.2rem + 1vw, 2.1rem);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
    color: var(--tc-white);
}

.stat-box span {
    display: block;
    margin-top: 6px;
    font-size: 0.9rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.66);
}

.hero-visual {
    position: relative;
}

.orbit-stage {
    position: relative;
    width: min(100%, 480px);
    aspect-ratio: 1 / 1;
    margin-inline: auto;
}

.orbit-glow {
    position: absolute;
    inset: 16%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(91, 75, 219, 0.5), rgba(34, 211, 238, 0.12) 52%, transparent 70%);
}

.orbit-rings {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.orbit-rings .ring {
    fill: none;
    stroke-width: 1;
    transform-box: fill-box;
    transform-origin: center;
}

.orbit-rings .ring-outer {
    stroke: rgba(148, 163, 184, 0.2);
}

.orbit-rings .ring-inner {
    stroke: rgba(34, 211, 238, 0.4);
    stroke-dasharray: 2 8;
}

.orbit-rings .ring-node {
    fill: var(--tc-cyan);
}

.hero-mark {
    position: absolute;
    top: 27%;
    left: 27%;
    width: 46%;
    height: 46%;
    overflow: visible;
    filter: drop-shadow(0 0 36px rgba(91, 75, 219, 0.45));
}

.hero-mark .tc-orbit {
    stroke-dasharray: 1;
    stroke-dashoffset: 0;
}

.hero-mark .tc-core {
    transform-box: fill-box;
    transform-origin: center;
}

.hero-mark .tc-sat {
    transform-box: view-box;
    transform-origin: 60px 60px;
}

.orbit-chip {
    position: absolute;
    translate: -50% -50%;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: rgba(16, 24, 58, 0.85);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
    color: var(--tc-white);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.3;
    white-space: nowrap;
}

.orbit-chip i {
    flex: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--tc-cyan);
    box-shadow: 0 0 10px var(--tc-cyan);
}

.orbit-chip.chip-2 i,
.orbit-chip.chip-4 i {
    background: var(--tc-violet-light);
    box-shadow: 0 0 10px var(--tc-violet-light);
}

.chip-1 { left: 13.6%; top: 29%; }
.chip-2 { left: 84.4%; top: 25.9%; }
.chip-3 { left: 86.4%; top: 71%; }
.chip-4 { left: 13.6%; top: 71%; }

/* Hero entrance: copy rises, the mark draws itself, then the services join the orbit */
@keyframes tc-rise {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: none; }
}

@keyframes tc-draw {
    from { stroke-dashoffset: 1; }
    to { stroke-dashoffset: 0; }
}

@keyframes tc-pop {
    0% { opacity: 0; transform: scale(0.2); }
    70% { opacity: 1; transform: scale(1.12); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes tc-orbit {
    from { opacity: 0; transform: rotate(-220deg); }
    25% { opacity: 1; }
    to { opacity: 1; transform: rotate(0deg); }
}

@keyframes tc-fade-scale {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes tc-chip-in {
    from { opacity: 0; scale: 0.8; }
    to { opacity: 1; scale: 1; }
}

.hero-rise {
    animation: tc-rise 0.7s var(--tc-ease) both;
}

.hero-copy > .hero-rise:nth-child(2) { animation-delay: 0.08s; }
.hero-copy > .hero-rise:nth-child(3) { animation-delay: 0.16s; }
.hero-copy > .hero-rise:nth-child(4) { animation-delay: 0.24s; }
.hero-copy > .hero-rise:nth-child(5) { animation-delay: 0.32s; }

.orbit-glow { animation: tc-fade-scale 1.2s var(--tc-ease) both; }
.orbit-rings .ring-outer { animation: tc-fade-scale 0.9s 0.1s var(--tc-ease) both; }
.orbit-rings .ring-inner { animation: tc-fade-scale 0.9s 0.2s var(--tc-ease) both; }
.orbit-rings .ring-node { animation: tc-rise 0.6s 1.1s var(--tc-ease) both; }
.hero-mark .tc-orbit { animation: tc-draw 1.1s 0.35s cubic-bezier(0.65, 0, 0.25, 1) both; }
.hero-mark .tc-core { animation: tc-pop 0.6s 0.25s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.hero-mark .tc-sat { animation: tc-orbit 1.3s 0.5s cubic-bezier(0.3, 0.7, 0.2, 1) both; }
.orbit-chip { animation: tc-chip-in 0.5s calc(1.15s + var(--i, 0) * 0.12s) var(--tc-ease) both; }

/* Sections -------------------------------------------------------------- */

.tc-section {
    position: relative;
    padding: clamp(76px, 9vw, 128px) 0;
}

.bg-paper {
    background: var(--tc-paper);
}

.bg-ink {
    background: var(--tc-ink);
    color: var(--tc-white);
}

.section-heading {
    max-width: 780px;
    margin: 0 auto 56px;
    text-align: center;
}

.section-heading h2 {
    margin: 16px 0 0;
    font-size: clamp(1.9rem, 1.25rem + 2.2vw, 3rem);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.015em;
}

html[lang="ar"] .section-heading h2,
html[lang="ar"] .ai-copy h2,
html[lang="ar"] .cta-copy h2 {
    font-weight: 700;
    line-height: 1.45;
}

.card-icon {
    display: grid;
    flex: none;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(91, 75, 219, 0.12), rgba(34, 211, 238, 0.14));
    color: var(--tc-violet);
}

.card-icon svg,
.ai-card svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* About */
.about-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.about-card {
    padding: 34px;
    border: 1px solid var(--tc-line);
    border-radius: var(--tc-radius-lg);
    background: var(--tc-white);
    box-shadow: var(--tc-shadow);
}

.about-card h3 {
    margin: 22px 0 10px;
    font-size: 1.25rem;
    font-weight: 600;
}

.about-card p {
    margin: 0;
    color: var(--tc-sub);
    line-height: 1.8;
}

/* Services */
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.service-card {
    position: relative;
    overflow: hidden;
    padding: 32px 28px 30px;
    border: 1px solid var(--tc-line);
    border-radius: 16px;
    background: var(--tc-white);
    box-shadow: var(--tc-shadow);
    transition: translate 0.3s var(--tc-ease), box-shadow 0.3s, border-color 0.3s;
}

.service-card::before {
    content: "";
    position: absolute;
    top: 0;
    inset-inline: 0;
    height: 3px;
    background: var(--tc-grad);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s var(--tc-ease);
}

html[dir="rtl"] .service-card::before {
    transform-origin: right;
}

.service-card:hover {
    translate: 0 -4px;
    border-color: rgba(34, 211, 238, 0.5);
    box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.2), 0 22px 44px -18px rgba(11, 16, 38, 0.22), 0 0 36px -10px rgba(34, 211, 238, 0.45);
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-number {
    position: absolute;
    top: 30px;
    inset-inline-end: 28px;
    font-family: var(--tc-font-mono);
    font-size: 0.8rem;
    color: var(--tc-sub);
}

.service-card h3 {
    margin: 24px 0 10px;
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.4;
}

.service-card p {
    margin: 0;
    color: var(--tc-sub);
    font-size: 1rem;
    line-height: 1.75;
}

/* Process */
.process-track {
    position: relative;
}

.process-line {
    position: absolute;
    top: 27px;
    inset-inline: 10%;
    height: 2px;
    background: rgba(11, 16, 38, 0.08);
    border-radius: 2px;
    overflow: hidden;
}

.process-line span {
    display: block;
    width: 100%;
    height: 100%;
    background: var(--tc-grad);
    transform: scaleX(var(--progress, 1));
    transform-origin: left;
}

html[dir="rtl"] .process-line span {
    background: linear-gradient(270deg, var(--tc-violet), var(--tc-cyan));
    transform-origin: right;
}

.process-grid {
    position: relative;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.process-item {
    text-align: center;
}

.process-dot {
    display: inline-grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border: 1px solid var(--tc-line);
    border-radius: 50%;
    background: var(--tc-white);
    font-family: var(--tc-font-mono);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--tc-sub);
    transition: background-color 0.4s, color 0.4s, border-color 0.4s, box-shadow 0.4s;
}

.process-item.is-active .process-dot,
html:not(.js) .process-dot {
    border-color: transparent;
    background: var(--tc-ink);
    color: var(--tc-white);
    box-shadow: 0 0 0 5px rgba(91, 75, 219, 0.14), 0 8px 22px -6px rgba(91, 75, 219, 0.55);
}

.process-item h3 {
    margin: 20px 0 8px;
    font-size: 1.1rem;
    font-weight: 600;
}

.process-item p {
    margin: 0;
    color: var(--tc-sub);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* AI in your business */
.ai-section {
    overflow: hidden;
}

.ai-section::before {
    content: "";
    position: absolute;
    top: -20%;
    inset-inline-start: -10%;
    width: 640px;
    height: 640px;
    background: radial-gradient(closest-side, rgba(91, 75, 219, 0.28), transparent 72%);
    pointer-events: none;
}

.ai-inner {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 64px;
    align-items: center;
}

.ai-copy h2 {
    margin: 16px 0 18px;
    font-size: clamp(1.9rem, 1.25rem + 2.2vw, 3rem);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.015em;
}

.ai-copy > p:not(.eyebrow) {
    margin: 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 1.1rem;
    line-height: 1.8;
}

.check-list {
    display: grid;
    gap: 14px;
    margin: 30px 0 0;
    padding: 0;
    list-style: none;
}

.check-list li {
    position: relative;
    padding-inline-start: 38px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.65;
}

.check-list li::before {
    content: "";
    position: absolute;
    top: 2px;
    inset-inline-start: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(34, 211, 238, 0.14) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2322D3EE' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 12.5l3.2 3.2L17 9'/%3E%3C/svg%3E") center / 18px no-repeat;
}

.ai-panel {
    position: relative;
    padding: 22px;
    border: 1px solid var(--tc-line-dark);
    border-radius: 22px;
    background: linear-gradient(160deg, rgba(24, 34, 77, 0.9), rgba(16, 24, 58, 0.92));
    box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.ai-panel::before {
    content: "";
    position: absolute;
    inset: -1px;
    z-index: -1;
    border-radius: inherit;
    background: var(--tc-grad);
    opacity: 0.35;
    filter: blur(28px);
}

.panel-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--tc-line-dark);
}

.panel-top strong {
    font-family: var(--tc-font-mono);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    color: rgba(255, 255, 255, 0.85);
}

html[lang="ar"] .panel-top strong {
    font-family: var(--tc-font-ar);
    font-size: 0.92rem;
    letter-spacing: 0;
}

.live {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(34, 211, 238, 0.12);
    color: var(--tc-cyan);
    font-family: var(--tc-font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.1em;
}

html[lang="ar"] .live {
    font-family: var(--tc-font-ar);
    font-size: 0.85rem;
    letter-spacing: 0;
}

.live i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--tc-cyan);
    box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.6);
    animation: tc-pulse 2s ease-out infinite;
}

@keyframes tc-pulse {
    0% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.55); }
    70%, 100% { box-shadow: 0 0 0 8px rgba(34, 211, 238, 0); }
}

.chat {
    display: grid;
    gap: 14px;
    padding: 22px 0;
}

.msg {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    max-width: 88%;
}

.msg p {
    margin: 0;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 0.98rem;
    line-height: 1.6;
}

.msg-user {
    justify-self: end;
}

.msg-user p {
    border-end-end-radius: 6px;
    background: linear-gradient(135deg, var(--tc-violet), var(--tc-indigo));
    color: var(--tc-white);
}

.msg-bot {
    justify-self: start;
}

.msg-bot p {
    border: 1px solid var(--tc-line-dark);
    border-end-start-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.92);
}

.bot-avatar {
    display: grid;
    flex: none;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--tc-line-dark);
    border-radius: 50%;
    background: var(--tc-ink);
}

.bot-avatar svg {
    width: 24px;
    height: 24px;
}

.typing {
    display: inline-flex;
    gap: 5px;
    padding: 16px 18px;
    border: 1px solid var(--tc-line-dark);
    border-radius: 16px;
    border-end-start-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
}

.typing[hidden] {
    display: none;
}

.typing i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.7);
    animation: tc-typing 1s ease-in-out infinite;
}

.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }

@keyframes tc-typing {
    0%, 60%, 100% { opacity: 0.35; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-4px); }
}

.ai-panel.is-typing .answer {
    display: none;
}

.ai-panel .msg {
    transition: opacity 0.45s var(--tc-ease), transform 0.45s var(--tc-ease);
}

.js .ai-panel .msg {
    opacity: 0;
    transform: translateY(10px);
}

.js .ai-panel .msg.is-shown,
.js .ai-panel.is-played .msg {
    opacity: 1;
    transform: none;
}

.ai-panel.is-played .answer {
    animation: tc-rise 0.4s var(--tc-ease) both;
}

.ai-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding-top: 18px;
    border-top: 1px solid var(--tc-line-dark);
}

.ai-card {
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 14px 8px;
    border: 1px solid var(--tc-line-dark);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--tc-cyan);
    text-align: center;
}

.ai-card small {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.82rem;
    line-height: 1.35;
}

/* Values */
.values-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
}

.value-item {
    padding: 26px 22px;
    border: 1px solid var(--tc-line);
    border-radius: 16px;
    background: var(--tc-white);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.value-item:hover {
    border-color: rgba(91, 75, 219, 0.35);
    box-shadow: var(--tc-shadow);
}

.value-item strong {
    display: inline-block;
    font-family: var(--tc-font-mono);
    font-size: 1.6rem;
    font-weight: 500;
    line-height: 1;
    background-image: var(--tc-grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.value-item p {
    margin: 16px 0 0;
    font-weight: 500;
    line-height: 1.65;
}

/* Projects */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.project-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--tc-line);
    border-radius: var(--tc-radius-lg);
    background: var(--tc-white);
    box-shadow: var(--tc-shadow);
    transition: translate 0.3s var(--tc-ease), box-shadow 0.3s, border-color 0.3s;
}

.project-card:hover {
    translate: 0 -4px;
    border-color: rgba(34, 211, 238, 0.45);
    box-shadow: 0 22px 44px -18px rgba(11, 16, 38, 0.22), 0 0 36px -12px rgba(34, 211, 238, 0.4);
}

.project-media {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: radial-gradient(circle at 70% 20%, rgba(91, 75, 219, 0.45), transparent 60%), var(--tc-ink-2);
}

.project-media svg {
    display: block;
    width: 100%;
    height: 100%;
    transition: transform 0.6s var(--tc-ease);
}

.project-card:hover .project-media svg {
    transform: scale(1.04);
}

.pm-road {
    stroke: rgba(148, 163, 184, 0.14);
    stroke-width: 14;
}

.project-body {
    display: grid;
    gap: 10px;
    padding: 24px 26px 28px;
}

.project-tag {
    justify-self: start;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(91, 75, 219, 0.1);
    color: var(--tc-violet);
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.4;
}

.project-card h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.5;
}

.project-next {
    justify-content: center;
    gap: 14px;
    padding: 32px 30px;
    border: 1.5px dashed rgba(91, 75, 219, 0.35);
    background: linear-gradient(160deg, rgba(91, 75, 219, 0.06), rgba(34, 211, 238, 0.06)), var(--tc-white);
    box-shadow: none;
    color: var(--tc-ink);
    text-decoration: none;
}

.project-next:hover {
    color: var(--tc-ink);
    border-style: solid;
}

.project-next .project-tag {
    justify-self: auto;
    align-self: flex-start;
}

.next-plus {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--tc-grad);
    color: var(--tc-white);
    box-shadow: 0 10px 24px -8px rgba(91, 75, 219, 0.7);
}

.next-plus svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
}

.next-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--tc-violet);
    font-weight: 600;
}

/* Team */
.team-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
}

.team-card {
    display: flex;
    flex: 0 1 calc(25% - 12px);
    flex-direction: column;
    align-items: center;
    gap: 16px;
    min-width: 220px;
    padding: 28px 20px 26px;
    border: 1px solid var(--tc-line);
    border-radius: 16px;
    background: var(--tc-white);
    text-align: center;
    transition: border-color 0.3s, box-shadow 0.3s, translate 0.3s var(--tc-ease);
}

.team-card:hover {
    translate: 0 -3px;
    border-color: rgba(91, 75, 219, 0.35);
    box-shadow: var(--tc-shadow);
}

.team-avatar {
    position: relative;
    isolation: isolate;
    display: grid;
    flex: none;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--tc-ink);
    color: var(--tc-white);
    font-family: var(--tc-font-mono);
    font-size: 1.05rem;
    font-weight: 500;
}

.team-avatar::before {
    content: "";
    position: absolute;
    inset: -3px;
    z-index: -1;
    border-radius: 50%;
    background: var(--tc-grad);
}

.team-content {
    min-width: 0;
}

.team-content strong {
    display: block;
    color: var(--tc-violet);
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.4;
}

.team-content span {
    display: block;
    margin-top: 4px;
    font-size: 1.02rem;
    font-weight: 600;
    line-height: 1.45;
}

/* Contact */
.cta-section {
    padding: clamp(76px, 9vw, 120px) 0 0;
    background: #080C1F;
}

.cta-box {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    overflow: hidden;
    padding: clamp(36px, 5vw, 64px);
    border: 1px solid var(--tc-line-dark);
    border-radius: 28px;
    background: var(--tc-ink-2);
    color: var(--tc-white);
    box-shadow: 0 40px 80px -40px rgba(11, 16, 38, 0.6);
}

.cta-box::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    background:
        radial-gradient(circle at 12% 0%, rgba(91, 75, 219, 0.55), transparent 45%),
        radial-gradient(circle at 92% 110%, rgba(34, 211, 238, 0.32), transparent 45%);
}

.cta-copy {
    max-width: 640px;
}

.cta-copy h2 {
    margin: 16px 0 12px;
    font-size: clamp(1.75rem, 1.2rem + 1.9vw, 2.6rem);
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.015em;
}

.cta-copy p:last-child {
    margin: 0;
    color: rgba(255, 255, 255, 0.74);
    font-size: 1.05rem;
}

.cta-toggle {
    flex: none;
}

.contact-form-panel {
    margin-top: 20px;
    padding: clamp(24px, 4vw, 40px);
    border: 1px solid var(--tc-line-dark);
    border-radius: 24px;
    background: var(--tc-ink-2);
    color: var(--tc-white);
    animation: tc-rise 0.45s var(--tc-ease) both;
}

.contact-form {
    display: grid;
    gap: 18px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
}

.form-field {
    display: grid;
    gap: 8px;
}

.form-field label {
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.9rem;
    font-weight: 500;
}

.form-field input,
.form-field textarea {
    width: 100%;
    padding: 13px 15px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--tc-radius);
    background: rgba(255, 255, 255, 0.04);
    color: var(--tc-white);
    font: inherit;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

html[dir="rtl"] .form-field input[dir="ltr"] {
    text-align: right;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.form-field input:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--tc-cyan);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.15);
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* Footer ---------------------------------------------------------------- */

.site-footer {
    background: #080C1F;
    color: rgba(255, 255, 255, 0.7);
}

.footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
    gap: 40px;
    padding-top: 72px;
    padding-bottom: 56px;
}

.footer-brand .brand-logo {
    height: 44px;
}

.footer-brand p {
    max-width: 30ch;
    margin: 18px 0 0;
    line-height: 1.75;
}

.site-footer h4 {
    margin: 0 0 16px;
    color: var(--tc-white);
    font-size: 1rem;
    font-weight: 600;
}

.site-footer ul {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.95rem;
}

.site-footer a {
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
    transition: color 0.2s;
}

.site-footer a:hover {
    color: var(--tc-cyan);
}

.contact-label {
    display: block;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.85rem;
}

.contact-phone {
    unicode-bidi: isolate;
    white-space: nowrap;
}

.contact-address {
    line-height: 1.7;
}

.footer-bottom {
    padding: 22px 0;
    border-top: 1px solid var(--tc-line-dark);
    color: rgba(255, 255, 255, 0.55);
}

/* Scroll reveal (only when JavaScript runs; reduced motion shows everything at once) */
.js .reveal {
    opacity: 0;
    transform: translate3d(0, 22px, 0);
    transition: opacity 0.7s var(--tc-ease), transform 0.7s var(--tc-ease);
    transition-delay: var(--reveal-delay, 0s);
}

.js .reveal.reveal-start {
    transform: translate3d(calc(var(--tc-dir) * -32px), 0, 0);
}

.js .reveal.reveal-end {
    transform: translate3d(calc(var(--tc-dir) * 32px), 0, 0);
}

.js .reveal.is-visible {
    opacity: 1;
    transform: none;
}

/* Responsive ------------------------------------------------------------ */

@media (max-width: 1199.98px) {
    /* Five values in rows of three: the last two sit centred. */
    .values-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .value-item {
        grid-column: span 2;
    }

    .value-item:nth-child(4) {
        grid-column: 2 / span 2;
    }

    .team-card {
        flex-basis: calc(33.333% - 11px);
    }
}

@media (max-width: 991.98px) {
    .hero-section {
        min-height: 0;
        padding-top: calc(var(--tc-nav-h) + 40px);
    }

    .hero-inner,
    .ai-inner {
        grid-template-columns: minmax(0, 1fr);
        gap: 48px;
    }

    .orbit-stage {
        width: min(82%, 420px);
    }

    .services-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* Three projects in rows of two: the last one sits centred. */
    .projects-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .project-card {
        grid-column: span 2;
    }

    .project-card:nth-child(3) {
        grid-column: 2 / span 2;
    }

    .process-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 26px;
    }

    .process-line {
        top: 28px;
        bottom: 28px;
        inset-inline: 27px auto;
        width: 2px;
        height: auto;
    }

    .process-line span,
    html[dir="rtl"] .process-line span {
        background: linear-gradient(180deg, var(--tc-violet), var(--tc-cyan));
        transform: scaleY(var(--progress, 1));
        transform-origin: top;
    }

    .process-item {
        display: grid;
        grid-template-columns: 56px minmax(0, 1fr);
        column-gap: 20px;
        text-align: start;
    }

    .process-dot {
        grid-row: span 2;
    }

    .process-item h3 {
        margin: 12px 0 4px;
    }

    .cta-box {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .about-grid,
    .services-grid,
    .projects-grid,
    .values-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .value-item,
    .value-item:nth-child(4),
    .project-card,
    .project-card:nth-child(3) {
        grid-column: auto;
    }

    .hero-actions .tc-btn {
        flex: 1 1 100%;
    }

    .hero-stats {
        gap: 8px;
    }

    .stat-box {
        padding: 14px 12px;
    }

    .stat-box span {
        font-size: 0.82rem;
    }

    .orbit-stage {
        width: min(88%, 380px);
    }

    .orbit-chip {
        padding: 6px 11px;
        font-size: 0.8rem;
    }

    .about-card {
        padding: 26px;
    }

    .section-heading {
        margin-bottom: 40px;
    }

    .value-item {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        gap: 16px;
        align-items: center;
    }

    .value-item p {
        margin: 0;
    }

    .team-card {
        flex-basis: calc(50% - 8px);
        min-width: 0;
        padding: 22px 12px;
    }

    .cta-toggle {
        width: 100%;
    }

    .footer-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 32px;
        padding-top: 56px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-delay: 0s !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        transition-delay: 0s !important;
        scroll-behavior: auto !important;
    }

    .js .reveal {
        opacity: 1;
        transform: none;
    }
}
