/* Polices hébergées localement (Inter, JetBrains Mono — licence SIL OFL) */
/* Inter · latin-ext */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/assets/fonts/inter-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Inter · latin */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/assets/fonts/inter-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* JetBrains Mono · latin-ext */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url(/assets/fonts/jetbrains-mono-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* JetBrains Mono · latin */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url(/assets/fonts/jetbrains-mono-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ==========================================================================
   Portfolio — Matteo Robert · Design system « thème sombre v1.0 »
   ========================================================================== */

:root {
  --bg: #0f0f0d;
  --bg-2: #171714;
  --bg-3: #1f1f1b;
  --line: #2c2c27;
  --accent: #ff5a1f;
  --accent-hover: #ff7340;
  --accent-soft: rgba(255, 90, 31, 0.1);
  --text: #eeebe3;
  --muted: #9a968b;
  --dim: #85817a; /* contraste 4,9:1 sur --bg (WCAG AA) */
  --lime: #d7f25c;
  --accent-ink: var(--accent);   /* accent utilisé comme couleur de petit texte */
  --accent-big: var(--accent);   /* accent pour les grands titres */
  --ok-ink: var(--lime);
  --err-ink: #ff8a8d;
  --line-hover: #3d3d36;
  --header-bg: rgba(15, 15, 13, 0.82);
  --shadow: rgba(0, 0, 0, 0.5);
  --pure: #000;

  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --container: 1240px;
  --gutter: 40px;
  --section: 120px;
  --r-card: 20px;
  --r-thumb: 14px;
  --r-contact: 28px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  color-scheme: dark;
}

/* ---------- Mode clair ----------
   Suit le réglage du système, sauf si le visiteur a choisi avec le bouton (data-theme). */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f4f2ec; --bg-2: #fbfaf7; --bg-3: #ebe8df; --line: #dcd8cc;
    --text: #161613; --muted: #57544c; --dim: #6b675f;
    --accent-ink: #c2410c; --accent-big: #e8501a; --ok-ink: #4d6b00; --err-ink: #c4262c;
    --line-hover: #b9b4a6; --header-bg: rgba(244, 242, 236, 0.85);
    --shadow: rgba(60, 50, 30, 0.18); --pure: #fff;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f4f2ec; --bg-2: #fbfaf7; --bg-3: #ebe8df; --line: #dcd8cc;
  --text: #161613; --muted: #57544c; --dim: #6b675f;
  --accent-ink: #c2410c; --accent-big: #e8501a; --ok-ink: #4d6b00; --err-ink: #c4262c;
  --line-hover: #b9b4a6; --header-bg: rgba(244, 242, 236, 0.85);
  --shadow: rgba(60, 50, 30, 0.18); --pure: #fff;
  color-scheme: light;
}
/* Les illustrations et blocs de code restent sombres, comme des écrans, quel que soit le thème */
.thumb, .case-visual, .code {
  --bg: #0f0f0d; --bg-2: #171714; --bg-3: #1f1f1b; --line: #2c2c27;
  --text: #eeebe3; --muted: #9a968b; --dim: #85817a;
  --accent-ink: #ff5a1f; --accent-big: #ff5a1f; --line-hover: #3d3d36;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[hidden] { display: none !important; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--bg); }

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

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--accent); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-weight: 600;
}
.skip-link:focus { top: 16px; }

.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.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;
}

/* ---------- Typo utilitaires ---------- */

.label {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim);
}
.label .num, .num { color: var(--accent-ink); }

.h2 {
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1;
  margin: 0;
}
.h3 { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; margin: 0; }
.lead { font-size: 20px; color: var(--muted); line-height: 1.5; }

/* ---------- Boutons & tags ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  font-size: 14px; font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background .2s, border-color .2s, color .2s;
}
.btn .arrow { display: inline-block; transition: transform .25s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }
.btn:hover .arrow.up { transform: translate(2px, -2px); }
.btn:hover .arrow.down { transform: translateY(3px); }
.btn:hover { border-color: var(--text); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #140a05; }
.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn--dark { background: #0f0f0d; border-color: #0f0f0d; color: #eeebe3; }
.btn--dark:hover { background: #000; border-color: #000; }
.btn--sm { padding: 8px 16px; font-size: 13px; }
.btn[disabled] { opacity: .6; cursor: wait; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; list-style: none; }
.tag {
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px;
}

.round-btn {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--line);
  transition: background .2s, border-color .2s, transform .25s var(--ease);
}
.round-btn--accent { background: var(--accent); border-color: var(--accent); color: #140a05; }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  height: 76px;
  border-bottom: 1px solid var(--line);
}
.logo { font-weight: 700; letter-spacing: -0.02em; font-size: 17px; }
.logo span { color: var(--dim); }

.nav ul { display: flex; gap: 28px; margin: 0; padding: 0; list-style: none; }
.nav a { font-size: 13px; color: var(--muted); transition: color .2s; }
.nav a .n { font-family: var(--mono); font-size: 11px; color: var(--dim); margin-right: 4px; }
.nav a:hover, .nav a[aria-current="true"] { color: var(--text); }

.menu-toggle {
  display: none;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); background: transparent; cursor: pointer;
  place-items: center;
}
.menu-toggle span { display: block; width: 16px; height: 1.5px; background: var(--text); position: relative; }
.menu-toggle span::after { content: ""; position: absolute; left: 0; top: 5px; width: 16px; height: 1.5px; background: var(--text); }
.menu-toggle span::before { content: ""; position: absolute; left: 0; top: -5px; width: 16px; height: 1.5px; background: var(--text); }

/* Bouton mode clair / sombre */
.theme-toggle {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--line); background: transparent;
  color: var(--text); cursor: pointer; transition: border-color .2s;
}
.theme-toggle:hover { border-color: var(--text); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
/* Sans choix explicite, l'icône propose le thème opposé à celui du système */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .theme-toggle .sun { display: block; }
  :root:not([data-theme]) .theme-toggle .moon { display: none; }
}
.header-actions { display: flex; align-items: center; gap: 10px; }
.lang-switch { padding: 6px 4px; color: var(--muted); transition: color .2s; }
.lang-switch:hover { color: var(--text); }

/* Menu mobile plein écran */
.mobile-menu {
  position: fixed; inset: 0; z-index: 60;
  background: var(--bg);
  padding: 20px;
  display: flex; flex-direction: column;
}
.mobile-menu__inner {
  flex: 1; border: 1px solid var(--line); border-radius: var(--r-card);
  background: var(--bg-2); padding: 24px; display: flex; flex-direction: column;
}
.mobile-menu__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.mobile-menu__close { background: none; border: 0; font-size: 28px; line-height: 1; cursor: pointer; padding: 6px; }
.mobile-menu ul { list-style: none; margin: 0; padding: 0; }
.mobile-menu li a {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 18px 0; border-bottom: 1px solid var(--line);
  font-size: 34px; font-weight: 600; letter-spacing: -0.03em;
}
.mobile-menu li a .n { font-family: var(--mono); font-size: 11px; color: var(--dim); font-weight: 400; letter-spacing: 0; }
.mobile-menu li:last-child a { color: var(--accent-big); }
.mobile-menu .btn { margin-top: auto; justify-content: center; }

/* ---------- Hero ---------- */

.hero { padding-block: 56px 72px; }
.hero__meta { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 40px; }
.status { display: inline-flex; align-items: center; gap: 10px; }
.status::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--lime);
  box-shadow: 0 0 0 4px rgba(215, 242, 92, 0.15);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(215, 242, 92, 0.04); } }

.hero__top { position: relative; }
.hero__title {
  font-size: clamp(32px, 8.4vw, 120px);
  font-weight: 600;
  line-height: 0.92;
  letter-spacing: -0.045em;
  margin: 0;
  overflow-wrap: anywhere;
}
/* Inter est une police variable : ses contours se chevauchent et un simple text-stroke
   dessine des lignes parasites dans les lettres. On remplit avec la couleur du fond et on
   peint le trait (doublé) en dessous : le remplissage masque les chevauchements. */
.hero__title .outline {
  color: var(--bg);
  -webkit-text-stroke: 3px var(--text);
  paint-order: stroke fill;
  font-weight: 500;
}
.hero__title .accent { color: var(--accent-big); }

.portrait {
  position: absolute; right: 0; top: 0;
  width: clamp(120px, 15vw, 200px);
  transform: rotate(6deg);
}
.portrait img {
  width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 50%;
  filter: grayscale(0.15) contrast(1.02);
  box-shadow: 0 0 0 1px var(--line), 0 20px 50px var(--shadow);
}
.portrait__badge {
  position: absolute; bottom: 4px; left: -10px;
  background: var(--bg-3); border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 10px; transform: rotate(-6deg); white-space: nowrap;
}

.hero__bottom {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; flex-wrap: wrap;
  margin-top: 48px;
}
.hero__intro { max-width: 520px; color: var(--muted); margin: 0; font-size: 17px; }
.hero__intro strong { color: var(--text); font-weight: 500; }
.hero__ctas { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Bandeau défilant ---------- */

.marquee {
  border-block: 1px solid var(--line);
  overflow: hidden;
  padding-block: 18px;
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.marquee__track { display: flex; width: max-content; animation: marquee 45s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee ul { display: flex; margin: 0; padding: 0; list-style: none; }
.marquee li { display: flex; align-items: center; font-size: 22px; color: var(--muted); letter-spacing: -0.01em; white-space: nowrap; }
.marquee li::after { content: "✦"; color: var(--accent); font-size: 11px; margin-inline: 34px; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */

.section { padding-block: var(--section) 0; }
.section__head {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 16px;
  padding-bottom: 24px; margin-bottom: 32px;
  border-bottom: 1px solid var(--line);
}

/* ---------- Cartes projets ---------- */

.card {
  position: relative;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 10px;
  transition: border-color .25s, transform .35s var(--ease);
}
a.card:hover { border-color: var(--line-hover); }
a.card:hover .round-btn { transform: rotate(45deg); }

.thumb {
  border-radius: var(--r-thumb);
  overflow: hidden;
  background: var(--bg-3);
  aspect-ratio: 16 / 10;
}
.thumb svg { width: 100%; height: 100%; }

.card--feature { display: grid; grid-template-columns: 1.45fr 1fr; gap: 10px; }
.card--feature .thumb { aspect-ratio: auto; min-height: 380px; }
.card__body { padding: 22px 20px 20px; display: flex; flex-direction: column; gap: 12px; }
.card__top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.card__body p { margin: 0; color: var(--muted); font-size: 14px; }
.card--feature .card__body { padding: 26px; }
.card--feature .h3 { font-size: clamp(24px, 2.4vw, 32px); }
/* Variante image à droite, pour alterner avec la carte du haut */
.card--reverse { grid-template-columns: 1fr 1.45fr; margin-top: 20px; }
.card--reverse .thumb { order: 2; }

.stats { display: flex; gap: 36px; flex-wrap: wrap; margin-top: auto; padding-top: 22px; border-top: 1px solid var(--line); }
.stat b { display: block; font-size: 26px; font-weight: 600; letter-spacing: -0.03em; }
.stat .label { font-size: 11px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }

/* ---------- Contact ---------- */

.contact {
  background: var(--accent);
  color: #140a05;
  border-radius: var(--r-contact);
  padding: clamp(28px, 5vw, 64px);
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
}
.contact .label { color: rgba(20, 10, 5, 0.6); }
.contact__title {
  font-size: clamp(42px, 6.4vw, 88px);
  font-weight: 600; letter-spacing: -0.05em; line-height: 0.92;
  margin: 18px 0 24px;
}
.contact__text { margin: 0 0 28px; max-width: 420px; font-size: 16px; color: rgba(20, 10, 5, 0.78); }
.contact__mail {
  display: inline-block; font-size: clamp(18px, 2vw, 22px); font-weight: 500;
  border-bottom: 2px solid #140a05; padding-bottom: 2px; margin-top: 6px; word-break: break-all;
}
.contact__mail:hover { border-bottom-color: transparent; }
.contact__facts { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 8px; font-size: 14px; }
.contact__facts li::before { content: "→ "; }
.contact__actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 28px; }
.contact__actions .btn:not(.btn--dark) { border-color: #140a05; }
.contact__actions .btn:not(.btn--dark):hover { background: rgba(20,10,5,.08); }

.form {
  background: var(--bg);
  color: var(--text);
  border-radius: var(--r-card);
  padding: clamp(20px, 3vw, 32px);
  display: grid; gap: 16px;
  box-shadow: 0 30px 60px -30px rgba(20, 10, 5, 0.6);
}
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 6px; }
.field label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.field label .opt { color: var(--dim); text-transform: none; letter-spacing: 0; }
.field input, .field textarea {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 15px;
  transition: border-color .2s, background .2s;
}
.field textarea { min-height: 140px; resize: vertical; line-height: 1.5; }
.field input::placeholder, .field textarea::placeholder { color: var(--dim); }
.field input:hover, .field textarea:hover { border-color: var(--line-hover); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); background: var(--bg-3); }
.field input:user-invalid, .field textarea:user-invalid { border-color: #e5484d; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form__foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.form__note { font-size: 12px; color: var(--dim); margin: 0; max-width: 260px; }
.form__status { margin: 0; font-size: 14px; border-radius: 12px; padding: 12px 14px; }
.form__status.ok { background: rgba(215, 242, 92, .1); color: var(--ok-ink); border: 1px solid rgba(215, 242, 92, .3); }
.form__status.err { background: rgba(229, 72, 77, .1); color: var(--err-ink); border: 1px solid rgba(229, 72, 77, .35); }

/* ---------- À propos / parcours ---------- */

.about { display: grid; grid-template-columns: 1fr 1.1fr; gap: 64px; }
.about__lead { font-size: clamp(22px, 2.3vw, 28px); line-height: 1.3; letter-spacing: -0.02em; margin: 0 0 28px; font-weight: 500; }
.about__lead span { color: var(--dim); }
.about__facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 28px; }
.about__facts div { background: var(--bg); padding: 14px 16px; }
.about__facts dt { margin-bottom: 2px; }
.about__facts dd { margin: 0; font-size: 14px; }
.about__links { display: flex; gap: 10px; flex-wrap: wrap; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline__group { font-family: var(--mono); font-size: 11px; color: var(--accent-ink); text-transform: uppercase; letter-spacing: .06em; padding: 22px 0 8px; }
.timeline__group:first-child { padding-top: 0; }
.timeline li.item {
  display: grid; grid-template-columns: 130px 1fr auto; gap: 16px; align-items: baseline;
  padding: 18px 0; border-top: 1px solid var(--line);
}
.timeline .when { font-family: var(--mono); font-size: 11px; color: var(--dim); text-transform: uppercase; }
.timeline .what b { display: block; font-weight: 600; font-size: 16px; }
.timeline .what span { font-size: 13px; color: var(--muted); }
.timeline .where { font-family: var(--mono); font-size: 11px; color: var(--dim); text-transform: uppercase; }
.timeline .badge { border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; color: var(--muted); }

/* ---------- Compétences ---------- */

.skills { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.skill { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-card); padding: 22px; }
.skill__icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-ink);
  font-family: var(--mono); font-size: 13px; margin-bottom: 26px;
}
.skill h3 { font-size: 16px; margin: 0 0 10px; font-weight: 600; }
.skill ul { list-style: none; padding: 0; margin: 0; font-size: 13px; color: var(--muted); display: grid; gap: 4px; }

/* ---------- Footer ---------- */

.site-footer { margin-top: var(--section); }
.site-footer .container {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding-block: 28px; border-top: 1px solid var(--line);
}
.site-footer a:hover { color: var(--text); }

/* ---------- Page projet (étude de cas) ---------- */

.case-hero { padding-block: 40px 0; }
.case-hero__nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 40px; }
.back { font-size: 13px; color: var(--muted); }
.back:hover { color: var(--text); }
.case-hero__grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; align-items: end; }
.case-title { font-size: clamp(44px, 7vw, 96px); font-weight: 600; letter-spacing: -0.045em; line-height: 0.95; margin: 16px 0 0; }
.case-hero__side p { margin: 0 0 24px; }

.meta { display: grid; grid-template-columns: repeat(4, 1fr); border-block: 1px solid var(--line); margin-top: 48px; }
.meta > div { padding: 20px 20px 20px 0; }
.meta > div + div { border-left: 1px solid var(--line); padding-left: 20px; }
.meta dt { margin-bottom: 6px; }
.meta dd { margin: 0; font-size: 14px; font-weight: 500; }

.case-visual { margin-top: 32px; border-radius: var(--r-card); overflow: hidden; border: 1px solid var(--line); background: var(--bg-2); }
.case-visual svg { width: 100%; height: auto; }

.case-body { display: grid; grid-template-columns: 220px 1fr; gap: 64px; padding-top: 96px; }
.case-body > * { min-width: 0; }
.toc { position: sticky; top: 110px; align-self: start; }
.toc ol { list-style: none; margin: 16px 0 0; padding: 0; }
.toc a { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--dim); transition: color .2s; }
.toc a .n { font-family: var(--mono); font-size: 11px; margin-right: 8px; }
.toc a:hover, .toc a[aria-current="true"] { color: var(--text); }
.toc a[aria-current="true"] .n { color: var(--accent-ink); }

.case-section { max-width: 760px; padding-bottom: 96px; }
.case-section h2 { font-size: clamp(28px, 3.4vw, 40px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.08; margin: 12px 0 20px; }
.case-section p { color: var(--muted); margin: 0 0 16px; }
.case-section p strong { color: var(--text); font-weight: 600; }
.case-section code { font-family: var(--mono); font-size: .88em; color: var(--text); background: var(--bg-3); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.skill ul a { color: var(--text); border-bottom: 1px solid var(--accent); }
.skill ul a:hover { color: var(--accent-ink); }
.case-section ul.list { color: var(--muted); padding-left: 0; list-style: none; display: grid; gap: 10px; margin: 0 0 16px; }
.case-section ul.list li { padding-left: 22px; position: relative; }
.case-section ul.list li::before { content: ""; position: absolute; left: 2px; top: 10px; width: 8px; height: 1px; background: var(--accent); }
.quote { border-left: 2px solid var(--accent); padding: 4px 0 4px 20px; margin: 28px 0; }
.quote p { color: var(--text); font-size: 20px; line-height: 1.4; margin: 0 0 8px; letter-spacing: -0.01em; }

.figures { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 28px; max-width: none; }
.figure .thumb { aspect-ratio: 4 / 3; border: 1px solid var(--line); }
.figure figcaption { margin-top: 10px; }
.figure { margin: 0; }

.code {
  background: #0a0a09; border: 1px solid var(--line); border-radius: 14px;
  padding: 22px 24px; overflow-x: auto; margin-top: 24px;
  font-family: var(--mono); font-size: 13px; line-height: 1.75; color: var(--muted);
}
.code .c { color: var(--dim); }
.code .k { color: var(--accent); }
.code .s { color: var(--lime); }
.code .v { color: var(--text); }

.results { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 24px; }
.result { background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.result b { display: block; font-size: clamp(32px, 4vw, 44px); color: var(--accent-big); font-weight: 600; letter-spacing: -0.04em; line-height: 1.1; margin-bottom: 8px; }

.next {
  display: flex; justify-content: space-between; align-items: center; gap: 32px; flex-wrap: wrap;
  border-top: 1px solid var(--line); padding-top: 56px;
}
.next__title { font-size: clamp(40px, 6vw, 80px); font-weight: 600; letter-spacing: -0.045em; line-height: 0.95; margin: 12px 0 0; transition: color .2s; }
.next:hover .next__title { color: var(--accent-big); }

/* ---------- 404 ---------- */
.notfound { min-height: 70vh; display: grid; place-content: center; text-align: center; gap: 20px; }
.notfound h1 { font-size: clamp(80px, 18vw, 200px); margin: 0; letter-spacing: -0.06em; line-height: 1; }
.notfound h1 span { color: var(--accent-big); }

/* ---------- Animations d'apparition ---------- */

.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }

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

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  .skills { grid-template-columns: repeat(2, 1fr); }
  .card--feature { grid-template-columns: 1fr; }
  .card--feature .thumb { min-height: 0; aspect-ratio: 16 / 9; }
  .card--reverse .thumb { order: 0; }
  .contact { grid-template-columns: 1fr; }
  .about { grid-template-columns: 1fr; gap: 40px; }
}

@media (max-width: 860px) {
  :root { --gutter: 20px; --section: 88px; }
  .nav, .site-header .btn { display: none; }
  .menu-toggle { display: grid; }
  .site-header .container { height: 64px; }
  .portrait { position: static; transform: none; width: 96px; margin-bottom: 24px; }
  .portrait__badge { display: none; }
  .hero { padding-top: 32px; }
  .hero__meta { margin-bottom: 28px; }
  .hero__meta .label:last-child { display: none; }
  .hero__top { display: flex; flex-direction: column-reverse; }
  .hero__ctas { width: 100%; flex-direction: column; }
  .hero__ctas .btn { justify-content: center; padding-block: 16px; }
  .marquee li { font-size: 18px; }
  .grid-2 { grid-template-columns: 1fr; }
  .case-hero__grid { grid-template-columns: 1fr; gap: 24px; }
  .meta { grid-template-columns: 1fr 1fr; }
  .meta > div:nth-child(3) { border-left: 0; padding-left: 0; }
  .meta > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .case-body { grid-template-columns: 1fr; gap: 24px; padding-top: 64px; }
  .toc { position: static; }
  /* Schéma d'architecture : lisible en le faisant défiler */
  .case-visual { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .case-visual svg { min-width: 820px; }
  .figures, .results { grid-template-columns: 1fr; }
  .case-section { padding-bottom: 64px; }
}

@media (max-width: 560px) {
  .form__row { grid-template-columns: 1fr; }
  .skills { grid-template-columns: 1fr; }
  .timeline li.item { grid-template-columns: 1fr auto; gap: 4px 12px; }
  .timeline .when { grid-column: 1 / -1; }
  .about__facts { grid-template-columns: 1fr; }
  .form__foot .btn { width: 100%; justify-content: center; padding-block: 14px; }
  .section__head .label { display: none; }
  /* Compétences : icône et titre sur une ligne, liste en dessous */
  .skills { gap: 12px; }
  .skill { display: grid; grid-template-columns: 36px 1fr; column-gap: 14px; padding: 18px; }
  .skill__icon { margin-bottom: 0; }
  .skill h3 { align-self: center; margin: 0; }
  .skill ul { grid-column: 2; margin-top: 8px; }
}
