/*
 * Charte « Registre » (commune avec l'application, voir donatware-app/docs/charte-graphique.md) :
 * bleu encre pour les actions, filet laiton en ornement, bandeau bleu nuit dans les deux thèmes.
 * Polices IBM Plex (licence SIL OFL 1.1, voir fonts/OFL.txt), hébergées ici.
 */
@font-face {
  font-family: "IBM Plex Sans";
  src: url("fonts/ibm-plex-sans-latin-var.woff2") format("woff2");
  font-weight: 100 700;
  font-stretch: 85% 100%;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Serif";
  src: url("fonts/ibm-plex-serif-latin-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/ibm-plex-mono-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #1d3a6e;
  --ink-hover: #16305c;
  --ink-soft: #9db8ee;
  --brass: #c0912f;
  --night: #121a2a;
  --on-night: #e6e9ef;
  --on-night-muted: #a3adc0;
  --bg: #f2f3f6;
  --surface: #ffffff;
  --border: #dde1e8;
  --text: #141c2b;
  --muted: #566176;
  --link: var(--ink);

  --radius-sm: 2px;
  --radius: 4px;
  --radius-lg: 6px;

  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: "IBM Plex Serif", Georgia, "Times New Roman", serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brass: #e2b45c;
    --night: #0a0f19;
    --bg: #0e1420;
    --surface: #151d2c;
    --border: #253047;
    --text: #e6e9ef;
    --muted: #9aa4b5;
    --link: var(--ink-soft);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 2px solid var(--ink-soft); outline-offset: 3px; border-radius: var(--radius-sm); }

.wrap { width: 100%; max-width: 960px; margin: 0 auto; padding: 0 16px; }

.logo { display: block; width: 100%; height: auto; }

.mono { font-family: var(--font-mono); font-size: 0.95em; }

/* Bandeau bleu nuit, identique dans les deux thèmes (comme la barre latérale de l'application) */
.masthead { background: var(--night); color: var(--on-night); }
.masthead a { color: var(--on-night); }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 20px; padding-bottom: 20px; }
.topbar-end { justify-content: flex-end; }
.topbar .home { display: block; width: 150px; }
.topbar nav { display: flex; gap: 20px; font-size: 0.9375rem; }
.topbar nav a { text-decoration: none; color: var(--on-night-muted); }
.topbar nav a:hover { color: var(--on-night); }

/* Accueil : page entière bleu nuit, dans les deux thèmes */
body.home { background: var(--night); color: var(--on-night); }
body.home footer { border-top-color: #232d42; color: var(--on-night-muted); }
body.home footer a { color: var(--ink-soft); }

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: 48px;
  padding-bottom: 72px;
}
.hero h1 { margin: 0; width: 100%; display: flex; justify-content: center; }
.hero .logo { max-width: 450px; color: var(--on-night); }
.tagline {
  margin: 24px 0 0;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(1.25rem, 3.5vw, 1.625rem);
  line-height: 1.3;
  color: var(--on-night-muted);
}
.hero .rule { width: 2.5rem; height: 2px; margin: 24px 0 36px; background: var(--brass); border: 0; }

.button {
  display: inline-block;
  padding: 11px 22px;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s ease;
}
.hero .button-primary { background: var(--ink-soft); color: var(--night); }
.hero .button-primary:hover { background: #c3d4f5; }

.contact-mail { margin: 16px 0 0; font-size: 0.9375rem; color: var(--on-night-muted); }

/*
 * Animations de l'accueil, en CSS uniquement : fond (lignes de registre fixes, deux halos qui dérivent),
 * logo dévoilé, apparition en cascade, survols. Seuls l'opacité, la position et le flou sont animés.
 * Rien ne bouge si le système demande moins d'animations (prefers-reduced-motion).
 */
body.home > * { position: relative; z-index: 1; }

/* Lignes de registre, estompées vers les bords */
body.home::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, transparent 0 31px, rgba(157, 184, 238, 0.07) 31px 32px);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 0%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 0%, transparent 75%);
}

/* Halos : bleu encre (body::after) et laiton (.hero::before) */
body.home::after,
body.home .hero::before {
  content: "";
  position: fixed;
  z-index: -1;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(60px);
}
body.home::after {
  z-index: 0;
  top: -10vmax;
  left: -10vmax;
  width: 60vmax;
  height: 60vmax;
  background: radial-gradient(circle, rgba(61, 102, 178, 0.38), transparent 65%);
}
body.home .hero::before {
  right: -12vmax;
  bottom: -14vmax;
  width: 50vmax;
  height: 50vmax;
  background: radial-gradient(circle, rgba(192, 145, 47, 0.16), transparent 65%);
}

/* Bouton : soulèvement, halo et reflet au survol */
.hero .button-primary {
  position: relative;
  overflow: hidden;
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.hero .button-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.55) 50%, transparent 65%);
  transform: translateX(-110%);
  pointer-events: none;
}
.hero .button-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px -6px rgba(157, 184, 238, 0.55); }
.hero .button-primary:active { transform: translateY(0); }
.hero .button-primary:hover::after { transform: translateX(110%); transition: transform 0.7s ease; }

/* Liens : soulignement qui glisse de gauche à droite */
body.home .topbar nav a,
body.home footer a {
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) left bottom / 0 1px no-repeat;
  padding-bottom: 2px;
  transition: background-size 0.3s ease, color 0.2s ease;
}
body.home .topbar nav a:hover,
body.home footer a:hover { background-size: 100% 1px; }

@media (prefers-reduced-motion: no-preference) {
  body.home::after { animation: drift-ink 34s ease-in-out infinite alternate; }
  body.home .hero::before { animation: drift-brass 41s ease-in-out infinite alternate; }

  .hero .logo { animation: draw 1.1s cubic-bezier(0.65, 0, 0.35, 1) both; }
  .hero .tagline { animation: rise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) 0.6s both; }
  .hero .rule { animation: stretch 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) 0.75s both; }
  .hero .button { animation: rise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) 0.85s both; }
  .hero .contact-mail { animation: rise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) 0.95s both; }
  body.home .topbar { animation: fade 0.5s ease 0.2s both; }
}

@keyframes draw {
  from { clip-path: inset(0 100% 0 0); filter: blur(4px); opacity: 0.4; }
  to { clip-path: inset(0 0 0 0); filter: blur(0); opacity: 1; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes stretch {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes drift-ink {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(28vw, 18vh) scale(1.15); }
}
@keyframes drift-brass {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-22vw, -16vh) scale(1.1); }
}

/* Mentions légales */
.page-title { padding-top: 40px; padding-bottom: 48px; }
.page-title h1 { margin: 0; font-family: var(--font-serif); font-weight: 600; font-size: clamp(1.75rem, 5vw, 2.25rem); line-height: 1.2; }
.page-title .rule { width: 2.5rem; height: 2px; margin: 14px 0 0; background: var(--brass); border: 0; }

.legal { max-width: 760px; padding-top: 16px; padding-bottom: 64px; }
.legal section { padding: 24px 0; border-top: 1px solid var(--border); }
.legal section:first-child { border-top: 0; }
.legal h2 { font-family: var(--font-sans); font-size: 1.125rem; margin: 0 0 10px; }
.legal p, .legal li { margin: 0 0 10px; }
.legal p:last-child { margin-bottom: 0; }
.legal ul { margin: 0 0 10px; padding-left: 1.2rem; }
.legal .updated { color: var(--muted); font-size: 0.9375rem; }

.table-wrap { overflow-x: auto; margin: 12px 0; }
.legal table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.legal th { font-weight: 600; }

/* Pied de page */
footer {
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--muted);
}
footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; padding-top: 20px; padding-bottom: 20px; }
footer p { margin: 0; }
footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }

main { flex: 1; }

