/*
 * Styles du site public.
 *
 * L'identité de la première version est conservée — fond de code et logo AB
 * à l'accueil, menu bleu nuit, grands titres translucides en Adam, carte photo
 * qui se retourne, barres de compétences, frise en zigzag, pied de page bleu —
 * avec un traitement plus actuel : coins arrondis, ombres douces, animations
 * discrètes, mise en page fluide jusqu'au mobile.
 */

@font-face {
  font-family: "adam";
  src: url("/assets/fonts/Adam-Medium.ttf") format("truetype");
  font-display: swap;
}

/* Montserrat, hébergée avec le site (aucun appel à Google Fonts). Police
   variable : un seul fichier couvre toutes les graisses. */
@font-face {
  font-family: "Montserrat";
  src: url("/assets/fonts/montserrat-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Montserrat";
  src: url("/assets/fonts/montserrat-latin-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --blue: #2e8cd9;
  /* Bleu des fonds sous texte blanc : #2e8cd9 n'atteint pas le contraste AA. */
  --blue-strong: #1f6fb2;
  --navy: #184a73;

  /* Couleurs qui changent avec le thème (sombre : plus bas). */
  --bg: #ffffff;
  --card: #ffffff;
  --surface: #f4f7fa;
  --track: #dde6ef;
  --text: rgba(0, 0, 0, 0.85);
  --muted: #5d6b79;
  --title: rgba(46, 140, 217, 0.22);
  /* Bleu utilisé comme couleur de texte (liens, postes, libellés). */
  --accent-text: #1f6fb2;
  --accent-hover: #184a73;
  --shadow: 0 10px 30px rgba(24, 74, 115, 0.1);
  --shadow-hover: 0 18px 40px rgba(24, 74, 115, 0.16);
  --scroll-thumb: #184a73;
  color-scheme: light;
  --radius: 18px;
  --menu-height: 64px;
  --gradient: linear-gradient(90deg, var(--navy), var(--blue));
  --font: "Montserrat", system-ui, sans-serif;
  --font-display: "adam", var(--font);
}

/*
 * Thème sombre : bleu nuit, dans la continuité de l'accueil et du menu.
 * Choisi explicitement (data-theme="dark", posé par le bouton du menu) ou
 * hérité du système quand le visiteur n'a rien choisi.
 */
:root[data-theme="dark"] {
  --bg: #0b1622;
  --card: #12233a;
  --surface: #0f1d2e;
  --track: #1f3550;
  --text: rgba(255, 255, 255, 0.88);
  --muted: #9fb2c6;
  --title: rgba(46, 140, 217, 0.3);
  --accent-text: #7fbdf0;
  --accent-hover: #b3d8f7;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 18px 40px rgba(0, 0, 0, 0.45);
  --scroll-thumb: #2a5580;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1622;
    --card: #12233a;
    --surface: #0f1d2e;
    --track: #1f3550;
    --text: rgba(255, 255, 255, 0.88);
    --muted: #9fb2c6;
    --title: rgba(46, 140, 217, 0.3);
    --accent-text: #7fbdf0;
    --accent-hover: #b3d8f7;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    --shadow-hover: 0 18px 40px rgba(0, 0, 0, 0.45);
    --scroll-thumb: #2a5580;
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--menu-height);
  /* Barre de défilement aux couleurs du site : fine, pouce bleu nuit sur le
     fond de la page. Propriétés standard (Chrome, Edge, Firefox). */
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) var(--bg);
}

/* Safari ne connaît que les pseudo-éléments WebKit. Les navigateurs qui
   gèrent `scrollbar-color` ci-dessus ignorent ces règles. */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  border: 2px solid var(--bg);
  border-radius: 999px;
  background: var(--scroll-thumb);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--blue);
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Miniature floue posée en fond par le serveur : visible le temps que
   l'image se charge, puis recouverte par elle. */
img[style*="background-image"] {
  background-size: cover;
  background-position: center;
}

a {
  color: var(--accent-text);
}

a:hover {
  color: var(--accent-hover);
}

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ------------------------------------------------------------------ */
/* Apparition au défilement                                            */
/* ------------------------------------------------------------------ */

/* Masqué seulement quand le JavaScript tourne : sans lui, tout reste visible. */
@media (scripting: enabled) {
  .reveal {
    opacity: 0;
    transform: translateY(16px);
    transition:
      opacity 0.7s ease,
      transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
    transition-delay: var(--reveal-delay, 0ms);
  }

  .reveal.is-visible {
    opacity: 1;
    transform: none;
  }
}

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

  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ------------------------------------------------------------------ */
/* Accueil                                                             */
/* ------------------------------------------------------------------ */

.home {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 96px 24px;
  color: #ffffff;
  overflow: hidden;
  /* Bleu nuit, un peu plus clair au centre, derrière le logo. */
  background: radial-gradient(ellipse at center, #0f2f4d 0%, #081a2c 60%, #050f1b 100%);
}

/* Le réseau animé de l'accueil, sous le logo. */
.home-network {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.home-logo,
.home-wordmark {
  position: relative;
  z-index: 1;
}

.home-logo {
  width: clamp(140px, 22vw, 220px);
}

.home-wordmark {
  width: clamp(220px, 30vw, 300px);
}

.lang-switch {
  position: absolute;
  z-index: 2;
  top: 24px;
  left: 24px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 16px 8px 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  color: #ffffff;
  font: 600 14px var(--font);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease;
}

.lang-switch:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.lang-switch img {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  object-fit: cover;
}

@keyframes bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(10px);
  }
}

.home-scroll {
  position: absolute;
  z-index: 2;
  bottom: 32px;
  display: flex;
  padding: 4px;
  color: rgba(255, 255, 255, 0.75);
  animation: bob 1.8s ease-in-out infinite;
}

.home-scroll:hover {
  color: #ffffff;
}

/* ------------------------------------------------------------------ */
/* Menu                                                                */
/* ------------------------------------------------------------------ */

.menu {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--navy);
  box-shadow: 0 6px 24px rgba(10, 30, 50, 0.18);
}

.menu-inner {
  height: var(--menu-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.menu-links {
  display: flex;
  flex: 1;
  justify-content: space-between;
  margin: 0;
  padding: 0;
  list-style: none;
}

.menu-link {
  display: block;
  padding: 20px 0 18px;
  border-bottom: 2px solid transparent;
  color: rgba(255, 255, 255, 0.72);
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: 4px;
  text-decoration: none;
  transition:
    color 0.2s ease,
    border-color 0.2s ease;
}

.menu-link:hover {
  color: #ffffff;
}

.menu-link[aria-current="true"] {
  color: #ffffff;
  border-bottom-color: var(--blue);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  margin-left: 32px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-left: auto;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #ffffff;
  cursor: pointer;
}

@media (max-width: 1100px) {
  .menu-link {
    font-size: 14px;
    letter-spacing: 3px;
  }
}

@media (max-width: 860px) {
  .menu-toggle {
    display: inline-flex;
  }

  .theme-toggle {
    margin-left: 8px;
  }

  .menu-links {
    position: absolute;
    top: var(--menu-height);
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    padding: 8px 24px 24px;
    background: var(--navy);
    box-shadow: 0 16px 32px rgba(10, 30, 50, 0.25);
  }

  .menu.is-open .menu-links {
    display: flex;
  }

  .menu-link {
    padding: 14px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 18px;
  }

  .menu-link[aria-current="true"] {
    border-bottom-color: rgba(255, 255, 255, 0.1);
    color: var(--blue);
  }
}

/* ------------------------------------------------------------------ */
/* Sections                                                            */
/* ------------------------------------------------------------------ */

/* Le décalage sous le menu collant vient de `scroll-padding-top` sur <html>. */
.section {
  padding: 96px 0 112px;
  /* Le liseré bleu nuit de la première version, affiné et en dégradé. */
  border-bottom: 8px solid var(--navy);
  border-image: var(--gradient) 1;
}

.section-alt {
  background: var(--surface);
}

.section-body {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.section-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  /* Sur téléphone, un mot de onze lettres (« EXPERIENCES ») tient sur une ligne. */
  font-size: clamp(28px, 8.4vw, 88px);
  line-height: 1;
  letter-spacing: clamp(2px, 1vw, 12px);
  color: var(--title);
}

.section-title-start {
  align-self: flex-start;
}

.section-title-center {
  align-self: center;
  text-align: center;
}

.section-title-end {
  align-self: flex-end;
  text-align: right;
}

.section-intro {
  margin: 0 0 24px;
  max-width: 820px;
  font-size: clamp(17px, 1.6vw, 20px);
  line-height: 1.6;
}

.section-intro-center {
  align-self: center;
  text-align: center;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.lift {
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.pill {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--blue-strong);
  color: #ffffff;
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 14px 28px;
  border-radius: 999px;
  background: var(--blue-strong);
  color: #ffffff;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-decoration: none;
}

.button:hover {
  color: #ffffff;
  background: var(--navy);
}

/* ------------------------------------------------------------------ */
/* Présentation                                                        */
/* ------------------------------------------------------------------ */

.presentation {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 72px;
}

.flip {
  flex: 0 1 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin: 0 auto;
}

.flip-button {
  width: 100%;
  aspect-ratio: 19 / 22;
  padding: 0;
  border: 0;
  background: none;
  perspective: 1200px;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.flip-inner {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
  transform-style: preserve-3d;
}

.flip-button[aria-pressed="true"] .flip-inner {
  transform: rotateY(180deg);
}

/* Au survol seulement avec une souris : sur écran tactile, le survol
   « collerait » après un toucher et la carte ne se retournerait plus. */
@media (hover: hover) {
  .flip-button:hover .flip-inner {
    transform: rotateY(180deg);
  }
}

.flip-face {
  display: block;
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 20px;
  backface-visibility: hidden;
  box-shadow: 0 24px 60px rgba(24, 74, 115, 0.22);
}

.flip-face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.flip-back {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  padding: 32px 28px;
  background: var(--navy);
  color: #ffffff;
  text-align: center;
  font-size: 15px;
  transform: rotateY(180deg);
}

/* Le dos est fait de <span> (contenu d'un bouton) : on les remet en blocs. */
.flip-back > span {
  display: block;
}

.hobby-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  font-weight: 700;
}

.hobby-line {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.78);
}

.hobby-separator {
  height: 1px;
  background: rgba(255, 255, 255, 0.2);
}

.flip-hint {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.intro {
  flex: 999 1 520px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 28px;
}

.hello {
  margin: 0;
  font-size: clamp(34px, 4vw, 44px);
  font-weight: 500;
  letter-spacing: 3px;
  color: var(--blue);
}

.bio {
  margin: 0;
  max-width: 640px;
  font-size: clamp(17px, 1.6vw, 19px);
  line-height: 1.7;
}

.facts {
  width: 100%;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

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

.fact {
  padding: 18px 20px;
  border-radius: 14px;
  background: var(--surface);
}

.fact dt {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent-text);
}

.fact dd {
  margin: 6px 0 0;
  font-size: 17px;
  font-weight: 600;
}

/* ------------------------------------------------------------------ */
/* Compétences                                                         */
/* ------------------------------------------------------------------ */

.skills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr));
  gap: 28px 80px;
}

.skill-column {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.skill-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.skill-level {
  color: var(--accent-text);
}

.skill-track {
  height: 10px;
  border-radius: 999px;
  background: var(--track);
  overflow: hidden;
}

.skill-fill {
  width: var(--level);
  height: 100%;
  border-radius: 999px;
  background: var(--gradient);
}

@media (scripting: enabled) {
  .skill-fill {
    width: 0;
    transition: width 1.2s cubic-bezier(0.2, 0.7, 0.2, 1) 0.2s;
  }

  .is-visible .skill-fill {
    width: var(--level);
  }
}

/* ------------------------------------------------------------------ */
/* Frises : expériences et formation                                   */
/* ------------------------------------------------------------------ */

.timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* La ligne de la frise : un rail discret (::before) et son remplissage
   (::after), qui suit le défilement grâce à `--progress` (0 à 1). */
.timeline::before,
.timeline::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  margin-left: -1.5px;
  border-radius: 3px;
}

.timeline::before {
  background: var(--track);
}

.timeline::after {
  background: linear-gradient(180deg, var(--blue), var(--navy));
  transform: scaleY(var(--progress, 1));
  transform-origin: top;
}

.timeline-row {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 64px 1fr;
  align-items: center;
}

.timeline-dot {
  position: relative;
  z-index: 1;
  justify-self: center;
  width: 20px;
  height: 20px;
  border: 4px solid var(--track);
  border-radius: 999px;
  background: var(--card);
  transition:
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}

/* Pastille dépassée : elle s'allume, avec un léger halo. */
.timeline-row.is-passed .timeline-dot {
  border-color: var(--blue);
  box-shadow: 0 0 0 6px rgba(46, 140, 217, 0.15);
}

/* Sans JavaScript, la frise s'affiche entière et allumée. */
@media (scripting: none) {
  .timeline-dot {
    border-color: var(--blue);
  }
}

.timeline-date-left {
  text-align: right;
}

.experience {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 28px 32px;
}

.experience-left {
  text-align: right;
}

.experience-company {
  margin: 0;
  font-size: clamp(24px, 2.4vw, 30px);
  font-weight: 700;
}

.experience-role {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  color: var(--accent-text);
}

.experience-place {
  margin: 0;
  font-size: 15px;
  font-style: italic;
  color: var(--muted);
}

.experience-text {
  margin: 12px 0 0;
  font-size: 15px;
  line-height: 1.6;
}

.experience-link {
  margin-top: 4px;
  font-size: 14px;
  font-weight: 600;
}

.degrees {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px 32px;
}

.degree {
  padding: 24px 28px;
}

.degree-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.degree-info {
  text-align: right;
}

.degree-info .experience-place {
  margin-top: 6px;
}

.degree-text {
  font-size: 15px;
  line-height: 1.7;
}

@media (max-width: 860px) {
  .timeline::before,
  .timeline::after {
    left: 10px;
  }

  .timeline-row {
    grid-template-columns: 1fr;
    gap: 12px;
    padding-left: 40px;
  }

  .timeline-dot {
    position: absolute;
    top: 10px;
    left: 0;
  }

  /* Sur une colonne, la date passe toujours au-dessus de la carte. */
  .timeline-date,
  .timeline-date-left {
    order: -1;
    text-align: left;
  }

  .experience-left {
    text-align: left;
  }

  .degrees {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .degree-info {
    text-align: left;
  }

  .degree-period {
    justify-self: start;
    margin-top: 20px;
  }
}

/* ------------------------------------------------------------------ */
/* Portfolio                                                           */
/* ------------------------------------------------------------------ */

.projects {
  display: grid;
  grid-template-columns: 10fr 7fr 7fr;
  gap: 24px;
}

.project {
  position: relative;
  display: block;
  width: 100%;
  min-height: 340px;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--track);
  box-shadow: 0 14px 36px rgba(24, 74, 115, 0.16);
  cursor: pointer;
  font: inherit;
}

.project img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: transform 0.5s ease;
}

.project-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  background: rgba(31, 111, 178, 0.92);
  color: #ffffff;
  font-size: 22px;
  font-weight: 600;
  text-align: center;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.project-meta {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.project:hover img,
.project:focus-visible img {
  transform: scale(1.04);
}

.project:hover .project-overlay,
.project:focus-visible .project-overlay {
  opacity: 1;
}

/* Sans survol possible (écran tactile), le titre reste lisible en bas. */
@media (hover: none) {
  .project-overlay {
    opacity: 1;
    inset: auto 0 0 0;
    padding: 16px;
    font-size: 18px;
  }
}

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

  .project {
    min-height: 0;
    aspect-ratio: 16 / 10;
  }
}

/* Fenêtre de détail d'une référence */
.dialog {
  width: min(1200px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 0;
  border-radius: 24px;
  overflow: hidden;
  background: var(--card);
  color: var(--text);
  box-shadow: 0 40px 100px rgba(6, 18, 32, 0.4);
}

.dialog::backdrop {
  background: rgba(6, 18, 32, 0.55);
  backdrop-filter: blur(4px);
}

.dialog[open] {
  animation: dialog-in 0.25s cubic-bezier(0.2, 0.7, 0.2, 1);
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
}

.dialog-body {
  display: grid;
  grid-template-columns: 3fr 2fr;
  max-height: calc(100vh - 32px);
}

.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.dialog-details {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 40px 36px;
  overflow-y: auto;
}

.dialog-title {
  margin: 0;
  padding-right: 40px;
  font-size: 28px;
}

.dialog-facts {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dialog-facts dt {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent-text);
}

.dialog-facts dd {
  margin: 4px 0 0;
  font-size: 16px;
  line-height: 1.6;
}

.dialog-details .button {
  align-self: flex-start;
  margin-top: 8px;
}

.carousel {
  position: relative;
  min-height: 320px;
  background: var(--surface);
  /* Le navigateur garde le défilement vertical, le glissement horizontal
     revient au carrousel. */
  touch-action: pan-y;
  user-select: none;
}

.carousel-slide,
.carousel img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.carousel img {
  object-fit: cover;
  object-position: top;
  background-size: cover;
}

.carousel-slide[hidden] {
  display: none;
}

.carousel-nav {
  position: absolute;
  top: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-top: -22px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.carousel-prev {
  left: 16px;
}

.carousel-next {
  right: 16px;
}

.carousel-dots {
  position: absolute;
  bottom: 16px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
}

.carousel-dot[aria-current="true"] {
  background: #ffffff;
}

@media (max-width: 860px) {
  .dialog-body {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }

  .carousel {
    min-height: 0;
    aspect-ratio: 16 / 10;
  }

  .dialog-details {
    overflow: visible;
    padding: 28px 24px 32px;
  }
}

/* ------------------------------------------------------------------ */
/* Contact                                                             */
/* ------------------------------------------------------------------ */

.contact {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
}

.contact-lead {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
}

.contact-mail {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  max-width: 100%;
  padding: 16px 28px;
  border-radius: 999px;
  background: var(--card);
  box-shadow: var(--shadow);
  font-size: clamp(15px, 2vw, 18px);
  font-weight: 600;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.contact-networks-label {
  margin: 16px 0 0;
  font-size: 16px;
  color: var(--muted);
}

.socials {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.social {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: var(--card);
  color: var(--accent-text);
  box-shadow: 0 6px 18px rgba(24, 74, 115, 0.1);
  transition:
    background 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.social:hover {
  background: var(--blue-strong);
  color: #ffffff;
  transform: translateY(-3px);
}

/* ------------------------------------------------------------------ */
/* Pied de page                                                        */
/* ------------------------------------------------------------------ */

.footer {
  background: var(--blue-strong);
  color: #ffffff;
}

.footer-inner {
  display: flex;
  justify-content: center;
  padding-top: 28px;
  padding-bottom: 28px;
}

.footer-copyright {
  margin: 0;
  font-size: 14px;
  text-align: center;
}

.footer-copyright a {
  color: #ffffff;
}

.footer-copyright a:hover {
  color: rgba(255, 255, 255, 0.8);
}
