/* Asserfolio — multilingual layer (EN / FR / AR), RTL support and WhatsApp buttons */

/* Language switcher */
.lang-switch { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper-strong); flex: none; }
.lang-switch button { min-height: 32px; padding: 6px 12px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-soft); font: inherit; font-size: .72rem; font-weight: 750; line-height: 1; cursor: pointer; transition: background .18s ease, color .18s ease; }
.lang-switch button:hover { color: var(--orange-deep); }
.lang-switch button[aria-pressed="true"] { background: var(--dark); color: var(--white); }

/* WhatsApp buttons */
.button-whatsapp { background: #25d366; color: #06361b; }
.button-whatsapp:hover { background: #3ee27c; }
.button-whatsapp svg { width: 20px; height: 20px; flex: none; fill: currentColor; }
.wa-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; margin: 0 0 26px; }
.wa-number { color: #e0e8ed; font-size: .92rem; font-weight: 650; letter-spacing: .02em; direction: ltr; unicode-bidi: isolate; }
.wa-float { position: fixed; z-index: 9; inset-inline-end: max(18px, env(safe-area-inset-right, 0px)); bottom: max(18px, env(safe-area-inset-bottom, 0px)); display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: #25d366; color: #06361b; box-shadow: 0 8px 22px rgba(0, 0, 0, .28); transition: transform .18s ease, background .18s ease; }
.wa-float:hover { transform: translateY(-2px) scale(1.04); background: #3ee27c; }
.wa-float svg { width: 30px; height: 30px; fill: currentColor; }

/* Header on small screens: let the switcher wrap under the logo and nav */
@media (max-width: 680px) {
  .header-inner { flex-wrap: wrap; padding-block: 8px; }
  .lang-switch { order: 3; }
}

/* Right-to-left (Arabic) */
[dir="rtl"] .section-heading-note { margin: 0 auto 4px 0; }
[dir="rtl"] .site-nav .nav-cta span { margin-left: 0; margin-right: 4px; }
[dir="rtl"] .text-link span, [dir="rtl"] .source-link span { padding-left: 0; padding-right: 4px; }
[dir="rtl"] .approach-mark { transform: scaleX(-1); }
[dir="rtl"] .contact-card::before { right: auto; left: -40px; }
[dir="rtl"] .contact-orbit { right: auto; left: 9%; }
[dir="rtl"] .visual-caption { right: auto; left: 0; }
[dir="rtl"] .contact-honey { left: auto; right: -9999px; }

/* Arabic typography: no letter-spacing (it breaks letter joining), looser line height */
[lang="ar"], [lang="ar"] body { font-family: "Cairo", "Noto Naskh Arabic", "Segoe UI", Tahoma, system-ui, sans-serif; }
[lang="ar"] *, [lang="ar"] *::before, [lang="ar"] *::after { letter-spacing: 0 !important; }
[lang="ar"] h1, [lang="ar"] h2, [lang="ar"] h3, [lang="ar"] .hero-art-title, [lang="ar"] .intro-statement { line-height: 1.3 !important; font-weight: 700; }
[lang="ar"] .hero h1 { font-size: clamp(2.6rem, 6vw, 5rem); }
[lang="ar"] .section-heading h2, [lang="ar"] .toolkit-intro h2, [lang="ar"] .approach-heading h2, [lang="ar"] .demos-section h2, [lang="ar"] .contact-card h2 { font-size: clamp(2.1rem, 4.6vw, 3.8rem); }
[lang="ar"] .project-copy h3 { font-size: clamp(2rem, 3.4vw, 3rem); }
[lang="ar"] .hero-art-title { font-size: clamp(2.2rem, 4vw, 3.5rem); }
[lang="ar"] .project-description, [lang="ar"] .hero-lede, [lang="ar"] .skill-evidence { line-height: 1.9 !important; }

/* Intro splash (about 4.4 s, on every visit): particles form the monogram, morph into the name, split-panel exit. Hidden unless <html> has .intro-active. */
.intro { display: none; }
.intro-active .intro { position: fixed; inset: 0; z-index: 100; display: block; color: var(--white); }
.intro-panel { position: absolute; left: 0; right: 0; z-index: 0; height: 50.5%; background: var(--dark); animation: introPanelUp .85s cubic-bezier(.76, 0, .24, 1) 3.5s forwards; }
.intro-panel-top { top: 0; }
.intro-panel-bottom { bottom: 0; animation-name: introPanelDown; }
.intro-stage { position: absolute; inset: 0; z-index: 1; animation: introStageOut .4s ease 3.3s forwards; }
.intro-active.intro-leaving .intro-stage { animation: introStageOut .2s ease forwards; }
.intro-active.intro-leaving .intro-panel { animation-duration: .5s; animation-delay: .1s; }
.intro-bg { position: absolute; inset: 0; opacity: 0; animation: introFade 1.4s ease .1s forwards; background:
  radial-gradient(circle at 50% 44%, rgba(242,107,61,.2), transparent 50%),
  linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px) 0 0 / 56px 56px,
  linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px) 0 0 / 56px 56px;
  -webkit-mask-image: radial-gradient(circle at 50% 44%, #000 0, transparent 70%); mask-image: radial-gradient(circle at 50% 44%, #000 0, transparent 70%); }
.intro-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.intro-name { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.intro-tag { position: absolute; top: max(28px, env(safe-area-inset-top, 0px)); inset-inline-start: max(24px, env(safe-area-inset-left, 0px)); display: flex; align-items: center; gap: 10px; margin: 0; color: #7f8791; font-size: .6rem; font-weight: 750; letter-spacing: .26em; opacity: 0; animation: introFade .8s ease .5s forwards; }
.intro-tag i, .intro-loc i { width: 4px; height: 4px; border-radius: 50%; background: var(--orange); }
.intro-text { position: absolute; left: 0; right: 0; top: 58%; display: grid; justify-items: center; gap: 12px; padding-inline: 24px; text-align: center; }
.intro-rule { display: block; width: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--orange), transparent); animation: introRule .8s ease 2.35s forwards; }
.intro-line { max-width: 36ch; margin: 0; color: #c3c8ce; font-size: clamp(.92rem, 2.3vw, 1.1rem); line-height: 1.55; opacity: 0; transform: translateY(8px); animation: introRise .7s ease 2.5s forwards; }
.intro-loc { display: flex; align-items: center; gap: 10px; margin: 4px 0 0; color: #7f8791; font-size: .62rem; font-weight: 750; letter-spacing: .3em; opacity: 0; animation: introFade .7s ease 2.8s forwards; }
.intro-foot { position: absolute; left: 0; right: 0; bottom: max(30px, env(safe-area-inset-bottom, 0px)); display: flex; align-items: center; justify-content: center; gap: 14px; }
.intro-bar { width: min(260px, 52vw); height: 2px; background: rgba(255,255,255,.14); overflow: hidden; }
.intro-bar i { display: block; height: 100%; background: var(--orange); transform: scaleX(0); transform-origin: left center; animation: introBar 3.2s cubic-bezier(.4, 0, .2, 1) .2s forwards; }
.intro-count { min-width: 3.4ch; color: #9aa1aa; font-size: .66rem; font-weight: 750; letter-spacing: .12em; font-variant-numeric: tabular-nums; }
.intro-skipbtn { position: absolute; z-index: 2; top: max(20px, env(safe-area-inset-top, 0px)); inset-inline-end: max(20px, env(safe-area-inset-right, 0px)); min-height: 40px; padding: 0 18px; border: 1px solid rgba(255,255,255,.26); border-radius: 999px; background: transparent; color: var(--white); font: inherit; font-size: .74rem; font-weight: 700; letter-spacing: .04em; cursor: pointer; transition: background .18s ease, border-color .18s ease; }
.intro-skipbtn:hover { background: rgba(255,255,255,.08); border-color: var(--orange); }
.intro-skipbtn:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
@keyframes introRule { to { width: 76px; } }
@keyframes introRise { to { opacity: 1; transform: none; } }
@keyframes introFade { to { opacity: 1; } }
@keyframes introBar { to { transform: scaleX(1); } }
@keyframes introStageOut { to { opacity: 0; transform: scale(1.035); } }
@keyframes introPanelUp { to { transform: translateY(-101%); } }
@keyframes introPanelDown { to { transform: translateY(101%); } }
[dir="rtl"] .intro-bar i { transform-origin: right center; }
