/* ============================================================
   Hazem Abdullah — Portfolio
   Style: light, bento cards, mint accent, big rounded corners
   ============================================================ */

:root {
  --bg: #e7ebf0;
  --bg-2: #eef1f5;
  --card: #ffffff;
  --ink: #0e0f12;          /* near-black cards */
  --ink-2: #17181d;
  --accent: #3ce08a;       /* mint green */
  --accent-strong: #23c774;
  --accent-ink: #0b8f52;   /* darker green — legible small text on light bg */
  --accent-soft: #d9f7e7;

  --text: #0e0f12;
  --muted: #5b6572;
  --muted-2: #8a93a1;
  --on-dark: #f5f7f9;
  --on-dark-muted: #a9b2bf;
  --on-accent: #06331f;    /* text on mint */

  --border: rgba(14, 15, 18, 0.08);
  --border-2: rgba(14, 15, 18, 0.14);

  --r-xl: 40px;
  --r-lg: 30px;
  --r: 22px;
  --r-sm: 16px;

  --maxw: 1200px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow: 0 30px 60px -30px rgba(14, 15, 18, 0.18);
  --shadow-sm: 0 12px 30px -18px rgba(14, 15, 18, 0.22);

  --font-display: 'Poppins', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 100px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent); color: var(--on-accent); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(16px, 4vw, 32px); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 15px 30px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 600; font-size: 15px;
  cursor: pointer; border: 1px solid transparent;
  transition: transform 0.2s var(--ease), box-shadow 0.3s var(--ease), background 0.25s, color 0.25s;
}
.btn--dark { background: var(--ink); color: var(--on-dark); }
.btn--dark:hover { transform: translateY(-2px); box-shadow: 0 16px 34px -14px rgba(14,15,18,0.5); }
.btn--mint { background: var(--accent); color: var(--on-accent); }
.btn--mint:hover { transform: translateY(-2px); background: var(--accent-strong); box-shadow: 0 16px 34px -16px rgba(35,199,116,0.7); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--border-2); }
.btn--ghost:hover { transform: translateY(-2px); border-color: var(--ink); }
.btn--light { background: #fff; color: var(--ink); }
.btn--light:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }

/* circular arrow button */
.arrow-btn {
  width: 90px; height: 90px; border-radius: 50%;
  display: grid; place-items: center;
  background: #fff; color: var(--ink);
  border: 0; cursor: pointer; flex-shrink: 0;
  transition: transform 0.25s var(--ease), background 0.25s;
}
.arrow-btn svg { width: 24px; height: 24px; transition: transform 0.25s var(--ease); }
.arrow-btn:hover { transform: rotate(-45deg); }

/* ---------- Navigation ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px clamp(16px, 4vw, 40px);
  transition: background 0.3s var(--ease), box-shadow 0.3s, padding 0.3s var(--ease);
}
.nav.scrolled {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 var(--border);
  padding-top: 14px; padding-bottom: 14px;
}
.nav__brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; font-size: 22px; letter-spacing: -0.5px; }
.nav__brand .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.nav__links { display: flex; align-items: center; gap: 34px; }
.nav__links a { color: var(--muted); font-size: 15px; font-weight: 500; transition: color 0.2s; }
.nav__links a:hover { color: var(--ink); }
.nav__right { display: flex; align-items: center; gap: 14px; }
.nav__cta { padding: 13px 26px; border-radius: 999px; background: var(--ink); color: var(--on-dark) !important; font-family: var(--font-display); font-weight: 600; font-size: 15px; transition: transform 0.2s var(--ease); }
.nav__cta:hover { transform: translateY(-2px); }
.lang-toggle {
  font-family: var(--font-mono); font-size: 13px; font-weight: 500;
  color: var(--ink); padding: 9px 14px; min-width: 56px;
  border: 1px solid var(--border-2); border-radius: 999px;
  background: rgba(255,255,255,0.6); cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.lang-toggle:hover { border-color: var(--ink); background: #fff; }
.nav__toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 6px; }
.nav__toggle span { width: 24px; height: 2px; background: var(--ink); border-radius: 2px; transition: 0.3s var(--ease); }

/* ---------- Hero ---------- */
.hero { padding: 104px 0 20px; }
.hero__card {
  background: var(--card);
  border-radius: var(--r-xl);
  padding: clamp(28px, 5vw, 64px);
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 40px; align-items: center;
  box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-mono); font-size: 14.5px; font-weight: 500; color: var(--accent-ink);
  padding: 9px 17px; border: 1px solid var(--border-2); border-radius: 999px;
  margin-bottom: 24px;
}
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(60,224,138,0.6); animation: pulse 2s infinite; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(60,224,138,.6)} 70%{box-shadow:0 0 0 9px rgba(60,224,138,0)} 100%{box-shadow:0 0 0 0 rgba(60,224,138,0)} }
.hero__title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(38px, 5.6vw, 68px); line-height: 1.03; letter-spacing: -2px;
  margin-bottom: 22px;
}
.hero__title .mint { color: var(--accent-strong); }
.hero__lede { color: var(--muted); font-size: clamp(15px, 1.6vw, 18px); max-width: 480px; margin-bottom: 32px; }
.hero__lede strong { color: var(--ink); font-weight: 600; }
.hero__actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 30px; }
.hero__meta { display: flex; flex-wrap: wrap; gap: 10px 20px; font-family: var(--font-mono); font-size: 13px; color: var(--muted-2); }

/* Portrait */
.portrait {
  position: relative; aspect-ratio: 1 / 1; width: 100%; max-width: 420px; margin-inline: auto;
  border-radius: var(--r-lg); overflow: hidden;
  background: linear-gradient(160deg, var(--accent-soft), #eef1f5);
  box-shadow: var(--shadow-sm);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.portrait--empty::after {
  content: 'HA'; position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 800; font-size: 96px; color: var(--accent-strong);
}
.portrait__badge {
  position: absolute; left: 16px; bottom: 16px; z-index: 2;
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.92); backdrop-filter: blur(6px);
  padding: 9px 15px; border-radius: 999px;
  font-size: 13px; font-weight: 600; color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.portrait__ring { position: absolute; inset: 0; border: 3px solid rgba(60,224,138,0.5); border-radius: var(--r-lg); pointer-events: none; }

/* ---------- Pillar cards (entrepreneur / CTO / AI expert) ---------- */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 20px; }
.feature {
  border-radius: var(--r-lg); padding: clamp(26px, 3vw, 40px);
  min-height: 230px; display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.feature__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.feature h3 { font-family: var(--font-display); font-weight: 600; font-size: clamp(26px, 3vw, 38px); letter-spacing: -1px; line-height: 1.05; }
.feature p { font-size: 16px; max-width: 460px; margin-top: 16px; }
.feature--dark { background: var(--ink); color: var(--on-dark); }
.feature--dark p { color: var(--on-dark-muted); }
.feature--mint { background: var(--accent); color: var(--on-accent); }
.feature--mint p { color: #0b492e; }
.feature--mint .arrow-btn { background: var(--ink); color: #fff; }
.feature--light { background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); }
.feature--light p { color: var(--muted); }
.feature--light .arrow-btn { background: var(--ink); color: #fff; }
.feature h3 { font-size: clamp(24px, 2.4vw, 32px); }
.arrow-btn { width: 64px; height: 64px; }
.arrow-btn svg { width: 20px; height: 20px; }

/* ---------- Bento row ---------- */
.bento { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
.bento__card { background: var(--card); border-radius: var(--r-lg); padding: clamp(28px, 4vw, 46px); box-shadow: var(--shadow-sm); }
.checklist { list-style: none; display: grid; gap: 20px; }
.checklist li { display: flex; align-items: center; gap: 16px; font-size: clamp(17px, 2vw, 21px); font-weight: 500; }
.check {
  width: 30px; height: 30px; border-radius: 50%; background: var(--accent);
  display: grid; place-items: center; flex-shrink: 0;
}
.check svg { width: 15px; height: 15px; color: var(--on-accent); }
.bento__big h3 { font-family: var(--font-display); font-weight: 700; font-size: clamp(30px, 4vw, 46px); letter-spacing: -1.5px; line-height: 1.08; }
.bento__big h3 .mint { color: var(--accent-strong); }
.bento__big p { color: var(--muted); font-size: 16px; margin: 18px 0 26px; }

/* ---------- Sections ---------- */
.section { padding: clamp(64px, 9vw, 110px) 0 0; }
.section__head { margin-bottom: 44px; max-width: 720px; }
.section__tag { font-family: var(--font-mono); font-size: 13.5px; font-weight: 500; color: var(--accent-ink); text-transform: uppercase; letter-spacing: 1px; }
.section__title { font-family: var(--font-display); font-weight: 700; font-size: clamp(28px, 4.2vw, 46px); letter-spacing: -1.4px; line-height: 1.12; margin-top: 12px; }
.section__sub { color: var(--muted); font-size: 17px; margin-top: 14px; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.stat { background: var(--card); border-radius: var(--r); padding: 30px 26px; box-shadow: var(--shadow-sm); transition: transform 0.3s var(--ease); }
.stat:hover { transform: translateY(-4px); }
.stat__num { font-family: var(--font-display); font-weight: 800; font-size: clamp(30px, 4vw, 46px); line-height: 1; color: var(--accent-strong); }
.stat__label { display: block; margin-top: 10px; font-size: 14px; color: var(--muted); }

/* Timeline */
.timeline { position: relative; padding-left: 34px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(var(--accent), var(--border)); }
.tl { position: relative; padding-bottom: 20px; }
.tl__marker { position: absolute; left: -34px; top: 26px; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); }
.tl__body { background: var(--card); border-radius: var(--r); padding: 26px 30px; box-shadow: var(--shadow-sm); transition: transform 0.3s var(--ease); }
.tl__body:hover { transform: translateX(6px); }
.tl__top { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.tl__top h3 { font-family: var(--font-display); font-weight: 600; font-size: 21px; letter-spacing: -0.5px; }
.tl__period { font-family: var(--font-mono); font-size: 13px; color: var(--accent-strong); white-space: nowrap; }
.tl__org { color: var(--muted); font-weight: 500; margin: 4px 0 16px; font-size: 15px; }
.tl__points { list-style: none; display: grid; gap: 9px; }
.tl__points li { position: relative; padding-left: 22px; color: var(--muted); font-size: 15px; }
.tl__points li::before { content: '▹'; position: absolute; left: 0; color: var(--accent-strong); }
.tl__points strong { color: var(--ink); font-weight: 600; }

/* Skills */
.skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.skill-card { background: var(--card); border-radius: var(--r); padding: 30px 28px; box-shadow: var(--shadow-sm); transition: transform 0.3s var(--ease); }
.skill-card:hover { transform: translateY(-5px); }
.skill-card--dark { background: var(--ink); color: var(--on-dark); }
.skill-card__icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 24px; background: var(--accent-soft); margin-bottom: 18px; }
.skill-card--dark .skill-card__icon { background: rgba(255,255,255,0.08); }
.skill-card h3 { font-family: var(--font-display); font-weight: 600; font-size: 19px; margin-bottom: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips span { font-size: 13px; padding: 7px 13px; border-radius: 999px; background: var(--bg-2); color: var(--muted); border: 1px solid var(--border); }
.skill-card--dark .chips span { background: rgba(255,255,255,0.06); color: var(--on-dark-muted); border-color: rgba(255,255,255,0.1); }

/* Projects */
.projects { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.proj-card { background: var(--card); border-radius: var(--r); padding: 30px 28px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 12px; transition: transform 0.3s var(--ease); }
.proj-card:hover { transform: translateY(-5px); }
.proj-card--dark { background: var(--ink); color: var(--on-dark); }
.proj-card__no { font-family: var(--font-mono); font-size: 13px; color: var(--accent-strong); }
.proj-card h3 { font-family: var(--font-display); font-weight: 600; font-size: 20px; letter-spacing: -0.4px; line-height: 1.2; }
.proj-card p { color: var(--muted); font-size: 15px; flex: 1; }
.proj-card--dark p { color: var(--on-dark-muted); }
.proj-card .chips { margin-top: 6px; }
.projects__earlier { margin-top: 20px; font-size: 14.5px; color: var(--muted); }
.proj-card--dark .chips span { background: rgba(255,255,255,0.06); color: var(--on-dark-muted); border-color: rgba(255,255,255,0.1); }

/* Skills — force a clean 3-up on desktop */
.skills--three { grid-template-columns: repeat(3, 1fr); }

/* Clients — logo wall (grayscale wordmarks) */
.clients { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.clients span {
  display: grid; place-items: center; text-align: center;
  font-family: var(--font-display); font-weight: 700; font-size: clamp(14px, 1.5vw, 18px);
  padding: 22px 14px; border-radius: var(--r-sm);
  background: var(--card); color: var(--muted-2);
  box-shadow: var(--shadow-sm);
  filter: grayscale(1); opacity: 0.85;
  transition: color 0.25s, transform 0.25s var(--ease), opacity 0.25s;
}
.clients span:hover { color: var(--ink); opacity: 1; transform: translateY(-3px); }

/* Media & Speaking */
.media { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.media-item { background: var(--card); border-radius: var(--r); padding: 26px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 8px; transition: transform 0.3s var(--ease); }
a.media-item:hover { transform: translateY(-5px); }
.media-item:hover { transform: translateY(-5px); }
.media-item .ic { font-size: 26px; }
.media-item h3 { font-family: var(--font-display); font-weight: 600; font-size: 17px; line-height: 1.25; }
.media-item span:last-child { color: var(--muted-2); font-size: 13.5px; }

/* Credentials */
.cred-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.cred { background: var(--card); border-radius: var(--r); padding: 30px; box-shadow: var(--shadow-sm); }
.cred h3 { font-family: var(--font-display); font-weight: 600; font-size: 19px; margin-bottom: 18px; }
.cred ul { list-style: none; display: grid; gap: 14px; }
.cred li { display: flex; flex-direction: column; gap: 2px; }
.cred li strong { font-weight: 600; font-size: 15px; }
.cred li span { color: var(--muted-2); font-size: 13.5px; }
.cred__label { margin: 20px 0 12px; font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.cred ul.cred__chips { display: grid; gap: 9px; }
.cred__chips li { font-size: 14px; color: var(--muted); background: none; border: 0; border-radius: 0; padding: 0; padding-inline-start: 16px; position: relative; }
.cred__chips li::before { content: '•'; position: absolute; inset-inline-start: 0; color: var(--accent-ink); }

/* Contact — big dark card */
.contact { padding-bottom: 30px; }
.contact__card {
  background: var(--ink); color: var(--on-dark);
  border-radius: var(--r-xl); padding: clamp(40px, 7vw, 84px);
  text-align: center; position: relative; overflow: hidden;
}
.contact__card::before { content:''; position:absolute; top:-40%; left:50%; transform:translateX(-50%); width:560px; height:560px; background:radial-gradient(circle, rgba(60,224,138,0.22), transparent 65%); }
.contact__tag { font-family: var(--font-mono); font-size: 13px; color: var(--accent); text-transform: uppercase; letter-spacing: 1px; position: relative; }
.contact__title { font-family: var(--font-display); font-weight: 700; font-size: clamp(30px, 5.5vw, 58px); letter-spacing: -2px; line-height: 1.05; margin: 16px 0 14px; position: relative; }
.contact__title .mint { color: var(--accent); }
.contact__sub { color: var(--on-dark-muted); font-size: 17px; margin-bottom: 34px; position: relative; }
.contact__links { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; position: relative; }
.contact__card .btn--ghost { color: #fff; border-color: rgba(255,255,255,0.25); }
.contact__card .btn--ghost:hover { border-color: #fff; background: rgba(255,255,255,0.06); }

/* Footer */
.footer { text-align: center; padding: 50px 20px 40px; color: var(--muted); font-size: 14px; }
.footer__muted { color: var(--muted-2); margin-top: 6px; font-size: 13px; }

/* Reveal */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 940px) {
  .hero__card { grid-template-columns: 1fr; }
  .portrait { order: -1; max-width: 320px; }
  .features, .bento { grid-template-columns: 1fr; }
  .skills--three { grid-template-columns: 1fr; }
  .clients { grid-template-columns: repeat(3, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .nav__links {
    position: fixed; top: 0; right: 0; height: 100vh; width: min(80vw, 320px);
    flex-direction: column; justify-content: center; gap: 28px;
    background: rgba(255,255,255,0.98); backdrop-filter: blur(20px);
    box-shadow: -10px 0 40px -20px rgba(0,0,0,0.25);
    transform: translateX(100%); transition: transform 0.4s var(--ease); z-index: 99;
  }
  .nav__links.open { transform: translateX(0); }
  .nav__links a { font-size: 19px; }
  .nav__toggle { display: flex; z-index: 101; }
  .nav__cta { display: none; }
  .nav__toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav__toggle.open span:nth-child(2) { opacity: 0; }
  .nav__toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}
@media (max-width: 520px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 12px; }
  .clients { grid-template-columns: repeat(2, 1fr); }
  .tl__top { flex-direction: column; gap: 4px; }
}

/* ============================================================
   RTL / Arabic
   ============================================================ */
/* Arabic uses Cairo throughout — including elements that default to the Latin mono/display fonts */
[dir="rtl"] body,
[dir="rtl"] .nav__brand,
[dir="rtl"] .hero__title,
[dir="rtl"] .section__title,
[dir="rtl"] .contact__title,
[dir="rtl"] .feature h3,
[dir="rtl"] .bento__big h3,
[dir="rtl"] .tl__top h3,
[dir="rtl"] .skill-card h3,
[dir="rtl"] .proj-card h3,
[dir="rtl"] .cred h3,
[dir="rtl"] .about__card h3,
[dir="rtl"] .btn,
[dir="rtl"] .nav__cta,
[dir="rtl"] .hero__eyebrow,
[dir="rtl"] .hero__meta,
[dir="rtl"] .section__tag,
[dir="rtl"] .contact__tag,
[dir="rtl"] .tl__period,
[dir="rtl"] .proj-card__no,
[dir="rtl"] .cred__label,
[dir="rtl"] .portrait__badge,
[dir="rtl"] .chips span,
[dir="rtl"] .cred__chips li { font-family: 'Cairo', system-ui, sans-serif; }

/* Reset Latin-only tracking/casing for Arabic */
[dir="rtl"] .hero__title,
[dir="rtl"] .section__title,
[dir="rtl"] .contact__title,
[dir="rtl"] .feature h3,
[dir="rtl"] .bento__big h3,
[dir="rtl"] .tl__top h3 { letter-spacing: 0; line-height: 1.25; }
[dir="rtl"] .hero__eyebrow,
[dir="rtl"] .section__tag,
[dir="rtl"] .contact__tag,
[dir="rtl"] .cred__label { letter-spacing: 0; text-transform: none; font-size: 14px; }
[dir="rtl"] .hero__title { font-weight: 800; }
[dir="rtl"] .timeline { padding-left: 0; padding-right: 34px; }
[dir="rtl"] .timeline::before { left: auto; right: 7px; }
[dir="rtl"] .tl__marker { left: auto; right: -34px; }
[dir="rtl"] .tl__body:hover { transform: translateX(-6px); }
[dir="rtl"] .tl__points li { padding-left: 0; padding-right: 22px; }
[dir="rtl"] .tl__points li::before { left: auto; right: 0; content: '◃'; }
[dir="rtl"] .clients span, [dir="rtl"] .tl__period { direction: ltr; unicode-bidi: isolate; }
@media (max-width: 760px) {
  [dir="rtl"] .nav__links { right: auto; left: 0; transform: translateX(-100%); }
  [dir="rtl"] .nav__links.open { transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
