/*
  Plan de design
  Couleurs : blanc, noir, gris, et un seul bleu foncé #0F1D45 comme couleur d’accent (en mode sombre, les traits d’accent passent au blanc). Logos et captures en couleur.
  Typo : une seule famille, Schibsted Grotesk. Le nom en très gras et très grand, le reste discret.
  Mise en page : grille suisse, étiquettes de section à gauche, contenu à droite, aligné à gauche.
  Principe : un seul élément fort (le nom), tout le reste calme. Mouvement seulement en réponse à une action.
*/
:root {
  --bg: #ffffff;
  --surface: #f2f2f2;
  --fg: #24262b;
  --navy: #0f1d45;
  --accent: var(--navy);
  --accent-soft: var(--navy);
  --on-accent: #ffffff;
  --muted: #5c5f66;
  --line: #d6d6d6;
  --font: "Schibsted Grotesk", "Helvetica Neue", Helvetica, sans-serif;

  /* Échelle typographique, rapport 1,25 */
  --fs-sm: 0.8125rem;
  --fs-base: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: clamp(1.375rem, 1.1rem + 1vw, 1.75rem);
  --fs-display: clamp(1.75rem, 1.2rem + 2.2vw, 2.5rem);

  /* Espacements, base 8 px */
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s6: 48px; --s8: 64px; --s12: 96px;

  --radius-sm: 6px;   /* boutons, images */
  --radius-lg: 14px;  /* tuiles d'icônes */
  --ease: cubic-bezier(0.2, 0, 0, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #1e2024; --surface: #2a2d33; --fg: #eceef1; --muted: #aeb2ba; --line: #3a3d44; --accent: #ffffff; color-scheme: dark; }
}
:root[data-theme="dark"] { --bg: #1e2024; --surface: #2a2d33; --fg: #eceef1; --muted: #aeb2ba; --line: #3a3d44; --accent: #ffffff; color-scheme: dark; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--font); font-size: var(--fs-base); line-height: 1.55;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  font-kerning: normal;
}
::selection { background: var(--fg); color: var(--bg); }
h1, h2, h3 { margin: 0; line-height: 1.15; font-weight: 700; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
img { max-width: 100%; }
[id] { scroll-margin-top: var(--s4); }

a { color: var(--fg); text-decoration-color: var(--accent); text-decoration-line: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; transition: text-decoration-thickness 150ms var(--ease); }
a:hover { text-decoration-thickness: 3px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.skip { position: absolute; left: var(--s2); top: -100px; z-index: 10; background: var(--fg); color: var(--bg); padding: 12px 16px; border-radius: var(--radius-sm); text-decoration: none; font-weight: 600; }
.skip:focus { top: var(--s2); }

.wrap {
  max-width: 1120px; margin: 0 auto;
  padding-left: max(var(--s2), env(safe-area-inset-left, 0px));
  padding-right: max(var(--s2), env(safe-area-inset-right, 0px));
}
@media (min-width: 720px) { .wrap { padding-left: max(var(--s4), env(safe-area-inset-left, 0px)); padding-right: max(var(--s4), env(safe-area-inset-right, 0px)); } }

/* En-tête */
header .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--s1) var(--s3); padding-block: var(--s2); }
.name { font-weight: 700; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
nav { display: flex; flex-wrap: wrap; align-items: center; margin-right: -10px; }
nav a { color: var(--fg); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; padding-inline: 10px; font-weight: 500; }
nav a:hover { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 0.35em; }
nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 0.35em; }
nav a.home { min-width: 44px; justify-content: center; }
nav a.home svg { width: 20px; height: 20px; }
nav a.home[aria-current="page"] { text-decoration: none; }
nav a.home[aria-current="page"] svg { fill: var(--accent); color: var(--accent); }
@media (max-width: 420px) { nav a { padding-inline: 7px; } nav a.home { min-width: 36px; } nav { margin-right: -7px; } }

/* Sections : étiquette à gauche, contenu à droite */
section, .split { padding-block: var(--s6); }
.split { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--s3); row-gap: var(--s2); border-top: 1px solid var(--line); }
.split > h2 { grid-column: 1 / span 3; font-size: var(--fs-lg); }
.split > :not(h2) { grid-column: 4 / -1; }
@media (max-width: 760px) { .split > h2, .split > :not(h2) { grid-column: 1 / -1; } }
.prose { display: grid; gap: var(--s2); max-width: 62ch; }

/* Accueil */
.hero { padding-block: var(--s8); align-items: center; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--s3); row-gap: var(--s4); }
.hero h1 { font-size: var(--fs-display); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.hero-text { grid-column: 1 / span 6; display: grid; gap: var(--s2); align-content: start; }
.lead { color: var(--muted); max-width: 46ch; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: var(--s1); }
.btn {
  display: inline-flex; align-items: center; min-height: 48px; padding: 0 22px;
  border: 2px solid var(--fg); border-radius: var(--radius-sm);
  font-weight: 600; text-decoration: none; color: var(--fg); background: transparent;
  transition: background-color 150ms var(--ease), color 150ms var(--ease), transform 100ms var(--ease);
}
.btn.solid { background: var(--navy); border-color: var(--navy); color: #ffffff; }
.btn:hover { background: var(--fg); color: var(--bg); }
.btn.solid:hover { background: var(--bg); color: var(--fg); border-color: var(--fg); }
.btn:active { transform: scale(0.98); }
.hero-shots { grid-column: 7 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-self: start; }
.hero-shots img {
  width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; display: block;
  border-radius: var(--radius-sm); background: var(--surface);
}
.hero-shots img { grid-column: 1 / -1; }
@media (max-width: 860px) {
  .hero-text, .hero-shots { grid-column: 1 / -1; }
}

/* Infos du stage */
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s3); margin: 0; padding: var(--s3); background: var(--navy); color: #ffffff; border-radius: var(--radius-sm); }
.facts dt { color: #c3c9db; font-size: var(--fs-sm); }
.facts dd { margin: 2px 0 0; font-weight: 600; }
@media (max-width: 860px) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.facts + .split { border-top: 0; }

/* Courriel */
.mail { display: flex; flex-wrap: wrap; align-items: center; gap: 12px var(--s2); }
.mail span { font-size: var(--fs-lg); font-weight: 600; letter-spacing: -0.01em; user-select: all; overflow-wrap: anywhere; }
.mail button {
  font: 600 var(--fs-sm) var(--font); min-height: 44px; padding: 0 16px; cursor: pointer;
  background: var(--bg); color: var(--fg); border: 2px solid var(--fg); border-radius: var(--radius-sm);
  transition: background-color 150ms var(--ease), color 150ms var(--ease), transform 100ms var(--ease);
}
.mail button:hover { background: var(--fg); color: var(--bg); }
.mail button:active { transform: scale(0.98); }

/* Pages internes */
.page-head { padding-block: var(--s6) var(--s4); display: grid; gap: var(--s2); }
.page-head h1 { font-size: var(--fs-display); letter-spacing: -0.02em; line-height: 1.1; }
.page-head p { color: var(--muted); max-width: 55ch; }
.page { border-top: 1px solid var(--line); padding-block: var(--s6) var(--s12); }

/* Compétences */
.skills { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3) var(--s4); }
.skills b { display: block; font-weight: 600; }
.skills span { color: var(--muted); }
@media (max-width: 560px) { .skills { grid-template-columns: 1fr; } }
.tools { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 10px; }
.tools li {
  display: flex; align-items: center; gap: 12px; min-width: 0; min-height: 52px; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-weight: 500; line-height: 1.25;
  transition: border-color 150ms var(--ease);
}
.tools svg { flex: none; width: 24px; height: 24px; color: var(--brand, var(--fg)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tools svg { color: color-mix(in oklab, var(--brand, var(--fg)) 65%, white); } }
:root[data-theme="dark"] .tools svg { color: color-mix(in oklab, var(--brand, var(--fg)) 65%, white); }

@media (max-width: 420px) { .tools { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tools li { padding: 10px; gap: 10px; font-size: var(--fs-sm); } }

/* Projets */
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--s6) var(--s4); align-items: start; }
.project { display: grid; gap: 12px; min-width: 0; }
img.img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; display: block; border-radius: var(--radius-sm); background: var(--surface); margin-bottom: var(--s1); }
.project .when { color: var(--accent); font-weight: 600; font-size: var(--fs-sm); }
.project h2 { font-size: var(--fs-lg); letter-spacing: -0.01em; margin-top: -6px; }
.project p { color: var(--muted); }
.project .tech { color: var(--fg); font-weight: 600; font-size: var(--fs-sm); }

footer { border-top: 1px solid var(--line); padding-block: var(--s4); color: var(--muted); font-size: var(--fs-sm); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* Page Compétences : simple et compacte */
.block { border-top: 1px solid var(--line); padding-block: var(--s4); }
.block > h2 { font-size: var(--fs-lg); margin-bottom: var(--s2); }
.block .skills { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s2) var(--s4); }
@media (max-width: 860px) { .block .skills { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .block .skills { grid-template-columns: 1fr; } }
.block .tools { display: flex; flex-wrap: wrap; gap: 8px; }
.block .tools li { min-height: 44px; padding: 8px 14px; gap: 10px; border: 0; background: var(--surface); font-size: var(--fs-base); font-weight: 500; }
.block .tools svg { width: 22px; height: 22px; }
