/* =================================================================
   Cédric Hufnagel — perso.thehuf.uk
   Design system & styles (flat, sans build)
   ================================================================= */

/* ---------- 1. TOKENS ---------- */
:root {
  /* Couleurs — palette encre chaude, accent cuivre */
  --bg: #fbfaf8;
  --bg-2: #f5f3ef;
  --surface: #ffffff;
  --surface-2: #f6f5f1;
  --ink: #17150f;
  --ink-2: #45423a;
  --muted: #6f6c63;
  --muted-2: #94918a;
  --line: #ece8e1;
  --line-2: #e0dcd3;
  --accent: #9a5b32;
  --accent-2: #b8734a;
  --accent-ink: #5f3618;
  --accent-soft: rgba(154, 91, 50, 0.09);
  --accent-glow: rgba(154, 91, 50, 0.20);
  --on-dark: #f4f2ee;
  --on-dark-muted: rgba(244, 242, 238, 0.66);
  --on-dark-line: rgba(244, 242, 238, 0.14);

  /* Divers */
  --grid-line: rgba(23, 21, 15, 0.045);
  --ring: conic-gradient(from 210deg,
    rgba(184, 115, 74, 0.55), rgba(122, 139, 116, 0.45),
    rgba(184, 115, 74, 0.2), rgba(184, 115, 74, 0.55));
  color-scheme: light;

  /* Typographie */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Rayons */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 30px;
  --r-pill: 999px;

  /* Ombres */
  --shadow-sm: 0 1px 2px rgba(23, 21, 15, 0.05);
  --shadow-md: 0 10px 30px -14px rgba(23, 21, 15, 0.16);
  --shadow-lg: 0 36px 80px -30px rgba(23, 21, 15, 0.28);

  /* Layout */
  --container: 1140px;
  --nav-h: 70px;

  /* Mouvement */
  --ease: cubic-bezier(0.22, 0.7, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- 1b. THÈME SOMBRE ----------
   Appliqué quand l'utilisateur force "dark", et en mode système
   (data-theme="system") quand l'OS est en sombre. Bloc dupliqué :
   garder les deux listes synchronisées. */
:root[data-theme="dark"] {
  --bg: #16140f;
  --bg-2: #1b1913;
  --surface: #201d16;
  --surface-2: #27241c;
  --ink: #f2f0ea;
  --ink-2: #cbc8bf;
  --muted: #9c988d;
  --muted-2: #7d7970;
  --line: #2e2b22;
  --line-2: #3a362b;
  --accent: #cd8756;
  --accent-2: #dc9b6d;
  --accent-soft: rgba(205, 135, 86, 0.13);
  --accent-glow: rgba(205, 135, 86, 0.30);
  --grid-line: rgba(255, 255, 255, 0.05);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 30px -14px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 36px 80px -30px rgba(0, 0, 0, 0.65);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    --bg: #16140f;
    --bg-2: #1b1913;
    --surface: #201d16;
    --surface-2: #27241c;
    --ink: #f2f0ea;
    --ink-2: #cbc8bf;
    --muted: #9c988d;
    --muted-2: #7d7970;
    --line: #2e2b22;
    --line-2: #3a362b;
    --accent: #cd8756;
    --accent-2: #dc9b6d;
    --accent-soft: rgba(205, 135, 86, 0.13);
    --accent-glow: rgba(205, 135, 86, 0.30);
    --grid-line: rgba(255, 255, 255, 0.05);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 10px 30px -14px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 36px 80px -30px rgba(0, 0, 0, 0.65);
    color-scheme: dark;
  }
}

/* ---------- 2. RESET & BASE ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink-2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
ul, ol { margin: 0; padding: 0; list-style: none; }
p { margin: 0; }

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: 500;
  letter-spacing: -0.018em;
  line-height: 1.12;
}

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

::selection { background: var(--accent-glow); color: var(--ink); }

/* ---------- 3. LAYOUT ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2rem);
}

.section { padding: clamp(4.5rem, 9vw, 7.5rem) 0; }
.section--alt { background: var(--bg-2); }

[id] { scroll-margin-top: calc(var(--nav-h) + 16px); }

.skip-link {
  position: fixed;
  top: -100px;
  left: 1rem;
  z-index: 2000;
  background: var(--ink);
  color: var(--bg);
  padding: 0.7rem 1.1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 1rem; }

/* ---------- 4. EYEBROW & SECTION HEAD ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.1rem;
}
.eyebrow__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.eyebrow--on-dark { color: var(--accent-2); }

.section__head { max-width: 760px; margin-bottom: 3.25rem; }
.section__head--center { margin-inline: auto; text-align: center; }
.section__head--center .eyebrow { justify-content: center; }
.section__title { font-size: clamp(2rem, 4.2vw, 3.1rem); letter-spacing: -0.025em; }
.section__lead { margin-top: 1.1rem; font-size: 1.08rem; color: var(--muted); max-width: 60ch; }
.section__head--center .section__lead { margin-inline: auto; }

/* ---------- 5. BOUTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55em;
  padding: 0.85rem 1.3rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease),
              background 0.25s var(--ease), border-color 0.25s var(--ease);
}
.btn svg { transition: transform 0.25s var(--ease); }
.btn--primary {
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 10px 22px -12px var(--accent-glow);
}
.btn--primary:hover { transform: translateY(-2px); }
.btn--primary:hover svg { transform: translateX(3px); }
.btn--primary:active { transform: translateY(0); }
.btn--ghost {
  background: var(--surface);
  border-color: var(--line-2);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.btn--ghost:hover { border-color: var(--ink); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn--sm { padding: 0.6rem 0.95rem; font-size: 0.86rem; border-radius: 10px; }

/* ---------- 6. NAVIGATION ----------
   Pleine largeur : transparente en haut, voile flouté + hairline au
   scroll. Safe area iOS couverte. */
.nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  padding-top: env(safe-area-inset-top);
  border-bottom: 1px solid transparent;
  background: transparent;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}
.nav.is-scrolled {
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom-color: var(--line);
}
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .nav.is-scrolled { background: color-mix(in srgb, var(--bg) 96%, transparent); }
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
  gap: 1.5rem;
  transition: height 0.3s var(--ease);
}
.nav.is-scrolled .nav__inner { height: 60px; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.15rem;
  color: var(--ink);
}
.brand__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: #fff;
  box-shadow: 0 6px 16px -8px var(--accent-glow);
}

.nav__links {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.nav__links a {
  padding: 0.5rem 0.85rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-2);
  border-radius: 8px;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.nav__links a:hover { color: var(--ink); background: var(--surface-2); }
.nav__links a.is-active:not(.nav__cta) { color: var(--accent); }
.nav__links a.nav__cta { margin-left: 0.5rem; color: #fff; }
.nav__links a.nav__cta:hover { color: #fff; background: linear-gradient(180deg, var(--accent-2), var(--accent)); }

/* Soulignement actif glissant */
.nav__ind {
  position: absolute;
  bottom: -2px;
  left: 0;
  height: 2px;
  width: 0;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0;
  transition: transform 0.35s var(--ease), width 0.35s var(--ease), opacity 0.25s var(--ease);
  pointer-events: none;
}

.nav__actions { display: flex; align-items: center; gap: 0.5rem; }
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  box-shadow: var(--shadow-sm);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.theme-toggle:hover { color: var(--accent); border-color: var(--line-2); transform: translateY(-1px); }
.theme-toggle .ic { display: none; }
:root[data-theme="system"] .theme-toggle .ic--system,
:root[data-theme="light"] .theme-toggle .ic--light,
:root[data-theme="dark"] .theme-toggle .ic--dark { display: block; }

.nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 0 11px;
}
.nav__toggle-bar {
  height: 2px;
  width: 100%;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.2s var(--ease);
}
.nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- 7. HERO ---------- */
.hero {
  position: relative;
  padding: clamp(3.5rem, 8vw, 6.5rem) 0 clamp(3.5rem, 7vw, 6rem);
  overflow: hidden;
}
.hero__bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.hero__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 60px 60px;
  -webkit-mask: radial-gradient(ellipse 72% 60% at 50% 0%, #000 30%, transparent 76%);
          mask: radial-gradient(ellipse 72% 60% at 50% 0%, #000 30%, transparent 76%);
}
.hero__glow { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.35; }
.hero__glow--1 {
  width: 520px; height: 520px;
  top: -180px; left: -120px;
  background: radial-gradient(circle, rgba(184, 115, 74, 0.4), transparent 65%);
}
.hero__glow--2 {
  width: 460px; height: 460px;
  top: -120px; right: -80px;
  background: radial-gradient(circle, rgba(122, 139, 116, 0.32), transparent 65%);
}

.hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 4.5rem);
}
.hero__title {
  font-size: clamp(2.4rem, 5.2vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0.4rem 0 0.5rem;
}
.hero__roles {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.2vw, 1.5rem);
  color: var(--accent);
  min-height: 1.5em;
  margin-bottom: 1.1rem;
}
.hero__caret {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 3px;
  vertical-align: text-bottom;
  background: var(--accent);
  animation: caret 1.1s steps(1) infinite;
}
.hero__lead { font-size: 1.12rem; color: var(--muted); max-width: 54ch; line-height: 1.6; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 2rem; }
.hero .eyebrow__dot { animation: pulse 2.6s ease-in-out infinite; }

/* Portrait */
.hero__media { position: relative; justify-self: center; width: 100%; max-width: 320px; }
.portrait {
  position: relative;
  padding: 4px;
  border-radius: var(--r-xl);
  background: var(--ring);
  box-shadow: var(--shadow-lg);
}
.portrait img {
  width: 100%;
  border-radius: calc(var(--r-xl) - 5px);
  object-fit: cover;
  aspect-ratio: 1 / 1;
}
.portrait__halo {
  position: absolute;
  inset: -14%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, rgba(184, 115, 74, 0.22), transparent 62%);
  filter: blur(44px);
}

@keyframes caret { 50% { opacity: 0; } }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px var(--accent-soft); }
  50% { box-shadow: 0 0 0 8px transparent; }
}

/* ---------- 8. CHIFFRES ---------- */
.facts { border-block: 1px solid var(--line); background: var(--surface); }
.facts__inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  padding-block: 2.5rem;
}
.fact { text-align: center; }
.fact__num {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 500;
  color: var(--accent);
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.fact__label { margin-top: 0.35rem; font-size: 0.95rem; font-weight: 600; color: var(--ink); }
.fact__label span { display: block; font-size: 0.82rem; font-weight: 400; color: var(--muted); }

/* ---------- 9. À PROPOS ---------- */
.about__inner {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}
.about__lead { font-size: 1.2rem; color: var(--ink); line-height: 1.6; font-style: italic; }
.about__text { margin-top: 1.25rem; color: var(--muted); }
.about__meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem 2rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.about__meta li { font-size: 0.95rem; color: var(--ink-2); }
.about__meta strong {
  display: block;
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-2);
  margin-bottom: 0.1rem;
}
.about__meta a { color: var(--accent); }
.about__meta a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 10. PARCOURS (timeline) ---------- */
.timeline__cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.timeline__heading {
  font-size: 1.35rem;
  margin-bottom: 1.75rem;
}
.tl-item {
  position: relative;
  padding: 0 0 2rem 1.75rem;
  border-left: 2px solid var(--line-2);
}
.tl-item:last-child { padding-bottom: 0.5rem; }
.tl-item::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg-2);
  border: 2.5px solid var(--accent);
}
.tl-item__title { font-family: var(--font-sans); font-size: 1.05rem; font-weight: 600; color: var(--ink); }
.tl-item__period {
  display: inline-block;
  margin: 0.4rem 0;
  padding: 0.2rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 7px;
}
.tl-item__org { font-size: 0.9rem; font-style: italic; color: var(--muted); margin-bottom: 0.5rem; }
.tl-item__text { font-size: 0.94rem; color: var(--ink-2); line-height: 1.6; }
.tl-item__text a { color: var(--accent); }
.tl-item__text a:hover { text-decoration: underline; text-underline-offset: 3px; }
.tl-item__list { margin-top: 0.6rem; display: flex; flex-direction: column; gap: 0.35rem; }
.tl-item__list li {
  position: relative;
  padding-left: 1.1rem;
  font-size: 0.92rem;
  color: var(--muted);
}
.tl-item__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------- 11. COMPÉTENCES ---------- */
.skills__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2.5rem;
}
.skills__grid li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.1rem 1.3rem;
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.skills__grid li:hover { transform: translateY(-3px); border-color: var(--line-2); box-shadow: var(--shadow-md); }
.skills__grid svg { color: var(--accent); flex-shrink: 0; }

/* Accordéons */
.acc {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  margin-bottom: 0.75rem;
}
.acc[open] { border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.acc summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.35rem;
  font-weight: 600;
  font-size: 1rem;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}
.acc summary::-webkit-details-marker { display: none; }
.acc summary svg { flex-shrink: 0; color: var(--muted); transition: transform 0.3s var(--ease); }
.acc[open] summary svg { transform: rotate(180deg); color: var(--accent); }
.acc__body { padding: 0 1.35rem 1.25rem; color: var(--muted); font-size: 0.95rem; }
.acc__body ul { margin-top: 0.6rem; display: flex; flex-direction: column; gap: 0.35rem; }
.acc__body li { position: relative; padding-left: 1.1rem; }
.acc__body li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------- 12. PUBLICATIONS ---------- */
.pub-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2.25rem;
}
.pub-filter {
  padding: 0.5rem 1rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-pill);
  transition: color 0.2s var(--ease), background 0.2s var(--ease),
              border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.pub-filter:hover { border-color: var(--ink-2); }
.pub-filter.is-active {
  color: #fff;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  border-color: transparent;
  box-shadow: 0 6px 16px -10px var(--accent-glow);
}

.pub-list { max-width: 880px; margin-inline: auto; }
.pub {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 1.5rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  margin-bottom: 0.85rem;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease),
              box-shadow 0.3s var(--ease), opacity 0.3s var(--ease);
}
.pub:hover { transform: translateY(-2px); border-color: var(--line-2); box-shadow: var(--shadow-md); }
.pub.is-hidden { display: none; }
.pub__side {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding-right: 1.5rem;
  border-right: 1px solid var(--line);
}
.pub__year { font-family: var(--font-display); font-size: 1.5rem; color: var(--accent); line-height: 1; }
.pub__type {
  align-self: start;
  padding: 0.2rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: var(--r-pill);
}
.pub__title { font-family: var(--font-display); font-size: 1.12rem; color: var(--ink); margin-bottom: 0.35rem; line-height: 1.35; }
.pub__authors { font-size: 0.85rem; color: var(--muted); line-height: 1.5; }
.pub__authors strong { color: var(--ink-2); }
.pub__venue { font-size: 0.9rem; color: var(--muted); margin-top: 0.15rem; }
.pub__links { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.85rem; }
.pub__links a {
  display: inline-flex;
  padding: 0.3rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: var(--r-pill);
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.pub__links a:hover { background: var(--accent); color: #fff; }

/* ---------- 13. PROJETS ---------- */
.projects__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.project {
  display: flex;
  flex-direction: column;
  padding: 1.85rem 1.75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.project:hover { transform: translateY(-5px); border-color: var(--line-2); box-shadow: var(--shadow-md); }
.project__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 13px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 1.1rem;
}
.project__title { font-size: 1.25rem; margin-bottom: 0.5rem; }
.project__text { font-size: 0.94rem; color: var(--muted); line-height: 1.55; flex-grow: 1; }
.project__link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 1.1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
}
.project__link:hover { color: var(--accent-ink); }
:root[data-theme="dark"] .project__link:hover { color: var(--accent-2); }

/* ---------- 14. CONTACT ---------- */
.contact { background: linear-gradient(180deg, #1e1a14, #14110c); color: var(--on-dark); }
.contact__title { color: var(--on-dark); font-size: clamp(2rem, 4.2vw, 3.1rem); }
.contact__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.contact__lead { margin-top: 1.25rem; color: var(--on-dark-muted); font-size: 1.08rem; max-width: 46ch; }
.contact__methods { display: flex; flex-direction: column; gap: 0.85rem; }
.contact-method {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--on-dark-line);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease), transform 0.25s var(--ease);
}
a.contact-method:hover { border-color: rgba(244, 242, 238, 0.32); background: rgba(255, 255, 255, 0.06); transform: translateX(4px); }
.contact-method__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 11px;
  background: rgba(184, 115, 74, 0.2);
  color: var(--accent-2);
}
.contact-method__label { display: flex; flex-direction: column; font-size: 0.95rem; color: var(--on-dark-muted); line-height: 1.4; }
.contact-method__label strong {
  color: var(--on-dark);
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.15rem;
}

/* Bloc code : Codeberg mis en avant, GitHub en miroir secondaire */
.contact-method--code { display: flex; gap: 0.6rem; }
.cm-code {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--on-dark-line);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease), transform 0.25s var(--ease);
}
.cm-code--main {
  flex: 1 1 auto;
  min-width: 0;
  border-color: color-mix(in srgb, var(--accent-2) 32%, var(--on-dark-line));
  background: rgba(184, 115, 74, 0.08);
}
.cm-code--main:hover { border-color: color-mix(in srgb, var(--accent-2) 55%, transparent); background: rgba(184, 115, 74, 0.14); transform: translateX(4px); }
.cm-code--alt {
  flex: 0 0 auto;
  gap: 0.5rem;
  color: var(--on-dark-muted);
  font-size: 0.82rem;
  font-weight: 600;
}
.cm-code--alt svg { color: var(--muted-2); transition: color 0.2s var(--ease); }
.cm-code--alt:hover { border-color: rgba(244, 242, 238, 0.32); background: rgba(255, 255, 255, 0.06); color: var(--on-dark); }
.cm-code--alt:hover svg { color: var(--on-dark); }

/* ---------- 15. FOOTER ---------- */
.footer {
  background: #0f0d09;
  color: var(--on-dark-muted);
  padding: 2.5rem 0 calc(2rem + env(safe-area-inset-bottom));
}
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
}
.footer__id { font-family: var(--font-display); color: var(--on-dark); font-size: 1rem; }
.footer__nav { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.footer__nav a { font-size: 0.9rem; color: var(--on-dark-muted); transition: color 0.2s var(--ease); }
.footer__nav a:hover { color: var(--on-dark); }
.footer__legal { font-size: 0.82rem; }

/* ---------- 16. REVEAL ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.75s var(--ease-out), transform 0.75s var(--ease-out);
}
.reveal.is-visible { opacity: 1; transform: none; }
.facts .fact:nth-child(2), .projects__grid .project:nth-child(2) { transition-delay: 0.08s; }
.facts .fact:nth-child(3), .projects__grid .project:nth-child(3) { transition-delay: 0.16s; }
.facts .fact:nth-child(4) { transition-delay: 0.24s; }

/* ---------- 17. RESPONSIVE ---------- */
@media (max-width: 1024px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__media { max-width: 240px; margin-inline: auto; margin-top: 1.25rem; }
  .about__inner, .contact__inner { grid-template-columns: 1fr; }
  .timeline__cols { grid-template-columns: 1fr; }
  .facts__inner { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .nav__links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    padding: 1rem clamp(1.25rem, 4vw, 2rem) 1.5rem;
    background: color-mix(in srgb, var(--bg) 95%, transparent);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0.25s;
  }
  .nav__links.is-open { opacity: 1; visibility: visible; transform: none; }
  .nav__ind { display: none; }
  .nav__links a { padding: 0.85rem 1rem; border-radius: 10px; font-size: 1rem; }
  .nav__cta { margin: 0.5rem 0 0; text-align: center; }
  .nav__toggle { display: flex; }
  .skills__grid { grid-template-columns: 1fr 1fr; }
  .projects__grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  body { font-size: 1rem; }
  .facts__inner { grid-template-columns: 1fr 1fr; gap: 1.75rem 1rem; }
  .skills__grid { grid-template-columns: 1fr; }
  .about__meta { grid-template-columns: 1fr; }
  .hero__media { max-width: 200px; }
  .hero__actions .btn { width: 100%; }
  .pub { grid-template-columns: 1fr; gap: 0.85rem; }
  .pub__side {
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    padding-right: 0;
    padding-bottom: 0.85rem;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .pub__year { font-size: 1.15rem; }
}

/* ---------- 18. REDUCED MOTION ---------- */
@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; }
  .hero__caret { display: none; }
}
