:root {
  --ink: #251b2d;
  --muted: #665e73;
  --accent: #7c3fa0;
  --accent-2: #b8397a;
  --pale: #f0e5f6;
  --line: #dbcce5;
  --white: #fffcff;
  --topbar-height: 59px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

section[id] {
  scroll-margin-top: var(--topbar-height);
}

body {
  margin: 0;
  color: var(--ink);
  background: #f9f4fb;
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  line-height: 1.55;
}

a {
  color: inherit;
}

.skip-link,
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  z-index: 10;
  top: 10px;
  left: 10px;
  width: auto;
  height: auto;
  padding: 10px 14px;
  clip: auto;
  border-radius: 8px;
  color: var(--ink);
  background: var(--white);
}

.shell {
  width: min(1120px, calc(100% - 40px));
  margin: auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  border-bottom: 1px solid rgba(199, 175, 227, 0.24);
  background: rgba(23, 10, 43, 0.96);
  color: #fff;
  backdrop-filter: blur(12px);
}

.topbar .shell {
  min-height: calc(var(--topbar-height) - 1px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  font-weight: 750;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.desktop-nav {
  display: flex;
  gap: 20px;
  font-size: 0.87rem;
}

.desktop-nav a {
  color: #eadff3;
  text-decoration: none;
}

.desktop-nav a:hover {
  color: #fff;
}

.mobile-menu {
  position: relative;
  display: none;
}

.mobile-menu summary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #eadff3;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 700;
  list-style: none;
}

.mobile-menu summary::-webkit-details-marker {
  display: none;
}

.mobile-menu summary::after {
  width: 7px;
  height: 7px;
  border-right: 1.75px solid currentColor;
  border-bottom: 1.75px solid currentColor;
  content: "";
  transform: translateY(-2px) rotate(45deg);
  transition: transform 180ms ease;
}

.mobile-menu[open] summary::after {
  transform: translateY(2px) rotate(225deg);
}

.mobile-menu summary:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 5px;
  border-radius: 2px;
}

.mobile-menu nav {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: max-content;
  min-width: 180px;
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: #24113d;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
}

.mobile-menu nav a {
  padding: 8px 10px;
  border-radius: 6px;
  color: #eadff3;
  text-decoration: none;
}

.mobile-menu nav a:hover,
.mobile-menu nav a:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.hero {
  margin: 0;
  background:
    radial-gradient(circle at 78% 106%, rgba(217, 79, 157, 0.56) 0%, transparent 37%), radial-gradient(circle at 48% 118%, rgba(199, 175, 227, 0.42) 0%, transparent 34%),
    radial-gradient(circle at 16% 112%, rgba(106, 43, 201, 0.4) 0%, transparent 34%), linear-gradient(128deg, #120322 0%, #410b75 52%, #791847 100%);
  color: #fff;
  padding: 72px 0 62px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 44px;
}

.hero-identity {
  min-height: 146px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-name {
  max-width: none;
  margin: 0 0 5px;
  font-size: clamp(2.1rem, 3.2vw, 2.8rem);
  line-height: 1;
  letter-spacing: -0.045em;
}

.eyebrow {
  margin: 0 0 8px;
  color: #e3cef5;
  font-size: 1rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tagline {
  max-width: 800px;
  margin: 0;
  font-size: clamp(1.25rem, 1.7vw, 1.4rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.contact-card {
  width: 400px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 15px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.88rem;
}

.contact-card > div {
  min-width: 0;
}

.contact-card strong {
  display: block;
  margin-bottom: 5px;
}

.contact-card a {
  display: block;
  color: #fff;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.contact-card img {
  align-self: center;
  width: 96px;
  height: 122px;
  object-fit: cover;
  object-position: center;
  border-radius: 10px;
}

main {
  padding: 42px 0 48px;
}

section {
  margin: 0 0 68px;
}

.intro {
  max-width: 920px;
  margin-right: auto;
  margin-bottom: 42px;
  margin-left: auto;
}

main > section:last-child {
  margin-bottom: 0;
}

.section-kicker {
  margin: 0 0 11px;
  color: var(--accent);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.intro p {
  margin: 0;
  font-size: clamp(1rem, 1.7vw, 1.17rem);
  hyphens: auto;
  line-height: 1.62;
  letter-spacing: -0.012em;
  text-wrap: pretty;
}

h2 {
  margin: 0 0 25px;
  font-size: 1.65rem;
  letter-spacing: -0.035em;
}

.skills {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.skill {
  padding: 24px;
  border-right: 1px solid var(--line);
}

.skill:last-child {
  border-right: 0;
}

h3 {
  margin: 0 0 12px;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.93rem;
}

li + li {
  margin-top: 6px;
}

.timeline {
  display: grid;
  gap: 20px;
}

.experience {
  display: grid;
  grid-template-columns: 190px 1fr;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}

.company {
  padding: 28px 24px;
  background: var(--pale);
}

.company-logo {
  display: block;
  width: 132px;
  height: 38px;
  margin: 0 0 14px;
  object-fit: contain;
  object-position: left center;
}

.company-logo--solutec {
  height: 44px;
}

.company h3 {
  margin: 0;
  display: block;
  font-size: 1.16rem;
}

.company span {
  display: block;
  margin-top: 4px;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
}

.company small {
  display: block;
  margin-top: 32px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.missions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 28px;
}

.mission {
  padding: 25px 0;
}

.mission + .mission {
  border-top: 1px solid var(--line);
}

.mission-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: flex-start;
  gap: 18px;
}

.mission-chevron:focus-visible {
  outline: 3px solid rgba(124, 63, 160, 0.3);
  outline-offset: 3px;
}

.mission.is-open .mission-head {
  margin-bottom: 14px;
}

.mission-identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 14px;
}

.client-logo {
  flex: 0 0 auto;
  width: 84px;
  height: 44px;
  object-fit: contain;
  object-position: center;
}

.mission-location {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.86rem;
}

.mission h4 {
  margin: 0;
  font-size: 1.08rem;
}

.mission-duration {
  color: var(--accent-2);
  font-size: 0.83rem;
  font-weight: 750;
}

.mission-meta {
  display: flex;
  min-width: 92px;
  flex-direction: column;
  align-items: flex-end;
  gap: 9px;
  text-align: right;
}

.mission-chevron {
  padding: 0;
  width: 34px;
  height: 30px;
  display: none;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--accent);
  background: var(--white);
  cursor: pointer;
  font: inherit;
  transition:
    border-color 160ms ease,
    background 160ms ease;
}

.mission.is-collapsible .mission-chevron {
  display: grid;
}

.mission-chevron::before {
  width: 8px;
  height: 8px;
  content: "";
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 180ms ease;
}

.mission-chevron:hover {
  border-color: #b78bca;
  background: var(--pale);
}

.mission.is-open .mission-chevron::before {
  transform: translateY(2px) rotate(225deg);
}

.blocks {
  display: grid;
  gap: 12px;
}

.mission.is-collapsible:not(.is-open) .blocks {
  display: none;
}

.block {
  padding: 14px 16px;
  border-left: 3px solid var(--accent);
  background: #fcfafd;
}

.block h5 {
  margin: 0 0 7px;
  color: var(--accent);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.block p {
  margin: 0;
  color: var(--muted);
  font-size: 0.91rem;
}

.block strong {
  color: var(--accent);
  font-weight: 700;
}

.training {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(3, auto);
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 42px;
}

.course {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.course:nth-child(3),
.course:last-child {
  border-bottom: 0;
}

.course time,
.course .course-period {
  color: var(--accent-2);
  font-size: 1rem;
  font-weight: 800;
}

.course b {
  display: block;
  font-size: 0.93rem;
}

.course span {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
}

.footer {
  padding: 38px 0;
  background: #170a2b;
  color: #eadff3;
}

.footer .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  font-size: 0.9rem;
}

.print-cv-link {
  display: none;
}

.pdf {
  display: inline-block;
  padding: 10px 15px;
  border: 1px solid #d3b5eb;
  border-radius: 9px;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
}

.pdf:hover {
  background: rgba(217, 79, 157, 0.14);
}

@media (max-width: 920px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero-name {
    font-size: clamp(2.1rem, 6vw, 2.8rem);
  }

  .contact-card {
    width: 100%;
  }
}

@media (max-width: 850px) {
  .skills {
    grid-template-columns: repeat(2, 1fr);
  }

  .skill:nth-child(2) {
    border-right: 0;
  }

  .skill:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 650px) {
  .shell {
    width: min(100% - 30px, 1120px);
  }

  .desktop-nav {
    display: none;
  }

  .mobile-menu {
    display: block;
  }

  .brand {
    font-size: 0.86rem;
    white-space: nowrap;
  }

  .hero {
    padding: 55px 0 45px;
  }

  .hero-identity {
    min-height: 0;
  }

  .hero-grid,
  .experience {
    grid-template-columns: 1fr;
  }

  .company {
    display: grid;
    grid-template-columns: minmax(105px, 132px) minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 24px;
    row-gap: 8px;
    padding: 20px;
  }

  .company-logo {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    margin: 0;
  }

  .company h3 {
    grid-column: 1;
    grid-row: 2;
  }

  .company span {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    margin-top: 0;
    text-align: right;
  }

  .company small {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
    margin-top: 0;
    text-align: right;
  }

  .missions {
    padding: 0 20px;
  }

  .footer .shell {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .mission-head {
    gap: 10px;
  }

  .mission-identity {
    align-items: flex-start;
  }

  .client-logo {
    width: 68px;
    height: 38px;
  }

  .mission-meta {
    min-width: 74px;
  }

  .skills,
  .training {
    grid-auto-flow: row;
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }

  .course:nth-child(3) {
    border-bottom: 1px solid var(--line);
  }

  .course:last-child {
    border-bottom: 0;
  }

  .skill {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .skill:last-child {
    border-bottom: 0;
  }

  .skill:nth-child(2) {
    border-bottom: 1px solid var(--line);
  }

  #interets .skills {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #interets .skill:nth-child(odd) {
    border-right: 1px solid var(--line);
  }

  #interets .skill:nth-child(even) {
    border-right: 0;
  }

  #interets .skill:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  #interets .skill:nth-child(n + 3) {
    border-bottom: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .mission-chevron,
  .mission-chevron::before {
    transition: none;
  }
}

@media print {
  @page {
    size: A4;
    margin: 10mm;
  }

  html {
    scroll-behavior: auto;
  }

  body {
    background: #fff;
    font-size: 9px;
    line-height: 1.32;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .topbar,
  .mission-chevron,
  .pdf {
    display: none !important;
  }

  .shell {
    width: 100%;
  }

  .hero {
    padding: 10mm;
    background: linear-gradient(118deg, #512064 0%, #7f3c8b 58%, #9c4b72 100%);
    break-inside: avoid;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1fr) 69mm;
    gap: 8mm;
  }

  .eyebrow {
    margin-bottom: 3px;
    font-size: 7.5pt;
  }

  .hero-identity {
    min-height: 50px;
  }

  .hero-name {
    margin-bottom: 2px;
    font-size: 22pt;
    line-height: 1;
  }

  .tagline {
    font-size: 11pt;
    line-height: 1.16;
  }

  .contact-card {
    width: 69mm;
    grid-template-columns: minmax(0, 1fr) 15mm;
    gap: 3mm;
    padding: 3.5mm;
    border-radius: 7px;
    font-size: 7.2pt;
    line-height: 1.38;
  }

  .contact-card img {
    width: 15mm;
    height: 20mm;
    border-radius: 5px;
  }

  main {
    padding: 5mm 0 0;
  }

  section {
    margin-bottom: 4mm;
  }

  .intro {
    margin-bottom: 4mm;
  }

  .intro p {
    font-size: 8.5pt;
    line-height: 1.36;
  }

  h2 {
    margin-bottom: 2.5mm;
    font-size: 14pt;
    break-after: avoid;
  }

  .section-kicker {
    margin-bottom: 1.5mm;
    font-size: 7.5pt;
  }

  ul {
    padding-left: 3.8mm;
    font-size: 7.6pt;
  }

  li + li {
    margin-top: 1px;
  }

  #competences .skills,
  #interets .skills {
    break-inside: avoid;
  }

  .skill {
    padding: 3.5mm;
  }

  .skill h3 {
    margin-bottom: 1.6mm;
    font-size: 8.5pt;
  }

  .experience {
    display: grid;
    grid-template-columns: 31mm minmax(0, 1fr);
    border-color: var(--line);
    border-width: 2px;
    width: calc(100% - 2mm);
    margin-right: auto;
    margin-left: auto;
    border-radius: 7px;
    overflow: hidden;
    break-inside: avoid;
  }

  .skills {
    border-width: 2px;
    width: calc(100% - 2mm);
    margin-right: auto;
    margin-left: auto;
  }

  .company {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 1.5mm;
    padding: 4mm;
  }

  .company-logo,
  .company-logo--solutec {
    width: 22mm;
    height: 9mm;
    margin: 0 0 1mm;
  }

  .company h3 {
    font-size: 9pt;
  }

  .company span {
    margin: 0;
    font-size: 7.5pt;
    text-align: left;
  }

  .company small {
    margin: 0;
    font-size: 7pt;
    line-height: 1.26;
  }

  .missions {
    display: block;
    padding: 0 4mm;
  }

  .mission {
    padding: 3mm 0;
  }

  .mission-head {
    break-after: avoid;
    gap: 3mm;
  }

  .mission h4 {
    font-size: 8.5pt;
  }

  .mission-location {
    margin-top: 0.5mm;
    font-size: 7.1pt;
  }

  .client-logo {
    width: 17mm;
    height: 8mm;
  }

  .blocks {
    gap: 0;
    border-left: 2px solid var(--accent);
    background: #faf7fc;
  }

  .block {
    padding: 2mm 2.5mm;
    border-left: 0;
    background: transparent;
  }

  .block h5 {
    display: none;
  }

  .block p {
    font-size: 7.4pt;
    line-height: 1.28;
  }

  .block:first-child ul {
    padding-left: 0;
    color: var(--accent);
    font-size: 7.4pt;
    font-weight: 650;
    list-style: none;
  }

  /* Le PDF affiche uniquement les puces sélectionnées explicitement dans le HTML. */
  .block li:not([data-print="selected"]) {
    display: none;
  }

  .mission.is-collapsible:not(.is-open) .blocks {
    display: grid;
  }

  .mission-head,
  .block,
  .course,
  .skill {
    break-inside: avoid;
  }

  .course {
    padding: 1.5mm 0;
    gap: 3mm;
  }

  .course time,
  .course .course-period {
    font-size: 7.5pt;
  }

  .course b,
  .course span {
    font-size: 7.2pt;
    line-height: 1.2;
  }

  .footer {
    display: block;
    margin-top: 4mm;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
  }

  .footer .shell {
    display: block;
    font-size: 7pt;
    text-align: center;
  }

  .footer .shell > span {
    display: none;
  }

  .print-cv-link {
    display: inline;
    color: var(--accent);
    font-weight: 750;
    text-decoration: none;
  }

  #interets {
    margin-bottom: 3mm;
  }

  #interets h2 {
    margin-bottom: 2mm;
    font-size: 11pt;
  }

  #interets .skills {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  #interets .skill {
    padding: 1.5mm 3.5mm;
    border-right: 2px solid var(--line);
    border-bottom: 0;
  }

  #interets .skill:last-child {
    border-right: 0;
  }

  #interets .skill h3 {
    margin-bottom: 1mm;
    font-size: 7.8pt;
  }

  #interets ul {
    font-size: 6.9pt;
  }
}
