:root {
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  --bg: #f6f7f9;
  --surface: #fff;
  --line: #e3e6eb;
  --text: #161a22;
  --muted: #5d6675;
  --accent: #0d9488;
  --accent-soft: #0d948816;
  --red: #bd0606;
  --orange: #c2410c;
  --green: #15803d;
  --blue: #1d4ed8;
  --purple: #7e22ce;
  --yellow: #a16207;
  --cyan: #0e7490;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0d11;
    --surface: #12151b;
    --line: #222731;
    --text: #e8ebf0;
    --muted: #8d96a5;
    --accent: #2dd4bf;
    --accent-soft: #2dd4bf1a;
    --red: #f87171;
    --orange: #fb923c;
    --green: #4ade80;
    --blue: #60a5fa;
    --purple: #c084fc;
    --yellow: #facc15;
    --cyan: #22d3ee;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0d11;
  --surface: #12151b;
  --line: #222731;
  --text: #e8ebf0;
  --muted: #8d96a5;
  --accent: #2dd4bf;
  --accent-soft: #2dd4bf1a;
  --red: #f87171;
  --orange: #fb923c;
  --green: #4ade80;
  --blue: #60a5fa;
  --purple: #c084fc;
  --yellow: #facc15;
  --cyan: #22d3ee;
}

* {
  box-sizing: border-box;
}

html {
  scroll-padding-top: env(safe-area-inset-top, 0px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 var(--sans);
}

a {
  color: inherit;
  text-decoration: none;
}

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

header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.bar,
main {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.logo {
  font: 700 17px var(--mono);
  letter-spacing: -0.02em;
}
.logo b {
  color: var(--red);
}
nav {
  display: flex;
  gap: 6px;
  align-items: center;
}
nav a {
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  transition:
    color 0.15s,
    background 0.15s;
}
nav a:hover {
  color: var(--text);
  background: var(--accent-soft);
}
nav svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  display: block;
}

main {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 32px 24px 64px;

  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 20px;
}

main > * {
  min-width: 0;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 24px;
}
h2 {
  margin: 0 0 18px;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.01em;
}
.hero {
  grid-column: 1;
  padding: 32px 24px;
}
.hero h2 {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}
.hero h1 {
  margin: 6px 0 10px;
  font: 700 42px/1.1 var(--mono);
  letter-spacing: -0.04em;
}
.hero .role {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--red);
  font: 500 13.5px var(--mono);
}
.skills {
  grid-column: 1;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 10px;
}
.skill {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  transition: border-color 0.15s;
}
.skill:hover {
  border-color: var(--c);
}
.skill i {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font: 700 12px var(--mono);
  font-style: normal;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 14%, transparent);
}
.projects {
  grid-column: 2;
  grid-row: 1 / span 2;
}
.scroll {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}
th {
  padding: 0 12px 10px;
  text-align: left;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

/* pour tout le spremier td d'une ligne*/
.project-row td:first-child {
  cursor: pointer;
}

td {
  padding: 18px 12px;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
}
tr:last-child td {
  border-bottom: 0;
}
tbody tr {
  transition: background 0.15s;
}
tbody tr:hover {
  background: var(--accent-soft);
}

td.name {
  padding: 0;
  font: 600 14px var(--mono);
  width: 190px;
}

.name a {
  display: flex;
  width: 100%;
  height: 100%;
  padding: 12px 16px;

  color: inherit;
  text-decoration: none;
}

td.desc {
  color: var(--muted);
  font-size: 14px;
  max-width: 360px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 6px;
  font: 500 12px/1 var(--mono);
  color: var(--c);
  background: color-mix(in srgb, var(--c) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 8%, transparent);
}

.red {
  --c: var(--red);
}
.orange {
  --c: var(--orange);
}
.green {
  --c: var(--green);
}
.blue {
  --c: var(--blue);
}
.purple {
  --c: var(--purple);
}
.yellow {
  --c: var(--yellow);
}
.cyan {
  --c: var(--cyan);
}
.exp {
  grid-column: 1 / -1;
}

/* Timeline : horizontale sur grand écran, verticale sur petit écran.
   Dans les deux cas, chaque étape a sa ligne et son point au-dessus du texte. */
.timeline {
  display: grid;
  grid-auto-flow: column; /* une colonne par étape = horizontal */
  grid-auto-columns: minmax(260px, 1fr);
  gap: 0 28px;
  margin: 0;
  padding: 0 0 4px;
  list-style: none;
  overflow-x: auto; /* défilement s'il y a beaucoup d'étapes */
}
.timeline > li {
  position: relative;
  padding-top: 30px;
}
.timeline > li::before {
  /* le point */
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--accent);
}
.timeline > li::after {
  /* la ligne, au-dessus du texte */
  content: "";
  position: absolute;
  left: 0;
  right: -28px;
  top: 5px;
  height: 2px;
  background: var(--line);
}
.timeline > li:last-child::after {
  right: 0;
}

.when {
  font: 500 12px var(--mono);
  color: var(--red);
}
.timeline h3 {
  margin: 2px 0 0;
  font-size: 17px;
}
.timeline .sub {
  color: var(--muted);
  font-size: 14px;
}
.timeline ul {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 14px;
}

.project-separator {
  margin-top: 16px;
  font-weight: 700;
  margin-bottom: 0;
}
.project-separator:first-child {
  margin-top: 0;
}

/* Gestion lang */
.lang {
  margin-left: 6px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: 500 12px var(--mono);
  cursor: pointer;
  transition:
    color 0.15s,
    border-color 0.15s;
}
.lang:hover {
  color: var(--text);
  border-color: var(--red);
}

@media (max-width: 900px) {
  main {
    grid-template-columns: 1fr;
  }
  .hero,
  .skills,
  .projects,
  .exp {
    grid-column: 1;
    grid-row: auto;
  }
  nav a:not(.gh) {
    display: none;
  }
  .timeline {
    grid-auto-flow: row;
    grid-auto-columns: auto;
    gap: 28px 0;
    overflow-x: visible;
  }
  .timeline > li::after {
    right: 0;
  }
}

/* Tableau -> cartes empilées quand la colonne devient trop étroite */
@media (max-width: 1200px) {
  .scroll {
    overflow-x: visible;
  }
  table {
    min-width: 0;
  }
  table,
  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }
  thead {
    display: none;
  }
  tbody tr {
    padding: 16px 8px;
    border-bottom: 1px solid var(--line);
    border-radius: 8px;
  }
  tbody tr:last-child {
    border-bottom: 0;
  }
  td {
    padding: 6px 0;
    border: 0;
  }
  td.name {
    width: 100%;
    padding: 0 0 4px;
  }
  .name a {
    padding: 0;
  }
  td.desc {
    max-width: none;
  }
  /* petit libellé au-dessus des tags / outils */
  td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 6px;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
  }
}

/* Mobile */
@media (max-width: 600px) {
  .bar,
  main {
    padding-left: 16px;
    padding-right: 16px;
  }
  main {
    padding-top: 20px;
    gap: 14px;
  }
  .card {
    padding: 18px;
  }
  .hero {
    padding: 24px 18px;
  }
  .hero h1 {
    font-size: clamp(30px, 10vw, 42px);
  }
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  }
}
