/* ==========================================================================
   Mehdi Troudi — site vitrine
   Design : sobre, mobile-first, une seule couleur d'accent (teal).
   ========================================================================== */

:root {
  --accent: #0F6E56;
  --accent-dark: #0b5443;
  --accent-light: #E1F5EE;
  --text: #1a2420;
  --text-muted: #55645f;
  --bg: #ffffff;
  --bg-alt: #fafbfa;
  --border: #e2e8e5;
  --radius: 12px;
  --radius-sm: 8px;
  --max-width: 1120px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  font-size: 16px;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3 {
  line-height: 1.25;
  font-weight: 700;
  margin: 0 0 0.6em;
}
h1 { font-size: 1.9rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--accent); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; }

.text-muted { color: var(--text-muted); }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 0.6em 1em;
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}
.site-header .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.brand {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
}
.brand:hover { text-decoration: none; color: var(--accent); }

.main-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  margin: 0;
  padding: 0;
}
.main-nav a {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.25rem 0.1rem;
  border-bottom: 2px solid transparent;
}
.main-nav a:hover,
.main-nav a[aria-current="page"] {
  color: var(--accent);
  text-decoration: none;
  border-bottom-color: var(--accent);
}

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.75em 1.4em;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover, .btn:focus { text-decoration: none; }
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-dark); color: #fff; }
.btn-secondary {
  background: #fff;
  color: var(--accent);
  border-color: var(--accent);
}
.btn-secondary:hover { background: var(--accent-light); color: var(--accent); }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* ---------- Hero (accueil) ---------- */
.hero {
  padding: 2.5rem 0 1.5rem;
}
.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.5rem;
}
.hero-photo {
  width: 132px;
  height: 132px;
  border-radius: var(--radius);
  object-fit: cover;
  border: 3px solid var(--accent-light);
}
.hero h1 { margin-bottom: 0.35em; }
.hero .subtitle {
  font-size: 1.05rem;
  color: var(--accent-dark);
  font-weight: 600;
  margin-bottom: 0.9em;
}
.hero .lead {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 65ch;
}

@media (min-width: 640px) {
  .hero-inner { flex-direction: row; align-items: center; }
  .hero-photo { width: 152px; height: 152px; flex-shrink: 0; }
}

/* ---------- Sections génériques ---------- */
.section {
  padding: 2.25rem 0;
}
.section-alt { background: var(--bg-alt); }
.section-title { margin-bottom: 1.5rem; }
.section-intro {
  max-width: 70ch;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}

/* ---------- Cartes ---------- */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.1rem;
}
@media (min-width: 640px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
  .card-grid-3 { grid-template-columns: repeat(3, 1fr); }
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.card-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.card-icon svg { width: 22px; height: 22px; }
.card h3 { margin: 0.2rem 0 0.1rem; }
.card p { color: var(--text-muted); font-size: 0.95rem; }
.card .card-link {
  margin-top: auto;
  font-weight: 600;
  font-size: 0.92rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-dark);
  background: var(--accent-light);
  border-radius: 999px;
  padding: 0.2em 0.75em;
  width: fit-content;
}
.badge-muted {
  color: var(--text-muted);
  background: var(--bg-alt);
  border: 1px solid var(--border);
}

/* ---------- Parcours (timeline) ---------- */
.timeline-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.3rem 1.4rem;
  margin-bottom: 1rem;
}
.timeline-item h3 {
  margin-bottom: 0.15em;
  font-size: 1.05rem;
}
.timeline-role {
  color: var(--accent-dark);
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 0.5em;
}
.timeline-dates {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
}
.timeline-item ul {
  margin: 0.6em 0 0;
  padding-left: 1.2em;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.timeline-item li { margin-bottom: 0.3em; }

.list-plain {
  padding-left: 1.2em;
  color: var(--text-muted);
}
.list-plain li { margin-bottom: 0.5em; }

/* ---------- Contact ---------- */
.contact-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.9rem;
}
.contact-item .card-icon { flex-shrink: 0; }
.contact-item a { font-weight: 600; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: 2rem;
  background: var(--bg-alt);
}
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-start;
}
@media (min-width: 640px) {
  .footer-inner { flex-direction: row; justify-content: space-between; align-items: center; }
}
.footer-social {
  display: flex;
  gap: 0.75rem;
}
.footer-social a {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}
.footer-social a:hover {
  color: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
}
.footer-social svg { width: 18px; height: 18px; }
.footer-copy { font-size: 0.85rem; color: var(--text-muted); }

/* ---------- Touche personnelle (page Projets) ---------- */
.personal-note {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  align-items: center;
  text-align: center;
  border-top: 1px solid var(--border);
  padding-top: 2rem;
  margin-top: 2rem;
}
.personal-note img {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent-light);
}
@media (min-width: 640px) {
  .personal-note { flex-direction: row; text-align: left; }
}
