.profile {
  position: relative;
  background-color: #00387f;
  padding: 1.8rem 1rem 2.2rem;
  margin-bottom: 2rem;
  text-align: center;
  user-select: none;
}

.photo img {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  display: block;
  margin: 0 auto;
  border: 2px solid #4aa3ff;
   object-fit: unset;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.cardless {
  margin-top: 22px;
}

/* === Hero === */
.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  padding: 28px;
  margin-bottom: 22px;
}

.hero-text h1 {
  color: var(--brand);
  margin: 0 0 12px;
  font-size: clamp(28px, 3.2vw, 40px);
  line-height: 1.2;
}

.hero .lead {
  color: #1f2937;
  font-weight: 600;
  margin: 0 0 6px;
}

.hero .sub {
  color: var(--muted);
  max-width: 820px;
}

.hero .cta {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}

/* === Tech badges row === */
.tech-badges {
  margin: .75rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.tech-badges li {
  font-size: .9rem;
  line-height: 1;
  padding: .45rem .6rem;
  border-radius: 999px;
  background: rgba(74, 163, 255, .10);
  color: #0f3d80;
  border: 1px solid rgba(74, 163, 255, .25);
}

/* Hero CTAs (Contact = primary) ,Buttons */
.hero-ctas {
  display: flex;
  gap: .75rem;
  align-items: center;
  flex-wrap: wrap;
}

.btn {
  border-radius: 10px;
  padding: .65rem 1.1rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center
}

.btn-primary {
  background: linear-gradient(180deg, #4aa3ff, #1c7bdb);
  color: #fff;
  border: none;
  box-shadow: 0 8px 20px rgba(28, 123, 219, .22);
}

.btn-primary:hover {
  filter: brightness(.98);
  transform: translateY(-1px)
}

.btn-ghost {
  background: #fff;
  color: #0f172a;
  border: 1px solid #e5e7eb;
}

.btn-ghost:hover {
  background: #f8fafc
}

.center {
  text-align: center;
  margin: 15px;
}

/* === Stats strip === */
.stats.card {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid #e6edf7;
  padding: 22px;
  position: relative;
}

.stats.card .stats-note {
  grid-column: 1 / -1;
  margin: 4px 6px 0;
  font-size: 12.5px;
  color: #7a8699;
  background: #f7faff;
  border: 1px dashed #e1eaf6;
  border-radius: 10px;
  padding: 8px 10px;
}

.stat {
  position: relative;
  background: linear-gradient(180deg, #f9fbff, #ffffff);
  border: 1px solid #e8eef6;
  border-radius: 14px;
  padding: 16px 14px;
  text-align: center;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, opacity .28s ease;
  will-change: transform;
  opacity: 0;
  transform: translateY(6px);
  outline: none;
}

.stat.revealed {
  opacity: 1;
  transform: none;
}

.stat::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 12px;
  background: radial-gradient(60% 60% at 50% 30%, rgba(28, 123, 219, .08), transparent 70%);
  pointer-events: none;
}

.stat:hover,
.stat:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 10px 18px rgba(28, 123, 219, .10);
  border-color: #d7e7ff;
}

.num {
  font-weight: 800;
  font-size: clamp(28px, 3.5vw, 44px);
  line-height: 1;
  color: #0f315a;
  letter-spacing: .5px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .6);
  display: inline-flex;
  align-items: baseline;
}

.num::after {
  margin-left: 2px;
  font-weight: 800;
  color: #0f315a;
}

.lbl {
  margin-top: 8px;
  font-size: 14px;
  color: #6b7280;
  letter-spacing: .2px;
}

.subnote {
  margin-top: 6px;
  font-size: 12.5px;
  color: #7a8699;
}

.stack-chips {
  margin: 10px auto 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.stack-chips li {
  font-size: 12.5px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f1f6ff;
  border: 1px solid #dfeafc;
  color: #0f315a;
  line-height: 1;
}

.stack-chips li.more {
  cursor: pointer;
  background: #e8f3ff;
  border-color: #cfe3ff;
  font-weight: 700;
}

.stack-chips.more-list {
  margin-top: 8px;
}

.flags {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  justify-content: center;
}

.flag {
  font-size: 18px;
  line-height: 1;
}

@media (max-width: 900px) {
  .stats.card {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 520px) {
  .stats.card {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {

  .stat,
  .stat.revealed {
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}

/* === Section title with accent underline === */
.section-title {
  color: #374151;
  font-size: 22px;
  margin: 26px 0 14px;
  position: relative;
  display: inline-block;
}

.section-title::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 62px;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), #6bc7ff);
  border-radius: 4px;
}

/* === Featured Expertise === */
.expertise-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.expert-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  padding: 18px;
  background: #fff;
  border: 1px solid #e6edf7;
  box-shadow: var(--shadow);
  transform: translateY(6px);
  opacity: .0;
  transition: transform .28s ease, box-shadow .28s ease, border-color .28s ease, opacity .3s ease;
}

.expert-card.revealed {
  transform: none;
  opacity: 1
}

.expert-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 14px;
  padding: 1px;
  background: linear-gradient(135deg, #bcd7ff 0%, #b1efe9 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: .55;
  pointer-events: none;
}

.expert-card:hover {
  transform: translateY(-4px);
  border-color: #d7e7ff;
  box-shadow: 0 12px 22px rgba(28, 123, 219, .12);
}

.expert-card .icon {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: radial-gradient(65% 65% at 50% 30%, rgba(28, 123, 219, .12), rgba(0, 0, 0, 0));
  border: 1px solid #e8eef6;
  box-shadow: 0 6px 12px rgba(28, 123, 219, .08) inset;
  transition: transform .25s ease, background .25s ease, box-shadow .25s ease;
}

.expert-card .icon span {
  font-size: 26px;
  transform: translateY(0);
  transition: transform .25s ease;
}

.expert-card:hover .icon {
  transform: translateY(-2px) scale(1.03);
}

.expert-card:hover .icon span {
  transform: translateY(-1px);
}

.expert-card h3 {
  margin: .8rem 0 .4rem;
  color: #0f315a;
  font-weight: 800;
  position: relative;
  display: inline-block;
}

.expert-card h3::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -6px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, #4aa3ff, #00a6a6);
  transition: right .35s ease;
}

.expert-card:hover h3::after {
  right: 0;
}

.expert-card p {
  margin: .35rem 0 0;
  color: #6b7280
}

/* (stagger) */
.expert-card[data-delay="1"] {
  transition-delay: .05s
}

.expert-card[data-delay="2"] {
  transition-delay: .12s
}

.expert-card[data-delay="3"] {
  transition-delay: .18s
}

.expert-card .icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #f2f7ff;
  border: 1px solid #e6edf7;
  box-shadow: 0 6px 14px rgba(28, 123, 219, .08) inset;
  margin-bottom: 10px;
}

.expert-card .icon i {
  font-size: 22px;
  color: var(--brand, #00387f);
}

.expert-card .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  margin-top: auto;
  padding-top: 8px;
}

.expert-card .tags span {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f6faff;
  border: 1px solid #e6edf7;
  color: #0f315a;
}

/* Grid responsive */
@media (max-width: 900px) {
  .expertise-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .expertise-grid {
    grid-template-columns: 1fr;
  }
}

/* === Recent Projects === */
.projects.scroller {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 1fr);
  gap: 16px;

  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  padding: 4px 2px 8px;
  -webkit-overflow-scrolling: touch;
}

.projects.scroller::-webkit-scrollbar {
  height: 8px
}

.projects.scroller::-webkit-scrollbar-track {
  background: #eef2f7;
  border-radius: 10px
}

.projects.scroller::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #bcd7ff, #b1efe9);
  border-radius: 10px;
}

/* === Project card – refined ================================ */
.project.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #fff;
  border: 1px solid #e6edf7;
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 16px 16px 14px;
  min-height: 188px;
  scroll-snap-align: start;
  transform: translateY(6px);
  opacity: 0;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease, opacity .3s ease;
  will-change: transform;
}

.project.card.revealed {
  transform: none;
  opacity: 1;
}

.project.card:hover {
  transform: translateY(-4px);
  border-color: #d7e7ff;
  box-shadow: 0 12px 22px rgba(28, 123, 219, .12);
}

.project.card:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(28, 123, 219, .25), 0 10px 22px rgba(28, 123, 219, .12);
  border-color: #cfe2ff;
}

.project.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(120px 60px at var(--mx, 50%) -20%, rgba(255, 255, 255, .65), transparent 60%);
  opacity: 0;
  transition: opacity .2s ease;
}

.project.card:hover::after {
  opacity: .6
}

.pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .3px;
  background: #e7f1ff;
  color: #0f315a;
  border: 1px solid #d3e2ff;
  padding: 6px 10px;
  border-radius: 999px;
  margin-bottom: 4px;
}

.pill.alt {
  background: #eafffb;
  color: #0f766e;
  border-color: #b9f4ea;
}

.project h3 {
  margin: .15rem 0 .2rem;
  color: #0f315a;
  font-weight: 800;
  line-height: 1.25;
}

.project p {
  color: #6b7280;
  margin: .1rem 0 .4rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tags {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tags span {
  font-size: 12px;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  padding: 4px 8px;
  border-radius: 999px;
  transition: background .2s ease, transform .2s ease, border-color .2s ease;
}

.project:hover .tags span {
  background: #e8eef6;
  border-color: #dbe7f5;
}

.tags span:hover {
  transform: translateY(-1px)
}

.projects.scroller.drag-hint {
  cursor: grab;
  background-attachment: local, local;
}

@media (max-width: 900px) {
  .projects.scroller {
    grid-auto-columns: 70%;
  }

  .project.card {
    min-height: 196px;
  }
}

@media (max-width: 560px) {
  .projects.scroller {
    grid-auto-columns: 88%;
  }

  .project.card {
    min-height: 206px;
  }
}

@media (prefers-reduced-motion: reduce) {

  .project.card,
  .project.card::after {
    transition: none !important;
    transform: none !important;
  }
}

/* === CTA banner === */
.cta-banner {
  margin-top: 22px;
  padding: 26px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  background: linear-gradient(180deg, #1b4477, #0f315a);
  color: #e7eef7;
}

.cta-banner h2 {
  color: #fff;
  margin: 0 0 6px;
}

.cta-banner p {
  color: #dbe8ff;
  margin: 0;
}

.cta-banner .btn-primary {
  background: linear-gradient(180deg, #5fb7ff, #2d85e6);
}

/* === Footer info === */
.footer-info {
  margin-top: 22px;
  padding: 22px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 18px;
}

.footer-info h4 {
  margin: .25rem 0 .35rem;
  color: #1f2937;
}

.footer-info p,
.footer-info li {
  color: #5b6472;
}

.footer-info .links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-info .links li {
  margin: .25rem 0;
}

/* micro */
.tiny {
  font-size: 12px;
}

.muted {
  color: #8b95a5;
}

/* === Responsive === */
@media (max-width:1024px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .hero-photo {
    order: -1;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .expertise-grid {
    grid-template-columns: 1fr 1fr;
  }

  .scroller {
    grid-template-columns: 1fr 1fr;
  }

  .cta-banner {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .footer-info {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width:640px) {
  .stats {
    grid-template-columns: 1fr;
  }

  .expertise-grid {
    grid-template-columns: 1fr;
  }

  .scroller {
    grid-template-columns: 1fr;
    scroll-snap-type: x mandatory;
    overflow-x: auto;
  }

  .project {
    min-width: 290px;
    scroll-snap-align: start;
  }

  .footer-info {
    grid-template-columns: 1fr;
  }
}

/* arabic-content (RTL) */
.arabic-content {
    direction: rtl;
    text-align: right;
}

.arabic-content .hero {
    text-align: right;
}

.arabic-content .hero-text h1 {
    text-align: right;
}

.arabic-content .hero .lead,
.arabic-content .hero .sub {
    text-align: right;
}

.arabic-content .tech-badges {
    justify-content: flex-end;
}

.arabic-content .stack-chips {
    justify-content: center;
}

.arabic-content .flags {
    justify-content: center;
}

.arabic-content .section-title {
    text-align: right;
}

.arabic-content .section-title::before {
    right: 0;
    left: auto;
}

.arabic-content .expert-card h3 {
    text-align: right;
}

.arabic-content .expert-card h3::after {
    right: 0;
    left: auto;
}

.arabic-content .project h3,
.arabic-content .project p {
    text-align: right;
}

.arabic-content .tags {
    justify-content: flex-start;
}

.arabic-content .footer-info {
    text-align: right;
}

.arabic-content .footer-info .links {
    text-align: right;
}

.arabic-content .cta-banner {
    text-align: right;
}

.arabic-content .cta-banner h2,
.arabic-content .cta-banner p {
    text-align: right;
}

.arabic-content .cta-banner .btn {
    margin-right: auto;
    margin-left: 0;
}