/* Base Go8b — classes préfixées g8-, aucun style inline.
   Mobile first. Points d'arrêt (CLAUDE.md): 480 / 768 / 1024 / 1280 px
   (les variables CSS ne fonctionnent pas dans les requêtes média: valeurs écrites en dur).
   Les règles sur les éléments HTML utilisent :where() (spécificité nulle) pour qu'Oxygen puisse les surcharger. */

/* ---------- Base ---------- */
/* border-box pour les composants g8- seulement (min-height 44 px = hauteur totale). */
:where([class^="g8-"], [class*=" g8-"]),
:where([class^="g8-"], [class*=" g8-"])::before,
:where([class^="g8-"], [class*=" g8-"])::after {
	box-sizing: border-box;
}

:where(html) {
	scroll-padding-top: 5.5rem; /* le header sticky ne masque pas la cible d'une ancre (WCAG 2.4.11) */
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

:where(body) {
	margin: 0;
	background: var(--g8-bg);
	color: var(--g8-ink);
	font-family: var(--g8-font-body);
	font-size: var(--g8-fs-body);
	font-weight: var(--g8-fw-body);
	line-height: 1.6;
}

:where(h1, h2, h3, h4) {
	margin: 0 0 var(--g8-s-4);
	color: var(--g8-primary);
	font-family: var(--g8-font-head);
	font-weight: var(--g8-fw-head);
	line-height: 1.15;
	text-wrap: balance;
}

:where(h1) { font-size: var(--g8-fs-h1); line-height: 1.1; }
:where(h2) { font-size: var(--g8-fs-h2); }
:where(h3) { font-size: var(--g8-fs-h3); line-height: 1.2; }
:where(h4) { font-size: var(--g8-fs-h4); line-height: 1.25; }

:where(p, ul, ol) {
	margin: 0 0 var(--g8-s-4);
}

:where(strong, b) {
	font-weight: var(--g8-fw-strong);
}

:where(img, svg, video) {
	max-width: 100%;
	height: auto;
}

/* Liens de texte: soulignés (ink = primary, la couleur seule ne suffit pas, WCAG 1.4.1). */
:where(a:not([class])) {
	color: var(--g8-primary);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

:where(a:not([class])):hover {
	text-decoration-thickness: 2px;
}

.g8-lead {
	font-size: var(--g8-fs-lead);
	color: var(--g8-ink-soft);
}

.g8-small {
	font-size: var(--g8-fs-small);
	color: var(--g8-ink-soft);
}

.g8-tagline {
	font-size: var(--g8-fs-tagline);
	font-weight: var(--g8-fw-strong);
	letter-spacing: var(--g8-ls-tagline);
	text-transform: uppercase;
	color: var(--g8-ink-soft);
}

/* Texte long (pages légales) */
.g8-prose {
	max-width: 72ch;
}

.g8-prose :where(h2) {
	margin-block-start: var(--g8-s-7);
	font-size: var(--g8-fs-h3);
}

.g8-prose :where(h3) {
	margin-block-start: var(--g8-s-6);
	font-size: var(--g8-fs-h4);
}

.g8-prose :where(ul, ol) {
	padding-inline-start: 1.25em;
}

.g8-prose :where(li + li) {
	margin-block-start: var(--g8-s-2);
}

.g8-contact-list {
	margin: 0 0 var(--g8-s-5);
	padding: 0;
	list-style: none;
}

.g8-contact-list :where(li) {
	display: flex;
	align-items: center;
	min-height: 44px;
}

/* ---------- Mise en page ---------- */
.g8-container {
	width: min(100% - 2rem, var(--g8-container));
	margin-inline: auto;
}

.g8-section {
	padding-block: var(--g8-s-section);
}

.g8-section--alt {
	background: var(--g8-bg-alt);
}

.g8-section--deep,
.g8-on-dark {
	background: var(--g8-deep);
	color: var(--g8-bg);
}

.g8-section--deep :where(h1, h2, h3, h4),
.g8-on-dark :where(h1, h2, h3, h4) {
	color: var(--g8-bg);
}

.g8-section--deep :where(a:not([class])),
.g8-on-dark :where(a:not([class])) {
	color: var(--g8-bg);
}

.g8-stack > * + * {
	margin-block-start: var(--g8-s-4);
}

.g8-grid {
	display: grid;
	gap: var(--g8-s-5);
	grid-template-columns: 1fr;
}

.g8-actions {
	display: flex;
	flex-direction: column;
	gap: var(--g8-s-3);
}

.g8-embed {
	display: block;
	width: 100%;
	min-height: 600px;
	border: 0;
	border-radius: var(--g8-radius);
	background: var(--g8-surface);
}

/* ---------- Accueil ---------- */
.g8-hero {
	padding-block: clamp(4rem, 10vw, 8rem);
}

.g8-hero__inner {
	max-width: 56rem;
}

.g8-hero__lead {
	max-width: 44rem;
	margin-block-end: var(--g8-s-6);
}

.g8-services,
.g8-portfolio {
	margin: var(--g8-s-6) 0 0;
	padding: 0;
	list-style: none;
}

.g8-card.g8-service {
	border-block-start: 4px solid var(--g8-accent);
}

.g8-services__cta {
	margin-block-start: var(--g8-s-6);
}

.g8-band {
	display: grid;
	gap: var(--g8-s-5);
	justify-items: start;
}

.g8-band :where(h2) {
	margin: 0;
	max-width: 40rem;
}

.g8-project {
	position: relative;
}

.g8-project :where(h3) {
	font-size: var(--g8-fs-h4);
	margin-block-end: var(--g8-s-2);
}

.g8-project__link {
	color: var(--g8-primary);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

/* Toute la carte est cliquable, le lien reste le seul élément focusable. */
.g8-project__link::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
}

.g8-card.g8-project:hover {
	box-shadow: var(--g8-shadow-md);
}

.g8-project:has(.g8-project__link:focus-visible) {
	outline: 3px solid var(--g8-primary);
	outline-offset: 3px;
}

.g8-project__link:focus-visible {
	outline: none; /* l'anneau est porté par la carte (:focus-within) */
}

@media (min-width: 1024px) {
	.g8-band {
		grid-template-columns: 1fr auto;
		align-items: center;
	}
}

/* ---------- Boutons (design système) ---------- */
/* Contour (défaut) */
.g8-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--g8-s-2);
	min-height: 44px;
	min-width: 44px;
	padding: 0.75rem 1.5rem;
	border: 1.5px solid var(--g8-border);
	border-radius: var(--g8-radius-pill);
	background: transparent;
	color: var(--g8-primary);
	font-family: var(--g8-font-body);
	font-size: var(--g8-fs-body);
	font-weight: var(--g8-fw-strong);
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s ease-out, color 0.2s ease-out, border-color 0.2s ease-out;
}

.g8-btn:hover {
	background: var(--g8-primary);
	color: var(--g8-bg);
}

/* Plein */
.g8-btn--solid {
	background: var(--g8-primary);
	color: var(--g8-bg);
}

.g8-btn--solid:hover {
	background: var(--g8-primary-hover);
	border-color: var(--g8-primary-hover);
}

/* Accent: un seul par écran (« Prendre rendez-vous ») */
.g8-btn--accent {
	background: var(--g8-accent);
	border-color: var(--g8-accent);
	color: var(--g8-on-accent);
}

.g8-btn--accent:hover {
	background: var(--g8-accent-hover);
	border-color: var(--g8-accent-hover);
	color: var(--g8-on-accent);
}

/* Contour sur fond sombre */
.g8-on-dark .g8-btn:not(.g8-btn--solid, .g8-btn--accent),
.g8-section--deep .g8-btn:not(.g8-btn--solid, .g8-btn--accent) {
	border-color: var(--g8-bg);
	color: var(--g8-bg);
}

.g8-on-dark .g8-btn:not(.g8-btn--solid, .g8-btn--accent):hover,
.g8-section--deep .g8-btn:not(.g8-btn--solid, .g8-btn--accent):hover {
	background: var(--g8-bg);
	color: var(--g8-deep);
}

/* ---------- Cartes ---------- */
.g8-card {
	background: var(--g8-surface);
	border: 1px solid var(--g8-line);
	border-radius: var(--g8-radius);
	box-shadow: var(--g8-shadow);
	padding: var(--g8-s-5);
	color: var(--g8-ink);
}

.g8-card--lg {
	border-radius: var(--g8-radius-lg);
	padding: var(--g8-s-6);
}

.g8-card :where(h2, h3, h4):last-child,
.g8-card :where(p):last-child {
	margin-block-end: 0;
}

/* Encadrés */
.g8-note {
	padding: var(--g8-s-4) var(--g8-s-5);
	border-radius: var(--g8-radius);
	background: var(--g8-peach);
	color: var(--g8-ink);
}

.g8-note--info {
	background: var(--g8-lavender);
}

/* ---------- Formulaires ---------- */
.g8-form {
	display: grid;
	gap: var(--g8-s-5);
}

.g8-field {
	display: grid;
	gap: var(--g8-s-2);
}

.g8-label {
	font-weight: var(--g8-fw-strong);
	color: var(--g8-ink);
}

.g8-required {
	color: var(--g8-ink);
	font-weight: var(--g8-fw-strong);
}

.g8-input {
	width: 100%;
	min-height: 44px;
	padding: 0.625rem 0.875rem;
	border: 1.5px solid var(--g8-border);
	border-radius: var(--g8-radius);
	background: var(--g8-surface);
	color: var(--g8-ink);
	font-family: var(--g8-font-body);
	font-size: 1rem; /* ≥ 16 px: pas de zoom automatique sur iOS */
	line-height: 1.5;
}

input.g8-input[type="file"]::file-selector-button {
	min-height: 36px;
	margin-inline-end: var(--g8-s-3);
	padding: 0.375rem 1rem;
	border: 1.5px solid var(--g8-border);
	border-radius: var(--g8-radius-pill);
	background: var(--g8-bg);
	color: var(--g8-primary);
	font: inherit;
	font-weight: var(--g8-fw-strong);
	cursor: pointer;
}

textarea.g8-input {
	min-height: 9rem;
	resize: vertical;
}

.g8-input::placeholder {
	color: var(--g8-ink-muted); /* placeholders seulement (4.18:1); jamais d'information essentielle */
	opacity: 1;
}

.g8-input[type="file"] {
	padding: 0.5rem;
	cursor: pointer;
}

.g8-hint {
	font-size: var(--g8-fs-small);
	color: var(--g8-ink-soft);
}

/* Erreur: toujours un message texte (« Erreur : … »). Le texte reste violet foncé: l'orange
   en texte sur crème (2.24:1) échoue l'AA; l'orange sert de repère visuel en bordure. */
.g8-field--error .g8-input,
.g8-input[aria-invalid="true"] {
	box-shadow: 0 0 0 3px var(--g8-accent);
}

.g8-error :where(p, ul) {
	margin: 0;
}

.g8-error :where(ul) {
	padding-inline-start: 1.25em;
	font-weight: var(--g8-fw-body);
}

.g8-error {
	padding-inline-start: var(--g8-s-3);
	border-inline-start: 4px solid var(--g8-accent);
	color: var(--g8-ink);
	font-weight: var(--g8-fw-strong);
}

.g8-success {
	padding-inline-start: var(--g8-s-3);
	border-inline-start: 4px solid var(--g8-success);
	color: var(--g8-ink);
	font-weight: var(--g8-fw-strong);
}

/* Message global du formulaire (envoyé / erreur), au-dessus des champs */
.g8-contact > .g8-error,
.g8-contact > .g8-success {
	margin-block-end: var(--g8-s-5);
}

/* Champ piège anti-robots: hors écran, ignoré des lecteurs d'écran (aria-hidden dans le HTML). */
.g8-hp {
	position: absolute;
	left: -10000px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* ---------- En-tête ---------- */
.g8-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: var(--g8-bg);
	border-bottom: 1px solid var(--g8-line);
}

.g8-header__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--g8-s-3);
	min-height: 4.5rem;
}

.g8-brand {
	display: inline-flex;
	align-items: center;
	gap: var(--g8-s-3);
	min-height: 44px;
	color: var(--g8-primary);
	font-family: var(--g8-font-head);
	font-size: 1.5rem;
	text-decoration: none;
}

.g8-brand img {
	width: 44px;
	height: 44px;
}

.g8-nav__toggle {
	display: none; /* affiché seulement quand le JS est actif (.g8-js) */
}

.g8-nav__list {
	display: flex;
	flex-wrap: wrap;
	gap: var(--g8-s-1) var(--g8-s-4);
	margin: 0;
	padding: 0;
	list-style: none;
}

.g8-nav__link {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding-inline: var(--g8-s-2);
	color: var(--g8-primary);
	font-weight: var(--g8-fw-strong);
	text-decoration: none;
	border-radius: var(--g8-radius-sm);
}

.g8-nav__link:hover {
	text-decoration: underline;
	text-underline-offset: 0.25em;
}

.g8-nav__link[aria-current="page"] {
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 0.25em;
}

/* Mobile avec JS: menu repliable */
.g8-js .g8-nav__toggle {
	display: inline-flex;
}

.g8-js .g8-nav {
	flex-basis: 100%;
}

.g8-js .g8-nav__list {
	display: none;
	flex-direction: column;
	padding-block: var(--g8-s-2) var(--g8-s-4);
}

.g8-js .g8-nav.is-open .g8-nav__list {
	display: flex;
}

/* ---------- Pied de page ---------- */
.g8-footer {
	padding-block: var(--g8-s-7);
	background: var(--g8-deep);
	color: var(--g8-bg);
}

.g8-footer__grid {
	display: grid;
	gap: var(--g8-s-6);
}

.g8-footer__slogan {
	margin: 0;
	color: var(--g8-bg);
	font-family: var(--g8-font-head);
	font-size: var(--g8-fs-h4);
	line-height: 1.25;
}

.g8-footer__title {
	margin: 0 0 var(--g8-s-3);
	color: var(--g8-bg);
	font-family: var(--g8-font-body);
	font-size: var(--g8-fs-body);
	font-weight: var(--g8-fw-strong);
}

.g8-footer__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.g8-footer__link {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	color: var(--g8-bg);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

.g8-footer__legal {
	margin-block-start: var(--g8-s-6);
	padding-block-start: var(--g8-s-4);
	border-top: 1px solid var(--g8-purple-500);
	font-size: var(--g8-fs-small);
}

/* ---------- Focus visible (WCAG 2.4.7, 1.4.11) ----------
   Violet 3 px, décalage 3 px: 11:1 sur crème. L'orange du design système (2.24:1) échoue
   le seuil de 3:1 sur crème; décision de Ben: garder le violet. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible,
.g8-btn:focus-visible {
	outline: 3px solid var(--g8-primary);
	outline-offset: 3px;
}

/* Sur fond sombre: anneau crème (violet = 1.1:1 sur --g8-deep). */
.g8-on-dark :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible,
.g8-section--deep :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible,
.g8-footer :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible,
.g8-on-dark .g8-btn:focus-visible,
.g8-section--deep .g8-btn:focus-visible {
	outline-color: var(--g8-bg);
}

/* Lien d'évitement (WCAG 2.4.1): visible seulement au focus clavier. */
.g8-skip-link {
	position: absolute;
	inset-block-start: var(--g8-s-2);
	inset-inline-start: var(--g8-s-2);
	z-index: 1000;
	min-height: 44px;
	padding: 0.75rem 1.5rem;
	border-radius: var(--g8-radius-pill);
	background: var(--g8-primary);
	color: var(--g8-bg);
	transform: translateY(-200%);
}

.g8-skip-link:focus {
	transform: none;
}

/* Texte pour lecteurs d'écran seulement. */
.g8-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* ---------- Points d'arrêt ---------- */
@media (min-width: 480px) {
	.g8-actions {
		flex-direction: row;
		flex-wrap: wrap;
	}
}

@media (min-width: 768px) {
	.g8-grid--2,
	.g8-grid--3 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.g8-footer__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	/* Menu toujours visible à partir de 768 px */
	.g8-js .g8-nav__toggle {
		display: none;
	}

	.g8-js .g8-nav {
		flex-basis: auto;
	}

	.g8-js .g8-nav__list,
	.g8-nav__list {
		display: flex;
		flex-direction: row;
		padding-block: 0;
	}
}

@media (min-width: 1024px) {
	.g8-grid--3 {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.g8-footer__grid {
		grid-template-columns: 2fr 1fr 1fr;
	}
}

@media (min-width: 1280px) {
	.g8-container {
		width: min(100% - 4rem, var(--g8-container));
	}
}

/* ---------- Mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation: none !important;
		transition: none !important;
		scroll-behavior: auto !important;
	}
}
