/* ————————————————————————————————————————————————
   Chaîne et spirale — couche v10 de l’accueil réel.
   Direction 3, choisie par Alex le 30 novembre 2026, en DOUBLE MODE.
   La page, son texte, ses fonctions et ses pièces ne changent pas :
   cette feuille remappe les variables du site dans les deux modes —
   le sombre, marine très profond où la chaîne d’or attire l’œil ;
   le clair, fond lumineux et encre marine, conçu comme un vrai mode.
   Les contrastes de chaque couple texte/fond sont mesurés et
   consignés au rapport v10 (tous ≥ 4,5:1, dans les deux modes).
   ———————————————————————————————————————————————— */

/* ===== LE CLAIR — fond lumineux propre, encre marine, or assombri ===== */
html:not([data-theme="sombre"]){
  --fond:#F4F7F9 !important; --fond2:#E8EEF2 !important;
  --carte:#FFFFFF !important; --carte2:#EFF4F7 !important;
  --puit:#E6EDF2 !important; --puit2:#F0F4F7 !important;
  --barre:rgba(246,249,250,.92) !important;
  --noeud:#FFFFFF !important; --face:#EAF1F5 !important;
  --ligne:#B7C8D4 !important; --filet-fort:#0E3A5C !important;
  --vert:#0E7A54 !important; --vert-doux:#0A5C3F !important;
  --or:#7A5C00 !important; --or-clair:#664D00 !important; --or-decor:#7A5C00 !important;
  --texte:#0B2136 !important; --texte-doux:#42596B !important;
  --encre:#0B2136 !important; --encre2:#42596B !important;
  --encre-sur-or:#FFFFFF !important; --encre-foncee:#0A141F !important;
  --ombre:rgba(11,33,54,.14) !important; --ligne-douce:rgba(11,33,54,.12) !important;
  --rouge:#B3271E !important;
  --verre:rgba(255,255,255,.55) !important;
  --vitre:rgba(244,247,249,.82) !important; --vitre-txt:#0B2136 !important; --vitre-txt2:#42596B !important;
  --sophia-creme:#F4F7F9 !important; --sophia-encre:#0B2136 !important;
  --sophia-or:#7A5C00 !important; --sophia-or-doux:#DCE6EC !important; --sophia-gris:#42596B !important;
  --rv-papier:#F4F7F9 !important; --rv-encre:#0B2136 !important;
  --rv-vermillon:#7A5C00 !important; --rv-vermillon-fonce:#664D00 !important;
  --filet-double:#0B2136 !important;
  --sp-ligne:#42596B !important; --sp-noeud:#7A5C00 !important; --sp-courant:#664D00 !important;
}
html:not([data-theme="sombre"]) .b5w{
  --fond:#F4F7F9 !important; --fond2:#E8EEF2 !important;
  --encre:#0B2136 !important; --encre2:#42596B !important;
  --or:#7A5C00 !important; --or2:#664D00 !important;
  --ligne:rgba(18,62,99,.35) !important;
  --vitre:rgba(244,247,249,.88) !important; --vitre-txt:#0B2136 !important; --vitre-txt2:#42596B !important;
  --verre:rgba(255,255,255,.55) !important;
}

/* ===== LE SOMBRE — marine très profond, la chaîne attire, le reste se calme ===== */
html[data-theme="sombre"]{
  --fond:#081A2C !important; --fond2:#0B2138 !important;
  --carte:#0E2A44 !important; --carte2:#0B2239 !important;
  --puit:#05101D !important; --puit2:#0D2742 !important;
  --barre:rgba(7,22,38,.92) !important;
  --noeud:#102C49 !important; --face:#0D2742 !important;
  --ligne:#33536F !important; --filet-fort:#E6C86A !important;
  --vert:#3ECF8E !important; --vert-doux:#7BD8AE !important;
  --or:#C9A227 !important; --or-clair:#E6C86A !important; --or-decor:#C9A227 !important;
  --texte:#EEF4F8 !important; --texte-doux:#ABC2D6 !important;
  --encre:#EEF4F8 !important; --encre2:#ABC2D6 !important;
  --encre-sur-or:#171106 !important; --encre-foncee:#0A141F !important;
  --ombre:rgba(2,8,16,.55) !important; --ligne-douce:rgba(238,244,248,.13) !important;
  --rouge:#FF9B8A !important;
  --verre:rgba(10,28,46,.55) !important;
  --vitre:rgba(10,28,46,.78) !important; --vitre-txt:#F2F7FA !important; --vitre-txt2:#B9CFE0 !important;
  --sophia-creme:#081A2C !important; --sophia-encre:#EEF4F8 !important;
  --sophia-or:#C9A227 !important; --sophia-or-doux:#14334F !important; --sophia-gris:#ABC2D6 !important;
  --rv-papier:#081A2C !important; --rv-encre:#EEF4F8 !important;
  --rv-vermillon:#C9A227 !important; --rv-vermillon-fonce:#E6C86A !important;
  --filet-double:#C9A227 !important;
  --sp-ligne:#ABC2D6 !important; --sp-noeud:#C9A227 !important; --sp-courant:#E6C86A !important;
}
html[data-theme="sombre"] .b5w{
  --fond:#081A2C !important; --fond2:#0B2138 !important;
  --encre:#EEF4F8 !important; --encre2:#ABC2D6 !important;
  --or:#C9A227 !important; --or2:#E6C86A !important;
  --ligne:rgba(201,162,39,.4) !important;
  --vitre:rgba(8,26,44,.84) !important; --vitre-txt:#EEF4F8 !important; --vitre-txt2:#ABC2D6 !important;
  --verre:rgba(255,255,255,.07) !important;
}

/* ===== Le champ de l’ouverture : la profondeur marine, dosée =====
   Le dégradé n’existe qu’ici, comme une eau profonde sous l’ouverture —
   jamais sur une surface de lecture, jamais sur une carte. */
body{background-color:var(--fond) !important}
html:not([data-theme="sombre"]) body{
  background-image:
    radial-gradient(1100px 620px at 82% -6%, rgba(201,162,39,.09), transparent 60%),
    radial-gradient(950px 700px at 50% -12%, rgba(18,62,99,.07), transparent 65%) !important;
}
html[data-theme="sombre"] body{
  background-image:
    radial-gradient(1100px 620px at 82% -6%, rgba(201,162,39,.12), transparent 60%),
    radial-gradient(950px 720px at 50% -12%, rgba(46,96,138,.38), transparent 66%) !important;
}

/* ===== La spirale du site, re-cadrée sur l’ouverture =====
   Le canevas #spirale de la page n’est ni supprimé ni laissé en
   filigrane sur tout le défilement : il devient le fond de l’ouverture
   (la première hauteur d’écran), fondu avant la première zone de lecture. */
#spirale{
  position:absolute !important; inset:auto !important;
  top:0 !important; left:0 !important; width:100% !important;
  height:min(96vh,920px) !important; z-index:0 !important;
  -webkit-mask-image:linear-gradient(180deg,#000 60%,transparent 97%);
  mask-image:linear-gradient(180deg,#000 60%,transparent 97%);
}
html:not([data-theme="sombre"]) #spirale{opacity:.16 !important}
html[data-theme="sombre"] #spirale{opacity:.5 !important}

/* ===== Le bandeau v10 : la signature au-dessus de l’ouverture ===== */
.bandeau10{
  position:relative; z-index:2;
  max-width:1120px; margin:0 auto; padding:12px 20px 0;
}
.bandeau10-ligne{
  display:flex; align-items:center; gap:15px; flex-wrap:wrap;
  font-family:-apple-system,BlinkMacSystemFont,"Helvetica Neue",Helvetica,"Segoe UI",Arial,sans-serif;
  font-size:12.5px; letter-spacing:.14em; text-transform:uppercase; color:var(--texte);
}
.bandeau10 .nom{font-weight:700}
.bandeau10 .lieu{color:var(--texte-doux); letter-spacing:.08em}
.bandeau10 .spirale-signature{width:56px; height:44px; flex:none}
.double-filet10{
  border:0; height:4px; margin:10px 0 0;
  border-top:3px solid var(--filet-double); border-bottom:1px solid var(--ligne);
}

/* La spirale φ dessinée — treize maillons, le rayon ×φ par quart de tour.
   Elle se trace une fois à l’ouverture, puis elle se tient tranquille. */
.spirale-signature .sp-chaine{
  fill:none; stroke:var(--sp-ligne); stroke-width:1.7; opacity:.65;
  stroke-dasharray:1; stroke-dashoffset:1;
  animation:sp-trace 2.4s ease forwards .2s;
}
.spirale-signature .sp-noeud{
  fill:var(--sp-noeud); opacity:0;
  animation:sp-noeud .45s ease forwards;
  animation-delay:calc(.3s + var(--d)*.14s);
}
.spirale-signature .sp-noeud.sp-courant{fill:var(--sp-courant)}
.spirale-signature .sp-halo{
  fill:none; stroke:var(--sp-courant); stroke-width:1.1; opacity:0;
  animation:sp-noeud .9s ease forwards; animation-delay:2.3s;
}
@keyframes sp-trace{to{stroke-dashoffset:0}}
@keyframes sp-noeud{to{opacity:1}}

/* ===== Les actions : une pleine (l’or), le reste en renvois bordés ===== */
a[style*="background:#b8860b"],a[style*="background:#B8860B"]{
  background:var(--or) !important; color:var(--encre-sur-or) !important;
}
a[style*="border:1px solid #b8860b"],a[style*="border:1px solid #B8860B"]{
  background:transparent !important; color:var(--or-clair) !important; border-color:var(--or) !important;
}
/* Le texte hérité suit le mode : une feuille embarquée dans une pièce
   de la page figeait le corps entier en quasi-noir (#111) — invisible
   sur le marine pour tout texte sans couleur propre (la marque, etc.). */
body{color:var(--texte) !important}

/* Le panneau « Commencer en 5 secondes » : la v8 le voulait « carte
   claire aux deux thèmes » (theme-sophia-v8.css) — ses deux thèmes
   étaient clairs. En v10, il suit le mode ; son filet d'or, qui fait
   son identité, est conservé dans les deux modes. */
#commencer-5-secondes{
  background:var(--carte) !important; color:var(--texte) !important;
  border-color:var(--or) !important;
}

div[style*="fffdf4"],section[style*="fffdf4"]{background:var(--carte) !important; color:var(--texte) !important; border-color:var(--ligne) !important}
.barre-actions,header{flex-wrap:wrap !important}

nav.onglets button, .onglets button, nav.onglets a.porte-lien{
  background:var(--carte) !important; background-image:none !important;
  color:var(--texte) !important; border-color:var(--ligne) !important;
}
nav.onglets button:hover, .onglets button:hover, nav.onglets a.porte-lien:hover{
  background:var(--puit2) !important; border-color:var(--or) !important;
}
nav.onglets button.actif, .sceptique-choix button.actif, .vue-choix button.actif,
button.action{
  background:var(--or) !important; background-image:none !important;
  color:var(--encre-sur-or) !important; border-color:var(--or) !important;
}
button.secondaire{color:var(--vert-doux) !important; border-color:var(--ligne) !important}

/* ===== Surfaces nommées : la peau suit les variables, la profondeur reste ===== */
.rail-arbre{background:var(--carte) !important; border-color:var(--ligne) !important}
.rail-arbre .etiquette{color:var(--texte) !important; background:none !important; border-color:var(--filet-fort) !important}
.arbre-menu-titre{color:var(--texte) !important}
.carte-compteur{background:var(--carte) !important; background-image:none !important; border-color:var(--ligne) !important}
.cc-nombre{color:var(--or-clair) !important}
.cc-quoi{color:var(--texte-doux) !important}
.b53-banniere{background:var(--carte) !important; background-image:none !important; border-color:var(--ligne) !important}
.b53-seg{background:var(--carte) !important; background-image:none !important; border-color:var(--ligne) !important; color:var(--texte) !important}
.b53-seg-etiquette{color:var(--texte-doux) !important}
.b53-seg-valeur{color:var(--texte) !important}
.b53-seg-detail{color:var(--texte-doux) !important}
.piece52{background:var(--carte) !important; border-color:var(--ligne) !important; border-left:3px solid var(--or) !important}
.piece52 .piece52-date{color:var(--texte-doux) !important}
.frise52 h3,.frise52 .quand{color:var(--texte) !important}
.carte-geste,.actu-item,.menu-entree{
  background:var(--carte) !important; background-image:none !important; border-color:var(--ligne) !important;
}

/* ===== Liens, code, sélection : les trois voix du système ===== */
a{color:var(--or-clair) !important}
a:hover{color:var(--or) !important}
code{background:var(--puit) !important; color:inherit !important}
html:not([data-theme="sombre"]) ::selection{background:#CFE0EC; color:#0B2136}
html[data-theme="sombre"] ::selection{background:#C9A227; color:#081A2C}

/* En-tête mobile : les actions passent sous la marque, sans collision */
@media (max-width:820px){
  .barre-actions{position:static !important; display:flex !important; flex-wrap:wrap; gap:.4rem; justify-content:flex-end; margin-top:.4rem}
  .bandeau10 .spirale-signature{width:46px; height:37px}
}
@media (prefers-reduced-motion:reduce){
  .spirale-signature .sp-chaine{animation:none !important; stroke-dashoffset:0 !important}
  .spirale-signature .sp-noeud,.spirale-signature .sp-halo{animation:none !important; opacity:1 !important}
}
