/* ═══════════════════════════════════════════════════════════════════════
   latortu.fr — socle commun à toutes les pages
   ───────────────────────────────────────────────────────────────────────
   Deux thèmes :
     clair  (défaut)        fond lumineux, accents vifs
     sombre body.dark-mode  HUD : noir profond, accent phosphorescent,
                            scanlines — dans l'esprit du portfolio

   Chaque page garde ses propres composants : cette feuille ne fournit que
   les jetons de couleur, le bandeau et le pied. Les pages utilisaient déjà
   les mêmes noms de variables (--bg, --txt, --line…), et celles qui
   avaient un nom d'accent à elles (--gold, --orange, --terra, --purple)
   le reçoivent ici en alias. Rien de leur CSS n'a eu besoin d'être réécrit.

   Les contrastes sont calculés, pas estimés. Sur le fond clair #eef1f9 :
     --txt   13,44:1      --dim2  6,06:1      --dim  4,91:1
   Les accents viennent par paire : --accent pour les gros titres, les
   bordures et les icônes, --accent-ink pour le petit texte, où il faut
   tenir 4,5:1.
   ═══════════════════════════════════════════════════════════════════════ */

/* ─── jetons : thème clair ───────────────────────────────────────────
   Les teintes viennent de la photo de référence — un spectre vif sur un
   noir profond. En clair, ce sont les mêmes familles passées en encre ;
   en sombre, ce sont les couleurs vives sur le noir de la photo.

   Chaque valeur a été calculée, pas choisie : les encres tiennent 4,6:1
   au minimum sur les TROIS fonds (page, carte, pied de carte), et les
   accents sombres sont la version la plus vive qui tienne encore 7:1. */
:root{
  --bg:#f4f5fa; --bg2:#ffffff; --bg3:#eceef7;
  --line:#dfe2ef; --line2:#c6cbe0;
  --txt:#17162b; --dim2:#45435f; --dim:#5a5878;
  --green:#097b3e; --green-ink:#097b3e;
  --red:#c7340f;   --red-ink:#c7340f;
  --radius:10px; --radius-sm:6px;

  --accent:#5c8af5; --accent-ink:#1b5aee; --accent-fort:#104ad1;
  --accent-soft:rgba(92,138,245,.12); --accent-line:rgba(92,138,245,.30);
  /* un aplat d'accent porte du texte : il faut la version sombre, sinon
     le blanc n'y tient pas 4,5:1 */
  --sur-accent:#ffffff;

  --glass:rgba(255,255,255,.84);
  --ombre:0 16px 40px rgba(23,22,43,.13);
  --ombre-douce:0 8px 24px rgba(23,22,43,.08);
  --halo:radial-gradient(ellipse 70% 60% at 50% 0%,var(--accent-soft),transparent 70%);
  --scan:0;
  /* la trame : une pastille tous les 24 px, assez pâle pour ne rien
     changer aux contrastes, assez présente pour que le fond ne soit
     plus un aplat */
  --grain:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Ccircle cx='1.5' cy='1.5' r='1' fill='%2317162b' opacity='.055'/%3E%3C/svg%3E");
  --voile-1:rgba(27,90,238,.07); --voile-2:rgba(149,46,239,.06);
  --voile-3:rgba(10,116,133,.05); --voile-4:rgba(199,15,113,.04);

  --f-titre:'Fraunces',Georgia,serif;
  --f-ui:'Inter',system-ui,-apple-system,sans-serif;
  --f-mono:'JetBrains Mono','SFMono-Regular',Consolas,monospace;
}

/* ─── l'accent de chaque section, pris dans le spectre de la photo ──── */
.sec-accueil    {--accent:#5c8af5;--accent-ink:#1b5aee;--accent-fort:#104ad1;--accent-soft:rgba(92,138,245,.12);--accent-line:rgba(92,138,245,.30)}
.sec-dashboards {--accent:#0b97ad;--accent-ink:#0a7485;--accent-fort:#07535f;--accent-soft:rgba(11,151,173,.13);--accent-line:rgba(11,151,173,.32)}
.sec-menu       {--accent:#f25b36;--accent-ink:#c7340f;--accent-fort:#a12a0c;--accent-soft:rgba(242,91,54,.13);--accent-line:rgba(242,91,54,.32)}
.sec-logements  {--accent:#0aa352;--accent-ink:#097b3e;--accent-fort:#06552b;--accent-soft:rgba(10,163,82,.13);--accent-line:rgba(10,163,82,.32)}
/* le portfolio porte le violet de ses propres titres (#952eef) */
.sec-portfolio  {--accent:#b266f5;--accent-ink:#952eef;--accent-fort:#8111e4;--accent-soft:rgba(178,102,245,.13);--accent-line:rgba(178,102,245,.32)}
.sec-crypto     {--accent:#f349a4;--accent-ink:#c70f71;--accent-fort:#a10c5c;--accent-soft:rgba(243,73,164,.13);--accent-line:rgba(243,73,164,.32)}
.sec-inventaire {--accent:#c07e0c;--accent-ink:#8e5e0b;--accent-fort:#684508;--accent-soft:rgba(192,126,12,.14);--accent-line:rgba(192,126,12,.34)}

/* ─── jetons : thème sombre, HUD ──────────────────────────────────────
   Les jetons sont posés sur <html> AUTANT que sur <body>. Sur <body>
   seul, <html> gardait le fond clair : il ne descend pas de <body>, et
   la page se retrouvait en texte clair sur fond clair — mesuré à
   1,01:1 sur le titre. */
:root.dark-mode,
body.dark-mode{
  --bg:#080711; --bg2:#0e0d1b; --bg3:#141327;
  --line:rgba(169,165,198,.20); --line2:rgba(169,165,198,.34);
  --txt:#f0eefb; --dim2:#a9a5c6; --dim:#8d89ad;
  --green:#05bd5b; --green-ink:#05bd5b;
  --red:#fb7f60;   --red-ink:#fb7f60;

  --accent:#7ea4fc; --accent-ink:#7ea4fc; --accent-fort:#7ea4fc;
  --accent-soft:rgba(126,164,252,.15); --accent-line:rgba(126,164,252,.36);
  /* en sombre l'accent est lumineux : c'est le texte qui devient sombre */
  --sur-accent:#080711;

  --glass:rgba(14,13,27,.80);
  --ombre:0 0 36px rgba(126,164,252,.12);
  --ombre-douce:0 0 22px rgba(126,164,252,.08);
  --halo:radial-gradient(ellipse 72% 62% at 50% 0%,var(--accent-soft),transparent 72%);
  --scan:.5;
  --grain:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Ccircle cx='1.5' cy='1.5' r='1' fill='%23f0eefb' opacity='.07'/%3E%3C/svg%3E");
  /* en sombre les voiles reprennent le spectre de la photo, plus francs */
  --voile-1:rgba(126,164,252,.13); --voile-2:rgba(198,136,252,.11);
  --voile-3:rgba(5,182,209,.10);   --voile-4:rgba(251,116,188,.09);
}
body.dark-mode .sec-accueil,
body.dark-mode.sec-accueil    {--accent:#7ea4fc;--accent-ink:#7ea4fc;--accent-fort:#7ea4fc;--accent-soft:rgba(126,164,252,.15);--accent-line:rgba(126,164,252,.36)}
body.dark-mode .sec-dashboards,
body.dark-mode.sec-dashboards {--accent:#05b6d1;--accent-ink:#05b6d1;--accent-fort:#05b6d1;--accent-soft:rgba(5,182,209,.15);--accent-line:rgba(5,182,209,.36)}
body.dark-mode .sec-menu,
body.dark-mode.sec-menu       {--accent:#fb7f60;--accent-ink:#fb7f60;--accent-fort:#fb7f60;--accent-soft:rgba(251,127,96,.15);--accent-line:rgba(251,127,96,.36)}
body.dark-mode .sec-logements,
body.dark-mode.sec-logements  {--accent:#05bd5b;--accent-ink:#05bd5b;--accent-fort:#05bd5b;--accent-soft:rgba(5,189,91,.15);--accent-line:rgba(5,189,91,.36)}
body.dark-mode .sec-portfolio,
body.dark-mode.sec-portfolio  {--accent:#c688fc;--accent-ink:#c688fc;--accent-fort:#c688fc;--accent-soft:rgba(198,136,252,.15);--accent-line:rgba(198,136,252,.36)}
body.dark-mode .sec-crypto,
body.dark-mode.sec-crypto     {--accent:#fb74bc;--accent-ink:#fb74bc;--accent-fort:#fb74bc;--accent-soft:rgba(251,116,188,.15);--accent-line:rgba(251,116,188,.36)}
body.dark-mode .sec-inventaire,
body.dark-mode.sec-inventaire {--accent:#e59306;--accent-ink:#e59306;--accent-fort:#e59306;--accent-soft:rgba(229,147,6,.15);--accent-line:rgba(229,147,6,.36)}

/* ─── alias : les noms d'accent que les pages employaient déjà ──────── */
/* Ces noms servaient surtout a colorer du TEXTE dans les pages. Ils
   pointent donc sur la variante encre, pas sur l'accent vif : avec les
   couleurs de la photo, plus lumineuses que les precedentes, l'accent
   vif faisait tomber le petit texte a 3,01:1. Les variantes « 2 » et
   « 3 » gardent la version vive, pour les bordures et les survols. */
:root,:root.dark-mode,body.dark-mode{
  --gold:var(--accent-ink);   --gold2:var(--accent);
  --orange:var(--accent-ink); --orange2:var(--accent-fort); --orange3:var(--accent);
  --terra:var(--accent-ink);  --terra2:var(--accent);       --brown:var(--accent-fort);
  --purple:var(--accent-ink); --blue:var(--accent-ink);     --yellow:var(--accent-ink);
  --card:var(--bg2);          --txt2:var(--dim2);
  --shadow:var(--ombre);
}

/* Le fond de page. Il est posé sur <html> pour que la zone de rebond
   suive le thème, et non seulement la zone occupée par <body>.
   Le relief est sur <body> : quatre voiles de couleur aux quatre coins,
   et une trame de pastilles par-dessus. Les voiles ne bougent pas au
   défilement, la trame suit — ce décalage suffit à donner du relief
   sans rien animer. */
html{background:var(--bg);color-scheme:light}
:root.dark-mode{color-scheme:dark}
body{
  background-color:var(--bg);
  background-image:
    radial-gradient(ellipse 60% 44% at 4% -6%,var(--voile-1),transparent 64%),
    radial-gradient(ellipse 52% 38% at 98% 4%,var(--voile-2),transparent 66%),
    radial-gradient(ellipse 58% 40% at 50% 106%,var(--voile-3),transparent 68%),
    radial-gradient(ellipse 44% 34% at 86% 76%,var(--voile-4),transparent 66%),
    var(--grain);
  background-attachment:fixed,fixed,fixed,fixed,scroll;
  background-repeat:no-repeat,no-repeat,no-repeat,no-repeat,repeat;
}

/* ─── scanlines du HUD ──────────────────────────────────────────────── */
body::after{
  content:'';position:fixed;inset:0;z-index:9999;pointer-events:none;
  opacity:var(--scan);
  background:repeating-linear-gradient(0deg,
    rgba(255,255,255,.035) 0 1px, transparent 1px 3px);
  mix-blend-mode:screen;
}

/* ═══ le bandeau commun ═════════════════════════════════════════════ */
.site-bar{
  position:sticky;top:0;z-index:50;
  display:flex;align-items:center;gap:14px;
  padding:0 clamp(16px,3.4vw,34px);height:68px;
  border-bottom:1px solid var(--line);
  background:var(--glass);
  -webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);
}
/* le nom du site, à gauche, et il ramène à l'accueil */
.site-logo{
  font-family:var(--f-titre);font-size:1.32rem;font-weight:800;
  letter-spacing:-.02em;text-decoration:none;
  /* la variante « encre » et non l'accent vif : en teal, l'accent vif ne
     donne que 2,43:1 sur le verre du bandeau, mesuré. */
  color:var(--accent-ink);
  display:flex;align-items:baseline;gap:.1em;white-space:nowrap;
}
.site-logo b{font-weight:800;color:var(--accent-ink)}
.site-logo span{color:var(--txt);font-weight:300}
.site-logo em{
  font-style:normal;color:var(--dim);font-size:.72em;font-weight:400;
  font-family:var(--f-titre);margin-left:.45em;
}
.site-logo:hover b,.site-logo:hover span{color:var(--accent)}
.site-logo:focus-visible{outline:2px solid var(--accent);outline-offset:4px;border-radius:4px}

.site-tools{margin-left:auto;display:flex;align-items:center;gap:8px}
/* Sur les pages qui centrent tout leur contenu — les connexions — le
   bandeau serait centré comme le reste : il flotte au-dessus. */
.site-bar.flottant{position:fixed;top:0;left:0;right:0;width:100%}

/* boutons du bandeau : bascule de thème, langue, retour */
.site-btn{
  display:inline-flex;align-items:center;gap:7px;
  background:var(--bg3);border:1px solid var(--line2);color:var(--txt);
  padding:7px 12px;border-radius:var(--radius-sm);
  font-family:var(--f-ui);font-size:12px;font-weight:500;line-height:1;
  cursor:pointer;text-decoration:none;
  transition:border-color .15s,color .15s,background .15s;
}
.site-btn:hover,.site-btn:focus-visible{
  border-color:var(--accent);color:var(--accent-ink);outline:none}
.site-btn svg{width:14px;height:14px;flex:none}

/* la bascule de thème : une icône qui change avec le thème */
#theme-toggle .ico-nuit{display:block}
#theme-toggle .ico-jour{display:none}
body.dark-mode #theme-toggle .ico-nuit{display:none}
body.dark-mode #theme-toggle .ico-jour{display:block}

/* ─── le sélecteur de langue, en haut à droite et nulle part ailleurs ── */
.site-lang{position:relative}
.site-lang-pop{
  position:absolute;top:calc(100% + 8px);right:0;min-width:142px;
  background:var(--bg2);color:var(--txt);
  border:1px solid var(--line2);border-radius:var(--radius-sm);
  padding:4px 0;box-shadow:var(--ombre);
  opacity:0;pointer-events:none;transform:translateY(-4px);
  transition:opacity .13s,transform .13s;
}
.site-lang-pop.open{opacity:1;pointer-events:auto;transform:none}
.site-lang-pop a{
  display:block;padding:9px 14px;font-size:13px;color:var(--txt);
  text-decoration:none}
.site-lang-pop a:hover{background:var(--accent-soft);color:var(--accent-ink)}
.site-lang-pop a.on{font-weight:600;color:var(--accent-ink)}
.site-chev{transition:transform .2s}
[aria-expanded="true"] .site-chev{transform:rotate(180deg)}

/* ═══ le pied commun ════════════════════════════════════════════════ */
.site-pied{
  margin-top:auto;
  border-top:1px solid var(--line);
  padding:18px clamp(16px,3.4vw,34px) 22px;
  display:flex;align-items:center;gap:10px 18px;flex-wrap:wrap;
  font-family:var(--f-ui);font-size:12.5px;color:var(--dim2);
  background:var(--bg2);
}
.site-pied a{color:var(--dim2);text-decoration:none}
.site-pied a:hover{color:var(--accent-ink)}
.site-pied .site-pied-fin{margin-left:auto}

/* ─── petits écrans : le bandeau se comprime au lieu de déborder ───── */
.site-tools{min-width:0}
.site-btn{min-width:0;max-width:100%}
@media (max-width:620px){
  .site-bar{height:60px;gap:8px;padding:0 14px}
  .site-logo em{display:none}
  .site-btn-txt{display:none}
  .site-btn{padding:7px 9px;gap:5px}
}
@media (max-width:380px){
  .site-logo{font-size:1.1rem}
}

/* ─── on respecte « moins d'animations » ───────────────────────────── */
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{
    animation-duration:.001ms!important;animation-iteration-count:1!important;
    transition-duration:.001ms!important}
}
