/*
Theme Name: CoreEdge Consulting
Theme URI: https://coreedge.consulting/
Author: CoreEdge Consulting
Author URI: https://coreedge.consulting/
Description: WordPress theme for CoreEdge IT Consulting: multilingual EN/FR/AR with RTL, signed-invoice opening sequence, animated 3D glass-core hero, portfolio of in-house products.
Version: 2.2.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: coreedge-consulting
Tags: one-page, custom-colors, custom-logo, responsive, rtl-language-support
*/

/* ============================================================
   1. Tokens
   Palette: ink (navy), paper (cool ledger paper), ledger blue,
   seal green (validation), signal teal (on dark).
   ============================================================ */
:root {
    --ink:          #0F2231;
    --ink-2:        #16303F;
    --paper:        #EEF3F1;
    --paper-2:      #E4ECE9;
    --white:        #FFFFFF;
    --line:         #D2DEDA;
    --line-dark:    rgba(232, 240, 238, 0.12);

    --text:         #14232F;
    --text-body:    #3F505B;
    --text-muted:   #5B6D77;
    --on-dark:      #E8F0EE;
    --on-dark-muted: rgba(232, 240, 238, 0.7);

    --blue:         #2E7BB4;
    --blue-ink:     #1F5F8F;
    --teal:         #3DA4C7;
    --green:        #2F9E6A;
    --green-ink:    #1F7A4E;

    /* legacy names kept for markup that still references them */
    --bg-dark:      var(--ink);
    --bg-main:      var(--paper);
    --border:       var(--line);

    --font:         'Schibsted Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-ar:      'IBM Plex Sans Arabic', 'Schibsted Grotesk', system-ui, sans-serif;
    --font-mono:    'JetBrains Mono', ui-monospace, 'Cascadia Code', monospace;

    --header-h:     72px;
    --gutter:       clamp(20px, 4vw, 32px);
    --section-y:    clamp(72px, 10vw, 128px);
    --r-lg:         18px;
    --r-md:         12px;
    --r-sm:         8px;

    --ease-out:     cubic-bezier(0.16, 1, 0.3, 1);
    --ease:         cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   2. Base
   ============================================================ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-body);
    background: var(--white);
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
}
body.lang-ar { font-family: var(--font-ar); direction: rtl; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4 { color: var(--text); text-wrap: balance; }
p { text-wrap: pretty; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; border-radius: 4px; }

/* Multilingual: every string is rendered in all three languages */
body.lang-en [data-lang="fr"], body.lang-en [data-lang="ar"],
body.lang-fr [data-lang="en"], body.lang-fr [data-lang="ar"],
body.lang-ar [data-lang="en"], body.lang-ar [data-lang="fr"] { display: none !important; }

.container { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: var(--gutter); }
section { padding-block: var(--section-y); }
.text-center { text-align: center; }

/* ============================================================
   3. Type
   ============================================================ */
.section-head {
    display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 18px 64px; align-items: end; margin-bottom: clamp(40px, 6vw, 64px);
}
.section-title {
    font-size: clamp(2rem, 4.2vw, 3.25rem); font-weight: 750; line-height: 1.04;
    letter-spacing: -0.032em; color: var(--text); margin-bottom: 0;
}
.section-title-light { color: var(--white); }
.section-sub { font-size: 1.05rem; line-height: 1.65; color: var(--text-muted); max-width: 46ch; }
.section-sub-light { color: var(--on-dark-muted); }
body.lang-ar .section-title,
body.lang-ar .hero-headline,
body.lang-ar .maint-title { letter-spacing: 0; line-height: 1.3; }

/* ============================================================
   4. Buttons
   ============================================================ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    min-height: 50px; padding: 0 24px; border-radius: 10px;
    font-weight: 650; font-size: 0.97rem; line-height: 1.2; text-align: center;
    transition: background-color 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: var(--white); }
.btn-primary:hover { background: var(--blue-ink); }
.btn-ghost { color: var(--ink); box-shadow: inset 0 0 0 1.5px rgba(15, 34, 49, 0.22); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn-outline-dark { color: var(--white); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.3); }
.btn-outline-dark:hover { box-shadow: inset 0 0 0 1.5px var(--white); background: rgba(255, 255, 255, 0.06); }
#services .btn-primary, #why-us .btn-primary, .cta-card .btn-primary { background: var(--white); color: var(--ink); }
#services .btn-primary:hover, #why-us .btn-primary:hover, .cta-card .btn-primary:hover { background: var(--paper-2); }

/* ============================================================
   5. Header
   The blur lives on ::before so that the fixed mobile drawer is
   not trapped inside the header's containing block.
   ============================================================ */
#site-header { position: fixed; inset: 0 0 auto 0; z-index: 1000; }
#site-header::before {
    content: ''; position: absolute; inset: 0; z-index: -1;
    background: rgba(255, 255, 255, 0.86);
    -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
    border-bottom: 1px solid transparent; transition: border-color 0.3s var(--ease);
}
#site-header.scrolled::before { border-bottom-color: var(--line); }
#site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 20px; height: var(--header-h); }

.site-logo { font-size: 1.28rem; font-weight: 800; letter-spacing: -0.045em; color: var(--ink); white-space: nowrap; flex-shrink: 0; }
.site-logo em { font-style: normal; color: var(--blue); }
.site-logo img, .custom-logo { height: 56px; max-height: none; width: auto; }
.footer-logo { display: inline-flex !important; align-items: center; gap: 10px; }
.footer-logo img { height: 36px; width: auto; }

.main-nav { display: flex; align-items: center; gap: 22px; }
.nav-menu { display: flex; align-items: center; gap: 4px; }
.nav-menu a {
    display: inline-flex; align-items: center; min-height: 40px; padding: 0 10px;
    font-size: 0.9rem; font-weight: 500; color: var(--text-body); border-radius: 8px; white-space: nowrap;
    transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.nav-menu a:hover { color: var(--ink); background: var(--paper); }
.nav-menu a.active { color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 #14A866; border-radius: 0; }

.lang-switcher { display: flex; padding: 4px; gap: 2px; background: rgba(255, 255, 255, 0.7); border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); flex-shrink: 0; }
.lang-btn { min-width: 38px; min-height: 34px; padding: 0 8px; border-radius: 7px; font-size: 0.78rem; font-weight: 700; color: var(--text-muted); transition: background-color 0.2s var(--ease), color 0.2s var(--ease); }
.lang-btn:hover { color: var(--ink); }
.lang-btn.active { background: var(--white); color: var(--ink); box-shadow: 0 1px 3px rgba(15, 34, 49, 0.14), 0 0 0 1px rgba(15, 34, 49, 0.06); }

.nav-toggle { display: none; width: 44px; height: 44px; align-items: center; justify-content: center; flex-direction: column; gap: 5px; border-radius: 10px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform 0.3s var(--ease-out), opacity 0.2s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   6. Hero: glass core wired to code, cloud and a signed invoice
   Everything in the scene is sized in cqw (1% of the scene width),
   so the composition scales as one piece from phone to desktop.
   ============================================================ */
#hero {
    --emerald:   #14A866;
    --emerald-2: #0B7F4B;
    --glow:      #3DDC97;
    /* desktop: exactly one screen tall; everything below scales with the viewport height */
    position: relative; overflow: hidden; isolation: isolate;
    height: 100svh; min-height: 580px; max-height: 1080px;
    display: flex; flex-direction: column; justify-content: center;
    padding-top: calc(var(--header-h) + clamp(12px, 3.2vh, 48px));
    padding-bottom: clamp(14px, 2.6vh, 36px);
    background: linear-gradient(180deg, #F6F8F8 0%, #EEF2F1 100%);
}
.hero-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hero-bg { overflow: hidden; }
.hero-bg::before { /* soft light */
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(900px 600px at 78% 40%, rgba(255, 255, 255, 0.95), transparent 70%);
}
.hero-spot { /* cursor spotlight, moved with transform only */
    position: absolute; left: 0; top: 0; width: 640px; height: 520px; margin: -260px 0 0 -320px;
    background: radial-gradient(closest-side, rgba(61, 220, 151, 0.14), transparent);
    transform: translate(var(--hx, 70vw), var(--hy, 35vh)); transition: transform 0.7s var(--ease-out);
    will-change: transform;
}
.hero-bg::after { /* engineering grid, fading out */
    content: ''; position: absolute; inset: 0;
    background-image: linear-gradient(rgba(15, 34, 49, 0.045) 1px, transparent 1px), linear-gradient(90deg, rgba(15, 34, 49, 0.045) 1px, transparent 1px);
    background-size: 56px 56px;
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 70% 40%, #000 10%, transparent 75%);
            mask-image: radial-gradient(ellipse 70% 60% at 70% 40%, #000 10%, transparent 75%);
}

.hero-layout { display: grid; grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); gap: clamp(16px, 3vw, 48px); align-items: center; }
.hero-slogan {
    display: inline-flex; align-items: center; gap: 12px; margin-bottom: clamp(10px, 2.6vh, 28px);
    font-size: clamp(0.95rem, 1.2vw, 1.1rem); font-weight: 650; letter-spacing: -0.01em; color: var(--emerald-2);
    direction: ltr; unicode-bidi: isolate;
}
.hero-slogan-dot { position: relative; width: 12px; height: 12px; border-radius: 50%; background: var(--emerald); box-shadow: 0 0 0 5px rgba(20, 168, 102, 0.14); }
.hero-slogan-dot::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--emerald); animation: dotPing 2.4s var(--ease-out) infinite; }
@keyframes dotPing { 0% { transform: scale(1); opacity: 0.7; } 80%, 100% { transform: scale(3.2); opacity: 0; } }

.hero-headline {
    font-size: clamp(2.3rem, min(5.4vw, 8.6vh), 4.7rem); font-weight: 800; line-height: 0.96;
    letter-spacing: -0.052em; color: #0B1620; max-width: 12.6ch;
    text-wrap: wrap; /* balance + per-word inline-blocks sends Chrome's layout into a loop */
}
body.lang-en .hero-headline { max-width: 6.7em; } /* Technology / that moves / your business / forward. */
body.lang-fr .hero-headline { max-width: 13.5ch; font-size: clamp(2.1rem, min(4.8vw, 7.4vh), 4.6rem); }
.hero-headline .w { display: inline-block; overflow: clip; overflow-clip-margin: 0.12em; vertical-align: top; padding-bottom: 0.06em; margin-bottom: -0.06em; }
.hero-headline .w > span { display: inline-block; }
.hero-sub { font-size: clamp(1rem, min(1.35vw, 2.2vh), 1.2rem); line-height: 1.6; max-width: 44ch; margin: clamp(12px, 2.6vh, 30px) 0 clamp(16px, 3.4vh, 38px); color: #4A5A64; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; }
#hero .btn { min-height: clamp(46px, 7vh, 56px); padding: 0 26px; border-radius: 10px; font-size: 1.02rem; }
#hero .btn-primary { background: #0B1A26; box-shadow: 0 14px 30px -14px rgba(11, 26, 38, 0.65); }
#hero .btn-primary:hover { background: #0F2A3A; }
#hero .btn-ghost { background: rgba(255, 255, 255, 0.55); box-shadow: inset 0 0 0 1.5px rgba(15, 34, 49, 0.28); }
#hero .btn-ghost:hover { background: var(--white); box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn-arrow svg { width: 20px; height: 20px; transition: transform 0.3s var(--ease-out); }
.btn-arrow:hover svg { transform: translateX(4px); }
body.lang-ar .btn-arrow svg { transform: scaleX(-1); }
body.lang-ar .btn-arrow:hover svg { transform: scaleX(-1) translateX(4px); }

/* ---------- Scene ---------- */
.hero-layout { flex: 1 1 auto; min-height: 0; }
.hero-visual { position: relative; display: grid; place-items: center; }
.scene {
    --mx: 0; --my: 0;
    /* never taller than the space the header, paddings and feature strip leave */
    position: relative; aspect-ratio: 10 / 9;
    width: min(100%, calc((100svh - var(--header-h) - 190px) * 10 / 9));
    container-type: inline-size;
    direction: ltr; /* the composition does not mirror in Arabic */
}
.sc-floor, .sc-links { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.sc-layer {
    position: absolute;
    transform: translate3d(calc(var(--mx) * var(--d) * 3.6cqw), calc(var(--my) * var(--d) * 2.8cqw - var(--sp, 0) * var(--d) * 14cqw), 0);
    transition: transform 0.9s var(--ease-out);
}
.sc-links.sc-layer { inset: 0; }

.ring { fill: none; }
.ring-outer { stroke: rgba(15, 34, 49, 0.12); stroke-width: 1.5; }
.ring-inner { stroke: rgba(255, 255, 255, 0.95); stroke-width: 10; }
.ring-dash { stroke: rgba(20, 168, 102, 0.55); stroke-width: 2; stroke-dasharray: 18 26; animation: ringFlow 12s linear infinite; }
.ring-pool { opacity: 0.8; }
@keyframes ringFlow { to { stroke-dashoffset: -440; } }
@keyframes glowPulse { from { opacity: 0.6; } to { opacity: 1; } }

/* wires */
.wire { fill: none; stroke: var(--emerald); stroke-width: 2.6; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.wire-glow { fill: none; stroke: rgba(61, 220, 151, 0.22); stroke-width: 9; stroke-linecap: round; }
.wire-thin { stroke-width: 1.6; opacity: 0.6; }
.flow { fill: none; stroke: #C9FFE4; stroke-width: 2.6; stroke-linecap: round; stroke-dasharray: 0.03 0.12; animation: wireFlow 2.8s linear infinite; opacity: 0.9; }
@keyframes wireFlow { to { stroke-dashoffset: -0.15; } }
.packet { fill: url(#scPacket); }
.node-halo { fill: url(#scHalo); animation: halo 2.6s ease-in-out infinite; }
.node:nth-child(2) .node-halo { animation-delay: -0.7s; }
.node:nth-child(3) .node-halo { animation-delay: -1.4s; }
.node:nth-child(4) .node-halo { animation-delay: -2s; }
@keyframes halo { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }

/* ---------- Glass cube ---------- */
.l-cube { left: 22%; top: 16%; width: 52cqw; aspect-ratio: 1; display: grid; place-items: center; perspective: 1400px; }
.cube-glow {
    position: absolute; left: 50%; top: 58%; width: 64cqw; height: 34cqw; translate: -50% -50%;
    background: radial-gradient(closest-side, rgba(61, 220, 151, 0.35), transparent);
    animation: glowPulse 4s ease-in-out infinite alternate;
}
.cube {
    --cs: 29cqw;
    position: relative; width: var(--cs); height: var(--cs);
    transform-style: preserve-3d;
    transform: rotateX(-24deg) rotateY(38deg);
    animation: cubeSpin 26s linear infinite;
}
@keyframes cubeSpin { from { transform: rotateX(-24deg) rotateY(38deg); } to { transform: rotateX(-24deg) rotateY(398deg); } }
.cf, .kf { position: absolute; inset: 0; backface-visibility: visible; }
.cf {
    background:
        linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.55) 38%, transparent 46%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.62), rgba(226, 240, 234, 0.16) 50%, rgba(255, 255, 255, 0.4) 100%);
    box-shadow: inset 0 0 0 0.35cqw rgba(255, 255, 255, 0.92), inset 0 0 0 0.5cqw rgba(15, 34, 49, 0.08), inset 0 0 3cqw rgba(255, 255, 255, 0.45);
    border-radius: 0.6cqw;
}
/* dark corner pillars: each side face paints its two vertical edges, adjacent faces meet in an L-profile */
.cf-front::before, .cf-back::before, .cf-left::before, .cf-right::before,
.cf-front::after,  .cf-back::after,  .cf-left::after,  .cf-right::after {
    content: ''; position: absolute; top: -1%; bottom: -1%; width: 8%;
    background: linear-gradient(90deg, #0E1418, #2A343A 45%, #111A1F);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
    border-radius: 0.5cqw;
}
.cf::before { left: 0; } .cf::after { right: 0; }
.cf-top, .cf-bottom { background: linear-gradient(135deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.12)); }
.cf-top::before, .cf-top::after { content: ''; position: absolute; inset: 0; background:
    radial-gradient(circle at 4% 4%, #151D22 6%, transparent 6.5%), radial-gradient(circle at 96% 4%, #151D22 6%, transparent 6.5%),
    radial-gradient(circle at 4% 96%, #151D22 6%, transparent 6.5%), radial-gradient(circle at 96% 96%, #151D22 6%, transparent 6.5%); }
.cf-front  { transform: translateZ(calc(var(--cs) / 2)); }
.cf-back   { transform: rotateY(180deg) translateZ(calc(var(--cs) / 2)); }
.cf-right  { transform: rotateY(90deg) translateZ(calc(var(--cs) / 2)); }
.cf-left   { transform: rotateY(-90deg) translateZ(calc(var(--cs) / 2)); }
.cf-top    { transform: rotateX(90deg) translateZ(calc(var(--cs) / 2)); }
.cf-bottom { transform: rotateX(-90deg) translateZ(calc(var(--cs) / 2)); background: rgba(20, 168, 102, 0.12); }

.core {
    --ks: calc(var(--cs) * 0.58);
    position: absolute; left: 50%; top: 50%; width: var(--ks); height: var(--ks);
    margin: calc(var(--ks) / -2) 0 0 calc(var(--ks) / -2);
    transform-style: preserve-3d;
    animation: coreSpin 18s linear infinite reverse;
}
@keyframes coreSpin { to { transform: rotateY(360deg); } }
.kf {
    background:
        repeating-linear-gradient(90deg, rgba(210, 255, 232, 0.22) 0 1px, transparent 1px 16.6%),
        repeating-linear-gradient(0deg, rgba(210, 255, 232, 0.16) 0 1px, transparent 1px 16.6%),
        radial-gradient(circle at 30% 25%, rgba(190, 255, 220, 0.9), transparent 55%),
        linear-gradient(150deg, #2FD08A 0%, #0FA05E 45%, #06663B 100%);
    box-shadow: inset 0 0 1.6cqw rgba(200, 255, 225, 0.7), 0 0 3cqw rgba(61, 220, 151, 0.55);
    border-radius: 0.3cqw; opacity: 0.93;
}
.kf-front  { transform: translateZ(calc(var(--ks) / 2)); }
.kf-back   { transform: rotateY(180deg) translateZ(calc(var(--ks) / 2)); }
.kf-right  { transform: rotateY(90deg) translateZ(calc(var(--ks) / 2)); }
.kf-left   { transform: rotateY(-90deg) translateZ(calc(var(--ks) / 2)); }
.kf-top    { transform: rotateX(90deg) translateZ(calc(var(--ks) / 2)); }
.kf-bottom { transform: rotateX(-90deg) translateZ(calc(var(--ks) / 2)); }

/* ---------- Glass panels ---------- */
.sc-panel {
    position: relative; width: 100%; height: 100%;
    border-radius: 1.4cqw;
    animation: panelFloat 7s ease-in-out infinite alternate;
}
@keyframes panelFloat { from { translate: 0 0; } to { translate: 0 -1.4cqw; } }

/* code */
.l-code { left: 0; top: 10%; width: 38cqw; height: 27cqw; }
.p-code {
    transform: perspective(900px) rotateY(20deg) rotateX(4deg) rotateZ(-7deg);
    background: linear-gradient(160deg, rgba(22, 36, 38, 0.94), rgba(10, 20, 22, 0.96));
    box-shadow: 0 0 0 0.25cqw rgba(255, 255, 255, 0.55), 0 0 0 0.55cqw rgba(20, 168, 102, 0.12), 0 3cqw 5cqw -2cqw rgba(8, 20, 24, 0.55);
    display: flex; flex-direction: column; overflow: hidden;
    font-size: 1.58cqw;
}
.pc-bar { display: flex; align-items: center; gap: 0.7cqw; padding: 1.3cqw 1.6cqw 0.9cqw; }
.pc-bar i { width: 1cqw; height: 1cqw; border-radius: 50%; background: #3DDC97; box-shadow: 0 0 0.8cqw rgba(61, 220, 151, 0.8); }
.pc-bar i:nth-child(2) { opacity: 0.65; } .pc-bar i:nth-child(3) { opacity: 0.35; }
.pc-file { margin-inline-start: auto; font-family: var(--font-mono); font-size: 0.85em; color: rgba(200, 240, 220, 0.45); }
.pc-body { flex: 1; display: flex; min-height: 0; }
.pc-side { display: grid; align-content: start; gap: 1.2cqw; padding: 0.8cqw 1.3cqw; border-inline-end: 1px solid rgba(255, 255, 255, 0.07); }
.pc-side i { width: 1.3cqw; height: 1.1cqw; border-radius: 0.25cqw; box-shadow: inset 0 0 0 1px rgba(200, 240, 220, 0.35); }
.pc-code { margin: 0; padding: 0.6cqw 1.6cqw; font-family: var(--font-mono); font-size: 1em; line-height: 1.75; color: #E4EEF0; white-space: pre; overflow: hidden; }
.pc-code b { font-weight: 500; }
.pc-code .k { color: #7FB8FF; } .pc-code .s { color: #5EE6A6; } .pc-code .f { color: #C8F5DD; }
.ln { display: inline-block; vertical-align: top; overflow: hidden; width: calc(var(--n) * 1ch); border-inline-end: 0.2em solid transparent; }
.pc-status { display: flex; align-items: center; gap: 0.8cqw; padding: 0.8cqw 1.6cqw; border-top: 1px solid rgba(255, 255, 255, 0.07); font-family: var(--font-mono); font-size: 0.8em; color: rgba(200, 240, 220, 0.6); }
.pc-status i { width: 0.9cqw; height: 0.9cqw; border-radius: 50%; background: #3DDC97; animation: blink 1.6s step-end infinite; }
.pc-status b { margin-inline-start: auto; color: #5EE6A6; font-weight: 500; }
@keyframes blink { 50% { opacity: 0.2; } }

/* typing loop, restarted by JS every cycle */
.p-code.is-typing .ln { width: 0; animation: typeLine calc(var(--n) * 45ms + 60ms) steps(var(--n), end) calc(var(--i) * 640ms + 200ms) forwards, caretOn calc(var(--n) * 45ms + 200ms) calc(var(--i) * 640ms + 200ms); }
.p-code.is-typing .ln-last { animation: typeLine 60ms steps(1, end) calc(5 * 640ms + 200ms) forwards, caretBlink 1s step-end calc(5 * 640ms + 200ms) infinite; }
@keyframes typeLine { to { width: calc(var(--n) * 1ch); } }
@keyframes caretOn { from, to { border-inline-end-color: #3DDC97; } }
@keyframes caretBlink { 0%, 49% { border-inline-end-color: #3DDC97; } 50%, 100% { border-inline-end-color: transparent; } }

/* cloud + rack */
.l-cloud { left: 55%; top: 1%; width: 33cqw; height: 29cqw; }
.p-cloud {
    transform: perspective(900px) rotateY(-24deg) rotateX(6deg);
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.72), rgba(236, 244, 241, 0.38));
    box-shadow: inset 0 0 0 0.2cqw rgba(255, 255, 255, 0.95), 0 3cqw 5cqw -2.4cqw rgba(15, 34, 49, 0.35);
    animation-delay: -2.4s;
}
.cloud { position: absolute; left: 50%; top: 4%; width: 17cqw; height: 11cqw; translate: -50% 0; }
.cloud > i { position: absolute; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #FFFFFF 40%, #E3ECEA 100%); box-shadow: 0 1cqw 2cqw -0.6cqw rgba(15, 34, 49, 0.25), inset 0 -0.5cqw 1cqw rgba(15, 34, 49, 0.08); }
.cl-a { width: 7cqw; height: 7cqw; left: 1.5cqw; top: 3.4cqw; }
.cl-b { width: 9.5cqw; height: 9.5cqw; left: 5cqw; top: 0; }
.cl-c { width: 6.5cqw; height: 6.5cqw; right: 0.8cqw; top: 3.6cqw; }
.cl-base { left: 1.5cqw; right: 0.8cqw; bottom: 0.2cqw; height: 4cqw; border-radius: 3cqw !important; }
.cl-arrow { position: absolute; left: 50%; top: 2.6cqw; width: 4.4cqw; height: 4.4cqw; translate: -50% 0; color: var(--emerald); animation: arrowUp 1.8s var(--ease-out) infinite; }
@keyframes arrowUp { 0% { transform: translateY(1.4cqw); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(-1.2cqw); opacity: 0; } }
.rack { position: absolute; left: 12%; right: 12%; bottom: 9%; display: grid; grid-template-columns: 1fr 1fr; gap: 0.9cqw; }
.srv { height: 4.2cqw; border-radius: 0.7cqw; background: linear-gradient(180deg, #25323A, #0E171C); box-shadow: 0 0.8cqw 1.4cqw -0.6cqw rgba(8, 20, 24, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.12); display: flex; align-items: center; gap: 0.5cqw; padding-inline: 1cqw; }
.srv i { width: 0.8cqw; height: 0.8cqw; border-radius: 50%; background: #3DDC97; box-shadow: 0 0 0.8cqw #3DDC97; animation: led 1.3s step-end infinite; will-change: opacity; }
.srv i:nth-child(2) { animation-delay: -0.4s; } .srv i:nth-child(3) { width: 3cqw; border-radius: 0.3cqw; margin-inline-start: auto; opacity: 0.35; animation: none; box-shadow: none; }
.srv:nth-child(2) i { animation-duration: 0.9s; } .srv:nth-child(3) i { animation-duration: 1.7s; } .srv:nth-child(4) i { animation-duration: 1.1s; }
@keyframes led { 50% { opacity: 0.25; } }

/* checklist behind the cloud */
.l-list { left: 86%; top: 10%; width: 13cqw; height: 29cqw; }
.p-list {
    transform: perspective(700px) rotateY(-32deg);
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.25));
    box-shadow: inset 0 0 0 0.2cqw rgba(255, 255, 255, 0.9), 0 2cqw 4cqw -2cqw rgba(15, 34, 49, 0.3);
    padding: 2.4cqw 1.6cqw; animation-delay: -4s;
}
.pl-dot { display: block; width: 1cqw; height: 1cqw; border-radius: 50%; background: rgba(15, 34, 49, 0.25); margin-bottom: 2.2cqw; }
.p-list ul { display: grid; gap: 2.3cqw; }
.p-list li { display: flex; align-items: center; gap: 1cqw; }
.p-list li::before { content: ''; flex-shrink: 0; width: 1.3cqw; height: 1.3cqw; border-radius: 50%; background: rgba(15, 34, 49, 0.14); animation: tick 6s infinite; }
.p-list li::after { content: ''; flex: 1; height: 0.7cqw; border-radius: 1cqw; background: rgba(15, 34, 49, 0.1); }
.p-list li:nth-child(2)::before { animation-delay: 0.6s; } .p-list li:nth-child(3)::before { animation-delay: 1.2s; }
.p-list li:nth-child(4)::before { animation-delay: 1.8s; } .p-list li:nth-child(5)::before { animation-delay: 2.4s; }
@keyframes tick { 0%, 8% { background: rgba(15, 34, 49, 0.14); } 12%, 80% { background: #14A866; } 90%, 100% { background: rgba(15, 34, 49, 0.14); } }

/* e-invoice */
.l-inv { left: 63%; top: 47%; width: 35cqw; height: 40cqw; }
.p-inv {
    transform: perspective(900px) rotateY(-26deg) rotateX(14deg) rotateZ(9deg);
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.97), rgba(246, 250, 248, 0.9));
    box-shadow: 0 0 0 0.3cqw rgba(255, 255, 255, 0.8), 0 0 0 0.9cqw rgba(61, 220, 151, 0.14), 0 0 3cqw rgba(61, 220, 151, 0.25), 0 4cqw 6cqw -3cqw rgba(15, 34, 49, 0.45);
    padding: 3cqw 3cqw 2.6cqw; display: flex; flex-direction: column; gap: 1.4cqw;
    font-size: 1.9cqw; color: var(--ink); animation-delay: -1.2s;
}
.pi-head { display: flex; align-items: center; justify-content: space-between; }
.pi-head strong { font-size: 1.15em; font-weight: 800; letter-spacing: -0.03em; }
.pi-badge { display: inline-flex; align-items: center; gap: 0.6cqw; padding: 0.4cqw 1cqw; border-radius: 1cqw; background: rgba(20, 168, 102, 0.1); color: var(--emerald-2); font-size: 0.72em; }
.pi-badge i { width: 0.9cqw; height: 0.9cqw; border-radius: 50%; background: var(--emerald); }
.pi-badge b { font-weight: 700; }
.pi-title { font-size: 0.98em; font-weight: 600; color: #22323D; margin-top: -0.6cqw; }
.pi-bars { display: grid; gap: 0.8cqw; }
.pi-bars i { height: 0.7cqw; border-radius: 1cqw; background: #E3EBE8; width: 72%; }
.pi-bars i + i { width: 50%; }
.pi-body { display: grid; grid-template-columns: 11cqw 1fr; gap: 2.2cqw; align-items: center; }
.pi-qr svg { width: 100%; height: auto; }
.pi-qr rect { fill: #0B1620; }
.pi-lines { display: grid; gap: 1.1cqw; }
.pi-lines i { height: 0.6cqw; border-radius: 1cqw; background: #E3EBE8; }
.pi-lines i:nth-child(3) { width: 80%; } .pi-lines i:nth-child(4) { width: 60%; }
.pi-progress { position: relative; overflow: hidden; background: rgba(20, 168, 102, 0.15) !important; }
.pi-progress::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, var(--emerald), var(--glow)); transform-origin: left; animation: fill 5.2s var(--ease-out) infinite; }
@keyframes fill { 0% { transform: scaleX(0); } 55%, 100% { transform: scaleX(1); } }
.pi-foot { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 1cqw; }
.pi-sign { width: 12cqw; height: 4cqw; overflow: visible; }
.pi-sign path { fill: none; stroke: #0B1620; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.p-inv.is-signing .pi-sign path { animation: signDraw 1.2s var(--ease) both; }
@keyframes signDraw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.pi-amount { font-size: 1.25em; font-weight: 800; letter-spacing: -0.03em; white-space: nowrap; direction: ltr; font-variant-numeric: tabular-nums; }
.p-inv.is-switching .pi-qr, .p-inv.is-switching .pi-amount, .p-inv.is-switching .pi-format { opacity: 0; transition: opacity 0.2s; }
.pi-qr, .pi-amount, .pi-format { transition: opacity 0.35s; }

/* invoice ⇄ TunTrust certificate: the card turns edge-on, swaps face, turns back */
.pi-flip { width: 100%; height: 100%; transform: perspective(1000px) rotateY(var(--turn, 0deg)); }
html #hero.is-playing .l-inv > .pi-flip {
    transition: opacity 0.9s var(--ease-out) 0.8s, scale 1.2s var(--ease-out) 0.8s, transform 0.5s var(--ease-out) 0s;
}
html #hero.is-playing .l-inv > .pi-flip.is-turning {
    --turn: 90deg;
    transition: opacity 0.9s var(--ease-out) 0.8s, scale 1.2s var(--ease-out) 0.8s, transform 0.36s cubic-bezier(0.55, 0, 1, 0.45) 0s;
}
.pi-cert {
    position: absolute; inset: 0; z-index: 2; overflow: hidden; border-radius: inherit;
    background: #fff; opacity: 0; visibility: hidden;
}
.p-inv.is-cert { cursor: zoom-in; }
.p-inv.is-cert .pi-cert { opacity: 1; visibility: visible; }
.pi-cert-doc { width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; }
.pi-cert::after { /* soft fade so the tag stays readable */
    content: ''; position: absolute; inset: auto 0 0; height: 38%;
    background: linear-gradient(to top, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0));
}
.pi-cert-scan { /* verification sweep */
    position: absolute; left: 0; right: 0; top: 0; height: 18%; z-index: 1; opacity: 0; pointer-events: none;
    background: linear-gradient(to bottom, rgba(61, 220, 151, 0), rgba(61, 220, 151, 0.28) 85%, #3DDC97 100%);
    box-shadow: 0 1px 0 #3DDC97, 0 0 2cqw rgba(61, 220, 151, 0.7);
}
.p-inv.is-verifying .pi-cert-scan { animation: certScan 1.5s cubic-bezier(0.45, 0, 0.3, 1) 0.15s both; }
@keyframes certScan { 0% { opacity: 1; translate: 0 -100%; } 85% { opacity: 1; } 100% { opacity: 0; translate: 0 470%; } }
.pi-cert-seal {
    position: absolute; z-index: 3; top: 30%; right: 9%; width: 9cqw; height: 9cqw; border-radius: 50%;
    display: grid; place-items: center; color: #fff;
    background: radial-gradient(circle at 35% 30%, #3DDC97, #0B7F4B);
    box-shadow: 0 0 0 0.6cqw rgba(255, 255, 255, 0.9), 0 0 0 1cqw rgba(20, 168, 102, 0.35), 0 1.4cqw 3cqw -0.6cqw rgba(11, 127, 75, 0.7);
    opacity: 0;
}
.pi-cert-seal svg { width: 55%; height: 55%; }
.p-inv.is-verifying .pi-cert-seal { animation: ciStamp 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) 1.55s both; }
.pi-cert-tag {
    position: absolute; z-index: 3; left: 6%; right: 6%; bottom: 5%;
    display: flex; align-items: center; gap: 1.2cqw; padding: 1.1cqw 1.6cqw; border-radius: 1.2cqw;
    background: #0B1620; color: #fff; font-size: 0.78em; line-height: 1.25;
    box-shadow: 0 1.4cqw 3cqw -1.4cqw rgba(11, 22, 32, 0.6);
}
.pi-cert-tag b { font-weight: 800; letter-spacing: -0.01em; color: #5EE6A6; }
.pi-cert-tag > span { opacity: 0.9; }
.p-inv.is-verifying .pi-cert-tag { animation: tagIn 0.6s var(--ease-out) 1.2s both; }
@keyframes tagIn { from { opacity: 0; translate: 0 1.5cqw; } to { opacity: 1; translate: 0 0; } }

/* E-Fatourti card: TunTrust certification badge (opens the certificate viewer), one line */
.app-cert {
    display: flex; align-items: center; gap: 9px; width: 100%; margin-top: 10px;
    padding: 5px 8px 5px 5px; border-radius: 9px; text-align: start;
    background: #F1FAF5; box-shadow: inset 0 0 0 1px rgba(20, 168, 102, 0.25);
    transition: background-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
body.lang-ar .app-cert { padding: 5px 5px 5px 8px; }
.app-cert:hover { background: #E6F6EE; box-shadow: inset 0 0 0 1px rgba(20, 168, 102, 0.6); }
.app-cert-icon { flex-shrink: 0; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 7px; color: #fff; background: linear-gradient(150deg, #2FD08A, #0B7F4B); }
.app-cert-icon svg { width: 15px; height: 15px; }
.app-cert-text { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; line-height: 1.3; }
.app-cert-text strong { font-size: 0.82rem; font-weight: 700; color: #0B1620; }
.app-cert-text small { font-size: 0.74rem; font-weight: 600; color: #0B7F4B; direction: ltr; unicode-bidi: isolate; }
.app-cert-go { flex-shrink: 0; width: 16px; height: 16px; color: #0B7F4B; transition: transform 0.25s var(--ease-out); }
.app-cert:hover .app-cert-go { transform: translateX(3px); }
body.lang-ar .app-cert-go { transform: scaleX(-1); }
body.lang-ar .app-cert:hover .app-cert-go { transform: scaleX(-1) translateX(3px); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* certificate viewer */
.cert-dialog {
    width: min(620px, calc(100vw - 32px)); max-height: calc(100svh - 32px); margin: auto; padding: 0;
    border: 0; border-radius: 16px; background: #fff; color: var(--text);
    box-shadow: 0 40px 100px -30px rgba(11, 22, 32, 0.6);
    overflow: hidden; flex-direction: column;
}
.cert-dialog[open] { display: flex; animation: certIn 0.4s var(--ease-out); }
.cert-dialog::backdrop { background: rgba(11, 22, 32, 0.6); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
@keyframes certIn { from { opacity: 0; translate: 0 24px; scale: 0.97; } }
.cert-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 14px 12px 22px; border-bottom: 1px solid var(--line); }
body.lang-ar .cert-dialog-head { padding: 14px 22px 12px 14px; }
.cert-dialog-head h2 { font-size: 1.05rem; font-weight: 750; letter-spacing: -0.01em; }
.cert-close { width: 44px; height: 44px; flex-shrink: 0; display: grid; place-items: center; border-radius: 10px; color: var(--ink); }
.cert-close:hover { background: var(--paper); }
.cert-close svg { width: 20px; height: 20px; }
.cert-dialog-body { overflow-y: auto; padding: 18px 22px 22px; }
.cert-dialog-body img { width: 100%; height: auto; border-radius: 6px; box-shadow: 0 0 0 1px var(--line); }
.cert-dialog-body p { margin-top: 14px; font-size: 0.9rem; line-height: 1.6; color: var(--text-body); }

/* ---------- Feature strip ---------- */
.hero-features {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: clamp(10px, 2.2vh, 36px); padding-top: clamp(12px, 2.4vh, 28px);
    border-top: 1px solid rgba(15, 34, 49, 0.1);
}
.hero-features li + li { border-inline-start: 1px solid rgba(15, 34, 49, 0.1); }
.hf { display: flex; align-items: flex-start; gap: 14px; padding: 6px clamp(12px, 2vw, 26px); height: 100%; border-radius: 12px; transition: background-color 0.3s var(--ease); }
.hero-features li:first-child .hf { padding-inline-start: 0; }
.hf-icon { flex-shrink: 0; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; color: #1C2B35; background: rgba(255, 255, 255, 0.8); box-shadow: 0 0 0 1px rgba(15, 34, 49, 0.06), 0 6px 14px -8px rgba(15, 34, 49, 0.3); transition: background-color 0.3s var(--ease), color 0.3s var(--ease), transform 0.4s var(--ease-out), box-shadow 0.3s; }
.hf-icon svg { width: 22px; height: 22px; }
.hf-text { display: grid; gap: 3px; padding-top: 3px; }
.hf-text strong { font-size: 1rem; font-weight: 700; color: #0B1620; letter-spacing: -0.01em; line-height: 1.25; }
.hf-text small { font-size: 0.86rem; line-height: 1.45; color: var(--text-muted); }
.hf:hover .hf-icon { background: var(--emerald); color: var(--white); transform: translateY(-3px) rotate(-6deg); box-shadow: 0 10px 22px -10px rgba(20, 168, 102, 0.9); }

/* ---------- Entrance (only with JS; .is-playing is added once the intro opens) ---------- */
html.js #hero .hero-slogan,
html.js #hero .hero-sub,
html.js #hero .hero-ctas,
html.js #hero .hero-features li { opacity: 0; translate: 0 18px; }
html.js #hero .hero-headline .w > span { translate: 0 105%; rotate: 4deg; }
html.js #hero .sc-layer > *, html.js #hero .sc-floor { opacity: 0; scale: 0.86; }
html.js #hero .wire { stroke-dashoffset: 1; }
html.js #hero .flow, html.js #hero .packets, html.js #hero .nodes { opacity: 0; }

html #hero.is-playing .hero-slogan, html #hero.is-playing .hero-sub, html #hero.is-playing .hero-ctas, html #hero.is-playing .hero-features li {
    opacity: 1; translate: 0 0; transition: opacity 0.8s var(--ease-out), translate 0.9s var(--ease-out);
}
html #hero.is-playing .hero-sub { transition-delay: 0.45s; }
html #hero.is-playing .hero-ctas { transition-delay: 0.6s; }
html #hero.is-playing .hero-features li { transition-delay: calc(0.9s + var(--i, 0) * 0.1s); }
html #hero.is-playing .hero-headline .w > span { translate: 0 0; rotate: 0deg; transition: translate 1s var(--ease-out), rotate 1s var(--ease-out); transition-delay: calc(0.08s + var(--i) * 0.055s); }
html #hero.is-playing .sc-layer > *, html #hero.is-playing .sc-floor { opacity: 1; scale: 1; transition: opacity 0.9s var(--ease-out), scale 1.2s var(--ease-out); }
html #hero.is-playing .sc-floor { transition-delay: 0.1s; }
html #hero.is-playing .l-cube > * { transition-delay: 0.2s; }
html #hero.is-playing .l-code > * { transition-delay: 0.45s; }
html #hero.is-playing .l-cloud > * { transition-delay: 0.6s; }
html #hero.is-playing .l-list > * { transition-delay: 0.7s; }
html #hero.is-playing .l-inv > * { transition-delay: 0.8s; }
html #hero.is-playing .wire { stroke-dashoffset: 0; transition: stroke-dashoffset 1.4s var(--ease-out) 1s; }
html #hero.is-playing .flow, html #hero.is-playing .packets, html #hero.is-playing .nodes { opacity: 1; transition: opacity 0.6s 1.8s; }
html #hero.is-playing .nodes { transition-delay: 1.2s; }

/* offscreen: stop everything */
#hero.is-paused *, #hero.is-paused *::before, #hero.is-paused *::after { animation-play-state: paused !important; }

/* ============================================================
   6b. Opening sequence: invoice signed → software deployed → site opens
   ============================================================ */
@property --iris { syntax: '<length>'; inherits: false; initial-value: 0px; }

.ce-intro { display: none; }
html.intro-on { overflow: hidden; }
html.intro-on .ce-intro {
    position: fixed; inset: 0; z-index: 3000;
    display: grid; place-items: center;
    background: linear-gradient(180deg, #F6F8F8, #ECF1EF);
    color: var(--ink);
}
.ci-bg { position: absolute; inset: 0; pointer-events: none;
    background-image: linear-gradient(rgba(15, 34, 49, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(15, 34, 49, 0.05) 1px, transparent 1px);
    background-size: 56px 56px;
    -webkit-mask-image: radial-gradient(ellipse 60% 55% at 50% 46%, #000, transparent 80%);
            mask-image: radial-gradient(ellipse 60% 55% at 50% 46%, #000, transparent 80%);
}
.ci-bg::after { content: ''; position: absolute; left: 50%; top: 46%; width: 70vmin; height: 70vmin; translate: -50% -50%; border-radius: 50%;
    background: radial-gradient(closest-side, rgba(61, 220, 151, 0.18), transparent); transition: opacity 0.6s; opacity: 0; }
.ce-intro.is-deploying .ci-bg::after { opacity: 1; }

.ci-stage { position: relative; display: grid; justify-items: center; gap: clamp(20px, 3vh, 34px); perspective: 1600px; padding-inline: 16px; }
.ci-card {
    --tx: 0deg; --ty: 0deg;
    position: relative; display: grid; width: min(400px, 88vw);
    transform-style: preserve-3d;
    transform: translateY(70px) rotateX(32deg) scale(0.9);
    opacity: 0;
    transition: transform 1s var(--ease-out), opacity 0.6s var(--ease-out);
    font-size: clamp(13px, 3.4vw, 15px);
}
.ci-card.is-in { transform: rotateX(var(--ty)) rotateY(var(--tx)); opacity: 1; }
.ci-card.is-flipped { transform: rotateX(var(--ty)) rotateY(calc(180deg + var(--tx))); transition: transform 1.05s cubic-bezier(0.7, 0, 0.2, 1); }
.ci-card.is-launch { transform: rotateY(180deg) scale(0.08); opacity: 0; transition: transform 0.7s cubic-bezier(0.7, 0, 0.84, 0), opacity 0.3s 0.45s; }
.ci-card.is-shake { animation: ciShake 0.35s linear; }
/* faces swap at the flip's midpoint (backface-visibility alone is unreliable under masks/filters) */
.ci-back { visibility: hidden; }
.ci-card.is-flipped .ci-front { visibility: hidden; transition: visibility 0s linear 0.5s; }
.ci-card.is-flipped .ci-back { visibility: visible; transition: visibility 0s linear 0.5s; }
@keyframes ciShake { 20% { translate: -3px 1px; } 40% { translate: 3px -1px; } 60% { translate: -2px 0; } 80% { translate: 1px 1px; } }
.ci-face {
    grid-area: 1 / 1; border-radius: 16px; backface-visibility: hidden; -webkit-backface-visibility: hidden;
    box-shadow: 0 0 0 1px rgba(15, 34, 49, 0.06), 0 40px 80px -30px rgba(15, 34, 49, 0.45), 0 0 0 7px rgba(255, 255, 255, 0.55);
}
.ci-front { position: relative; background: var(--white); padding: 1.7em 1.7em 1.4em; display: flex; flex-direction: column; gap: 1.05em; overflow: hidden; }
.ci-back { transform: rotateY(180deg); background: linear-gradient(165deg, #0E1C22, #08130F); color: #CFEFDD; display: flex; flex-direction: column; overflow: hidden;
    box-shadow: 0 0 0 1px rgba(61, 220, 151, 0.25), 0 40px 80px -30px rgba(8, 20, 16, 0.7), 0 0 60px -10px rgba(61, 220, 151, 0.35); }

.ci-head { display: flex; justify-content: space-between; align-items: center; }
.ci-brand { font-weight: 800; letter-spacing: -0.045em; font-size: 1.3em; color: #0B1620; }
.ci-status { position: relative; display: inline-grid; font-size: 0.78em; font-weight: 700; }
.ci-status > span { grid-area: 1 / 1; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 20px; transition: opacity 0.3s, scale 0.4s var(--ease-out); }
.ci-status > span::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.ci-status-draft { background: #F1F4F3; color: #6B7C85; }
.ci-status-signed { background: rgba(20, 168, 102, 0.12); color: #0B7F4B; opacity: 0; scale: 0.6; }
.ci-card.is-signed .ci-status-draft { opacity: 0; }
.ci-card.is-signed .ci-status-signed { opacity: 1; scale: 1; }
.ci-title { display: flex; justify-content: space-between; gap: 1em; font-size: 0.88em; color: var(--text-muted); margin-top: -0.4em; }
.ci-title b { color: #0B1620; font-weight: 700; direction: ltr; unicode-bidi: isolate; }
.ci-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 1em; padding: 0.9em 1em; border-radius: 10px; background: #F4F7F6; }
.ci-parties small { display: block; font-size: 0.74em; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.ci-parties strong { font-size: 0.9em; color: #0B1620; font-weight: 700; }
.ci-lines { display: grid; gap: 0.2em; }
.ci-lines li { display: flex; justify-content: space-between; gap: 1em; padding: 0.55em 0; border-bottom: 1px dashed #DCE5E2; font-size: 0.93em; color: #22323D;
    opacity: 0; translate: -12px 0; transition: opacity 0.5s var(--ease-out), translate 0.6s var(--ease-out); }
body.lang-ar .ci-lines li { translate: 12px 0; }
.ci-lines li.is-on { opacity: 1; translate: 0 0; }
.ci-lines b { font-weight: 650; font-variant-numeric: tabular-nums; direction: ltr; }
.ci-total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 0.2em; }
.ci-total > span { font-weight: 700; color: #22323D; }
.ci-total strong { font-size: 1.55em; font-weight: 800; letter-spacing: -0.03em; color: #0B1620; direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; }
.ci-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 1em; padding-top: 0.6em; border-top: 2px solid #0B1620; }
.ci-sign { position: relative; flex: 1; min-width: 0; max-width: 240px; direction: ltr; }
.ci-sign svg { width: 100%; height: auto; overflow: visible; }
.ci-sign small { display: block; font-size: 0.72em; color: var(--text-muted); border-top: 1px solid #DCE5E2; padding-top: 3px; width: 70%; }
.ci-sign path { fill: none; stroke: #0B1620; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.ci-card.is-signing .ci-sign-main { animation: signDraw 1.15s cubic-bezier(0.45, 0.05, 0.4, 1) forwards; }
.ci-card.is-signing .ci-sign-under { animation: signDraw 0.35s var(--ease-out) 1.15s forwards; }
.ci-nib { fill: #3DDC97; filter: drop-shadow(0 0 4px #3DDC97) drop-shadow(0 0 8px rgba(61, 220, 151, 0.8)); opacity: 0; }
.ci-card.is-signing .ci-nib { animation: nibFade 1.3s linear forwards; }
@keyframes nibFade { 0%, 85% { opacity: 1; } 100% { opacity: 0; } }
.ci-qr { width: 72px; flex-shrink: 0; padding: 5px; border-radius: 8px; box-shadow: 0 0 0 1px #E3EBE8; }
.ci-qr svg { width: 100%; height: auto; }
.ci-qr rect { fill: #0B1620; }
.ci-stamp {
    position: absolute; inset-inline-start: 24%; bottom: 13%; pointer-events: none;
    padding: 0.55em 0.9em; border-radius: 8px; rotate: -14deg;
    border: 3px solid #14A866; box-shadow: inset 0 0 0 2px #fff, inset 0 0 0 4px rgba(20, 168, 102, 0.5);
    color: #0B7F4B; font-weight: 800; font-size: 0.86em; letter-spacing: 0.08em; white-space: nowrap;
    background: rgba(236, 250, 243, 0.75);
    opacity: 0; scale: 2.3;
}
.ci-card.is-signed .ci-stamp { animation: ciStamp 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) forwards; }
@keyframes ciStamp { 0% { opacity: 0; scale: 2.3; } 55% { opacity: 1; scale: 0.92; } 100% { opacity: 1; scale: 1; } }

/* terminal */
.ci-term-bar { display: flex; align-items: center; gap: 7px; padding: 14px 16px 10px; border-bottom: 1px solid rgba(207, 239, 221, 0.08); }
.ci-term-bar i { width: 10px; height: 10px; border-radius: 50%; background: #3DDC97; box-shadow: 0 0 8px rgba(61, 220, 151, 0.8); }
.ci-term-bar i:nth-child(2) { opacity: 0.6; } .ci-term-bar i:nth-child(3) { opacity: 0.3; }
.ci-term-bar span { margin-inline-start: auto; font-family: var(--font-mono); font-size: 0.75em; color: rgba(207, 239, 221, 0.45); }
.ci-term { flex: 1; padding: 14px 16px; font-family: var(--font-mono); font-size: 0.8em; line-height: 1.75; direction: ltr; text-align: left; white-space: pre; overflow: hidden; }
.ci-term div { opacity: 0; translate: 0 6px; animation: termIn 0.3s var(--ease-out) forwards; }
@keyframes termIn { to { opacity: 1; translate: 0 0; } }
.ci-term .p { color: #5EE6A6; } .ci-term .m { color: rgba(207, 239, 221, 0.45); } .ci-term .ok { color: #3DDC97; font-weight: 600; }
.ci-term .live { margin-top: 6px; color: #fff; font-weight: 600; }
.ci-term .live::before { content: '●'; color: #3DDC97; margin-inline-end: 8px; text-shadow: 0 0 10px #3DDC97; animation: blink 1s step-end infinite; }
.ci-progress { display: flex; align-items: center; gap: 12px; padding: 12px 16px 16px; font-family: var(--font-mono); font-size: 0.75em; color: #3DDC97; direction: ltr; }
.ci-progress i { position: relative; flex: 1; height: 5px; border-radius: 5px; background: rgba(61, 220, 151, 0.14); overflow: hidden; }
.ci-progress i::after { content: ''; position: absolute; inset: 0; transform-origin: left; transform: scaleX(var(--p, 0)); background: linear-gradient(90deg, #14A866, #9DFFD0); box-shadow: 0 0 12px #3DDC97; transition: transform 0.3s var(--ease-out); }
.ci-progress span { min-width: 4ch; text-align: right; }

/* steps under the card */
.ci-steps { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; font-size: 0.86rem; font-weight: 600; color: #8796A0; opacity: 0; transition: opacity 0.6s 0.4s; counter-reset: s; }
.ce-intro.is-started .ci-steps { opacity: 1; }
.ci-steps li { display: inline-flex; align-items: center; gap: 9px; transition: color 0.3s; }
.ci-steps i { position: relative; width: 20px; height: 20px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px #C5D1CD; transition: background-color 0.3s, box-shadow 0.3s; }
.ci-steps i::after { content: ''; position: absolute; left: 7px; top: 4px; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; rotate: 45deg; scale: 0; transition: scale 0.3s var(--ease-out); }
.ci-steps li.is-active { color: #0B1620; }
.ci-steps li.is-active i { box-shadow: inset 0 0 0 1.5px #14A866, 0 0 0 4px rgba(20, 168, 102, 0.14); animation: halo2 1.2s ease-in-out infinite; }
.ci-steps li.is-done { color: #0B7F4B; }
.ci-steps li.is-done i { background: #14A866; box-shadow: none; animation: none; }
.ci-steps li.is-done i::after { scale: 1; }
@keyframes halo2 { 50% { box-shadow: inset 0 0 0 1.5px #14A866, 0 0 0 7px rgba(20, 168, 102, 0.08); } }

.ci-skip {
    position: absolute; bottom: calc(22px + env(safe-area-inset-bottom)); inset-inline-end: 24px;
    display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 10px;
    font-size: 0.88rem; font-weight: 650; color: #3F505B; background: rgba(255, 255, 255, 0.7);
    box-shadow: inset 0 0 0 1px rgba(15, 34, 49, 0.12); transition: background-color 0.2s, color 0.2s;
}
.ci-skip:hover { background: #fff; color: var(--ink); }
.ci-skip svg { width: 16px; height: 16px; }
body.lang-ar .ci-skip svg { transform: scaleX(-1); }
.ci-timeline { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(15, 34, 49, 0.06); }
.ci-timeline i { position: absolute; inset: 0; transform-origin: left; transform: scaleX(0); background: linear-gradient(90deg, #14A866, #3DDC97); }
body.lang-ar .ci-timeline i { transform-origin: right; }
.ce-intro.is-started .ci-timeline i { animation: timeline var(--intro-ms, 6400ms) linear forwards; }
@keyframes timeline { to { transform: scaleX(1); } }

/* exit: iris opens from the centre with a green ring riding its edge */
.ce-intro::after { content: ''; position: absolute; left: 50%; top: 46%; width: 2px; height: 2px; border-radius: 50%; translate: -50% -50%; pointer-events: none; opacity: 0; }
.ce-intro.is-out {
    -webkit-mask-image: radial-gradient(circle at 50% 46%, transparent var(--iris), #000 calc(var(--iris) + 1px));
            mask-image: radial-gradient(circle at 50% 46%, transparent var(--iris), #000 calc(var(--iris) + 1px));
    animation: ciIris 1.1s cubic-bezier(0.65, 0, 0.2, 1) forwards; pointer-events: none;
}
.ce-intro.is-out::after { animation: ciRing 1.1s cubic-bezier(0.65, 0, 0.2, 1) forwards; }
.ce-intro.is-out .ci-skip, .ce-intro.is-out .ci-steps, .ce-intro.is-out .ci-timeline { opacity: 0; transition: opacity 0.2s; }
@keyframes ciIris { 0% { --iris: 0px; opacity: 1; } 75% { opacity: 1; } 100% { --iris: 150vmax; opacity: 0; } }
@keyframes ciRing { 0% { width: 0; height: 0; opacity: 1; box-shadow: 0 0 0 3px #3DDC97, 0 0 40px 8px rgba(61, 220, 151, 0.6); }
                    100% { width: 300vmax; height: 300vmax; opacity: 0; box-shadow: 0 0 0 3px #3DDC97, 0 0 40px 8px rgba(61, 220, 151, 0.6); } }
.ce-intro.is-skip { opacity: 0; transition: opacity 0.45s var(--ease); pointer-events: none; }

/* ============================================================
   7. Services (dark)
   ============================================================ */
#services { background: var(--ink); color: var(--on-dark); }
.services-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line-dark); border: 1px solid var(--line-dark); border-radius: var(--r-lg); overflow: hidden; }
.service-card { background: var(--ink); padding: clamp(28px, 4vw, 44px); transition: background-color 0.3s var(--ease); }
.service-card:hover { background: var(--ink-2); }
.service-icon { width: 44px; height: 44px; display: grid; place-items: center; color: var(--teal); margin-bottom: 22px; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line-dark); }
.service-icon svg { width: 22px; height: 22px; }
.service-card h3 { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.02em; color: var(--white); margin-bottom: 10px; }
.service-card p { font-size: 0.97rem; line-height: 1.65; color: var(--on-dark-muted); max-width: 46ch; }
.service-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 22px; }
.service-tag { font-size: 0.76rem; font-weight: 600; color: var(--on-dark); padding: 4px 10px; border-radius: 6px; background: rgba(232, 240, 238, 0.07); }

/* ============================================================
   8. Process
   ============================================================ */
#process { background: var(--white); }
.process-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(32px, 6vw, 80px); align-items: start; }
.process-steps { display: grid; border-top: 1px solid var(--line); }
.process-step {
    width: 100%; display: flex; gap: 20px; align-items: flex-start; text-align: start;
    padding: 18px 4px; border-bottom: 1px solid var(--line);
    transition: background-color 0.2s var(--ease);
}
.process-step:hover { background: var(--paper); }
.step-indicator {
    flex-shrink: 0; width: 40px; height: 40px; display: grid; place-items: center;
    border-radius: 50%; font-size: 0.85rem; font-weight: 700; color: var(--text-muted);
    box-shadow: inset 0 0 0 1.5px var(--line); font-variant-numeric: tabular-nums;
    transition: background-color 0.25s var(--ease), color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.step-text { display: grid; gap: 3px; min-width: 0; }
.step-name { font-size: 1.05rem; font-weight: 650; color: var(--text); transition: color 0.2s var(--ease); }
.step-summary { font-size: 0.92rem; color: var(--text-muted); line-height: 1.5; }
.step-duration { justify-self: start; margin-top: 6px; font-size: 0.76rem; font-weight: 600; color: var(--blue-ink); padding: 2px 8px; border-radius: 6px; background: #E6F0F7; }
.process-step.is-active .step-indicator { background: var(--ink); color: var(--white); box-shadow: none; }
.process-step.is-active .step-name { color: var(--blue-ink); }

.process-detail-card {
    position: sticky; top: calc(var(--header-h) + 24px);
    background: var(--paper); border-radius: var(--r-lg); padding: clamp(26px, 4vw, 40px);
    transform-origin: 50% 50%;
}
.pd-panel h3 { font-size: 1.45rem; font-weight: 750; letter-spacing: -0.02em; margin-bottom: 12px; }
.pd-panel p { font-size: 1rem; line-height: 1.7; color: var(--text-body); margin-bottom: 22px; }
.process-deliverables { display: grid; gap: 10px; }
.deliverable { display: flex; align-items: center; gap: 12px; font-size: 0.94rem; color: var(--text); padding: 12px 14px; background: var(--white); border-radius: 10px; }
.deliverable-check { width: 22px; height: 22px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; background: var(--green); color: var(--white); }
.deliverable-check svg { width: 12px; height: 12px; }

/* ============================================================
   9. Stats
   ============================================================ */
#stats { background: var(--ink); padding-block: clamp(48px, 7vw, 80px); }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stats-item { padding: 8px clamp(12px, 3vw, 32px); border-inline-start: 1px solid var(--line-dark); }
.stats-item:first-child { border-inline-start: 0; padding-inline-start: 0; }
.stats-num { font-size: clamp(2.4rem, 5vw, 3.6rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1; color: var(--white); font-variant-numeric: tabular-nums; margin-bottom: 10px; }
.stats-label { font-size: 0.92rem; color: var(--on-dark-muted); line-height: 1.4; }

/* ============================================================
   10. About
   ============================================================ */
#about { background: var(--white); }
.about-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(36px, 6vw, 80px); align-items: center; }
.about-visual { position: relative; }
.about-img-wrap { border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 4 / 3; background: var(--paper-2); }
.about-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.about-badge { position: absolute; bottom: -18px; inset-inline-end: 24px; background: var(--ink); color: var(--white); border-radius: var(--r-md); padding: 14px 20px; text-align: center; }
.about-badge strong { display: block; font-size: 1.6rem; font-weight: 800; line-height: 1; letter-spacing: -0.03em; }
.about-badge span { font-size: 0.8rem; color: var(--on-dark-muted); }
.about-content .section-title { margin-bottom: 18px; }
.about-content .section-sub { max-width: 52ch; }
.about-features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 32px; }
.about-feature { display: flex; gap: 12px; align-items: flex-start; padding: 16px; background: var(--paper); border-radius: var(--r-md); }
.about-feature-icon { width: 34px; height: 34px; flex-shrink: 0; display: grid; place-items: center; border-radius: 9px; background: var(--ink); color: var(--white); }
.about-feature-icon svg { width: 16px; height: 16px; }
.about-feature h4 { font-size: 0.95rem; font-weight: 700; margin-bottom: 2px; }
.about-feature p { font-size: 0.86rem; color: var(--text-muted); }

/* ============================================================
   11. Why us (dark)
   ============================================================ */
#why-us { background: var(--ink-2); }
.why-layout { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(36px, 6vw, 80px); align-items: center; }
.why-intro { font-size: 1.05rem; color: var(--on-dark-muted); line-height: 1.7; margin: 18px 0 30px; max-width: 46ch; }
.why-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.why-card { padding: 24px; border-radius: var(--r-md); box-shadow: inset 0 0 0 1px var(--line-dark); transition: background-color 0.3s var(--ease); }
.why-card:hover { background: rgba(232, 240, 238, 0.04); }
.why-card-icon { width: 38px; height: 38px; display: grid; place-items: center; color: var(--teal); margin-bottom: 14px; }
.why-card-icon svg { width: 22px; height: 22px; }
.why-card h4 { font-size: 1.02rem; font-weight: 700; color: var(--white); margin-bottom: 6px; }
.why-card p { font-size: 0.92rem; color: var(--on-dark-muted); line-height: 1.6; }

/* ============================================================
   12. Portfolio: products we built (3D tilt on pointer)
   ============================================================ */
#portfolio { background: var(--paper); }
/* One row, native horizontal scroll with snap: swipe, trackpad, keyboard and RTL come for free */
.portfolio-track {
    --per: 3; --gap: 24px;
    display: grid; grid-auto-flow: column; gap: var(--gap);
    grid-auto-columns: calc((100% - (var(--per) - 1) * var(--gap)) / var(--per));
    overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory; scroll-behavior: smooth;
    padding-block: 16px 30px; margin-block: -16px -30px; /* room for the tilt and its shadow */
    scrollbar-width: none; perspective: 1400px;
}
.portfolio-track::-webkit-scrollbar { display: none; }
.portfolio-track:focus-visible { outline-offset: 6px; border-radius: var(--r-lg); }
.portfolio-track > .app-card { scroll-snap-align: start; }
.portfolio-track .app-visual { aspect-ratio: 16 / 10; }
.slider-controls[hidden] { display: none; }
.portfolio-controls .slider-btn:disabled { opacity: 0.35; cursor: default; box-shadow: inset 0 0 0 1.5px var(--line); }
.app-card {
    --rx: 0deg; --ry: 0deg; --px: 0px; --py: 0px;
    display: flex; flex-direction: column; min-width: 0;
    background: var(--white); border-radius: var(--r-lg); overflow: hidden;
    box-shadow: 0 0 0 1px var(--line);
    transform: rotateX(var(--ry)) rotateY(var(--rx));
    transition: transform 0.5s var(--ease-out), box-shadow 0.3s var(--ease);
}
.app-card.is-tilting { transition: transform 0.12s linear, box-shadow 0.3s var(--ease); box-shadow: 0 0 0 1px var(--line), 0 30px 60px -28px rgba(15, 34, 49, 0.45); }
.app-visual { position: relative; aspect-ratio: 2 / 1; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.app-visual > img, .app-visual > .mt-mark { transform: translate(var(--px), var(--py)); transition: transform 0.5s var(--ease-out); }
.app-card.is-tilting .app-visual > img, .app-card.is-tilting .app-visual > .mt-mark { transition: transform 0.12s linear; }
.app-visual--efatourti { background: linear-gradient(160deg, #FFFFFF 0%, #F7ECEE 100%); }
.app-visual--efatourti img { width: 68%; max-width: 330px; height: auto; }
.app-visual--syndico { background: radial-gradient(circle at 50% 45%, rgba(61, 164, 199, 0.28), transparent 60%), linear-gradient(155deg, var(--ink) 0%, #17405F 100%); }
.app-visual--syndico img { height: 64%; width: auto; filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.35)); }
.app-visual--wassel > img { position: absolute; inset: -12px; width: calc(100% + 24px); height: calc(100% + 24px); max-width: none; object-fit: cover; object-position: 50% 60%; }
.app-visual--wassel::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(15, 34, 49, 0.55), transparent 55%); pointer-events: none; }
.app-wordmark { position: absolute; z-index: 1; bottom: 12px; inset-inline-end: 18px; font-family: var(--font-ar); font-size: 2rem; font-weight: 700; color: var(--white); line-height: 1; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35); }
.app-visual--mothertroc { background: radial-gradient(circle at 25% 20%, rgba(255, 255, 255, 0.75), transparent 45%), linear-gradient(140deg, #F1E6E9 0%, #E7D7DE 100%); }
.mt-mark { display: flex; flex-direction: column; align-items: center; gap: 10px; color: #302A27; }
.mt-mark svg { width: 54px; height: 54px; color: #9C6F80; }
.mt-mark span { font-family: var(--font); font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 700; letter-spacing: -0.05em; line-height: 1; white-space: nowrap; }

.app-status {
    position: absolute; z-index: 2; top: 14px; inset-inline-start: 14px;
    display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 6px;
    font-size: 0.76rem; font-weight: 700; background: rgba(255, 255, 255, 0.94); color: var(--text);
}
.app-status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.app-status--live { color: var(--green-ink); }
.app-status--pilot { color: var(--blue-ink); }
.app-status--beta { color: #9A5F0B; }
.app-status--dev { color: #7E4E60; }

.app-body { display: flex; flex-direction: column; flex: 1; padding: 26px 26px 20px; }
.app-body h3 { font-size: 1.45rem; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 6px; }
.app-tagline { font-size: 1rem; font-weight: 600; color: var(--text); line-height: 1.45; margin-bottom: 10px; }
.app-desc { font-size: 0.93rem; color: var(--text-body); line-height: 1.65; flex: 1; }
.app-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.app-tags li { font-size: 0.76rem; font-weight: 600; color: var(--text-body); background: var(--paper); padding: 3px 9px; border-radius: 6px; }
.app-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); }
.app-market { font-size: 0.85rem; color: var(--text-muted); }
.app-link { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; font-size: 0.92rem; font-weight: 700; color: var(--blue-ink); }
.app-link:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.app-link-icon { width: 15px; height: 15px; }
body.lang-ar .app-link-icon { transform: scaleX(-1); }
.app-soon { display: inline-flex; align-items: center; min-height: 44px; font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }

/* ============================================================
   13. Testimonials
   ============================================================ */
#testimonials { background: var(--white); }
.testimonials-wrap { overflow: hidden; touch-action: pan-y; }
.testimonials-track { display: flex; gap: 20px; transition: transform 0.55s var(--ease-out); }
.testimonial-card {
    flex: 0 0 calc((100% - 40px) / 3); min-width: 0; position: relative;
    background: var(--paper); border-radius: var(--r-lg); padding: 30px;
    display: flex; flex-direction: column;
}
.t-stars { display: flex; gap: 3px; margin-bottom: 16px; }
.t-star { width: 14px; height: 14px; background: var(--green); clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.t-text { font-size: 1rem; line-height: 1.65; color: var(--text); margin-bottom: 22px; flex: 1; }
.t-author { display: flex; align-items: center; gap: 12px; }
.t-avatar { width: 42px; height: 42px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--white); font-weight: 700; font-size: 0.85rem; }
.t-name { font-weight: 700; font-size: 0.95rem; color: var(--text); }
.t-role { font-size: 0.84rem; color: var(--text-muted); }
.slider-controls { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 28px; }
.slider-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); transition: box-shadow 0.2s var(--ease), background-color 0.2s var(--ease); }
.slider-btn:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.slider-btn svg { width: 18px; height: 18px; }
body.lang-ar .slider-btn svg { transform: scaleX(-1); }
.slider-dots { display: flex; gap: 4px; }
.slider-dot { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.slider-dot::before { content: ''; width: 8px; height: 8px; border-radius: 4px; background: var(--line); transition: width 0.3s var(--ease-out), background-color 0.3s; }
.slider-dot.active::before { width: 20px; background: var(--ink); }

/* ============================================================
   15. Compliance
   ============================================================ */
#compliance { background: var(--paper); }
.compliance-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.compliance-card { background: var(--white); border-radius: var(--r-md); padding: 26px; }
.compliance-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; background: var(--ink); color: var(--white); margin-bottom: 16px; }
.compliance-icon svg { width: 20px; height: 20px; }
.compliance-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 6px; }
.compliance-card p { font-size: 0.93rem; color: var(--text-body); line-height: 1.6; }

/* ============================================================
   16. Maintenance
   ============================================================ */
#maintenance { background: var(--ink-2); position: relative; overflow: hidden; }
.maintenance-bg-dots { display: none; }
.maintenance-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(36px, 6vw, 80px); align-items: center; }
.maint-title { font-size: clamp(1.9rem, 3.6vw, 2.75rem); font-weight: 750; letter-spacing: -0.03em; line-height: 1.08; color: var(--white); margin-bottom: 16px; }
.maint-desc { font-size: 1.03rem; color: var(--on-dark-muted); line-height: 1.7; margin-bottom: 26px; max-width: 46ch; }
.maint-features { display: grid; gap: 12px; margin-bottom: 30px; }
.maint-feature { display: flex; align-items: center; gap: 12px; color: var(--on-dark); font-size: 0.97rem; }
.maint-check { width: 22px; height: 22px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; background: rgba(47, 158, 106, 0.2); color: #7FD3A9; }
.maint-check svg { width: 12px; height: 12px; }
.maint-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.maint-card { padding: 22px; border-radius: var(--r-md); box-shadow: inset 0 0 0 1px var(--line-dark); }
.maint-card-icon { width: 40px; height: 40px; display: grid; place-items: center; color: var(--teal); margin-bottom: 12px; }
.maint-card-icon svg { width: 24px; height: 24px; }
.maint-card h4 { font-size: 1rem; font-weight: 700; color: var(--white); margin-bottom: 4px; }
.maint-card p { font-size: 0.88rem; color: var(--on-dark-muted); }

/* ============================================================
   17. CTA banner
   ============================================================ */
#cta-banner { background: var(--white); padding-block: clamp(56px, 8vw, 96px); }
.cta-card { background: var(--ink); border-radius: var(--r-lg); padding: clamp(36px, 6vw, 72px); display: grid; grid-template-columns: minmax(0, 1.2fr) auto; gap: 18px 40px; align-items: center; }
.cta-card h2 { grid-column: 1; font-size: clamp(1.8rem, 3.6vw, 2.6rem); font-weight: 750; letter-spacing: -0.03em; line-height: 1.1; color: var(--white); }
.cta-card > p:not(.cta-email) { grid-column: 1; font-size: 1.03rem; color: var(--on-dark-muted); max-width: 52ch; }
.cta-actions { grid-column: 2; grid-row: 1 / span 2; display: flex; flex-direction: column; gap: 10px; }
.cta-email { grid-column: 1 / -1; font-size: 0.92rem; color: var(--on-dark-muted); }
.cta-email a { color: var(--white); text-decoration: underline; text-underline-offset: 3px; }

/* ============================================================
   18. Contact
   ============================================================ */
#contact { background: var(--paper); }
.contact-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: clamp(16px, 3vw, 32px); align-items: stretch; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.contact-actions .btn { flex: 1 1 200px; }
.btn-whatsapp { background: #128C4A; color: var(--white); }
.btn-whatsapp:hover { background: #0E7A40; }
.contact-info-card { background: var(--white); border-radius: var(--r-lg); padding: 26px; }
.contact-info-card h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 18px; }
.info-row { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 16px; }
.info-row:last-child { margin-bottom: 0; }
.info-icon { width: 36px; height: 36px; flex-shrink: 0; display: grid; place-items: center; border-radius: 9px; background: var(--paper); color: var(--ink); }
.info-icon svg { width: 17px; height: 17px; }
.info-text strong { display: block; font-size: 0.9rem; font-weight: 700; color: var(--text); }
.info-text span { font-size: 0.93rem; color: var(--text-muted); overflow-wrap: anywhere; }
/* email / WhatsApp rows are links: full-row tap target, clear hover */
.contact-info-card .info-link { align-items: center; margin: -8px -10px 8px; padding: 8px 10px; border-radius: 12px; color: inherit; text-decoration: none; transition: background-color 0.2s var(--ease); }
.info-link:hover, .info-link:focus-visible { background: var(--paper); }
.info-link:hover .info-text > span, .info-link:focus-visible .info-text > span { color: var(--blue-ink); text-decoration: underline; text-underline-offset: 3px; }
.info-link:hover .info-icon { background: var(--white); }
.info-icon-wa { color: #128C4A; }
body.lang-ar .info-text [dir="ltr"] { display: inline-block; }
.svc-list { display: grid; gap: 9px; }
.svc-list-item { display: flex; align-items: center; gap: 10px; font-size: 0.93rem; color: var(--text-body); }
.svc-list-item::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--green); flex-shrink: 0; }

/* ============================================================
   19. Footer
   ============================================================ */
#site-footer { background: var(--ink); color: var(--on-dark-muted); padding: clamp(48px, 7vw, 72px) 0 28px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 40px; border-bottom: 1px solid var(--line-dark); }
.footer-brand .site-logo { color: var(--white); display: inline-block; margin-bottom: 8px; }
.footer-slogan { font-size: 0.97rem; font-weight: 650; color: var(--white); margin-bottom: 12px; }
.footer-brand .site-logo em { color: var(--teal); }
.footer-brand p { font-size: 0.93rem; line-height: 1.65; max-width: 36ch; margin-bottom: 20px; }
.footer-social { display: flex; gap: 8px; }
.social-link { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line-dark); font-size: 0.8rem; font-weight: 700; color: var(--on-dark); transition: background-color 0.2s var(--ease); }
.social-link:hover { background: rgba(232, 240, 238, 0.08); }
.footer-col h4 { font-size: 0.95rem; font-weight: 700; color: var(--white); margin-bottom: 14px; }
.footer-links { display: grid; gap: 4px; }
.footer-links a, .footer-links li > span { display: inline-flex; align-items: center; min-height: 32px; font-size: 0.93rem; color: var(--on-dark-muted); transition: color 0.2s var(--ease); overflow-wrap: anywhere; }
.footer-links a:hover { color: var(--white); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 24px; font-size: 0.86rem; }
.footer-bottom-links { display: flex; flex-wrap: wrap; gap: 20px; }
.footer-bottom-links a:hover, .footer-cookie-btn:hover { color: var(--white); }

/* Cookie consent (GDPR): non-blocking card, bottom corner on desktop, full width on phones.
   Accept and refuse carry the same weight, as the CNIL requires. */
.cookie-consent {
    position: fixed; z-index: 2000; inset-inline-start: 24px; bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    width: min(440px, calc(100% - 48px)); padding: 22px 22px 20px;
    background: var(--ink); color: var(--on-dark-muted); border-radius: var(--r-lg);
    box-shadow: 0 18px 50px rgba(15, 34, 49, 0.35), 0 0 0 1px var(--line-dark);
    opacity: 0; transform: translateY(16px);
    transition: opacity 0.3s var(--ease), transform 0.35s var(--ease-out);
}
.cookie-consent.is-in { opacity: 1; transform: none; }
.cc-title { font-size: 1.05rem; font-weight: 700; color: var(--white); margin-bottom: 8px; }
.cc-text { font-size: 0.9rem; line-height: 1.55; }
.cc-text a { color: var(--white); text-decoration: underline; text-underline-offset: 3px; }
.cc-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.cc-btn { min-height: 46px; padding: 0 16px; }
.cc-accept { background: var(--white); color: var(--ink); }
.cc-accept:hover { background: var(--paper-2); }
.cc-refuse { color: var(--white); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.4); }
.cc-refuse:hover { box-shadow: inset 0 0 0 1.5px var(--white); background: rgba(255, 255, 255, 0.06); }
.cookie-consent .btn:focus-visible { outline: 2px solid var(--glow); outline-offset: 2px; }
body.lang-ar .cc-title { letter-spacing: 0; }
@media (max-width: 480px) {
    .cookie-consent { inset-inline: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); width: auto; padding: 18px 16px 16px; }
}

/* index.php fallback */
main.container { padding-block: calc(var(--header-h) + 48px) 80px !important; }

/* ============================================================
   19b. Desktop: every section fits one screen (no scrolling inside a part)
   Budget = viewport height minus the fixed header; spacing scales with vh.
   ============================================================ */
@media (min-width: 901px) {
    :root { --section-y: clamp(26px, 5vh, 96px); }
    .section-head { margin-bottom: clamp(18px, 3.6vh, 56px); }
    .section-title { font-size: clamp(1.85rem, min(4.2vw, 6.2vh), 3.25rem); }
    .section-sub { font-size: clamp(0.95rem, 2.1vh, 1.05rem); }

    /* services: one row of four */
    .service-card { padding: clamp(20px, 3.6vh, 40px) clamp(20px, 2vw, 32px); }
    .service-icon { margin-bottom: clamp(12px, 2.2vh, 22px); }
    .service-card h3 { font-size: 1.15rem; }
    .service-card p { font-size: 0.92rem; }
    .service-tags { margin-top: clamp(12px, 2.2vh, 22px); }

    /* process: horizontal stepper, detail card underneath */
    .process-layout { grid-template-columns: 1fr; gap: clamp(14px, 2.6vh, 28px); }
    .process-steps { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; border-top: 0; }
    .process-step {
        flex-direction: column; gap: 10px; padding: clamp(12px, 2vh, 18px) 14px;
        border: 0; border-radius: var(--r-md); box-shadow: inset 0 0 0 1px var(--line);
        transition: background-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
    }
    .process-step.is-active { background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--ink); }
    .step-summary { display: none; }
    .step-name { font-size: 0.98rem; line-height: 1.3; }
    .process-detail-card { position: relative; top: 0; padding: clamp(20px, 3.4vh, 36px) clamp(24px, 3vw, 40px); }
    .pd-panel { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 4px clamp(24px, 4vw, 56px); align-items: center; }
    .pd-panel[hidden] { display: none; }
    .pd-panel h3 { grid-column: 1; }
    .pd-panel p { grid-column: 1; margin-bottom: 0; }
    .pd-panel .process-deliverables { grid-column: 2; grid-row: 1 / span 2; }
    .deliverable { padding: 10px 14px; }

    /* stats / about / why-us already fit; tighten the gaps a little */
    .about-features { margin-top: clamp(16px, 3vh, 32px); }
    .about-img-wrap { aspect-ratio: auto; height: min(56vh, 460px); }
    .why-card { padding: clamp(16px, 2.8vh, 24px); }

    /* portfolio: shorter visuals, tighter copy */
    /* arrows sit beside the heading instead of under the cards */
    #portfolio > .container { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 32px; align-items: end; }
    #portfolio .section-head { grid-column: 1; grid-row: 1; }
    #portfolio .portfolio-track { grid-column: 1 / -1; grid-row: 2; }
    #portfolio .portfolio-controls { grid-column: 2; grid-row: 1; margin: 0 0 clamp(18px, 3.6vh, 56px); }
    .portfolio-track .app-visual { aspect-ratio: auto; height: clamp(96px, 18vh, 220px); }
    .app-body { padding: clamp(14px, 2.4vh, 26px) 22px clamp(10px, 1.6vh, 20px); }
    .app-body h3 { font-size: 1.25rem; margin-bottom: 2px; }
    .app-tagline { font-size: 0.94rem; margin-bottom: 6px; }
    .app-desc { font-size: 0.86rem; line-height: 1.55; }
    .app-tags { margin-top: 12px; }
    .app-footer { margin-top: 10px; padding-top: 6px; }

    /* testimonials */
    .testimonial-card { padding: clamp(20px, 3.4vh, 30px); }
    .slider-controls { margin-top: clamp(12px, 2.4vh, 28px); }

    /* compliance */
    .compliance-card { padding: clamp(16px, 2.8vh, 26px) 22px; }
    .compliance-icon { width: 36px; height: 36px; margin-bottom: clamp(8px, 1.6vh, 16px); }

    /* maintenance */
    .maint-desc { margin-bottom: clamp(14px, 2.6vh, 26px); }
    .maint-features { margin-bottom: clamp(16px, 3vh, 30px); gap: 10px; }

    /* contact: compact cards */
    .contact-info-card { padding: clamp(16px, 2.8vh, 26px) 22px; }
    .contact-info-card h3 { margin-bottom: clamp(10px, 1.8vh, 18px); }
    .info-row { margin-bottom: clamp(8px, 1.6vh, 16px); }
    .svc-list { gap: 6px; }
}
@media (min-width: 1081px) {
    .services-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
/* short desktop screens: shorter portfolio visuals */
@media (min-width: 901px) and (max-height: 760px) {
    .portfolio-track .app-visual { height: clamp(60px, 10vh, 120px); }
    .app-cert { margin-top: 6px; padding-block: 3px; }
    .app-cert-icon { width: 22px; height: 22px; }
    .app-desc { font-size: 0.82rem; line-height: 1.5; }
    .app-tags { margin-top: 8px; }
}

/* ============================================================
   20. Responsive
   ============================================================ */
/* short desktop screens: the feature strip drops its captions so the hero still fits one screen */
@media (min-width: 901px) and (max-height: 700px) {
    .hf-text small { display: none; }
    .hf-icon { width: 40px; height: 40px; }
    .hf { align-items: center; }
}

@media (max-width: 1080px) {
    /* 8 links + language switcher no longer fit: switch to the drawer */
    .nav-toggle { display: inline-flex; }
    .main-nav {
        position: fixed; top: var(--header-h); inset-inline: 0; bottom: 0; z-index: 999;
        flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 24px;
        padding: 16px var(--gutter) calc(32px + env(safe-area-inset-bottom));
        background: var(--white); overflow-y: auto; overscroll-behavior: contain;
        transform: translateX(100%); visibility: hidden;
        transition: transform 0.35s var(--ease-out), visibility 0s linear 0.35s;
    }
    body.lang-ar .main-nav { transform: translateX(-100%); }
    .main-nav.open, body.lang-ar .main-nav.open { transform: none; visibility: visible; transition: transform 0.35s var(--ease-out), visibility 0s; }
    .nav-menu { flex-direction: column; align-items: stretch; gap: 0; }
    .nav-menu a { min-height: 54px; padding: 0 4px; font-size: 1.15rem; font-weight: 600; color: var(--text); border-bottom: 1px solid var(--line); border-radius: 0; }
    .nav-menu a.active { box-shadow: none; color: var(--blue-ink); }
    .nav-menu a:hover { background: none; }
    .lang-switcher { align-self: flex-start; }
    .lang-btn { min-width: 52px; min-height: 44px; font-size: 0.9rem; }

    .footer-grid { grid-template-columns: 1fr 1fr; }
    .compliance-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .testimonial-card { flex-basis: calc((100% - 20px) / 2); }
    .portfolio-track { --per: 2; }
}

@media (max-width: 900px) {
    .section-head { grid-template-columns: 1fr; align-items: start; }
    .hero-layout { grid-template-columns: 1fr; gap: 12px; }
    #hero { height: auto; min-height: 0; max-height: none; }
    .scene { width: 100%; }
    .hero-headline, body.lang-fr .hero-headline { max-width: 13ch; }
    .hero-visual { width: min(100%, 600px); justify-self: center; margin-top: 12px; }
    .hero-features { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 18px; }
    .hero-features li:nth-child(3) { border-inline-start: 0; }
    .hero-features li:nth-child(3) .hf { padding-inline-start: 0; }
    .process-layout, .about-grid, .why-layout, .maintenance-layout, .contact-layout { grid-template-columns: 1fr; }
    .process-detail-card { position: relative; top: 0; margin-block: 4px 12px; }
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 28px; }
    .stats-item:nth-child(odd) { border-inline-start: 0; padding-inline-start: 0; }
    .cta-card { grid-template-columns: 1fr; }
    .cta-actions { grid-column: 1; grid-row: auto; flex-direction: row; flex-wrap: wrap; }
    .about-badge { bottom: 16px; }
}

@media (max-width: 720px) {
    :root { --header-h: 64px; }
    .site-logo img, .custom-logo { height: 48px; }
    .portfolio-track { --gap: 16px; grid-auto-columns: 86%; } /* next card peeks in: invites the swipe */
    .services-grid { grid-template-columns: 1fr; }
    .testimonial-card { flex-basis: 100%; }
    .compliance-grid, .why-grid, .about-features { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
    .hero-ctas .btn { width: 100%; }
    .hero-features { grid-template-columns: 1fr; }
    .hero-features li + li { border-inline-start: 0; }
    .hero-features .hf { padding-inline: 0; }
    .ci-steps { font-size: 0.78rem; gap: 8px 14px; }
    .ci-skip { inset-inline-end: 16px; }
    .maint-cards { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
}

/* Motion: honour the OS setting. The hero scene renders in its final, still pose. */
@media (prefers-reduced-motion: reduce) {
    html, .portfolio-track { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
    .cube { animation: none; }
    .p-code .ln { width: calc(var(--n) * 1ch) !important; }
}

