/* ==========================================================
   بشّـار — Portfolio
   Plain CSS, no build step. RTL Arabic.
   ========================================================== */

/* ---------- Fonts (self-hosted Thmanyah Serif Display) ---------- */
@font-face { font-family: "Thmanyah"; src: url("../fonts/thmanyah-serif-display-light.woff2") format("woff2"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "Thmanyah"; src: url("../fonts/thmanyah-serif-display-regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Thmanyah"; src: url("../fonts/thmanyah-serif-display-medium.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Thmanyah"; src: url("../fonts/thmanyah-serif-display-bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Thmanyah"; src: url("../fonts/thmanyah-serif-display-black.woff2") format("woff2"); font-weight: 900; font-style: normal; font-display: swap; }

/* ---------- Tokens ---------- */
:root {
  --bg: #f4f3ee;
  --surface: #ffffff;
  --surface-2: #f4f4f4;
  --line: rgba(7, 7, 7, 0.07);
  --text: #27272a;
  --text-2: #52525b;
  --text-3: #71717a;
  --muted: #a1a1aa;
  --ink: #070707;
  --purple: #9117e3;
  --purple-2: #b14bf5;
  --green: #6ee81c;
  --green-2: #8ff04f;
  --orange: #d97757;

  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 24px;
  --pill: 100px;

  --container: 1200px;
  --narrow: 700px;
  --gutter: 24px;

  --shadow-soft: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px -12px rgba(0,0,0,.12);
  --shadow-green: 0 10px 30px -8px rgba(110, 232, 28, .55);

  --ease: cubic-bezier(.22, 1, .36, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* Thmanyah alternates, applied exactly as on the original site:
   stylistic alternates on every heading, swashes too on nav + footer links */
h1, h2, h3, h4, .h-display, .stat strong { font-feature-settings: "salt" 1; }
.nav__link, .footer__links a { font-feature-settings: "salt" 1, "swsh" 1; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Thmanyah", "Times New Roman", serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.3;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
h1, h2, h3, h4, p, figure, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--purple); outline-offset: 3px; border-radius: 8px; }

.container { width: min(var(--container), 100% - var(--gutter) * 2); margin-inline: auto; }
.narrow { width: min(var(--narrow), 100% - var(--gutter) * 2); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header / nav ---------- */
.site-header {
  position: fixed; inset-block-start: 12px; inset-inline: 0; z-index: 50;
  pointer-events: none;
}
.site-header .container { display: flex; justify-content: flex-start; }
.nav {
  pointer-events: auto;
  display: inline-flex; width: max-content; max-width: 100%; flex: none; align-items: center; gap: 4px;
  padding: 5px 5px 5px 20px;
  background: rgba(244, 243, 238, .82);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: var(--pill);
}
.nav__logo { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; flex: none; margin-inline-end: 12px; background: #000; }
.nav__logo img { width: 100%; height: 100%; object-fit: cover; }
.nav a.nav__link {
  font-weight: 500; font-size: 16px; color: var(--ink);
  padding: 8px 14px; border-radius: var(--pill);
}


main { padding-top: 120px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 14px;
  height: 56px; padding: 0 22px 0 24px;
  border-radius: var(--pill);
  font-weight: 900; font-size: 16px;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn--green { background: linear-gradient(180deg, var(--green-2), var(--green)); color: #fff; box-shadow: var(--shadow-green); }
.btn--white { background: var(--surface); color: var(--text); box-shadow: var(--shadow-soft); }
.btn--white svg { color: var(--purple); }
.btn--sm { height: 44px; font-size: 15px; padding: 0 18px 0 20px; }

/* ---------- Section heading ---------- */
.section { padding-block: 140px; }
.section-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 16px; margin-bottom: 56px; }
.tag {
  display: inline-flex; align-items: center;
  padding: 10px 24px; border-radius: var(--pill);
  background: radial-gradient(128% 50% at 0% 50%, var(--purple) 0%, #a43ff0 100%);
  color: #f4f4f4; font-weight: 700; font-size: 14px; line-height: 1.2;
  box-shadow: 0 6px 18px -8px rgba(145, 23, 227, .7);
}
.h-display { font-weight: 500; font-size: 60px; line-height: 1.1; color: var(--text); max-width: 440px; }

/* ---------- Hero ---------- */
.hero { padding-top: 80px; padding-bottom: 72px; }
.hero__inner { display: flex; align-items: center; justify-content: space-between; gap: 40px; }
.hero__name { display: flex; align-items: center; gap: 28px; }
.hero__name h1 { font-weight: 900; font-size: 96px; line-height: 1; letter-spacing: 0; }
.app-icon {
  width: 96px; height: 96px; flex: none;
  border-radius: 24px; overflow: hidden;
  border: 4px solid #fff; background: #000;
  box-shadow: 0 18px 40px -10px rgba(0,0,0,.35);
}
.app-icon img { width: 100%; height: 100%; object-fit: cover; }
.hero__copy { max-width: 480px; display: flex; flex-direction: column; gap: 14px; }
.rating { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text); }
.rating__chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--line); border-radius: var(--pill); font-weight: 500; direction: ltr; }
.rating__chip svg { width: 14px; height: 14px; color: var(--orange); }
.hero__lead { font-size: 20px; line-height: 1.3; }
.hero__actions { display: flex; gap: 12px; margin-top: 10px; flex-wrap: wrap; }

/* ---------- Project cards / marquee ---------- */
.project-card {
  position: relative; flex: none;
  width: 560px; aspect-ratio: 1; border-radius: var(--radius-lg); overflow: hidden;
  background: #111;
}
.project-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s cubic-bezier(.5,0,.2,1); }
.project-card:hover img { transform: scale(1.1); }
.project-card__chip {
  position: absolute; inset-block-end: 30px; inset-inline-end: 30px; height: 48px;
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; color: var(--text);
  border-radius: var(--pill); padding: 0 24px;
  font-weight: 500; font-size: 14px;
}
.project-card__chip span:nth-child(2) { color: var(--muted); }

.marquee { overflow: hidden; width: 100%; }
.marquee__track { display: flex; gap: 20px; width: max-content; will-change: transform; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(50%); } }
/* inside a container: soft fade at the edges */
.marquee--fade { -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }

/* ---------- About (home) ---------- */
.about-stack { display: flex; flex-direction: column; gap: 12px; }
.card { background: var(--surface); border-radius: var(--radius-lg); padding: 30px; }
.about-card { position: sticky; top: 110px; box-shadow: 0 -6px 24px -18px rgba(0,0,0,.25); }
.about-card h3 { display: flex; align-items: center; gap: 10px; color: var(--purple); font-weight: 700; font-size: 21px; line-height: 1.3; margin-bottom: 14px; }
.about-card h3::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.about-card p { font-size: 24px; line-height: 1.3; color: var(--muted); }
.about-card--muted h3 { color: var(--text-3); }
.xp-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding-block: 10px; font-size: 24px; line-height: 1.3; }
.xp-row + .xp-row { border-top: 1px solid var(--line); }
.xp-row__role { color: var(--text); }
.xp-row__years { color: var(--text-2); font-weight: 500; white-space: nowrap; }
.xp-row--current .xp-row__role, .xp-row--current .xp-row__years { font-weight: 700; }

/* ---------- Client logos ---------- */
.logos { background: var(--surface); border-radius: var(--radius-lg); padding-block: 40px; }
.logos .marquee__track { gap: 72px; align-items: center; --marquee-speed: 35s; }
.logos img { width: auto; opacity: .6; filter: grayscale(1); }

/* ---------- Projects carousel (contained) ---------- */
.carousel { position: relative; }
.carousel__viewport { overflow: hidden; border-radius: var(--radius-lg); }
.carousel__track { display: flex; gap: 20px; width: max-content; will-change: transform; }
.projects-foot { display: flex; flex-direction: column; align-items: center; gap: 24px; margin-top: 40px; text-align: center; }
.projects-foot p { font-size: 20px; line-height: 1.3; max-width: 560px; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 36px 20px; text-align: center; display: flex; flex-direction: column; gap: 10px; }
.stat strong { font-weight: 500; font-size: 60px; line-height: 1.1; color: var(--purple); direction: ltr; unicode-bidi: isolate; }
.stat span { font-size: 20px; line-height: 1.3; }

/* ---------- Process ---------- */
.steps { display: flex; flex-direction: column; gap: 16px; }
.step { background: var(--surface); border-radius: var(--radius-lg); padding: 24px 30px 30px; transition: background .35s var(--ease); }
.step__tag {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 16px; border-radius: var(--pill);
  background: var(--surface-2); color: var(--muted);
  font-weight: 500; font-size: 18px; line-height: 1.3;
  margin-bottom: 18px;
  position: relative; isolation: isolate;
  transition: color .5s ease;
}
/* the purple fill fades in over the grey pill (a gradient can't transition directly,
   which made it snap) */
.step__tag::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: radial-gradient(128% 50% at 0% 50%, var(--purple) 0%, #a43ff0 100%);
  opacity: 0; transition: opacity .55s ease;
}
.step__tag .step__title { max-width: 0; overflow: hidden; white-space: nowrap; opacity: 0; filter: blur(4px); transition: max-width .45s cubic-bezier(.22,1,.36,1), opacity .5s ease .05s, filter .5s ease .05s; }
.step p { font-size: 24px; line-height: 1.3; color: var(--muted); transition: color .6s ease; }
.step.is-active .step__tag { color: #fff; }
.step.is-active .step__tag::before { opacity: 1; }
.step.is-active .step__title { max-width: 340px; opacity: 1; filter: none; }
/* room for glyph overhang at the line ends so letters are never shaved */
.step__tag .step__title { padding-block: .25em; margin-block: -.25em; }
.step.is-active .step__title { padding-inline-end: .3em; margin-inline-end: -.3em; }
.step.is-active p { color: var(--text); }

/* ---------- Services ---------- */
.services { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; direction: ltr; }
.services > * { direction: rtl; }
.service { background: var(--surface); border-radius: var(--radius-lg); padding: 30px; display: flex; flex-direction: column; gap: 40px; }
.service__head { display: flex; align-items: center; gap: 16px; }
.service__icon { width: 52px; height: 52px; border-radius: 50%; background: #f5ecfd; color: var(--purple); display: grid; place-items: center; flex: none; }
.service__icon svg { width: 24px; height: 24px; }
.service h3 { font-weight: 500; font-size: 24px; line-height: 1.3; max-width: 170px; }
.service p { font-size: 24px; line-height: 1.3; color: var(--text-2); max-width: 500px; }

/* ---------- FAQ ---------- */
.faq { display: flex; flex-direction: column; gap: 10px; }
.faq details { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); transition: background .3s var(--ease); }
.faq details[open] { background: var(--surface); }
.faq summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px 24px; font-weight: 500; font-size: 18px; line-height: 1.4;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; width: 14px; height: 14px; flex: none;
  background: var(--purple);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M7 1v12M1 7h12' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M7 1v12M1 7h12' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform .35s var(--ease), background .3s;
}
.faq details[open] summary::after { transform: rotate(45deg); background: var(--muted); }
.faq__answer { padding: 0 24px 22px; font-size: 18px; line-height: 1.5; color: var(--text-2); }

/* ---------- Footer ---------- */
.site-footer { padding-block: 120px 40px; }
.footer__grid { display: flex; justify-content: flex-start; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.footer__col h2 { font-weight: 500; font-size: 20px; line-height: 1.3; margin-bottom: 14px; }
.footer__box { background: var(--surface); border-radius: var(--radius); padding: 14px; }
.footer__links { display: flex; flex-direction: column; gap: 4px; padding: 8px 14px 8px 30px; }
.footer__links a { font-size: 16px; color: var(--text-3); padding-block: 5px; transition: color .2s; }
.footer__links a:hover { color: var(--text); }
.footer__social { display: flex; gap: 14px; align-items: stretch; }
.social-list { display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.social-list a {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 14px 6px 12px; border: 1px solid var(--line); border-radius: var(--pill);
  font-size: 16px; color: var(--text-3); transition: color .2s, background .2s;
}
.social-list a:hover { color: var(--text); }
.social-list img { width: 20px; height: 20px; }
.footer__photo { width: 136px; height: 178px; border-radius: var(--radius-sm); overflow: hidden; background: #000; flex: none; }
.footer__photo img { width: 100%; height: 100%; object-fit: contain;  /* square logo in a tall tile: show it whole, never crop the dash or dots */ }
.footer__bottom { margin-top: 40px; color: var(--muted); font-size: 14px; }

/* Floating WhatsApp */
.wa-float {
  position: fixed; inset-block-end: 24px; inset-inline-end: 24px; z-index: 40;
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  background: #f7f6f2; color: #2bd65a;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,.18), 0 2px 6px -2px rgba(0,0,0,.06);
  transition: transform .6s var(--ease), box-shadow .6s var(--ease);
}
.wa-float:hover { transform: scale(1.06); box-shadow: 0 14px 34px -10px rgba(0,0,0,.22), 0 2px 6px -2px rgba(0,0,0,.06); }
.wa-float svg { width: 28px; height: 28px; }

/* ---------- About page ---------- */
.intro { padding-top: 140px; text-align: center; }
.intro p { font-size: 30px; line-height: 1.45; max-width: 940px; margin-inline: auto; }
.intro__visual { margin: 160px auto 0; width: min(700px, 100%); aspect-ratio: 700 / 420; border-radius: var(--radius-lg); overflow: hidden; border: 5px solid #fff; box-shadow: var(--shadow-soft); background: #000; }
.intro__visual img { width: 100%; height: 100%; object-fit: cover; }
.xp-list { display: flex; flex-direction: column; gap: 12px; }
.xp-item { display: grid; grid-template-columns: 1fr 1fr auto; align-items: center; gap: 16px; background: var(--surface); border-radius: var(--radius); padding: 20px 26px; font-size: 18px; }
.xp-item__company { color: var(--text-3); text-align: center; direction: ltr; }
.xp-item__years { color: var(--text-3); text-align: left; }
.skills { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.skill { background: var(--surface); border-radius: var(--radius); padding: 10px 10px 16px; display: flex; flex-direction: column; gap: 14px; }
.skill__img { aspect-ratio: 245 / 236; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.skill__img img { width: 100%; height: 100%; object-fit: cover; }
.skill__label { display: flex; align-items: center; gap: 8px; font-size: 16px; padding-inline: 6px; }
.skill__label svg { width: 18px; height: 18px; color: var(--purple); flex: none; }
.tools { display: flex; justify-content: center; margin-top: 40px; }
.tools__bar { display: flex; gap: 36px; padding: 20px 36px; background: rgba(7,7,7,.06); border-radius: var(--radius); flex-wrap: wrap; justify-content: center; direction: ltr; }
.tools__bar img { width: auto; height: 60px; }

/* ---------- Page heading (all projects) ---------- */
.page-head { text-align: center; padding-top: 60px; margin-bottom: 64px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.page-head h1 { font-weight: 500; font-size: 60px; line-height: 1.1; }
.page-head p { font-size: 20px; line-height: 1.3; color: var(--muted); max-width: 300px; }

/* ---------- Project detail ---------- */
.project-hero { text-align: center; padding: 60px var(--gutter) 0; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.project-hero h1 { font-weight: 500; font-size: 60px; line-height: 1.1; }
.project-hero p { font-size: 20px; line-height: 1.4; max-width: 880px; color: var(--text); }
.project-cover { width: min(1140px, 100% - var(--gutter) * 2); margin: 56px auto 0; border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 1140 / 600; }
.project-cover img { width: 100%; height: 100%; object-fit: cover; }
.meta { width: min(1140px, 100% - var(--gutter) * 2); margin: 48px auto 0; }
.meta__row { display: flex; justify-content: space-between; padding-block: 14px; border-bottom: 1px solid var(--line); font-size: 16px; }
.meta__row dt { color: var(--text-3); }
.meta__row dd { margin: 0; color: var(--text); font-weight: 500; }

.gallery { width: min(1140px, 100% - var(--gutter) * 2); margin: 80px auto 0; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.gallery__col { display: flex; flex-direction: column; gap: 20px; }
.gallery img { width: 100%; height: auto; border-radius: var(--radius); background: #e9e8e3; }

.video-duo { width: min(1140px, 100% - var(--gutter) * 2); margin: 80px auto 0; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.video-duo video { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: var(--radius); background: #000; }

.slider { width: min(1120px, 100% - var(--gutter) * 2); margin: 80px auto 0; position: relative; }
.slider__viewport { overflow: hidden; border-radius: var(--radius); }
.slider__track { display: flex; transition: transform .6s var(--ease); }
.slider__track video { flex: 0 0 100%; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.slider__btn { position: absolute; top: 50%; translate: 0 -50%; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.14); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); color: #fff; z-index: 2; }
.slider__btn svg { width: 18px; height: 18px; }
.slider__btn--prev { inset-inline-start: 16px; }
.slider__btn--next { inset-inline-end: 16px; }
.slider__dots { display: flex; justify-content: center; gap: 6px; margin-top: 16px; }
.slider__dots button { width: 7px; height: 7px; border-radius: 50%; background: rgba(7,7,7,.18); transition: width .3s var(--ease), background .3s; }
.slider__dots button[aria-current="true"] { width: 20px; border-radius: 6px; background: var(--purple); }

/* ---------- 404 ---------- */
.notfound { min-height: 60vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 18px; padding-top: 40px; }
.notfound__ticker { height: 110px; overflow: hidden; }
.notfound__ticker ul { animation: ticker 4s var(--ease) infinite; }
.notfound__ticker li { height: 110px; display: flex; align-items: center; justify-content: center; font-weight: 500; font-size: 96px; line-height: 1; }
@keyframes ticker { 0%, 40% { transform: translateY(0); } 50%, 90% { transform: translateY(-110px); } 100% { transform: translateY(-220px); } }
.notfound p { font-size: 18px; color: var(--text-2); }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .marquee__track, .carousel__track, .notfound__ticker ul { animation: none; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Tablet ---------- */
@media (max-width: 1199.98px) {
  .h-display, .page-head h1, .project-hero h1 { font-size: 48px; }
  .hero__inner { flex-direction: column; align-items: flex-start; }
  .project-card { width: 420px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .skills { grid-template-columns: repeat(2, 1fr); }
  .about-card p, .step p, .service p, .xp-row { font-size: 21px; }
}

/* ---------- Mobile ---------- */
@media (max-width: 809.98px) {
  :root { --gutter: 16px; }
  main { padding-top: 96px; }
  .section { padding-block: 80px; }
  .section-head { margin-bottom: 36px; }
  .h-display, .page-head h1, .project-hero h1 { font-size: 38px; }
  .hero { padding-top: 40px; }
  .hero__name h1 { font-size: 72px; }
  .app-icon { width: 72px; height: 72px; border-radius: 18px; }
  .hero__lead { font-size: 18px; }
  .project-card { width: 300px; }
  .project-card__chip { inset-block-end: 16px; inset-inline-end: 16px; }
  .card, .service, .step { padding: 22px; }
  .about-card p, .step p, .service p, .xp-row { font-size: 18px; }
  .services { grid-template-columns: 1fr; }
  .service { gap: 24px; }
  .stat strong { font-size: 44px; }
  .stat span { font-size: 16px; }
  .faq summary { font-size: 16px; padding: 18px; }
  .faq__answer { padding: 0 18px 18px; font-size: 16px; }
  .intro { padding-top: 60px; }
  .intro p { font-size: 21px; }
  .intro__visual { margin-top: 64px; }
  .tools__bar { gap: 18px; padding: 14px 18px; }
  .tools__bar img { height: 40px; }
  .xp-item { grid-template-columns: 1fr auto; font-size: 16px; }
  .xp-item__company { display: none; }
  .gallery, .video-duo { grid-template-columns: 1fr; }
  .logos img { height: 44px; }
  .footer__grid { flex-direction: column; align-items: stretch; }
  .footer__social { flex-wrap: wrap; }
  .notfound__ticker, .notfound__ticker li { height: 72px; }
  .notfound__ticker li { font-size: 48px; white-space: nowrap; }
  @keyframes ticker { 0%, 40% { transform: translateY(0); } 50%, 90% { transform: translateY(-72px); } 100% { transform: translateY(-144px); } }
  .nav { padding-inline-start: 10px; }
  .nav a.nav__link { padding: 8px 10px; font-size: 15px; }
}

/* ==========================================================
   Motion & micro-interactions
   ========================================================== */

/* Page enter: soft fade (matches the old site's page transition) */
body { animation: page-in .45s var(--ease) both; }
@keyframes page-in { from { opacity: 0; } to { opacity: 1; } }

/* Blur-in reveal */
.reveal { opacity: 0; filter: blur(12px); transform: translateY(28px); transition: opacity 1s var(--ease), filter 1s var(--ease), transform 1s var(--ease); }
.reveal.is-visible { opacity: 1; filter: blur(0); transform: none; }

/* Progressive blur at the top of the screen: no tint, just blur that is strongest at the
   very top and fades out (two stacked layers with staggered masks). It lives inside the
   header, behind the nav, so the nav itself always stays sharp */
.site-header::before, .site-header::after {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  inset-inline: 0; top: -12px; height: 110px;
}
.site-header::before {
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 35%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 0%, #000 35%, transparent 100%);
}
.site-header::after {
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 55%);
          mask-image: linear-gradient(to bottom, #000 0%, transparent 55%);
}

/* Custom cursor: a lime blob that trails the pointer, stretches with speed,
   grows over clickable things, and turns into the project's badge over cards */
.cursor { position: fixed; top: 0; left: 0; z-index: 100; pointer-events: none; display: none; }
.has-cursor .cursor { display: block; }
.cursor__blob {
  position: absolute; left: 0; top: 0; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%;
  background: var(--green); opacity: .9;
  transition: width .35s var(--ease), height .35s var(--ease), margin .35s var(--ease), opacity .25s;
  will-change: transform;
}
.cursor.is-link .cursor__blob { width: 88px; height: 88px; margin: -44px 0 0 -44px; opacity: .85; }
.cursor.is-down .cursor__blob { width: 30px; height: 30px; margin: -15px 0 0 -15px; }
/* Over a project card the circle morphs into a rounded square showing the project's badge */
.cursor__badge {
  position: absolute; left: 0; top: 0; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%;
  max-width: none; object-fit: cover; border: 0; background: var(--green);
  box-shadow: 0 10px 24px -10px rgba(0,0,0,.45);
  opacity: 0;
  transition: width .5s cubic-bezier(.34,1.2,.5,1), height .5s cubic-bezier(.34,1.2,.5,1), margin .5s cubic-bezier(.34,1.2,.5,1),
              border-radius .5s var(--ease), opacity .35s ease, background-color .35s ease;
}
.cursor.is-card .cursor__badge { opacity: 1; width: 80px; height: 80px; margin: -40px 0 0 -40px; border-radius: 16px; background: transparent; box-shadow: none; }
.cursor.is-card .cursor__blob { opacity: 0; }

/* Project card arrow: rests outside the card's edge, then slides in while
   turning upright (from upside-down); its size never changes */
.project-card__go {
  position: absolute; inset-block-end: 30px; inset-inline-start: 30px;
  width: 48px; height: 48px; display: block;
  transform: translateX(130px) rotate(180deg);
  transition: transform .45s cubic-bezier(.6,0,.2,1);
}
.project-card__go > span {
  width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center;
  background: #fff; color: var(--orange);
}
.project-card__go svg { width: 24px; height: 24px; }
.project-card:hover .project-card__go, .project-card:focus-visible .project-card__go { transform: none; }

/* Buttons: the label and arrow roll up and a fresh copy rolls in from below */
/* Rolling labels: the window is taller than the text (and pulled back with negative
   margins) so Arabic descenders and swash tails like ي are never cut off */
.roll { display: inline-block; overflow: hidden; height: 1.9em; line-height: 1.9em; margin-block: -.3em; padding-inline: .2em; margin-inline: -.2em; vertical-align: middle; }
.roll > span { display: block; transition: transform .6s cubic-bezier(.16,1,.3,1); }
.btn .roll > span { transition: transform .35s cubic-bezier(.25,1.12,.35,1); }
.roll > span::after { content: attr(data-text); display: block; }
.roll--icon { height: 20px; line-height: 0; margin: 0; padding: 0; }
.roll--icon > span { display: flex; flex-direction: column; }
.roll--icon > span::after { content: none; }
:is(.btn, .nav__link, .footer__links a, .social-list a):is(:hover, :focus-visible) .roll > span { transform: translateY(-50%); }
.btn:hover .roll--icon > span, .btn:focus-visible .roll--icon > span { transition-delay: 0s; }

/* Hide the system pointer wherever the custom circle is active */
.has-cursor, .has-cursor * { cursor: none !important; }
.has-cursor input, .has-cursor textarea { cursor: text !important; }

/* Stacking cards: about + process steps stick and overlap as you scroll */
.about-card { top: calc(110px + var(--i, 0) * 18px); box-shadow: 0 -10px 30px -22px rgba(0,0,0,.35); }
.step { position: sticky; top: calc(110px + var(--i, 0) * 18px); box-shadow: 0 -10px 30px -22px rgba(0,0,0,.35); }
.step p { color: var(--muted); }
.step.is-active p { color: var(--text); }

/* Stats count up */
.stat strong { font-variant-numeric: tabular-nums; }

/* FAQ: smooth open */
.faq__answer { animation: faq-open .45s var(--ease); }
@keyframes faq-open { from { opacity: 0; transform: translateY(-6px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }

/* Buttons: subtle press */
.btn:active { transform: scale(.97); }

@media (prefers-reduced-motion: reduce) {
  body { animation: none; }
  .reveal { opacity: 1; filter: none; transform: none; }
  .cursor { display: none !important; }
  .roll > span, .project-card__go { transition: none !important; }
  .project-card__go > span { animation: none !important; }
}
@media (max-width: 809.98px) {
  .about-card, .step { top: calc(90px + var(--i, 0) * 12px); }
  .project-card__go { inset-block-end: 16px; inset-inline-start: 16px; }
  .project-card__chip { inset-block-end: 16px; inset-inline-end: 16px; }
}


/* ==========================================================
   Geometry matched to the original site (measured at 1440px)
   ========================================================== */
@media (min-width: 810px) {
  /* nav: 56px tall pill, 48px between links */
  .nav { gap: 48px; padding: 7px 7px 7px 59px; }
  .nav__logo { margin-inline-end: 0; }
  .nav a.nav__link { padding: 0; }
  /* buttons: 30px side padding, 24px arrow */
  .btn { padding: 0 30px; gap: 30px; }
  .btn svg, .roll--icon { width: 24px; height: 24px; }
  .projects-foot .btn { height: 64px; }
  /* section rhythm */
  /* home page rhythm (other pages keep the default section spacing) */
  #about, #projects, #projects + .section, #process, #services, #faq { padding-block: 0; }
  .section-head { margin-bottom: 64px; }
  #about { padding-top: 120px; }
  #projects { padding-top: 106px; }
  #projects + .section { padding-top: 130px !important; }
  #process { padding-top: 136px; }
  #services { padding-top: 205px; }
  #services .section-head { margin-bottom: 48px; }
  #faq { padding-top: 206px; }
  .site-footer { padding-top: 200px; }
  /* cards */
  .about-card h3 { margin-bottom: 24px; }
  .logos { padding-block: 70px; }
  .stats { max-width: 1140px; margin-inline: auto; gap: 20px; }
  .stat { min-height: 220px; padding: 30px; justify-content: center; border-radius: var(--radius-lg); }
  .steps { gap: 20px; }
  .step { padding: 30px; }
  .step__tag { padding: 8px 16px; margin-bottom: 24px; }
  .services { gap: 20px; }
  .service { min-height: 250px; }
  .faq { gap: 20px; }
  .faq details { border-radius: var(--radius-lg); }
  .footer__box.footer__social { padding: 24px; }
  /* contact page: questions start right under the nav */
  main > #faq:first-child { padding-top: 51px; }
  /* about page */
  .section--xp { padding-block: 98px 194px; }
  .section--skills .section-head { margin-bottom: 84px; }
  .xp-list { gap: 18px; }
  .xp-item { padding: 31px 30px; font-size: 20px; border-radius: var(--radius-lg); }
}

/* Tools bar: text stand-in until the Claude Code logo file is added */
.tools__text { display: inline-flex; align-items: center; height: 60px; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; font-weight: 600; font-size: 20px; color: #d97757; white-space: nowrap; }
@media (max-width: 809.98px) { .tools__text { height: 40px; font-size: 15px; } }

/* Previous / next project */
.project-nav { max-width: 1140px; margin: 120px auto 0; padding-inline: var(--gutter); display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.project-nav__link {
  display: flex; align-items: center; gap: 18px; padding: 14px; border-radius: var(--radius-lg);
  background: var(--surface); transition: background .3s var(--ease);
}
.project-nav__link--prev { flex-direction: row-reverse; text-align: end; }
.project-nav__link img { width: 72px; height: 72px; border-radius: 16px; object-fit: cover; flex: none; }
.project-nav__text { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.project-nav__label { font-size: 14px; color: var(--muted); }
.project-nav__name { font-size: 24px; font-weight: 500; line-height: 1.2; font-feature-settings: "salt" 1; }
.project-nav__arrow { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); color: var(--orange); flex: none; transition: transform .45s cubic-bezier(.16,1,.3,1); }
.project-nav__arrow svg { width: 22px; height: 22px; }
.project-nav__link--next:hover .project-nav__arrow { transform: translateX(4px); }
.project-nav__link--prev:hover .project-nav__arrow { transform: translateX(-4px); }
@media (max-width: 809.98px) {
  .project-nav { grid-template-columns: 1fr; margin-top: 72px; gap: 12px; }
  .project-nav__link img { width: 56px; height: 56px; }
  .project-nav__name { font-size: 20px; }
}

/* ==========================================================
   First-visit loader: the logo is Morse code for "B" (— · · ·).
   Proportions from the logo file: dash = 5 dots wide, gaps = half a dot.
   Black screen, the outlined dash grows left to right like a loading bar,
   the three dots punch in, then the site opens.
   ========================================================== */
.loader { display: none; }
.show-loader, .show-loader body { overflow: hidden; }
.show-loader .loader {
  display: grid; place-items: center; position: fixed; inset: 0; z-index: 200;
  background: #070707;
  animation: loader-out .7s cubic-bezier(.65,0,.35,1) 2.05s forwards;
}
.loader__mark { display: flex; align-items: center; gap: 20px; direction: ltr; animation: loader-mark-out .7s cubic-bezier(.65,0,.35,1) 2.05s forwards; }
.loader__dash {
  position: relative; width: 200px; height: 40px;
}
/* the dash stays an outline, like the logo (hairline = 1/32 of its height), and grows left to right */
.loader__fill {
  position: absolute; inset-block: 0; left: 0; width: 0;
  border: 1.25px solid var(--green); box-sizing: border-box;
  box-shadow: 0 0 18px -6px rgba(110,232,28,.7);
  opacity: 0;
  animation: loader-fill .95s cubic-bezier(.65,0,.35,1) .45s forwards;
}
.loader__dot {
  width: 40px; height: 40px; background: var(--green);
  box-shadow: 0 0 22px -4px rgba(110,232,28,.75);
  transform: scale(0); opacity: 0;
  animation: loader-punch .42s cubic-bezier(.3,1.6,.5,1) forwards;
}
.loader__dot:nth-child(2) { animation-delay: 1.42s; }
.loader__dot:nth-child(3) { animation-delay: 1.56s; }
.loader__dot:nth-child(4) { animation-delay: 1.70s; }
@keyframes loader-fade { to { opacity: 1; } }
@keyframes loader-fill { 0% { width: 0; opacity: 0; } 4% { opacity: 1; } 100% { width: 100%; opacity: 1; } }
@keyframes loader-punch { 0% { transform: scale(0); opacity: 0; } 40% { opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
@keyframes loader-mark-out { to { transform: scale(.92); filter: blur(8px); opacity: 0; } }
@keyframes loader-out { to { opacity: 0; visibility: hidden; } }
@media (max-width: 809.98px) {
  .loader__mark { gap: 12px; }
  .loader__dash { width: 120px; height: 24px; }
  .loader__dot { width: 24px; height: 24px; }
}

/* ==========================================================
   Micro-interactions
   ========================================================== */


/* 1 · Headings arrive word by word (blur-up, staggered) */
.split .w { display: inline-block; opacity: 0; filter: blur(10px); transform: translateY(.35em);
  transition: opacity .8s var(--ease), filter .8s var(--ease), transform .8s var(--ease);
  transition-delay: calc(var(--wi) * 90ms + 120ms); }
.split.is-in .w { opacity: 1; filter: none; transform: none; }


/* 4 · Project cards lean toward the cursor with a soft light sweep */
.project-card { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .6s cubic-bezier(.16,1,.3,1); }
.project-card.is-tilting { transition: transform .12s linear; }
.project-card::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(420px circle at var(--gx, 50%) var(--gy, 50%), rgba(var(--glow, 255,255,255), .32), transparent 55%);  /* each client's own colour */
  opacity: 0; transition: opacity .45s ease;
}
.project-card:hover::after { opacity: 1; }
.project-card__chip, .project-card__go { z-index: 2; }

/* 5 · Parallax on project pages (set from JS) */
.project-cover img { transform: translateY(var(--py, 0px)) scale(1.1); will-change: transform; }
.gallery__col { transform: translateY(var(--py, 0px)); will-change: transform; }

/* 6 · Page transitions: fade the page out before the next one loads */
html.is-leaving body { opacity: 0; transition: opacity .3s ease; }

/* 7 · FAQ: plus turns into a minus; the answer height animates (JS) */
.faq summary::after { transition: transform .45s cubic-bezier(.16,1,.3,1), background .3s; }
.faq details[open] summary::after {
  transform: rotate(180deg);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M1 7h12' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M1 7h12' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
}
.faq details { overflow: hidden; }
.faq details.is-closing summary::after {
  transform: none; background: var(--purple);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M7 1v12M1 7h12' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M7 1v12M1 7h12' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
}
.faq__answer { animation: none; }

/* 8 · Stats tick up in Morse rhythm (— · · ·) with a green signal dot */
.stat { position: relative; }
.stat__tick { position: absolute; inset-block-start: 18px; inset-inline-end: 18px; width: 7px; height: 7px; background: var(--green); opacity: 0; box-shadow: 0 0 8px rgba(110,232,28,.8); }
.stat__tick.is-on { opacity: 1; transition: opacity .04s; }
.stat__tick:not(.is-on) { transition: opacity .25s ease; }

@media (prefers-reduced-motion: reduce) {
  .split .w { opacity: 1; filter: none; transform: none; transition: none; }
  .project-card { transform: none; }
  .project-cover img, .gallery__col { transform: none; }
}

/* ---------- Easter egg: Morse-B snake (assets/js/snake.js) ---------- */
.snake-open, .snake-open body { overflow: hidden; }
.snake {
  position: fixed; inset: 0; z-index: 90; background: #070707; color: #F4F3EE;
  opacity: 0; visibility: hidden; touch-action: none; user-select: none; -webkit-user-select: none; outline: none;
  transition: opacity .45s cubic-bezier(.65,0,.35,1), visibility 0s linear .45s;
}
.snake.is-open { opacity: 1; visibility: visible; transition: opacity .45s cubic-bezier(.65,0,.35,1); }
.snake__cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.snake__hud { position: absolute; inset-inline: 0; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; pointer-events: none; }
.snake__score { display: flex; align-items: baseline; gap: 12px; font-size: 16px; color: rgba(244,243,238,.55); }
.snake__score b { font-size: 32px; font-weight: 700; color: #6EE81C; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.snake__side { display: flex; align-items: center; gap: 20px; }
.snake__best { font-size: 16px; color: rgba(244,243,238,.55); }
.snake__best b { color: #F4F3EE; font-weight: 500; font-variant-numeric: tabular-nums; }
.snake__close {
  pointer-events: auto; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(244,243,238,.08); color: #F4F3EE; border: 0; transition: background .25s;
}
.snake__close:hover, .snake__close:focus-visible { background: rgba(244,243,238,.16); }
.snake__close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.snake__msg {
  position: absolute; inset-inline: 16px; top: 64%; text-align: center; pointer-events: none;
  opacity: 0; filter: blur(8px); transform: translateY(8px);
  transition: opacity .45s ease, filter .45s ease, transform .45s cubic-bezier(.22,1,.36,1);
}
.snake__msg.is-on { opacity: 1; filter: none; transform: none; }
.snake__msg h2 { font-size: clamp(36px, 6vw, 60px); font-weight: 700; line-height: 1.3; margin: 0 0 8px; color: #F4F3EE; }
.snake__msg p { font-size: 20px; margin: 0 0 16px; color: rgba(244,243,238,.75); }
.snake__msg small { font-size: 16px; color: rgba(244,243,238,.45); }
.snake-playing .cursor { opacity: 0 !important; }
@media (max-width: 599px) {
  .snake__score { font-size: 14px; gap: 8px; } .snake__score b { font-size: 24px; }
  .snake__best { font-size: 14px; } .snake__side { gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .snake, .snake.is-open, .snake__msg { transition: none; }
}

/* Snake game launcher: stacked above the WhatsApp button, logo colours (green on black) */
.snake-float {
  position: fixed; inset-block-end: 92px; inset-inline-end: 24px; z-index: 40;
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  background: #070707; color: #6EE81C; border: 0; padding: 0;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,.35), 0 2px 6px -2px rgba(0,0,0,.1);
  transition: transform .6s var(--ease), box-shadow .6s var(--ease);
}
.snake-float:hover { transform: scale(1.06); box-shadow: 0 14px 34px -10px rgba(0,0,0,.4), 0 2px 6px -2px rgba(0,0,0,.1); }
.snake-float svg { width: 32px; height: 32px; }
.snake-open .snake-float, .snake-open .wa-float { visibility: hidden; }

/* Animated brand elements are transparent: no placeholder tile behind them */
.gallery img[src*="-motion.svg"] { background: none; }
