/* =========================================================
   Majed Tello · Portfolio
   Base color: Steel Blue (#4682B4)
   ========================================================= */

:root {
  --steel: #4682b4;
  --steel-50: #f0f6fb;
  --steel-100: #dce9f4;
  --steel-200: #b9d3ea;
  --steel-300: #8db7dc;
  --steel-400: #6299c9;
  --steel-500: #4682b4;
  --steel-600: #386a95;
  --steel-700: #2d5577;
  --steel-800: #22405a;
  --steel-900: #172b3d;

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Space Grotesk", var(--font-sans);
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;

  --radius: 18px;
  --radius-sm: 12px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --header-h: 72px;
}

/* ---------- Light theme ---------- */
:root[data-theme="light"] {
  --bg: #f4f7fb;
  --bg-alt: #eaf1f8;
  --surface: #ffffff;
  --surface-2: #f6f9fc;
  --text: #0f1d2c;
  --text-soft: #34475c;
  --muted: #5d7085;
  --border: rgba(70, 130, 180, .18);
  --border-strong: rgba(70, 130, 180, .35);
  --primary: #3c78a8;
  --primary-strong: #2d5f8a;
  --primary-soft: rgba(70, 130, 180, .12);
  --accent: #5fa3d6;
  --glow: rgba(70, 130, 180, .28);
  --shadow: 0 1px 2px rgba(23, 43, 61, .05), 0 12px 32px -12px rgba(23, 43, 61, .16);
  --shadow-lg: 0 30px 60px -20px rgba(34, 64, 90, .28);
  --header-bg: rgba(244, 247, 251, .72);
  --grid-line: rgba(70, 130, 180, .08);
  color-scheme: light;
}

/* ---------- Dark theme ---------- */
:root[data-theme="dark"] {
  --bg: #08111b;
  --bg-alt: #0b1724;
  --surface: #0f1d2b;
  --surface-2: #132435;
  --text: #e8f0f8;
  --text-soft: #c2d1e0;
  --muted: #8ea3b9;
  --border: rgba(141, 183, 220, .12);
  --border-strong: rgba(141, 183, 220, .28);
  --primary: #6fa6d6;
  --primary-strong: #4682b4;
  --primary-soft: rgba(70, 130, 180, .16);
  --accent: #9cc8ec;
  --glow: rgba(70, 130, 180, .45);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 14px 36px -14px rgba(0, 0, 0, .6);
  --shadow-lg: 0 30px 70px -20px rgba(0, 0, 0, .7);
  --header-bg: rgba(8, 17, 27, .7);
  --grid-line: rgba(141, 183, 220, .05);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 8px); }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .5s var(--ease), color .5s var(--ease);
}
html[dir="rtl"] body { font-family: "Cairo", var(--font-sans); }
html[dir="rtl"] .section__title,
html[dir="rtl"] .hero__name,
html[dir="rtl"] h3 { font-family: "Cairo", var(--font-head); letter-spacing: 0 !important; }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
::selection { background: var(--steel); color: #fff; }

.container { width: min(1200px, 100% - 40px); margin-inline: auto; }

.ic {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
html[dir="rtl"] .flip-rtl { transform: scaleX(-1); }

.gradient-text {
  background: linear-gradient(110deg, var(--steel-300) 0%, var(--steel) 35%, var(--accent) 55%, var(--steel-600) 80%);
  background-size: 220% auto;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  animation: shine 7s linear infinite;
}
:root[data-theme="light"] .gradient-text {
  background-image: linear-gradient(110deg, var(--steel-700) 0%, var(--steel) 35%, var(--steel-400) 55%, var(--steel-800) 80%);
  background-size: 220% auto;
}
@keyframes shine { to { background-position: -220% center; } }

/* ---------- Preloader ---------- */
.preloader {
  position: fixed; inset: 0; z-index: 1000;
  display: grid; place-items: center;
  background: var(--bg);
  transition: opacity .6s var(--ease), visibility .6s;
}
.preloader.done { opacity: 0; visibility: hidden; }
.preloader__logo { position: relative; width: 110px; height: 110px; display: grid; place-items: center; }
.preloader__logo span {
  font: 700 30px var(--font-head); color: var(--primary); letter-spacing: .04em;
  animation: pulse 1.4s ease-in-out infinite;
}
.preloader__ring { position: absolute; inset: 0; width: 100%; height: 100%; animation: spin 1.4s linear infinite; }
.preloader__ring circle {
  fill: none; stroke: var(--steel); stroke-width: 4; stroke-linecap: round;
  stroke-dasharray: 200 400;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .45; transform: scale(.94); } }

/* ---------- Scroll progress & cursor glow ---------- */
.scroll-progress {
  position: fixed; top: 0; inset-inline-start: 0; height: 3px; width: 100%; z-index: 200;
  background: linear-gradient(90deg, var(--steel-600), var(--steel-300));
  transform-origin: left; transform: scaleX(0);
  box-shadow: 0 0 12px var(--glow);
}
html[dir="rtl"] .scroll-progress { transform-origin: right; }
.cursor-glow {
  position: fixed; top: 0; left: 0; z-index: 0; pointer-events: none;
  width: 520px; height: 520px; border-radius: 50%;
  background: radial-gradient(circle, var(--glow) 0%, transparent 65%);
  opacity: .35; transform: translate(-50%, -50%);
  transition: opacity .4s;
  will-change: transform;
}
@media (hover: none) { .cursor-glow { display: none; } }

/* ---------- Header ---------- */
.header {
  position: fixed; inset: 0 0 auto 0; z-index: 100; height: var(--header-h);
  transition: background .4s var(--ease), box-shadow .4s, border-color .4s, transform .4s var(--ease);
  border-bottom: 1px solid transparent;
}
.header.scrolled {
  background: var(--header-bg);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-color: var(--border);
}
.header.hidden { transform: translateY(-100%); }
.header__inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 20px; }

.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; }
.logo__mark {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  font: 700 15px var(--font-head); color: #fff; letter-spacing: .03em;
  background: linear-gradient(135deg, var(--steel-400), var(--steel-700));
  box-shadow: 0 6px 18px -6px var(--glow), inset 0 1px 0 rgba(255,255,255,.25);
  transition: transform .5s var(--ease);
}
.logo:hover .logo__mark { transform: rotate(-8deg) scale(1.06); }
.logo__text { font: 600 18px var(--font-head); direction: ltr; }
.logo__text b { color: var(--primary); }

.nav { display: flex; gap: 4px; }
.nav__link {
  position: relative; padding: 8px 14px; border-radius: 999px;
  font-size: 15px; font-weight: 500; color: var(--text-soft);
  transition: color .3s, background .3s;
}
.nav__link::after {
  content: ""; position: absolute; inset-inline: 14px; bottom: 4px; height: 2px; border-radius: 2px;
  background: var(--primary); transform: scaleX(0); transition: transform .4s var(--ease);
}
.nav__link:hover { color: var(--text); }
.nav__link.active { color: var(--primary); }
.nav__link.active::after, .nav__link:hover::after { transform: scaleX(1); }

.header__actions { display: flex; align-items: center; gap: 8px; }
.icon-btn, .pill-btn {
  height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-soft);
  transition: border-color .3s, color .3s, transform .3s var(--ease), background .3s;
}
.icon-btn { width: 40px; }
.pill-btn { padding: 0 14px; font-size: 14px; font-weight: 600; }
html[dir="rtl"] .pill-btn span { font-family: var(--font-sans); }
html[dir="ltr"] .pill-btn span { font-family: "Cairo", var(--font-sans); }
.icon-btn:hover, .pill-btn:hover { border-color: var(--border-strong); color: var(--primary); transform: translateY(-2px); }

.theme-toggle { position: relative; overflow: hidden; }
.theme-toggle .ic { position: absolute; transition: transform .6s var(--ease), opacity .4s; }
:root[data-theme="dark"] .ic-sun { transform: translateY(0) rotate(0); opacity: 1; }
:root[data-theme="dark"] .ic-moon { transform: translateY(150%) rotate(90deg); opacity: 0; }
:root[data-theme="light"] .ic-sun { transform: translateY(-150%) rotate(-90deg); opacity: 0; }
:root[data-theme="light"] .ic-moon { transform: translateY(0) rotate(0); opacity: 1; }

.burger { display: none; flex-direction: column; gap: 4px; }
.burger span { width: 16px; height: 2px; border-radius: 2px; background: currentColor; transition: transform .4s var(--ease), opacity .3s; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; gap: 10px;
  height: 50px; padding: 0 24px; border-radius: 999px;
  font-weight: 600; font-size: 15px; white-space: nowrap;
  transition: transform .35s var(--ease), box-shadow .35s, background .35s, border-color .35s, color .35s;
  overflow: hidden; isolation: isolate;
}
.btn--lg { height: 58px; padding: 0 32px; font-size: 16px; }
.btn--primary {
  color: #fff;
  background: linear-gradient(135deg, var(--steel-400), var(--steel-600));
  box-shadow: 0 10px 28px -10px var(--glow), inset 0 1px 0 rgba(255,255,255,.2);
}
.btn--primary::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(135deg, var(--steel-300), var(--steel-500));
  opacity: 0; transition: opacity .35s;
}
.btn--primary:hover::before { opacity: 1; }
.btn--primary:hover { box-shadow: 0 16px 36px -10px var(--glow); }
.btn--primary .ic { transition: transform .35s var(--ease); }
.btn--primary:hover .ic.flip-rtl { transform: translateX(4px); }
html[dir="rtl"] .btn--primary:hover .ic.flip-rtl { transform: scaleX(-1) translateX(4px); }
.btn--ghost { border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); }
.btn--ghost:hover { border-color: var(--primary); color: var(--primary); }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100svh; display: flex; align-items: center;
  padding: calc(var(--header-h) + 40px) 0 100px; overflow: hidden;
}
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.hero__grid {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%);
}
.hero__blob {
  position: absolute; z-index: 0; border-radius: 50%; filter: blur(80px); opacity: .55; pointer-events: none;
  animation: float 18s ease-in-out infinite;
}
.hero__blob--1 { width: 520px; height: 520px; background: var(--steel); top: -140px; inset-inline-end: -120px; opacity: .35; }
.hero__blob--2 { width: 420px; height: 420px; background: var(--steel-300); bottom: -160px; inset-inline-start: -120px; opacity: .22; animation-delay: -9s; }
:root[data-theme="light"] .hero__blob--1 { opacity: .22; }
:root[data-theme="light"] .hero__blob--2 { opacity: .3; }
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, 30px) scale(1.08); }
  66% { transform: translate(-30px, 20px) scale(.95); }
}

.hero__inner {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: 56px;
}

.badge-available {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 14px 7px 12px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--primary-soft);
  font-size: 13.5px; font-weight: 600; color: var(--primary);
  backdrop-filter: blur(8px);
}
.badge-available .dot {
  position: relative; width: 8px; height: 8px; border-radius: 50%; background: #34c38f;
}
.badge-available .dot::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: #34c38f;
  animation: ping 1.8s cubic-bezier(0, 0, .2, 1) infinite;
}
@keyframes ping { 75%, 100% { transform: scale(2.6); opacity: 0; } }

.hero__hello { margin: 26px 0 4px; font-size: 18px; color: var(--muted); font-weight: 500; }
.hero__name {
  margin: 0; font: 700 clamp(44px, 7.2vw, 88px)/1.02 var(--font-head);
  letter-spacing: -.035em;
}
html[dir="rtl"] .hero__name { line-height: 1.25; }
.hero__role {
  margin: 18px 0 0; min-height: 1.6em;
  font: 500 clamp(18px, 2.3vw, 24px) var(--font-mono); color: var(--text-soft);
  direction: ltr; text-align: start;
}
html[dir="rtl"] .hero__role { direction: rtl; font-family: "Cairo", var(--font-mono); font-weight: 600; }
.code-bracket { color: var(--primary); opacity: .8; }
.caret {
  display: inline-block; width: 2px; height: 1.05em; margin-inline: 2px 6px; vertical-align: -.15em;
  background: var(--primary); animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.hero__lead { margin: 22px 0 0; max-width: 580px; font-size: 18px; color: var(--text-soft); }
.hero__ctas { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.hero__socials { display: flex; gap: 10px; margin-top: 34px; }

.social {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-soft);
  transition: transform .35s var(--ease), color .3s, border-color .3s, box-shadow .3s;
}
.social svg { width: 20px; height: 20px; fill: currentColor; }
.social:hover { transform: translateY(-4px); color: var(--primary); border-color: var(--border-strong); box-shadow: 0 10px 24px -10px var(--glow); }

/* Portrait */
.hero__visual { display: grid; place-items: center; }
.portrait { position: relative; width: min(420px, 82vw); aspect-ratio: 1; }
.portrait__ring {
  position: absolute; inset: -6%; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 20%, var(--steel-300) 35%, var(--steel) 50%, transparent 65% 100%);
  mask: radial-gradient(circle, transparent 66.5%, #000 67%, #000 68.5%, transparent 69%);
  -webkit-mask: radial-gradient(circle, transparent 66.5%, #000 67%, #000 68.5%, transparent 69%);
  animation: spin 10s linear infinite;
}
.portrait__ring--2 {
  inset: -14%; opacity: .5; animation-duration: 16s; animation-direction: reverse;
  background: conic-gradient(from 90deg, transparent 0 40%, var(--accent) 55%, transparent 70% 100%);
}
.portrait__frame {
  position: absolute; inset: 0; border-radius: 50%; overflow: hidden;
  background: radial-gradient(circle at 50% 35%, var(--steel-500), var(--steel-800) 75%);
  box-shadow: 0 0 0 1px var(--border-strong), 0 30px 80px -20px var(--glow), inset 0 0 60px rgba(0,0,0,.25);
}
.portrait__frame img {
  position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%;
  transform: scale(1.12); transition: transform 1.2s var(--ease);
}
.portrait:hover .portrait__frame img { transform: scale(1.18); }
.portrait__frame.no-img img { display: none; }
.portrait__fallback {
  position: absolute; inset: 0; display: grid; place-items: center;
  font: 700 clamp(70px, 12vw, 120px) var(--font-head); color: rgba(255,255,255,.9); letter-spacing: .02em;
}

.orbit-chip {
  position: absolute; z-index: 2; display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: 12px;
  font: 600 13px var(--font-mono); color: var(--text); white-space: nowrap; unicode-bidi: isolate;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  animation: bob 6s ease-in-out infinite;
}
.chip-dot { width: 8px; height: 8px; border-radius: 3px; background: var(--steel); box-shadow: 0 0 10px var(--steel); }
.orbit-chip--1 { top: 6%; inset-inline-start: -8%; }
.orbit-chip--2 { top: 30%; inset-inline-end: -4%; animation-delay: -1.5s; }
.orbit-chip--3 { bottom: 16%; inset-inline-start: -14%; animation-delay: -3s; }
.orbit-chip--4 { bottom: 2%; inset-inline-end: 4%; animation-delay: -4.5s; }
@keyframes bob { 50% { transform: translateY(-12px); } }

.code-card {
  position: absolute; z-index: 3; bottom: -12%; inset-inline-start: -24%;
  width: 220px; border-radius: 14px; overflow: hidden;
  background: color-mix(in srgb, #0b1724 88%, transparent);
  border: 1px solid rgba(141, 183, 220, .25);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px);
  animation: bob 7s ease-in-out infinite; animation-delay: -2s;
  display: none;
}
.code-card__bar { direction: ltr; display: flex; gap: 6px; padding: 10px 12px; border-bottom: 1px solid rgba(141,183,220,.12); }
.code-card__bar i { width: 9px; height: 9px; border-radius: 50%; background: #ff5f57; }
.code-card__bar i:nth-child(2) { background: #febc2e; }
.code-card__bar i:nth-child(3) { background: #28c840; }
.code-card pre { direction: ltr; text-align: left; margin: 0; padding: 12px 14px 14px; font: 12px/1.6 var(--font-mono); color: #d6e4f0; }
.code-card .k { color: #8db7dc; } .code-card .t { color: #6fd3c1; }
.code-card .s { color: #e6c07b; } .code-card .n { color: #f78c6c; } .code-card .m { color: #c3a6ff; }
@media (min-width: 1280px) {
  .code-card { display: block; }
  .orbit-chip--2 { top: 42%; }
  .orbit-chip--3 { bottom: auto; top: 46%; inset-inline-start: -16%; }
}

.scroll-cue {
  position: absolute; z-index: 1; bottom: 28px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted);
}
.scroll-cue__mouse { width: 24px; height: 38px; border: 2px solid var(--border-strong); border-radius: 14px; display: flex; justify-content: center; padding-top: 6px; }
.scroll-cue__mouse span { width: 3px; height: 8px; border-radius: 3px; background: var(--primary); animation: wheel 1.8s ease-in-out infinite; }
@keyframes wheel { 0% { transform: translateY(0); opacity: 1; } 80% { transform: translateY(12px); opacity: 0; } 100% { opacity: 0; } }

/* ---------- Stats ---------- */
.stats { position: relative; z-index: 2; margin-top: -40px; }
.stats__grid {
  display: grid; grid-template-columns: repeat(5, 1fr);
  border-radius: var(--radius); overflow: hidden;
  background: var(--border); gap: 1px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}
.stat {
  padding: 30px 22px; text-align: center; background: var(--surface);
  transition: background .4s;
}
.stat:hover { background: var(--surface-2); }
.stat__value { font: 700 clamp(30px, 3.6vw, 42px)/1 var(--font-head); color: var(--primary); direction: ltr; display: inline-block; }
.stat__label { margin-top: 10px; font-size: 14px; color: var(--muted); font-weight: 500; }

/* ---------- Sections ---------- */
.section { position: relative; padding: 120px 0; }
.section--alt { background: var(--bg-alt); }
.section__head { max-width: 720px; margin-bottom: 56px; }
.section__head--center { margin-inline: auto; text-align: center; }
.kicker {
  display: inline-flex; align-items: center; gap: 10px;
  font: 600 13px var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--primary);
}
html[dir="rtl"] .kicker { font-family: "Cairo", var(--font-mono); letter-spacing: 0; font-size: 14px; }
.kicker::before { content: ""; width: 28px; height: 2px; border-radius: 2px; background: currentColor; }
.section__title {
  margin: 14px 0 0; font: 700 clamp(30px, 4.2vw, 48px)/1.12 var(--font-head); letter-spacing: -.025em;
}
.section__sub { margin: 16px 0 0; font-size: 18px; color: var(--muted); }
.sub-title {
  display: flex; align-items: center; gap: 14px;
  margin: 0 0 24px; font: 600 15px var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--text-soft);
}
html[dir="rtl"] .sub-title { font-family: "Cairo", var(--font-mono); letter-spacing: 0; font-size: 17px; }
.sub-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--border-strong), transparent); }
html[dir="rtl"] .sub-title::after { background: linear-gradient(-90deg, var(--border-strong), transparent); }
.sub-title:not(:first-of-type) { margin-top: 64px; }

/* ---------- Card base (with spotlight) ---------- */
.card {
  position: relative; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform .5s var(--ease), border-color .4s, box-shadow .5s;
  overflow: hidden;
}
.card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .4s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), var(--primary-soft), transparent 45%);
}
.card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-lg); }
.card:hover::before { opacity: 1; }
.card > * { position: relative; }

.icon-box {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; flex: none;
  color: var(--primary); background: var(--primary-soft); border: 1px solid var(--border);
  transition: transform .5s var(--ease), background .4s, color .4s;
}
.icon-box .ic { width: 24px; height: 24px; }
.card:hover .icon-box { transform: rotate(-6deg) scale(1.08); background: var(--steel); color: #fff; }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: 1fr 1.05fr; gap: 56px; align-items: start; }
.about__text p { margin: 0 0 18px; font-size: 17.5px; color: var(--text-soft); }
.info-list { list-style: none; margin: 30px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.info-list li {
  display: flex; flex-direction: column; gap: 2px; padding: 14px 16px;
  border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border);
}
.info-list span { font-size: 13px; color: var(--muted); }
.info-list b { font-weight: 600; font-size: 15px; }
.pillars { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.pillar { padding: 26px; }
.pillar:hover { transform: translateY(-6px); }
.pillar h3 { margin: 18px 0 8px; font: 600 19px var(--font-head); }
.pillar p { margin: 0; font-size: 15px; color: var(--muted); }

/* ---------- Skills ---------- */
.marquee {
  position: relative; overflow: hidden; margin-bottom: 48px; padding: 6px 0;
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  direction: ltr;
}
.marquee__track { display: flex; gap: 14px; width: max-content; animation: marquee 45s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__item {
  padding: 10px 20px; border-radius: 999px; white-space: nowrap;
  font: 500 14px var(--font-mono); color: var(--text-soft);
  background: var(--surface); border: 1px solid var(--border);
}
.marquee__item:nth-child(3n) { color: var(--primary); border-color: var(--border-strong); }
@keyframes marquee { to { transform: translateX(-50%); } }

.skills { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 20px; }
.skill-card { padding: 26px; }
.skill-card:hover { transform: translateY(-6px); }
.skill-card__head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.skill-card__head h3 { margin: 0; font: 600 18px var(--font-head); }
.skill-card__head small { display: block; color: var(--muted); font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 6px 12px; border-radius: 999px; font-size: 13.5px; font-weight: 500;
  color: var(--text-soft); background: var(--surface-2); border: 1px solid var(--border);
  transition: color .3s, border-color .3s, background .3s, transform .3s var(--ease);
}
.chip:hover { color: var(--primary); border-color: var(--border-strong); background: var(--primary-soft); transform: translateY(-2px); }

/* ---------- Timeline ---------- */
.timeline { position: relative; display: grid; gap: 28px; padding-inline-start: 56px; }
.timeline__line { position: absolute; top: 8px; bottom: 8px; inset-inline-start: 19px; width: 2px; background: var(--border); border-radius: 2px; }
.timeline__line span {
  position: absolute; top: 0; left: 0; width: 100%; height: 0;
  background: linear-gradient(var(--steel-300), var(--steel), var(--steel-600));
  box-shadow: 0 0 12px var(--glow); border-radius: 2px;
}
.job { position: relative; }
.job__dot {
  position: absolute; top: 28px; inset-inline-start: -46px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--border-strong); transition: border-color .5s, box-shadow .5s, background .5s;
}
.job.in .job__dot { border-color: var(--steel); background: var(--surface); box-shadow: 0 0 0 6px var(--primary-soft); }
.job--current .job__dot::after {
  content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid var(--steel);
  animation: ping 2s cubic-bezier(0, 0, .2, 1) infinite;
}
.job__card { padding: 30px; }
.job__card:hover { transform: translateX(6px); }
html[dir="rtl"] .job__card:hover { transform: translateX(-6px); }
.job__top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 20px; align-items: flex-start; }
.job__role { margin: 0; font: 600 22px var(--font-head); }
.job__company { margin-top: 4px; color: var(--primary); font-weight: 600; }
.job__company span { color: var(--muted); font-weight: 400; }
.job__period {
  padding: 6px 14px; border-radius: 999px; font: 500 13px var(--font-mono); white-space: nowrap;
  background: var(--primary-soft); color: var(--primary); border: 1px solid var(--border);
}
html[dir="rtl"] .job__period { font-family: "Cairo", var(--font-mono); }
.job__group { margin-top: 22px; }
.job__group h4 { margin: 0 0 10px; font-size: 14px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text); }
html[dir="rtl"] .job__group h4 { letter-spacing: 0; }
.job ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 9px; }
.job li { position: relative; padding-inline-start: 22px; color: var(--text-soft); font-size: 15.5px; }
.job li::before {
  content: ""; position: absolute; inset-inline-start: 2px; top: .72em; width: 8px; height: 8px; border-radius: 2px;
  background: var(--steel); transform: rotate(45deg); opacity: .8;
}
.job__tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.tag {
  padding: 4px 11px; border-radius: 8px; font: 500 12.5px var(--font-mono); direction: ltr;
  color: var(--primary); background: var(--primary-soft);
}
.job__toggle {
  margin-top: 18px; display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 600; color: var(--primary);
}
.job__toggle .ic { width: 16px; height: 16px; transition: transform .4s var(--ease); }
.job__more { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .6s var(--ease); }
.job__more > div { overflow: hidden; }
.job.open .job__more { grid-template-rows: 1fr; }
.job.open .job__toggle .ic { transform: rotate(180deg); }

/* ---------- Projects ---------- */
.key-projects { display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px; }
.kp { grid-column: span 2; padding: 26px; display: flex; flex-direction: column; }
.kp:nth-child(4), .kp:nth-child(5) { grid-column: span 3; }
.kp:hover { transform: translateY(-6px); }
.kp h4 { margin: 18px 0 8px; font: 600 18px/1.3 var(--font-head); }
.kp p { margin: 0 0 20px; font-size: 15px; color: var(--muted); flex: 1; }
.kp__metric { display: flex; align-items: baseline; gap: 10px; padding-top: 16px; border-top: 1px dashed var(--border-strong); }
.kp__metric b { font: 700 26px var(--font-head); color: var(--primary); direction: ltr; }
.kp__metric span { font-size: 13.5px; color: var(--muted); }

.projects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.project { display: flex; flex-direction: column; will-change: transform; }
.project__visual {
  position: relative; height: 150px; overflow: hidden; color: var(--primary);
  background:
    radial-gradient(120% 100% at 100% 0%, var(--primary-soft), transparent 60%),
    linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / 22px 22px,
    var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.project__visual::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 40%;
  background: linear-gradient(transparent, color-mix(in srgb, var(--surface) 70%, transparent));
}
.project__visual svg { position: absolute; inset: 0; width: 100%; height: 100%; transition: transform .9s var(--ease); }
.project:hover .project__visual svg { transform: scale(1.06); }
.pv-line { stroke: currentColor; stroke-opacity: .2; stroke-width: 1.5; }
.flow { stroke: currentColor; stroke-opacity: .7; stroke-width: 1.5; stroke-dasharray: 6 10; animation: dash 6s linear infinite; }
.project:hover .flow { animation-duration: 2s; }
.pv-node { fill: var(--surface); stroke: currentColor; stroke-width: 2; }
.pv-node--hub { fill: currentColor; }
.pv-pulse {
  fill: none; stroke: currentColor; stroke-width: 2;
  transform-box: fill-box; transform-origin: center;
  animation: node-pulse 2.4s ease-out infinite;
}
@keyframes dash { to { stroke-dashoffset: -160; } }
@keyframes node-pulse { from { transform: scale(1); opacity: .7; } to { transform: scale(2.6); opacity: 0; } }
.project__year {
  position: absolute; z-index: 1; top: 14px; inset-inline-end: 14px; padding: 4px 10px; border-radius: 8px;
  font: 600 12px var(--font-mono); color: var(--primary);
  background: var(--surface); border: 1px solid var(--border-strong);
}
.project__body { padding: 0 24px 24px; display: flex; flex-direction: column; flex: 1; }
.project__icon { margin-top: -26px; margin-bottom: 18px; z-index: 1; background: var(--surface); border-color: var(--border-strong); box-shadow: var(--shadow); }
.project__title { margin: 0; font: 700 24px var(--font-head); letter-spacing: -.02em; }
.project__subtitle { margin: 2px 0 14px; font-size: 14.5px; font-weight: 600; color: var(--primary); }
.project__body p { margin: 0 0 20px; font-size: 15px; color: var(--text-soft); flex: 1; }
.project__metric {
  display: flex; align-items: baseline; gap: 10px; margin-bottom: 18px; padding: 14px 0;
  border-top: 1px dashed var(--border-strong); border-bottom: 1px dashed var(--border-strong);
}
.project__metric b { font: 700 26px var(--font-head); color: var(--primary); direction: ltr; unicode-bidi: isolate; }
.project__metric span { font-size: 13.5px; color: var(--muted); }
.project__tech { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Work with me ---------- */
.engage { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.engage-card { padding: 30px; }
.engage-card:hover { transform: translateY(-6px); }
.engage-card h3 { margin: 20px 0 10px; font: 600 20px var(--font-head); }
.engage-card p { margin: 0; font-size: 15.5px; color: var(--muted); }
.engage-card__num {
  position: absolute; top: 18px; inset-inline-end: 22px;
  font: 700 44px/1 var(--font-head); color: var(--primary); opacity: .14;
  transition: opacity .4s, transform .5s var(--ease);
}
.engage-card:hover .engage-card__num { opacity: .3; transform: translateY(-4px); }
.about__note {
  padding: 14px 18px; border-radius: var(--radius-sm);
  border-inline-start: 3px solid var(--steel); background: var(--primary-soft);
  color: var(--text) !important; font-weight: 500;
}

/* ---------- Credentials ---------- */
.creds { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.cred { padding: 26px; }
.cred:hover { transform: translateY(-6px); }
.cred h3 { display: flex; align-items: center; gap: 12px; margin: 0 0 20px; font: 600 18px var(--font-head); }
.cred h3 .icon-box { width: 40px; height: 40px; border-radius: 12px; }
.cred h3 .icon-box .ic { width: 20px; height: 20px; }
.cred__item + .cred__item { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.cred__item b { display: block; font-weight: 600; font-size: 15.5px; }
.cred__item span { font-size: 14px; color: var(--muted); }
.cred__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.cred__list li { display: flex; gap: 10px; font-size: 15px; color: var(--text-soft); }
.cred__list li .ic { color: var(--primary); width: 18px; height: 18px; margin-top: 3px; }
.lang + .lang { margin-top: 18px; }
.lang__top { display: flex; justify-content: space-between; gap: 10px; font-size: 15px; }
.lang__top span { color: var(--muted); font-size: 13px; }
.bar { margin-top: 8px; height: 6px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; border-radius: 6px; background: linear-gradient(90deg, var(--steel-600), var(--steel-300)); transition: width 1.6s var(--ease); }
html[dir="rtl"] .bar span { background: linear-gradient(-90deg, var(--steel-600), var(--steel-300)); }
.cred.in .bar span { width: var(--w); }

/* ---------- Contact ---------- */
.contact { overflow: hidden; }
.contact__glow {
  position: absolute; left: 50%; top: 50%; width: 900px; height: 600px; transform: translate(-50%, -50%);
  background: radial-gradient(ellipse, var(--glow), transparent 65%); opacity: .5; pointer-events: none; filter: blur(30px);
}
.contact__panel {
  position: relative; padding: clamp(36px, 6vw, 72px); border-radius: 28px;
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(14px);
  overflow: hidden;
}
.contact__panel::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: conic-gradient(from var(--angle, 0deg), transparent 0 70%, var(--steel-300) 85%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: rotate-border 6s linear infinite;
}
@property --angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
@keyframes rotate-border { to { --angle: 360deg; } }
.contact__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 8px; }
.contact-item { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.contact-item:hover { transform: translateY(-5px); }
.contact-item small { color: var(--muted); font-size: 13px; }
.contact-item b { display: block; font-weight: 600; font-size: 15px; word-break: break-word; }
.contact-item .ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.contact-item__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.copy-btn {
  padding: 4px 10px; border-radius: 8px; font-size: 12px; font-weight: 600;
  color: var(--primary); background: var(--primary-soft); border: 1px solid var(--border);
  transition: background .3s, color .3s;
}
.copy-btn:hover { background: var(--steel); color: #fff; }
.contact__cta { display: flex; justify-content: center; margin-top: 40px; }
.contact__socials { display: flex; justify-content: center; gap: 12px; margin-top: 28px; }

/* ---------- Footer ---------- */
.footer { padding: 36px 0; border-top: 1px solid var(--border); }
.footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.footer p { margin: 0; color: var(--muted); font-size: 14px; }

.to-top {
  position: fixed; bottom: 24px; inset-inline-end: 24px; z-index: 90;
  width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center;
  color: #fff; background: linear-gradient(135deg, var(--steel-400), var(--steel-600));
  box-shadow: 0 12px 28px -10px var(--glow);
  opacity: 0; transform: translateY(20px) scale(.9); pointer-events: none;
  transition: opacity .4s, transform .4s var(--ease);
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { transform: translateY(-4px); }

.toast {
  position: fixed; bottom: 28px; left: 50%; z-index: 300; transform: translate(-50%, 30px);
  padding: 12px 20px; border-radius: 12px; font-weight: 600; font-size: 14px;
  color: #fff; background: var(--steel-700); box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: opacity .3s, transform .4s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.noscript { padding: 20px; text-align: center; }

/* ---------- Reveal animations ---------- */
.reveal {
  opacity: 0; transform: translateY(32px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
  transition-delay: calc(var(--d, 0) * 90ms);
}
.reveal.in { opacity: 1; transform: none; }
.hero .reveal { transition-delay: calc(var(--d, 0) * 110ms + 250ms); }
body.lang-switching main { animation: lang-fade .5s var(--ease); }
@keyframes lang-fade { from { opacity: .2; filter: blur(4px); } to { opacity: 1; filter: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .stats__grid { grid-template-columns: repeat(6, 1fr); }
  .stat { grid-column: span 2; }
  .stat:nth-child(4), .stat:nth-child(5) { grid-column: span 3; }
  .creds { grid-template-columns: repeat(2, 1fr); }
  .contact__grid { grid-template-columns: repeat(2, 1fr); }
  .projects { grid-template-columns: repeat(2, 1fr); }
  .key-projects { grid-template-columns: repeat(2, 1fr); }
  .kp, .kp:nth-child(4), .kp:nth-child(5) { grid-column: span 1; }
  .kp:nth-child(5) { grid-column: span 2; }
}

@media (max-width: 920px) {
  .nav {
    position: fixed; top: var(--header-h); inset-inline: 12px; flex-direction: column; gap: 4px;
    padding: 14px; border-radius: var(--radius);
    background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
    opacity: 0; transform: translateY(-12px) scale(.98); pointer-events: none;
    transition: opacity .35s, transform .45s var(--ease);
  }
  .nav.open { opacity: 1; transform: none; pointer-events: auto; }
  .nav__link { padding: 12px 16px; font-size: 16px; }
  .nav__link::after { display: none; }
  .nav__link.active { background: var(--primary-soft); }
  .burger { display: inline-flex; }

  .hero__inner { grid-template-columns: 1fr; gap: 64px; text-align: center; }
  .hero__content { display: flex; flex-direction: column; align-items: center; }
  .hero__role { text-align: center; }
  .hero__lead { margin-inline: auto; }
  .hero__ctas, .hero__socials { justify-content: center; }
  .hero__visual { order: -1; }
  .portrait { width: min(300px, 70vw); }
  .orbit-chip { font-size: 11.5px; padding: 7px 11px; }
  .orbit-chip--1 { inset-inline-start: -14%; }
  .orbit-chip--3 { inset-inline-start: -18%; }
  .orbit-chip--2 { inset-inline-end: -18%; }
  .scroll-cue { display: none; }
  .stats { margin-top: 0; }

  .about { grid-template-columns: 1fr; }
  .engage { grid-template-columns: 1fr; }
  .section { padding: 90px 0; }
}

@media (max-width: 640px) {
  .container { width: calc(100% - 32px); }
  .logo__text { display: none; }
  .pill-btn { padding: 0 12px; }
  .stats__grid { grid-template-columns: 1fr 1fr; }
  .stat:last-child { grid-column: span 2; }
  .stat { padding: 22px 12px; }
  .pillars, .info-list { grid-template-columns: 1fr; }
  .skills { grid-template-columns: 1fr; }
  .timeline { padding-inline-start: 34px; }
  .timeline__line { inset-inline-start: 9px; }
  .job__dot { inset-inline-start: -34px; width: 18px; height: 18px; }
  .job__card { padding: 22px; }
  .key-projects, .projects, .creds, .contact__grid { grid-template-columns: 1fr; }
  .kp:nth-child(5) { grid-column: span 1; }
  .btn { height: 48px; padding: 0 20px; }
  .hero__ctas { flex-direction: column; width: 100%; }
  .hero__ctas .btn { justify-content: center; }
  .orbit-chip--1, .orbit-chip--3 { inset-inline-start: -6%; }
  .orbit-chip--2 { inset-inline-end: -8%; }
  .to-top { bottom: 16px; inset-inline-end: 16px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
