/* ============================================
   HICHAM — Personal Profile
   Hand-crafted with Reem Kufi + Outfit/Fraunces
   ============================================ */

:root {
  --bg: #0b0f1c;
  --bg-soft: #111729;
  --bg-card: rgba(255, 255, 255, 0.035);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #ecf0fa;
  --text-muted: #8c95ab;
  --text-dim: #5e6679;
  --primary: #6366f1;
  --primary-2: #8b5cf6;
  --accent: #06b6d4;
  --accent-2: #ec4899;
  --success: #10b981;
  --gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
  --gradient-2: linear-gradient(135deg, #06b6d4 0%, #6366f1 100%);
  --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 60px rgba(99, 102, 241, 0.28);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --transition: 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  --font-ar: 'Noto Kufi Arabic', sans-serif;
  --font-en: 'Outfit', system-ui, sans-serif;
  --font-display: 'Fraunces', serif;
}

[data-theme="light"] {
  --bg: #f6f7fb;
  --bg-soft: #ffffff;
  --bg-card: rgba(0, 0, 0, 0.025);
  --bg-card-hover: rgba(0, 0, 0, 0.05);
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.16);
  --text: #0b0f1c;
  --text-muted: #525a6e;
  --text-dim: #8b94a7;
  --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  overflow-x: hidden; /* prevent horizontal scroll at root */
}

body {
  font-family: var(--font-ar);
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  font-weight: 400;
  overflow-x: hidden;
  min-height: 100vh;
  letter-spacing: 0.01em;
  /* Ensure nothing escapes the viewport width */
  max-width: 100vw;
  position: relative;
}

html[lang="en"] body, html[lang="fr"] body {
  font-family: var(--font-en);
  line-height: 1.65;
  letter-spacing: -0.005em;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul { list-style: none; }
input, textarea { font-family: inherit; color: inherit; }

/* Prevent any child from causing horizontal scroll */
main { overflow: clip; }
.container { max-width: 100%; }

/* Every section clips its own overflow — stops animated elements from causing scrollbar */
section {
  position: relative;
}

::selection { background: var(--primary); color: #fff; }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--primary), var(--primary-2));
  border-radius: 10px;
}

.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Background ===== */
.bg-aurora {
  position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.5;
  animation: float 22s ease-in-out infinite;
}
.orb-1 { width: 520px; height: 520px; background: radial-gradient(circle, var(--primary) 0%, transparent 70%); top: -10%; left: -10%; }
.orb-2 { width: 420px; height: 420px; background: radial-gradient(circle, var(--accent-2) 0%, transparent 70%); bottom: -10%; right: -10%; animation-delay: -7s; }
.orb-3 { width: 360px; height: 360px; background: radial-gradient(circle, var(--accent) 0%, transparent 70%); top: 50%; left: 50%; transform: translate(-50%, -50%); animation-name: floatCenter; animation-delay: -14s; }
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, -30px) scale(1.05); }
  66% { transform: translate(-30px, 40px) scale(0.95); }
}
@keyframes floatCenter {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.15); }
}
.grid-overlay {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 80%);
}

/* ===== Particle canvas ===== */
.particle-canvas {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 100;
}

/* ===== Loader ===== */
.loader {
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: 9999;
  display: grid; place-items: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
.loader.hidden { opacity: 0; visibility: hidden; }
.loader-ring {
  position: absolute;
  width: 110px; height: 110px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--primary);
  border-right-color: var(--accent-2);
  animation: spin 1s linear infinite;
}
.loader-logo {
  width: 80px; height: 80px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: var(--shadow-glow), 0 0 0 3px var(--primary);
  animation: pulseLoader 1.4s ease-in-out infinite;
  position: relative;
  z-index: 1;
}
.loader-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  border-radius: 50%;
}
@keyframes pulseLoader { 0%,100% { transform: scale(1); } 50% { transform: scale(1.1); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Cursor ===== */
.cursor-dot, .cursor-ring {
  position: fixed;
  pointer-events: none;
  z-index: 9998;
  border-radius: 50%;
  top: 0; left: 0;
  transition: width 0.3s, height 0.3s, opacity 0.3s, background-color 0.3s;
}
.cursor-dot {
  width: 8px; height: 8px;
  background: var(--primary);
  transform: translate(-50%, -50%);
}
.cursor-ring {
  width: 36px; height: 36px;
  border: 2px solid var(--primary);
  transform: translate(-50%, -50%);
  opacity: 0.6;
}
.cursor-ring.hover {
  width: 64px; height: 64px;
  background: rgba(99, 102, 241, 0.12);
  border-color: var(--accent-2);
}
@media (max-width: 968px) {
  .cursor-dot, .cursor-ring { display: none; }
}

/* ===== Mascot — Pixie (Travels around screen) ===== */
.mascot-wrap {
  position: fixed;
  bottom: 20px;
  left: 16px;          /* use left/right instead of logical props to avoid RTL overflow */
  right: auto;
  top: auto;
  width: 110px;
  z-index: 95;
  cursor: pointer;
  user-select: none;
  filter: drop-shadow(0 14px 24px rgba(99, 102, 241, 0.3));
  transform: translateY(160%);
  opacity: 0;
  transition:
    transform 1.1s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.5s,
    left 0.9s cubic-bezier(0.65, 0, 0.35, 1),
    right 0.9s cubic-bezier(0.65, 0, 0.35, 1),
    top 0.9s cubic-bezier(0.65, 0, 0.35, 1),
    bottom 0.9s cubic-bezier(0.65, 0, 0.35, 1),
    width 0.6s ease;
  /* CRITICAL: never let mascot cause horizontal scroll */
  max-width: calc(100vw - 32px);
}
.mascot-wrap.show { transform: translateY(0); opacity: 1; }
.mascot-wrap.flying .mascot-svg { animation: mascotFly 1s ease-in-out; }
@keyframes mascotFly {
  0% { transform: scale(1) rotate(0); }
  40% { transform: scale(0.85) rotate(-8deg) translateY(-20px); }
  100% { transform: scale(1) rotate(0); }
}

/* ANCHORS — use left/right/top/bottom (not logical props) */
.mascot-wrap[data-anchor="bl"] { bottom: 20px; left: 16px; right: auto; top: auto; }
.mascot-wrap[data-anchor="br"] { bottom: 20px; right: 16px; left: auto; top: auto; }
.mascot-wrap[data-anchor="tl"] { top: 90px; left: 16px; right: auto; bottom: auto; }
.mascot-wrap[data-anchor="tr"] { top: 90px; right: 16px; left: auto; bottom: auto; }
.mascot-wrap[data-anchor="ml"] { top: 50%; left: 16px; right: auto; bottom: auto; transform: translateY(-50%); }
.mascot-wrap[data-anchor="mr"] { top: 50%; right: 16px; left: auto; bottom: auto; transform: translateY(-50%); }
.mascot-wrap[data-anchor="ml"].show { transform: translateY(-50%); }
.mascot-wrap[data-anchor="mr"].show { transform: translateY(-50%); }

.mascot-svg {
  width: 100%;
  height: auto;
  transform-origin: bottom center;
  animation: mascotFloat 4s ease-in-out infinite;
  overflow: visible;
}
@keyframes mascotFloat {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-8px) rotate(1deg); }
}

/* Code dots / antenna — removed (robot replaced by cartoon boy) */

.pupil { transition: transform 0.18s ease-out; }
.eyelid {
  transform-origin: top center;
  animation: blink 5s infinite;
}
@keyframes blink {
  0%, 92%, 100% { height: 0; }
  94%, 97% { height: 16px; }
}
.floor-shadow { animation: shadowPulse 4s ease-in-out infinite; transform-origin: center; }
@keyframes shadowPulse {
  0%, 100% { transform: scaleX(1); opacity: 0.3; }
  50% { transform: scaleX(0.85); opacity: 0.18; }
}

/* === Arm gestures — suit character, natural physics === */
.arm { transition: transform 0.7s cubic-bezier(0.34, 1.4, 0.64, 1); }
.hand-left, .hand-right { transition: transform 0.5s ease; }
.fl-f1,.fl-f2,.fl-f3,.fl-f4,.fl-thumb,
.fr-f1,.fr-f2,.fr-f3,.fr-f4,.fr-thumb { transition: transform 0.4s ease; }
.brow-left, .brow-right { transition: all 0.3s ease; }
.mouth-smile { transition: all 0.4s ease; }
.eyelid { animation: blink 5s infinite; }
@keyframes blink {
  0%, 91%, 100% { ry: 0; }
  93%, 96% { ry: 14; }
}

/* IDLE — very subtle natural sway, like breathing */
.mascot-wrap.gesture-idle .arm-left {
  animation: idleBreathL 4s ease-in-out infinite;
}
.mascot-wrap.gesture-idle .arm-right {
  animation: idleBreathR 4s ease-in-out infinite;
}
@keyframes idleBreathL {
  0%,100% { transform: rotate(0deg); }
  50% { transform: rotate(3deg) translateY(2px); }
}
@keyframes idleBreathR {
  0%,100% { transform: rotate(0deg); }
  50% { transform: rotate(-3deg) translateY(2px); }
}

/* WAVE — natural arm raise + wrist wave */
.mascot-wrap.gesture-wave .arm-right {
  transform: rotate(-75deg) translate(-12px, -32px);
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.mascot-wrap.gesture-wave .hand-right {
  animation: wristWave 0.55s ease-in-out infinite;
}
@keyframes wristWave {
  0%,100% { transform: rotate(-18deg); }
  50% { transform: rotate(18deg); }
}

/* POINT right — arm extends naturally */
.mascot-wrap.gesture-point .arm-right {
  transform: rotate(-28deg) translate(-4px, -10px);
}
.mascot-wrap.gesture-point .fr-f2 { transform: rotate(8,2,-4) translateY(-9px) scaleY(1.45); }
.mascot-wrap.gesture-point .fr-f1,
.mascot-wrap.gesture-point .fr-f3,
.mascot-wrap.gesture-point .fr-f4 { transform: scaleY(0.35); }

/* POINT left */
.mascot-wrap.gesture-point-left .arm-left {
  transform: rotate(28deg) translate(4px, -10px);
}
.mascot-wrap.gesture-point-left .fl-f2 { transform: translateY(-9px) scaleY(1.45); }
.mascot-wrap.gesture-point-left .fl-f1,
.mascot-wrap.gesture-point-left .fl-f3,
.mascot-wrap.gesture-point-left .fl-f4 { transform: scaleY(0.35); }

/* POINT UP */
.mascot-wrap.gesture-point-up .arm-right {
  transform: rotate(-115deg) translate(0, -20px);
}
.mascot-wrap.gesture-point-up .fr-f2 { transform: translateY(-10px) scaleY(1.5); }

/* POINT DOWN */
.mascot-wrap.gesture-point-down .arm-right {
  transform: rotate(58deg);
}
.mascot-wrap.gesture-point-down .fr-f2 { transform: translateY(9px) scaleY(1.4); }

/* THUMBS UP — natural fist with thumb out */
.mascot-wrap.gesture-thumbs .arm-left {
  transform: rotate(20deg) translateY(-4px);
}
.mascot-wrap.gesture-thumbs .fl-thumb { transform: rotate(-45,-9,4) translateY(-15px) scaleY(1.8); }
.mascot-wrap.gesture-thumbs .fl-f1,
.mascot-wrap.gesture-thumbs .fl-f2,
.mascot-wrap.gesture-thumbs .fl-f3,
.mascot-wrap.gesture-thumbs .fl-f4 { transform: scaleY(0.28); }

/* PEACE ✌️ */
.mascot-wrap.gesture-peace .arm-right {
  transform: rotate(-20deg) translateY(-6px);
}
.mascot-wrap.gesture-peace .fr-f1 { transform: rotate(25,7,-2) translateY(-9px) scaleY(1.5); }
.mascot-wrap.gesture-peace .fr-f2 { transform: rotate(8,2,-4) translateY(-9px) scaleY(1.5); }
.mascot-wrap.gesture-peace .fr-f3,
.mascot-wrap.gesture-peace .fr-f4 { transform: scaleY(0.28); }

/* THINK — hand near chin, head tilts */
.mascot-wrap.gesture-think .arm-right {
  transform: rotate(-58deg) translate(-8px, -20px);
}
.mascot-wrap.gesture-think .head-group {
  animation: thinkTilt 2.5s ease-in-out infinite;
}
@keyframes thinkTilt {
  0%,100% { transform: rotate(0deg); }
  40% { transform: rotate(-5deg); }
  70% { transform: rotate(-3deg); }
}

/* CODE — both arms forward, typing rhythm */
.mascot-wrap.gesture-code .arm-left {
  transform: rotate(40deg) translate(6px, 2px);
  animation: codeArmL 0.45s ease-in-out infinite;
}
.mascot-wrap.gesture-code .arm-right {
  transform: rotate(-40deg) translate(-6px, 2px);
  animation: codeArmR 0.45s ease-in-out infinite;
}
@keyframes codeArmL {
  0%,100% { transform: rotate(40deg) translate(6px, 2px); }
  50% { transform: rotate(40deg) translate(6px, 8px); }
}
@keyframes codeArmR {
  0%,100% { transform: rotate(-40deg) translate(-6px, 2px); }
  50% { transform: rotate(-40deg) translate(-6px, 8px); }
}

/* HEART — arms cross at chest */
.mascot-wrap.gesture-heart .arm-left {
  transform: rotate(50deg) translate(4px, -4px);
}
.mascot-wrap.gesture-heart .arm-right {
  transform: rotate(-50deg) translate(-4px, -4px);
}

/* PRESENT — one arm out, palm up */
.mascot-wrap.gesture-present .arm-right {
  transform: rotate(-58deg) translate(-10px, -20px);
}

/* MOODS */
.mascot-wrap.mood-happy .pupil-left,
.mascot-wrap.mood-happy .pupil-right { fill: #10b981; }
.mascot-wrap.mood-excited .mascot-svg {
  animation: mascotBounce 0.6s ease-in-out infinite;
}
@keyframes mascotBounce {
  0%,100% { transform: translateY(0) scaleY(1); }
  40% { transform: translateY(-14px) scaleY(1.02); }
  70% { transform: translateY(-6px) scaleY(0.98); }
}

/* Speech bubble */
.speech-bubble {
  position: absolute;
  left: calc(100% + 12px);
  right: auto;
  bottom: 55%;
  background: var(--bg-soft);
  border: 1px solid var(--border-strong);
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  opacity: 0;
  transform: translateY(8px) scale(0.9);
  transform-origin: bottom left;
  transition: opacity 0.3s, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  width: 200px;          /* fixed width — no overflow */
  white-space: normal;
  word-break: break-word;
  z-index: 96;
}
.speech-bubble::before {
  content: '';
  position: absolute;
  bottom: 14px;
  left: -7px;
  width: 14px; height: 14px;
  background: var(--bg-soft);
  border-left: 1px solid var(--border-strong);
  border-bottom: 1px solid var(--border-strong);
  transform: rotate(45deg);
}

/* When mascot is on the right side — bubble goes left */
.mascot-wrap[data-anchor="br"] .speech-bubble,
.mascot-wrap[data-anchor="tr"] .speech-bubble,
.mascot-wrap[data-anchor="mr"] .speech-bubble {
  left: auto;
  right: calc(100% + 12px);
  transform-origin: bottom right;
}
.mascot-wrap[data-anchor="br"] .speech-bubble::before,
.mascot-wrap[data-anchor="tr"] .speech-bubble::before,
.mascot-wrap[data-anchor="mr"] .speech-bubble::before {
  left: auto;
  right: -7px;
  border-left: none;
  border-right: 1px solid var(--border-strong);
  border-bottom: 1px solid var(--border-strong);
  border-top: none;
}

.mascot-wrap[data-anchor="tl"] .speech-bubble,
.mascot-wrap[data-anchor="tr"] .speech-bubble {
  bottom: auto;
  top: 55%;
}

.speech-bubble.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Mascot mini-mode (mobile) */
@media (max-width: 768px) {
  .mascot-wrap {
    width: 75px;
    bottom: 14px;
    left: 12px;
    right: auto;
    max-width: 75px;
  }
  .mascot-wrap[data-anchor="br"] { right: 12px; left: auto; }
  .mascot-wrap[data-anchor="tl"] { top: 80px; left: 12px; right: auto; }
  .mascot-wrap[data-anchor="tr"] { top: 80px; right: 12px; left: auto; }
  .mascot-wrap[data-anchor="ml"],
  .mascot-wrap[data-anchor="mr"] {
    /* on mobile, don't use middle anchors — fall back to bottom */
    top: auto;
    bottom: 14px;
  }
  .mascot-wrap[data-anchor="ml"] { left: 12px; right: auto; transform: translateY(0); }
  .mascot-wrap[data-anchor="mr"] { right: 12px; left: auto; transform: translateY(0); }
  .mascot-wrap[data-anchor="ml"].show,
  .mascot-wrap[data-anchor="mr"].show { transform: translateY(0); }

  .speech-bubble {
    font-size: 12px;
    padding: 8px 12px;
    width: 170px;
    bottom: 80%;
  }

  .mascot-toggle { display: none; } /* removed */

  /* Hide mascot when keyboard might be open */
  .mascot-wrap.minimized {
    width: 55px;
    opacity: 0.6;
  }
}

@media (max-width: 480px) {
  .mascot-wrap { width: 65px; max-width: 65px; }
  .speech-bubble { width: 155px; font-size: 11.5px; }
}

/* Nav overlay (mobile) */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(3px);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.nav-overlay.show { opacity: 1; }

/* Nav menu header (mobile) */
.nav-menu-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}
.nav-menu-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-family: var(--font-en);
}
.nav-close {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: grid; place-items: center;
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}
.nav-close:hover { background: rgba(239,68,68,0.15); color: #ef4444; border-color: rgba(239,68,68,0.3); }

/* Nav icon (mobile only) */
.nav-icon { display: none; }

/* Nav menu socials (mobile only) */
.nav-menu-socials {
  display: none;
  gap: 10px;
  padding-top: 20px;
  margin-top: 10px;
  border-top: 1px solid var(--border);
}
.nav-menu-socials a {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: grid; place-items: center;
  font-size: 16px;
  color: var(--text-muted);
  transition: var(--transition);
}
.nav-menu-socials a:hover {
  color: var(--primary);
  background: rgba(99,102,241,0.1);
  border-color: var(--primary);
}

@media (max-width: 880px) {
  .nav-overlay { display: block; }
  .nav-menu-header { display: flex; }
  .nav-icon { display: inline-block; width: 20px; text-align: center; color: var(--primary); font-size: 14px; }
  .nav-menu-socials { display: flex; }
  /* Active link style in mobile menu */
  .nav-links a.active {
    background: rgba(99,102,241,0.1);
    color: var(--primary);
  }
  .nav-links a.active .nav-icon { color: var(--primary); }
  .nav-links a.active::after { display: none; }
}
/* Mascot direction — RTL: move mascot to right side, bubble goes left.
   NO scaleX flip — avoids text inversion. */
.mascot-wrap[data-dir="rtl"] {
  left: auto !important;
  right: 16px !important;
}
.mascot-wrap[data-dir="rtl"] .speech-bubble {
  left: auto;
  right: calc(100% + 12px);
  transform-origin: bottom right;
}
.mascot-wrap[data-dir="rtl"] .speech-bubble::before {
  left: auto;
  right: -7px;
  border-left: none;
  border-right: 1px solid var(--border-strong);
  border-bottom: 1px solid var(--border-strong);
}
.mascot-wrap.hidden { transform: translateY(160%) !important; opacity: 0 !important; pointer-events: none; }

/* ===== Navbar ===== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 18px 0;
  transition: var(--transition);
}
.navbar.scrolled {
  background: rgba(11, 15, 28, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}
[data-theme="light"] .navbar.scrolled { background: rgba(246, 247, 251, 0.85); }

.nav-container {
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  /* overflow: hidden removed — it clips dropdown menus */
  overflow: visible;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700;
  font-size: 19px;
}
.logo-mark {
  width: 40px; height: 40px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
  border: 2px solid rgba(99, 102, 241, 0.4);
  transition: var(--transition);
}
.logo-mark:hover {
  box-shadow: 0 6px 22px rgba(99, 102, 241, 0.55);
  border-color: var(--primary);
}
.logo-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}
.logo-text {
  font-family: var(--font-en);
  letter-spacing: 1.2px;
  font-weight: 700;
}
.nav-links { display: flex; gap: 4px; }
.nav-links a {
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
  transition: var(--transition);
  position: relative;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--text);
  background: var(--bg-card);
}
.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px; height: 2px;
  background: var(--gradient);
  border-radius: 2px;
}
.nav-actions { display: flex; align-items: center; gap: 10px; }

.lang-switcher {
  position: relative;
  z-index: 1001;
}
.lang-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: var(--transition);
  font-family: var(--font-en);
}
.lang-btn:hover { background: var(--bg-card-hover); }
.lang-btn .arrow { font-size: 10px; transition: var(--transition); }
.lang-btn.open .arrow { transform: rotate(180deg); }
.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: auto;
  min-width: 160px;
  background: var(--bg-soft);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.35);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.96);
  transform-origin: top right;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 1100;
}
html[dir="rtl"] .lang-menu { right: auto; left: 0; transform-origin: top left; }
.lang-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.lang-menu li {
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: var(--transition);
}
.lang-menu li:hover { background: var(--bg-card-hover); }
.lang-menu li.active { background: var(--gradient); color: #fff; }

.theme-toggle {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: grid; place-items: center;
  transition: var(--transition);
}
.theme-toggle:hover {
  background: var(--bg-card-hover);
  transform: rotate(20deg);
}
.menu-toggle {
  display: none;
  width: 40px; height: 40px;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  align-items: center;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
}
.menu-toggle span {
  width: 20px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}
.menu-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  transition: var(--transition);
  cursor: pointer;
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
  font-family: inherit;
}
.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.35);
}
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(99, 102, 241, 0.5);
}
.btn-ghost {
  background: var(--bg-card);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-ghost:hover {
  background: var(--bg-card-hover);
  transform: translateY(-3px);
}
.btn-block { width: 100%; }
.arrow-icon { transition: transform 0.3s ease; }
html[dir="ltr"] .arrow-icon { transform: scaleX(-1); }
.btn:hover .arrow-icon { transform: translateX(-4px); }
html[dir="ltr"] .btn:hover .arrow-icon { transform: translateX(4px) scaleX(-1); }

/* ===== Hero ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 120px 0 80px;
  position: relative;
}
.hero-container {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 80px;
  align-items: center;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}
.wave-emoji {
  display: inline-block;
  animation: wave 2.5s ease-in-out infinite;
  transform-origin: 70% 70%;
}
@keyframes wave {
  0%, 60%, 100% { transform: rotate(0); }
  10%, 30% { transform: rotate(14deg); }
  20% { transform: rotate(-8deg); }
  40%, 50% { transform: rotate(10deg); }
}

.hero-title {
  font-size: clamp(40px, 6vw, 76px);
  line-height: 1.1;
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}
html[lang="en"] .hero-title, html[lang="fr"] .hero-title {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.025em;
}
.hero-greet {
  display: block;
  font-size: 0.5em;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-family: var(--font-ar);
}
html[lang="en"] .hero-greet, html[lang="fr"] .hero-greet {
  font-family: var(--font-en);
  font-weight: 400;
  font-style: italic;
}
.hero-name {
  font-family: var(--font-en);
  letter-spacing: -0.03em;
  font-weight: 800;
  display: inline-block;
}
.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 200% 200%;
  animation: gradientShift 6s ease infinite;
}
@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero-subtitle {
  font-size: clamp(18px, 2.5vw, 26px);
  font-weight: 500;
  color: var(--text);
  margin-bottom: 24px;
  min-height: 40px;
}
.cursor-blink {
  color: var(--primary);
  animation: cursorBlink 1s step-end infinite;
}
@keyframes cursorBlink { 50% { opacity: 0; } }

.hero-description {
  font-size: 17px;
  color: var(--text-muted);
  max-width: 580px;
  margin-bottom: 36px;
  line-height: 1.9;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

.hero-socials {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.hero-socials a {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: grid; place-items: center;
  font-size: 17px;
  color: var(--text-muted);
  transition: var(--transition);
  position: relative;
}
.hero-socials a[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--bg-soft);
  border: 1px solid var(--border-strong);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-en);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}
.hero-socials a:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.hero-socials a:hover {
  color: #fff;
  transform: translateY(-4px) scale(1.05);
  border-color: transparent;
  box-shadow: 0 10px 22px rgba(99, 102, 241, 0.3);
}
.hero-socials a:nth-child(1):hover { background: linear-gradient(135deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); }
.hero-socials a:nth-child(2):hover { background: #000; }
.hero-socials a:nth-child(3):hover { background: #1877f2; }
.hero-socials a:nth-child(4):hover { background: #181717; }
.hero-socials a:nth-child(5):hover { background: var(--gradient); }

/* Hero Visual */
.hero-visual {
  position: relative;
  display: grid;
  place-items: center;
}
.avatar-wrap {
  position: relative;
  width: 380px; height: 380px;
  /* contain rings visually without clipping them */
  isolation: isolate;
}
  cursor: pointer;
}
.avatar-glow {
  position: absolute; inset: -20%;
  background: var(--gradient);
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.4;
  animation: glowPulse 4s ease-in-out infinite;
}
@keyframes glowPulse {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.05); }
}
.avatar-ring {
  position: absolute;
  inset: 0;
  border: 1px dashed var(--border-strong);
  border-radius: 50%;
  /* use scale instead of negative inset to avoid overflow */
}
.ring-1 {
  transform: scale(1.12);
  animation: spin 30s linear infinite;
}
.ring-2 {
  transform: scale(1.28);
  border-style: solid;
  border-color: transparent;
  border-top-color: var(--primary);
  border-right-color: var(--accent-2);
  animation: spin 15s linear infinite reverse;
}
.avatar-card {
  position: absolute; inset: 30px;
  border-radius: 50%;
  background: var(--gradient);
  display: grid; place-items: center;
  box-shadow: var(--shadow-glow);
  animation: floatY 6s ease-in-out infinite;
  transition: transform 0.4s ease;
  overflow: hidden;
}
.avatar-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  border-radius: 50%;
  display: block;
}
.avatar-wrap:hover .avatar-card {
  transform: scale(1.04);
}
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

.float-chip {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-en);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(10px);
  animation: floatChip 5s ease-in-out infinite;
  white-space: nowrap;
}
.float-chip i { color: var(--primary); font-size: 13px; }
/* Use left/right instead of logical props */
.chip-1 { top: 5%; left: -8%; animation-delay: 0s; }
.chip-2 { top: 30%; right: -12%; animation-delay: -1.5s; }
.chip-3 { bottom: 25%; left: -12%; animation-delay: -3s; }
.chip-4 { bottom: 5%; right: -4%; animation-delay: -4.5s; }
html[dir="rtl"] .chip-1 { left: auto; right: -8%; }
html[dir="rtl"] .chip-2 { right: auto; left: -12%; }
html[dir="rtl"] .chip-3 { left: auto; right: -12%; }
html[dir="rtl"] .chip-4 { right: auto; left: -4%; }
@keyframes floatChip { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

.scroll-indicator {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: 26px; height: 44px;
  border: 2px solid var(--text-muted);
  border-radius: 100px;
  display: grid; place-items: start center;
  padding-top: 8px;
}
.scroll-indicator span {
  width: 4px; height: 10px;
  background: var(--text-muted);
  border-radius: 2px;
  animation: scrollMove 1.8s ease-in-out infinite;
}
@keyframes scrollMove {
  0% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(15px); opacity: 0; }
}

/* ===== Sections ===== */
section { padding: 100px 0; position: relative; }
.section-head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 64px;
}
.section-tag {
  display: inline-block;
  padding: 6px 14px;
  background: rgba(99, 102, 241, 0.12);
  color: var(--primary);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
  letter-spacing: 0.5px;
}
.section-title {
  font-size: clamp(32px, 5vw, 54px);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 14px;
  letter-spacing: -0.01em;
}
html[lang="en"] .section-title, html[lang="fr"] .section-title {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.025em;
}
.section-sub {
  font-size: 17px;
  color: var(--text-muted);
}

/* ===== Stats ===== */
.stats { padding: 60px 0; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.stat-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-strong);
}
.stat-number {
  font-family: var(--font-en);
  font-size: clamp(36px, 5vw, 52px);
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
}
.stat-number::after { content: '+'; }
.stat-number[data-suffix="+"]::after { content: '+'; }
.stat-label { font-size: 14px; color: var(--text-muted); font-weight: 500; }

/* ===== About ===== */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 50px;
  align-items: start;
}
.about-text p {
  font-size: 16.5px;
  color: var(--text-muted);
  margin-bottom: 18px;
  line-height: 1.95;
}
.about-text strong { color: var(--text); }

.about-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 30px;
}
.feature-item {
  display: flex;
  gap: 14px;
  padding: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
}
.feature-item:hover {
  background: var(--bg-card-hover);
  transform: translateY(-3px);
}
.feature-item i {
  font-size: 22px;
  color: var(--primary);
  flex-shrink: 0;
  width: 44px; height: 44px;
  background: rgba(99, 102, 241, 0.12);
  border-radius: 10px;
  display: grid; place-items: center;
}
.feature-item h4 { font-size: 15px; margin-bottom: 4px; font-weight: 600; }
.feature-item p { font-size: 13px; color: var(--text-muted); margin: 0; line-height: 1.6; }

.about-card {
  position: relative;
  padding: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.card-glow {
  position: absolute;
  top: -40%; right: -40%;
  width: 80%; height: 80%;
  background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
  filter: blur(60px);
  opacity: 0.25;
}
.about-card h3 {
  font-size: 22px;
  margin-bottom: 22px;
  position: relative;
  font-weight: 600;
}
.info-list { position: relative; margin-bottom: 22px; }
.info-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14.5px;
}
.info-list li:last-child { border-bottom: none; }
.info-list span { color: var(--text-muted); }

.follow-block {
  position: relative;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.follow-block p {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.follow-icons {
  display: flex;
  gap: 10px;
}
.follow-icons a {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: var(--bg-card-hover);
  font-size: 17px;
  color: var(--text);
  transition: var(--transition);
}
.follow-icons .follow-ig:hover { background: linear-gradient(135deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); color: #fff; transform: translateY(-3px); }
.follow-icons .follow-tt:hover { background: #000; color: #fff; transform: translateY(-3px); }
.follow-icons .follow-fb:hover { background: #1877f2; color: #fff; transform: translateY(-3px); }

/* ===== Projects ===== */
.projects-filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 50px;
}
.filter-btn {
  padding: 10px 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  transition: var(--transition);
  font-family: inherit;
}
.filter-btn:hover { color: var(--text); background: var(--bg-card-hover); }
.filter-btn.active {
  background: var(--gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 24px;
}
.project-card {
  position: relative;
  padding: 32px 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: var(--transition);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.project-card.hide { display: none; }
.project-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 4px;
  background: var(--gradient);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s ease;
}
.project-card:hover {
  transform: translateY(-8px);
  border-color: var(--border-strong);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}
.project-card:hover::before { transform: scaleX(1); }

.project-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: var(--gradient);
  display: grid; place-items: center;
  font-size: 22px;
  color: #fff;
  margin-bottom: 22px;
  box-shadow: 0 10px 24px rgba(99, 102, 241, 0.3);
  transition: var(--transition);
}
.project-card:hover .project-icon {
  transform: rotate(-8deg) scale(1.05);
}
.project-tag {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 14px;
  align-self: flex-start;
}
.project-card h3 {
  font-size: 20px;
  margin-bottom: 12px;
  line-height: 1.4;
  font-weight: 600;
}
.project-card p {
  color: var(--text-muted);
  font-size: 14.5px;
  line-height: 1.75;
  margin-bottom: 20px;
  flex-grow: 1;
}
.project-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}
.project-stack span {
  padding: 4px 10px;
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-en);
}
.project-name {
  font-size: 20px;
  margin-bottom: 12px;
  line-height: 1.4;
  font-weight: 700;
  font-family: var(--font-en);
  letter-spacing: 0.5px;
}

/* Project card — icon style header */
.project-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.project-icon-img {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}
.project-icon-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}
.project-card:hover .project-icon-img {
  transform: scale(1.08) rotate(-3deg);
  box-shadow: 0 8px 20px rgba(99,102,241,0.3);
}
.project-header-info {
  flex: 1;
  min-width: 0;
}
.project-name {
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-en);
  letter-spacing: 0.3px;
  margin: 4px 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Remove old img-wrap styles */
.project-img-wrap { display: none; }
.project-img { display: none; }
.browser-bar { display: none; }
.project-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--gradient);
  color: #fff;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-en);
  transition: var(--transition);
  cursor: pointer;
  border: none;
  text-decoration: none;
  margin-top: auto;
}
.project-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(99,102,241,0.4);
  color: #fff;
}
.project-btn-disabled {
  background: var(--bg-card-hover);
  color: var(--text-muted);
  cursor: default;
  border: 1px solid var(--border);
}
.project-btn-disabled:hover {
  transform: none;
  box-shadow: none;
}

/* ===== Skills ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 22px;
}
.skill-cat {
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: var(--transition);
}
.skill-cat:hover {
  transform: translateY(-5px);
  border-color: var(--border-strong);
}
.skill-cat h3 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  margin-bottom: 20px;
  font-weight: 600;
}
.skill-cat h3 i {
  width: 40px; height: 40px;
  background: var(--gradient);
  border-radius: 10px;
  display: grid; place-items: center;
  color: #fff;
  font-size: 16px;
}
.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.skill-tags span {
  padding: 8px 14px;
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-en);
  transition: var(--transition);
  cursor: default;
}
.skill-tags span:hover {
  background: var(--gradient);
  color: #fff;
  border-color: transparent;
  transform: translateY(-2px) scale(1.05);
}

/* ===== Services ===== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 24px;
}
.service-card {
  position: relative;
  padding: 36px 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: var(--transition);
  overflow: hidden;
}
.service-card::before {
  content: '';
  position: absolute; inset: 0;
  background: var(--gradient);
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 0;
}
.service-card > * { position: relative; z-index: 1; }
.service-card:hover {
  transform: translateY(-8px);
  border-color: transparent;
  color: #fff;
}
.service-card:hover::before { opacity: 1; }
.service-card:hover .service-num,
.service-card:hover h3,
.service-card:hover p { color: #fff; }
.service-card:hover .service-icon {
  background: rgba(255,255,255,0.18);
  color: #fff;
}
.service-num {
  font-family: var(--font-en);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-dim);
  margin-bottom: 18px;
  transition: var(--transition);
}
.service-icon {
  width: 56px; height: 56px;
  background: rgba(99, 102, 241, 0.12);
  color: var(--primary);
  border-radius: 14px;
  display: grid; place-items: center;
  font-size: 22px;
  margin-bottom: 22px;
  transition: var(--transition);
}
.service-card h3 {
  font-size: 20px;
  margin-bottom: 12px;
  font-weight: 600;
  transition: var(--transition);
}
.service-card p {
  font-size: 14.5px;
  color: var(--text-muted);
  line-height: 1.75;
  transition: var(--transition);
}

/* ===== Contact ===== */
.contact-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.2fr;
  gap: 40px;
  align-items: start;
}
.contact-info { display: grid; gap: 18px; }
.contact-item {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
}
.contact-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
}
.contact-item > i {
  width: 50px; height: 50px;
  background: var(--gradient);
  border-radius: 12px;
  display: grid; place-items: center;
  color: #fff;
  font-size: 18px;
  flex-shrink: 0;
}
.contact-item span {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.contact-item strong {
  font-size: 15px;
  font-family: var(--font-en);
  font-weight: 600;
}

.contact-socials {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  padding: 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  justify-content: center;
}
.contact-socials a {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: var(--bg-card-hover);
  display: grid; place-items: center;
  font-size: 17px;
  transition: var(--transition);
}
.contact-socials a:hover {
  transform: translateY(-4px) scale(1.1);
  color: #fff;
}
.contact-socials a:nth-child(1):hover { background: linear-gradient(135deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); }
.contact-socials a:nth-child(2):hover { background: #000; }
.contact-socials a:nth-child(3):hover { background: #1877f2; }
.contact-socials a:nth-child(4):hover { background: #181717; }
.contact-socials a:nth-child(5):hover { background: var(--gradient); }

/* Form */
.contact-form {
  padding: 36px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: grid;
  gap: 18px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.form-group { position: relative; }
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 22px 16px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  transition: var(--transition);
  resize: vertical;
  font-family: inherit;
}
.form-group textarea { min-height: 130px; padding-top: 26px; }
.form-group label {
  position: absolute;
  inset-inline-start: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--text-muted);
  pointer-events: none;
  transition: var(--transition);
  background: transparent;
  padding: 0 4px;
}
.form-group textarea + label { top: 22px; transform: none; }
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.form-group input:focus + label,
.form-group input:not(:placeholder-shown) + label,
.form-group textarea:focus + label,
.form-group textarea:not(:placeholder-shown) + label {
  top: 6px;
  transform: none;
  font-size: 11px;
  color: var(--primary);
  background: var(--bg);
}

/* ===== Footer ===== */
.footer {
  padding: 48px 0 28px;
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
}

/* Top row */
.footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.footer-name {
  display: block;
  font-family: var(--font-en);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 1px;
}
.footer-tagline {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.footer-socials {
  display: flex;
  gap: 10px;
}
.footer-socials a {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: grid; place-items: center;
  font-size: 15px;
  color: var(--text-muted);
  transition: var(--transition);
}
.footer-socials a:hover {
  color: #fff;
  transform: translateY(-3px);
  border-color: transparent;
}
.footer-socials a:nth-child(1):hover { background: linear-gradient(135deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888); }
.footer-socials a:nth-child(2):hover { background: #000; }
.footer-socials a:nth-child(3):hover { background: #1877f2; }
.footer-socials a:nth-child(4):hover { background: #181717; }
.footer-socials a:nth-child(5):hover { background: var(--gradient); }

/* Nav links row */
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  justify-content: center;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.footer-nav a {
  font-size: 14px;
  color: var(--text-muted);
  transition: var(--transition);
}
.footer-nav a:hover { color: var(--primary); }

/* Bottom row */
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-bottom p {
  font-size: 13px;
  color: var(--text-muted);
}
.back-top {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: var(--gradient);
  display: grid; place-items: center;
  color: #fff;
  transition: var(--transition);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.3);
  flex-shrink: 0;
}
.back-top:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 26px rgba(99, 102, 241, 0.45);
}

/* Mobile footer */
@media (max-width: 600px) {
  .footer { padding: 36px 0 24px; }
  .footer-top { flex-direction: column; align-items: flex-start; gap: 16px; }
  .footer-socials { flex-wrap: wrap; }
  .footer-nav { justify-content: flex-start; gap: 6px 16px; }
  .footer-bottom { flex-direction: column; align-items: center; text-align: center; gap: 14px; }
  .footer-bottom p { order: 2; }
  .back-top { order: 1; }
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-soft);
  border: 1px solid var(--border-strong);
  padding: 14px 22px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  transition: opacity 0.4s, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 9000;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== Reveal ===== */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}
.reveal.show {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Responsive ===== */
@media (max-width: 1080px) {
  .hero-container { gap: 40px; }
  .avatar-wrap { width: 320px; height: 320px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 880px) {
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    left: auto;
    width: 72%;
    max-width: 280px;
    height: 100vh;
    background: var(--bg-soft);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-left: 1px solid var(--border);
    flex-direction: column;
    padding: 90px 20px 32px;
    gap: 4px;
    transition: right 0.45s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 999;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: -8px 0 32px rgba(0,0,0,0.25);
  }
  html[dir="rtl"] .nav-links {
    right: auto;
    left: -100%;
    border-left: none;
    border-right: 1px solid var(--border);
    box-shadow: 8px 0 32px rgba(0,0,0,0.25);
    transition: left 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .nav-links.open { right: 0; }
  html[dir="rtl"] .nav-links.open { left: 0; right: auto; }
  .nav-links a {
    width: 100%;
    padding: 13px 16px;
    font-size: 15px;
    border-radius: 10px;
  }
  .nav-links a.active {
    background: rgba(99,102,241,0.12);
    color: var(--primary);
  }
  .nav-links a.active::after { display: none; }
  .menu-toggle { display: flex; }

  .hero-container { grid-template-columns: 1fr; text-align: center; gap: 30px; }
  .hero-content { order: 2; }
  .hero-visual { order: 1; }
  .hero-badge { margin: 0 auto 20px; }
  .hero-actions { justify-content: center; }
  .hero-socials { justify-content: center; }
  .hero-description { margin-inline: auto; }
  .avatar-wrap { width: 260px; height: 260px; }
  /* Hide all chips on tablet/mobile — they overflow */
  .float-chip { display: none !important; }

  .about-grid { grid-template-columns: 1fr; gap: 30px; }
  .about-features { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }

  section { padding: 70px 0; }
  .section-head { margin-bottom: 44px; }
}

/* ----- Mobile (768px and below) ----- */
@media (max-width: 768px) {
  .container { padding: 0 18px; }
  html { scroll-padding-top: 70px; }

  /* Disable custom cursor on touch devices */
  .cursor-dot, .cursor-ring { display: none !important; }

  /* Navbar — mobile optimized */
  .navbar { padding: 10px 0; }
  .nav-container {
    padding: 0 14px;
    gap: 8px;
  }
  /* Logo: show mark only, hide text */
  .logo-text { display: none; }
  .logo-mark {
    width: 36px; height: 36px;
    border-radius: 10px;
  }
  /* Compact lang button — icon + code only */
  .lang-btn {
    padding: 6px 9px;
    font-size: 12px;
    gap: 4px;
    border-radius: 8px;
  }
  .lang-btn i.fa-globe { font-size: 13px; }
  .lang-btn .arrow { display: none; }
  /* Compact theme toggle */
  .theme-toggle {
    width: 36px; height: 36px;
    border-radius: 8px;
    font-size: 14px;
  }
  /* Hamburger */
  .menu-toggle {
    width: 36px; height: 36px;
    border-radius: 8px;
    gap: 4px;
  }
  .menu-toggle span { width: 18px; }

  /* Hero */
  .hero { padding: 100px 0 60px; min-height: auto; }
  .hero-title { font-size: clamp(34px, 8vw, 50px); margin-bottom: 12px; }
  .hero-subtitle { font-size: 17px; min-height: 30px; margin-bottom: 18px; }
  .hero-description { font-size: 15px; margin-bottom: 28px; }
  .hero-actions { gap: 10px; margin-bottom: 28px; }
  .hero-actions .btn { padding: 12px 22px; font-size: 14px; }
  .hero-socials { gap: 10px; }
  .hero-socials a { width: 40px; height: 40px; font-size: 15px; }
  .hero-socials a[data-tooltip]::after { display: none; }

  /* Section heads */
  .section-title { font-size: clamp(26px, 6vw, 40px); }
  .section-sub { font-size: 15px; }

  /* Stats */
  .stats { padding: 40px 0; }
  .stat-card { padding: 24px 16px; }
  .stat-number { font-size: clamp(30px, 8vw, 42px); }
  .stat-label { font-size: 13px; }

  /* About */
  .about-text p { font-size: 15px; }
  .feature-item { padding: 16px; }
  .feature-item h4 { font-size: 14.5px; }
  .feature-item p { font-size: 12.5px; }
  .about-card { padding: 24px; }
  .about-card h3 { font-size: 19px; margin-bottom: 18px; }
  .info-list li { font-size: 13.5px; padding: 12px 0; }

  /* Projects */
  .projects-filter { gap: 8px; margin-bottom: 36px; }
  .filter-btn { padding: 8px 16px; font-size: 13px; }
  .projects-grid { grid-template-columns: 1fr; gap: 18px; }
  .project-card { padding: 26px 22px; }
  .project-card h3 { font-size: 18px; }
  .project-card p { font-size: 14px; }
  .project-icon { width: 50px; height: 50px; font-size: 19px; margin-bottom: 18px; }

  /* Skills */
  .skills-grid { grid-template-columns: 1fr; gap: 18px; }
  .skill-cat { padding: 24px 22px; }
  .skill-cat h3 { font-size: 17px; margin-bottom: 16px; }
  .skill-tags span { padding: 6px 12px; font-size: 12.5px; }

  /* Services */
  .services-grid { grid-template-columns: 1fr; gap: 18px; }
  .service-card { padding: 28px 22px; }
  .service-card h3 { font-size: 18px; }
  .service-card p { font-size: 14px; }

  /* Contact */
  .contact-item { padding: 18px; gap: 14px; }
  .contact-item > i { width: 44px; height: 44px; font-size: 16px; }
  .contact-item span { font-size: 12px; }
  .contact-item strong { font-size: 14px; }
  .contact-socials { padding: 16px; gap: 10px; }
  .contact-socials a { width: 40px; height: 40px; font-size: 15px; }
  .contact-form { padding: 24px 20px; }
  .form-group input, .form-group textarea { padding: 20px 14px 10px; font-size: 14px; }

  /* Footer */
  .footer-container { flex-direction: column; text-align: center; gap: 16px; }
  .footer p { font-size: 13px; order: 3; }
}

/* ----- Small Mobile (480px and below) ----- */
@media (max-width: 480px) {
  .container { padding: 0 14px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat-card { padding: 20px 12px; }
  .stat-number { font-size: 28px; }
  .stat-label { font-size: 12px; }

  .form-row { grid-template-columns: 1fr; gap: 14px; }

  .hero-title { font-size: 32px; }
  .hero-name { font-size: 1em; }
  .hero-subtitle { font-size: 15px; }

  .avatar-wrap { width: 220px; height: 220px; }
  .float-chip { display: none !important; }

  .nav-links { width: 88%; padding-top: 90px; }

  /* Compact buttons */
  .btn { padding: 12px 20px; font-size: 13.5px; }
  .scroll-indicator { display: none; }
}

@media (max-width: 360px) {
  .hero-actions { flex-direction: column; width: 100%; }
  .hero-actions .btn { width: 100%; }
}

/* Landscape mobile — keep things compact */
@media (max-height: 500px) and (orientation: landscape) {
  .hero { padding: 90px 0 40px; }
  .scroll-indicator { display: none; }
  .mascot-wrap { width: 70px; }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
