/* ==========================================================================
   Personal site stylesheet (shared by every profile)
   Colours come from the profile: --accent, --accent-2, --accent-3 and their
   RGB versions are set in each page's <head>.
   ========================================================================== */

/* 1. Tokens
   ========================================================================== */
:root {
  --bg: #05060a;
  --ink: #eef1f7;
  --mute: #8a90a3;
  --line: rgba(255, 255, 255, 0.08);
  --glass: rgba(12, 14, 21, 0.84);
  --wa: #25d366;

  --accent: #5ef2ff;
  --accent-2: #8b5cff;
  --accent-3: #ff5ec4;
  --accent-rgb: 94, 242, 255;
  --accent-2-rgb: 139, 92, 255;

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --pad-x: 5vw;
  --radius-lg: 26px;
  --radius-md: 20px;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* 2. Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body.menu-open { overflow: hidden; }
::selection { background: var(--accent); color: #000; }
h1, h2, h3 { font-family: var(--font-display); }
a { color: inherit; }
img, svg { display: block; }
.sr-only {
  position: absolute !important; width: 1px !important; height: 1px !important;
  margin: -1px !important; padding: 0 !important; border: 0 !important;
  overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important;
}

/* 3. Background layers
   ========================================================================== */
#scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: block;
  background:
    radial-gradient(60% 50% at 70% 40%, rgba(var(--accent-2-rgb), 0.16), transparent 70%),
    radial-gradient(40% 40% at 25% 70%, rgba(var(--accent-rgb), 0.06), transparent 70%);
}
html[dir="rtl"] #scene {
  background:
    radial-gradient(60% 50% at 30% 40%, rgba(var(--accent-2-rgb), 0.16), transparent 70%),
    radial-gradient(40% 40% at 75% 70%, rgba(var(--accent-rgb), 0.06), transparent 70%);
}
.noise {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, 0.7));
}
.site-header, main, .footer, .marquee { position: relative; z-index: 2; }

/* 4. Loader, progress, cursor
   ========================================================================== */
.loader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 22px;
  background: var(--bg);
  transition: opacity 0.8s 0.2s, visibility 0.8s 0.2s;
}
.loader.is-done { opacity: 0; visibility: hidden; }
.loader__mark {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 700;
  letter-spacing: -0.04em;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.loader__bar { width: 120px; height: 2px; overflow: hidden; border-radius: 2px; background: var(--line); }
.loader__bar span {
  display: block;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  animation: load 1.1s var(--ease-out) infinite;
}

.progress {
  position: fixed;
  top: 0;
  inset-inline-start: 0;
  z-index: 60;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
}

.cursor, .cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
}
.cursor {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(var(--accent-rgb), 0.6);
  transition: width 0.25s, height 0.25s, background 0.25s, border-color 0.25s;
}
.cursor.is-active { width: 80px; height: 80px; background: rgba(var(--accent-rgb), 0.12); border-color: var(--accent); }
.cursor-dot { width: 5px; height: 5px; background: var(--accent); }
@media (hover: none) { .cursor, .cursor-dot { display: none; } }

/* 5. Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 26px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.3s, background 0.3s, color 0.3s, border-color 0.3s;
  will-change: transform;
}
.btn__icon { width: 18px; height: 18px; flex: none; }
.btn--primary { background: var(--ink); color: var(--bg); }
.btn--primary:hover { box-shadow: 0 0 0 6px rgba(var(--accent-rgb), 0.15), 0 10px 40px rgba(var(--accent-rgb), 0.35); }
.btn--ghost { color: var(--ink); background: rgba(255, 255, 255, 0.03); border-color: rgba(255, 255, 255, 0.18); }
.btn--ghost:hover { color: var(--accent); border-color: var(--accent); }
.btn--wa { background: var(--wa); color: #04130a; }
.btn--wa:hover { box-shadow: 0 0 0 6px rgba(37, 211, 102, 0.15), 0 10px 40px rgba(37, 211, 102, 0.35); }
.btn--sm { padding: 10px 18px; font-size: 14px; }
.btn[disabled] { opacity: 0.6; cursor: wait; }

/* 6. Header & navigation
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0;
  inset-inline: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px var(--pad-x);
  border-bottom: 1px solid transparent;
  transition: background 0.4s, padding 0.4s, border-color 0.4s;
}
.site-header.is-scrolled { padding-block: 14px; background: rgba(5, 6, 10, 0.92); border-bottom-color: var(--line); }

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.logo__mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  font-size: 14px;
  letter-spacing: 0;
  color: var(--ink);
  isolation: isolate;
  overflow: hidden;
}
.logo__mark::before {
  content: "";
  position: absolute;
  inset: -40%;
  z-index: -2;
  background: conic-gradient(from 200deg, var(--accent), var(--accent-2), var(--accent-3), var(--accent));
  animation: spin 8s linear infinite;
}
.logo__mark::after {
  content: "";
  position: absolute;
  inset: 2px;
  z-index: -1;
  border-radius: 9px;
  background: var(--bg);
}
.logo__dot { color: var(--accent); }

.nav { display: flex; gap: 34px; }
.nav a { position: relative; font-size: 15px; color: var(--mute); text-decoration: none; transition: color 0.3s; }
.nav a::after {
  content: "";
  position: absolute;
  bottom: -4px;
  inset-inline-start: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.35s;
}
.nav a:hover { color: var(--ink); }
.nav a:hover::after { width: 100%; }

.header-actions { display: flex; align-items: center; gap: 12px; }

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.1), rgba(var(--accent-2-rgb), 0.1));
  color: var(--ink);
  font-family: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, var(--font-display), sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.lang-toggle svg { width: 18px; height: 18px; color: var(--accent); transition: transform 0.6s var(--ease-out); }
.lang-toggle:hover { border-color: var(--accent); box-shadow: 0 0 0 5px rgba(var(--accent-rgb), 0.08); }
.lang-toggle:hover svg { transform: rotate(180deg); }
.lang-toggle__label:lang(en) { font-family: var(--font-display); }

.menu-toggle {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}
.menu-toggle span {
  position: absolute;
  left: 12px;
  right: 12px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.3s, top 0.3s;
}
.menu-toggle span:nth-child(1) { top: 17px; }
.menu-toggle span:nth-child(2) { top: 25px; }
.menu-open .menu-toggle span:nth-child(1) { top: 21px; transform: rotate(45deg); }
.menu-open .menu-toggle span:nth-child(2) { top: 21px; transform: rotate(-45deg); }

.section-dots {
  position: fixed;
  top: 50%;
  right: 3vw;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transform: translateY(-50%);
}
.section-dots a { display: block; width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, 0.2); transition: all 0.3s; }
.section-dots a.is-active { height: 26px; border-radius: 6px; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
html[dir="rtl"] .section-dots { right: auto; left: 3vw; }

@media (max-width: 860px) {
  .site-header { padding: 14px 20px; }
  .site-header.is-scrolled { background: #05060a; }
  .header-cta { display: none; }
  .header-actions { margin-inline-start: auto; }
  .menu-toggle { display: block; z-index: 3; width: 42px; height: 42px; }
  .lang-toggle { height: 42px; padding: 0 14px; }
  .menu-toggle span:nth-child(1) { top: 16px; }
  .menu-toggle span:nth-child(2) { top: 24px; }
  .menu-open .menu-toggle span:nth-child(1),
  .menu-open .menu-toggle span:nth-child(2) { top: 20px; }
  .section-dots { display: none; }
  .nav {
    position: fixed;
    inset: 0;
    z-index: 2;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 28px;
    background: rgba(5, 6, 10, 0.97);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s, visibility 0.4s;
  }
  .nav a { font-family: var(--font-display); font-size: 32px; color: var(--ink); }
  .menu-open .nav { opacity: 1; visibility: visible; }
}

/* 7. Sections & typography
   ========================================================================== */
.section {
  min-height: 100vh;
  padding: 140px var(--pad-x) 100px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  margin-bottom: 22px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.3em;
  color: var(--accent);
}
.eyebrow::before { content: ""; width: 34px; height: 1px; background: currentColor; }
.title {
  max-width: 16ch;
  font-size: clamp(34px, 5.2vw, 72px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.035em;
}
.lead {
  max-width: 58ch;
  margin-top: 22px;
  font-size: clamp(16px, 1.3vw, 19px);
  font-weight: 300;
  color: var(--mute);
}
.accent {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; list-style: none; }
.chips li {
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  font-family: var(--font-mono);
  font-size: 12px;
}

/* 8. Hero
   ========================================================================== */
.hero { position: relative; align-items: flex-start; padding-top: 120px; }
.hero__content { max-width: 860px; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  padding: 7px 16px 7px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 13px;
  color: var(--mute);
}
.badge__dot {
  width: 8px;
  height: 8px;
  margin-inline-start: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  animation: pulse 1.6s infinite;
}
.hero__hello { font-family: var(--font-mono); font-size: 15px; letter-spacing: 0.08em; color: var(--accent); }
.hero__name {
  margin-top: 6px;
  font-size: clamp(42px, 6.3vw, 100px);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.05em;
}
.hero__title {
  max-width: 22ch;
  margin-top: 18px;
  font-family: var(--font-display);
  font-size: clamp(22px, 2.6vw, 38px);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.hero__lead {
  max-width: 56ch;
  margin-top: 22px;
  font-size: clamp(16px, 1.4vw, 20px);
  font-weight: 300;
  color: var(--mute);
}
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 38px; }
.scroll-hint {
  position: absolute;
  bottom: 34px;
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--mute);
}
.scroll-hint__line { width: 1px; height: 50px; background: linear-gradient(var(--accent), transparent); animation: drop 2s infinite; }
@media (max-height: 820px) { .scroll-hint { display: none; } }

/* 9. Marquee
   ========================================================================== */
.marquee {
  overflow: hidden;
  padding: 22px 0;
  border-block: 1px solid var(--line);
  background: rgba(5, 6, 10, 0.82);
}
.marquee__track {
  display: flex;
  gap: 48px;
  width: max-content;
  font-family: var(--font-mono);
  font-size: 15px;
  white-space: nowrap;
  animation: marquee 40s linear infinite;
}
.marquee__track i { font-style: normal; color: var(--accent); }

/* 10. Glow cards (shared)
   ========================================================================== */
.glow-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--glass);
  transform-style: preserve-3d;
  transition: transform 0.15s ease-out, border-color 0.4s;
}
.glow-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(var(--accent-rgb), 0.12), transparent 45%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}
.glow-card:hover { border-color: rgba(var(--accent-rgb), 0.35); }
.glow-card:hover::before { opacity: 1; }
.glow-card > * { position: relative; z-index: 1; }

/* 11. About
   ========================================================================== */
.about {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 60px;
  align-items: start;
  margin-top: 16px;
}
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 26px; }
.fact {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px 22px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--glass);
  transition: border-color 0.3s, transform 0.3s var(--ease-out);
}
.fact:hover { border-color: rgba(var(--accent-rgb), 0.35); transform: translateY(-3px); }
.fact__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}
.fact__value { font-family: var(--font-display); font-size: 19px; font-weight: 600; line-height: 1.3; }
@media (max-width: 960px) {
  .about { grid-template-columns: 1fr; gap: 10px; }
}

/* 12. Expertise
   ========================================================================== */
.skills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 56px;
  perspective: 1200px;
}
.skill { padding: 32px 28px; }
.skill__icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 22px;
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.14), rgba(var(--accent-2-rgb), 0.12));
  color: var(--accent);
}
.skill__icon svg { width: 26px; height: 26px; }
.skill h3 { font-size: 22px; font-weight: 600; line-height: 1.25; letter-spacing: -0.02em; }
.skill p { margin-top: 12px; font-size: 15px; font-weight: 300; color: var(--mute); }
@media (max-width: 1000px) { .skills { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .skills { grid-template-columns: 1fr; } }

/* 13. Approach & terminal
   ========================================================================== */
.approach { display: grid; grid-template-columns: 1fr 1.1fr; gap: 60px; align-items: center; margin-top: 20px; }
.steps { display: grid; gap: 4px; list-style: none; }
.step {
  display: flex;
  align-items: baseline;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.step__no { min-width: 28px; font-family: var(--font-mono); font-size: 13px; color: var(--accent); }
.step h3 { font-size: 20px; font-weight: 600; }
.step p { font-size: 15px; font-weight: 300; color: var(--mute); }

.terminal {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(6, 8, 12, 0.95);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(var(--accent-rgb), 0.06);
  transform: perspective(1200px) rotateY(-10deg) rotateX(4deg);
  transition: transform 0.6s;
}
.terminal:hover { transform: perspective(1200px); }
html[dir="rtl"] .terminal { transform: perspective(1200px) rotateY(10deg) rotateX(4deg); }
html[dir="rtl"] .terminal:hover { transform: perspective(1200px); }
.terminal__bar { display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.terminal__bar i { width: 11px; height: 11px; border-radius: 50%; }
.terminal__bar i:nth-child(1) { background: #ff5f57; }
.terminal__bar i:nth-child(2) { background: #febc2e; }
.terminal__bar i:nth-child(3) { background: #28c840; }
.terminal__bar span { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--mute); }
.terminal__body {
  min-height: 360px;
  padding: 24px 26px;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.9;
  white-space: pre-wrap;
  color: #c9d1e3;
}
.t-prompt { color: var(--accent); }
.t-flag { color: var(--accent-2); }
.t-ok { color: #7ee787; }
.t-warn { color: #febc2e; }
.t-dim { color: var(--mute); }
.caret { display: inline-block; width: 8px; height: 16px; vertical-align: middle; background: var(--accent); animation: pulse 1s steps(1) infinite; }
@media (max-width: 960px) {
  .approach { grid-template-columns: 1fr; }
  .terminal, html[dir="rtl"] .terminal { transform: none; }
}

/* 14. Work
   ========================================================================== */
.work { margin-top: 50px; list-style: none; border-top: 1px solid var(--line); }
.work-item {
  position: relative;
  display: grid;
  grid-template-columns: 60px minmax(0, 1.2fr) minmax(0, 1fr) 130px;
  align-items: center;
  gap: 30px;
  padding: 34px 26px;
  border-bottom: 1px solid var(--line);
  isolation: isolate;
}
.work-item::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.08), rgba(var(--accent-2-rgb), 0.05) 55%, transparent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s var(--ease-out);
}
.work-item::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  inset-inline-start: 0;
  width: 2px;
  background: linear-gradient(var(--accent), var(--accent-2));
  transform: scaleY(0);
  transition: transform 0.5s var(--ease-out);
}
.work-item:hover::before { transform: scaleX(1); }
.work-item:hover::after { transform: scaleY(1); }
html[dir="rtl"] .work-item::before {
  transform-origin: right;
  background: linear-gradient(270deg, rgba(var(--accent-rgb), 0.08), rgba(var(--accent-2-rgb), 0.05) 55%, transparent);
}
.work-item__no { font-family: var(--font-mono); font-size: 13px; color: var(--mute); transition: color 0.3s; }
.work-item:hover .work-item__no { color: var(--accent); }
.work-item__cat { margin-bottom: 8px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.22em; color: var(--accent); }
.work-item h3 { font-size: clamp(22px, 2.4vw, 34px); font-weight: 600; line-height: 1.1; letter-spacing: -0.03em; transition: transform 0.5s var(--ease-out); }
.work-item:hover h3 { transform: translateX(10px); }
html[dir="rtl"] .work-item:hover h3 { transform: translateX(-10px); }
.work-item__desc { font-size: 15.5px; font-weight: 300; color: var(--mute); }
.work-item__desc strong { font-weight: 500; color: var(--ink); }
.work-item__stat { text-align: end; }
.work-item__stat b {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(36px, 3.6vw, 52px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.work-item__stat small {
  display: block;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mute);
}
.work__more {
  width: fit-content;
  margin-top: 34px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.4);
  transition: border-color 0.3s;
}
.work__more:hover { border-color: var(--accent); }
@media (max-width: 1000px) {
  .work-item { grid-template-columns: 50px 1fr 110px; gap: 18px 22px; }
  .work-item__desc { grid-column: 2 / -1; grid-row: 2; }
}
@media (max-width: 640px) {
  .work-item { grid-template-columns: 1fr auto; padding: 28px 6px; }
  .work-item__no { grid-column: 1 / -1; }
  .work-item__main { grid-column: 1; }
  .work-item__stat { grid-column: 2; grid-row: 2; }
  .work-item__desc { grid-column: 1 / -1; grid-row: 3; }
  .work-item:hover h3, html[dir="rtl"] .work-item:hover h3 { transform: none; }
}

/* 15. Contact
   ========================================================================== */
#contact .title { max-width: 18ch; }
.contact {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 40px;
  align-items: start;
  margin-top: 50px;
}
.contact-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 30px;
}
.field { display: flex; flex-direction: column; gap: 8px; }
.field--full { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 500; color: var(--mute); }
.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  background: rgba(10, 12, 18, 0.9);
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.1); }
.contact-form textarea { min-height: 130px; resize: vertical; }
.contact-form select option { background: #0b0d14; }
html[dir="rtl"] .contact-form input[dir="ltr"] { text-align: right; }
.contact-form__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }
.form-note { min-height: 22px; font-size: 14px; color: var(--accent); }
.form-note.is-error { color: #ff6b6b; }

.channels-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--mute);
}
.channels-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.channels { display: grid; gap: 12px; list-style: none; }
.channel {
  --ch: var(--accent);
  --ch-rgb: var(--accent-rgb);
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(10, 12, 18, 0.9);
  text-decoration: none;
  transition: border-color 0.35s, transform 0.35s var(--ease-out), box-shadow 0.35s;
}
.channel--wa { --ch: var(--wa); --ch-rgb: 37, 211, 102; }
.channel::before {
  content: "";
  position: absolute;
  top: -50px;
  inset-inline-end: -50px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--ch-rgb), 0.14), transparent 70%);
  pointer-events: none;
}
.channel:hover { transform: translateY(-3px); border-color: rgba(var(--ch-rgb), 0.45); box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45); }
.channel__link { position: absolute; inset: 0; z-index: 1; }
.channel__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(var(--ch-rgb), 0.35);
  border-radius: 13px;
  background: rgba(var(--ch-rgb), 0.12);
  color: var(--ch);
}
.channel__icon svg { width: 21px; height: 21px; }
.channel__icon--aisec { background: conic-gradient(from 200deg, #5ef2ff, #8b5cff, #b6ff5e, #5ef2ff); border: 0; position: relative; }
.channel__icon--aisec::after { content: ""; position: absolute; inset: 12px; border-radius: 5px; background: #0a0c12; }
.channel__body { display: flex; flex-direction: column; min-width: 0; }
.channel__label { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--mute); }
.channel__value { font-family: var(--font-display); font-size: 18px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.channel__note { font-size: 12.5px; color: var(--mute); }
.copy-btn {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-inline-start: auto;
  padding: 8px 13px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.25s, color 0.25s;
}
.copy-btn svg { width: 15px; height: 15px; }
.copy-btn:hover { border-color: rgba(255, 255, 255, 0.3); }
.copy-btn.is-copied { border-color: var(--accent); color: var(--accent); }
@media (max-width: 1000px) {
  .contact { grid-template-columns: 1fr; }
}

/* 16. Floating WhatsApp & footer
   ========================================================================== */
.wa-float {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 70;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--wa);
  color: #04130a;
  box-shadow: 0 10px 30px rgba(37, 211, 102, 0.4);
  transition: transform 0.3s;
}
.wa-float svg { width: 28px; height: 28px; }
.wa-float:hover { transform: scale(1.1); }
.wa-float::after { content: ""; position: absolute; inset: 0; border: 2px solid var(--wa); border-radius: 50%; animation: ping 2s infinite; }
html[dir="rtl"] .wa-float { right: auto; left: 24px; }

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  padding: 34px var(--pad-x);
  border-top: 1px solid var(--line);
  background: rgba(5, 6, 10, 0.92);
  font-size: 13px;
  color: var(--mute);
}
.footer a { text-decoration: none; font-family: "Space Grotesk", system-ui, sans-serif; }
.c-ai { color: #5ef2ff; }
.c-sec { color: #b6ff5e; }

/* 17. Reveal & keyframes
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1s var(--ease-out), transform 1s var(--ease-out);
  transition-delay: var(--d, 0s);
}
.reveal.is-visible { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }
.no-js .loader { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: 0.3; } }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes ping { to { transform: scale(1.6); opacity: 0; } }
@keyframes load { from { transform: translateX(-110%); } to { transform: translateX(260%); } }
@keyframes drop {
  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; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}

/* 18. Arabic / right-to-left
   ========================================================================== */
html[lang="ar"] {
  --font-ar: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --font-display: var(--font-ar);
  --font-body: var(--font-ar);
}
html[lang="ar"] :is(.eyebrow, .work-item__cat, .channel__label, .channels-divider, .work-item__stat small,
  .fact__label, .scroll-hint, .hero__hello, .hero__name, .hero__title, .title, h3, .lang-toggle) {
  font-family: var(--font-ar);
  letter-spacing: 0;
  text-transform: none;
}
html[lang="ar"] .eyebrow { font-size: 14px; font-weight: 500; }
html[lang="ar"] .work-item__cat,
html[lang="ar"] .fact__label { font-size: 13px; font-weight: 600; }
html[lang="ar"] :is(.channel__label, .channels-divider, .work-item__stat small) { font-size: 13px; }
html[lang="ar"] .hero__hello { font-size: 17px; }
html[lang="ar"] .hero__name { line-height: 1.25; }
html[lang="ar"] .hero__title { line-height: 1.5; }
html[lang="ar"] .title { line-height: 1.35; max-width: 18ch; }
html[lang="ar"] .work-item h3,
html[lang="ar"] .skill h3 { line-height: 1.45; }
html[lang="ar"] :is(.lead, .hero__lead, .skill p, .work-item__desc, .step p) { line-height: 1.9; font-weight: 400; }

/* 19. Mobile polish
   ========================================================================== */
@media (max-width: 640px) {
  :root { --pad-x: 20px; }
  .section { min-height: auto; padding: 96px var(--pad-x) 56px; }
  .hero { min-height: 100vh; min-height: 100svh; padding-top: 100px; justify-content: flex-end; padding-bottom: 70px; }
  .lead, .hero__lead { color: #a9afc0; text-shadow: 0 1px 14px rgba(5, 6, 10, 0.95), 0 0 2px rgba(5, 6, 10, 0.9); }
  .hero__name, .hero__title, .title { text-shadow: 0 2px 24px rgba(5, 6, 10, 0.85); }
  .hero__cta .btn { flex: 1 1 auto; }
  .scroll-hint { display: none; }
  .eyebrow { letter-spacing: 0.2em; }
  .facts { grid-template-columns: 1fr 1fr; gap: 10px; }
  .fact { padding: 16px; }
  .fact__value { font-size: 16px; }
  .skills { margin-top: 36px; gap: 14px; }
  .skill { padding: 26px 22px; }
  .work { margin-top: 34px; }
  .work-item__cat { letter-spacing: 0.14em; }
  .terminal__body { min-height: 250px; padding: 18px 16px; font-size: 10.5px; line-height: 1.8; white-space: pre; overflow-x: auto; }
  .terminal__bar { padding: 12px 14px; }
  .terminal__bar span { font-size: 10px; }
  .contact { margin-top: 32px; }
  .contact-form { grid-template-columns: 1fr; padding: 22px 18px; }
  .contact-form__actions .btn { flex: 1 1 auto; }
  .channel { padding: 16px; }
  .wa-float { width: 50px; height: 50px; right: 16px; bottom: 16px; }
  .wa-float svg { width: 24px; height: 24px; }
  html[dir="rtl"] .wa-float { right: auto; left: 16px; }
  .footer { padding: 26px var(--pad-x) 84px; }
}

/* 20. Touch & small-screen polish
   ========================================================================== */

/* Phones have no hover: stop effects sticking after a tap, give press feedback instead. */
@media (hover: none) {
  .channel:hover, .fact:hover { transform: none; box-shadow: none; border-color: var(--line); }
  .channel--wa:hover { border-color: var(--line); }
  .glow-card:hover { border-color: var(--line); }
  .glow-card:hover::before { opacity: 0; }
  .work-item:hover::before { transform: scaleX(0); }
  .work-item:hover::after { transform: scaleY(0); }
  .work-item:hover h3, html[dir="rtl"] .work-item:hover h3 { transform: none; }
  .work-item:hover .work-item__no { color: var(--mute); }
  .btn--ghost:hover { color: var(--ink); border-color: rgba(255, 255, 255, 0.18); }
  .btn--primary:hover, .btn--wa:hover { box-shadow: none; }
  .lang-toggle:hover { box-shadow: none; }
  .lang-toggle:hover svg { transform: none; }
  .wa-float:hover { transform: none; }
  .btn:active, .lang-toggle:active, .menu-toggle:active, .copy-btn:active, .wa-float:active { transform: scale(0.96); }
  .channel:active, .fact:active { transform: scale(0.985); }
}

@media (max-width: 640px) {
  /* iOS zooms into any field under 16px; keep them at 16 */
  .contact-form input, .contact-form select, .contact-form textarea { font-size: 16px; padding: 14px 16px; }
  .field label { font-size: 14px; }

  /* Comfortable finger targets (44px) */
  .logo { min-height: 44px; }
  .work__more { display: inline-flex; align-items: center; min-height: 44px; border-bottom: 0; text-decoration: underline; text-underline-offset: 6px; text-decoration-color: rgba(var(--accent-rgb), 0.5); }
  .copy-btn { min-height: 44px; padding: 0 14px; }
  .footer a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; font-size: 15px; }
  .footer { align-items: center; }
  .btn { min-height: 50px; }

  /* Small labels readable */
  .fact__label, .work-item__cat, .channel__label, .channels-divider { font-size: 12px; letter-spacing: 0.14em; }
  .work-item__stat small { font-size: 11.5px; letter-spacing: 0.12em; }
  .terminal__bar span { font-size: 11px; }
  .badge { font-size: 12.5px; }
  .channel__note { font-size: 13px; }

  /* Menu: big, centred, easy to tap */
  .nav a { padding: 6px 18px; }

  /* Floating WhatsApp clears the iPhone home bar */
  .wa-float { bottom: calc(16px + env(safe-area-inset-bottom)); }
}

/* Narrow phones (iPhone SE / small Android): keep the header on one line */
@media (max-width: 380px) {
  .site-header { padding-inline: 16px; gap: 10px; }
  .logo__name { display: none; }
  .logo { min-width: 44px; justify-content: center; }
  .header-actions { gap: 8px; }
  .lang-toggle { padding: 0 12px; font-size: 14px; }
  :root { --pad-x: 18px; }
  .facts { grid-template-columns: 1fr; }
  .contact-form { padding: 20px 16px; }
}

/* Short screens (iPhone SE, landscape): the whole hero, buttons included, fits the first screen */
@media (max-width: 640px) and (max-height: 700px) {
  .hero { padding-top: 84px; padding-bottom: 28px; }
  .badge { margin-bottom: 14px; }
  .hero__hello { font-size: 13px; }
  .hero__name { font-size: 38px; }
  .hero__title { margin-top: 10px; font-size: 20px; }
  .hero__lead { margin-top: 12px; font-size: 15px; line-height: 1.6; }
  html[lang="ar"] .hero__lead { line-height: 1.75; }
  .hero__cta { margin-top: 20px; gap: 10px; }
  .hero__cta .btn { min-height: 46px; padding: 10px 18px; }
}

/* Landscape phones */
@media (max-height: 500px) and (orientation: landscape) {
  .hero { min-height: auto; padding-top: 90px; padding-bottom: 40px; }
  .section { min-height: auto; }
  .scroll-hint { display: none; }
}

/* 21. Floating WhatsApp, menu layering, email card
   ========================================================================== */
.wa-float { transition: transform 0.3s, opacity 0.35s, visibility 0.35s; }
body:not(.past-hero) .wa-float,
body.menu-open .wa-float { opacity: 0; visibility: hidden; transform: translateY(20px); pointer-events: none; }

/* The language button stays usable above the open menu */
.lang-toggle { position: relative; z-index: 3; }

@media (max-width: 640px) {
  .channel__value--email { font-size: 16.5px; line-height: 1.35; }
  .copy-btn { width: 44px; padding: 0; justify-content: center; flex: none; }
  .copy-btn .js-copy-label { display: none; }
  .copy-btn svg { width: 18px; height: 18px; }
}

/* Narrow phones: the copy button moves to the card's corner so a long email fits on its line */
@media (max-width: 380px) {
  .channel { gap: 14px; }
  .channel__icon { width: 42px; height: 42px; }
  .copy-btn { position: absolute; top: 8px; inset-inline-end: 8px; width: 44px; height: 44px; min-height: 44px; }
  .channel__value--email { font-size: 15px; }
}
html[dir="rtl"] .channel__value { text-align: right; }
