/* =========================================================
   Thème
   ========================================================= */
:root {
  --bg: #f1f3f2;
  --surface: #ffffff;
  --ink: #18212b;
  --muted: #5a6573;
  --line: #d5dad8;
  --accent: #2346c8;
  --accent-soft: #e3e8fb;
  --ok: #1f9d6b;

  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;

  --header-h: 4rem;
  --time-col: 9rem;
  --col-gap: 2.5rem;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11161d;
    --surface: #18202a;
    --ink: #e7ecf1;
    --muted: #9aa6b4;
    --line: #2a3542;
    --accent: #8ba3ff;
    --accent-soft: #1f2a48;
    --ok: #3cc58e;
    color-scheme: dark;
  }
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cat-auto  { --tool-accent: #6f9cf5; }
  :root:not([data-theme="light"]) .cat-sys   { --tool-accent: #a995ff; }
  :root:not([data-theme="light"]) .cat-cloud { --tool-accent: #4fc9d3; }
  :root:not([data-theme="light"]) .cat-sup   { --tool-accent: #f0a066; }
  :root:not([data-theme="light"]) .cat-parc  { --tool-accent: #62cf8c; }
  :root:not([data-theme="light"]) .cat-proj  { --tool-accent: #ef8cb8; }
}
:root[data-theme="dark"] .cat-auto  { --tool-accent: #6f9cf5; }
:root[data-theme="dark"] .cat-sys   { --tool-accent: #a995ff; }
:root[data-theme="dark"] .cat-cloud { --tool-accent: #4fc9d3; }
:root[data-theme="dark"] .cat-sup   { --tool-accent: #f0a066; }
:root[data-theme="dark"] .cat-parc  { --tool-accent: #62cf8c; }
:root[data-theme="dark"] .cat-proj  { --tool-accent: #ef8cb8; }

:root[data-theme="dark"] {
  --bg: #11161d;
  --surface: #18202a;
  --ink: #e7ecf1;
  --muted: #9aa6b4;
  --line: #2a3542;
  --accent: #8ba3ff;
  --accent-soft: #1f2a48;
  --ok: #3cc58e;
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

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

.wrap {
  width: min(68rem, 100% - 2.5rem);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 100;
  padding: .5rem 1rem;
  background: var(--ink);
  color: var(--bg);
  border-radius: .5rem;
  text-decoration: none;
}
.skip-link:focus { top: 1rem; }

/* =========================================================
   En-tête
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: var(--header-h);
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -.01em;
  text-decoration: none;
  white-space: nowrap;
}

.nav {
  display: flex;
  align-items: center;
  gap: .25rem;
}

.nav a {
  padding: .4rem .7rem;
  border-radius: .5rem;
  color: var(--muted);
  font-size: .95rem;
  text-decoration: none;
  white-space: nowrap;
  transition: color .15s, background-color .15s;
}
.nav a:hover { color: var(--ink); }
.nav a[aria-current="true"] {
  color: var(--ink);
  background: var(--accent-soft);
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-left: .35rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: border-color .15s;
}
.theme-toggle:hover { border-color: var(--ink); }

/* =========================================================
   Présentation
   ========================================================= */
.hero {
  padding: clamp(4rem, 12vw, 8rem) 0 clamp(3.5rem, 9vw, 6rem);
}

.hero-name {
  margin: 0 0 1.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3.25rem, 11vw, 7rem);
  line-height: .9;
  letter-spacing: -.04em;
}

.hero-role {
  max-width: 34ch;
  margin: 0 0 1.75rem;
  color: var(--muted);
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  line-height: 1.4;
}

.hero-text {
  max-width: 60ch;
  margin: 0 0 1.75rem;
}

.hero-status {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin: 0 0 2.25rem;
  color: var(--muted);
  font-size: .95rem;
}

.status-dot {
  flex: none;
  width: .55rem;
  height: .55rem;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 22%, transparent);
  animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 22%, transparent);
  }
  50% {
    transform: scale(1.35);
    box-shadow: 0 0 0 7px color-mix(in srgb, var(--ok) 10%, transparent);
  }
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}

/* Apparition unique au chargement */
.hero .wrap > * {
  animation: rise .7s cubic-bezier(.2, .7, .2, 1) both;
}
.hero .wrap > :nth-child(2) { animation-delay: .08s; }
.hero .wrap > :nth-child(3) { animation-delay: .16s; }
.hero .wrap > :nth-child(4) { animation-delay: .24s; }
.hero .wrap > :nth-child(5) { animation-delay: .32s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* =========================================================
   Boutons
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.875rem;
  padding: 0 1.25rem;
  border: 1px solid transparent;
  border-radius: .6rem;
  font-size: .975rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color .15s, border-color .15s, color .15s;
}

.btn-primary {
  background: var(--ink);
  color: var(--bg);
}
.btn-primary:hover {
  background: var(--accent);
  color: #fff;
}

.btn-ghost {
  border-color: var(--line);
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--ink); }

/* =========================================================
   Sections
   ========================================================= */
.section {
  padding: clamp(4rem, 9vw, 6.5rem) 0;
  border-top: 1px solid var(--line);
}

.section-head {
  max-width: 60ch;
  margin-bottom: 2.5rem;
}

.section-head h2,
.legal h1 {
  margin: 0 0 .75rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.1rem, 4.6vw, 3.1rem);
  line-height: 1.05;
  letter-spacing: -.03em;
}

.section-intro {
  margin: 0;
  color: var(--muted);
}

/* =========================================================
   Parcours : deux colonnes en parallèle
   ========================================================= */
.track-head {
  position: sticky;
  top: var(--header-h);
  z-index: 5;
  display: grid;
  grid-template-columns: var(--time-col) 1fr 1fr;
  gap: 0 var(--col-gap);
  padding: .9rem 0;
  border-bottom: 1px solid var(--ink);
  background: var(--bg);
  color: var(--muted);
  font-size: .875rem;
  line-height: 1.35;
}
.track-head strong {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -.01em;
}

.tracks-body { position: relative; }

/* Ligne verticale de la frise */
.tracks-body::before {
  content: "";
  position: absolute;
  left: .3rem;
  top: 3rem;
  bottom: 0;
  width: 1px;
  background: var(--line);
}

.period {
  display: grid;
  grid-template-columns: var(--time-col) 1fr 1fr;
  gap: 1.75rem var(--col-gap);
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--line);
}

.period-time {
  position: relative;
  padding-left: 1.6rem;
}
.period-time::before {
  content: "";
  position: absolute;
  left: 0;
  top: .7rem;
  width: .65rem;
  height: .65rem;
  border: 2px solid var(--muted);
  border-radius: 50%;
  background: var(--bg);
}
.is-current .period-time::before {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.period-years {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2rem;
  line-height: 1.05;
  letter-spacing: -.03em;
}

.period-range {
  display: block;
  margin-top: .35rem;
  color: var(--muted);
  font-size: .85rem;
  line-height: 1.4;
}

.period-status {
  display: inline-block;
  margin-top: .7rem;
  padding: .15rem .6rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .8rem;
  font-weight: 600;
}

.cell h3 {
  margin: 0 0 .3rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  line-height: 1.25;
  letter-spacing: -.01em;
}

.cell-meta {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: .9rem;
}

/* Nom de l'école / de l'entreprise, au-dessus de chaque intitulé */
.cell-org {
  margin: 0 0 .4rem;
  color: var(--accent);
  font-size: .85rem;
  font-weight: 600;
}
.cell-place {
  margin-left: .3rem;
  color: var(--muted);
  font-weight: 400;
}
/* « École : » / « Entreprise : » seulement sur mobile (les colonnes n'ont plus d'en-tête) */
.cell-kind { display: none; }

.cell ul {
  display: grid;
  gap: .4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.cell li {
  position: relative;
  padding-left: 1.1rem;
  font-size: .975rem;
  line-height: 1.5;
}
.cell li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .72em;
  width: .45rem;
  height: 2px;
  background: var(--accent);
}

/* Détail dépliable */
.more {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin-top: 1.1rem;
  padding: .25rem 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: .925rem;
  font-weight: 600;
  cursor: pointer;
}
.more svg { transition: transform .25s ease; }
.more[aria-expanded="true"] svg { transform: rotate(180deg); }

.more-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .3s ease;
}
.more-body > div {
  overflow: hidden;
  visibility: hidden;
  transition: visibility 0s .3s;
}
.more-body.is-open { grid-template-rows: 1fr; }
.more-body.is-open > div {
  visibility: visible;
  transition: visibility 0s;
}
.more-body p {
  max-width: 60ch;
  margin: .75rem 0 0;
  color: var(--muted);
  font-size: .95rem;
}

/* =========================================================
   Compétences
   ========================================================= */
/* Couleur de chaque domaine */
.cat-auto  { --tool-accent: #2f6fd6; }
.cat-sys   { --tool-accent: #7a5af5; }
.cat-cloud { --tool-accent: #0e97a3; }
.cat-sup   { --tool-accent: #dd7a32; }
.cat-parc  { --tool-accent: #2e9a58; }
.cat-proj  { --tool-accent: #cf4f88; }

/* Rangées : sans JS (ou avec « réduire les animations »),
   les badges passent simplement à la ligne */
.marquee {
  display: grid;
  gap: .75rem;
}

.marquee-row { overflow: hidden; }

.marquee-track {
  display: flex;
  width: max-content;
  max-width: 100%;
  will-change: transform;
}

.marquee-group {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Version animée (activée par le JS) */
.marquee.is-animated .marquee-row {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent);
          mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent);
}
.marquee.is-animated .marquee-track { max-width: none; }
.marquee.is-animated .marquee-group {
  flex-wrap: nowrap;
  padding-right: .6rem; /* même écart entre deux copies qu'entre deux badges */
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  flex: none;
  padding: .4rem .95rem .4rem .4rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: .925rem;
  font-weight: 500;
  white-space: nowrap;
}

.badge-icon {
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--tool-accent) 14%, transparent);
  color: var(--tool-accent);
}
.badge-icon svg {
  width: 1rem;
  height: 1rem;
}

/* Bouton pause */
.marquee-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 1.25rem;
}

.marquee-control {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: border-color .15s;
}
.marquee-control[hidden] { display: none; }
.marquee-control:hover { border-color: var(--ink); }
.marquee-control svg {
  width: 1rem;
  height: 1rem;
}
.marquee-control .icon-play,
.marquee-control[aria-pressed="true"] .icon-pause { display: none; }
.marquee-control[aria-pressed="true"] .icon-play { display: grid; }
.marquee-control .icon-pause { display: grid; }

/* =========================================================
   Contact
   ========================================================= */
.contact-mail {
  display: inline-block;
  padding-bottom: .15rem;
  border-bottom: 3px solid var(--accent);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 5.5vw, 3.25rem);
  line-height: 1.15;
  letter-spacing: -.03em;
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: color .15s;
}
.contact-mail:hover { color: var(--accent); }

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 2.25rem;
}

/* =========================================================
   Pied de page
   ========================================================= */
.site-footer {
  padding: 2rem 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .9rem;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.footer-inner p { margin: 0; }
.footer-inner a { text-underline-offset: 3px; }
.footer-inner a:hover { color: var(--ink); }

/* =========================================================
   Mentions légales
   ========================================================= */
.legal {
  padding: clamp(3.5rem, 9vw, 5.5rem) 0 clamp(4rem, 9vw, 6rem);
}
.legal .wrap > * { max-width: 68ch; }

.legal-intro { color: var(--muted); }

.legal h2 {
  margin: 2.75rem 0 .85rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.4rem;
  letter-spacing: -.015em;
}
.legal p { margin: 0 0 1rem; }
.legal a { text-underline-offset: 3px; }

.info-list {
  display: grid;
  grid-template-columns: minmax(9rem, max-content) 1fr;
  gap: .55rem 1.5rem;
  margin: 0;
}
.info-list dt {
  color: var(--muted);
  font-size: .95rem;
}
.info-list dd { margin: 0; }

mark.ph {
  padding: 0 .3em;
  border-radius: .25em;
  background: var(--accent-soft);
  color: var(--ink);
}

.legal-updated {
  margin-top: 3rem !important;
  color: var(--muted);
  font-size: .9rem;
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 860px) {
  .track-head { display: none; }

  .tracks-body::before { top: 3.2rem; }

  .period {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding-left: 1.6rem;
  }
  .period-time { padding-left: 0; }
  .period-time::before { left: -1.6rem; }

  .period-years { display: inline; font-size: 1.75rem; }
  .period-range { display: inline; margin: 0 0 0 .6rem; }
  .period-status { display: table; }

  .cell-kind { display: inline; }

  .cell-empty { display: none; }
}

@media (max-width: 540px) {
  /* Sur mobile : on garde le nom et le bouton de thème, les liens de section sont masqués */
  .nav a[href^="#"] { display: none; }
  .nav a { font-size: .875rem; }
  .info-list { grid-template-columns: 1fr; gap: .15rem; }
  .info-list dd { margin-bottom: .6rem; }
}

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