/* =============================================================
   CREATIVE DZ v4 · scroll sur place, téléphone 3D qui s'assemble
   Noir + cyan néon · Anton (titres) · JetBrains Mono (HUD) · Rubik
   ============================================================= */
:root {
  --bg: #030507;
  --cyan: #00C2FF;
  --cyan-2: #7BE3FF;
  --text: #F4F7FB;
  --text-2: #B8C3D6;
  --text-3: #7F8BA3;
  --line: rgba(255, 255, 255, .1);
  --head: Anton, 'Noto Kufi Arabic', Impact, sans-serif;
  --body: Rubik, 'Noto Sans Arabic', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --vh: 100svh;
}
html[lang="ar"] { --head: 'Noto Kufi Arabic', Anton, sans-serif; --body: 'Noto Sans Arabic', Rubik, sans-serif; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-snap-type: y mandatory; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--body); -webkit-font-smoothing: antialiased; overflow-x: clip; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--cyan); color: var(--bg); }
.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; }
.skip:focus { position: fixed; inset-inline-start: 16px; top: 16px; z-index: 100; width: auto; height: auto; clip: auto; padding: 12px 18px; border-radius: 10px; background: var(--cyan); color: var(--bg); font-weight: 600; }
svg.i { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 12px 22px; border-radius: 4px; font: 600 13.5px var(--mono); letter-spacing: .06em; text-transform: uppercase; border: 1px solid transparent; cursor: pointer; transition: transform .25s var(--ease), box-shadow .25s, border-color .25s, color .25s; }
html[lang="ar"] .btn { font: 600 15px var(--body); letter-spacing: 0; }
.btn--cyan { background: var(--cyan); color: #00131c; box-shadow: 0 12px 40px -12px rgba(0, 194, 255, .8); }
.btn--cyan:hover { transform: translateY(-2px); box-shadow: 0 0 0 6px rgba(0, 194, 255, .15), 0 16px 50px -12px rgba(0, 194, 255, .9); }
.btn--line { border-color: rgba(255, 255, 255, .28); color: #fff; background: rgba(3, 5, 7, .35); }
.btn--line:hover { border-color: var(--cyan); color: var(--cyan-2); }
.btn--lg { min-height: 54px; padding: 14px 24px; }

/* ---------- En-tête ---------- */
.header { position: fixed; top: 0; left: 0; right: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px clamp(16px, 4vw, 48px); pointer-events: none; }
.header > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { display: flex; align-items: flex-end; gap: 3px; width: 32px; height: 32px; padding: 7px 6px; border-radius: 8px; background: #0b1428; border: 1px solid rgba(0, 194, 255, .5); }
.brand-mark span { flex: 1; border-radius: 2px; background: #fff; transform: skewX(-14deg); }
.brand-mark span:nth-child(1) { height: 38%; } .brand-mark span:nth-child(2) { height: 68%; } .brand-mark span:nth-child(3) { height: 100%; background: var(--cyan); }
.brand-name { font: 400 22px Anton, sans-serif; letter-spacing: .08em; direction: ltr; unicode-bidi: isolate; }
.brand-name b { color: var(--cyan); font-weight: 400; margin-left: 6px; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.lang { display: flex; gap: 2px; font: 500 12px var(--mono); background: rgba(3, 5, 7, .5); border-radius: 6px; padding: 2px; }
.lang a { padding: 6px 9px; min-height: 32px; display: inline-flex; align-items: center; color: var(--text-3); border-radius: 4px; }
.lang a[lang="ar"] { font: 600 13px 'Noto Sans Arabic', sans-serif; }
.lang a[aria-current="page"] { color: var(--bg); background: #fff; }
.header-cta { min-height: 40px; padding: 8px 16px; }

/* ---------- Histoire épinglée ---------- */
.story { position: relative; height: calc(var(--n) * var(--vh)); }
.snap { position: absolute; left: 0; top: calc(var(--i) * var(--vh)); width: 1px; height: var(--vh); scroll-snap-align: start; scroll-snap-stop: always; pointer-events: none; }
.stage { position: sticky; top: 0; height: var(--vh); overflow: hidden; background: radial-gradient(60% 70% at 68% 50%, #0a1a33 0%, #050912 45%, var(--bg) 80%); }
html[dir="rtl"] .stage { background: radial-gradient(60% 70% at 32% 50%, #0a1a33 0%, #050912 45%, var(--bg) 80%); }
.scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.vignette { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(3, 5, 7, .85) 0%, rgba(3, 5, 7, .35) 38%, transparent 60%); }
html[dir="rtl"] .vignette { background: linear-gradient(270deg, rgba(3, 5, 7, .85) 0%, rgba(3, 5, 7, .35) 38%, transparent 60%); }

/* HUD façon interface */
.hud { position: absolute; inset: 0; pointer-events: none; font: 500 11px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); }
.hud > * { position: absolute; }
.hud-loc { top: 78px; inset-inline-start: clamp(16px, 4vw, 48px); }
.hud-count { direction: ltr; top: 78px; inset-inline-end: clamp(16px, 4vw, 48px); color: var(--cyan); font-size: 13px; }
.hud-spec { unicode-bidi: plaintext; bottom: 54px; inset-inline-end: clamp(16px, 4vw, 48px); color: var(--cyan-2); white-space: nowrap; overflow: hidden; max-width: 46vw; }
.hud-spec::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-inline-end: 10px; background: var(--cyan); border-radius: 50%; box-shadow: 0 0 12px var(--cyan); vertical-align: 1px; }
.hud-spec.type { animation: type .7s steps(28) both; }
@keyframes type { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
html[dir="rtl"] .hud-spec.type { animation-name: type-rtl; }
@keyframes type-rtl { from { clip-path: inset(0 0 0 100%); } to { clip-path: inset(0 0 0 0); } }
.hud-scroll { bottom: 54px; inset-inline-start: clamp(16px, 4vw, 48px); display: flex; align-items: center; gap: 10px; }
.hud-scroll i { width: 1px; height: 26px; background: linear-gradient(var(--cyan), transparent); animation: drip 1.6s var(--ease) infinite; }
@keyframes drip { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }
.hud-bar { left: 0; right: 0; bottom: 0; height: 2px; background: var(--line); }
.hud-bar i { display: block; height: 100%; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); transform-origin: left; transform: scaleX(0); }
html[dir="rtl"] .hud-bar i { transform-origin: right; }

/* Points de chapitre */
.dots { position: absolute; z-index: 5; top: 50%; inset-inline-end: clamp(10px, 2vw, 28px); transform: translateY(-50%); display: flex; flex-direction: column; gap: 4px; }
.dot { width: 28px; height: 22px; padding: 0; border: 0; background: none; cursor: pointer; display: flex; align-items: center; justify-content: flex-end; }
.dot i { display: block; width: 12px; height: 2px; background: rgba(255, 255, 255, .3); transition: width .35s var(--ease), background .35s; }
.dot:hover i { background: var(--cyan-2); }
.dot[aria-current="step"] i { width: 26px; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }

/* ---------- Panneaux de texte (un par chapitre) ---------- */
.panel { position: absolute; z-index: 4; top: 50%; inset-inline-start: clamp(20px, 6vw, 96px); width: min(540px, 42vw); transform: translateY(-50%); visibility: hidden; transition: visibility 0s .45s; }
.panel.on { visibility: visible; transition-delay: 0s; }
.panel .r { opacity: 0; transform: translateY(22px); transition: opacity .3s, transform .45s var(--ease); }
.panel.on .r { opacity: 1; transform: none; transition: opacity .55s calc(var(--d, 0) * 80ms + 160ms), transform .7s var(--ease) calc(var(--d, 0) * 80ms + 160ms); }
.w { display: inline-block; overflow: hidden; vertical-align: bottom; padding: .16em .02em .04em; margin: -.16em -.02em 0; }
.w > span { display: inline-block; transform: translateY(108%); transition: transform .35s var(--ease); }
.panel.on .w > span { transform: none; transition: transform .75s var(--ease) calc(var(--w) * 55ms + 120ms); }
/* Arabe : pas de masque (les lettres ont des jambages), simple montée en fondu mot par mot */
html[lang="ar"] .w { overflow: visible; padding: 0; margin: 0; }
html[lang="ar"] .w > span { transform: translateY(.35em); opacity: 0; transition: transform .35s var(--ease), opacity .25s; }
html[lang="ar"] .panel.on .w > span { transform: none; opacity: 1; transition: transform .7s var(--ease) calc(var(--w) * 60ms + 120ms), opacity .5s calc(var(--w) * 60ms + 120ms); }

.eye { margin: 0 0 16px; font: 500 12.5px var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--cyan); }
.eye b { display: inline-block; padding: 2px 7px; margin-inline-end: 8px; border: 1px solid var(--cyan); border-radius: 3px; font-weight: 700; }
html[lang="ar"] .eye { font: 600 14px var(--body); letter-spacing: 0; }
.t { margin: 0; font: 400 clamp(40px, 5.2vw, 80px)/.98 var(--head); text-transform: uppercase; text-wrap: balance; }
.hero { margin: 0; font: 400 clamp(54px, 7vw, 118px)/.9 var(--head); white-space: nowrap; text-transform: uppercase; }
.hero .h1b { display: block; margin-top: 10px; font-size: .36em; line-height: 1; color: var(--cyan); letter-spacing: .02em; }
html[lang="ar"] .t, html[lang="ar"] .hero .h1b { font-weight: 800; line-height: 1.3; }
.sub { margin: 20px 0 0; max-width: 470px; color: var(--text-2); font-size: clamp(16px, 1.25vw, 18.5px); }
.ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.tags li { padding: 7px 12px; border: 1px solid rgba(0, 194, 255, .35); border-radius: 999px; font: 500 12px var(--mono); letter-spacing: .06em; color: var(--cyan-2); background: rgba(0, 194, 255, .06); }
html[lang="ar"] .tags li { font: 500 14px var(--body); letter-spacing: 0; }
.ghost { position: absolute; z-index: -1; top: -.5em; inset-inline-start: -.06em; font: 400 clamp(150px, 19vw, 300px)/1 Anton, sans-serif; color: transparent; -webkit-text-stroke: 1px rgba(0, 194, 255, .18); pointer-events: none; opacity: 0; transform: translateY(30px); transition: opacity .3s, transform .5s var(--ease); }
.panel.on .ghost { opacity: 1; transform: none; transition: opacity .9s .1s, transform 1.1s var(--ease) .1s; }

/* Chiffres */
.stats { display: grid; grid-template-columns: repeat(3, auto); gap: 26px; margin-top: 32px; justify-content: start; }
.stat-n { display: block; font: 400 clamp(38px, 4.4vw, 64px)/1 Anton, sans-serif; color: var(--cyan); text-shadow: 0 0 30px rgba(0, 194, 255, .45); direction: ltr; unicode-bidi: isolate; }
.stat-l { display: block; margin-top: 8px; color: var(--text-2); font-size: 14px; max-width: 150px; }

/* Clients */
.logos { display: grid; grid-template-columns: repeat(5, 56px); gap: 12px; margin-top: 28px; }
.logos img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: #fff; border: 2px solid rgba(0, 194, 255, .35); }
.quotes { position: relative; margin-top: 26px; min-height: 92px; }
.quotes figure { position: absolute; inset: 0; margin: 0; opacity: 0; transform: translateY(10px); transition: opacity .5s, transform .6s var(--ease); }
.quotes figure.on { opacity: 1; transform: none; }
.quotes blockquote { margin: 0; font-size: clamp(17px, 1.4vw, 20px); color: var(--text); }
.quotes figcaption { margin-top: 8px; font: 500 12px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--cyan); }

/* Final : composer son pack */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.chip { min-height: 40px; padding: 8px 14px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .22); background: rgba(3, 5, 7, .45); cursor: pointer; font-size: 14px; transition: background .2s, border-color .2s, color .2s; }
.chip:hover { border-color: var(--cyan); }
.chip[aria-pressed="true"] { background: var(--cyan); border-color: var(--cyan); color: #00131c; font-weight: 600; }
.builder-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 18px; }
.builder-sum { font: 500 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.panel--final { width: min(640px, 48vw); top: calc(50% + 24px); }
.panel--final .t { font-size: clamp(36px, 4vw, 62px); }
.panel--final .sub { margin-top: 12px; }
.panel--final .chips { margin-top: 16px; }
/* Équipe */
.panel--team { width: min(680px, 50vw); top: calc(50% + 34px); }
.panel--team .t { font-size: clamp(36px, 4vw, 62px); }
.team { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 30px; }
.mem { display: flex; flex-direction: column; align-items: flex-start; }
.mem img { width: 168px; height: 168px; border-radius: 50%; object-fit: cover; border: 3px solid var(--cyan); box-shadow: 0 0 40px -6px rgba(0, 194, 255, .75); background: #0b1428; }
.mem h3 { margin: 18px 0 4px; font: 400 clamp(24px, 2.2vw, 32px)/1.05 Anton, sans-serif; text-transform: uppercase; letter-spacing: .02em; }
.mem .role { margin: 0; font: 600 13px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--cyan); }
html[lang="ar"] .mem .role { font: 600 15px var(--body); letter-spacing: 0; }
.mem .bio { margin: 10px 0 0; color: var(--text-2); font-size: 15.5px; line-height: 1.5; }
.panel--final .tel { margin-top: 22px; }
.tel { display: inline-flex; align-items: center; gap: 8px; font: 500 14px var(--mono); color: var(--text); direction: ltr; }
.tel:hover { color: var(--cyan-2); }

/* ---------- Pied de page ---------- */
.footer { scroll-snap-align: end; padding: 34px clamp(16px, 4vw, 48px) 26px; border-top: 1px solid var(--line); background: var(--bg); }
.footer-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; }
.footer p { margin: 6px 0 0; color: var(--text-3); font-size: 14px; }
.socials { display: flex; gap: 10px; }
.socials a { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 8px; }
.socials a:hover { border-color: var(--cyan); color: var(--cyan-2); }
.copyright { margin: 22px 0 0 !important; font-size: 12.5px !important; }

/* ---------- Mobile : téléphone en haut, texte en bas ---------- */
@media (max-width: 819px) {
  .header { padding: 12px 16px; }
  .brand-name { font-size: 19px; }
  .header-cta { width: 40px; padding: 0; }
  .header-cta span { display: none; }
  .stage { background: radial-gradient(90% 55% at 50% 30%, #0a1a33 0%, #050912 50%, var(--bg) 85%); }
  html[dir="rtl"] .stage { background: radial-gradient(90% 55% at 50% 30%, #0a1a33 0%, #050912 50%, var(--bg) 85%); }
  .vignette, html[dir="rtl"] .vignette { background: linear-gradient(0deg, rgba(3, 5, 7, .96) 0%, rgba(3, 5, 7, .82) 34%, transparent 56%); }
  .hud-loc { display: none; }
  .hud-count { top: 70px; inset-inline-end: 16px; }
  .hud-spec, .hud-scroll { display: none; }
  .dots { top: 72px; inset-inline-end: auto; inset-inline-start: 12px; transform: none; flex-direction: row; gap: 0; }
  .dot { width: 18px; justify-content: center; }
  .dot i { width: 10px; }
  .dot[aria-current="step"] i { width: 16px; }
  .panel { top: auto; bottom: calc(26px + env(safe-area-inset-bottom)); inset-inline: 16px; width: auto; transform: none; }
  .eye { margin-bottom: 10px; font-size: 11px; }
  .t { font-size: clamp(32px, 9.4vw, 44px); }
  .hero { font-size: clamp(52px, 16vw, 72px); }
  .sub { margin-top: 12px; font-size: 15px; }
  .ctas { margin-top: 18px; gap: 10px; }
  .ctas .btn { flex: 1 1 auto; min-height: 50px; padding: 12px 16px; font-size: 12.5px; }
  .tags { margin-top: 14px; }
  .ghost { display: none; }
  .stats { gap: 14px; margin-top: 18px; }
  .stat-n { font-size: 36px; }
  .stat-l { font-size: 12.5px; }
  .logos { grid-template-columns: repeat(5, 44px); gap: 10px; margin-top: 16px; }
  .logos img { width: 44px; height: 44px; }
  .quotes { margin-top: 16px; min-height: 78px; }
  .quotes blockquote { font-size: 16px; }
  .chips { margin-top: 14px; gap: 6px; }
  .chip { min-height: 36px; padding: 6px 12px; font-size: 13px; }
  .builder-row { margin-top: 12px; }
  .builder-row .btn { flex: 1 1 100%; }
  .builder-sum { display: none; }
  .team { gap: 14px; margin-top: 16px; }
  .mem { align-items: center; text-align: center; }
  .mem img { width: 112px; height: 112px; }
  .mem h3 { margin-top: 12px; font-size: 20px; }
  .mem .role { font-size: 10.5px; letter-spacing: .04em; }
  html[lang="ar"] .mem .role { font-size: 13px; }
  .mem .bio { margin-top: 8px; font-size: 13px; line-height: 1.45; }
}
@media (max-width: 819px) and (max-height: 700px) {
  .mem img { width: 84px; height: 84px; }
  .mem .bio { font-size: 12px; }
  .panel--final .sub { display: none; }
}

/* ---------- Sans 3D ou mouvement réduit ---------- */
html.no3d { scroll-snap-type: none; }
.no3d .story { height: auto; }
.no3d .snap, .no3d .dots, .no3d .hud { display: none; }
.no3d .stage { position: static; height: auto; overflow: visible; padding: 110px 0 40px; }
.no3d .vignette { display: none; }
.no3d .panel { position: relative; inset: auto; transform: none; width: auto; max-width: 640px; margin: 0 auto 90px; padding: 0 20px; visibility: visible; }
.no3d .panel .r, .no3d .w > span, .no3d .ghost { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
}
