/* =========================================================
   Moustapha Alifei Salimata — Portfolio
   Design system inspiré de l'esthétique Apple :
   typographie système, grand whitespace, hairlines, retenue.
   ========================================================= */

:root {
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --surface: #ffffff;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #86868b;
  --line: rgba(0, 0, 0, 0.10);
  --line-strong: rgba(0, 0, 0, 0.16);
  --accent: #0066cc;
  --accent-2: #6e3ad6;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.10);
  --nav-bg: rgba(255, 255, 255, 0.72);
  --radius: 18px;
  --radius-sm: 12px;
  --maxw: 1080px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

:root[data-theme="dark"] {
  --bg: #000000;
  --bg-alt: #0a0a0c;
  --surface: #111113;
  --text: #f5f5f7;
  --text-2: #a1a1a6;
  --text-3: #86868b;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.20);
  --accent: #2997ff;
  --accent-2: #b78bff;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.6);
  --nav-bg: rgba(0, 0, 0, 0.62);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { transition: none !important; }
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI",
    "Helvetica Neue", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
  overflow-x: hidden;
}

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

a { color: inherit; text-decoration: none; }

/* ---------- Navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background 0.4s var(--ease);
}
.nav.is-scrolled { border-bottom-color: var(--line); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 52px; }
.nav__brand { font-weight: 600; font-size: 17px; letter-spacing: -0.02em; }
.nav__brand span { color: var(--text-3); margin: 0 1px; }
.nav__links { display: flex; gap: 30px; list-style: none; }
.nav__links a { font-size: 13.5px; color: var(--text-2); transition: color 0.2s var(--ease); }
.nav__links a:hover { color: var(--text); }

.theme-toggle {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 50%;
  background: transparent; border: 1px solid var(--line);
  color: var(--text); cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.theme-toggle:hover { background: var(--bg-alt); border-color: var(--line-strong); }

.nav__tools { display: flex; align-items: center; gap: 10px; }
.lang-toggle {
  height: 34px; min-width: 40px; padding: 0 12px; border-radius: 999px;
  background: transparent; border: 1px solid var(--line); color: var(--text);
  font-family: inherit; font-size: 12.5px; font-weight: 600; letter-spacing: 0.03em;
  cursor: pointer; transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.lang-toggle:hover { background: var(--bg-alt); border-color: var(--line-strong); }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

@media (max-width: 720px) { .nav__links { display: none; } }

/* ---------- Hero ---------- */
.hero { padding: clamp(72px, 14vw, 168px) 0 clamp(56px, 9vw, 104px); position: relative; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(60% 50% at 50% -10%, rgba(110, 58, 214, 0.10), transparent 60%),
    radial-gradient(50% 40% at 85% 10%, rgba(0, 102, 204, 0.08), transparent 60%);
}
.hero__inner { max-width: 880px; }
.hero__eyebrow {
  font-size: 14px; font-weight: 500; color: var(--accent);
  letter-spacing: 0.02em; margin-bottom: 22px;
}
.hero__title {
  font-size: clamp(40px, 7vw, 76px); line-height: 1.04;
  font-weight: 600; letter-spacing: -0.035em; margin-bottom: 26px;
}
.grad {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero__lead {
  font-size: clamp(18px, 2.4vw, 23px); color: var(--text-2);
  max-width: 640px; line-height: 1.45; margin-bottom: 36px;
}
.hero__lead strong { color: var(--text); font-weight: 600; }
.hero__cta { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 64px; }

.hero__stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
  max-width: 720px; padding-top: 40px; border-top: 1px solid var(--line);
}
.hero__stats dt { font-size: clamp(28px, 4vw, 40px); font-weight: 600; letter-spacing: -0.03em; }
.hero__stats dd { font-size: 14px; color: var(--text-2); margin-top: 4px; line-height: 1.35; }
@media (max-width: 560px) { .hero__stats { grid-template-columns: 1fr; gap: 22px; } }

/* En-tête simple — nom + rôle, sans effet de « cover » */
.hero--minimal { padding: clamp(48px, 8vw, 88px) 0 clamp(24px, 4vw, 40px); }
.hero--minimal::before { display: none; }
.hero--minimal .hero__inner { max-width: var(--maxw); } /* même largeur/bord que les autres sections */
.hero__cta--minimal { margin-top: 28px; margin-bottom: 0; }
.hero__name { font-size: clamp(30px, 5vw, 48px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.05; }
.hero__role { font-size: clamp(16px, 2vw, 19px); color: var(--text-2); margin-top: 10px; }
.hero__intro { font-size: clamp(16px, 1.9vw, 19px); color: var(--text-2); line-height: 1.55; max-width: 620px; margin-top: 22px; }
.hero__intro strong { color: var(--text); font-weight: 600; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 46px; padding: 0 24px; border-radius: 999px;
  font-size: 15px; font-weight: 500; cursor: pointer;
  transition: transform 0.18s var(--ease), background 0.2s var(--ease), opacity 0.2s var(--ease);
  border: 1px solid transparent; white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { opacity: 0.9; }
.btn--ghost { background: transparent; border-color: var(--line-strong); color: var(--text); }
.btn--ghost:hover { background: var(--bg-alt); }

/* ---------- Section scaffolding ---------- */
.section { padding: clamp(72px, 11vw, 132px) 0; }
.section--alt { background: var(--bg-alt); }
.section__kicker {
  font-size: 13px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 16px;
}
.section__title {
  font-size: clamp(30px, 5vw, 52px); font-weight: 600;
  letter-spacing: -0.03em; line-height: 1.08; max-width: 760px;
}
.section__intro {
  font-size: clamp(17px, 2vw, 21px); color: var(--text-2);
  max-width: 660px; margin-top: 20px; line-height: 1.5;
}

/* ---------- Grids ---------- */
.grid { display: grid; gap: 20px; margin-top: 56px; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid--3 { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .grid--2 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 30px 28px;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--line-strong); }
.card h3 { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 12px; }
.card p { color: var(--text-2); font-size: 15.5px; line-height: 1.55; }

/* ---------- Tags ---------- */
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.tags li {
  font-size: 12.5px; font-weight: 500; color: var(--text-2);
  background: var(--bg-alt); border: 1px solid var(--line);
  padding: 5px 11px; border-radius: 999px;
}
.section--alt .tags li { background: var(--surface); }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin-top: 56px; position: relative; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px;
  width: 1px; background: var(--line-strong);
}
@media (max-width: 700px) { .timeline::before { left: 5px; } }
.timeline__item { position: relative; padding-left: 44px; padding-bottom: 52px; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item::before {
  content: ""; position: absolute; left: 0; top: 6px;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent);
}
.section--alt .timeline__item::before { background: var(--bg-alt); }
.timeline__date {
  font-size: 13px; font-weight: 600; color: var(--accent);
  letter-spacing: 0.02em; margin-bottom: 6px;
}
.timeline__body h3 { font-size: clamp(19px, 2.4vw, 24px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
.timeline__org { font-size: 14.5px; color: var(--text-3); margin: 6px 0 14px; }
.timeline__body > p { color: var(--text-2); font-size: 16px; line-height: 1.6; max-width: 760px; }
.timeline__body strong { color: var(--text); font-weight: 600; }

.bullets { list-style: none; margin: 16px 0 4px; max-width: 760px; }
.bullets li {
  position: relative; padding-left: 20px; margin-bottom: 9px;
  color: var(--text-2); font-size: 15.5px; line-height: 1.55;
}
.bullets li::before {
  content: ""; position: absolute; left: 2px; top: 10px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--accent);
}
.bullets strong { color: var(--text); font-weight: 600; }
.timeline .tags { margin-top: 20px; }

.more-link {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 18px; font-size: 14px; font-weight: 500; color: var(--accent);
  transition: gap 0.25s var(--ease);
}
.more-link:hover { gap: 11px; }

/* ---------- Projects ---------- */
.project {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 30px 28px;
  display: flex; flex-direction: column;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}
.project:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--line-strong); }
.section--alt .project { background: var(--surface); }
.project__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.project__head h3 { font-size: 23px; font-weight: 600; letter-spacing: -0.02em; }
.project__year { font-size: 13px; font-weight: 600; color: var(--text-3); }
.project__tag {
  font-size: 13px; font-weight: 500; color: var(--accent);
  margin: 8px 0 14px;
}
.project > p:not(.project__tag) { color: var(--text-2); font-size: 15.5px; line-height: 1.6; }
.project strong { color: var(--text); font-weight: 600; }
.project .tags { margin-top: auto; padding-top: 18px; }

.project--link { cursor: pointer; }
.project__more {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 18px; font-size: 14px; font-weight: 500; color: var(--accent);
  transition: gap 0.25s var(--ease);
}
.project--link:hover .project__more { gap: 11px; }

.mini-list { list-style: none; display: grid; gap: 14px; margin-top: 4px; }
.mini-list li { color: var(--text-2); font-size: 15px; line-height: 1.5; padding-left: 16px; position: relative; }
.mini-list li::before { content: "—"; position: absolute; left: 0; color: var(--text-3); }
.mini-list strong { color: var(--text); font-weight: 600; }
.mini-list a { color: var(--accent); font-weight: 600; }
.mini-list a:hover { text-decoration: underline; }

/* ---------- Education ---------- */
.edu { list-style: none; margin-top: 56px; max-width: 760px; }
.edu__item {
  display: flex; gap: 28px; align-items: flex-start;
  padding: 26px 0; border-top: 1px solid var(--line);
}
.edu__item:last-child { border-bottom: 1px solid var(--line); }
.edu__year { font-size: 15px; font-weight: 600; color: var(--accent); min-width: 52px; padding-top: 2px; }
.edu__item h3 { font-size: clamp(17px, 2vw, 20px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; }
.edu__item p { color: var(--text-2); font-size: 14.5px; margin-top: 5px; }
@media (max-width: 520px) { .edu__item { gap: 16px; } }

/* ---------- Contact ---------- */
.section--contact { text-align: center; }
.contact__inner { display: flex; flex-direction: column; align-items: center; }
.section--contact .section__title { max-width: none; }
.section--contact .section__intro { margin-left: auto; margin-right: auto; }
.contact__actions { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-top: 38px; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 30px 0; }
.footer__inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.footer span { font-size: 13px; color: var(--text-3); }

/* ---------- Project detail pages ---------- */
.back-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; color: var(--text-2); margin-bottom: 36px;
  transition: gap 0.25s var(--ease), color 0.2s var(--ease);
}
.back-link:hover { color: var(--text); gap: 12px; }

.detail-hero { padding: clamp(48px, 8vw, 88px) 0 clamp(28px, 4vw, 44px); }
.detail-hero__year { font-size: 14px; font-weight: 600; color: var(--accent); letter-spacing: 0.02em; }
.detail-hero__title { font-size: clamp(36px, 6vw, 60px); font-weight: 600; letter-spacing: -0.035em; line-height: 1.05; margin: 12px 0 18px; }
.detail-hero__lead { font-size: clamp(18px, 2.3vw, 22px); color: var(--text-2); max-width: 680px; line-height: 1.5; }
.detail-hero__lead strong { color: var(--text); font-weight: 600; }
.detail-hero .tags { margin-top: 26px; }
.detail-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 30px; }

.detail-section { padding: clamp(40px, 6vw, 64px) 0; border-top: 1px solid var(--line); }
.detail-section:first-of-type { border-top: none; }
.detail-section h2 { font-size: clamp(22px, 3vw, 30px); font-weight: 600; letter-spacing: -0.025em; margin-bottom: 20px; }
.detail-section p { color: var(--text-2); font-size: 16.5px; line-height: 1.65; max-width: 760px; margin-bottom: 14px; }
.detail-section p strong { color: var(--text); font-weight: 600; }

.feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin-top: 8px; }
@media (max-width: 700px) { .feature-grid { grid-template-columns: 1fr; } }
.feature {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 22px 22px;
}
.feature h3 { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 8px; }
.feature p { font-size: 14.5px; line-height: 1.55; margin: 0; }

.stat-row { display: flex; flex-wrap: wrap; gap: 36px; margin-top: 8px; }
.stat-row > div dt { font-size: clamp(26px, 4vw, 36px); font-weight: 600; letter-spacing: -0.03em; }
.stat-row > div dd { font-size: 14px; color: var(--text-2); margin-top: 4px; }

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