/* ==========================================================================
   thibautjulien.be — feuille de style principale
   Sommaire :
     1. Design tokens (variables)
     2. Reset & base
     3. Utilitaires (conteneur, libellés, boutons, tags)
     4. Header & navigation
     5. Hero & fiche personnage
     6. Bandeau process
     7. À propos
     8. Compétences
     9. Projets (filtres + cartes)
    10. Contact & formulaire
    11. Footer
    12. Fenêtre de détails (<dialog>)
    13. Animations (chargement, continues, défilement)
    14. Responsive
    15. Mouvement réduit
   ========================================================================== */

/* 1. Design tokens -------------------------------------------------------- */
:root {
  /* Couleurs */
  --c-bg: #0f0e0c;
  --c-surface: #191714;
  --c-band: #141310;
  --c-border: #2a2620;
  --c-border-strong: #3a352c;
  --c-border-dashed: #4a4338;
  --c-text: #f2ede4;
  --c-text-soft: #e5ded2;
  --c-text-2: #c9c1b4;
  --c-text-muted: #a39b8e;
  --c-accent: #f2b544;
  --c-accent-hover: #ffd27a;
  --c-accent-light: #ffe3a3;
  --c-on-accent: #0f0e0c;
  --c-on-accent-soft: #3a2e14;
  --c-available: #6fd08c;
  --c-error: #ff8a7a;
  --c-stripe-a: #221f1a;
  --c-stripe-b: #1c1a16;

  /* Typographies */
  --f-display: "Bricolage Grotesque", system-ui, sans-serif;
  --f-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* Rayons */
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-2xl: 24px;
  --r-3xl: 32px;
  --r-pill: 999px;

  /* Espacements */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;
  --s-10: 112px;

  /* Mise en page */
  --container: 1240px;
  --gutter: 24px;
  --header-h: 73px;

  /* Mouvement */
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* 2. Reset & base --------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 8px); /* ancres sous le header sticky */
  -webkit-text-size-adjust: 100%;
}

/* Barres de défilement masquées (le défilement reste possible : molette, tactile, clavier) */
html,
.project-dialog {
  scrollbar-width: none;
}
::-webkit-scrollbar {
  display: none;
}

/* L'attribut hidden doit toujours l'emporter (ex. sur .btn qui est en inline-flex) */
[hidden] {
  display: none !important;
}

/* Défilement bloqué pendant l'ouverture de la fenêtre de détails */
html.is-locked {
  overflow: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Le halo de la fiche déborde en tournant : on coupe le débordement horizontal
   sur <main> (pleine largeur), sans toucher au header sticky. */
main {
  display: block;
  overflow-x: clip;
}
main:focus {
  outline: none;
}

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

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

/* Focus visible : contour doré partout */
:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Lien d'évitement */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--s-4);
  z-index: 100;
  background: var(--c-accent);
  color: var(--c-on-accent);
  font-weight: 600;
  padding: 10px 16px;
  border-radius: var(--r-sm);
  text-decoration: none;
}
.skip-link:focus {
  top: var(--s-4);
  color: var(--c-on-accent);
}

/* Masqué visuellement, lu par les lecteurs d'écran */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* 3. Utilitaires ----------------------------------------------------------- */
.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Libellé type « // À PROPOS » */
.eyebrow {
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--c-accent);
  letter-spacing: 0.08em;
}

.section-title {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(36px, 4.4vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.section-head {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Boutons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  padding: 15px 26px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s, filter 0.2s, border-color 0.2s, background-color 0.2s;
}
.btn:hover {
  transform: translateY(-2px);
}
.btn svg {
  flex-shrink: 0;
}

.btn--primary {
  background: var(--c-accent);
  color: var(--c-on-accent);
}
.btn--primary:hover {
  color: var(--c-on-accent);
  filter: brightness(1.08);
}

.btn--ghost {
  border-color: var(--c-border-strong);
  color: var(--c-text);
  font-weight: 500;
}
.btn--ghost:hover {
  color: var(--c-text);
  border-color: var(--c-accent);
}

.btn--pill {
  border-radius: var(--r-pill);
  padding: 10px 18px;
}

/* Tags */
.tag {
  display: inline-block;
  font-size: 14px;
  padding: 6px 12px;
  border-radius: var(--r-sm);
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  color: var(--c-text-soft);
  transition: transform 0.2s, border-color 0.2s;
}
.tag:hover {
  transform: translateY(-3px);
  border-color: var(--c-accent);
}

.tag--mono {
  font-family: var(--f-mono);
  font-size: 12px;
  padding: 4px 9px;
  border-radius: var(--r-xs);
  background: transparent;
  color: var(--c-text-2);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

/* Statut (« ● En production ») */
.status {
  font-family: var(--f-mono);
  font-size: 12px;
  padding: 5px 10px;
  border-radius: var(--r-xs);
  background: rgba(15, 14, 12, 0.85);
  color: var(--c-text-soft);
}

/* Petite carte (soft skills) */
.mini-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 18px;
}
.mini-card__title {
  font-size: 16px;
  font-weight: 600;
}
.mini-card p {
  font-size: 14px;
  color: var(--c-text-muted);
}

/* 4. Header & navigation --------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(15, 14, 12, 0.86);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--c-border);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  padding-block: var(--s-4);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  text-decoration: none;
  color: var(--c-text);
}
.brand:hover {
  color: var(--c-text);
}

.brand__logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--c-accent);
  color: var(--c-on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.03em;
}

.brand__name {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 18px;
}

.nav__menu {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 28px;
  font-size: 15px;
}

/* Soulignement progressif au survol + lien actif */
.nav__link {
  color: var(--c-text-2);
  text-decoration: none;
  padding-block: 4px;
  background: linear-gradient(var(--c-accent), var(--c-accent)) 0 100% / 0 1.5px no-repeat;
  transition: background-size 0.3s, color 0.2s;
}
.nav__link:hover,
.nav__link.is-active {
  color: var(--c-text);
  background-size: 100% 1.5px;
}

.nav__toggle {
  display: none; /* visible seulement sur mobile */
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-md);
  border: 1px solid var(--c-border-strong);
  background: transparent;
  color: var(--c-text);
  cursor: pointer;
}
.nav__toggle .icon-close {
  display: none;
}
.nav__toggle[aria-expanded="true"] .icon-open {
  display: none;
}
.nav__toggle[aria-expanded="true"] .icon-close {
  display: block;
}

/* 5. Hero ------------------------------------------------------------------ */
.hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 56px;
  padding-top: var(--s-9);
  padding-bottom: 80px;
}

.hero__content {
  flex: 999 1 560px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.badge {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-pill);
  padding: 8px 16px;
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--c-text-2);
}

.badge__dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-available);
}

.hero__title {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(52px, 8vw, 116px);
  line-height: 0.95;
  letter-spacing: -0.03em;
}

.hero__title-accent {
  display: inline-block;
  color: var(--c-accent);
}

.hero__intro {
  max-width: 600px;
  font-size: 19px;
  color: var(--c-text-2);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

/* Fiche personnage */
.profile {
  flex: 1 1 340px;
  max-width: 420px;
  position: relative;
}

.profile__orb {
  position: absolute;
  inset: -40px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    rgba(242, 181, 68, 0.22),
    transparent 40%,
    rgba(242, 181, 68, 0.12) 70%,
    transparent
  );
  filter: blur(40px);
  pointer-events: none;
}

.profile__card {
  position: relative;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-2xl);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Cadre photo : fond = la photo zoomée et floutée, par-dessus = le portrait rond net.
   (photo-profil.jpg est un portrait rond sur fond sombre : on le découpe en cercle.) */
.profile__media {
  position: relative;
  aspect-ratio: 4 / 4.2;
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-bg);
  isolation: isolate;
}

.profile__photo-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(22px) brightness(0.55);
  transform: scale(1.35); /* évite les bords clairs du flou */
  z-index: -1;
}

.profile__photo {
  width: 82%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(242, 181, 68, 0.55), 0 18px 40px -12px rgba(0, 0, 0, 0.7);
}

.profile__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--s-3);
}

.profile__name {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 24px;
  line-height: 1.2;
}

.profile__role {
  color: var(--c-text-muted);
  font-size: 14px;
}

.profile__level {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--c-on-accent);
  background: var(--c-accent);
  padding: 4px 10px;
  border-radius: var(--r-xs);
  white-space: nowrap;
}

.profile__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.stat {
  background: var(--c-bg);
  border-radius: var(--r-md);
  padding: var(--s-3);
}
.stat dt {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 22px;
  color: var(--c-accent);
}
.stat dd {
  margin: 0;
  font-size: 12px;
  color: var(--c-text-muted);
}

/* 6. Bandeau process ------------------------------------------------------- */
.process {
  border-block: 1px solid var(--c-border);
  background: var(--c-band);
}

.process__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--s-5);
  padding-block: 28px;
  font-family: var(--f-mono);
  font-size: 14px;
  color: var(--c-text-2);
}

.process__num {
  color: var(--c-accent);
}

/* 7. À propos -------------------------------------------------------------- */
.about {
  display: flex;
  flex-wrap: wrap;
  gap: 56px;
  padding-top: var(--s-10);
  padding-bottom: var(--s-8);
}

.about__head {
  flex: 1 1 320px;
}

.about__body {
  flex: 999 1 520px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s-6);
}

.about__text {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  font-size: 18px;
  color: var(--c-text-2);
}

.about__skills {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.about__skills-label {
  font-weight: 400;
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--c-text-muted);
}

.grid-soft {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--s-3);
}

/* 8. Compétences ----------------------------------------------------------- */
.skills {
  display: flex;
  flex-direction: column;
  gap: 36px;
  padding-block: var(--s-8);
}

.split-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--s-4);
}

.skills__lead {
  max-width: 380px;
  color: var(--c-text-muted);
  font-size: 15px;
}

.grid-skills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: var(--s-4);
}

.skill-card {
  height: 100%;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  padding: var(--s-5);
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}

.skill-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.skill-card__title {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 21px;
}

.skill-card__num {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--c-text-muted);
}

/* 9. Projets --------------------------------------------------------------- */
.projects {
  display: flex;
  flex-direction: column;
  gap: 36px;
  padding-top: var(--s-9);
  padding-bottom: var(--s-8);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

.chip {
  min-height: 44px;
  padding: 10px 18px;
  border-radius: var(--r-pill);
  border: 1px solid var(--c-border-strong);
  background: transparent;
  color: var(--c-text-2);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.25s, color 0.25s, border-color 0.25s;
}
.chip:hover {
  border-color: var(--c-accent);
}
.chip[aria-pressed="true"] {
  background: var(--c-accent);
  border-color: var(--c-accent);
  color: var(--c-on-accent);
}

.grid-projects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr));
  gap: var(--s-5);
}

.projects__empty {
  color: var(--c-text-muted);
}

.project-card {
  width: 100%;
  height: 100%;
  padding: 0;
  display: flex;
  flex-direction: column;
  text-align: left;
  color: var(--c-text);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 22px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.35s var(--ease-out), border-color 0.3s, box-shadow 0.35s;
}
.project-card:hover,
.project-card:focus-visible {
  transform: translateY(-8px);
  border-color: var(--c-accent);
  box-shadow: 0 24px 60px -20px rgba(242, 181, 68, 0.35);
}
.project-card:focus-visible {
  outline-offset: 4px;
  border-radius: 22px;
}

.project-card__cover {
  position: relative;
  height: 240px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 70% 30%, rgba(242, 181, 68, 0.16), transparent 60%), var(--cover, #1f1a12);
  border-bottom: 1px solid var(--c-border);
}

.project-card__cover .status {
  position: absolute;
  top: var(--s-4);
  left: var(--s-4);
  background: rgba(15, 14, 12, 0.8);
}

/* Grande lettre en contour */
.mono-letter {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 88px;
  line-height: 1;
  /* Lettre pleine + filtre SVG #letter-outline (index.html) qui n'en garde que le bord.
     Contrairement à -webkit-text-stroke, ça ne dessine pas les contours internes
     qui se chevauchent dans certaines lettres (ex. le « P »). */
  color: var(--c-accent);
  filter: url(#letter-outline);
  opacity: 0.85;
  transition: transform 0.5s var(--ease-out);
}
.project-card:hover .mono-letter,
.project-card:focus-visible .mono-letter {
  transform: scale(1.15) rotate(-6deg);
}

.project-card__body {
  flex: 1;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.project-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-3);
}

.project-card__title {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 23px;
}

.project-card__cat {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--c-accent);
}

.project-card__desc {
  flex: 1;
  font-size: 15px;
  color: var(--c-text-muted);
}

.project-card .tag-list {
  gap: 6px;
}

.project-card__more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--c-accent);
}

/* 10. Contact -------------------------------------------------------------- */
.contact {
  padding-top: var(--s-9);
  padding-bottom: var(--s-10);
}

.contact__panel {
  background: var(--c-accent);
  color: var(--c-on-accent);
  border-radius: var(--r-3xl);
  padding: clamp(32px, 5vw, 64px);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-7);
}

/* Sur fond doré, le focus doré serait invisible : on passe en sombre */
.contact__panel :focus-visible {
  outline-color: var(--c-on-accent);
}
.contact__form :focus-visible {
  outline-color: var(--c-accent);
}

.contact__content {
  flex: 999 1 420px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.contact .eyebrow {
  color: var(--c-on-accent);
}

.contact__title {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(40px, 5.6vw, 76px);
  line-height: 0.98;
  letter-spacing: -0.03em;
}

.contact__lead {
  max-width: 480px;
  font-size: 18px;
  color: var(--c-on-accent-soft);
}

.contact__mail {
  align-self: flex-start;
  max-width: 100%;
  background: var(--c-bg);
  color: var(--c-text);
  border-radius: 14px;
  padding: 16px 26px;
  font-size: 17px;
  overflow-wrap: anywhere;
}
.contact__mail:hover {
  color: var(--c-text);
}

.socials {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--c-on-accent);
  text-decoration: none;
  border: 1.5px solid var(--c-on-accent);
  border-radius: var(--r-pill);
  padding: 9px 18px;
  font-weight: 600;
  font-size: 14px;
  transition: transform 0.2s, background-color 0.2s, color 0.2s;
}
.social-link:hover {
  color: var(--c-accent);
  background: var(--c-on-accent);
  transform: translateY(-2px);
}

/* Formulaire */
.contact__form {
  flex: 1 1 340px;
  min-width: 0;
  background: var(--c-bg);
  color: var(--c-text);
  border-radius: 22px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: var(--c-text-2);
}

.field input,
.field textarea {
  width: 100%;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 10px;
  padding: 13px 14px;
  color: var(--c-text);
  font-size: 15px;
  transition: border-color 0.2s;
}
.field textarea {
  resize: vertical;
  min-height: 120px;
}
.field input::placeholder,
.field textarea::placeholder {
  color: #8a8276;
}
.field input:hover,
.field textarea:hover {
  border-color: var(--c-border-strong);
}
.field input:focus,
.field textarea:focus {
  border-color: var(--c-accent);
}
.field [aria-invalid="true"] {
  border-color: var(--c-error);
}

.field__error {
  min-height: 0;
  font-size: 13px;
  color: var(--c-error);
}
.field__error:empty {
  display: none;
}

/* Piège à robots (honeypot) : invisible pour les humains */
.hp {
  position: absolute;
  left: -9999px;
}

.contact__submit {
  border: 0;
  padding: 15px;
  font-size: 16px;
}
.contact__submit[disabled] {
  opacity: 0.6;
  cursor: progress;
  transform: none;
}

.form-status {
  font-size: 14px;
}
.form-status:empty {
  display: none;
}
.form-status.is-success {
  color: var(--c-available);
}
.form-status.is-error {
  color: var(--c-error);
}

/* 11. Footer --------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--c-border);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s-3);
  padding-block: 28px;
  font-size: 14px;
  color: var(--c-text-muted);
}

.site-footer__domain {
  font-family: var(--f-mono);
}

/* 12. Fenêtre de détails --------------------------------------------------- */
.project-dialog {
  width: min(1000px, calc(100% - 40px));
  max-width: none;
  max-height: calc(100% - 80px);
  margin: 40px auto auto;
  padding: 0;
  border: 1px solid var(--c-border);
  border-radius: 28px;
  background: var(--c-surface);
  color: var(--c-text);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.project-dialog::backdrop {
  background: rgba(8, 7, 6, 0.82);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

/* Ouverture : fondu + montée */
.project-dialog[open] {
  animation: up 0.6s var(--ease-out) both;
}
.project-dialog[open]::backdrop {
  animation: fade 0.3s ease both;
}

.dialog__media {
  position: relative;
  border-bottom: 1px solid var(--c-border);
}

.dialog__shot {
  display: block;
  width: 100%;
  height: auto;
  max-height: 72vh;
  object-fit: contain; /* capture affichée en entier, quel que soit son format */
  background: var(--c-bg);
  animation: fade 0.3s ease both;
}

/* Emplacement rayé « Capture à venir » */
.shot-placeholder {
  aspect-ratio: 16 / 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  background: radial-gradient(circle at 70% 30%, rgba(242, 181, 68, 0.18), transparent 60%),
    repeating-linear-gradient(135deg, #1f1c17 0 14px, #1a1814 14px 28px);
}
.shot-placeholder .mono-letter {
  font-size: clamp(72px, 12vw, 120px);
  opacity: 0.5;
}
.shot-placeholder__label {
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--c-text-muted);
}

.dialog__close {
  position: absolute;
  top: var(--s-4);
  right: var(--s-4);
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--c-border-strong);
  background: rgba(15, 14, 12, 0.85);
  color: var(--c-text);
}
.dialog__close:hover {
  border-color: var(--c-accent);
}

/* Carrousel de captures */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--c-border-strong);
  background: rgba(15, 14, 12, 0.85);
  color: var(--c-text);
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
}
.carousel-btn:hover {
  border-color: var(--c-accent);
  transform: translateY(-50%) scale(1.06);
}
.carousel-btn--prev {
  left: var(--s-4);
}
.carousel-btn--next {
  right: var(--s-4);
}
.carousel-count {
  position: absolute;
  right: var(--s-4);
  bottom: var(--s-4);
  font-family: var(--f-mono);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: var(--r-xs);
  background: rgba(15, 14, 12, 0.85);
  color: var(--c-text-soft);
}
#dialog-shot {
  touch-action: pan-y; /* laisse défiler verticalement, le JS gère le glissement horizontal */
}

.dialog__media .status {
  position: absolute;
  top: 20px;
  left: 20px;
}

.dialog__thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: var(--s-3);
  padding: var(--s-4) var(--s-6) 0;
}
.dialog__thumbs:empty {
  display: none;
}

.thumb {
  padding: 0;
  aspect-ratio: 16 / 10;
  border-radius: var(--r-md);
  border: 1px dashed var(--c-border-dashed);
  background: var(--c-stripe-b);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.thumb:hover {
  border-color: var(--c-accent);
  transform: translateY(-2px);
}
.thumb[aria-current="true"] {
  border: 1.5px solid var(--c-accent);
}

.dialog__body {
  padding: 28px var(--s-6) 36px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.dialog__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--s-3);
}

.dialog__title {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1;
  letter-spacing: -0.02em;
}

.dialog__kind {
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--c-accent);
}

.dialog__long {
  max-width: 760px;
  font-size: 17px;
  color: var(--c-text-2);
}

.dialog__cols {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-6);
}

.dialog__features {
  flex: 999 1 360px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.dialog__aside {
  flex: 1 1 280px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dialog__label {
  font-weight: 400;
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--c-text-muted);
}

.dialog__group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dialog__group .tag-list {
  margin-top: 6px;
}

.feature-list {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.feature-list li {
  display: flex;
  gap: var(--s-3);
  align-items: flex-start;
  font-size: 15px;
  color: var(--c-text-soft);
}
.feature-list li::before {
  content: "→";
  color: var(--c-accent);
  font-family: var(--f-mono);
}

.dialog__value {
  font-size: 15px;
}

.dialog__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  padding-top: 24px;
  border-top: 1px solid var(--c-border);
}
.dialog__actions .btn {
  padding: 14px 24px;
}

/* 13. Animations ----------------------------------------------------------- */
@keyframes up {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes float {
  50% {
    transform: translateY(-12px) rotate(-1deg);
  }
}
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(111, 208, 140, 0.7);
  }
  100% {
    box-shadow: 0 0 0 10px rgba(111, 208, 140, 0);
  }
}
@keyframes shine {
  to {
    background-position: 200% center;
  }
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Apparition au chargement (hero), avec délais en cascade */
.anim-in {
  animation: up 0.9s var(--ease-out) both;
}
.anim-d1 { animation-delay: 0.1s; }
.anim-d2 { animation-delay: 0.25s; }
.anim-d3 { animation-delay: 0.4s; }
.anim-d4 { animation-delay: 0.55s; }

/* Animations continues */
.anim-pulse {
  animation: pulse 1.8s ease-out infinite;
}
.anim-float {
  animation: float 6s ease-in-out infinite;
}
.anim-spin {
  animation: spin 30s linear infinite;
}
.anim-shine {
  background: linear-gradient(90deg, var(--c-accent), var(--c-accent-light), var(--c-accent)) 0 0 / 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shine 4s linear infinite;
}

/* Apparition au défilement.
   Les éléments ne sont masqués que si JS est actif (classe .js sur <html>),
   sinon le contenu reste visible. main.js ajoute .is-visible via IntersectionObserver
   et règle --reveal-delay pour décaler les éléments d'une même grille. */
.js .reveal {
  opacity: 0;
  transform: translateY(70px) scale(0.96);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
  transition-delay: var(--reveal-delay, 0s);
}
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* 14. Responsive ----------------------------------------------------------- */
@media (max-width: 760px) {
  :root {
    --gutter: 16px;
  }

  .nav__toggle {
    display: inline-flex;
  }

  /* Menu replié : affiché sous la barre quand le burger est ouvert.
     Sans JS, le menu reste visible (pas de classe .js). */
  .js .nav__menu {
    display: none;
  }
  .nav__menu {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: var(--s-2);
    padding-bottom: var(--s-2);
  }
  .js .nav__menu.is-open {
    display: flex;
    animation: fade 0.25s ease both;
  }
  .nav__link {
    padding: 10px 0;
    font-size: 17px;
  }
  .nav__menu .btn {
    margin-top: var(--s-2);
  }

  .hero {
    padding-top: var(--s-8);
    padding-bottom: var(--s-8);
    gap: var(--s-7);
  }
  .hero__intro {
    font-size: 17px;
  }
  .profile {
    max-width: none;
  }

  .about {
    padding-top: var(--s-8);
    gap: var(--s-6);
  }

  .projects,
  .contact {
    padding-top: var(--s-8);
  }

  .contact__form {
    padding: var(--s-5);
  }

  .project-dialog {
    width: calc(100% - 24px);
    max-height: calc(100% - 24px);
    margin-top: 12px;
    border-radius: var(--r-2xl);
  }
  .dialog__thumbs {
    grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
    padding-inline: var(--s-4);
  }
  .dialog__body {
    padding: var(--s-5) var(--s-4) 28px;
  }
}

@media (max-width: 420px) {
  .profile__stats {
    gap: 6px;
  }
  .stat {
    padding: 10px 8px;
  }
  .stat dt {
    font-size: 18px;
  }
}

/* 15. Mouvement réduit ----------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .js .reveal {
    opacity: 1;
    transform: none;
  }
}
