/* =====================================================================
 *  Thème « Nuit » du portfolio — inspiré du site « La vision de l'IA en 2026 »
 *  (fond nuit, police Inter, cyan + violet, sections numérotées).
 *  Chargé UNIQUEMENT sur les pages publiques, après app.css.
 *  L'espace privé (admin) garde son thème clair.
 *  Règle de base : la lisibilité passe avant les effets.
 *  Contrastes (WCAG) sur le fond #07080b : texte 17,7:1, texte secondaire 10,4:1,
 *  texte discret 8,8:1, cyan 12,7:1, violet 8,6:1, ambre 13,7:1.
 * ===================================================================== */

@font-face { font-family: "Inter"; src: url("../fonts/Inter-Regular.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/Inter-SemiBold.woff") format("woff"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter Display"; src: url("../fonts/InterDisplay-SemiBold.woff") format("woff"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter Display"; src: url("../fonts/InterDisplay-Bold.woff") format("woff"); font-weight: 700; font-style: normal; font-display: swap; }

.theme-nuit {
  --c-bg: #07080b;
  --c-surface: #11141b;
  --c-surface-2: #171b24;
  --c-ink: #eef1f5;
  --c-ink-2: #c3cad4;
  --c-muted: #a3adba;
  --c-line: #262c38;
  --c-night: #0b0d12;
  --c-night-2: #11141b;
  --c-accent: #5ce1e6;
  --c-accent-ink: #5ce1e6;
  --c-accent-soft: rgba(92, 225, 230, 0.12);
  --c-lagoon: #5ce1e6;
  --c-violet: #8b7cff;
  --c-violet-texte: #a99eff;
  --c-warn: #ffcf6e;
  --c-warn-soft: rgba(255, 207, 110, 0.1);
  --c-danger: #ff8a80;
  --c-danger-soft: rgba(255, 138, 128, 0.1);
  --c-ok: #7ee2a8;
  --c-ok-soft: rgba(126, 226, 168, 0.1);
  --c-focus: #5ce1e6;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-titre: "Inter Display", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 18px 40px -18px rgba(0, 0, 0, 0.8);
  color-scheme: dark;
}

/* ---------- Fond : deux halos très doux, fixes (aucun calcul, aucune animation) ---------- */
body.theme-nuit {
  background:
    radial-gradient(60vmax 45vmax at 85% 0%, rgba(92, 225, 230, 0.07), transparent 60%),
    radial-gradient(50vmax 40vmax at 0% 100%, rgba(139, 124, 255, 0.07), transparent 60%),
    var(--c-bg);
  background-attachment: fixed;
}
.theme-nuit ::selection { background: rgba(92, 225, 230, 0.35); color: #fff; }

/* ---------- Survol : changement immédiat, sans fondu ----------
   (menu, boutons, liens, cartes, barre latérale) */
.theme-nuit a, .theme-nuit .btn, .theme-nuit .site-nav a,
.theme-nuit .project-card, .theme-nuit .contact-card, .theme-nuit .next-project .h3 { transition: none; }

/* ---------- Typographie ---------- */
.theme-nuit h1, .theme-nuit h2, .theme-nuit h3, .theme-nuit .h1, .theme-nuit .h2, .theme-nuit .h3, .theme-nuit .hero-name {
  font-family: var(--font-titre); font-weight: 700; letter-spacing: -0.03em;
}
.theme-nuit .h4, .theme-nuit h4 { font-family: var(--font); font-weight: 600; letter-spacing: 0; }
.theme-nuit .eyebrow { color: var(--c-accent); letter-spacing: 0.08em; text-transform: none; font-size: 0.95rem; font-weight: 600; }
.theme-nuit a { color: var(--c-accent); }
.theme-nuit a:hover { color: #fff; }
.theme-nuit .lead { color: var(--c-ink-2); }

/* Numéro de section : « 01 », « 02 »… comme les chapitres du site IA 2026 */
.sec-num { display: inline-block; font-family: var(--font-mono); color: var(--c-accent); margin-right: 0.5rem; }
.sec-num::after { content: " ·"; color: var(--c-muted); }

/* ---------- Boutons ---------- */
.theme-nuit .btn { border-radius: 999px; font-weight: 600; }
.theme-nuit .btn-primary { background: var(--c-accent); color: #07080b; }
.theme-nuit .btn-primary:hover { background: #9af0f2; color: #07080b; }
.theme-nuit .btn-secondary { background: rgba(17, 20, 27, 0.85); color: var(--c-ink); border-color: var(--c-line); }
.theme-nuit .btn-secondary:hover { border-color: var(--c-accent); color: #fff; }
.theme-nuit .btn-ghost { color: var(--c-accent); }
.theme-nuit .btn-light { background: var(--c-accent); color: #07080b; }
.theme-nuit .btn-light:hover { background: #9af0f2; color: #07080b; }
.theme-nuit .btn-outline-light { color: var(--c-ink); border-color: var(--c-line); }
.theme-nuit .btn-outline-light:hover { border-color: var(--c-accent); color: #fff; }

/* ---------- En-tête ---------- */
.theme-nuit .site-header { background: rgba(7, 8, 11, 0.9); border-bottom-color: var(--c-line); }
@supports (backdrop-filter: blur(8px)) { .theme-nuit .site-header { background: rgba(7, 8, 11, 0.72); } }
.theme-nuit .brand { color: var(--c-ink); }
.theme-nuit .brand-mark { background: transparent; color: var(--c-accent); border: 1px solid rgba(92, 225, 230, 0.45); font-family: var(--font-mono); }
.theme-nuit .site-nav a:not(.btn) { color: var(--c-ink-2); }
.theme-nuit .site-nav a:not(.btn):hover, .theme-nuit .site-nav a[aria-current="page"] { background: var(--c-surface-2); color: #fff; }
.theme-nuit .site-nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--c-accent); }
.theme-nuit .nav-toggle { background: var(--c-surface); border-color: var(--c-line); }
.theme-nuit .nav-toggle-bar, .theme-nuit .nav-toggle-bar::before, .theme-nuit .nav-toggle-bar::after { background: var(--c-ink); }
.theme-nuit .nav-toggle[aria-expanded="true"] .nav-toggle-bar { background: transparent; }

/* ---------- Héros ---------- */
.theme-nuit .pill { background: var(--c-accent-soft); color: var(--c-accent); border: 1px solid rgba(92, 225, 230, 0.35); }
.theme-nuit .pill-dot { background: var(--c-accent); box-shadow: 0 0 0 4px rgba(92, 225, 230, 0.18); }
.theme-nuit .hero-name { font-size: clamp(2.8rem, 1.6rem + 5vw, 5.4rem); letter-spacing: -0.045em; line-height: 0.98; }
.theme-nuit .hero-role { color: var(--c-violet-texte); }
.theme-nuit .hero-contact a { color: var(--c-ink-2); }

/* Le schéma du héros est déjà sombre : on l'encadre comme une carte */
.theme-nuit .hero-visual .diagram { border-radius: 20px; border: 1px solid var(--c-line); box-shadow: 0 0 60px -20px rgba(92, 225, 230, 0.35); }
.theme-nuit .ds-panel { fill: #0b0d12; }
.theme-nuit .ds-kicker, .theme-nuit .ds-foot { fill: #a3adba; }
.theme-nuit .ds-layer .ds-sub { fill: #b3bcc8; }
.theme-nuit .ds-layer rect { stroke: rgba(92, 225, 230, 0.35); }
.theme-nuit .ds-layer-base rect { fill: rgba(92, 225, 230, 0.12); stroke: var(--c-accent); }
.theme-nuit .ds-wire { stroke: rgba(92, 225, 230, 0.4); }

/* ---------- Schémas d'architecture (projets) en version sombre ---------- */
.theme-nuit .arch-zone { fill: #0b0d12; stroke: var(--c-line); }
.theme-nuit .arch-zone-web { fill: #0e1418; }
.theme-nuit .arch-zone-label { fill: #a3adba; }
.theme-nuit .arch-node rect { fill: #171b24; stroke: #3a4352; }
.theme-nuit .arch-node text { fill: #eef1f5; }
.theme-nuit .arch-node .arch-sub, .theme-nuit .arch-sub { fill: #b3bcc8; }
.theme-nuit .arch-node-quiet rect { fill: #11141b; }
.theme-nuit .arch-switch rect { fill: #1d2a33; stroke: var(--c-accent); }
.theme-nuit .arch-flow { stroke: var(--c-accent); }
.theme-nuit .arch-link { stroke: #4b5666; }
.theme-nuit .arch-arrowhead { fill: var(--c-accent); }
.theme-nuit .arch-badge { fill: #1d2a33; }
.theme-nuit .arch-badge-sub { fill: var(--c-accent); }

/* ---------- Sections et cartes ---------- */
.theme-nuit .section-alt { background: rgba(17, 20, 27, 0.55); border-block-color: var(--c-line); }
.theme-nuit .facts-grid { background: rgba(17, 20, 27, 0.8); }
.theme-nuit .featured-visual, .theme-nuit .figure { background: var(--c-surface); border-color: var(--c-line); }
.theme-nuit .status-tag { background: var(--c-accent-soft); color: var(--c-accent); border: 1px solid rgba(92, 225, 230, 0.3); }
.theme-nuit .project-card, .theme-nuit .skill-card, .theme-nuit .aside-card, .theme-nuit .contact-card, .theme-nuit .signal-card, .theme-nuit .method li {
  background: linear-gradient(160deg, rgba(23, 27, 36, 0.92), rgba(11, 13, 18, 0.92)); border-color: var(--c-line);
}
.theme-nuit .section-alt .project-card { background: linear-gradient(160deg, rgba(23, 27, 36, 0.92), rgba(11, 13, 18, 0.92)); }
.theme-nuit .project-card:hover, .theme-nuit .contact-card:hover { border-color: rgba(92, 225, 230, 0.55); box-shadow: none; transform: none; }
.theme-nuit .card-link { color: var(--c-ink); }
.theme-nuit .card-link:hover { color: var(--c-accent); }
.theme-nuit .chips li { background: rgba(92, 225, 230, 0.08); border: 1px solid rgba(92, 225, 230, 0.25); color: var(--c-ink-2); border-radius: 999px; }
.theme-nuit .level { color: var(--c-violet-texte); }
.theme-nuit .method-num { color: var(--c-accent); }
.theme-nuit .timeline li::before { box-shadow: 0 0 0 4px var(--c-accent-soft), 0 0 12px rgba(92, 225, 230, 0.6); }
.theme-nuit .timeline-period { color: var(--c-accent); }
.theme-nuit .matrix thead th { background: var(--c-surface-2); }
.theme-nuit .table-wrap { background: var(--c-surface); }
.theme-nuit .signal-code { background: var(--c-surface-2); }
.theme-nuit .next-project:hover .h3 { color: var(--c-accent); }

/* Appel final : bandeau avec liseré lumineux */
.theme-nuit .cta { background: linear-gradient(135deg, #0e1b22, #12122a); border-top: 1px solid rgba(92, 225, 230, 0.25); color: var(--c-ink-2); }
.theme-nuit .cta .h2 { color: #fff; }

/* ---------- Champs de formulaire ---------- */
.theme-nuit input:not([type]), .theme-nuit input[type="text"], .theme-nuit input[type="email"], .theme-nuit input[type="tel"], .theme-nuit input[type="search"], .theme-nuit select, .theme-nuit textarea {
  background: #0b0d12; color: var(--c-ink); border-color: #3a4352;
}

/* ---------- Le CV reste une « feuille de papier » claire, lisible et imprimable ---------- */
.theme-nuit .cv-sheet {
  --c-ink: #142530; --c-ink-2: #3c4f59; --c-muted: #5d6e76; --c-line: #d9e1de;
  --c-accent: #0b6f67; --c-accent-ink: #085a53; --c-accent-soft: #e2f1ee; --c-night: #14303a;
  color: var(--c-ink); background: #fff; box-shadow: 0 30px 80px -30px rgba(92, 225, 230, 0.25);
}
.theme-nuit .cv-sheet h1, .theme-nuit .cv-sheet h2, .theme-nuit .cv-sheet h3, .theme-nuit .cv-sheet h4 { color: var(--c-ink); }
.theme-nuit .cv-sheet a { color: var(--c-accent-ink); }
.theme-nuit .cv-sheet a:hover { color: var(--c-ink); }
.theme-nuit .cv-sheet .chips li { background: #eef2f0; border-color: #d9e1de; color: #3c4f59; }
.theme-nuit .cv-sheet .level { color: var(--c-accent-ink); }
.theme-nuit .cv-sheet ::selection { background: #bde8e1; color: #142530; }

/* ---------- Barre de progression de l'accueil (comme les chapitres 01…07) ---------- */
.rail { display: none; }
@media (min-width: 1100px) {
  .js .rail {
    display: block; position: fixed; right: 1.4rem; top: 50%; transform: translateY(-50%); z-index: 40;
  }
  .rail ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
  .rail a {
    position: relative; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
    border: 1px solid var(--c-line); background: rgba(7, 8, 11, 0.7); color: var(--c-ink-2);
    font: 600 0.75rem/1 var(--font-mono); text-decoration: none;
  }
  .rail a:hover { border-color: var(--c-accent); color: #fff; }
  .rail a[aria-current="true"] { background: var(--c-accent); border-color: var(--c-accent); color: #07080b; }
  /* Étiquette au survol / au focus : affichage immédiat */
  .rail-label {
    position: absolute; right: calc(100% + 0.6rem); top: 50%; transform: translateY(-50%); white-space: nowrap;
    padding: 0.25rem 0.6rem; border-radius: 6px; background: var(--c-surface-2); border: 1px solid var(--c-line);
    color: var(--c-ink); font: 600 0.85rem/1.3 var(--font); display: none; pointer-events: none;
  }
  .rail a:hover .rail-label, .rail a:focus-visible .rail-label { display: block; }
}

/* ---------- Apparition douce au défilement (désactivée en mouvement réduit et sans JS) ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s cubic-bezier(.2, .7, .2, 1), transform 0.7s cubic-bezier(.2, .7, .2, 1); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* =====================================================================
 *  Révélations par clip-path (masque qui s'ouvre), au défilement.
 *  Sans JavaScript, en mouvement réduit ou à l'impression, rien n'est
 *  masqué. Une fois l'animation finie, le masque est retiré (clip-done) :
 *  ombres et contours de focus redeviennent visibles normalement.
 *   - up     : le bloc se dévoile de bas en haut (titres, étapes)
 *   - left   : volet qui s'ouvre de gauche à droite (cartes, lignes)
 *   - circle : cercle qui grandit depuis le centre (schémas, images)
 * ===================================================================== */
.js [data-clip]:not(.clip-done) {
  transition: clip-path 0.9s cubic-bezier(.65, 0, .35, 1) calc(var(--i, 0) * 90ms), opacity 0.5s ease calc(var(--i, 0) * 90ms);
}
.js [data-clip="up"]:not(.is-in) { clip-path: inset(100% 0 0 0); opacity: 0.2; }
.js [data-clip="up"].is-in:not(.clip-done) { clip-path: inset(0 0 0 0); }
.js [data-clip="left"]:not(.is-in) { clip-path: inset(0 100% 0 0 round 18px); opacity: 0.2; }
.js [data-clip="left"].is-in:not(.clip-done) { clip-path: inset(0 0 0 0 round 18px); }
.js [data-clip="circle"]:not(.is-in) { clip-path: circle(0% at 50% 50%); opacity: 0.2; }
.js [data-clip="circle"].is-in:not(.clip-done) { clip-path: circle(75% at 50% 50%); }
/* Grand titre : un trait cyan balaie le texte pendant qu'il se dévoile */
.js .hero-name[data-clip] { position: relative; }
.js .hero-name[data-clip]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--c-accent);
  box-shadow: 0 0 18px var(--c-accent); transform-origin: left; transform: scaleX(0); opacity: 0;
}
.js .hero-name.is-in:not(.clip-done)::after { animation: trait-titre 1.1s cubic-bezier(.65, 0, .35, 1) both; }
@keyframes trait-titre { 0% { transform: scaleX(0); opacity: 1; } 60% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(1); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .js [data-clip] { clip-path: none !important; opacity: 1 !important; transition: none !important; }
  .js .hero-name::after { display: none; }
}

/* ---------- Impression : retour au noir sur blanc ---------- */
@media print {
  .theme-nuit { --c-bg: #fff; --c-ink: #000; --c-ink-2: #222; --c-muted: #444; --c-line: #ccc; --c-accent: #0b6f67; --c-accent-ink: #0b6f67; color-scheme: light; }
  body.theme-nuit { background: #fff; color: #000; }
  .theme-nuit .cv-sheet { box-shadow: none; }
  /* CV : tient sur une page A4 (corps de texte conservé à 11 pt, seuls les espacements sont resserrés) */
  @page { size: A4; margin: 11mm 13mm; }
  .theme-nuit .cv-sheet { margin: 0; max-width: none; }
  .theme-nuit .cv-grid { grid-template-columns: 1.4fr 1fr; gap: 1.6rem; }   /* deux colonnes même si la page est étroite */
  .theme-nuit .cv-contact { text-align: right; }
  .theme-nuit .cv-head { padding-bottom: 0.6rem; margin-bottom: 0.8rem; }
  .theme-nuit .cv-availability { margin: 0; }
  .theme-nuit .cv-sheet p { margin-block: 0 0.4em; }
  .theme-nuit .cv-sheet .cv-h { margin-block: 0.8em 0.4em; }
  .theme-nuit .section-tight, .theme-nuit .section-tight .container { padding: 0; }
  .rail { display: none !important; }
  .js .reveal { opacity: 1 !important; transform: none !important; }
  .js [data-clip] { clip-path: none !important; opacity: 1 !important; }
}

/* ---------- Intro de l'accueil : révélation par clip-path ----------
   Chaque élément du héros se dévoile à son tour au chargement :
   - le nom est « balayé » de gauche à droite ;
   - les autres lignes montent depuis un masque horizontal ;
   - le schéma s'ouvre en cercle depuis son centre.
   L'animation ne garde AUCUN état final (fill-mode: backwards) : une fois
   finie, le clip-path disparaît (contours de focus et ombres intacts).
   Sans JavaScript, en mouvement réduit ou à l'impression : tout est visible. */
@keyframes intro-monte {
  from { clip-path: inset(0 0 100% 0); transform: translateY(0.6em); }
  to   { clip-path: inset(0 0 0 0); transform: none; }
}
@keyframes intro-balaye {
  from { clip-path: inset(-0.1em 100% -0.2em 0); }
  to   { clip-path: inset(-0.1em 0 -0.2em 0); }
}
@keyframes intro-cercle {
  from { clip-path: circle(0% at 50% 50%); opacity: 0.4; }
  to   { clip-path: circle(75% at 50% 50%); opacity: 1; }
}
@keyframes intro-trait {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
.js .hero .hero-text > * { animation: intro-monte 0.8s cubic-bezier(.2, .7, .2, 1) backwards; }
.js .hero .hero-text > :nth-child(1) { animation-delay: 0.05s; }
.js .hero .hero-text > :nth-child(2) { animation-delay: 0.15s; }
.js .hero .hero-name { animation: intro-balaye 1.1s cubic-bezier(.7, 0, .2, 1) 0.25s backwards; position: relative; }
/* Trait lumineux qui accompagne le balayage du nom */
.js .hero .hero-name::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -0.08em; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, var(--c-accent), var(--c-violet)); transform-origin: left;
  animation: intro-trait 1.1s cubic-bezier(.7, 0, .2, 1) 0.25s both; opacity: 0.85;
}
.js .hero .hero-text > :nth-child(4) { animation-delay: 0.7s; }
.js .hero .hero-text > :nth-child(5) { animation-delay: 0.82s; }
.js .hero .hero-text > :nth-child(6) { animation-delay: 0.94s; }
.js .hero .hero-text > :nth-child(7) { animation-delay: 1.06s; }
.js .hero .hero-visual { animation: intro-cercle 1.3s cubic-bezier(.2, .7, .2, 1) 0.45s backwards; }
@media (prefers-reduced-motion: reduce) {
  .js .hero .hero-text > *, .js .hero .hero-name, .js .hero .hero-visual, .js .hero .hero-name::after { animation: none; }
}
@media print {
  .js .hero .hero-text > *, .js .hero .hero-name, .js .hero .hero-visual { animation: none; }
  .hero-name::after { display: none; }
}

/* =====================================================================
 *  Écran de chargement + transitions entre pages (voir assets/js/loader.js)
 *  Masqué par défaut : visible seulement si loader.js a posé .is-loading
 *  ou .is-leaving. Sans JavaScript ou en mouvement réduit : jamais affiché.
 * ===================================================================== */
.loader { display: none; }
.is-loading .loader, .is-leaving .loader, .is-loaded:not(.loader-fini) .loader {
  display: grid; place-items: center; position: fixed; inset: 0; z-index: 1000;
  background:
    radial-gradient(60vmax 45vmax at 85% 0%, rgba(92, 225, 230, 0.09), transparent 60%),
    radial-gradient(50vmax 40vmax at 0% 100%, rgba(139, 124, 255, 0.09), transparent 60%),
    #07080b;
  color: var(--c-ink);
}
.loader-inner { display: grid; justify-items: center; gap: 0.35rem; text-align: center; padding: 1.5rem; }
.loader-mark { width: 76px; height: 76px; margin-bottom: 0.6rem; overflow: visible; }
.loader-mark-cadre { fill: none; stroke: var(--c-accent); stroke-width: 2; stroke-dasharray: 100; stroke-dashoffset: 100; }
.loader-mark text { fill: var(--c-accent); font: 600 22px/1 var(--font-mono); }
.loader-name { margin: 0; font: 700 clamp(1.6rem, 1.2rem + 2vw, 2.4rem)/1.1 var(--font-titre); letter-spacing: -0.03em; }
.loader-role { margin: 0; color: var(--c-ink-2); font-size: 0.95rem; }
.loader-bar { width: min(220px, 60vw); height: 2px; margin-top: 1.1rem; border-radius: 2px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.loader-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--c-accent), var(--c-violet)); transform: scaleX(0); transform-origin: left; }

/* Première arrivée : le cadre se dessine, le nom se dévoile, la barre progresse */
.loader-long.is-loading .loader-mark-cadre { animation: loader-cadre 0.9s cubic-bezier(.6, 0, .2, 1) forwards; }
.loader-long.is-loading .loader-name { animation: loader-mot 0.7s cubic-bezier(.2, .7, .2, 1) 0.15s backwards; }
.loader-long.is-loading .loader-role { animation: loader-mot 0.7s cubic-bezier(.2, .7, .2, 1) 0.3s backwards; }
.loader-long.is-loading .loader-bar span { animation: loader-barre 1.6s cubic-bezier(.3, .6, .3, 1) forwards; }
.loader-long.is-loaded .loader-bar span, .loader-long.is-loaded .loader-mark-cadre { transform: scaleX(1); stroke-dashoffset: 0; }

/* Navigation interne : rideau court, seulement le monogramme */
.loader-court .loader-name, .loader-court .loader-role, .loader-court .loader-bar { display: none; }
.loader-court .loader-mark-cadre { stroke-dashoffset: 0; }

/* Fermeture du rideau au clic sur un lien (le rideau monte depuis le bas) */
.is-leaving .loader { animation: loader-ferme 0.36s cubic-bezier(.7, 0, .3, 1) both; }
/* Ouverture : le rideau se relève et dévoile la page (clip-path, comme l'intro) */
.is-loaded .loader { animation: loader-ouvre 0.75s cubic-bezier(.7, 0, .2, 1) forwards; pointer-events: none; }
.loader-court.is-loaded .loader { animation-duration: 0.5s; }

@keyframes loader-cadre { to { stroke-dashoffset: 0; } }
@keyframes loader-mot { from { clip-path: inset(0 0 100% 0); transform: translateY(0.5em); } to { clip-path: inset(0); transform: none; } }
@keyframes loader-barre { 0% { transform: scaleX(0); } 60% { transform: scaleX(0.7); } 100% { transform: scaleX(0.92); } }
@keyframes loader-ferme { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0); } }
@keyframes loader-ouvre { from { clip-path: inset(0); } to { clip-path: inset(0 0 100% 0); } }

/* L'intro de l'accueil attend que l'écran de chargement se lève */
.is-loading .hero *, .is-loading .hero .hero-name::after { animation-play-state: paused !important; }

@media (prefers-reduced-motion: reduce) { .loader { display: none !important; } }
@media print { .loader { display: none !important; } }
