/* ------------------------------------------------------------------
   About page — editorial redesign. Loaded last on /about/.
   Red + off-white brand, big readable type, a real timeline.
   "html body" prefix out-ranks the page's older inline rules.
------------------------------------------------------------------- */
html body { --cream: #f6e2b7; --cream-2: #e9d3a8; --red: #85170a; --red-2: #571018; --hot: #e0644a; --soft: #d9c3a2; background: #120807; color: var(--cream); }
html body main { overflow: clip; }
html body .reveal { transition-duration: 1.1s; }

/* ---------- hero ---------- */
html body .about-hero {
  position: relative; min-height: min(92svh, 980px); display: flex; flex-direction: column; justify-content: flex-end;
  padding: 140px 8% clamp(50px, 7vw, 100px); border: 0;
  background: linear-gradient(100deg, rgba(133, 23, 10, .94), rgba(87, 16, 24, .96)), url("/assets/essam-pattern-tile.webp") repeat;
  background-size: auto, 420px;
}
html body .about-hero::after {
  content: ""; position: absolute; inset-inline-end: 6%; top: 50%; width: clamp(160px, 22vw, 340px); aspect-ratio: 127 / 240;
  transform: translateY(-58%) rotate(-6deg); opacity: .16; pointer-events: none;
  background: url("/assets/essam-mark.png") center / contain no-repeat; animation: floatMark 9s ease-in-out infinite;
}
@keyframes floatMark { 50% { transform: translateY(-62%) rotate(-3deg); } }
html body .about-hero .eyebrow { font-size: 13px; letter-spacing: .18em; color: var(--cream-2); opacity: .9; }
html body .about-hero h1 {
  position: relative; z-index: 1; margin: 22px 0 30px; max-width: 14ch;
  font-size: clamp(52px, 8.4vw, 148px); line-height: 1.22; font-weight: 600; letter-spacing: -.01em; color: var(--cream);
}
html[lang="ar"] body .about-hero h1 em { background: none !important; color: #f6e2b7; opacity: .78; }
html body .about-hero h1 em {
  font-style: normal; font-weight: 300; color: var(--cream);
  background: linear-gradient(transparent 78%, rgba(246, 226, 183, .28) 78% 90%, transparent 90%);
}
html body .about-hero .role { display: flex; flex-wrap: wrap; gap: 10px; font-size: 0; }
html body .about-hero .role::before { content: none; }
html body .role-chip { font: 500 12px/1 'Instrument Sans', sans-serif; letter-spacing: .12em; padding: 11px 16px; border: 1px solid rgba(246, 226, 183, .35); border-radius: 99px; color: var(--cream); }
html body .scroll-hint { position: absolute; inset-inline-start: 8%; bottom: 26px; font: 500 11px/1 'Instrument Sans', sans-serif; letter-spacing: .22em; color: var(--cream-2); opacity: .7; }

/* ---------- bio ---------- */
html body .bio-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .9fr); gap: clamp(40px, 7vw, 120px); align-items: center; padding: clamp(80px, 10vw, 150px) 8%; }
html body .bio-layout .lead { font-size: clamp(26px, 2.9vw, 46px); line-height: 1.55; font-weight: 500; color: var(--cream); margin: 0 0 34px; }
html body .bio-layout .muted { font-size: clamp(16px, 1.2vw, 19px); line-height: 2; color: var(--soft); max-width: 640px; }
html body .stats { gap: clamp(30px, 5vw, 80px); border-top: 1px solid rgba(246, 226, 183, .18); padding-top: 34px; margin-top: 44px; }
html body .stats b { font: 400 clamp(60px, 6.5vw, 110px)/1 'Instrument Serif', Georgia, serif; color: var(--cream); letter-spacing: -.02em; }
html body .stats p { font-size: 14px; color: var(--hot); margin-top: 10px; }
html body .about .portrait, html body .bio-layout .portrait { max-width: 520px; justify-self: center; transform: rotate(3deg); border: 8px solid var(--red); box-shadow: 16px 16px 0 var(--cream); transition: transform .8s cubic-bezier(.22, .9, .24, 1); }
html body .bio-layout .portrait:hover { transform: rotate(0deg) scale(1.01); }

/* ---------- section titles ---------- */
html body .kicker { display: inline-flex; align-items: center; gap: 12px; font: 500 13px/1 'Instrument Sans', sans-serif; letter-spacing: .16em; color: var(--hot); margin-bottom: 22px; }
html body .kicker::before { content: ""; width: 36px; height: 1px; background: currentColor; }
html body .experience h2, html body .expertise h2, html body .about-contact h2, html body .page-cta h2 {
  font-size: clamp(40px, 6vw, 104px); line-height: 1.2; font-weight: 600; color: var(--cream); letter-spacing: -.01em; margin: 0 0 clamp(40px, 5vw, 70px);
}

/* ---------- experience timeline ---------- */
html body .experience { padding: clamp(80px, 10vw, 150px) 8%; border-top: 1px solid rgba(246, 226, 183, .12); }
html body .timeline { margin: 0; counter-reset: job; }
html body .job {
  position: relative; display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: clamp(24px, 4vw, 70px);
  padding: clamp(30px, 3.4vw, 48px) clamp(0px, 2vw, 28px); border-top: 1px solid rgba(246, 226, 183, .16);
  transition: background .6s, padding .6s;
}
html body .job:last-child { border-bottom: 1px solid rgba(246, 226, 183, .16); }
html body .job::before { counter-increment: job; content: "0" counter(job); position: absolute; inset-inline-end: 0; top: clamp(30px, 3.4vw, 48px); font: italic 400 clamp(40px, 4vw, 64px)/1 'Instrument Serif', Georgia, serif; color: rgba(246, 226, 183, .14); transition: color .6s; }
html body .job:hover { background: linear-gradient(90deg, rgba(133, 23, 10, .35), rgba(87, 16, 24, .15)); }
html body .job:hover::before { color: rgba(246, 226, 183, .5); }
html body .job time { font: italic 400 clamp(22px, 2vw, 30px)/1.2 'Instrument Serif', Georgia, serif; color: var(--hot); direction: ltr; text-align: start; }
html body .job h3 { font-size: clamp(24px, 2.3vw, 36px); line-height: 1.45; font-weight: 600; color: var(--cream); margin: 0 0 10px; padding-inline-end: 80px; }
html body .job h4 { font-size: clamp(14px, 1.1vw, 17px); line-height: 1.7; font-weight: 500; color: var(--cream-2); margin: 0 0 14px; opacity: .85; }
html body .job p { font-size: clamp(15px, 1.15vw, 18px); line-height: 2; color: var(--soft); max-width: 780px; margin: 0; }

/* ---------- expertise ---------- */
html body .expertise { padding: clamp(80px, 10vw, 150px) 8%; background: linear-gradient(100deg, rgba(133, 23, 10, .92), rgba(87, 16, 24, .95)), url("/assets/essam-pattern-tile.webp") repeat; background-size: auto, 420px; }
html body .expertise .kicker { color: var(--cream-2); }
html body .expertise-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2vw, 28px); margin: 0; counter-reset: ex; }
html body .expertise article {
  position: relative; padding: clamp(28px, 3vw, 44px); border: 1px solid rgba(246, 226, 183, .22); border-radius: 18px; background: rgba(18, 8, 7, .28);
  backdrop-filter: blur(6px); transition: transform .6s cubic-bezier(.22, .9, .24, 1), background .6s;
}
html body .expertise article:hover { transform: translateY(-8px); background: rgba(18, 8, 7, .5); }
html body .expertise article::before { counter-increment: ex; content: "0" counter(ex); display: block; font: italic 400 54px/1 'Instrument Serif', Georgia, serif; color: var(--cream); opacity: .55; margin-bottom: 34px; }
html body .expertise h3 { font-size: clamp(24px, 2.1vw, 32px); font-weight: 600; line-height: 1.4; color: var(--cream); margin: 0 0 12px; }
html body .expertise p { font-size: clamp(15px, 1.1vw, 17px); line-height: 2; color: #f0dcc0; margin: 0; }
html body .tools { display: flex; flex-wrap: wrap; gap: 10px; margin-top: clamp(36px, 4vw, 56px); }
html body .tools span { font: 500 14px/1 'Instrument Sans', sans-serif; padding: 12px 18px; border-radius: 99px; background: var(--cream); color: var(--red); }

/* ---------- education / languages ---------- */
html body .education { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(30px, 5vw, 90px); padding: clamp(80px, 10vw, 140px) 8%; }
html body .education > div { border-top: 1px solid rgba(246, 226, 183, .2); padding-top: 30px; }
html body .education h3 { font-size: clamp(28px, 2.8vw, 44px); line-height: 1.35; font-weight: 600; color: var(--cream); margin: 0 0 14px; }
html body .education p { font-size: clamp(16px, 1.2vw, 19px); line-height: 2; color: var(--soft); }

/* ---------- contact ---------- */
html body .about-contact { padding: clamp(80px, 10vw, 140px) 8%; border-top: 1px solid rgba(246, 226, 183, .12); }
html body .about-contact > p { font-size: 17px; color: var(--soft); margin: -30px 0 40px; }
html body .contact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; }
html body .contact-grid a { display: block; padding: 28px 0; border-top: 1px solid rgba(246, 226, 183, .16); transition: padding .5s, color .4s; }
html body .contact-grid a:nth-child(odd) { padding-inline-end: 30px; }
html body .contact-grid small { display: block; font-size: 13px; color: var(--hot); margin-bottom: 10px; }
html body .contact-grid strong { font: 500 clamp(18px, 1.8vw, 28px)/1.3 'Instrument Sans', sans-serif; color: var(--cream); direction: ltr; unicode-bidi: isolate; }
html body .contact-grid a:hover strong { color: #fff; }
html body .contact-grid a:hover { padding-inline-start: 12px; }

/* ---------- closing CTA ---------- */
html body .page-cta { padding: clamp(90px, 12vw, 180px) 8%; text-align: center; background: linear-gradient(100deg, rgba(133, 23, 10, .94), rgba(87, 16, 24, .96)), url("/assets/essam-pattern-tile.webp") repeat; background-size: auto, 420px; }
html body .page-cta h2 { max-width: 16ch; margin-inline: auto; }
html body .page-cta a { display: inline-flex; padding: 18px 32px; border-radius: 99px; background: var(--cream); color: var(--red); font-size: 17px; font-weight: 600; transition: transform .4s, box-shadow .4s; }
html body .page-cta a:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .6); }

/* ---------- English: serif headlines ---------- */
html[lang="en"] body :is(.about-hero h1, .experience h2, .expertise h2, .about-contact h2, .page-cta h2, .education h3, .bio-layout .lead) {
  font-family: 'Instrument Serif', Georgia, serif; font-weight: 400; letter-spacing: -.015em; line-height: 1.05;
}
html[lang="en"] body .about-hero h1 em { font-style: italic; font-weight: 400; }
html[lang="en"] body .bio-layout .lead { line-height: 1.25; }
html[lang="en"] body :is(.job h3, .expertise h3) { font-family: 'Instrument Serif', Georgia, serif; font-weight: 400; font-size: clamp(28px, 2.6vw, 40px); line-height: 1.15; }

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  html body .bio-layout, html body .education, html body .contact-grid { grid-template-columns: 1fr; }
  html body .expertise-grid { grid-template-columns: 1fr; }
  html body .job { grid-template-columns: 1fr; gap: 12px; }
  html body .job h3 { padding-inline-end: 60px; }
  html body .about-hero { min-height: min(80svh, 760px); padding-top: 120px; }
  html body .about-hero::after { opacity: .1; inset-inline-end: -4%; }
}
@media (prefers-reduced-motion: reduce) { html body .about-hero::after { animation: none; } }
html body .contact-grid a { border: 0 !important; border-top: 1px solid rgba(246, 226, 183, .16) !important; background: none !important; border-radius: 0 !important; }
html body .page-cta { display: flex; flex-direction: column; align-items: center; gap: 10px; }
html body .job h4, html body .about-hero .role, html body .contact-grid strong { letter-spacing: 0 !important; }

/* phones: the side rail becomes a small floating pill; timeline numbers step aside */
@media (max-width: 700px) {
  html body nav.side-navigation { top: 12px; right: 12px; left: auto; width: auto; height: auto; padding: 6px; flex-direction: row; gap: 6px; border-radius: 99px; }
  html body nav.side-navigation .rail-label { display: none; }
  html body nav.side-navigation .rail-home img { height: 34px; width: auto; }
  html body nav.side-navigation #lang { writing-mode: horizontal-tb; transform: none; padding: 0 8px; }
  html body .job::before { display: none; }
  html body .job h3 { padding-inline-end: 0; }
  html body .about-hero { padding-top: 110px; }
}
