/* =========================================================
   PORTFOLIO — Ines Ghammam
   Style sobre : fond neutre, un seul accent violet · mode clair / sombre
   ========================================================= */

/* ---------- 1. Couleurs & variables ---------- */
/* Pour changer la couleur du site, modifie --primary (et --btn-bg / --btn-hover). */
:root {
  --bg: #fcfcfd;
  --bg-alt: #f6f5f9;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --border: #e7e5ee;
  --border-strong: #d6d2e3;
  --text: #1d1a26;
  --text-muted: #5f5b6e;
  --primary: #6d28d9;
  --accent: #6d28d9;
  --tint: #f4f1fb;
  --dots: rgba(109, 40, 217, 0.12);
  --selection: #ddd6fe;
  --danger: #dc2626;

  --btn-bg: #6d28d9;
  --btn-hover: #5b21b6;
  --btn-text: #ffffff;

  --tag-bg: #f4f1fb;
  --tag-text: #5b21b6;
  --shadow: 0 1px 2px rgba(20, 16, 40, 0.05), 0 10px 30px -18px rgba(20, 16, 40, 0.18);
  --shadow-hover: 0 1px 2px rgba(20, 16, 40, 0.06), 0 18px 40px -20px rgba(20, 16, 40, 0.26);

  --bf-body: #4c1d95;

  --radius: 22px;
  --radius-sm: 12px;
  --nav-h: 72px;
  --container: 1120px;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}

/* Mode sombre : gris très foncé + violet clair */
[data-theme="dark"] {
  --bg: #0f0e13;
  --bg-alt: #15141b;
  --surface: #17161e;
  --surface-strong: #1b1a23;
  --border: #2a2834;
  --border-strong: #3a3746;
  --text: #f1f0f5;
  --text-muted: #a8a5b5;
  --primary: #b9a6fb;
  --accent: #b9a6fb;
  --tint: #221f2d;
  --dots: rgba(185, 166, 251, 0.1);
  --selection: #4c3d7a;
  --danger: #f87171;

  --btn-bg: #b9a6fb;
  --btn-hover: #cdbffd;
  --btn-text: #15121f;

  --tag-bg: #221f2d;
  --tag-text: #d9d0fd;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px -18px rgba(0, 0, 0, 0.6);
  --shadow-hover: 0 14px 34px -18px rgba(0, 0, 0, 0.8);

  --bf-body: #f1f0f5;
  color-scheme: dark;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); }

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.5s var(--ease), color 0.5s var(--ease);
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button, input, textarea { font: inherit; color: inherit; }
strong { font-weight: 600; color: var(--text); }

.container { width: min(100% - 32px, var(--container)); margin-inline: auto; }
.mono { font-family: var(--font-mono); }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.icon {
  width: 1.15em; height: 1.15em; flex-shrink: 0;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}

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

.skip-link {
  position: fixed; top: -60px; left: 16px; z-index: 100;
  padding: 10px 16px; border-radius: 10px;
  background: var(--surface-strong); box-shadow: var(--shadow);
}
.skip-link:focus { top: 12px; }

::selection { background: var(--selection); color: var(--text); }

/* ---------- 3. Papillons (seulement en haut de la page) ---------- */
.butterfly-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100vh; height: 100svh; z-index: 0; pointer-events: none; overflow: hidden; }

.bf {
  position: absolute; top: 0; left: 0;
  width: var(--size, 36px);
  height: calc(var(--size, 36px) * 0.64);
  will-change: transform;
}
.bf__inner { position: relative; width: 100%; height: 100%; perspective: 260px; }

.bf__wing { position: absolute; top: 0; width: 50%; height: 100%; }
.bf__wing svg { width: 100%; height: 100%; display: block; overflow: visible; }
.bf__wing--r { left: 50%; transform-origin: 0% 50%; animation: flap-r var(--flap, 0.3s) ease-in-out infinite alternate; }
.bf__wing--l { right: 50%; transform-origin: 100% 50%; animation: flap-l var(--flap, 0.3s) ease-in-out infinite alternate; }
.bf__wing--l svg { transform: scaleX(-1); }

@keyframes flap-r { from { transform: rotateY(-8deg); } to { transform: rotateY(72deg); } }
@keyframes flap-l { from { transform: rotateY(8deg); } to { transform: rotateY(-72deg); } }

.bf__body {
  position: absolute; z-index: 2; left: 50%; top: 18%;
  width: max(2px, calc(var(--size, 36px) * 0.07)); height: 66%;
  transform: translateX(-50%);
  border-radius: 999px; background: var(--bf-body);
}
.bf__body::before, .bf__body::after {
  content: ""; position: absolute; bottom: 100%; left: 50%;
  width: 1px; height: calc(var(--size, 36px) * 0.2);
  background: var(--bf-body); transform-origin: bottom center;
}
.bf__body::before { transform: rotate(-24deg); }
.bf__body::after  { transform: rotate(24deg); }

/* Papillons posés sur la photo */
.perched { position: absolute; z-index: 3; }
.perched .bf { position: relative; }
.perched--1 { top: -6%; right: -4%; transform: rotate(24deg); }
.perched--2 { bottom: 8%; left: -8%; transform: rotate(-30deg); }

/* ---------- 5. Navigation ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  height: var(--nav-h);
  transition: background-color 0.35s var(--ease), box-shadow 0.35s var(--ease), backdrop-filter 0.35s;
}
.nav.is-scrolled {
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--border);
}
.nav__inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.nav__logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 600; font-size: 1.45rem; letter-spacing: -0.01em;
}
.nav__logo-icon { width: 30px; height: 24px; color: var(--primary); transition: transform 0.5s var(--ease); }
.nav__logo:hover .nav__logo-icon { transform: rotate(-12deg) scale(1.12); }
.nav__dot { color: var(--accent); }

.nav__menu { display: flex; gap: 6px; }
.nav__link {
  position: relative; padding: 8px 14px; border-radius: 999px;
  font-weight: 500; font-size: 0.95rem; color: var(--text-muted);
  transition: color 0.25s, background-color 0.25s;
}
.nav__link:hover { color: var(--text); background: var(--tag-bg); }
.nav__link.is-active { color: var(--text); }
.nav__link.is-active::after {
  content: ""; position: absolute; left: 50%; bottom: 2px;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent); transform: translateX(-50%);
}

.nav__actions { display: flex; align-items: center; gap: 8px; }

/* Bouton mode sombre */
.theme-toggle {
  position: relative; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface);
  backdrop-filter: blur(8px);
  display: grid; place-items: center; cursor: pointer; overflow: hidden;
  color: var(--primary);
  transition: transform 0.3s var(--ease), box-shadow 0.3s, background-color 0.3s;
}
.theme-toggle:hover { transform: rotate(-12deg) scale(1.06); box-shadow: var(--shadow); }
.theme-toggle .icon { position: absolute; width: 20px; height: 20px; transition: transform 0.6s var(--ease), opacity 0.4s; }
.theme-toggle__moon { transform: translateY(30px) rotate(-90deg); opacity: 0; }
[data-theme="dark"] .theme-toggle__sun { transform: translateY(-30px) rotate(90deg); opacity: 0; }
[data-theme="dark"] .theme-toggle__moon { transform: none; opacity: 1; }

.nav__burger {
  display: none; width: 44px; height: 44px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface); cursor: pointer;
  flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.nav__burger span { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--text); transition: transform 0.35s var(--ease), opacity 0.25s; }
.nav__burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- 6. Boutons, cartes, tags ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 26px; border-radius: 999px; border: 0; cursor: pointer;
  font-weight: 600; font-size: 0.98rem;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background-color 0.3s;
}
.btn--primary { background: var(--btn-bg); color: var(--btn-text); box-shadow: var(--shadow); }
.btn--primary:hover { transform: translateY(-2px); background: var(--btn-hover); box-shadow: var(--shadow-hover); }
.btn--primary .icon { transition: transform 0.3s var(--ease); }
.btn--primary:hover .icon { transform: translate(2px, -2px); }
.btn--ghost { border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--text); }
.btn--ghost:hover { transform: translateY(-2px); border-color: var(--primary); color: var(--primary); }
.btn--full { width: 100%; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s, background-color 0.5s;
}

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
  padding: 6px 12px; border-radius: 999px;
  background: var(--tag-bg); color: var(--tag-text);
  font-size: 0.85rem; font-weight: 500;
}
.tags--small li { padding: 4px 10px; font-size: 0.78rem; font-family: var(--font-mono); }

/* ---------- 7. Sections ---------- */
.section { position: relative; z-index: 1; padding: 110px 0; }
.section__head { margin-bottom: 52px; }
.section__kicker {
  display: inline-block; margin-bottom: 12px;
  font-family: var(--font-mono); font-size: 0.85rem; letter-spacing: 0.04em;
  color: var(--accent);
}
.section__title {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(2.1rem, 4.5vw, 3.2rem); line-height: 1.1; letter-spacing: -0.02em;
}
.section__title em, .hero__name em {
  font-style: italic; font-weight: 500;
  color: var(--primary);
}

/* ---------- 8. Accueil (hero) ---------- */
.hero {
  position: relative; z-index: 1;
  min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center;
  padding: calc(var(--nav-h) + 40px) 0 80px;
}
.hero__inner { display: grid; grid-template-columns: 1.15fr 0.85fr; align-items: center; gap: 56px; }

.hero__hello { font-family: var(--font-mono); color: var(--accent); font-size: 0.95rem; margin-bottom: 10px; }
.hero__name {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(3rem, 8vw, 5.6rem); line-height: 1; letter-spacing: -0.03em;
  margin-bottom: 18px;
}
.hero__role {
  font-size: clamp(1.1rem, 2.4vw, 1.45rem); font-weight: 600;
  color: var(--text); margin-bottom: 20px; min-height: 1.6em;
}
.hero__role .mono { color: var(--primary); font-weight: 400; }
.caret {
  display: inline-block; width: 2px; height: 1.1em; margin: 0 2px -0.18em 3px;
  background: var(--accent); animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero__intro { max-width: 540px; color: var(--text-muted); font-size: 1.07rem; margin-bottom: 32px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 32px; }

.socials { display: flex; gap: 12px; }
.socials a {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-muted);
  backdrop-filter: blur(8px);
  transition: transform 0.3s var(--ease), color 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.socials a:hover { transform: translateY(-3px); color: var(--primary); border-color: var(--primary); }

.hero__visual { position: relative; display: grid; place-items: center; }
.hero__photo { position: relative; width: min(100%, 380px); aspect-ratio: 1; }

.hero__ring { position: absolute; inset: -12px; border-radius: 50%; border: 1.5px solid var(--border); }

.hero__frame {
  position: absolute; inset: 0; border-radius: 50%; overflow: hidden;
  background: var(--tint);
  border: 6px solid var(--bg);
  display: grid; place-items: center;
  transition: border-color 0.5s;
}
.hero__frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero__initials {
  font-family: var(--font-display); font-style: italic; font-weight: 600;
  font-size: clamp(4rem, 10vw, 6.5rem); color: var(--primary);
}

.chip-float {
  position: absolute; z-index: 4;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-size: 0.85rem; font-weight: 600; white-space: nowrap;
}
.chip-float .mono { color: var(--primary); }
.chip-float--1 { top: 6%; left: -6%; }

.pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; background: #22c55e; }
.pulse::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: #22c55e;
  animation: ping 1.8s var(--ease) infinite;
}
@keyframes ping { 0% { transform: scale(1); opacity: 0.7; } 100% { transform: scale(3); opacity: 0; } }

.scroll-hint { position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); opacity: 0.7; }
.scroll-hint__mouse {
  display: block; width: 24px; height: 38px; border-radius: 14px;
  border: 2px solid var(--text-muted); position: relative;
}
.scroll-hint__mouse span {
  position: absolute; left: 50%; top: 7px; width: 4px; height: 8px; margin-left: -2px;
  border-radius: 2px; background: var(--accent); animation: wheel 1.8s ease-in-out infinite;
}
@keyframes wheel { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(12px); } }

/* ---------- 9. À propos ---------- */
.about { display: grid; grid-template-columns: 1.2fr 1fr; gap: 56px; align-items: start; }
.about__text p { color: var(--text-muted); font-size: 1.06rem; margin-bottom: 18px; }
.about__info { display: grid; gap: 12px; margin: 26px 0 32px; }
.about__info li { display: flex; align-items: center; gap: 12px; font-weight: 500; }
.about__info .icon { color: var(--accent); }

.about__cta { display: flex; flex-wrap: wrap; gap: 12px; }
.about__stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.stat { padding: 28px 24px; }
.stat:hover { transform: translateY(-6px); box-shadow: var(--shadow-hover); }
.stat__num, .stat__plus {
  font-family: var(--font-display); font-weight: 600; font-size: 2.8rem; line-height: 1;
  color: var(--primary);
}
.stat__label { display: block; margin-top: 10px; color: var(--text-muted); font-size: 0.92rem; }

/* ---------- 10. Compétences ---------- */
.skills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.skill-card { padding: 30px 28px; }
.skill-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-hover); border-color: color-mix(in srgb, var(--primary) 40%, transparent); }
.skill-card__icon {
  display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 20px;
  border-radius: 16px; background: var(--tint); color: var(--primary);
}
.skill-card__icon .icon { width: 24px; height: 24px; }
.skill-card h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.35rem; margin-bottom: 16px; }

/* ---------- 11. Projets ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 36px; }
.filter {
  padding: 10px 20px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-muted);
  font-weight: 600; font-size: 0.92rem; backdrop-filter: blur(8px);
  transition: color 0.25s, background 0.25s, border-color 0.25s, transform 0.25s var(--ease);
}
.filter:hover { color: var(--text); transform: translateY(-2px); }
.filter.is-active { background: var(--btn-bg); color: var(--btn-text); border-color: transparent; }

.projects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.project { overflow: hidden; display: flex; flex-direction: column; }
.project:hover { transform: translateY(-8px); box-shadow: var(--shadow-hover); }
.project.is-hidden { display: none; }

.project__thumb {
  position: relative; aspect-ratio: 16 / 10; overflow: hidden;
  background: var(--tint);
  display: grid; place-items: center;
}
.project__thumb::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(var(--dots) 1.2px, transparent 1.2px);
  background-size: 16px 16px;
}
.project__thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.project__glyph {
  position: relative; font-family: var(--font-display); font-style: italic; font-weight: 600;
  font-size: 3.6rem; color: var(--primary);
  transition: transform 0.6s var(--ease);
}
.project:hover .project__glyph { transform: scale(1.15) rotate(-6deg); }
.project__glyph .icon { width: 60px; height: 60px; stroke-width: 1.5; }

.project__badge {
  position: absolute; top: 14px; left: 14px; z-index: 1;
  padding: 5px 12px; border-radius: 999px;
  background: var(--surface-strong); color: var(--primary); border: 1px solid var(--border);
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.02em;
}

/* Carte "D'autres projets" */
.project--more {
  justify-content: center; align-items: flex-start; gap: 14px;
  padding: 32px 28px; min-height: 100%;
  border: 1.5px dashed color-mix(in srgb, var(--primary) 45%, transparent);
  background: color-mix(in srgb, var(--surface) 60%, transparent);
}
.project--more p { color: var(--text-muted); font-size: 0.95rem; }
.project--more__icon {
  display: grid; place-items: center; width: 56px; height: 56px; border-radius: 18px;
  background: var(--tint); color: var(--primary);
}
.project--more__icon .icon { width: 26px; height: 26px; }
.project--more__link {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 4px;
  font-weight: 600; font-size: 0.92rem; color: var(--primary);
}
.project--more:hover .project--more__link { color: var(--accent); }
.project--more:hover { border-style: solid; }
.projects .project--more {
  grid-column: 1 / -1; min-height: 0;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; column-gap: 20px; row-gap: 4px;
  padding: 22px 28px;
}
.projects .project--more .project--more__icon { grid-column: 1; grid-row: 1 / span 2; }
.projects .project--more .project__title { grid-column: 2; grid-row: 1; }
.projects .project--more p { grid-column: 2; grid-row: 2; }
.projects .project--more .project--more__link { grid-column: 3; grid-row: 1 / span 2; margin-top: 0; }
@media (max-width: 600px) {
  .projects .project--more { grid-template-columns: auto 1fr; padding: 22px 20px; }
  .projects .project--more .project--more__link { grid-column: 1 / -1; grid-row: 3; margin-top: 8px; }
}

.project__body { padding: 24px 24px 26px; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.project__title { font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; line-height: 1.25; }
.project__body p { color: var(--text-muted); font-size: 0.95rem; }
.project__links { display: flex; gap: 18px; margin-top: auto; padding-top: 6px; }
.project__links a {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 600; font-size: 0.9rem; color: var(--primary);
  transition: color 0.25s;
}
.project__links a:hover { color: var(--accent); }

/* ---------- 12. Parcours (frise) ---------- */
.timeline { position: relative; max-width: 940px; margin-inline: auto; }
.timeline::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px;
  transform: translateX(-50%);
  background: var(--border);
}
.timeline__item { position: relative; width: 50%; padding: 0 48px 40px 0; }
.timeline__item:nth-child(even) { margin-left: 50%; padding: 0 0 40px 48px; }
.timeline__dot {
  position: absolute; top: 18px; right: -22px; z-index: 2;
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--surface-strong); border: 1.5px solid var(--border-strong); color: var(--primary);
}
.timeline__item:nth-child(even) .timeline__dot { right: auto; left: -22px; }
.timeline__dot .icon { width: 20px; height: 20px; }

.timeline__card { padding: 24px 26px; }
.timeline__card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.timeline__date { font-family: var(--font-mono); font-size: 0.8rem; color: var(--accent); }
.timeline__card h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; margin: 6px 0 2px; line-height: 1.3; }
.timeline__place { font-weight: 600; color: var(--primary); font-size: 0.92rem; margin-bottom: 8px; }
.timeline__card p:last-child { color: var(--text-muted); font-size: 0.94rem; }

/* ---------- 13. Contact ---------- */
.contact { display: grid; grid-template-columns: 1fr 1.1fr; gap: 48px; align-items: start; }
.contact__lead { font-size: 1.15rem; color: var(--text-muted); margin-bottom: 26px; max-width: 420px; }
.contact__item { display: flex; align-items: center; gap: 16px; padding: 16px 20px; margin-bottom: 14px; font-weight: 600; word-break: break-word; }
.contact__item small { display: block; font-weight: 500; color: var(--text-muted); font-size: 0.8rem; }
.contact__item:hover { transform: translateX(6px); border-color: var(--primary); }
.contact__icon {
  display: grid; place-items: center; width: 46px; height: 46px; flex-shrink: 0; border-radius: 14px;
  background: var(--tint); color: var(--primary);
}

.contact__form { padding: 32px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 8px; }
.field input, .field textarea {
  width: 100%; padding: 14px 16px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); background: var(--surface-strong);
  transition: border-color 0.25s, box-shadow 0.25s, background-color 0.5s;
  resize: vertical;
}
.field input::placeholder, .field textarea::placeholder { color: var(--text-muted); opacity: 0.7; }
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent);
}
.field .is-invalid { border-color: var(--danger); }
.form-error { min-height: 1.4em; margin-bottom: 8px; color: var(--danger); font-size: 0.88rem; font-weight: 500; }

/* ---------- 14. Pied de page ---------- */
.footer { position: relative; z-index: 1; padding: 32px 0 40px; border-top: 1px solid var(--border); }
.footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--text-muted); font-size: 0.92rem; }
.to-top {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--btn-bg); color: var(--btn-text); box-shadow: var(--shadow);
  transition: transform 0.3s var(--ease);
}
.to-top:hover { transform: translateY(-4px); }

/* Notification */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 60;
  max-width: calc(100% - 32px);
  padding: 14px 22px; border-radius: 14px;
  background: var(--surface-strong); border: 1px solid var(--border); box-shadow: var(--shadow);
  font-weight: 500;
  transform: translate(-50%, 140%); opacity: 0;
  transition: transform 0.5s var(--ease), opacity 0.5s;
}
.toast.is-visible { transform: translate(-50%, 0); opacity: 1; }

/* ---------- 15. Animations d'apparition ---------- */
.reveal {
  opacity: 0; transform: translateY(28px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: calc(var(--d, 0) * 90ms);
}
.reveal.is-visible { opacity: 1; transform: none; }
/* Une fois apparues, les cartes retrouvent leurs transitions rapides au survol */
.card.reveal.is-visible { transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s, background-color 0.5s, opacity 0.9s var(--ease); }
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- 16. Responsive ---------- */
@media (max-width: 960px) {
  .hero__inner { grid-template-columns: 1fr; gap: 64px; text-align: center; }
  .hero__intro { margin-inline: auto; }
  .hero__cta, .socials { justify-content: center; }
  .hero__visual { order: -1; }
  .hero__photo { width: min(72vw, 300px); }
  .about, .contact { grid-template-columns: 1fr; gap: 40px; }
  .skills, .projects { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 820px) {
  .nav__burger { display: flex; }
  .nav__menu {
    position: fixed; top: var(--nav-h); left: 16px; right: 16px;
    flex-direction: column; gap: 4px; padding: 14px;
    border-radius: var(--radius); border: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
    opacity: 0; visibility: hidden; transform: translateY(-12px);
    transition: opacity 0.3s, transform 0.4s var(--ease), visibility 0.3s;
  }
  .nav__menu.is-open { opacity: 1; visibility: visible; transform: none; }
  .nav__link { padding: 12px 16px; font-size: 1rem; }
  .nav__link.is-active::after { left: auto; right: 16px; bottom: 50%; transform: translateY(50%); }
  .nav { background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }

  .timeline::before { left: 22px; }
  .timeline__item, .timeline__item:nth-child(even) { width: 100%; margin-left: 0; padding: 0 0 28px 64px; }
  .timeline__dot, .timeline__item:nth-child(even) .timeline__dot { left: 0; right: auto; }
}

@media (max-width: 600px) {
  .section { padding: 80px 0; }
  .section__head { margin-bottom: 36px; }
  .skills, .projects { grid-template-columns: 1fr; }
  .about__stats { gap: 12px; }
  .stat { padding: 22px 18px; }
  .stat__num, .stat__plus { font-size: 2.2rem; }
  .hero__role { font-size: 1.1rem; }
  .hero__role .mono { display: none; }
  .chip-float { font-size: 0.75rem; padding: 8px 12px; }
  .chip-float--1 { left: -4%; top: 0; }
  .contact__form { padding: 24px 20px; }
  .footer__inner { flex-direction: column-reverse; text-align: center; }
}

/* ---------- 17. Accessibilité : moins d'animations si demandé ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
