/* ===== Humeurs du classeur, deuxième fournée =====
   Matrix, télé CRT, plan d'archi, Gameboy, néon 80s, papier journal, post-it, Metal Gear.
   Classes mood-* posées par js/a11y-early.js ; effets animés (pluie, allumage, chaînes…) dans js/humeurs.js.
   Night City garde la main partout (:not(.nc)). */

.mood-layer { position: fixed; inset: 0; pointer-events: none; }
@media print { .mood-layer, .mood-masthead { display: none !important; } }

/* ---------- Matrix : écran phosphore vert, pluie de caractères discrète, titres qui se décodent ---------- */
html.mood-matrix:not(.nc) { filter: url(#mood-f-matrix); background: var(--paper); }
/* Fond porté par <html> : la pluie (z-index -1) passe alors devant le papier */
html.mood-matrix:not(.nc) body { background: transparent; }
/* Avant le filtre, une ombre foncée devient une lueur verte */
html.mood-matrix:not(.nc) body { text-shadow: 0 0 5px rgba(0, 0, 0, .28); }
html.mood-matrix:not(.nc) :is(.big, .section-title, .tab b, .tile b, .stat b) { text-shadow: 0 0 10px rgba(0, 0, 0, .45), -3px 2px 0 rgba(0, 0, 0, .25); }
html.mood-matrix:not(.nc) body::before { opacity: .35; }
.mood-rain { z-index: -1; width: 100%; height: 100%; opacity: .7; }
.mood-rain.intro { z-index: 2147482000; opacity: 1; animation: moodRainOut .35s 1.5s forwards; }
@keyframes moodRainOut { to { opacity: 0; } }
/* Le code coule derrière le classeur : les grands panneaux deviennent un peu transparents */
html.mood-matrix:not(.nc) .panel { background-color: color-mix(in srgb, var(--c) 72%, transparent); }
html.mood-matrix:not(.nc) .lede::after { content: "▌"; margin-left: 4px; animation: moodCaret 1s steps(2) infinite; }
@keyframes moodCaret { 50% { opacity: 0; } }

/* ---------- Télé CRT : balayage, coins arrondis du tube, franges de couleur, allumage et chaînes ---------- */
html.mood-crt:not(.nc) body { text-shadow: .7px 0 rgba(255, 0, 60, .28), -.7px 0 rgba(0, 190, 255, .28); }
html.mood-crt:not(.nc) .mood-crt-tube { z-index: 2147482000; }
.mood-crt-tube::before { /* lignes de balayage + scintillement */
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(rgba(10, 8, 20, .13) 0 1px, transparent 1px 3px);
  animation: moodFlicker 4s steps(40) infinite;
}
.mood-crt-tube::after { /* verre bombé : vignette et coins noirs */
  content: ""; position: absolute; inset: 0; border-radius: 34px / 26px;
  box-shadow: 0 0 0 60px #0d0b12, inset 0 0 90px rgba(10, 8, 20, .5), inset 0 0 18px rgba(10, 8, 20, .45);
  background: radial-gradient(120% 90% at 50% 40%, rgba(255, 255, 255, .07), transparent 60%);
}
.mood-crt-bar { position: absolute; left: 0; right: 0; height: 18vh; top: -20vh;
  background: linear-gradient(transparent, rgba(255, 255, 255, .06) 45%, rgba(255, 255, 255, .1) 50%, transparent);
  animation: moodRoll 7s linear infinite; }
@keyframes moodFlicker { 0%, 100% { opacity: 1; } 50% { opacity: .82; } 51% { opacity: 1; } 77% { opacity: .9; } }
@keyframes moodRoll { to { transform: translateY(140vh); } }
.mood-crt-osd { position: fixed; inset: 34px 46px auto auto; z-index: 2147482001; pointer-events: none;
  font: 700 26px/1.1 "Share Tech Mono", ui-monospace, monospace; color: #6dff8a; letter-spacing: .06em;
  text-shadow: 0 0 6px #22ff66, 2px 2px 0 #0b3d17; text-transform: uppercase; opacity: 0; transition: opacity .2s; }
.mood-crt-osd.on { opacity: 1; }
.mood-crt-osd small { display: block; font-size: 15px; }
.mood-crt-snow { position: fixed; inset: -40px; z-index: 2147481999; pointer-events: none; opacity: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.mood-crt-snow.on { animation: moodSnow .35s steps(6); }
@keyframes moodSnow { 0% { opacity: .85; transform: translate(0, 0); } 50% { opacity: .6; transform: translate(-20px, 14px); } 100% { opacity: 0; transform: translate(12px, -8px); } }
/* Allumage : le tube part d'une ligne blanche */
html.mood-crt.crt-booting { background: #0d0b12; }
html.mood-crt.crt-booting body { animation: moodCrtOn .75s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes moodCrtOn {
  0% { transform: scale(.5, .003); filter: brightness(6) saturate(0); }
  35% { transform: scale(1, .006); filter: brightness(4) saturate(0); }
  70% { transform: scale(1, 1.03); filter: brightness(1.4); }
  100% { transform: none; filter: none; }
}

/* ---------- Plan d'archi : papier bleu, quadrillage, cartouche ---------- */
html.mood-plan:not(.nc) { filter: url(#mood-f-plan); background: #fff; }
html.mood-plan:not(.nc) body::before, html.mood-plan:not(.nc) .panel::before {
  background-image:
    linear-gradient(rgba(23, 20, 31, .2) 1.5px, transparent 1.5px), linear-gradient(90deg, rgba(23, 20, 31, .2) 1.5px, transparent 1.5px),
    linear-gradient(rgba(23, 20, 31, .09) 1px, transparent 1px), linear-gradient(90deg, rgba(23, 20, 31, .09) 1px, transparent 1px);
  background-size: 70px 70px, 70px 70px, 14px 14px, 14px 14px;
}
html.mood-plan:not(.nc) :is(.card, .tile, .job, .box, .stat, .svc-cat, .skill-group, .contact-card, .legal-card, .panel, .below, .section-title) { border-style: dashed; }
html.mood-plan:not(.nc) :is(.big, .section-title) { letter-spacing: .02em; text-shadow: none; }
/* Cotes autour du grand titre */
html.mood-plan:not(.nc) .big { position: relative; }
html.mood-plan:not(.nc) .big::after {
  content: "← " attr(data-cote) " →"; position: absolute; left: 0; right: 0; bottom: -18px; display: block; text-align: center;
  font: 600 11px/1 ui-monospace, monospace; font-style: normal; letter-spacing: .1em; text-transform: none;
  border-top: 1.5px solid currentColor; padding-top: 3px; opacity: .8;
}
.mood-cartouche { position: fixed; inset: auto 14px 14px auto; z-index: 60; pointer-events: none; display: grid; grid-template-columns: auto auto;
  border: 2px solid #17141f; background: #fdf3e3; color: #17141f; font: 600 10.5px/1.25 ui-monospace, monospace; text-transform: uppercase; }
.mood-cartouche span { padding: 4px 8px; border: 1px solid #17141f; }
.mood-cartouche b { grid-column: 1 / -1; padding: 6px 8px; border: 1px solid #17141f; font: italic 900 14px/1 var(--display); }
@media (max-width: 640px) { .mood-cartouche { display: none; } }

/* ---------- Gameboy : 4 teintes de vert, pixels, démarrage ---------- */
html.mood-gameboy:not(.nc) { filter: url(#mood-f-gameboy); background: #fff; }
html.mood-gameboy:not(.nc) img { image-rendering: pixelated; }
html.mood-gameboy:not(.nc) :is(.card, .tile, .job, .box, .stat, .svc-cat, .skill-group, .contact-card, .legal-card, .pill, .btn, .tab, .chip, .subtab) {
  border-radius: 0 !important;
  clip-path: polygon(0 4px, 4px 4px, 4px 0, calc(100% - 4px) 0, calc(100% - 4px) 4px, 100% 4px, 100% calc(100% - 4px), calc(100% - 4px) calc(100% - 4px), calc(100% - 4px) 100%, 4px 100%, 4px calc(100% - 4px), 0 calc(100% - 4px));
}
html.mood-gameboy:not(.nc) :is(.card, .tile, .job, .box, .stat, .svc-cat, .skill-group, .contact-card, .legal-card) { box-shadow: none; outline: 4px solid rgba(23, 20, 31, .55); outline-offset: 2px; }
.mood-lcd { z-index: 2147482000;
  background: linear-gradient(90deg, rgba(23, 20, 31, .06) 1px, transparent 1px) 0 0 / 3px 3px, linear-gradient(rgba(23, 20, 31, .06) 1px, transparent 1px) 0 0 / 3px 3px; }
.mood-gb-boot { position: fixed; inset: 0; z-index: 2147482500; display: grid; place-items: center; background: #fff; pointer-events: none;
  animation: moodGbOut .4s 1.9s forwards; }
.mood-gb-boot b { font: italic 900 clamp(34px, 9vw, 70px)/1 var(--display); letter-spacing: .04em; color: #17141f; animation: moodGbDrop 1.3s steps(14) both; }
.mood-gb-boot b sup { font-size: .35em; }
@keyframes moodGbDrop { from { transform: translateY(-45vh); } }
@keyframes moodGbOut { to { opacity: 0; } }

/* ---------- Néon 80s : nuit violette, néons qui grésillent, grille synthwave ---------- */
html.mood-neon:not(.nc) {
  /* Valeurs choisies AVANT le négatif : le papier lavande devient violet nuit, les teintes sombres deviennent néon */
  --paper: #f3e6ff; --ink: #17141f; --ink-soft: #2e2541;
  --blue: #c4ecff; --yellow: #fff0b0; --green: #c4f5da; --orange: #ffd6bd; --pink: #ffcdea; --red: #ffc4d2; --violet: #e3d2ff;
  --neon-a: #8a0058; --neon-b: #005c7a;
  filter: invert(.95) hue-rotate(180deg) saturate(1.7) contrast(1.05); background: #fff;
}
html.mood-neon:not(.nc) :is(img:not(.portrait-frame img), video, canvas, .portrait-frame, .mascot, .mood-synth) { filter: invert(1) hue-rotate(180deg); }
html.mood-neon:not(.nc) :is(.big, .section-title, .tab b, .tile b) { text-shadow: 0 0 6px var(--neon-a), 0 0 16px var(--neon-a), -3px 2px 0 var(--neon-b); }
html.mood-neon:not(.nc) .big { animation: moodBuzz 6s infinite; }
@keyframes moodBuzz { 0%, 91%, 93%, 96%, 100% { opacity: 1; } 92%, 95% { opacity: .45; } }
html.mood-neon:not(.nc) :is(.card, .tile, .job, .box, .svc-cat, .skill-group, .contact-card, .legal-card) { box-shadow: 0 0 0 1px var(--neon-b), 0 0 16px var(--neon-b), 6px 6px 0 var(--neon-a); }
.mood-synth { position: fixed; inset: auto 0 0 0; height: 32vh; z-index: -1; pointer-events: none; overflow: hidden; perspective: 260px; }
.mood-synth::before { content: ""; position: absolute; left: -50%; right: -50%; top: 0; height: 200%; transform: rotateX(62deg); transform-origin: top;
  background: linear-gradient(transparent 0 95%, rgba(255, 60, 200, .55) 95%) 0 0 / 100% 46px, linear-gradient(90deg, transparent 0 96%, rgba(80, 230, 255, .5) 96%) 0 0 / 46px 100%;
  animation: moodGrid 1.6s linear infinite; }
.mood-synth::after { content: ""; position: absolute; inset: 0; background: linear-gradient(#1b0b33, rgba(27, 11, 51, 0) 45%); }
@keyframes moodGrid { to { background-position: 0 46px, 0 0; } }

/* ---------- Papier journal : noir et blanc, serif, colonnes, photo tramée ---------- */
html.mood-journal:not(.nc):not(.a11y-contrast) {
  --paper: #f3efe4; --ink: #111; --ink-soft: #2b2b2b;
  --blue: #e3dfd3; --yellow: #ebe6d8; --green: #dcd8cc; --orange: #e6e1d4; --pink: #d6d1c4; --red: #cfc9bb; --violet: #e0dcd0;
  --display: Georgia, "Times New Roman", Times, serif; --body: Georgia, "Times New Roman", Times, serif;
}
html.mood-journal:not(.nc) { filter: grayscale(1); }
html.mood-journal:not(.nc) body::before, html.mood-journal:not(.nc) .panel::before { opacity: .25; }
html.mood-journal:not(.nc) :is(.big, .section-title, .tab b, .tile b, .card h3, .job h3, .stat b, .box-head) { font-style: normal; text-shadow: none; letter-spacing: -.01em; }
html.mood-journal:not(.nc) .big { font-weight: 900; text-transform: none; }
html.mood-journal:not(.nc) :is(.card, .tile, .job, .box, .stat, .svc-cat, .skill-group, .contact-card, .legal-card) { box-shadow: none; border-width: 1px; border-top-width: 3px; }
html.mood-journal:not(.nc) .lede::first-letter { float: left; margin: 4px 8px 0 0; font: 900 3.4em/.8 Georgia, serif; }
@media (min-width: 900px) {
  html.mood-journal:not(.nc) :is(.legal-card, .box-body) { column-count: 2; column-gap: 26px; column-rule: 1px solid #111; }
  html.mood-journal:not(.nc) .job ul { column-count: 2; column-gap: 22px; }
}
html.mood-journal:not(.nc) :is(.portrait-frame img, .tile img, .room-teaser img) {
  filter: grayscale(1) contrast(1.5) !important;
  -webkit-mask: radial-gradient(circle, #000 58%, transparent 66%) 0 0 / 4px 4px; mask: radial-gradient(circle, #000 58%, transparent 66%) 0 0 / 4px 4px;
}
.mood-masthead { position: relative; z-index: 5; margin: 0 auto; padding: 10px clamp(16px, 3vw, 40px) 0; max-width: 1400px; color: #111; text-align: center;
  font-family: Georgia, "Times New Roman", serif; }
.mood-masthead b { display: block; padding: 6px 0 4px; border-block: 3px double #111; font: 900 clamp(26px, 5.5vw, 54px)/1 "Old English Text MT", "UnifrakturMaguntia", Georgia, serif; letter-spacing: .01em; }
.mood-masthead small { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px solid #111; font-size: 12px; font-style: italic; }

/* ---------- Post-it : tableau en liège, notes collées de travers ---------- */
html.mood-postit:not(.nc):not(.a11y-contrast) { --paper: #c69c6d; --ink: #2a1d12; --ink-soft: #4a3828; }
html.mood-postit:not(.nc) body::before {
  background-image: radial-gradient(rgba(70, 40, 15, .5) 1.2px, transparent 1.8px), radial-gradient(rgba(255, 235, 200, .35) 1px, transparent 1.6px), radial-gradient(rgba(90, 55, 25, .4) 2px, transparent 2.6px);
  background-size: 11px 13px, 17px 7px, 29px 23px; background-position: 0 0, 5px 3px, 9px 14px;
}
html.mood-postit:not(.nc) :is(.card, .tile, .job, .stat, .svc-cat, .skill-group, .contact-card, .legal-card, .box, .egg-card) {
  --note: #fff27a; position: relative; border: 0 !important; border-radius: 2px 2px 14px 2px / 2px 2px 6px 2px;
  background: linear-gradient(170deg, rgba(255, 255, 255, .35), transparent 40%), var(--note) !important; color: #2a1d12;
  box-shadow: 0 14px 16px -12px rgba(0, 0, 0, .55), 0 1px 2px rgba(0, 0, 0, .2) !important; transform: rotate(-1.4deg);
  transition: transform .2s;
}
html.mood-postit:not(.nc) :is(.card, .tile, .job, .stat, .svc-cat, .skill-group, .contact-card, .legal-card, .box, .egg-card):nth-child(4n+2) { --note: #ffb3d1; transform: rotate(1.2deg); }
html.mood-postit:not(.nc) :is(.card, .tile, .job, .stat, .svc-cat, .skill-group, .contact-card, .legal-card, .box, .egg-card):nth-child(4n+3) { --note: #a8f0c0; transform: rotate(-.6deg); }
html.mood-postit:not(.nc) :is(.card, .tile, .job, .stat, .svc-cat, .skill-group, .contact-card, .legal-card, .box, .egg-card):nth-child(4n) { --note: #a9dcff; transform: rotate(1.8deg); }
html.mood-postit:not(.nc) :is(.card, .tile, .job, .stat, .svc-cat, .skill-group, .contact-card, .legal-card, .box, .egg-card):hover { transform: rotate(0) scale(1.02); z-index: 2; }
html.mood-postit:not(.nc) :is(.card, .tile, .job, .stat, .svc-cat, .skill-group, .contact-card, .legal-card, .box, .egg-card)::before {
  content: ""; position: absolute; z-index: 3; top: -11px; left: calc(50% - 38px); width: 76px; height: 22px; transform: rotate(-3deg);
  background: rgba(255, 255, 240, .55); border-left: 2px dotted rgba(0, 0, 0, .12); border-right: 2px dotted rgba(0, 0, 0, .12);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .15);
}
html.mood-postit:not(.nc) :is(.card h3, .job h3, .tile b, .stat b, .svc-cat h3, .skill-group h3, .box-head) {
  font-family: "Segoe Print", "Bradley Hand", "Marker Felt", "Comic Sans MS", cursive; font-style: normal; text-transform: none; text-shadow: none;
}
html.mood-postit:not(.nc) .panel { box-shadow: 0 22px 26px -18px rgba(0, 0, 0, .6); }
html.mood-postit:not(.nc) .panel::after { /* punaise */
  content: ""; position: absolute; z-index: 4; top: 8px; left: calc(50% - 11px); width: 22px; height: 22px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff9b9b, #d01c2a 55%, #7a0a12); box-shadow: 2px 4px 4px rgba(0, 0, 0, .45);
}

/* ---------- Metal Gear : lavis olive et encre noire sur papier blanc cassé, grain, alerte « ! » ---------- */
html.mood-metalgear:not(.nc):not(.a11y-contrast) {
  --paper: #eeebe1; --ink: #12130e; --ink-soft: #34372a;
  --blue: #8f9c62; --yellow: #a9ae80; --green: #7d8c52; --orange: #5f6b3c; --pink: #a39f80; --red: #9b2f22; --violet: #8b9278;
}
html.mood-metalgear:not(.nc) {
  --mg-wash: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1600 900' preserveAspectRatio='xMidYMid slice'%3E %3Cfilter id='b' x='-20%25' y='-20%25' width='140%25' height='140%25'%3E %3CfeTurbulence type='fractalNoise' baseFrequency='.008 .03' numOctaves='3' seed='3' result='n'/%3E %3CfeDisplacementMap in='SourceGraphic' in2='n' scale='90' xChannelSelector='R' yChannelSelector='G' result='d'/%3E %3CfeTurbulence type='fractalNoise' baseFrequency='.003 .22' numOctaves='2' seed='8' result='s'/%3E %3CfeColorMatrix in='s' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1.7 1.75' result='a'/%3E %3CfeComposite in='d' in2='a' operator='in'/%3E %3C/filter%3E %3Cg filter='url(%23b)' transform='rotate(-24 800 450)'%3E %3Cpath d='M760 -80 L1720 -40 L1700 300 L900 330 Z' fill-opacity='.85'/%3E %3Cpath d='M980 360 L1760 330 L1760 620 L1100 600 Z' fill-opacity='.6'/%3E %3Cpath d='M-120 120 L520 90 L560 330 L-140 380 Z' fill-opacity='.55'/%3E %3Cpath d='M200 640 L980 600 L1000 760 L260 820 Z' fill-opacity='.5'/%3E %3Cpath d='M1200 700 L1800 680 L1780 980 L1250 960 Z' fill-opacity='.75'/%3E %3Cpath d='M-80 520 L300 500 L320 560 L-60 590 Z' fill-opacity='.7'/%3E %3C/g%3E%3C/svg%3E");
  --mg-ink: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1600 900' preserveAspectRatio='xMidYMid slice'%3E %3Cfilter id='k' x='-20%25' y='-20%25' width='140%25' height='140%25'%3E %3CfeTurbulence type='fractalNoise' baseFrequency='.01 .05' numOctaves='3' seed='11' result='n'/%3E %3CfeDisplacementMap in='SourceGraphic' in2='n' scale='40' xChannelSelector='R' yChannelSelector='G' result='d'/%3E %3CfeTurbulence type='fractalNoise' baseFrequency='.002 .35' numOctaves='2' seed='4' result='s'/%3E %3CfeColorMatrix in='s' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -3.2 2.1' result='a'/%3E %3CfeComposite in='d' in2='a' operator='in'/%3E %3C/filter%3E %3Cg filter='url(%23k)' fill='%2312130e' transform='rotate(-24 800 450)'%3E %3Cpath d='M1000 250 L1700 210 L1700 236 L1040 268 Z' fill-opacity='.55'/%3E %3Cpath d='M1150 560 L1750 540 L1750 556 L1180 572 Z' fill-opacity='.45'/%3E %3Cpath d='M-100 345 L470 320 L480 334 L-90 362 Z' fill-opacity='.4'/%3E %3Cpath d='M300 770 L900 735 L905 748 L320 784 Z' fill-opacity='.35'/%3E %3C/g%3E%3C/svg%3E");
  --mg-streak: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='300' viewBox='0 0 600 300' preserveAspectRatio='none'%3E %3Cfilter id='s' x='0' y='0' width='100%25' height='100%25'%3E %3CfeTurbulence type='fractalNoise' baseFrequency='.004 .16' numOctaves='2' seed='5'/%3E %3CfeColorMatrix type='matrix' values='0 0 0 0 .07 0 0 0 0 .07 0 0 0 0 .05 0 0 0 -2.4 1.35'/%3E %3C/filter%3E %3Crect width='600' height='300' filter='url(%23s)'/%3E%3C/svg%3E");
  --mg-stroke: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 60' preserveAspectRatio='none'%3E %3Cfilter id='r' x='-5%25' y='-30%25' width='110%25' height='160%25'%3E %3CfeTurbulence type='fractalNoise' baseFrequency='.02 .2' numOctaves='2' seed='2' result='n'/%3E %3CfeDisplacementMap in='SourceGraphic' in2='n' scale='14' xChannelSelector='R' yChannelSelector='G' result='d'/%3E %3CfeTurbulence type='fractalNoise' baseFrequency='.002 .5' seed='7' result='s'/%3E %3CfeColorMatrix in='s' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -3 2.2' result='a'/%3E %3CfeComposite in='d' in2='a' operator='in'/%3E%3C/filter%3E %3Cpath filter='url(%23r)' d='M8 34 Q120 14 392 20 L384 44 Q200 40 14 52 Z'/%3E%3C/svg%3E");
}
/* Papier : plus de points qui glissent, un grain fixe par-dessus tout */
html.mood-metalgear:not(.nc) body::before, html.mood-metalgear:not(.nc) .panel::before { display: none; }
html.mood-metalgear:not(.nc)::after {
  content: ""; position: fixed; inset: 0; z-index: 2147481000; pointer-events: none; opacity: .5; mix-blend-mode: multiply;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E %3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E %3CfeColorMatrix type='matrix' values='0 0 0 0 .2 0 0 0 0 .2 0 0 0 0 .14 0 0 0 -1.6 1.05'/%3E%3C/filter%3E %3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}
/* Panneaux : papier, et de grands coups de lavis dans la couleur de l'onglet */
html.mood-metalgear:not(.nc) .panel { background: var(--mg-ink) center / cover no-repeat, var(--paper); }
html.mood-metalgear:not(.nc) .panel::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: var(--c); opacity: .85; mix-blend-mode: multiply;
  -webkit-mask: var(--mg-wash) center / cover no-repeat; mask: var(--mg-wash) center / cover no-repeat;
}
/* Intercalaires et boutons : aplat olive strié au pinceau sec */
html.mood-metalgear:not(.nc) :is(.tab, .pill.cta, .chip, .label) { background-image: var(--mg-streak); background-size: 100% 100%; }
html.mood-metalgear:not(.nc) .tab { background-color: var(--c); }
/* Encre : titres noirs, ombre portée en lavis au lieu d'un aplat */
html.mood-metalgear:not(.nc) .big { text-shadow: -5px 4px 0 color-mix(in srgb, var(--orange) 55%, transparent); letter-spacing: -.03em; }
html.mood-metalgear:not(.nc) :is(.section-title, .logo span) { text-shadow: -3px 2px 0 color-mix(in srgb, var(--green) 70%, transparent); }
html.mood-metalgear:not(.nc) .section-title { padding: 0 10px 4px 2px; background: var(--mg-stroke) 0 100% / 100% 14px no-repeat; }
/* Fiches : papier, bord encre, ombre en lavis */
html.mood-metalgear:not(.nc) :is(.card, .tile, .job, .box, .stat, .svc-cat, .skill-group, .contact-card, .legal-card) {
  background-color: #f6f4ec; box-shadow: 6px 6px 0 color-mix(in srgb, var(--ink) 78%, var(--green));
}
html.mood-metalgear:not(.nc) :is(.pill, .btn) { box-shadow: 3px 3px 0 var(--ink); }
html.mood-metalgear:not(.nc) .btn { background: var(--ink); color: var(--paper); }
/* Photos : lavis olive et noir */
html.mood-metalgear:not(.nc) :is(.tile img, .room-teaser img) { filter: grayscale(1) sepia(.55) hue-rotate(28deg) saturate(1.25) contrast(1.3) brightness(1.02); }
/* La photo de l'accueil laisse place au portrait au lavis (js/humeurs.js change aussi le src, pour les navigateurs qui ignorent content sur <img>) */
html.mood-metalgear:not(.nc) .pola .portrait-frame { background: #eeebe1 url("../assets/images/humeurs/metalgear-portrait.webp") 50% 30% / cover no-repeat; }
html.mood-metalgear:not(.nc) .portrait-frame .profile-img { content: url("../assets/images/humeurs/metalgear-portrait.webp"); object-position: 50% 30%; filter: none; }
html.mood-metalgear:not(.nc) .portrait-frame { box-shadow: 10px 10px 0 color-mix(in srgb, var(--orange) 80%, var(--ink)); }

/* Alerte « ! » : quand on revient après s'être caché, ou quand on choisit l'humeur */
.mg-alert { position: fixed; z-index: 2147482600; pointer-events: none; width: 44px; height: 84px; margin: -100px 0 0 -22px;
  display: grid; place-items: center; font: 900 72px/1 var(--display); color: #e9e4c8; -webkit-text-stroke: 5px #12130e; paint-order: stroke fill;
  animation: mgPop .9s cubic-bezier(.2, 1.6, .4, 1) both; }
.mg-alert svg { width: 100%; height: 100%; overflow: visible; fill: #d4241a; stroke: #12130e; stroke-width: 5; stroke-linejoin: round; filter: drop-shadow(3px 3px 0 #12130e); }
.mg-alert.q { animation: mgQ .5s ease-out both; }
.mg-alert.big { width: 110px; height: 210px; margin: -105px 0 0 -55px; }
@keyframes mgPop { 0% { transform: scale(.2) translateY(30px); opacity: 0; } 30% { transform: scale(1.15); opacity: 1; } 45% { transform: scale(1); } 85% { opacity: 1; } 100% { opacity: 0; transform: translateY(-6px); } }
@keyframes mgQ { 0% { transform: scale(.3); opacity: 0; } 60% { transform: scale(1.1); opacity: 1; } 100% { transform: none; opacity: 1; } }
/* Bandeau de mission à chaque changement d'onglet */
.mg-mission { position: fixed; left: 0; top: 34vh; z-index: 2147482500; pointer-events: none;
  padding: 10px 46px 10px clamp(16px, 4vw, 48px); color: #eeebe1; background: #12130e var(--mg-streak) 0 0 / 100% 100%;
  clip-path: polygon(0 0, 100% 0, calc(100% - 26px) 100%, 0 100%);
  font: 700 12px/1.3 var(--body); letter-spacing: .3em; text-transform: uppercase;
  transform: translateX(-105%); transition: transform .45s cubic-bezier(.2, .8, .2, 1); }
.mg-mission b { display: block; font: italic 900 30px/1 var(--display); letter-spacing: .02em; color: #c6cc9c; }
.mg-mission.on { transform: none; }
@media (prefers-reduced-motion: reduce) { .mg-mission { transition: none; } .mg-alert { display: none; } }
@media print { html.mood-metalgear::after, html.mood-metalgear .panel::after, .mg-mission { display: none !important; } }

/* ---------- Calme : tout ce qui bouge se fige ---------- */
@media (prefers-reduced-motion: reduce) {
  .mood-rain { display: none; }
  .mood-crt-tube::before, .mood-crt-bar, .mood-synth::before, html.mood-neon .big, html.mood-matrix .lede::after { animation: none !important; }
  html.mood-crt.crt-booting body { animation: none; }
  .mood-gb-boot { display: none; }
}

/* ---------- Vision nocturne : phosphore vert, grain, balayage, vignette ronde, projecteur IR, allumage ---------- */
/* Le filtre inverse la luminance (papier sombre, encre verte claire) : photos, vidéos et Bip sont inversés d'avance pour rester à l'endroit */
html.mood-vision:not(.nc) { filter: url(#mood-f-vision); background: #fff; }
html.mood-vision:not(.nc) :is(img:not(.portrait-frame img), video, canvas, .portrait-frame, .mascot) { filter: invert(1); }
html.mood-vision:not(.nc) body { text-shadow: 0 0 6px rgba(255, 255, 255, .55); }
html.mood-vision:not(.nc) :is(.big, .section-title, .tab b, .tile b, .stat b) { text-shadow: 0 0 12px rgba(255, 255, 255, .7), -3px 2px 0 rgba(255, 255, 255, .25); }
html.mood-vision:not(.nc) body::before { opacity: .3; }
.mood-nv, .mood-nv-ir, .mood-nv-hud { z-index: 2147482000; }
html.nc .mood-nv, html.nc .mood-nv-ir, html.nc .mood-nv-hud { display: none; }
/* Couches dessinées en « négatif » : le filtre de la page les retourne (noir = lumière verte, blanc = nuit) */
.mood-nv::before { /* grain qui fourmille */
  content: ""; position: absolute; inset: -60px; opacity: .55;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1.2 .9'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: moodNvGrain .25s steps(4) infinite; }
@keyframes moodNvGrain { 25% { transform: translate(-22px, 14px); } 50% { transform: translate(18px, -26px); } 75% { transform: translate(-10px, -12px); } }
.mood-nv::after { /* lignes de balayage + vignette ronde de l'oculaire */
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(rgba(255, 255, 255, .1) 0 1px, transparent 1px 3px),
              radial-gradient(ellipse 72% 82% at 50% 50%, transparent 58%, rgba(255, 255, 255, .55) 78%, #fff 96%);
  animation: moodNvFlicker 4s steps(1) infinite; }
@keyframes moodNvFlicker { 0%, 100% { opacity: 1; } 47% { opacity: .9; } 48% { opacity: 1; } 81% { opacity: .94; } }
/* Projecteur infrarouge : une zone plus lumineuse qui suit le pointeur */
.mood-nv-ir { opacity: 0; transition: opacity .4s; background: radial-gradient(circle 190px at var(--mx, 50%) var(--my, 50%), rgba(0, 0, 0, .28), transparent 70%); }
html.nv-ir .mood-nv-ir { opacity: 1; }
.mood-nv-hud { inset: auto auto 18px 22px; display: flex; flex-wrap: wrap; gap: 6px 16px; max-width: calc(100vw - 44px); color: #000;
  font: 600 12px/1.2 "Share Tech Mono", ui-monospace, monospace; letter-spacing: .12em; opacity: .75; }
.mood-nv-hud .rec { animation: moodCaret 1.2s steps(2) infinite; }
/* Allumage : noir, éclair vert saturé, puis le gain se stabilise */
html.mood-vision.nv-booting body { animation: moodNvOn 1.1s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes moodNvOn { 0% { opacity: 0; } 35% { opacity: 1; filter: brightness(.25) contrast(3); } 55% { filter: brightness(1.9) blur(1px); } 100% { filter: none; } }
@media print { .mood-nv, .mood-nv-ir, .mood-nv-hud { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .mood-nv::before, .mood-nv::after, .mood-nv-hud .rec { animation: none !important; } }
