/* Jetons du thème : chargés sur le site ET dans l’éditeur de blocs (aperçu fidèle). */

:root {
	/* Nuit (design system Mokachupa) */
	--night: #08060f;
	--night-band: #0e0e21;
	--night-card: #120f22;
	--night-well: #1e1830;
	--star: #f0ecff;
	--star-soft: #c5bfe8;
	--star-muted: #8a7fa8;   /* ≥ 5:1 sur la nuit */

	/* Néons */
	--mint: #7cf4c8;
	--sky: #4db8ff;
	--violet: #b97bff;
	--pink: #ff3dbe;
	--pink-soft: #ff8cdc;

	/* Papiers */
	--paper: #f3ede1;
	--paper-white: #fbf8f1;
	--manila: #e4d4ab;
	--manila-dark: #cdb98a;
	--paper-ink: #2b2140;       /* ≥ 10:1 sur papier et kraft */
	--paper-ink-soft: #4a3d63;  /* ≥ 6:1 */
	--pen: #5b2fa8;             /* stylo violet, ≥ 5.9:1 sur le kraft */
	--stamp-ink: #8f0d5e;       /* encre à tampon : ≥ 4.9:1 même sur le kraft le plus foncé (grain compris) */
	--paper-line: #c9bfe0;

	--font-occult: "IM Fell English", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
	--font-occult-sc: "IM Fell English SC", "IM Fell English", Georgia, serif;
	--font-type: "Special Elite", "Courier New", monospace;
	--font-body: "Courier Prime", "Courier New", monospace;
	--font-hand: "Caveat", "Segoe Print", "Bradley Hand", cursive;

	--shadow-paper: 0 1px 1px rgba(0, 0, 0, 0.3), 0 12px 24px -10px rgba(0, 0, 0, 0.75);
	--shadow-lift: 0 2px 3px rgba(0, 0, 0, 0.35), 0 26px 40px -14px rgba(0, 0, 0, 0.85), 0 0 34px rgba(185, 123, 255, 0.22);
	--glow-mint: 0 0 30px rgba(124, 244, 200, 0.25);
	--glow-violet: 0 0 30px rgba(185, 123, 255, 0.28);

	--gutter: clamp(16px, 4vw, 48px);
}

/* --- Le « sol » de la page : nuit (sombre) ou bureau de jour (clair) ---------------------
   Sombre par défaut. Clair : réglage de la page (data-mode posé par le thème), choix du
   visiteur (interrupteur, posé par mode.js) ou, en « Auto », réglage clair de l’appareil. */

:root {
	color-scheme: dark;
	--ground: #08060f;
	/* Première couche : le haut de la page part de la couleur unie du sol. Safari (iPhone) peint la
	   zone de la barre d’état avec cette couleur unie : sans ce fondu, le halo violet commençait net
	   sous la barre, avec une ligne visible. */
	--ground-backdrop:
		linear-gradient(#08060f 0, rgba(8, 6, 15, 0) 120px),
		radial-gradient(ellipse 80% 60% at 50% -10%, rgba(185, 123, 255, 0.16), transparent 70%),
		radial-gradient(ellipse 60% 50% at 100% 100%, rgba(124, 244, 200, 0.07), transparent 70%),
		url("../img/starfield.svg"),
		#08060f;
	--ground-ink: #f0ecff;
	--ground-ink-soft: #c5bfe8;
	--ground-ink-muted: #8a7fa8;   /* ≥ 5:1 sur la nuit */
	--ground-accent: #7cf4c8;
	--ground-chip: rgba(18, 15, 34, 0.75);
	--ground-glow: 0 0 30px rgba(124, 244, 200, 0.25);
	--ground-glow-text: 0 0 12px rgba(124, 244, 200, 0.45);
	/* Étiquette de marque (« THE VAULT ») et onglet actif : menthe sur la nuit. */
	--brand-bg: #7cf4c8;
	--brand-ink: #08060f;
	--brand-glow: 0 0 30px rgba(124, 244, 200, 0.25);
}

@media (prefers-color-scheme: light) {
	/* De jour : le même ciel que la nuit, inversé (étoiles et constellations à l’encre sur lavande). */
	:root:not([data-mode="dark"]) {
		color-scheme: light;
		--ground: #ece7f1;
		--ground-backdrop:
			linear-gradient(#ece7f1 0, rgba(236, 231, 241, 0) 120px),
			radial-gradient(ellipse 80% 60% at 50% -10%, rgba(185, 123, 255, 0.2), transparent 70%),
			radial-gradient(ellipse 60% 50% at 100% 100%, rgba(19, 128, 92, 0.08), transparent 70%),
			url("../img/starfield-light.svg"),
			#ece7f1;
		--ground-ink: #2b2140;
		--ground-ink-soft: #4a3d63;
		--ground-ink-muted: #4a3d63;
		--ground-accent: #5b2fa8;
		--ground-chip: rgba(251, 248, 241, 0.85);
		--ground-glow: 0 0 18px rgba(185, 123, 255, 0.3);
		--ground-glow-text: none;
		/* De jour, la menthe sur lavande manque de contraste : encre profonde, lettres menthe. */
		--brand-bg: #2b2140;
		--brand-ink: #7cf4c8;
		--brand-glow: 0 2px 10px rgba(43, 33, 64, 0.25);
	}
}

:root[data-mode="light"] {
	color-scheme: light;
	--ground: #ece7f1;
	--ground-backdrop:
		linear-gradient(#ece7f1 0, rgba(236, 231, 241, 0) 120px),
		radial-gradient(ellipse 80% 60% at 50% -10%, rgba(185, 123, 255, 0.2), transparent 70%),
		radial-gradient(ellipse 60% 50% at 100% 100%, rgba(19, 128, 92, 0.08), transparent 70%),
		url("../img/starfield-light.svg"),
		#ece7f1;
	--ground-ink: #2b2140;
	--ground-ink-soft: #4a3d63;
	--ground-ink-muted: #4a3d63;
	--ground-accent: #5b2fa8;
	--ground-chip: rgba(251, 248, 241, 0.85);
	--ground-glow: 0 0 18px rgba(185, 123, 255, 0.3);
	--ground-glow-text: none;
	--brand-bg: #2b2140;
	--brand-ink: #7cf4c8;
	--brand-glow: 0 2px 10px rgba(43, 33, 64, 0.25);
}

/* --- Un élément forcé en sombre ou en clair (réglage « Mode » du bloc) ----------------------
   Les jetons « papier » sont redéfinis localement : chaque style de bloc suit sans règle dédiée. */

.is-mode-dark {
	--paper: #1e1830;
	--paper-white: #120f22;
	--manila: #2a2238;
	--manila-dark: #1e1830;
	--paper-ink: #f0ecff;
	--paper-ink-soft: #c5bfe8;
	--pen: #b97bff;          /* 6.5:1 sur #120f22 */
	--stamp-ink: #ff8cdc;    /* 9:1 */
	--paper-line: rgba(185, 123, 255, 0.28);
	color-scheme: dark;
}

.is-mode-light {
	--paper: #f3ede1;
	--paper-white: #fbf8f1;
	--manila: #e4d4ab;
	--manila-dark: #cdb98a;
	--paper-ink: #2b2140;
	--paper-ink-soft: #4a3d63;
	--pen: #5b2fa8;
	--stamp-ink: #8f0d5e;
	--paper-line: #c9bfe0;
	color-scheme: light;
}
