/* Portfolio Amadou Diallo — feuille de style unique, sans dépendance externe */

:root {
  --bg: #f7f8fa;
  --bg-alt: #eef1f5;
  --surface: #ffffff;
  --text: #16191d;
  --muted: #545c66;
  --border: #dde2e8;
  --accent: #1d5fd0;
  --accent-contrast: #ffffff;
  --accent-soft: #e4ecfb;
  --ok: #1a8a4a;
  --shadow: 0 1px 2px rgb(16 24 40 / .06), 0 1px 3px rgb(16 24 40 / .08);
  --radius: 12px;
  --maxw: 1080px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0f1216;
  --bg-alt: #141920;
  --surface: #181e26;
  --text: #e7eaee;
  --muted: #9aa4b0;
  --border: #29313c;
  --accent: #6aa1ff;
  --accent-contrast: #0b1220;
  --accent-soft: #1b2a44;
  --ok: #3ccf7a;
  --shadow: none;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1216;
    --bg-alt: #141920;
    --surface: #181e26;
    --text: #e7eaee;
    --muted: #9aa4b0;
    --border: #29313c;
    --accent: #6aa1ff;
    --accent-contrast: #0b1220;
    --accent-soft: #1b2a44;
    --ok: #3ccf7a;
    --shadow: none;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
ul, ol { margin: 0; padding: 0; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .container { padding: 0 32px; } }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 16px; top: -48px; z-index: 100;
  background: var(--accent); color: var(--accent-contrast);
  padding: 8px 14px; border-radius: 8px; text-decoration: none;
}
.skip-link:focus { top: 12px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* En-tête */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 12px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 600; margin-right: auto; }
.brand-mark {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px;
  background: var(--accent); color: var(--accent-contrast); font: 700 13px/1 var(--mono);
}

.nav { display: flex; align-items: center; }
.nav-list { list-style: none; display: flex; gap: 4px; }
.nav-list a {
  display: block; padding: 6px 10px; border-radius: 8px;
  color: var(--muted); text-decoration: none; font-size: 15px;
}
.nav-list a:hover, .nav-list a[aria-current="true"] { color: var(--text); background: var(--bg-alt); }

.nav-toggle, .theme-toggle {
  display: grid; place-items: center; width: 40px; height: 40px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text); cursor: pointer;
}
.nav-toggle { display: none; }
.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: 860px) {
  .brand-name { display: none; }
  .nav-toggle { display: grid; }
  .nav-list {
    display: none; position: absolute; top: 60px; left: 0; right: 0;
    flex-direction: column; gap: 0; padding: 8px 16px 16px;
    background: var(--bg); border-bottom: 1px solid var(--border);
  }
  .nav-list.open { display: flex; }
  .nav-list a { padding: 12px 8px; font-size: 16px; }
}
@media (max-width: 860px) and (min-width: 380px) { .brand-name { display: inline; } }

/* Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: 600 15px/1.2 var(--font); text-decoration: none; cursor: pointer;
  transition: border-color .15s, background .15s, transform .15s;
}
.btn:hover { border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-block { width: 100%; }

/* Accueil */
.hero { padding: 56px 0 64px; }
.hero-inner { display: grid; gap: 40px; align-items: center; }
@media (min-width: 820px) {
  .hero { padding: 88px 0 96px; }
  .hero-inner { grid-template-columns: 1fr 300px; gap: 56px; }
}
.status {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 18px;
  padding: 4px 12px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); font-size: 14px; color: var(--muted);
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); letter-spacing: -0.02em; }
.hero-title { margin: 8px 0 0; font: 600 clamp(1.1rem, 2.6vw, 1.4rem)/1.3 var(--font); color: var(--accent); }
.hero-lead { margin: 20px 0 0; max-width: 60ch; font-size: 1.1rem; color: var(--muted); }
.hero-facts { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 20px 0 0; font-size: 15px; color: var(--muted); }
.hero-facts li::before { content: "▹ "; color: var(--accent); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.hero-photo {
  width: 100%; max-width: 300px; aspect-ratio: 4 / 5; object-fit: cover;
  border-radius: 16px; border: 1px solid var(--border); box-shadow: var(--shadow);
  justify-self: center;
}
@media (max-width: 819px) { .hero-photo { max-width: 200px; order: -1; justify-self: start; } }

/* Sections */
.section { padding: 64px 0; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--border); }
.section-title { font-size: clamp(1.5rem, 3.5vw, 2rem); letter-spacing: -0.01em; margin-bottom: 32px; }
.section-title::before { content: "# "; color: var(--accent); font-family: var(--mono); font-weight: 500; }
.lead { font-size: 1.05rem; color: var(--muted); margin: 0 0 24px; max-width: 65ch; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.card h3 { font-size: 1.05rem; margin-bottom: 12px; }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li {
  padding: 3px 10px; border-radius: 999px; font-size: 13px;
  background: var(--accent-soft); color: var(--text); border: 1px solid transparent;
}

.tag {
  display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 12px; font-weight: 600;
  border: 1px solid var(--border); color: var(--muted); background: var(--surface);
}

/* Expériences */
.timeline { list-style: none; position: relative; display: grid; gap: 20px; }
@media (min-width: 640px) {
  .timeline { padding-left: 28px; }
  .timeline::before { content: ""; position: absolute; left: 7px; top: 10px; bottom: 10px; width: 2px; background: var(--border); }
  .job::before {
    content: ""; position: absolute; left: -27px; top: 26px; width: 12px; height: 12px;
    border-radius: 50%; background: var(--surface); border: 2px solid var(--accent);
  }
}
.job { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.job-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; margin-bottom: 12px; }
.job h3 { font-size: 1.1rem; }
.job .at { color: var(--accent); font-weight: 600; }
.job-meta { margin: 0; font-size: 14px; color: var(--muted); white-space: nowrap; }
@media (max-width: 520px) { .job-meta { white-space: normal; } }
.job-points { padding-left: 20px; margin-bottom: 14px; color: var(--muted); }
.job-points li { margin: 4px 0; }
.job-points li::marker { color: var(--accent); }

/* Compétences */
.skills-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }

/* Projets */
.projects-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.project { display: flex; flex-direction: column; gap: 4px; }
.project h3 { margin-bottom: 4px; }
.project p { margin: 0 0 8px; color: var(--muted); }
.project .chips { margin-top: auto; }
.project-kind { margin: 0 0 6px !important; font: 600 12px/1.2 var(--mono) !important; letter-spacing: .04em; text-transform: uppercase; color: var(--accent) !important; }
.link { margin-top: auto; font-weight: 600; text-decoration: none; }
.link:hover { text-decoration: underline; }

/* Formation */
.edu-grid { display: grid; gap: 20px; }
@media (min-width: 820px) { .edu-grid { grid-template-columns: 1.4fr 1fr; align-items: start; } }
.edu-list { list-style: none; display: grid; gap: 12px; }
.edu-list li {
  display: flex; flex-direction: column; padding: 16px 20px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.edu-list span { color: var(--muted); font-size: 15px; }
.cert h3 { margin-bottom: 10px; }
.tag-pending { margin: 0; color: var(--accent); border-color: var(--accent); }

/* Freelance */
.freelance { display: grid; gap: 24px; }
@media (min-width: 820px) { .freelance { grid-template-columns: 1.5fr 1fr; align-items: start; } }
.offer { list-style: none; display: grid; gap: 10px; }
.offer li { padding-left: 28px; position: relative; }
.offer li::before { content: "✓"; position: absolute; left: 4px; color: var(--ok); font-weight: 700; }
.rate { display: grid; gap: 14px; }
.rate-label { margin: 0; font: 600 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.rate-value { margin: 0; font-size: 1.8rem; font-weight: 700; }
.rate-value abbr { text-decoration: none; font-size: 1rem; color: var(--muted); }

/* Contact */
.contact-list { list-style: none; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.contact-item {
  display: flex; align-items: center; gap: 14px; padding: 18px 20px; height: 100%;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); text-decoration: none; overflow-wrap: anywhere;
  transition: border-color .15s;
}
.contact-item:hover { border-color: var(--accent); }
.contact-item svg { flex: none; color: var(--accent); }
.contact-item span { display: flex; flex-direction: column; font-weight: 600; }
.contact-item small { font-weight: 400; color: var(--muted); font-size: 13px; }

/* Pied de page */
.site-footer { padding: 28px 0; font-size: 14px; color: var(--muted); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.site-footer p { margin: 0; }

/* Page 404 */
.notfound { min-height: 70vh; display: grid; place-content: center; text-align: center; gap: 16px; padding: 48px 16px; }
.notfound h1 { font-size: clamp(2rem, 6vw, 3rem); }
.notfound p { margin: 0; color: var(--muted); }
