/* Le Relevé — ce que les pages du site ont en commun.
 *
 * Les couleurs sont RECOPIÉES de `lib/core/theme/lr_colors.dart`, qui fait foi
 * (constitution, principe X) : une page web ne lit pas les tokens Dart. Si la
 * palette bouge dans l'app, elle bouge ici aussi.
 *
 * La règle de l'app vaut pour le site : la couleur appartient aux TÂCHES,
 * l'interface autour reste neutre. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/BricolageGrotesque-variable.ttf") format("truetype-variations");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("/fonts/HankenGrotesk-variable.ttf") format("truetype-variations");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/JetBrainsMono-variable.ttf") format("truetype-variations");
  font-weight: 100 800;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  --bg: #f2f3f7;
  --surface: #ffffff;
  --sunk: #e7e9f0;
  --line: #dadde7;
  --line-control: #7d8196;
  --ink: #14151c;
  --ink-dim: #484b5c;
  --ink-mute: #63677a;
  --on-ink: #ffffff;
  --danger: #c0262d;

  /* Les tâches : un fond, et l'encre qui tient dessus (≥ 4,5:1). */
  --lagon: #2ec4b6;       --lagon-ink: #062421;
  --violet: #6a4cf5;      --violet-ink: #ffffff;
  --bleu: #2f66e8;        --bleu-ink: #ffffff;
  --mandarine: #ff7a45;   --mandarine-ink: #2b0e02;
  --menthe: #5bd16a;      --menthe-ink: #082410;
  --soleil: #ffd23f;      --soleil-ink: #2b2100;
  --framboise: #ff5da2;   --framboise-ink: #2d0216;
  --ardoise: #a3a8bc;     --ardoise-ink: #12141c;

  --display: "Bricolage Grotesque", "Hanken Grotesk", system-ui, sans-serif;
  --text: "Hanken Grotesk", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;

  --r-tile: 16px;
  --r-card: 24px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --max: 72rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1015;
    --surface: #1a1b23;
    --sunk: #23252f;
    --line: #2e303c;
    --line-control: #6e7285;
    --ink: #f1f2f7;
    --ink-dim: #b9bccb;
    --ink-mute: #9296a8;
    --on-ink: #0f1015;
    --danger: #ff8a8f;
    --ardoise: #8c91a6;
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-feature-settings: "ss01";
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--violet); color: #fff; }

a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

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

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.02;
  text-wrap: balance;
  margin: 0;
}

p { margin: 0 0 1rem; text-wrap: pretty; }

.skip {
  position: absolute; left: 1rem; top: -4rem;
  background: var(--ink); color: var(--on-ink);
  padding: 0.75rem 1rem; border-radius: 12px; z-index: 50;
  text-decoration: none; font-weight: 600;
}
.skip:focus { top: 1rem; }

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

.top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
}
.top-inner {
  max-width: var(--max); margin: 0 auto;
  padding: 0.75rem var(--gutter);
  display: flex; align-items: center; gap: 1rem;
}
.brand {
  display: inline-flex; align-items: center; gap: 0.6rem;
  text-decoration: none;
  font-family: var(--display); font-weight: 750; font-size: 1.2rem;
  letter-spacing: -0.02em;
  min-height: 44px;
}
.brand svg { width: 32px; height: 32px; flex: none; border-radius: 9px; }
.top nav { margin-left: auto; display: flex; gap: 0.25rem; align-items: center; }
.top nav a {
  text-decoration: none; font-weight: 600; font-size: 0.95rem;
  padding: 0.6rem 0.8rem; border-radius: 999px; color: var(--ink-dim);
  min-height: 44px; display: inline-flex; align-items: center;
}
.top nav a:hover { color: var(--ink); background: var(--sunk); }
.top nav a[aria-current="page"] { color: var(--ink); background: var(--sunk); }

/* Le ruban de la journée : la barre segmentée de l'écran « Aujourd'hui ». */
.ribbon {
  display: flex; gap: 3px; height: 6px;
  max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter);
}
.ribbon span {
  flex: var(--w, 1) 1 0; border-radius: 99px;
  background: var(--sunk);
  transition: background-color 500ms var(--ease);
}
.ribbon span.on { background: var(--c); }

/* ─── Boutons ─────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  min-height: 56px; padding: 0 1.4rem;
  border-radius: 999px; border: 0;
  font: 650 1rem/1 var(--text);
  text-decoration: none; cursor: pointer;
  transition: transform 160ms var(--ease), background-color 160ms, box-shadow 160ms;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn:active { transform: scale(0.97); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-ink { background: var(--ink); color: var(--on-ink); }
.btn-ink:hover { box-shadow: 0 8px 24px -10px color-mix(in srgb, var(--ink) 60%, transparent); }
.btn-line {
  background: transparent; color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--line-control);
}
.btn-line:hover { background: var(--surface); }

.stores { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
/* Les badges officiels des stores, tels que fournis par Apple et Google : on
   ne les redessine pas, on ne les recolore pas. Même hauteur pour les deux. */
.badge { display: inline-flex; border-radius: 10px; transition: transform 160ms var(--ease); }
.badge:active { transform: scale(0.97); }
.badge img { display: block; height: 54px; width: auto; }

/* ─── Pages de lecture (aide, confidentialité) ────────────────────────── */

.read {
  max-width: 44rem; margin: 0 auto;
  padding: clamp(2rem, 6vw, 4.5rem) var(--gutter) 5rem;
}
.read h1 { font-size: clamp(2.4rem, 7vw, 3.75rem); margin-bottom: 1rem; }
.read .lede {
  font-size: 1.2rem; color: var(--ink-dim); margin-bottom: 2.5rem;
}
.read h2 {
  font-size: 1.5rem; letter-spacing: -0.02em;
  margin: 3rem 0 0.9rem;
}
.read h3 { font-size: 1.1rem; margin: 1.75rem 0 0.4rem; letter-spacing: -0.01em; }
.read p, .read li { color: var(--ink-dim); }
.read strong { color: var(--ink); }
.read ul { padding-left: 1.2rem; }
.read li { margin-bottom: 0.45rem; }
.read .updated { color: var(--ink-mute); font-size: 0.95rem; }
.read kbd, .read .ui {
  font-family: var(--text); font-weight: 650; color: var(--ink);
  background: var(--sunk); border-radius: 8px; padding: 0.05rem 0.45rem;
  white-space: nowrap;
}

/* L'essentiel, posé sur une tuile de tâche : la seule couleur de la page. */
.gist {
  border-radius: var(--r-card);
  padding: 1.4rem 1.5rem;
  margin: 0 0 1rem;
  background: var(--c, var(--lagon));
  color: var(--ci, var(--lagon-ink));
}
.gist p { color: inherit; margin: 0; font-size: 1.1rem; }
.gist p + p { margin-top: 0.6rem; }
.gist strong { color: inherit; }

details {
  border-top: 1px solid var(--line);
  padding: 0.25rem 0;
}
details:last-of-type { border-bottom: 1px solid var(--line); }
summary {
  cursor: pointer; list-style: none;
  font-family: var(--display); font-weight: 700; font-size: 1.2rem;
  letter-spacing: -0.015em; line-height: 1.3;
  padding: 1rem 2.5rem 1rem 0; position: relative;
  min-height: 48px;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: ""; position: absolute; right: 0.5rem; top: 1.35rem;
  width: 10px; height: 10px;
  border-right: 2.5px solid var(--ink-mute); border-bottom: 2.5px solid var(--ink-mute);
  transform: rotate(45deg); transition: transform 200ms var(--ease);
}
details[open] summary::after { transform: rotate(-135deg); top: 1.6rem; }
details > div { padding: 0 0 1.25rem; }

/* ─── Pied de page ────────────────────────────────────────────────────── */

.foot {
  border-top: 1px solid var(--line);
  color: var(--ink-mute); font-size: 0.95rem;
}
.foot-inner {
  max-width: var(--max); margin: 0 auto;
  padding: 2rem var(--gutter) 2.5rem;
  display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center;
}
.foot nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.foot a { color: var(--ink-dim); min-height: 44px; display: inline-flex; align-items: center; }
.foot .who { margin-left: auto; }

@media (max-width: 40rem) {
  .top nav a.hide-sm { display: none; }
  .foot .who { margin-left: 0; }
}

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