/* =====================================================================
   P'tit Nous — socle commun (tokens, polices, reset, typo, boutons,
   en-tête, pied de page). Partagé par l'accueil et les pages légales.
   Voir site/DESIGN.md. Ne pas dupliquer ces règles ailleurs.
   ===================================================================== */

/* ---------- Polices (auto-hébergées, aucune requête externe) ---------- */
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-latin-full-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-latin-full-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("../fonts/nunito-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("../fonts/nunito-latin-wght-italic.woff2") format("woff2");
  font-weight: 200 1000;
  font-style: italic;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  /* Nuit (anticipation, rêve) */
  --night: #120a15;
  --night-2: #1d1121;
  --night-3: #2a1830;
  /* Aube (révélation, douceur) — palette de l'app */
  --cream: #fff6f3;
  --blush: #ffe3ea;
  --petal: #ffc9d6;
  --peach: #ffd8c2;
  --rose: #f2849e;
  --rose-deep: #d9577a;
  --rose-ink: #b23a5e;           /* rose lisible sur crème (AA) */
  --lavender: #e6ddfb;
  --lilac: #b9a6f2;
  --lilac-deep: #8b73e0;
  --glow: #ffe9c7;               /* reflets dorés, très parcimonieux */
  --ink: #3b2b3f;
  --ink-soft: #6f5e75;
  --ink-faint: #a898ab;          /* décoratif uniquement : < 4.5:1 sur crème */
  --white: #ffffff;
  --line: rgba(59, 43, 63, 0.12);
  --line-night: rgba(255, 233, 240, 0.14);

  --grad-cta: linear-gradient(135deg, #c64873 0%, #b23a5e 55%, #9c2f53 100%); /* texte blanc ≥ 4.5:1 */
  --grad-dream: linear-gradient(180deg, #ffd9e4 0%, #e9dfff 100%);
  --grad-dawn: linear-gradient(135deg, #fff3f0 0%, #fde8f0 55%, #f1eafe 100%);
  --grad-pair: linear-gradient(90deg, var(--rose) 0%, var(--lilac) 100%);

  /* Typo */
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fs-mega: clamp(3.4rem, 1.2rem + 9.5vw, 11rem);
  --fs-h1: clamp(2.6rem, 1.4rem + 5vw, 6rem);
  --fs-h2: clamp(2rem, 1.2rem + 3.2vw, 4.2rem);
  --fs-h3: clamp(1.3rem, 1.05rem + 1vw, 1.9rem);
  --fs-lead: clamp(1.1rem, 1rem + 0.5vw, 1.4rem);
  --fs-body: 1.0625rem;
  --fs-small: 0.9rem;
  --fs-micro: 0.78rem;

  /* Espace & formes */
  --gutter: clamp(16px, 4vw, 40px);
  --maxw: 1240px;
  --maxw-text: 720px;
  --r-sm: 12px;
  --r-md: 20px;
  --r-lg: 32px;
  --r-xl: 48px;
  --r-pill: 999px;
  --shadow-soft: 0 10px 40px -12px rgba(217, 87, 122, 0.28);
  --shadow-float: 0 30px 80px -24px rgba(59, 43, 63, 0.35);

  /* Mouvement */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);       /* expo.out */
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-1: 160ms;
  --dur-2: 320ms;
  --dur-3: 640ms;
  --dur-4: 1100ms;

  color-scheme: light;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; }
img, svg, video { display: block; max-width: 100%; }
canvas { display: block; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
h1, h2, h3, h4, p, ul, ol, figure, blockquote, dl, dd { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
[hidden] { display: none !important; }

body {
  min-height: 100vh;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.65;
  font-weight: 450;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

::selection { background: var(--petal); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--rose-deep);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Typo ---------- */
.display, h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 0;
  letter-spacing: -0.02em;
  line-height: 1.02;
  text-wrap: balance;
}
.display em, h1 em, h2 em {
  font-style: italic;
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1;
}
p, li { text-wrap: pretty; }
.lead { font-size: var(--fs-lead); line-height: 1.55; color: var(--ink-soft); }
.eyebrow {
  font-family: var(--font-body);
  font-size: var(--fs-micro);
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* ---------- Mise en page ---------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.skip-link {
  position: fixed; left: 16px; top: -60px; z-index: 1000;
  padding: 10px 16px; border-radius: var(--r-pill);
  background: var(--ink); color: var(--cream); font-weight: 700; text-decoration: none;
  transition: top var(--dur-2) var(--ease-out);
}
.skip-link:focus { top: 16px; }
.nowrap { white-space: nowrap; }
.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;
}

/* ---------- Boutons ---------- */
.btn {
  --btn-h: 52px;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: var(--btn-h); padding: 0 26px;
  border-radius: var(--r-pill);
  font-weight: 800; font-size: 1rem; letter-spacing: 0.01em;
  text-decoration: none; white-space: nowrap;
  transition: transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out), background-color var(--dur-2);
  isolation: isolate;
}
.btn--primary { background: var(--grad-cta); color: var(--white); box-shadow: var(--shadow-soft); }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 16px 50px -12px rgba(217, 87, 122, 0.5); }
.btn--ghost { color: var(--ink); background: rgba(255, 255, 255, 0.6); box-shadow: inset 0 0 0 1px var(--line); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.btn--ghost:hover { background: var(--white); }
.btn--sm { --btn-h: 40px; padding: 0 18px; font-size: 0.9rem; }
.btn[aria-disabled="true"] { cursor: default; }

/* ---------- En-tête (pilule flottante en verre) ---------- */
.nav {
  position: fixed; inset: 14px 0 auto; z-index: 100;
  display: flex; justify-content: center; pointer-events: none;
  padding-inline: var(--gutter);
}
.nav__bar {
  pointer-events: auto;
  width: 100%; max-width: var(--maxw);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: 60px; padding: 0 8px 0 14px;
  border-radius: var(--r-pill);
  background: rgba(255, 246, 243, 0.72);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6), 0 8px 30px -12px rgba(59, 43, 63, 0.18);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  transition: background-color var(--dur-3) var(--ease-out), color var(--dur-3) var(--ease-out), transform var(--dur-3) var(--ease-out);
}
.nav[data-theme="night"] .nav__bar {
  background: rgba(29, 17, 33, 0.55);
  color: var(--cream);
  box-shadow: inset 0 0 0 1px var(--line-night), 0 8px 30px -12px rgba(0, 0, 0, 0.5);
}
.nav[data-hidden="true"] .nav__bar { transform: translateY(calc(-100% - 40px)); }
.nav__brand {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none;
  font-family: var(--font-display); font-size: 1.25rem; font-weight: 600;
  font-variation-settings: "opsz" 48, "SOFT" 100, "WONK" 1;
  letter-spacing: -0.01em;
}
.nav__brand img, .nav__brand svg { width: 38px; height: auto; }
.nav__links { display: none; gap: 4px; }
.nav__links a {
  padding: 8px 14px; border-radius: var(--r-pill);
  font-weight: 700; font-size: 0.92rem; text-decoration: none; opacity: 0.8;
  transition: opacity var(--dur-2), background-color var(--dur-2);
}
.nav__links a:hover { opacity: 1; background: rgba(242, 132, 158, 0.12); }
.nav__end { display: flex; align-items: center; gap: 6px; }
@media (min-width: 900px) { .nav__links { display: flex; } }

/* Sélecteur de langue */
.lang-switch {
  display: inline-flex; padding: 3px; border-radius: var(--r-pill);
  box-shadow: inset 0 0 0 1px var(--line);
}
.nav[data-theme="night"] .lang-switch { box-shadow: inset 0 0 0 1px var(--line-night); }
.lang-switch a {
  min-width: 36px; height: 30px; padding: 0 10px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-pill);
  font-size: 0.8rem; font-weight: 800; letter-spacing: 0.06em; text-decoration: none; opacity: 0.6;
  transition: opacity var(--dur-2), background-color var(--dur-2), color var(--dur-2);
}
.lang-switch a[aria-current="true"] { opacity: 1; background: var(--ink); color: var(--cream); }
.nav[data-theme="night"] .lang-switch a[aria-current="true"] { background: var(--cream); color: var(--ink); }

/* ---------- Pied de page ---------- */
.footer {
  position: relative;
  background: var(--night);
  color: rgba(255, 246, 243, 0.72);
  padding: clamp(64px, 10vw, 120px) 0 32px;
  overflow: hidden;
}
.footer a { color: rgba(255, 246, 243, 0.86); text-decoration: none; }
.footer a:hover { color: var(--white); }
.footer__grid {
  display: grid; gap: 40px;
  grid-template-columns: 1fr;
}
@media (min-width: 760px) { .footer__grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer__title { color: var(--cream); font-size: var(--fs-micro); font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; margin-bottom: 14px; }
.footer__list { display: grid; gap: 10px; list-style: none; padding: 0; margin: 0; }
.footer__legal p { margin: 0; }
.footer__wordmark {
  font-family: var(--font-display);
  font-size: clamp(4rem, 2rem + 14vw, 16rem);
  line-height: 0.85; letter-spacing: -0.04em;
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1;
  color: transparent;
  background: linear-gradient(180deg, rgba(255, 201, 214, 0.9) 0%, rgba(185, 166, 242, 0.25) 100%);
  -webkit-background-clip: text; background-clip: text;
  margin-top: clamp(48px, 8vw, 96px);
  white-space: nowrap;
  user-select: none;
}
.footer__legal {
  display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between;
  margin-top: 24px; padding-top: 24px;
  border-top: 1px solid var(--line-night);
  font-size: var(--fs-small);
}

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

/* ---------- Appareils tactiles : pas de flou d'arrière-plan pendant le scroll ----------
   Sur mobile, un backdrop-filter au-dessus d'un fond animé est recalculé à chaque image
   et fait saccader tout le défilement. Fond plus opaque à la place. */
@media (hover: none), (pointer: coarse) {
  .nav__bar { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(255, 246, 243, 0.94); }
  .nav[data-theme="night"] .nav__bar { background: rgba(29, 17, 33, 0.9); }
  .btn--ghost { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(255, 255, 255, 0.88); }
}
