/*!
 * NS Portfolio, couche de design « SISR et MCP ».
 * Sombre par défaut (thème Arter), clair avec body.light-mode.
 */
body {
	--nsd-gold: #ffc107;
	--nsd-cyan: #38d6ff;
	--nsd-green: #3ddc84;
	--nsd-grid: rgba(255, 255, 255, .035);
	--nsd-hero-a: #0b1220;
	--nsd-hero-b: #13213a;
	--nsd-mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}
body.light-mode {
	--nsd-grid: rgba(15, 35, 70, .055);
	--nsd-cyan: #0a8fc2;
	--nsd-green: #1aa35a;
}

/* ---------- Fond façon plan de câblage ---------- */
html.ns-design .art-content {
	background-image:
		linear-gradient(var(--nsd-grid) 1px, transparent 1px),
		linear-gradient(90deg, var(--nsd-grid) 1px, transparent 1px);
	background-size: 32px 32px;
	background-position: -1px -1px;
}

/* ---------- Bandeau d'accueil ---------- */
.art-banner.ns-hero,
html.ns-design body .art-a.art-banner.ns-hero {
	position: relative;
	overflow: hidden;
	/* Ton CSS additionnel impose la photo avec !important (body:not(.light-mode) .art-banner) :
	   ce sélecteur plus précis la remplace par la topologie, sur ce bandeau uniquement. */
	background-image:
		radial-gradient(700px 360px at 85% 30%, rgba(56, 214, 255, .16), transparent 70%),
		radial-gradient(520px 300px at 10% 110%, rgba(255, 193, 7, .12), transparent 70%),
		linear-gradient(135deg, var(--nsd-hero-a), var(--nsd-hero-b)) !important;
	background-size: auto !important;
	background-repeat: no-repeat !important;
	background-position: center !important;
}
.art-banner.ns-hero .art-banner-back,
.art-banner.ns-hero .art-banner-dec {
	display: none;
}
.art-banner.ns-hero .art-banner-overlay {
	position: relative;
	z-index: 2;
	background: transparent !important;
}
.art-banner.ns-hero .art-banner-title {
	max-width: 54%;
}
.ns-topo-wrap {
	position: absolute;
	z-index: 1;
	top: 50%;
	right: 2%;
	width: 48%;
	max-width: 600px;
	transform: translateY(-50%);
	pointer-events: none;
}
.ns-topo { width: 100%; height: auto; display: block; overflow: visible; }
.ns-topo-link {
	fill: none;
	stroke: rgba(56, 214, 255, .30);
	stroke-width: 1.4;
	stroke-dasharray: 3 5;
	animation: nsd-dash 18s linear infinite;
}
.ns-pkt { fill: var(--nsd-gold); }
.ns-pkt-2 { fill: #8ff0ff; }
.ns-node-bg {
	fill: rgba(11, 18, 32, .92);
	stroke: rgba(56, 214, 255, .55);
	stroke-width: 1.4;
}
.ns-node-mcp .ns-node-bg,
.ns-node-agent .ns-node-bg { stroke: rgba(255, 193, 7, .75); }
.ns-node-ico {
	fill: none;
	stroke: #e8f6ff;
	stroke-width: 1.5;
	stroke-linecap: round;
	stroke-linejoin: round;
}
.ns-node-mcp .ns-node-ico,
.ns-node-agent .ns-node-ico { stroke: #ffd24d; }
.ns-node-pulse {
	fill: none;
	stroke: rgba(56, 214, 255, .5);
	stroke-width: 1;
	transform-box: fill-box;
	transform-origin: center;
	animation: nsd-pulse 3.6s ease-out infinite;
}
.ns-node-label {
	font-family: var(--nsd-mono);
	font-size: 10.5px;
	letter-spacing: .02em;
	fill: rgba(232, 246, 255, .78);
}

/* Invite de terminal */
.ns-prompt {
	font-family: var(--nsd-mono);
	font-size: 13.5px;
	margin: 0 0 14px !important;
	color: rgba(232, 246, 255, .85) !important;
	letter-spacing: .01em;
}
.ns-prompt-user { color: var(--nsd-green); font-weight: 600; }
.ns-prompt-sep { color: #8fb3ff; margin-right: 6px; }
.ns-prompt-cmd {
	display: inline-block;
	overflow: hidden;
	white-space: nowrap;
	vertical-align: bottom;
	animation: nsd-type 1.6s steps(26, end) .3s both;
}
.ns-caret {
	display: inline-block;
	width: 8px;
	height: 1.05em;
	margin-left: 3px;
	vertical-align: -2px;
	background: var(--nsd-gold);
	animation: nsd-blink 1s steps(1) infinite;
}

/* Voyants d'état */
.ns-status {
	list-style: none;
	margin: 18px 0 0 !important;
	padding: 0 !important;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.ns-status li {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 6px 12px;
	font-family: var(--nsd-mono);
	font-size: 12px;
	color: rgba(232, 246, 255, .9) !important;
	border: 1px solid rgba(255, 255, 255, .14);
	border-radius: 999px;
	background: rgba(255, 255, 255, .05);
	backdrop-filter: blur(4px);
}
.ns-led {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--nsd-green);
	box-shadow: 0 0 0 0 rgba(61, 220, 132, .6);
	animation: nsd-led 2.4s ease-out infinite;
}
.ns-led-gold { background: var(--nsd-gold); animation-delay: .8s; }
.ns-led-blue { background: #38d6ff; animation-delay: 1.6s; }

/* ---------- Cartes : port de switch + liseré lumineux ---------- */
.art-a.art-service-icon-box { position: relative; }
.ns-port {
	position: absolute;
	top: 14px;
	right: 16px;
	font-family: var(--nsd-mono);
	font-size: 10.5px;
	letter-spacing: .04em;
	color: rgba(140, 140, 142, .9);
	text-transform: uppercase;
}
.ns-port::before {
	content: "";
	display: inline-block;
	width: 6px;
	height: 6px;
	margin-right: 6px;
	border-radius: 50%;
	background: var(--nsd-green);
	vertical-align: 1px;
	box-shadow: 0 0 6px var(--nsd-green);
}
.art-a.art-service-icon-box::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: 0;
	height: 2px;
	background: linear-gradient(90deg, transparent, var(--nsd-gold), transparent);
	transform: scaleX(0);
	transform-origin: center;
	transition: transform .45s cubic-bezier(.2, .8, .2, 1);
}
.art-a.art-service-icon-box:hover::after,
.art-a.art-service-icon-box:focus-within::after { transform: scaleX(1); }
.art-a.art-service-icon-box {
	transition: transform .35s cubic-bezier(.2, .8, .2, 1), box-shadow .35s;
}
.art-a.art-service-icon-box:hover {
	transform: translateY(-4px);
	box-shadow: 0 18px 40px -22px rgba(0, 0, 0, .55);
}

/* ---------- Apparition au défilement ---------- */
.ns-pre {
	opacity: 0;
	transform: translateY(18px);
}
.ns-pre.ns-in {
	opacity: 1;
	transform: none;
	transition: opacity .6s ease var(--ns-delay, 0ms), transform .6s cubic-bezier(.2, .8, .2, 1) var(--ns-delay, 0ms);
}

/* ---------- Animations ---------- */
@keyframes nsd-dash { to { stroke-dashoffset: -160; } }
@keyframes nsd-pulse {
	0% { transform: scale(.85); opacity: .9; }
	100% { transform: scale(1.6); opacity: 0; }
}
@keyframes nsd-type { from { max-width: 0; } to { max-width: 30ch; } }
@keyframes nsd-blink { 50% { opacity: 0; } }
@keyframes nsd-led {
	0% { box-shadow: 0 0 0 0 rgba(61, 220, 132, .55); }
	100% { box-shadow: 0 0 0 7px rgba(61, 220, 132, 0); }
}

/* ---------- Mobile ---------- */
@media (max-width: 920px) {
	.art-banner.ns-hero .art-banner-title { max-width: 100%; }
	.ns-topo-wrap {
		width: 92%;
		right: -18%;
		opacity: .32;
	}
	.ns-node-label { display: none; }
	.ns-port { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	.ns-topo-link, .ns-node-pulse, .ns-led, .ns-caret { animation: none; }
	.ns-prompt-cmd { animation: none; max-width: none; }
	.art-a.art-service-icon-box:hover { transform: none; }
}

/* ---------- Le bandeau reste sombre dans les deux thèmes ----------
 * En thème clair, le CSS additionnel force le texte en sombre (!important) :
 * on verrouille les couleurs des éléments posés sur le bandeau. */
html.ns-design body .ns-hero .ns-prompt,
html.ns-design body .ns-hero .ns-prompt-cmd { color: rgba(232, 246, 255, .88) !important; }
html.ns-design body .ns-hero .ns-prompt-user { color: #3ddc84 !important; }
html.ns-design body .ns-hero .ns-prompt-sep { color: #8fb3ff !important; }
html.ns-design body .ns-hero .ns-status li { color: rgba(232, 246, 255, .92) !important; }
html.ns-design body.light-mode .ns-hero .ns-topo-link { stroke: rgba(56, 214, 255, .34); }

/* =====================================================================
   PAGES INTÉRIEURES : bandeau avec invite de terminal et scène animée
   ===================================================================== */
html.ns-design body .art-top-bg {
	background-image:
		linear-gradient(rgba(56, 214, 255, .05) 1px, transparent 1px),
		linear-gradient(90deg, rgba(56, 214, 255, .05) 1px, transparent 1px),
		radial-gradient(800px 380px at 80% 0%, rgba(56, 214, 255, .18), transparent 70%),
		radial-gradient(600px 300px at 0% 100%, rgba(255, 193, 7, .10), transparent 70%),
		linear-gradient(135deg, #0b1220, #14223b) !important;
	background-size: 28px 28px, 28px 28px, auto, auto, auto !important;
	background-position: 0 0 !important;
	opacity: 1 !important;
}
html.ns-design body .art-top-bg .art-top-bg-overlay { background: transparent !important; }
.art-section-title.ns-page-hero {
	position: relative;
	min-height: 250px;
	display: flex;
	align-items: flex-end;
	padding-bottom: 34px !important;
}
.art-section-title.ns-page-hero .art-title-frame {
	position: relative;
	z-index: 2;
	max-width: 52%;
}
html.ns-design body .art-section-title.ns-page-hero h1 {
	color: #fff !important;
	font-size: clamp(28px, 3.2vw, 42px) !important;
	line-height: 1.15 !important;
	text-shadow: 0 2px 24px rgba(0, 0, 0, .35);
	-webkit-text-stroke: 0 !important;
}
html.ns-design body .ns-prompt-page { margin: 0 0 12px !important; font-size: 13px; }
.ns-scene-wrap {
	position: absolute;
	z-index: 1;
	right: 0;
	bottom: 18px;
	width: 46%;
	max-width: 560px;
	pointer-events: none;
}
.ns-scene { width: 100%; height: auto; display: block; overflow: visible; }

/* Éléments communs des scènes SVG */
.ns-box { fill: rgba(11, 18, 32, .88); stroke: rgba(56, 214, 255, .45); stroke-width: 1.2; }
.ns-box-gold { stroke: rgba(255, 193, 7, .7); }
.ns-wire { fill: none; stroke: rgba(56, 214, 255, .35); stroke-width: 1.3; stroke-dasharray: 3 5; animation: nsd-dash 16s linear infinite; }
.ns-pkt-cyan { fill: #8ff0ff; }
.ns-t-k { font: 600 9.5px/1 var(--nsd-mono); letter-spacing: .12em; fill: rgba(255, 210, 77, .95); }
.ns-t-h { font: 700 15px/1 Poppins, sans-serif; fill: #f1f7ff; }
.ns-t-sm { font-size: 12px; }
.ns-t-s { font: 500 10.5px/1 Poppins, sans-serif; fill: rgba(220, 235, 255, .72); }
.ns-t-code { font: 500 10px/1 var(--nsd-mono); fill: #8ff0ff; }
.ns-t-dim { fill: rgba(143, 240, 255, .55); }
.ns-led-svg { fill: #3ddc84; }
.ns-led-amber { fill: #ffc107; }
.ns-blink { animation: nsd-blinkled 2.4s steps(2, jump-none) infinite; }
.ns-unit { fill: rgba(255, 255, 255, .04); stroke: rgba(255, 255, 255, .10); }
.ns-slot { fill: rgba(255, 255, 255, .08); }
.ns-vmbox { fill: rgba(56, 214, 255, .07); stroke: rgba(56, 214, 255, .35); }
.ns-vm { animation: nsd-vm 4.8s ease-in-out infinite; transform-box: fill-box; }
.ns-port-svg { stroke: rgba(0, 0, 0, .35); }
.ns-v10 { fill: #38d6ff; } .ns-v20 { fill: #ffc107; } .ns-v30 { fill: #b388ff; }
.ns-v10-b { stroke: rgba(56, 214, 255, .7); } .ns-v20-b { stroke: rgba(255, 193, 7, .7); } .ns-v30-b { stroke: rgba(179, 136, 255, .7); }
.ns-v10-t { fill: #38d6ff; } .ns-v20-t { fill: #ffc107; } .ns-v30-t { fill: #b388ff; }
.ns-v10-f { fill: #38d6ff; } .ns-v20-f { fill: #ffc107; } .ns-v30-f { fill: #b388ff; }

/* Terminal animé */
.ns-term {
	border-radius: 12px;
	overflow: hidden;
	background: rgba(7, 12, 22, .92);
	border: 1px solid rgba(56, 214, 255, .28);
	box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .03) inset;
	font-family: var(--nsd-mono);
}
.ns-term-bar { display: flex; align-items: center; gap: 6px; padding: 9px 12px; background: rgba(255, 255, 255, .04); border-bottom: 1px solid rgba(255, 255, 255, .06); }
.ns-term-bar i { width: 9px; height: 9px; border-radius: 50%; background: #ff5f57; }
.ns-term-bar i:nth-child(2) { background: #febc2e; }
.ns-term-bar i:nth-child(3) { background: #28c840; }
.ns-term-bar span { margin-left: 8px; font-size: 11px; color: rgba(220, 235, 255, .55); }
html.ns-design body .ns-term-body {
	margin: 0 !important;
	padding: 14px 16px !important;
	min-height: 168px;
	background: transparent !important;
	border: 0 !important;
	color: rgba(220, 235, 255, .82) !important;
	font: 12.5px/1.65 var(--nsd-mono) !important;
	white-space: pre-wrap;
}
.ns-term-body b { color: #fff; font-weight: 600; }
.ns-term-body em { font-style: normal; }
.ns-term-body em.ok { color: #3ddc84; }
.ns-term-body em.warn { color: #ffc107; }
.ns-caret-t { display: inline-block; width: 7px; height: 1em; vertical-align: -2px; background: #ffc107; animation: nsd-blink 1s steps(1) infinite; }

@keyframes nsd-blinkled { 0% { opacity: 1; } 50% { opacity: .35; } }
@keyframes nsd-vm { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }

@media (max-width: 920px) {
	.art-section-title.ns-page-hero { min-height: 0; display: block; padding-bottom: 20px !important; }
	.art-section-title.ns-page-hero .art-title-frame { max-width: 100%; }
	.ns-scene-wrap { position: relative; width: 100%; right: auto; bottom: auto; margin-top: 18px; }
	.ns-term-body { min-height: 0; }
}

/* =====================================================================
   COMPOSANTS COMMUNS
   ===================================================================== */
/* Navigation : soulignement doré animé, page courante marquée */
html.ns-design .horizontal-menu-list > li > a { position: relative; }
html.ns-design .horizontal-menu-list > li > a::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -6px;
	height: 2px;
	border-radius: 2px;
	background: var(--nsd-gold);
	transform: scaleX(0);
	transition: transform .3s cubic-bezier(.2, .8, .2, 1);
}
html.ns-design .horizontal-menu-list > li > a:hover::after,
html.ns-design .horizontal-menu-list > li.current-menu-item > a::after,
html.ns-design .horizontal-menu-list > li.current-menu-ancestor > a::after { transform: scaleX(1); }

/* Avatar : anneau dégradé qui tourne lentement */
html.ns-design .art-avatar { position: relative; }
html.ns-design .art-avatar::before {
	content: "";
	position: absolute;
	inset: -5px;
	border-radius: 50%;
	background: conic-gradient(from 0deg, var(--nsd-gold), #38d6ff, #3ddc84, var(--nsd-gold));
	animation: nsd-spin 8s linear infinite;
	z-index: 0;
	-webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
	mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
}
@keyframes nsd-spin { to { transform: rotate(1turn); } }

/* Boutons : reflet qui balaie au survol */
html.ns-design .art-btn { position: relative; overflow: hidden; }
html.ns-design .art-btn::after {
	content: "";
	position: absolute;
	top: 0;
	left: -60%;
	width: 40%;
	height: 100%;
	background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent);
	transform: skewX(-20deg);
	transition: left .6s ease;
}
html.ns-design .art-btn:hover::after { left: 120%; }

/* Grilles de projets : cartes arrondies, zoom doux, liseré */
html.ns-design .art-a.art-portfolio-item-frame {
	border-radius: 14px;
	overflow: hidden;
	transition: transform .4s cubic-bezier(.2, .8, .2, 1), box-shadow .4s;
}
html.ns-design .art-a.art-portfolio-item-frame img { transition: transform .8s cubic-bezier(.2, .8, .2, 1); }
html.ns-design .art-a.art-portfolio-item-frame:hover { transform: translateY(-4px); box-shadow: 0 22px 46px -24px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 193, 7, .45); }
html.ns-design .art-a.art-portfolio-item-frame:hover img { transform: scale(1.05); }

/* Contenus de pages (textes, procédures) */
html.ns-design .art-content .elementor-widget-text-editor h2,
html.ns-design .art-content .elementor-widget-heading h2.elementor-heading-title {
	font-size: clamp(22px, 2.3vw, 28px) !important;
	line-height: 1.3 !important;
	padding-left: 14px;
	border-left: 4px solid var(--nsd-gold);
	margin: 1.6em 0 .7em !important;
}
html.ns-design .art-content .elementor-widget-text-editor h3 {
	font-size: 13px !important;
	letter-spacing: .09em;
	text-transform: uppercase;
	color: var(--nsd-gold) !important;
	margin: 1.6em 0 .6em !important;
}
html.ns-design .art-content .elementor-widget-text-editor p,
html.ns-design .art-content .elementor-widget-text-editor li { font-size: 15.5px; line-height: 1.75; }
html.ns-design .art-content .elementor-widget-text-editor code,
html.ns-design .art-content .elementor-widget-text-editor pre {
	font-family: var(--nsd-mono);
	background: rgba(7, 12, 22, .85) !important;
	color: #dff3ff !important;
	border: 1px solid rgba(56, 214, 255, .25);
	border-radius: 10px;
}
html.ns-design .art-content .elementor-widget-text-editor code { padding: .1em .4em; font-size: .88em; border-radius: 6px; }
html.ns-design .art-content .elementor-widget-text-editor pre { padding: 14px 16px; overflow-x: auto; }
html.ns-design .art-content .elementor-widget-text-editor img,
html.ns-design .art-content .elementor-widget-image img { border-radius: 12px; }

/* Pied de page : lisible dans les deux thèmes, style console */
html.ns-design .footer {
	border: 1px solid rgba(56, 214, 255, .18) !important;
	border-radius: 14px;
	background: rgba(7, 12, 22, .35) !important;
	font-family: var(--nsd-mono);
	font-size: 12.5px;
}
html.ns-design body:not(.light-mode) .footer,
html.ns-design body:not(.light-mode) .footer * { color: rgba(220, 235, 255, .72) !important; }
html.ns-design body:not(.light-mode) .footer a:hover { color: var(--nsd-gold) !important; }
html.ns-design body.light-mode .footer { background: #fff !important; border-color: rgba(15, 35, 70, .12) !important; }
html.ns-design body.light-mode .footer,
html.ns-design body.light-mode .footer * { color: rgba(26, 26, 26, .72) !important; }

/* Détails */
html.ns-design ::selection { background: rgba(255, 193, 7, .35); color: inherit; }
html.ns-design { scrollbar-color: rgba(255, 193, 7, .55) transparent; scrollbar-width: thin; }

@media (prefers-reduced-motion: reduce) {
	html.ns-design .art-avatar::before, .ns-wire, .ns-blink, .ns-vm { animation: none; }
	html.ns-design .art-a.art-portfolio-item-frame:hover, html.ns-design .art-a.art-portfolio-item-frame:hover img { transform: none; }
}

/* ---------- Ajustements : thème clair, contact, en-tête d'article ---------- */
/* Les bandeaux restent sombres dans les deux thèmes : on verrouille les textes posés dessus. */
html.ns-design body .ns-prompt,
html.ns-design body .ns-prompt .ns-prompt-cmd { color: rgba(232, 246, 255, .88) !important; }
html.ns-design body .ns-prompt .ns-prompt-user { color: #3ddc84 !important; }
html.ns-design body .ns-prompt .ns-prompt-sep { color: #8fb3ff !important; }
html.ns-design body .ns-contact-container .ns-header p { color: rgba(232, 246, 255, .82) !important; }

/* Article : la date passe sous le titre, en pastille console */
.ns-page-hero .art-right-frame {
	position: absolute;
	z-index: 2;
	left: 0;
	bottom: 4px;
}
.ns-page-hero .art-right-frame .art-project-category {
	font-family: var(--nsd-mono);
	font-size: 11.5px !important;
	padding: 4px 12px !important;
	border-radius: 999px !important;
	background: rgba(255, 193, 7, .14) !important;
	color: #ffd24d !important;
	border: 1px solid rgba(255, 193, 7, .35);
}
body.single-post .art-section-title.ns-page-hero { padding-bottom: 46px !important; }
body.single-post .art-section-title.ns-page-hero h1 { font-size: clamp(24px, 2.6vw, 34px) !important; }
body.single-post .ns-scene-wrap { width: 40%; }
