@page {
  size: A4;
  margin: 1.5cm;
}

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

html,
body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, sans-serif;
  color: #222;
  background: #f4f4f4;
}

body {
  display: flex;
  justify-content: center;
}

main {
  width: 26.5cm;
  max-width: 26.5cm;
  min-height: 29.7cm;
  background: #fff;
  padding: 1.8cm 1.6cm;
  box-shadow: 0 0 6mm rgba(0, 0, 0, 0.08);
}

@media print {
  body {
    background: #fff;
  }
  main {
    box-shadow: none;
    padding: 1.5cm;
  }
}

header {
  margin-bottom: 2.2rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.header-text {
  flex: 1;
  min-width: 0;
}

.header-photo {
  width: 7.5rem;
  height: 7.5rem;
  object-fit: cover;
  border-radius: 25%;
  flex-shrink: 0;
}

.name {
  margin: 0;
  font-size: 1.9rem;
  letter-spacing: 0.04em;
}

.tagline {
  margin: 1rem 0 0;
  font-size: 1.1rem;
  color: #555;
  max-width: 18cm;
}

.experiences {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
  color: #555;
  font-style: oblique;
}

.experiences a {
  color: #0a66c2;
  text-decoration: none;
}

.experiences a:hover {
  text-decoration: underline;
}

.intro {
  margin: 0.4rem 0 0.9rem;
  font-size: 0.9rem;
  color: #555;
  line-height: 1.25;
}

.intro--callout {
  background: #f3f6fb;
  border-left: 4px solid #4b7fd8;
  padding: 0.75rem 1rem;
  border-radius: 6px;
}

.intro--callout p {
  margin: 0;
  max-width: 24cm;
  line-height: 1.6;
  font-size: 1rem;
  text-align: justify;
  white-space: pre-line;
}

.intro ul {
  margin: 0;
  padding-left: 2rem;
}

.intro li {
  margin: 0.6rem 0;
  line-height: 1.5;
}

.category {
  margin: 2rem 0 0;
  font-size: 1.5rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #333;
}

.category-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.legend {
  margin: 0;
  font-size: 0.7rem;
  color: #777;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: flex-end;
  align-self: flex-end;
}

.legend-sort {
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 0.25rem;
  border-radius: 999px;
  background: #f5f5f5;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.08);
  position: relative;
}

.legend-toggle {
  border: none;
  background: transparent;
  padding: 0.4rem 1.1rem;
  border-radius: 999px;
  font-size: 0.75rem;
  cursor: pointer;
  color: #555;
  z-index: 1;
  transition: color 160ms ease, background-color 160ms ease;
  flex: 1 1 0;
  text-align: center;
}

.legend-toggle--active {
  color: #fff;
  font-weight: 600;
  background: #4b7fd8;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.02);
}

.legend-toggle:focus-visible {
  outline: 2px solid #4b7fd8;
  outline-offset: 2px;
}

.legend-domains {
  margin-top: 1.2rem;
  justify-content: flex-start;
  gap: 0.6rem;
  font-size: 0.7rem;
}

.legend-domain-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.legend-domain-color {
  width: 0.9rem;
  height: 0.4rem;
  border-radius: 999px;
}

.legend-domain-color-logiciel {
  background: rgba(59, 130, 246, 0.5);
}
.legend-domain-color-devops {
  background: rgba(34, 197, 94, 0.5);
}
.legend-domain-color-equipe {
  background: rgba(139, 92, 246, 0.5);
}
.legend-domain-color-client {
  background: rgba(249, 115, 22, 0.5);
}
.legend-domain-color-commercial {
  background: rgba(6, 182, 212, 0.5);
}
.legend-domain-color-projet {
  background: rgba(251, 191, 36, 0.5);
}
.legend-domain-color-ia {
  background: rgba(236, 72, 153, 0.5);
}

.domains {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  position: relative;
  z-index: 10;
}

.skill-value-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.15rem;
}

.skill-group-label {
  flex-basis: 100%;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #444;
  opacity: 0.85;
  margin-top: 0.25rem;
  margin-bottom: 0.1rem;
  animation: skillGroupFade 220ms ease-out;
  animation-fill-mode: both;
}

@keyframes skillGroupFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 0.85;
  }
}

.skill {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.45rem;
  border-radius: 4px;
  position: relative;
  will-change: transform, background-color;
  transition: background-color 150ms ease,
    transform 260ms cubic-bezier(0.22, 0.61, 0.36, 1);
  break-inside: avoid;
  cursor: pointer;
}

.skill.skill-domain-logiciel {
  background: rgba(59, 130, 246, 0.2);
}
.skill.skill-domain-devops {
  background: rgba(34, 197, 94, 0.2);
}
.skill.skill-domain-equipe {
  background: rgba(139, 92, 246, 0.2);
}
.skill.skill-domain-client {
  background: rgba(249, 115, 22, 0.2);
}
.skill.skill-domain-commercial {
  background: rgba(6, 182, 212, 0.2);
}
.skill.skill-domain-projet {
  background: rgba(251, 191, 36, 0.2);
}
.skill.skill-domain-ia {
  background: rgba(236, 72, 153, 0.2);
}

.skill.skill-domain-logiciel:hover {
  background: rgba(59, 130, 246, 0.45);
}
.skill.skill-domain-devops:hover {
  background: rgba(34, 197, 94, 0.45);
}
.skill.skill-domain-equipe:hover {
  background: rgba(139, 92, 246, 0.45);
}
.skill.skill-domain-client:hover {
  background: rgba(249, 115, 22, 0.45);
}
.skill.skill-domain-commercial:hover {
  background: rgba(6, 182, 212, 0.45);
}
.skill.skill-domain-projet:hover {
  background: rgba(251, 191, 36, 0.45);
}
.skill.skill-domain-ia:hover {
  background: rgba(236, 72, 153, 0.45);
}

.skill-name {
  font-weight: 400;
  font-size: 0.9rem;
}

.skill-info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.2em;
  height: 1.2em;
  font-size: 0.92rem;
  color: #444;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 50%;
  flex-shrink: 0;
}

.skill:hover .skill-info-icon {
  color: #fff;
  background: transparent;
  border-color: rgba(0, 0, 0, 0);
}

.skill:focus .skill-info-icon {
  color: #fff;
  background: transparent;
  border-color: rgba(0, 0, 0, 0);
}

.skill-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 0.5rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  white-space: normal;
  z-index: 9999;
  margin-bottom: 0.3rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
  line-height: 1.5;
  text-align: left;
  width: max-content;
  max-width: 250px;
  display: none;
}

.skill:hover .skill-tooltip {
  display: block;
}

.skill:focus-visible {
  outline: 2px solid #4b7fd8;
  outline-offset: 2px;
}

.skill:focus .skill-tooltip {
  display: block;
}

.skill-tooltip ul {
  margin: 0;
  padding-left: 1.2rem;
  list-style: disc;
}

.skill-tooltip li {
  margin: 0.3rem 0;
}

.skill-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top-color: #333;
  margin-top: -0.8rem;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.1));
}

@media (max-width: 768px) {
  html,
  body {
    width: 100%;
    min-height: 100%;
    margin: 0;
    padding: 0;
    background: #fff;
  }

  body {
    display: block;
  }

  main {
    width: 100%;
    max-width: none;
    min-height: auto;
    padding: 1.2rem 0.6rem 1.6rem;
    box-shadow: none;
  }

  header {
    flex-direction: row;
    align-items: flex-start;
    gap: 0.9rem;
  }

  .header-photo {
    width: 7.2rem;
    height: 7.2rem;
    margin-top: -0.3rem;
  }

  .tagline {
    max-width: 100%;
  }

  .legend {
    justify-content: flex-start;
    width: 100%;
    align-self: flex-start;
  }

  .category-container {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0.35rem;
  }

  .legend-domains {
    flex-direction: column;
    align-items: flex-start;
  }
}

