/*
Theme Name:   Ntournaux Futur
Theme URI:    https://ntournaux.fr
Author:       Nathan
Description:  Thème autonome, futuriste et sobre, pour un portfolio informatique. Mode sombre et clair, halo de couleur sous la souris.
Version:      1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain:  ntournaux-futur
*/

/* =========================================================
   1. Variables
   ========================================================= */
:root {
	--font: "Inter Variable", "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
	--mono: ui-monospace, "JetBrains Mono", "Cascadia Code", "SFMono-Regular", Menlo, Consolas, monospace;
	--radius: 14px;
	--radius-sm: 10px;
	--wrap: 1080px;
	--prose: 68ch;
}

html[data-theme="dark"],
html:not([data-theme]) {
	color-scheme: dark;
	--bg: #0a0f1c;
	--bg-rgb: 10, 15, 28;
	--bg-2: #0e1627;
	--surface: #111b30;
	--line: #1f2d4a;
	--text: #c9d4ea;
	--strong: #f1f5fd;
	--muted: #7f90b0;
	--accent: #5aa9ff;
	--accent-rgb: 90, 169, 255;
	--accent-2: #9b8cff;
	--accent-2-rgb: 155, 140, 255;
	--accent-3: #3fd6c4;
	--accent-3-rgb: 63, 214, 196;
	--on-accent: #06101f;
	--glow: .13;
	--grid: rgba(120, 160, 255, .05);
}

html[data-theme="light"] {
	color-scheme: light;
	--bg: #f3f6fb;
	--bg-rgb: 243, 246, 251;
	--bg-2: #eaf0f8;
	--surface: #ffffff;
	--line: #d6dfed;
	--text: #34445f;
	--strong: #0b1730;
	--muted: #5b6a85;
	--accent: #1f6feb;
	--accent-rgb: 31, 111, 235;
	--accent-2: #6d4aff;
	--accent-2-rgb: 109, 74, 255;
	--accent-3: #0e9384;
	--accent-3-rgb: 14, 147, 132;
	--on-accent: #ffffff;
	--glow: .10;
	--grid: rgba(20, 50, 110, .06);
}

/* =========================================================
   2. Base
   ========================================================= */
*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font);
	font-size: 1.0625rem;
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
	transition: background-color .3s ease, color .3s ease;
}

/* Grille technique discrète, qui s'estompe vers le bas */
body::before {
	content: "";
	position: fixed;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background-image:
		linear-gradient(var(--grid) 1px, transparent 1px),
		linear-gradient(90deg, var(--grid) 1px, transparent 1px);
	background-size: 48px 48px;
	-webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 0%, transparent 100%);
	mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 0%, transparent 100%);
}

img,
video,
iframe {
	max-width: 100%;
	height: auto;
}

a {
	color: var(--accent);
	text-decoration: none;
	transition: color .2s ease, text-decoration-color .2s ease;
}

a:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

::selection {
	background: rgba(var(--accent-rgb), .3);
	color: var(--strong);
}

:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 3px;
	border-radius: 4px;
}

.wrap {
	width: min(var(--wrap), 100% - 2.5rem);
	margin-inline: auto;
}

.prose-wrap {
	width: min(var(--prose), 100% - 2.5rem);
	margin-inline: auto;
}

.section {
	padding-block: clamp(2.5rem, 6vw, 5rem);
}

/* Accessibilité */
.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.skip-link:focus {
	position: fixed !important;
	top: 12px;
	left: 12px;
	width: auto;
	height: auto;
	margin: 0;
	clip: auto;
	padding: .6rem 1rem;
	background: var(--accent);
	color: var(--on-accent);
	border-radius: var(--radius-sm);
	z-index: 10000;
}

/* =========================================================
   3. Typographie
   ========================================================= */
h1,
h2,
h3,
h4,
h5,
h6 {
	margin: 0 0 .6em;
	color: var(--strong);
	font-weight: 600;
	letter-spacing: -.02em;
	line-height: 1.2;
}

h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1.2em; }

.lead {
	font-size: 1.2rem;
	color: var(--text);
	max-width: 52ch;
}

.meta {
	margin: 0 0 .5rem;
	color: var(--muted);
	font-family: var(--mono);
	font-size: .8rem;
}

.meta a {
	color: var(--muted);
}

.meta-cats::before {
	content: "/ ";
}

hr {
	border: 0;
	border-top: 1px solid var(--line);
	margin: 2.5rem 0;
}

/* Contenu des articles */
.prose > * + * {
	margin-top: 1.2em;
}

.prose h2,
.prose h3,
.prose h4 {
	margin-top: 2em;
}

.prose a {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
	text-decoration-color: rgba(var(--accent-rgb), .4);
}

.prose a:hover {
	text-decoration-color: var(--accent);
}

.prose ul,
.prose ol {
	padding-left: 1.4em;
}

.prose li + li {
	margin-top: .35em;
}

blockquote {
	margin: 1.6em 0;
	padding: 1rem 1.4rem;
	border-left: 2px solid var(--accent);
	background: rgba(var(--accent-rgb), .06);
	border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

blockquote p:last-child {
	margin-bottom: 0;
}

pre,
code,
kbd,
samp {
	font-family: var(--mono);
}

pre {
	margin: 1.4em 0;
	padding: 1.1rem 1.25rem;
	background: var(--bg-2);
	color: var(--text);
	border: 1px solid var(--line);
	border-radius: 12px;
	overflow: auto;
	font-size: .9rem;
	line-height: 1.6;
}

:not(pre) > code {
	padding: .1em .4em;
	background: rgba(var(--accent-rgb), .1);
	color: var(--accent);
	border-radius: 6px;
	font-size: .9em;
}

kbd {
	padding: .1em .45em;
	background: var(--surface);
	color: var(--strong);
	border: 1px solid var(--line);
	border-bottom-width: 2px;
	border-radius: 6px;
	font-size: .85em;
}

table {
	width: 100%;
	border-collapse: collapse;
	font-size: .95rem;
}

th,
td {
	padding: .6rem .8rem;
	border: 1px solid var(--line);
	text-align: left;
}

th {
	background: var(--bg-2);
	color: var(--strong);
}

figure {
	margin: 1.6em 0;
}

figcaption,
.wp-caption-text {
	margin-top: .5rem;
	color: var(--muted);
	font-size: .85rem;
}

.prose img {
	border-radius: var(--radius-sm);
}

/* Classes WordPress */
.alignleft { float: left; margin: .3em 1.5em 1em 0; }
.alignright { float: right; margin: .3em 0 1em 1.5em; }
.aligncenter { display: block; margin-inline: auto; }
.wp-caption { max-width: 100%; }
.sticky,
.bypostauthor,
.gallery-caption { display: block; }

/* =========================================================
   4. En-tête
   ========================================================= */
.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: rgba(var(--bg-rgb), .72);
	-webkit-backdrop-filter: saturate(140%) blur(14px);
	backdrop-filter: saturate(140%) blur(14px);
	border-bottom: 1px solid var(--line);
}

.header-inner {
	display: flex;
	align-items: center;
	gap: 1.5rem;
	min-height: 64px;
}

.brand {
	display: inline-flex;
	align-items: center;
	color: var(--strong);
	font-weight: 600;
	letter-spacing: -.01em;
}

.brand:hover {
	text-decoration: none;
	color: var(--strong);
}

.brand .prompt {
	margin-right: .5em;
	color: var(--accent);
	font-family: var(--mono);
	font-weight: 500;
}

.brand-logo img {
	display: block;
	max-height: 40px;
	width: auto;
}

.site-nav {
	margin-left: .75rem;
}

.menu {
	display: flex;
	flex-wrap: wrap;
	gap: .25rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-nav .menu a {
	display: block;
	padding: .45rem .85rem;
	color: var(--text);
	font-weight: 500;
	font-size: .95rem;
	border-radius: var(--radius-sm);
}

.site-nav .menu a:hover,
.site-nav .menu .current-menu-item > a,
.site-nav .menu .current_page_item > a {
	color: var(--accent);
	background: rgba(var(--accent-rgb), .08);
	text-decoration: none;
}

.header-tools {
	display: flex;
	align-items: center;
	gap: .5rem;
	margin-left: auto;
}

.theme-toggle,
.menu-btn {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	padding: 0;
	cursor: pointer;
	color: var(--strong);
	background: transparent;
	border: 1px solid var(--line);
	border-radius: 50%;
	transition: color .2s ease, border-color .2s ease;
}

.theme-toggle:hover,
.menu-btn:hover {
	color: var(--accent);
	border-color: var(--accent);
}

.theme-toggle svg,
.menu-btn svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* Soleil en mode sombre (pour passer au clair), lune en mode clair */
.theme-toggle .icon-moon {
	display: none;
}

html[data-theme="light"] .theme-toggle .icon-sun {
	display: none;
}

html[data-theme="light"] .theme-toggle .icon-moon {
	display: block;
}

.menu-btn {
	display: none;
}

@media (max-width: 760px) {
	.menu-btn {
		display: grid;
	}

	.site-nav {
		display: none;
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		margin: 0;
		padding: .75rem 1.25rem 1rem;
		background: var(--bg);
		border-bottom: 1px solid var(--line);
	}

	.site-nav.is-open {
		display: block;
	}

	.site-nav .menu {
		flex-direction: column;
	}

	.header-tools {
		margin-left: auto;
	}
}

/* =========================================================
   5. Cartes et halo local
   ========================================================= */
.card {
	position: relative;
	padding: 1.5rem;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	transition: border-color .25s ease, background-color .3s ease;
}

.card::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	pointer-events: none;
	opacity: 0;
	transition: opacity .25s ease;
	background: radial-gradient(280px circle at var(--lx, 50%) var(--ly, 50%), rgba(var(--accent-rgb), .10), transparent 70%);
}

.card:hover {
	border-color: rgba(var(--accent-rgb), .4);
}

.card:hover::after {
	opacity: 1;
}

.grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 1.25rem;
}

.section-title {
	margin-bottom: 1.5rem;
}

.feature h3 {
	margin-bottom: .4em;
}

.feature p:last-child {
	margin-bottom: 0;
	color: var(--text);
}

/* =========================================================
   6. Accueil
   ========================================================= */
.hero {
	padding-block: clamp(3rem, 8vw, 6.5rem);
}

.hero-grid {
	display: grid;
	grid-template-columns: 1.1fr .9fr;
	gap: clamp(2rem, 5vw, 4rem);
	align-items: center;
}

.hero-text h1 {
	max-width: none;
}

.hero-actions {
	display: flex;
	flex-wrap: wrap;
	gap: .75rem;
	margin: 1.8rem 0 0;
}

@media (max-width: 860px) {
	.hero-grid {
		grid-template-columns: 1fr;
	}
}

/* Terminal */
.terminal {
	padding: 0;
	overflow: hidden;
}

.terminal-bar {
	padding: .6rem 1.1rem;
	border-bottom: 1px solid var(--line);
	background: var(--bg-2);
	color: var(--muted);
	font-family: var(--mono);
	font-size: .8rem;
}

.terminal-body {
	margin: 0;
	padding: 1.1rem 1.25rem 1.3rem;
	background: transparent;
	border: 0;
	border-radius: 0;
	color: var(--text);
	font-size: .88rem;
	line-height: 1.8;
	white-space: pre-wrap;
}

.t-prompt {
	color: var(--accent);
	user-select: none;
}

/* =========================================================
   7. Articles et pages
   ========================================================= */
.page-header {
	margin-bottom: 2rem;
}

.post-card-thumb {
	display: block;
	margin: -1.5rem -1.5rem 1.2rem;
	overflow: hidden;
	border-radius: var(--radius) var(--radius) 0 0;
}

.post-card-thumb img {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

.post-card-title {
	margin-bottom: .5em;
	font-size: 1.2rem;
}

.post-card-title a {
	color: var(--strong);
}

.post-card-title a:hover {
	color: var(--accent);
	text-decoration: none;
}

.post-card-excerpt p:last-child {
	margin-bottom: 0;
}

.entry-header {
	margin-bottom: 2rem;
}

.entry-thumb {
	margin: 0 0 2rem;
}

.entry-thumb img {
	border-radius: var(--radius);
}

.entry-tags {
	margin-top: 2rem;
	font-family: var(--mono);
	font-size: .85rem;
}

.entry-tags a {
	display: inline-block;
	margin: 0 .4rem .4rem 0;
	padding: .15rem .6rem;
	color: var(--muted);
	border: 1px solid var(--line);
	border-radius: 999px;
}

.entry-tags a:hover {
	color: var(--accent);
	border-color: var(--accent);
	text-decoration: none;
}

.post-navigation .nav-links,
.comment-navigation .nav-links {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	margin-top: 3rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--line);
}

.post-navigation a {
	display: block;
	color: var(--strong);
	font-weight: 500;
}

.post-navigation .meta {
	display: block;
}

/* Pagination */
.pagination {
	margin-top: 2.5rem;
}

.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: .4rem;
}

.page-numbers {
	display: inline-block;
	padding: .35rem .85rem;
	color: var(--text);
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
}

a.page-numbers:hover,
.page-numbers.current {
	color: var(--on-accent);
	background: var(--accent);
	border-color: var(--accent);
	text-decoration: none;
}

/* =========================================================
   8. Commentaires
   ========================================================= */
.comments {
	margin-top: 4rem;
	padding-top: 2rem;
	border-top: 1px solid var(--line);
}

.comment-list,
.comment-list .children {
	margin: 0;
	padding: 0;
	list-style: none;
}

.comment-list .children {
	margin-left: 1.5rem;
}

.comment-body {
	margin-bottom: 1.2rem;
	padding: 1rem 1.2rem;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
}

.comment-author img {
	margin-right: .6rem;
	border-radius: 50%;
	vertical-align: middle;
}

.comment-metadata,
.comment-metadata a {
	color: var(--muted);
	font-family: var(--mono);
	font-size: .78rem;
}

/* =========================================================
   9. Boutons et formulaires
   ========================================================= */
.btn,
button[type="submit"],
input[type="submit"],
.wp-block-button__link {
	display: inline-block;
	padding: .6rem 1.2rem;
	cursor: pointer;
	color: var(--accent);
	background: rgba(var(--accent-rgb), .08);
	border: 1px solid rgba(var(--accent-rgb), .5);
	border-radius: var(--radius-sm);
	font-family: inherit;
	font-size: .95rem;
	font-weight: 500;
	line-height: 1.4;
	transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}

.btn:hover,
button[type="submit"]:hover,
input[type="submit"]:hover,
.wp-block-button__link:hover,
.btn-primary {
	color: var(--on-accent);
	background: var(--accent);
	border-color: var(--accent);
	text-decoration: none;
}

.btn-primary:hover {
	filter: brightness(1.08);
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
textarea,
select {
	width: 100%;
	padding: .65rem .9rem;
	color: var(--strong);
	background: var(--bg-2);
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	font-family: inherit;
	font-size: 1rem;
	transition: border-color .2s ease, box-shadow .2s ease;
}

input:focus,
textarea:focus,
select:focus {
	border-color: var(--accent);
	box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .18);
	outline: none;
}

::placeholder {
	color: var(--muted);
	opacity: 1;
}

.search-form {
	display: flex;
	gap: .6rem;
	max-width: 480px;
	margin-top: 1rem;
}

.comment-form label {
	display: block;
	margin-bottom: .3rem;
	font-size: .9rem;
}

.comment-form p {
	margin-bottom: 1rem;
}

/* =========================================================
   10. Pied de page
   ========================================================= */
.site-footer {
	margin-top: 3rem;
	padding-block: 1.8rem;
	background: var(--bg-2);
	border-top: 1px solid var(--line);
	color: var(--muted);
	font-size: .9rem;
}

.footer-inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

.footer-copy {
	margin: 0;
}

.footer-nav .menu a {
	color: var(--text);
}

.footer-nav .menu a:hover {
	color: var(--accent);
}

/* =========================================================
   11. Halo global sous la souris
   ========================================================= */
.glow {
	position: fixed;
	inset: 0;
	z-index: 9990;
	pointer-events: none;
	opacity: 0;
	transition: opacity .4s ease;
	background: radial-gradient(520px circle at var(--mx, 50%) var(--my, 50%), rgba(var(--accent-rgb), var(--glow)), transparent 65%);
}

.glow.is-on {
	opacity: 1;
}

/* =========================================================
   12. Préférences utilisateur et impression
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
	* {
		transition: none !important;
		animation: none !important;
		scroll-behavior: auto !important;
	}

	.glow {
		display: none;
	}
}

@media (hover: none) {
	.glow {
		display: none;
	}
}

@media print {
	.glow,
	.site-header,
	.site-footer,
	body::before {
		display: none !important;
	}

	body {
		background: #fff;
		color: #000;
	}
}

/* =========================================================
   13. Touches de couleur et composants du portfolio
   ========================================================= */
body::after {
	content: "";
	position: fixed;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background:
		radial-gradient(640px circle at 88% -6%, rgba(var(--accent-2-rgb), .13), transparent 70%),
		radial-gradient(560px circle at 8% 4%, rgba(var(--accent-rgb), .10), transparent 70%);
}

section[id] {
	scroll-margin-top: 72px;
}

/* Trait fin entre deux sections */
.section + .section::before {
	content: "";
	display: block;
	width: min(var(--wrap), 100% - 2.5rem);
	height: 1px;
	margin: 0 auto;
	background: var(--line);
	transform: translateY(calc(-1 * clamp(2.5rem, 6vw, 5rem)));
}

/* Navigation : séparateur entre pages du portfolio et sites externes */
.menu-sep {
	align-self: center;
	width: 1px;
	height: 18px;
	margin: 0 .35rem;
	background: var(--line);
}

@media (max-width: 760px) {
	.menu-sep {
		width: 100%;
		height: 1px;
		margin: .4rem 0;
	}
}

/* Titre du hero en dégradé */
.hero-name {
	color: var(--strong);
	background: linear-gradient(100deg, var(--strong) 20%, var(--accent) 62%, var(--accent-2) 100%);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
}

.btn-primary {
	background-image: linear-gradient(135deg, var(--accent), var(--accent-2));
	border-color: transparent;
}

/* Titres de section */
.section-title {
	display: flex;
	align-items: center;
	gap: .7rem;
}

.section-title::before {
	content: "";
	flex: none;
	width: 4px;
	height: 1.1em;
	border-radius: 2px;
	background: linear-gradient(var(--accent), var(--accent-2));
}

.sub-title {
	margin: 2.4rem 0 1rem;
	font-size: 1.1rem;
}

.grid-2 {
	grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.card h4 {
	margin: 0 0 .4em;
	font-size: 1.05rem;
}

.card p:last-child {
	margin-bottom: 0;
}

/* Cartes colorées */
.tone-1 { --c: var(--accent);   --c-rgb: var(--accent-rgb); }
.tone-2 { --c: var(--accent-2); --c-rgb: var(--accent-2-rgb); }
.tone-3 { --c: var(--accent-3); --c-rgb: var(--accent-3-rgb); }

.card[class*="tone-"]:hover {
	border-color: rgba(var(--c-rgb), .5);
}

.card[class*="tone-"]::after {
	background: radial-gradient(280px circle at var(--lx, 50%) var(--ly, 50%), rgba(var(--c-rgb), .12), transparent 70%);
}

.icon-tile {
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	margin-bottom: 1rem;
	color: var(--c);
	background: rgba(var(--c-rgb), .12);
	border: 1px solid rgba(var(--c-rgb), .3);
	border-radius: 12px;
}

.icon-tile svg {
	width: 22px;
	height: 22px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.7;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* Compétences */
.skills {
	max-width: 760px;
}

.skill {
	margin-top: 1.1rem;
}

.skill-head {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	font-size: .95rem;
}

.skill-head span:last-child {
	color: var(--muted);
	font-family: var(--mono);
	font-size: .82rem;
}

.bar {
	height: 6px;
	margin-top: .5rem;
	background: rgba(var(--accent-rgb), .08);
	border: 1px solid var(--line);
	border-radius: 999px;
	overflow: hidden;
}

.bar-fill {
	display: block;
	height: 100%;
	width: var(--w);
	border-radius: inherit;
	background: linear-gradient(90deg, var(--accent), var(--accent-2));
	box-shadow: 0 0 12px rgba(var(--accent-rgb), .35);
	transition: width 1s cubic-bezier(.2, .7, .2, 1);
}

.js .bar-fill {
	width: 0;
}

.js .bar.is-in .bar-fill {
	width: var(--w);
}

/* Contact */
.contact-list {
	max-width: 760px;
	margin: 1.6rem 0 0;
	padding: 0;
}

.contact-row {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	padding: .95rem 0;
	border-bottom: 1px solid var(--line);
}

.contact-row dt {
	color: var(--muted);
}

.contact-row dd {
	margin: 0;
	text-align: right;
	overflow-wrap: anywhere;
}

.contact-row + .hero-actions,
.contact-list + .hero-actions {
	margin-top: 1.6rem;
}
