/**
 * Page « Bientôt » de brokeo.ch.
 * Charte Brokeo, identité « le bloc » : aplats, ni dégradé, ni ombre ; Manrope ; fond uni et filet.
 * La mascotte a sa propre feuille (mascotte.css, copie exacte) : rien ici ne change son dessin.
 * Mouvement : transform et opacity seulement.
 */

/* Manrope, Copyright 2019 The Manrope Project Authors, licence SIL Open Font License 1.1. */
@font-face {
	font-family: "Manrope";
	font-style: normal;
	font-weight: 200 800;
	font-display: swap;
	src: url("polices/manrope-latin-wght-normal.woff2") format("woff2");
}

:root {
	--bg: #F7F7F4;
	--alt: #ECEDE8;
	--surface: #FFFFFF;
	--ink: #12263F;
	--muted: #4A5A6E;
	--line: #D5D8D2;
	--coral: #FF6B4A;
	color-scheme: light;

	/* Unité de la scène : le mot et la mascotte grandissent ensemble. */
	--u: min(20vw, (100vh - 124px) / 3.7, 15rem);
	--rebond: cubic-bezier(.3, 1.35, .5, 1);
	--marge: clamp(20px, 4vw, 48px);
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--bg: #0D1826;
		--alt: #112136;
		--surface: #142538;
		--ink: #F2F2ED;
		--muted: #A7B3C2;
		--line: #2A3D54;
		color-scheme: dark;
	}
}

:root[data-theme="dark"] {
	--bg: #0D1826;
	--alt: #112136;
	--surface: #142538;
	--ink: #F2F2ED;
	--muted: #A7B3C2;
	--line: #2A3D54;
	color-scheme: dark;
}

html {
	height: 100%;
	background: var(--bg);
	-webkit-text-size-adjust: 100%;
}

body {
	min-height: 100%;
	margin: 0;
	overflow: hidden;
	color: var(--ink);
	background: var(--bg);
	font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
	-webkit-font-smoothing: antialiased;
	-webkit-tap-highlight-color: transparent;
}

.vh {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* Le carré corail : signe de Brokeo (logo, fin du mot) */
.sq {
	display: inline-block;
	width: .6em;
	height: .6em;
	margin-left: .06em;
	background: var(--coral);
	border-radius: .08em;
	vertical-align: .02em;
}

/* Le mur de carrés, derrière tout (dessiné par bientot.js) */
.mur {
	position: fixed;
	inset: 0;
	z-index: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
}

/* En-tête : logo et bouton clair ou sombre */
.tete {
	position: fixed;
	top: 0;
	right: 0;
	left: 0;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 44px;
	padding: max(var(--marge), env(safe-area-inset-top)) max(var(--marge), env(safe-area-inset-right)) 0 max(var(--marge), env(safe-area-inset-left));
}

.logo {
	margin: 0;
	overflow: hidden;
	font-size: clamp(1.375rem, 1.1rem + 1vw, 1.75rem);
	font-weight: 800;
	line-height: 1.2;
	letter-spacing: -.02em;
}

.logo__mot,
.logo .sq {
	animation: monte .7s var(--rebond) .15s both;
}

.logo__mot {
	display: inline-block;
}

.logo .sq {
	animation-delay: .32s;
}

.theme {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	color: inherit;
	background: var(--bg);
	border: 1.5px solid var(--ink);
	border-radius: 6px;
	cursor: pointer;
	transition: transform .25s var(--rebond);
	animation: monte .7s var(--rebond) .4s both;
}

.theme[hidden] {
	display: none;
}

.theme:hover {
	transform: translateY(-3px);
}

.theme:active {
	transform: translateY(0) scale(.94);
}

.theme:focus-visible {
	outline: 2px solid var(--coral);
	outline-offset: 3px;
}

/* Signe du bouton : un carré à moitié plein, qui se retourne */
.theme__signe {
	position: relative;
	width: 16px;
	height: 16px;
	overflow: hidden;
	border: 1.5px solid var(--ink);
	border-radius: 3px;
	transition: transform .5s var(--rebond);
}

.theme__signe::before {
	position: absolute;
	inset: 0 50% 0 0;
	background: var(--ink);
	content: "";
}

.theme[aria-pressed="true"] .theme__signe {
	transform: rotate(180deg);
}

/* La scène */
.scene {
	position: relative;
	z-index: 1;
	display: grid;
	place-items: center;
	box-sizing: border-box;
	min-height: 100vh;
	min-height: 100dvh;
	padding: 76px var(--marge) 40px;
	overflow: hidden;
	overflow: clip;
}

.heros {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
}

/* La chute du bloc : c'est l'enveloppe qui tombe, jamais le dessin */
.chute {
	align-self: flex-end;
	--taille: calc(var(--u) * 2.9);
	width: var(--taille);
	margin: 0 calc(var(--u) * -.5) calc(var(--taille) * -23 / 160) 0;
	transform-origin: 50% 83.6%;
	animation: chute 1.15s .55s both;
}

.chute .mascotte {
	width: 100%;
	height: auto;
}

@keyframes chute {
	0% { transform: translateY(-120vh); animation-timing-function: cubic-bezier(.5, 0, .9, .6); }
	55% { transform: translateY(0) scale(1, 1); animation-timing-function: ease-out; }
	64% { transform: translateY(0) scale(1.1, .86); animation-timing-function: ease-out; }
	78% { transform: translateY(-5%) scale(.97, 1.04); animation-timing-function: ease-in; }
	90% { transform: translateY(0) scale(1.03, .97); }
	100% { transform: translateY(0) scale(1, 1); }
}

/* Le filet : le sol, d'un bord à l'autre, qui commence par un trait corail sous le mot */
.filet {
	position: relative;
	width: 100%;
	height: 2px;
}

.filet::before {
	position: absolute;
	top: 0;
	right: -100vw;
	left: -100vw;
	height: 2px;
	background: var(--line);
	transform-origin: 0 50%;
	animation: trace .9s cubic-bezier(.2, .7, .2, 1) both;
	content: "";
}

.filet::after {
	position: absolute;
	top: 0;
	left: 0;
	width: calc(var(--u) * .34);
	height: 2px;
	background: var(--coral);
	transform-origin: 0 50%;
	animation: trace .5s cubic-bezier(.2, .7, .2, 1) .5s both;
	content: "";
}

/* Le trait corail file le long du filet à chaque saut (bientot.js pose la distance) */
.filet.file::after {
	animation: file 1.1s cubic-bezier(.6, 0, .3, 1) both;
}

@keyframes trace {
	from { transform: scaleX(0); }
	to { transform: scaleX(1); }
}

@keyframes file {
	0%, 100% { transform: translateX(0); }
	50% { transform: translateX(var(--course, 0)); }
}

/* Le mot : les lettres tombent de derrière le filet, une par une */
.mot {
	margin: 0;
	padding: .2em .02em .04em 0;
	overflow: hidden;
	font-size: var(--u);
	font-weight: 800;
	line-height: .92;
	letter-spacing: -.045em;
	white-space: nowrap;
}

.mot__lettres {
	display: block;
}

.l {
	display: inline-block;
	animation: tombe .75s var(--rebond) both;
}

.l:nth-child(1) { animation-delay: 1.55s; }
.l:nth-child(2) { animation-delay: 1.62s; }
.l:nth-child(3) { animation-delay: 1.69s; }
.l:nth-child(4) { animation-delay: 1.76s; }
.l:nth-child(5) { animation-delay: 1.83s; }
.l:nth-child(6) { animation-delay: 1.9s; }
.l:nth-child(7) { animation-delay: 1.97s; }

.point {
	transform-origin: 50% 100%;
	animation: pose .7s var(--rebond) 2.3s both;
}

/* La vague : les lettres sautent l'une après l'autre quand la mascotte saute */
.vague .l,
.vague .point {
	animation: saute .62s ease-out both;
}

.vague .l:nth-child(1) { animation-delay: .34s; }
.vague .l:nth-child(2) { animation-delay: .29s; }
.vague .l:nth-child(3) { animation-delay: .24s; }
.vague .l:nth-child(4) { animation-delay: .19s; }
.vague .l:nth-child(5) { animation-delay: .14s; }
.vague .l:nth-child(6) { animation-delay: .09s; }
.vague .l:nth-child(7) { animation-delay: .04s; }
.vague .point { animation-delay: 0s; }

@keyframes monte {
	from { transform: translateY(130%); }
	to { transform: translateY(0); }
}

@keyframes tombe {
	from { transform: translateY(-125%); }
	to { transform: translateY(0); }
}

@keyframes pose {
	0% { transform: translateY(-260%) scale(1, 1); }
	60% { transform: translateY(0) scale(1.25, .7); }
	100% { transform: translateY(0) scale(1, 1); }
}

@keyframes saute {
	0% { transform: translateY(0); }
	30% { transform: translateY(-13%); }
	58% { transform: translateY(0); }
	76% { transform: translateY(-4%); }
	100% { transform: translateY(0); }
}

/* Pied : le seul lien de la page, petit et gris */
.pied {
	position: fixed;
	bottom: 0;
	left: 0;
	z-index: 2;
	padding: 0 max(var(--marge), env(safe-area-inset-right)) max(calc(var(--marge) - 14px), env(safe-area-inset-bottom)) max(var(--marge), env(safe-area-inset-left));
}

.pied__lien,
.note__retour {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	color: var(--muted);
	font-size: .8125rem;
	font-weight: 500;
	text-decoration: underline;
	text-decoration-color: var(--line);
	text-underline-offset: 4px;
}

.pied__lien {
	animation: monte .7s var(--rebond) 2.6s both;
}

.pied__lien:hover,
.note__retour:hover {
	color: var(--ink);
	text-decoration-color: var(--coral);
}

.pied__lien:focus-visible,
.note__retour:focus-visible,
.logo__lien:focus-visible {
	outline: 2px solid var(--coral);
	outline-offset: 3px;
}

/* Page « Protection des données » : un texte court sous un filet */
.texte {
	overflow: auto;
}

.logo__lien {
	color: inherit;
	text-decoration: none;
}

.note {
	box-sizing: border-box;
	max-width: 44rem;
	padding: clamp(120px, 22vh, 200px) var(--marge) 64px;
	font-size: 1.0625rem;
	line-height: 1.6;
}

.note__filet {
	position: relative;
	height: 1px;
	margin-bottom: 40px;
	background: var(--line);
}

.note__filet::before {
	position: absolute;
	inset: 0 auto 0 0;
	width: 28px;
	background: var(--coral);
	content: "";
}

.note__titre {
	margin: 0 0 24px;
	font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.75rem);
	font-weight: 800;
	line-height: 1.1;
	letter-spacing: -.03em;
}

.note__mail {
	color: inherit;
	text-decoration-color: var(--coral);
	text-underline-offset: 4px;
}

.note p {
	margin: 0 0 16px;
}

/* Téléphone tenu droit : la mascotte reste dans l'écran */
@media (max-aspect-ratio: 3/4) {
	.chute {
		--taille: calc(var(--u) * 3.6);
		margin-right: calc(var(--u) * -.3);
	}
}

/* Mouvement réduit : l'image finale, complète et immobile */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation: none !important;
		transition: none !important;
	}

	.mur {
		display: none;
	}
}
