/* Portfolio de Mattis Fernandez : feuille de style unique, sans dépendance externe. */
:root {
  --bg: #f6f7f9; --panel: #ffffff; --text: #1b1f24; --muted: #5d6673; --border: #e2e5ea;
  --accent: #2457d6; --accent-hover: #1c47b3; --accent-text: #ffffff; --accent-soft: #e8eefc;
  --ok: #1f8a4c; --ok-soft: #e3f4ea;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 6px 20px rgba(0,0,0,.06);
  --radius: 16px;
  --header-h: 64px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1216; --panel: #171b21; --text: #e7eaee; --muted: #9aa3ae; --border: #2a3039;
    --accent: #6d97ff; --accent-hover: #8aacff; --accent-text: #0b1020; --accent-soft: #1d2740;
    --ok: #4cc283; --ok-soft: #173326; --shadow: none;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1216; --panel: #171b21; --text: #e7eaee; --muted: #9aa3ae; --border: #2a3039;
  --accent: #6d97ff; --accent-hover: #8aacff; --accent-text: #0b1020; --accent-soft: #1d2740;
  --ok: #4cc283; --ok-soft: #173326; --shadow: none;
}

/* Bilingue : chaque texte existe en deux versions, seule celle de la langue de la page s'affiche. */
html[lang="fr"] [data-l="en"], html[lang="en"] [data-l="fr"] { display: none !important; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.25; margin: 0; }
p { margin: 0 0 12px; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; z-index: 100; background: var(--panel); padding: 8px 12px; border-radius: 8px; }

/* En-tête */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap { height: 100%; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; white-space: nowrap; }
.brand:hover { color: var(--text); }
.logo {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-text); font-size: 14px; font-weight: 800; letter-spacing: .5px;
}
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { color: var(--muted); text-decoration: none; font-size: 15px; padding: 6px 10px; border-radius: 8px; }
.nav a:hover { color: var(--text); background: var(--accent-soft); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.lang-btn {
  border: 1px solid var(--border); background: var(--panel); color: var(--text); cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600; padding: 6px 10px; border-radius: 8px;
}
.lang-btn:hover { border-color: var(--accent); }

/* Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 10px; font-weight: 600; font-size: 15px; text-decoration: none;
  border: 1px solid transparent; transition: background .15s, border-color .15s, transform .15s;
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: var(--accent-hover); color: var(--accent-text); transform: translateY(-1px); }
.btn-ghost { background: var(--panel); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--text); }
.btn-chat { padding: 8px 14px; font-size: 14px; }
.btn-chat .dot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 3px rgba(74,222,128,.25); }

/* Héros */
.hero { padding: 64px 0 40px; }
.hero .wrap { display: grid; grid-template-columns: 1fr auto; gap: 48px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--ok); background: var(--ok-soft); padding: 5px 12px; border-radius: 999px; margin-bottom: 18px; }
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.hero h1 { font-size: clamp(34px, 6vw, 54px); letter-spacing: -.02em; }
.hero .role { font-size: clamp(19px, 2.6vw, 24px); color: var(--accent); font-weight: 600; margin: 10px 0 18px; }
.hero .pitch { font-size: 17px; max-width: 620px; color: var(--muted); }
.hero .pitch strong { color: var(--text); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 22px; font-size: 14px; color: var(--muted); padding: 0; list-style: none; }
.facts li::before { content: "✓ "; color: var(--accent); font-weight: 700; }
.portrait { width: 280px; height: 280px; border-radius: 50%; overflow: hidden; border: 6px solid var(--panel); box-shadow: var(--shadow), 0 0 0 1px var(--border); }
.portrait img { width: 100%; height: 100%; object-fit: cover; }

/* Chiffres clés */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 8px 0 0; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 26px; color: var(--accent); line-height: 1.2; }
.stat > span { font-size: 14px; color: var(--muted); }

/* Sections */
section.block { padding: 56px 0 8px; }
.section-head { margin-bottom: 24px; }
.section-head h2 { font-size: clamp(26px, 3.6vw, 32px); letter-spacing: -.01em; }
.section-head p { color: var(--muted); margin: 6px 0 0; max-width: 640px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* À propos */
.about { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; }
.quote { border-left: 3px solid var(--accent); padding: 4px 0 4px 16px; margin: 16px 0; font-style: italic; color: var(--text); }
.strengths { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.strengths li { display: grid; grid-template-columns: 32px 1fr; gap: 10px; align-items: start; }
.strengths .ico { width: 32px; height: 32px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 15px; }
.strengths b { display: block; }
.strengths span { color: var(--muted); font-size: 15px; }

/* Parcours */
.timeline { position: relative; display: grid; gap: 16px; padding-left: 28px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--border); }
.job { position: relative; }
.job::before { content: ""; position: absolute; left: -28px; top: 26px; width: 16px; height: 16px; border-radius: 50%; background: var(--panel); border: 3px solid var(--accent); }
.job-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; align-items: baseline; }
.job h3 { font-size: 19px; }
.job .org { color: var(--accent); font-weight: 600; }
.job .when { font-size: 14px; color: var(--muted); white-space: nowrap; }
.job ul { margin: 12px 0 0; padding-left: 20px; }
.job li { margin-bottom: 6px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; padding: 0; list-style: none; }
.tags li { font-size: 13px; background: var(--accent-soft); color: var(--accent); padding: 3px 10px; border-radius: 999px; font-weight: 500; margin: 0; }

/* Projets */
.project { display: flex; flex-direction: column; }
.project .kind { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); margin-bottom: 8px; }
.project h3 { font-size: 18px; margin-bottom: 10px; }
.project p { color: var(--muted); font-size: 15px; }
.project .tags { margin-top: auto; padding-top: 8px; }
.project a.more { font-weight: 600; font-size: 15px; text-decoration: none; margin-top: 12px; }

/* Compétences */
.skill-group h3 { font-size: 17px; margin-bottom: 12px; }
.skill-group .tags { margin-top: 0; }

/* Formation */
.edu { display: grid; gap: 12px; }
.edu .card { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; }
.edu h3 { font-size: 17px; }
.edu .when { color: var(--muted); font-size: 14px; white-space: nowrap; }
.edu p { grid-column: 1 / -1; margin: 4px 0 0; color: var(--muted); font-size: 15px; }

/* Bandeau assistant */
.assistant {
  margin-top: 56px; border-radius: 20px; padding: 32px; display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center;
  background: linear-gradient(135deg, var(--accent) 0%, #5b3fd6 100%); color: #fff;
}
:root[data-theme="dark"] .assistant { background: linear-gradient(135deg, #1d3a8f 0%, #3b2a8f 100%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .assistant { background: linear-gradient(135deg, #1d3a8f 0%, #3b2a8f 100%); } }
.assistant h2 { font-size: clamp(22px, 3vw, 28px); margin-bottom: 8px; }
.assistant p { margin: 0; opacity: .92; max-width: 600px; }
.assistant .btn { background: #fff; color: #1b2a5c; }
.assistant .btn:hover { background: #eef2ff; color: #1b2a5c; transform: translateY(-1px); }

/* Contact */
.contact { text-align: center; padding: 40px 24px; }
.contact h2 { font-size: clamp(26px, 3.6vw, 32px); margin-bottom: 8px; }
.contact p { color: var(--muted); max-width: 560px; margin: 0 auto 22px; }
.contact .hero-cta { justify-content: center; margin-top: 0; }

/* Pied de page */
.site-footer { margin-top: 56px; border-top: 1px solid var(--border); padding: 24px 0 32px; font-size: 14px; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }

/* Apparition douce au défilement (désactivée si l'utilisateur réduit les animations) */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.shown { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }
.no-js .reveal { opacity: 1; transform: none; }

/* Page mentions légales */
.legal { max-width: 760px; padding-top: 32px; }
.legal h1 { font-size: 30px; margin-bottom: 4px; }
.legal h2 { font-size: 19px; margin: 26px 0 8px; }
.legal ul { padding-left: 20px; }
.legal li { margin-bottom: 8px; }

/* Responsive */
@media (max-width: 900px) {
  .nav { display: none; }
  .header-actions { margin-left: auto; }
  .hero { padding-top: 40px; }
  .hero .wrap { grid-template-columns: 1fr; gap: 28px; }
  .portrait { width: 160px; height: 160px; order: -1; border-width: 4px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .about, .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .assistant { grid-template-columns: 1fr; padding: 24px; }
}
@media (max-width: 520px) {
  .brand .name { display: none; }
  .btn-chat .long { display: none; }
  .hero-cta .btn { flex: 1 1 100%; }
  .card { padding: 18px; }
  .edu .card { grid-template-columns: 1fr; }
  .stat b { font-size: 22px; }
}
@media (min-width: 521px) { .btn-chat .short { display: none; } }
