:root {
  --paper: #f3efe6;
  --ink: #191512;
  --muted: #655d54;
  --line: #ddd4c6;
  --card: #fffdf8;
  --clay: #a33b32;
  --sand: #e8dfd1;
  --shadow: 0 16px 36px rgba(25, 21, 18, 0.08);
  --serif: "Fraunces", "Times New Roman", serif;
  --sans: "Outfit", "Segoe UI", sans-serif;
  --arabic: "IBM Plex Sans Arabic", "Segoe UI", sans-serif;
  --nav-h: 64px;
  --pad: clamp(16px, 4vw, 40px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  overflow-x: clip;
  background:
    radial-gradient(900px 420px at 100% -10%, rgba(163, 59, 50, 0.08), transparent 60%),
    var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.55;
}
body.lang-ar { font-family: var(--arabic); direction: rtl; }
body.lang-en .ar, body.lang-ar .en { display: none; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible {
  outline: 2px solid var(--clay);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  inset-inline-start: 12px;
  top: -48px;
  background: var(--ink);
  color: var(--paper);
  padding: 8px 12px;
  z-index: 30;
}
.skip:focus { top: 12px; }

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--nav-h);
  padding: 10px var(--pad);
  padding-top: max(10px, env(safe-area-inset-top));
  background: rgba(243, 239, 230, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
}
.nav.scrolled { border-bottom-color: var(--line); }
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  text-decoration: none;
  font-weight: 650;
  letter-spacing: 0.02em;
}
.brand-name { white-space: nowrap; }
.mark {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--paper);
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 14px;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.95rem;
}
.nav-links a:hover { color: var(--ink); }
.nav-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.lang-btn, .menu-btn, .filter-btn {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 999px;
  min-height: 40px;
  padding: 8px 14px;
  font: inherit;
  cursor: pointer;
}
.lang-btn { font-size: 0.85rem; }
.menu-btn { display: none; }
.hire {
  text-decoration: none;
  background: var(--ink);
  color: var(--paper) !important;
  border-radius: 999px;
  padding: 8px 14px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}

.wrap { width: min(1080px, calc(100% - (var(--pad) * 2))); margin: 0 auto; }
section { padding: 56px 0; scroll-margin-top: calc(var(--nav-h) + 12px); }
.hero { padding: 48px 0 8px; }

.kicker {
  margin: 0 0 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--clay);
  font-weight: 650;
}
.kicker-light { color: #e7b2ac; }
body.lang-ar .kicker { letter-spacing: 0; text-transform: none; font-size: 0.92rem; }

h1 {
  font-family: var(--serif);
  font-weight: 560;
  font-size: clamp(2.7rem, 7vw, 5.6rem);
  line-height: 0.94;
  letter-spacing: -0.03em;
  margin: 0;
}
body.lang-ar h1, body.lang-ar h2, body.lang-ar h3 { font-family: var(--arabic); letter-spacing: 0; }
body.lang-ar h1 { font-weight: 600; line-height: 1.15; }
.role {
  margin: 16px 0 0;
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  max-width: 38rem;
}
.lede { max-width: 40rem; color: var(--muted); margin: 12px 0 0; }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  border-radius: 999px;
  min-height: 46px;
  padding: 12px 18px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
}
.btn.ghost { background: transparent; color: var(--ink); }

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 36px 0 8px;
  padding: 0;
  list-style: none;
}
.stats li { border-top: 1px solid var(--ink); padding-top: 12px; min-width: 0; }
.stats strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 560;
}
.stats span { color: var(--muted); font-size: 0.9rem; }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 18px;
}
h2 {
  font-family: var(--serif);
  font-weight: 520;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  margin: 0;
  letter-spacing: -0.03em;
}
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-btn[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  text-align: start;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
}
.card.hidden { display: none; }
.card:hover { border-color: #c9bba8; }
.visual img, .word { transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1); }
.visual {
  height: 188px;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  flex: none;
}
.visual img {
  width: auto;
  max-width: 68%;
  max-height: 128px;
  object-fit: contain;
}
.word {
  font-family: var(--serif);
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  color: var(--paper);
  letter-spacing: -0.03em;
}
.card-body { padding: 14px 16px 16px; }
.card-body p { margin: 6px 0 0; color: var(--muted); font-size: 0.95rem; }
.meta-row, .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--muted);
}
body.lang-ar .tag { letter-spacing: 0; text-transform: none; font-size: 0.8rem; }
h3 { margin: 8px 0 0; font-size: 1.25rem; font-weight: 640; }

.bg-ink { background: #101010; }
.bg-wine { background: #6e1722; }
.bg-green { background: #173422; }
.bg-gold { background: #111; }
.bg-sand { background: #f7f4ee; }
.bg-plum { background: #2a2438; }
.bg-forest { background: #1c3330; }

@media (min-width: 901px) {
  .card.feature {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  }
  .card.feature .visual { height: 100%; min-height: 280px; }
  .card.feature .visual img { max-height: 180px; max-width: 42%; }
  .card.feature .card-body { padding: 28px 28px 24px; align-self: center; }
}

.timeline { display: grid; }
.job {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 20px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
}
.when { color: var(--muted); font-size: 0.92rem; margin: 4px 0 0; }
.job ul { margin: 8px 0 0; padding-inline-start: 18px; color: var(--muted); }
.job li + li { margin-top: 6px; }

.skill-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.edu-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 14px;
  align-items: start;
}
.edu-grid > div { display: grid; gap: 14px; }
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  min-width: 0;
}
.panel h3 { margin-top: 0; font-size: 1.05rem; }
.panel p { margin: 8px 0 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip {
  background: var(--sand);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.88rem;
}
.certs { margin: 8px 0 0; padding-inline-start: 18px; color: var(--muted); }
.certs li + li { margin-top: 8px; }

.contact {
  background: var(--ink);
  color: var(--paper);
  border-radius: 24px;
  padding: clamp(20px, 4vw, 36px);
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(220px, 0.7fr);
  gap: 24px;
  align-items: start;
}
.contact h2 { color: var(--paper); }
.contact p { color: #d9d0c4; max-width: 36rem; }
.contact .btn { background: var(--paper); color: var(--ink); border-color: var(--paper); margin-top: 8px; }
.contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.contact-list a {
  color: var(--paper);
  text-decoration: none;
  border-bottom: 1px solid rgba(243, 239, 230, 0.35);
  overflow-wrap: anywhere;
}

footer {
  padding: 18px var(--pad) calc(28px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

dialog {
  width: min(640px, calc(100% - 32px));
  max-height: min(860px, calc(100% - 32px));
  margin: auto;
  overflow: auto;
  border: none;
  border-radius: 20px;
  padding: 0;
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(25, 21, 18, 0.5); }
.dialog-visual { height: 200px; display: grid; place-items: center; overflow: hidden; }
.dialog-visual img { max-width: 70%; max-height: 140px; object-fit: contain; }
.dialog-visual .word { font-size: 2.2rem; }
.dialog-copy { padding: 16px 18px 22px; }
.dialog-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.dialog-copy h3 { font-family: var(--serif); font-size: clamp(1.6rem, 4vw, 2rem); margin: 10px 0; }
body.lang-ar .dialog-copy h3 { font-family: var(--arabic); }
#dialog-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
#dialog-links a {
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--ink);
  border-radius: 999px;
  min-height: 40px;
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
}
.close-btn {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: var(--paper);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
}

@media (max-width: 980px) {
  .skill-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .menu-btn { display: inline-flex; align-items: center; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    inset-inline: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--card);
    border-bottom: 1px solid var(--line);
    padding: 8px var(--pad) 16px;
    box-shadow: var(--shadow);
  }
  .nav-links.open { display: flex; }
  .nav-links li { border-top: 1px solid var(--line); }
  .nav-links li:first-child { border-top: 0; }
  .nav-links a {
    display: flex;
    align-items: center;
    min-height: 48px;
    color: var(--ink);
  }
  .nav-links .hire {
    margin-top: 8px;
    justify-content: center;
    border-top: 0;
  }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .work-grid, .edu-grid, .contact, .job { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; align-items: stretch; }
  .card.feature { display: flex; }
  .card.feature .visual { height: 188px; min-height: 0; }
  footer { flex-direction: column; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .skill-grid { grid-template-columns: 1fr; }
  .cta-row { flex-direction: column; }
  .cta-row .btn { width: 100%; }
  .contact { border-radius: 18px; }
  dialog {
    width: 100%;
    max-width: 100%;
    max-height: 92vh;
    height: auto;
    margin: 0;
    margin-top: auto;
    border-radius: 18px 18px 0 0;
  }
  .dialog-visual { height: 160px; }
}

@media (max-width: 380px) {
  .brand-name { display: none; }
  h1 { font-size: 2.45rem; }
}

.hero { position: relative; overflow: clip; }
.orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(8px);
  z-index: 0;
}
.orb-a {
  width: 280px;
  height: 280px;
  top: -80px;
  inset-inline-end: -40px;
  background: radial-gradient(circle, rgba(163, 59, 50, 0.28), transparent 68%);
  animation: drift 16s ease-in-out infinite;
}
.orb-b {
  width: 220px;
  height: 220px;
  bottom: 40px;
  inset-inline-start: -70px;
  background: radial-gradient(circle, rgba(35, 66, 55, 0.22), transparent 68%);
  animation: drift 18s ease-in-out infinite reverse;
}
.hero .wrap { position: relative; z-index: 1; }

.hero .kicker,
.hero h1,
.hero .role,
.hero .lede,
.hero .cta-row,
.hero .stats li {
  animation: rise 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.hero h1 { animation-delay: 0.08s; }
.hero .role { animation-delay: 0.16s; }
.hero .lede { animation-delay: 0.24s; }
.hero .cta-row { animation-delay: 0.32s; }
.hero .stats li:nth-child(1) { animation-delay: 0.4s; }
.hero .stats li:nth-child(2) { animation-delay: 0.48s; }
.hero .stats li:nth-child(3) { animation-delay: 0.56s; }
.hero .stats li:nth-child(4) { animation-delay: 0.64s; }

.marquee {
  overflow: hidden;
  border-block: 1px solid var(--line);
  margin-top: 28px;
  padding: 14px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track {
  display: flex;
  gap: 0;
  width: max-content;
  animation: ticker 28s linear infinite;
}
.marquee span {
  padding-inline: 22px;
  color: var(--muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 650;
}
.marquee span::before {
  content: "·";
  margin-inline-end: 22px;
  color: var(--clay);
}
body.lang-ar .marquee-track { animation-direction: reverse; }

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.in { opacity: 1; transform: none; }

.btn, .hire, .filter-btn, .lang-btn, .menu-btn {
  transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}
.card {
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease, border-color 0.35s ease, opacity 0.45s ease;
}
.nav-links.open { animation: menu-in 0.28s ease; }
dialog { animation: dialog-in 0.38s cubic-bezier(0.22, 1, 0.36, 1); }
dialog::backdrop { animation: fade-in 0.3s ease; }

@media (hover: hover) {
  .btn:hover, .hire:hover { transform: translateY(-2px); }
  .btn:hover { box-shadow: 0 10px 24px rgba(25, 21, 18, 0.16); }
  .filter-btn:hover, .lang-btn:hover, .menu-btn:hover { transform: translateY(-1px); }
  .card:hover {
    transform: translateY(-8px);
    box-shadow: 0 24px 50px rgba(25, 21, 18, 0.14);
  }
  .card:hover .visual img,
  .card:hover .word { transform: scale(1.08); }
  .nav-links a:not(.hire) { position: relative; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: none; }
}
@keyframes drift {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(18px, 24px, 0); }
}
@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@keyframes menu-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}
@keyframes dialog-in {
  from { opacity: 0; transform: translateY(28px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .reveal { opacity: 1; transform: none; }
}
