/* ParesiA — feuille de style commune (accueil + mentions légales)
   Polices auto-hébergées (SIL OFL 1.1) : aucune requête vers un service tiers. */

@font-face {
  font-family: "Commissioner";
  src: url("../fonts/commissioner.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Martian Mono";
  src: url("../fonts/martian-mono.woff2") format("woff2");
  font-weight: 100 800;
  font-stretch: 75% 112.5%;
  font-display: swap;
}

/* Couleurs du logo : bleu #0566A8, ciel #15A8E2, flamme #FFC81E.
   Thème clair : papier gris très clair, encre presque noire.
   Thème sombre : gris anthracite, encre claire. */
:root {
  color-scheme: light;
  --bg: #f3f4f6;
  --surface: #ffffff;
  --ink: #0b1620;
  --muted: #4c5763;
  --line: #c4cad1;
  --edge: #0b1620;
  --link: #0566a8;
  --accent: #0566a8;
  --flame: #ffc81e;
  --tag-bg: #0b1620;
  --tag-ink: #ffc81e;
  --done-ink: #0b1620;
  --off: #9aa3ac;
  --focus: #0566a8;
  --shell: #e6e9ed;
  --glass: rgba(255, 255, 255, 0.55);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #25272b;
    --surface: #303338;
    --ink: #eceef1;
    --muted: #a9b0b8;
    --line: #4a4e55;
    --edge: #d5d9de;
    --link: #5cc6f5;
    --accent: #15a8e2;
    --flame: #ffc81e;
    --tag-bg: #ffc81e;
    --tag-ink: #25272b;
    --done-ink: #25272b;
    --off: #6c727a;
    --focus: #ffc81e;
    --shell: #1c1e21;
    --glass: rgba(48, 51, 56, 0.5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #25272b;
  --surface: #303338;
  --ink: #eceef1;
  --muted: #a9b0b8;
  --line: #4a4e55;
  --edge: #d5d9de;
  --link: #5cc6f5;
  --accent: #15a8e2;
  --flame: #ffc81e;
  --tag-bg: #ffc81e;
  --tag-ink: #25272b;
  --done-ink: #25272b;
  --off: #6c727a;
  --focus: #ffc81e;
  --shell: #1c1e21;
  --glass: rgba(48, 51, 56, 0.5);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Commissioner", system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.55;
  font-weight: 420;
  font-feature-settings: "kern", "liga";
}

a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.mono {
  font-family: "Martian Mono", ui-monospace, monospace;
  font-size: 0.875em;
  font-stretch: 87.5%;
  overflow-wrap: anywhere;
}

/* Gabarit : large, marges latérales réduites */
.wrap {
  width: 100%;
  max-width: 84rem;
  margin-inline: auto;
  padding-inline: clamp(1rem, 3.5vw, 3rem);
}

/* ---------- En-tête ---------- */

.top {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-top: 1.5rem;
  padding-bottom: 1rem;
}
.home { display: flex; align-items: center; gap: 0.9rem; color: inherit; text-decoration: none; }
.badge { width: 5.5rem; height: 5.5rem; border-radius: 50%; flex: none; }
.wordmark { font-weight: 800; font-size: 2.1rem; letter-spacing: -0.02em; line-height: 1; }
.wordmark small {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.9375rem;
  font-weight: 550;
  letter-spacing: 0;
  color: var(--muted);
}

.theme-toggle {
  margin-left: auto;
  display: none; /* visible seulement si JavaScript est actif */
  align-items: center;
  gap: 0.5rem;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 650;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--edge);
  border-radius: 0;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--accent);
}
.js .theme-toggle { display: inline-flex; }
.theme-toggle:hover { box-shadow: 2px 2px 0 var(--accent); transform: translate(2px, 2px); }
.theme-toggle svg { width: 1.1rem; height: 1.1rem; }
/* L'icône montre le thème vers lequel on bascule */
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }

/* ---------- Cadre de contenu, d'une autre teinte ---------- */

.shell {
  max-width: 88rem;
  margin: 0.75rem auto 0;
  margin-inline: clamp(0.5rem, 2vw, 1.5rem);
  background: var(--shell);
  border: 1px solid var(--line);
  padding-bottom: 3.5rem;
}
@media (min-width: 92rem) { .shell { margin-inline: auto; } }

/* ---------- Compteurs : cadres flottants décalés ---------- */

.metrics {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(1rem, 2.5vw, 2rem);
  padding-top: 1.5rem;
  padding-bottom: 1rem;
}
.metrics[hidden] { display: none; }

/* Ligne qui traverse derrière les cadres */
.metrics::before {
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: 45%;
  border-top: 2px solid var(--line);
}

.frame {
  align-self: start;
  position: relative;
  z-index: 1;
  background: var(--glass);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 2px solid var(--edge);
  padding: 0.7rem 1rem 0.8rem;
}
.f-events   { grid-column: 1 / span 3;  margin-top: 0.6rem; box-shadow: 8px 8px 0 var(--accent); }
.f-profiles { grid-column: 5 / span 3;  margin-top: 1.9rem; box-shadow: -7px 8px 0 var(--edge); }
.f-live     { grid-column: 10 / span 3; margin-top: 0;      box-shadow: 8px 8px 0 var(--flame); }

.frame .k {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 650;
  color: var(--muted);
}
.frame .v {
  margin: 0.35rem 0 0;
  font-family: "Martian Mono", ui-monospace, monospace;
  font-stretch: 87.5%;
  font-weight: 700;
  font-size: clamp(1.6rem, 2.8vw, 2.4rem);
  line-height: 1;
  letter-spacing: -0.03em;
}
.frame .v .grp { margin-left: 0.22em; }
.metrics .when {
  grid-column: 1 / -1;
  margin: 1.4rem 0 0;
  text-align: right;
  font-family: "Martian Mono", ui-monospace, monospace;
  font-size: 0.75rem;
  font-stretch: 87.5%;
  color: var(--muted);
}

.dot {
  display: inline-block;
  width: 0.65rem; height: 0.65rem;
  border-radius: 50%;
  background: var(--flame);
  flex: none;
}

/* ---------- Ligne de symétrie brisée ---------- */

.break { position: relative; height: 2.5rem; }
.break span { position: absolute; display: block; }
.break span:first-child {
  left: clamp(1rem, 3.5vw, 3rem);
  width: 58%;
  top: 0.4rem;
  border-top: 3px solid var(--edge);
}
.break span:last-child {
  left: calc(58% + clamp(1rem, 3.5vw, 3rem) + 1.5rem);
  right: clamp(1rem, 3.5vw, 3rem);
  top: 1.9rem;
  border-top: 3px solid var(--accent);
}

/* ---------- Titre, explication, adresses ---------- */

.intro {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(1rem, 2.5vw, 2rem);
  padding-top: 1.5rem;
  padding-bottom: 4.5rem;
}
.intro h1 {
  grid-column: 1 / span 8;
  margin: 0;
  font-size: clamp(2.6rem, 6.8vw, 6rem);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.035em;
  max-width: 13ch;
}
.pitch {
  grid-column: 9 / span 4;
  align-self: end;
  margin: 0 0 0.4rem;
  padding-left: 1.1rem;
  border-left: 5px solid var(--flame);
  font-size: 1.125rem;
  line-height: 1.5;
  font-weight: 500;
  max-width: 34ch;
}

.nodes {
  grid-column: 1 / span 8;
  min-width: 0;
  list-style: none;
  margin: 3.5rem 0 0;
  padding: 0;
  border-bottom: 1px solid var(--line);
}
.nodes li {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0;
  border-top: 1px solid var(--line);
}
.via {
  flex: none;
  width: 4.75rem;
  font-size: 0.8125rem;
  font-weight: 650;
  color: var(--muted);
}
.addr {
  flex: 1 1 auto;
  min-width: 0;
  font-family: "Martian Mono", ui-monospace, monospace;
  font-size: 0.875rem;
  font-stretch: 87.5%;
  font-weight: 450;
  white-space: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

.copy {
  display: none;
  flex: none;
  width: 2.1rem; height: 2.1rem;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 1.5px solid var(--line);
  border-radius: 0;
  cursor: pointer;
}
.js .copy { display: inline-flex; }
.copy svg { width: 1.05rem; height: 1.05rem; }
.copy .i-done { display: none; }
.copy:hover { border-color: var(--edge); }
.copy[data-done] { background: var(--flame); border-color: var(--flame); color: var(--done-ink); }
.copy[data-done] .i-copy { display: none; }
.copy[data-done] .i-done { display: block; }

.nodes-note {
  grid-column: 1 / span 7;
  margin: 0.9rem 0 0;
  font-size: 0.875rem;
  color: var(--muted);
  max-width: 70ch;
}

/* ---------- Le relais en détail ---------- */

.details {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(1rem, 2.5vw, 2rem);
  padding-top: 3rem;
  border-top: 3px solid var(--edge);
}
.details-head { grid-column: 1 / span 4; }
.facts { grid-column: 5 / span 8; }

.details h2, .legal h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.pulse {
  display: none;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 2rem;
  font-size: 0.9375rem;
  font-weight: 550;
  color: var(--muted);
}
.js .pulse { display: flex; }
.pulse .dot { background: var(--off); }
.pulse[data-state="up"] { color: var(--ink); }
.pulse[data-state="up"] .dot { background: var(--flame); }

.facts { margin: 0; border-top: 2px solid var(--edge); }
.facts > div {
  display: grid;
  grid-template-columns: 12rem 1fr;
  gap: 0.25rem 1.5rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}
.facts > div:last-child { border-bottom: 2px solid var(--edge); }
.facts dt { color: var(--muted); font-size: 0.9375rem; font-weight: 600; padding-top: 0.1rem; }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

.nips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 0.45rem 1.5rem;
}
.nips a { display: flex; gap: 0.75rem; align-items: center; color: inherit; text-decoration: none; }
.nips a:hover span:last-child { text-decoration: underline; }
.nips .n {
  font-family: "Martian Mono", ui-monospace, monospace;
  font-size: 0.75rem;
  font-weight: 700;
  font-stretch: 87.5%;
  background: var(--tag-bg);
  color: var(--tag-ink);
  min-width: 2.6rem;
  text-align: center;
  padding: 0.15rem 0.3rem;
}

/* ---------- Page légale ---------- */

.legal-head { padding-top: 2.5rem; padding-bottom: 3rem; }
.legal-head h1 {
  margin: 0;
  font-size: clamp(2.2rem, 5.5vw, 4.5rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.035em;
  max-width: 16ch;
}
.legal-head .updated {
  display: inline-block;
  margin: 1.25rem 0 0;
  padding-left: 0.9rem;
  border-left: 5px solid var(--flame);
  font-size: 0.9375rem;
  color: var(--muted);
}

.legal section {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(1rem, 2.5vw, 2rem);
  padding: 2.25rem 0 1.5rem;
  border-top: 2px solid var(--edge);
}
.legal section:first-child { border-top-width: 3px; }
.legal section > h2 { grid-column: 1 / span 4; grid-row: 1 / span 12; align-self: start; }
.legal section > :not(h2) { grid-column: 5 / span 8; }
.legal p, .legal li { max-width: 68ch; }
.legal p { margin: 0 0 1rem; }
.legal ul { padding-left: 1.2rem; margin: 0 0 1rem; }
.legal li { margin: 0.3rem 0; }
.legal li::marker { color: var(--accent); }
.legal .facts { margin-bottom: 0.5rem; }

/* ---------- Pied de page ---------- */

.foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  margin-top: 1rem;
  padding-top: 1.5rem;
  padding-bottom: 2.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
}
.foot a { color: var(--ink); }

/* ---------- Écrans moyens et petits ---------- */

@media (max-width: 60rem) {
  .metrics { grid-template-columns: minmax(0, 1fr); row-gap: 1.25rem; padding-top: 1.5rem; padding-bottom: 2.5rem; }
  .metrics::before { display: none; }
  .f-events, .f-profiles, .f-live { grid-column: 1; margin-top: 0; }
  .f-events   { margin-right: 22%; box-shadow: 8px 8px 0 var(--accent); }
  .f-profiles { margin-left: 18%;  margin-right: 6%; box-shadow: -8px 8px 0 var(--edge); }
  .f-live     { margin-right: 10%; box-shadow: 8px 8px 0 var(--flame); }
  .frame .v { font-size: clamp(1.6rem, 7vw, 2.1rem); }
  .f-events, .f-profiles, .f-live { box-shadow: 6px 6px 0 var(--accent); }
  .f-profiles { box-shadow: -6px 6px 0 var(--edge); }
  .f-live { box-shadow: 6px 6px 0 var(--flame); }
  .metrics .when { text-align: left; margin-top: 0.5rem; }
  .badge { width: 4rem; height: 4rem; }
  .wordmark { font-size: 1.6rem; }

  .intro { grid-template-columns: minmax(0, 1fr); padding-bottom: 3rem; }
  .intro h1, .pitch, .nodes, .nodes-note { grid-column: 1; }
  .pitch { margin-top: 1.75rem; align-self: start; }
  .nodes { margin-top: 2.5rem; }

  .details { grid-template-columns: minmax(0, 1fr); }
  .details-head, .facts { grid-column: 1; }

  .legal section { grid-template-columns: minmax(0, 1fr); }
  .legal section > h2, .legal section > :not(h2) { grid-column: 1; }
  .legal section > h2 { grid-row: auto; }
}
@media (max-width: 36rem) {
  .facts > div { grid-template-columns: 1fr; }
  .via { width: 3.75rem; }
  .addr { font-size: 0.8125rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .f-live .dot { animation: flicker 2.4s ease-in-out infinite; }
  @keyframes flicker {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 200, 30, 0.6); }
    50% { box-shadow: 0 0 0 5px rgba(255, 200, 30, 0); }
  }
}
