/* NOUS. — application */

@font-face {
	font-family: "Bodoni Moda";
	src: url("fonts/bodoni-moda.woff2") format("woff2");
	font-weight: 400 900;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "Bodoni Moda";
	src: url("fonts/bodoni-moda-italic.woff2") format("woff2");
	font-weight: 400 900;
	font-style: italic;
	font-display: swap;
}
@font-face {
	font-family: "Jost";
	src: url("fonts/jost.woff2") format("woff2");
	font-weight: 100 900;
	font-style: normal;
	font-display: swap;
}

:root {
	--night: #10070C;
	--wine: #370E22;
	--passion: #A51D46;
	--rose: #ED4779;
	--gold: #D9AD87;
	--ivory: #F6E8DF;
	--text: #F6E8DF;
	--muted: rgba(246, 232, 223, .62);
	--faint: rgba(246, 232, 223, .38);
	--line: rgba(217, 173, 135, .18);
	--line-strong: rgba(217, 173, 135, .38);
	--veil: rgba(55, 14, 34, .52);
	--veil-strong: rgba(55, 14, 34, .82);
	--display: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;
	--ui: "Jost", "Futura", "Century Gothic", system-ui, sans-serif;
	--safe-top: env(safe-area-inset-top, 0px);
	--safe-bottom: env(safe-area-inset-bottom, 0px);
	--nav-h: 68px;
	--ease: cubic-bezier(.22, .8, .24, 1);
	color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
html { background: var(--night); -webkit-text-size-adjust: 100%; }
body {
	min-height: 100dvh;
	font-family: var(--ui);
	font-size: 16px;
	font-weight: 380;
	line-height: 1.5;
	color: var(--text);
	background: var(--night);
	-webkit-font-smoothing: antialiased;
	-webkit-tap-highlight-color: transparent;
	overscroll-behavior-y: none;
}
body::before {
	content: "";
	position: fixed;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background:
		radial-gradient(120% 70% at 85% -10%, rgba(165, 29, 70, .30), transparent 60%),
		radial-gradient(90% 60% at -10% 105%, rgba(55, 14, 34, .9), transparent 70%),
		var(--night);
}
img { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--gold); }
:focus-visible { outline: 2px solid var(--rose); outline-offset: 3px; border-radius: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.noscript { padding: 40px; text-align: center; }

/* ---------- Démarrage ---------- */
.splash {
	position: fixed;
	inset: 0;
	display: grid;
	place-items: center;
	background: var(--night);
	z-index: 50;
	transition: opacity .5s var(--ease), visibility .5s;
}
.splash__mark,
.mark {
	font-family: var(--display);
	font-style: italic;
	font-weight: 500;
	letter-spacing: .01em;
	color: var(--ivory);
}
.splash__mark { font-size: clamp(56px, 18vw, 96px); animation: breathe 2.4s var(--ease) infinite; }
.splash__mark span, .mark span { color: var(--rose); }
body:not(.is-booting) .splash { opacity: 0; visibility: hidden; }
@keyframes breathe { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }

/* ---------- Structure ---------- */
.screen {
	min-height: 100dvh;
	padding: calc(var(--safe-top) + 18px) 20px calc(var(--nav-h) + var(--safe-bottom) + 28px);
	max-width: 560px;
	margin: 0 auto;
	animation: enter .45s var(--ease) both;
}
.screen--bare { padding-bottom: calc(var(--safe-bottom) + 28px); }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-height: 44px;
	margin-bottom: 18px;
}
.topbar .mark { font-size: 28px; line-height: 1; }
.topbar__title { font-family: var(--display); font-style: italic; font-size: 28px; font-weight: 500; margin: 0; }
.icon-btn {
	display: inline-grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border: 1px solid var(--line);
	border-radius: 50%;
	background: var(--veil);
	color: var(--ivory);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
}
.icon-btn svg { width: 20px; height: 20px; }

.presence {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 6px 12px 6px 6px;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--veil);
	font-size: 13px;
	color: var(--muted);
	text-decoration: none;
}
.presence .avatar { width: 28px; height: 28px; font-size: 13px; }
.presence.is-online { color: var(--ivory); }
.presence.is-online .avatar { box-shadow: 0 0 0 2px var(--night), 0 0 0 3.5px var(--rose); }

/* ---------- Avatars ---------- */
.avatar {
	position: relative;
	display: grid;
	place-items: center;
	flex: none;
	width: 64px;
	height: 64px;
	border-radius: 50%;
	overflow: hidden;
	background: linear-gradient(145deg, var(--passion), var(--wine));
	font-family: var(--display);
	font-style: italic;
	font-size: 26px;
	color: var(--ivory);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Accueil : arche ---------- */
.hero { display: grid; justify-items: center; text-align: center; margin: 4px 0 30px; }
.arch {
	position: relative;
	width: min(76vw, 300px);
	aspect-ratio: 4 / 5;
	border-radius: 999px 999px 22px 22px;
	overflow: hidden;
	background:
		radial-gradient(70% 55% at 50% 38%, rgba(237, 71, 121, .35), transparent 70%),
		linear-gradient(180deg, var(--wine), #1d0a14 80%);
	box-shadow:
		0 0 0 1px var(--line-strong),
		0 30px 80px -30px rgba(237, 71, 121, .45);
	animation: glow-in 1.4s var(--ease) both;
}
.arch::after {
	content: "";
	position: absolute;
	inset: 8px;
	border-radius: 999px 999px 16px 16px;
	border: 1px solid rgba(217, 173, 135, .35);
	pointer-events: none;
}
.arch > img { width: 100%; height: 100%; object-fit: cover; }
.arch__duo {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}
.arch__duo .avatar {
	width: 46%;
	height: auto;
	aspect-ratio: 1;
	font-size: clamp(30px, 10vw, 48px);
	box-shadow: 0 0 0 4px #24101a;
}
.arch__duo .avatar + .avatar { margin-left: -14%; }
.arch__amp {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: var(--night);
	box-shadow: 0 0 0 1px var(--line-strong), 0 0 26px rgba(237, 71, 121, .6);
	font-family: var(--display);
	font-style: italic;
	font-size: 24px;
	color: var(--rose);
}
.arch__edit {
	position: absolute;
	right: 16px;
	bottom: 16px;
	z-index: 2;
}
@keyframes glow-in {
	from { opacity: 0; transform: scale(.97); box-shadow: 0 0 0 1px var(--line), 0 0 0 0 rgba(237, 71, 121, 0); }
	to { opacity: 1; transform: none; }
}
.names {
	margin: 22px 0 6px;
	font-family: var(--display);
	font-style: italic;
	font-weight: 500;
	font-size: clamp(30px, 9vw, 40px);
	line-height: 1.1;
}
.names .amp { color: var(--rose); padding: 0 .12em; }
.phrase { margin: 0; max-width: 32ch; color: var(--gold); font-weight: 340; font-size: 16px; }

/* ---------- Titres de section ---------- */
.section { margin: 30px 0 0; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section__title { margin: 0; font-family: var(--display); font-style: italic; font-weight: 500; font-size: 22px; }
.section__note { margin: 0; font-size: 13px; color: var(--faint); }

/* ---------- Stories (emplacement) ---------- */
.stories { display: flex; gap: 18px; overflow-x: auto; padding: 4px 2px 6px; scrollbar-width: none; }
.stories::-webkit-scrollbar { display: none; }
.story { display: grid; justify-items: center; gap: 8px; width: 74px; flex: none; text-align: center; }
.story__ring {
	padding: 3px;
	border-radius: 50%;
	background: conic-gradient(from 210deg, rgba(217, 173, 135, .28), rgba(217, 173, 135, .08), rgba(217, 173, 135, .28));
}
.story__ring .avatar { width: 66px; height: 66px; box-shadow: 0 0 0 3px var(--night); }
.story__name { font-size: 13px; color: var(--muted); max-width: 74px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Espaces ---------- */
.spaces { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.space {
	position: relative;
	display: grid;
	align-content: end;
	gap: 4px;
	min-height: 150px;
	padding: 58px 16px 16px;
	border: 1px solid var(--line);
	border-radius: 20px;
	background: linear-gradient(160deg, rgba(55, 14, 34, .85), rgba(16, 7, 12, .7));
	color: var(--ivory);
	text-align: left;
	text-decoration: none;
	overflow: hidden;
	transition: transform .2s var(--ease), border-color .2s;
}
.space:active { transform: scale(.98); }
.space--wide { grid-column: 1 / -1; min-height: 150px; }
.space--chat { background: radial-gradient(120% 120% at 100% 0%, rgba(165, 29, 70, .7), transparent 60%), linear-gradient(160deg, var(--wine), #1a0911); }
.space__icon { position: absolute; top: 16px; left: 16px; width: 26px; height: 26px; color: var(--gold); }
.space__title { font-family: var(--display); font-style: italic; font-size: 22px; font-weight: 500; line-height: 1.15; }
.space__hint { font-size: 13px; color: var(--muted); line-height: 1.35; }
.soon-tag {
	position: absolute;
	top: 14px;
	right: 14px;
	padding: 3px 10px;
	border: 1px solid var(--line-strong);
	border-radius: 999px;
	font-size: 12px;
	color: var(--gold);
	background: rgba(16, 7, 12, .5);
}

/* ---------- Navigation ---------- */
.nav {
	position: fixed;
	left: 50%;
	bottom: calc(var(--safe-bottom) + 10px);
	transform: translateX(-50%);
	z-index: 20;
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	width: min(calc(100% - 24px), 440px);
	height: var(--nav-h);
	padding: 6px;
	border: 1px solid var(--line);
	border-radius: 26px;
	background: rgba(22, 9, 16, .82);
	backdrop-filter: blur(18px) saturate(1.2);
	-webkit-backdrop-filter: blur(18px) saturate(1.2);
	box-shadow: 0 18px 50px -20px rgba(0, 0, 0, .9);
}
.nav__item {
	position: relative;
	display: grid;
	place-items: center;
	align-content: center;
	gap: 3px;
	border: 0;
	border-radius: 20px;
	background: transparent;
	color: var(--faint);
	font-size: 12px;
	text-decoration: none;
	transition: color .2s, background .2s;
}
.nav__item svg { width: 22px; height: 22px; }
.nav__item[aria-current="page"] { color: var(--ivory); background: rgba(165, 29, 70, .28); }
.nav__item[aria-current="page"] svg { color: var(--rose); }
.nav__dot { position: absolute; top: 9px; right: calc(50% - 18px); width: 6px; height: 6px; border-radius: 50%; background: var(--gold); opacity: .7; }
.nav__item .avatar { width: 24px; height: 24px; font-size: 12px; }
.nav__item[aria-current="page"] .avatar { box-shadow: 0 0 0 2px var(--rose); }

/* ---------- Boutons, champs ---------- */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 52px;
	padding: 0 22px;
	border: 1px solid transparent;
	border-radius: 16px;
	background: linear-gradient(135deg, var(--passion), #7f1536);
	color: #fff;
	font-weight: 500;
	font-size: 16px;
	letter-spacing: .01em;
	text-decoration: none;
	box-shadow: 0 12px 30px -14px rgba(237, 71, 121, .7);
	transition: transform .15s var(--ease), filter .2s;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .55; cursor: progress; }
.btn--block { width: 100%; }
.btn--ghost { background: transparent; border-color: var(--line-strong); color: var(--ivory); box-shadow: none; }
.btn--quiet { background: var(--veil); border-color: var(--line); color: var(--ivory); box-shadow: none; }
.btn--danger { background: transparent; border-color: rgba(237, 71, 121, .45); color: #ff9db8; box-shadow: none; }
.btn--small { min-height: 38px; padding: 0 14px; border-radius: 12px; font-size: 14px; }
.btn svg { width: 18px; height: 18px; }

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label, .field__label { font-size: 14px; color: var(--muted); }
.input {
	width: 100%;
	min-height: 52px;
	padding: 0 16px;
	border: 1px solid var(--line);
	border-radius: 14px;
	background: rgba(16, 7, 12, .55);
	color: var(--ivory);
	font-size: 16px;
	transition: border-color .2s, box-shadow .2s;
}
textarea.input { min-height: 96px; padding: 14px 16px; resize: vertical; line-height: 1.45; }
.input:focus { outline: none; border-color: var(--rose); box-shadow: 0 0 0 3px rgba(237, 71, 121, .18); }
.input::placeholder { color: var(--faint); }
.check { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--muted); }
.check input { width: 20px; height: 20px; accent-color: var(--passion); }
.form-error { margin: 0 0 14px; padding: 12px 14px; border-radius: 12px; background: rgba(165, 29, 70, .22); border: 1px solid rgba(237, 71, 121, .35); color: #ffd3df; font-size: 15px; }
.form-hint { margin: 6px 0 0; font-size: 13px; color: var(--faint); }

/* ---------- Connexion ---------- */
.login {
	position: relative;
	display: grid;
	align-content: center;
	min-height: 100dvh;
	padding: calc(var(--safe-top) + 32px) 26px calc(var(--safe-bottom) + 32px);
	max-width: 440px;
	margin: 0 auto;
}
.login__glow {
	position: fixed;
	inset: -20% -40% auto;
	height: 70%;
	background: radial-gradient(50% 50% at 50% 50%, rgba(237, 71, 121, .28), transparent 70%);
	pointer-events: none;
	animation: glow-in 1.6s var(--ease) both;
}
.login .mark { position: relative; font-size: clamp(72px, 24vw, 112px); line-height: .95; margin: 0; }
.login__tagline { position: relative; margin: 10px 0 40px; color: var(--gold); font-size: 17px; font-weight: 340; }
.login form { position: relative; }
.login__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 22px; }
.login__lost { font-size: 14px; color: var(--muted); }
.pw { position: relative; }
.pw .input { padding-right: 56px; }
.pw__toggle { position: absolute; right: 4px; top: 4px; width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); display: grid; place-items: center; }
.pw__toggle svg { width: 20px; height: 20px; }

/* ---------- Profil ---------- */
.profile-head { display: grid; justify-items: center; text-align: center; gap: 10px; margin: 6px 0 26px; }
.profile-head .avatar { width: 132px; height: 132px; font-size: 54px; box-shadow: 0 0 0 1px var(--line-strong), 0 20px 60px -20px rgba(237, 71, 121, .55); }
.profile-head__photo { position: relative; }
.profile-head__photo .icon-btn { position: absolute; right: -2px; bottom: -2px; width: 42px; height: 42px; background: var(--passion); border-color: transparent; }
.profile-head__name { margin: 8px 0 0; font-family: var(--display); font-style: italic; font-weight: 500; font-size: 34px; line-height: 1.1; }
.profile-head__meta { margin: 0; font-size: 14px; color: var(--muted); }

.panel {
	margin: 0 0 14px;
	padding: 18px;
	border: 1px solid var(--line);
	border-radius: 22px;
	background: var(--veil);
}
.panel__title { margin: 0 0 4px; font-size: 17px; font-weight: 500; }
.panel__text { margin: 0 0 14px; font-size: 14px; color: var(--muted); }
.panel__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel .btn + .btn { margin-top: 10px; }
.panel__actions { display: flex; flex-wrap: wrap; gap: 10px; }

.toggle { position: relative; width: 52px; height: 32px; flex: none; }
.toggle input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.toggle span { position: absolute; inset: 0; border-radius: 999px; background: rgba(246, 232, 223, .14); transition: background .2s; pointer-events: none; }
.toggle span::after { content: ""; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: var(--ivory); transition: transform .25s var(--ease); }
.toggle input:checked + span { background: var(--passion); }
.toggle input:checked + span::after { transform: translateX(20px); }
.toggle input:focus-visible + span { outline: 2px solid var(--rose); outline-offset: 3px; }

.devices { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.device { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: rgba(16, 7, 12, .45); border: 1px solid var(--line); }
.device svg { width: 22px; height: 22px; color: var(--gold); flex: none; }
.device__body { flex: 1; min-width: 0; }
.device__name { font-size: 15px; }
.device__meta { font-size: 13px; color: var(--faint); }
.device__here { font-size: 12px; color: var(--rose); }

.person { display: grid; justify-items: center; text-align: center; gap: 12px; padding-top: 10px; }
.person .avatar { width: min(62vw, 240px); height: auto; aspect-ratio: 1; font-size: 88px; box-shadow: 0 0 0 1px var(--line-strong), 0 30px 80px -30px rgba(237, 71, 121, .6); }

/* ---------- Module à venir ---------- */
.soon { display: grid; justify-items: center; text-align: center; padding-top: 12vh; }
.soon__icon { width: 64px; height: 64px; color: var(--gold); margin-bottom: 18px; }
.soon__title { margin: 0; font-family: var(--display); font-style: italic; font-weight: 500; font-size: 38px; }
.soon__text { margin: 10px 0 16px; max-width: 30ch; color: var(--muted); }
.soon .soon-tag { position: static; }

/* ---------- Feuille (bottom sheet) ---------- */
.sheet-backdrop {
	position: fixed;
	inset: 0;
	z-index: 40;
	background: rgba(8, 3, 6, .7);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	animation: fade .25s var(--ease) both;
}
.sheet {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 41;
	max-height: 92dvh;
	overflow: auto;
	margin: 0 auto;
	max-width: 560px;
	padding: 10px 20px calc(var(--safe-bottom) + 22px);
	border-radius: 28px 28px 0 0;
	border: 1px solid var(--line);
	border-bottom: 0;
	background: linear-gradient(180deg, #2a0c1a, var(--night) 70%);
	animation: rise .35s var(--ease) both;
}
.sheet__grip { width: 44px; height: 5px; margin: 0 auto 14px; border-radius: 3px; background: rgba(246, 232, 223, .22); }
.sheet__title { margin: 0 0 14px; font-family: var(--display); font-style: italic; font-weight: 500; font-size: 26px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }

/* ---------- Recadrage ---------- */
.cropper {
	position: relative;
	width: 100%;
	max-width: 420px;
	margin: 0 auto 16px;
	aspect-ratio: var(--crop-ratio, 1);
	overflow: hidden;
	border-radius: 20px;
	background: #000;
	touch-action: none;
	user-select: none;
}
.cropper img { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; will-change: transform; pointer-events: none; }
.cropper__mask { position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 9999px rgba(8, 3, 6, .55); }
.cropper--circle .cropper__mask { border-radius: 50%; box-shadow: 0 0 0 9999px rgba(8, 3, 6, .6); border: 2px solid rgba(246, 232, 223, .8); }
.cropper--arch .cropper__mask { border-radius: 999px 999px 16px 16px; box-shadow: 0 0 0 9999px rgba(8, 3, 6, .6); border: 2px solid rgba(246, 232, 223, .8); }
.zoom { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; color: var(--muted); }
.zoom input { flex: 1; accent-color: var(--rose); }
.zoom svg { width: 18px; height: 18px; }

/* ---------- Toasts & bannières ---------- */
.toasts {
	position: fixed;
	left: 50%;
	top: calc(var(--safe-top) + 12px);
	transform: translateX(-50%);
	z-index: 60;
	display: grid;
	gap: 8px;
	width: min(calc(100% - 24px), 420px);
	pointer-events: none;
}
.toast {
	padding: 12px 16px;
	border-radius: 14px;
	border: 1px solid var(--line-strong);
	background: rgba(36, 12, 24, .95);
	font-size: 15px;
	box-shadow: 0 16px 40px -20px #000;
	animation: drop .3s var(--ease) both;
	pointer-events: auto;
}
.toast--error { border-color: rgba(237, 71, 121, .6); }
@keyframes drop { from { opacity: 0; transform: translateY(-10px); } }

.banner {
	position: fixed;
	left: 50%;
	bottom: calc(var(--nav-h) + var(--safe-bottom) + 22px);
	transform: translateX(-50%);
	z-index: 30;
	display: flex;
	align-items: center;
	gap: 12px;
	width: min(calc(100% - 24px), 440px);
	padding: 12px 12px 12px 16px;
	border-radius: 18px;
	border: 1px solid var(--line-strong);
	background: rgba(36, 12, 24, .96);
	font-size: 14px;
	animation: rise .35s var(--ease) both;
}
.banner p { margin: 0; flex: 1; }
.offline-pill {
	position: fixed;
	top: calc(var(--safe-top) + 10px);
	right: 12px;
	z-index: 30;
	padding: 5px 12px;
	border-radius: 999px;
	background: rgba(36, 12, 24, .95);
	border: 1px solid var(--line-strong);
	font-size: 12px;
	color: var(--gold);
}

/* ---------- Accès refusé ---------- */
.denied { display: grid; align-content: center; justify-items: center; text-align: center; min-height: 100dvh; padding: 32px; }
.denied p { max-width: 30ch; color: var(--muted); }

/* ---------- Grand écran ---------- */
@media (min-width: 900px) {
	.screen { padding-top: 40px; }
	.nav { bottom: 18px; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

.stack { display: grid; gap: 10px; }
.stack > p { margin: 0 0 4px; }
