/*
 * Le site de Halo : une seule feuille, écrite à la main, sans police chargée d'ailleurs ni script.
 * Les couleurs suivent la piste de l'identité (docs/IDENTITE.md 6.2) : le papier blanc cassé, l'encre,
 * un surligneur. Ce sont des variables, que la direction artistique (chantier I) remplacera.
 * Toutes les animations sont en CSS, et s'arrêtent quand le système demande moins de mouvement.
 */

@property --sec {
  syntax: "<integer>";
  inherits: false;
  initial-value: 7;
}

@property --min {
  syntax: "<integer>";
  inherits: false;
  initial-value: 42;
}

:root {
  --paper: #15151a;
  --ink: #f1ede4;
  --muted: #a9a49a;
  --faint: #6d6a63;
  --line: #2c2c33;
  --band: #1b1b21;
  --card: #222229;
  --glow: #2b2417;
  --frame: #3a3a42;
  /* toujours sombre, comme l'app par défaut ; le surligneur : menthe, pêche serait #ffc59e */
  --hl: #a8ebc4;
  --hl-soft: rgba(168, 235, 196, 0.32);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 14px 36px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.3), 0 30px 70px rgba(0, 0, 0, 0.5);
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Noto Serif", serif;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-x: hidden;
}

/* le grain du papier, très léger, sur toute la page */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  background-image: url("/grain.svg");
  opacity: 0.12;
  mix-blend-mode: screen;
}

.wrap {
  max-width: 70rem;
  margin: 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

.narrow {
  max-width: 42rem;
  margin: 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-color: var(--hl);
  text-decoration-thickness: 0.22em;
  text-underline-offset: 0.12em;
}

a:hover {
  background: var(--hl-soft);
}

/* --- Le logo (celui de l'app, transparent) : la boucle suit l'encre du thème ------------------- */

.logo {
  display: block;
  height: 2.6rem;
  width: auto;
}

.logo-band {
  fill: #86ddab;
}

.logo-word {
  fill: #1a1a22;
}

.logo-loop {
  fill: none;
  stroke: var(--ink);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* --- L'en-tête : le logo au milieu, le bouton à droite, au bord du texte en filigrane ---------- */

.site-header {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  max-width: 82rem;
  margin: 0 auto;
  padding: 1.6rem 1.5rem 1rem;
}

.site-header .brand {
  grid-column: 2;
}

.site-header .pill {
  grid-column: 3;
  justify-self: end;
}

.brand {
  display: inline-block;
  text-decoration: none;
}

.brand:hover {
  background: none;
}

.pill {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  border-radius: 0.45rem;
  padding: 0.55rem 1.1rem;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
}

.pill:hover {
  background: var(--ink);
  opacity: 0.86;
}

.site-footer .logo {
  height: 2rem;
}

/* sur un téléphone, le logo reste seul en haut : les magasins sont juste dessous */
@media (max-width: 40rem) {
  .site-header .pill {
    display: none;
  }
}

/* --- Le haut de l'accueil : une page en filigrane, effacée en halo autour du titre ------------- */

.hero {
  position: relative;
  margin-top: -4.5rem;
  padding-top: 8.5rem;
  overflow: hidden;
}

.hero-page {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.hero-page p {
  margin: 0 auto;
  max-width: 82rem;
  padding: 0 1.5rem;
  text-indent: 2em;
  font-family: var(--serif);
  font-size: clamp(1.15rem, 2.2vw, 1.6rem);
  line-height: 1.75;
  text-align: justify;
  hyphens: auto;
  color: var(--ink);
  opacity: 0.09;
}

.hero-page p:first-child {
  padding-top: 5rem;
}

/* le halo : la lumière chaude au centre efface les lignes autour du titre, puis le bas se fond */
.hero-page::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 48% 30% at 50% 32%, var(--glow) 0%, var(--paper) 62%, transparent 100%),
    linear-gradient(to bottom, var(--paper) 4%, transparent 16%, transparent 52%, var(--paper) 80%);
}

.hero-inner {
  position: relative;
  text-align: center;
}

/* sur un téléphone, le halo s'élargit : le titre et le texte gardent leur clairière ; le titre se rapproche du logo */
@media (max-width: 40rem) {
  .hero {
    padding-top: 6rem;
  }

  .hero-page::after {
    background:
      radial-gradient(ellipse 95% 34% at 50% 30%, var(--glow) 0%, var(--paper) 70%, transparent 100%),
      linear-gradient(to bottom, var(--paper) 4%, transparent 16%, transparent 52%, var(--paper) 80%);
  }
}

.hero h1 {
  text-wrap: balance;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.7rem, 7.6vw, 5.4rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin: 0 auto 1.4rem;
  max-width: 12ch;
}

/* le mot gardé : le surligneur passe, puis la boucle se trace autour */
.circled {
  position: relative;
  display: inline-block;
  padding: 0 0.08em;
  margin: 0 0.1em 0 0.12em;
  z-index: 0;
}

.circled::before {
  content: "";
  position: absolute;
  left: 0.02em;
  right: 0.02em;
  top: 0.4em;
  bottom: 0.06em;
  background: var(--hl-soft);
  border-radius: 0.1em;
  transform: rotate(-1.5deg);
  transform-origin: left center;
  z-index: -1;
  animation: marker 0.7s 0.5s cubic-bezier(0.3, 0.7, 0.4, 1) both;
}

.circled svg {
  position: absolute;
  left: -0.36em;
  top: -0.2em;
  width: calc(100% + 0.72em);
  height: calc(100% + 0.42em);
  overflow: visible;
  pointer-events: none;
}

.circled path {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: draw 1s 1.15s cubic-bezier(0.45, 0.1, 0.3, 1) both;
}

@keyframes marker {
  from {
    transform: rotate(-1.5deg) scaleX(0);
  }
}

@keyframes draw {
  from {
    stroke-dashoffset: 1;
  }
}

.hero .lead {
  font-size: 1.2rem;
  max-width: 33rem;
  margin: 0 auto 1.8rem;
  color: var(--muted);
}

.stores {
  /* le bouton « Download now » y mène : les magasins arrivent au milieu de l'écran, pas collés en haut */
  scroll-margin-top: 35vh;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stores img {
  display: block;
  /* assez grands pour se toucher ; côte à côte jusque sur un petit téléphone */
  height: clamp(2.9rem, 9vw, 3.6rem);
  width: auto;
}

.note {
  margin: 0.9rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

/* --- Le téléphone : le geste de l'app, joué en boucle ----------------------------------------- */

.demo {
  position: relative;
  display: flex;
  justify-content: center;
  padding-top: 3.5rem;
  padding-bottom: 5rem;
}

/* la lumière de la lampe derrière le téléphone */
.demo::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 10%;
  width: 46rem;
  height: 34rem;
  margin-left: -23rem;
  background: radial-gradient(closest-side, var(--glow), transparent);
  z-index: -1;
}

.phone {
  position: relative;
  width: min(20rem, 100%);
  border: 0.6rem solid var(--frame);
  border-radius: 2.7rem;
  background: #f4efe3;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.phone::before {
  content: "";
  position: absolute;
  z-index: 3;
  top: 0.55rem;
  left: 50%;
  width: 5.5rem;
  height: 1.45rem;
  margin-left: -2.75rem;
  border-radius: 1rem;
  background: var(--frame);
}

.photo {
  padding: 2.7rem 1.05rem 7.5rem;
  color: #2b2a25;
  font-family: var(--serif);
  font-size: 0.68rem;
  line-height: 1.55;
  text-align: justify;
  hyphens: auto;
}

.folio {
  display: flex;
  justify-content: space-between;
  font-size: 0.56rem;
  letter-spacing: 0.14em;
  margin-bottom: 0.7rem;
}

.photo p {
  margin: 0;
  text-indent: 1.2em;
}

.photo mark {
  color: inherit;
  background: linear-gradient(#a8ebc4, #a8ebc4) no-repeat left center / 0% 100%;
  animation: sweep 9s infinite;
}

.tap {
  position: relative;
  display: inline-block;
  width: 0;
}

.tap::after {
  content: "";
  position: absolute;
  left: -0.9rem;
  top: -0.35rem;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  background: rgba(26, 26, 34, 0.22);
  opacity: 0;
  transform: scale(0.3);
  animation: tap 9s infinite;
}

.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  background: #ffffff;
  color: #1a1a22;
  border-radius: 1.2rem 1.2rem 0 0;
  padding: 0.9rem 1rem 1.3rem;
  box-shadow: 0 -8px 22px rgba(26, 26, 34, 0.1);
  font-size: 0.75rem;
  transform: translateY(105%);
  animation: sheet 9s infinite;
}

.sheet .label {
  color: #6b675f;
  margin: 0 0 0.4rem;
}

.sheet blockquote {
  margin: 0 0 0.8rem;
  font-family: var(--serif);
  font-size: 0.98rem;
  line-height: 1.35;
}

.keep {
  position: relative;
  display: inline-block;
  min-width: 5.2rem;
  height: 1.7rem;
  border-radius: 999px;
  background: #1a1a22;
  color: #faf7f0;
  font-weight: 600;
  animation: press 9s infinite;
}

.keep span {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.keep .done {
  opacity: 0;
  animation: done 9s infinite;
}

.keep .todo {
  animation: todo 9s infinite;
}

@keyframes tap {
  0%,
  14% {
    opacity: 0;
    transform: scale(0.3);
  }
  17% {
    opacity: 1;
    transform: scale(1);
  }
  22%,
  100% {
    opacity: 0;
    transform: scale(1.4);
  }
}

@keyframes sweep {
  0%,
  17% {
    background-size: 0% 100%;
  }
  32%,
  88% {
    background-size: 100% 100%;
  }
  95%,
  100% {
    background-size: 0% 100%;
  }
}

@keyframes sheet {
  0%,
  32% {
    transform: translateY(105%);
  }
  40%,
  86% {
    transform: translateY(0);
  }
  94%,
  100% {
    transform: translateY(105%);
  }
}

@keyframes press {
  0%,
  56% {
    transform: scale(1);
  }
  58% {
    transform: scale(0.92);
  }
  61%,
  100% {
    transform: scale(1);
  }
}

@keyframes todo {
  0%,
  58% {
    opacity: 1;
  }
  59%,
  100% {
    opacity: 0;
  }
}

@keyframes done {
  0%,
  58% {
    opacity: 0;
  }
  59%,
  100% {
    opacity: 1;
  }
}

/* --- Les sections ------------------------------------------------------------------------------ */

.section {
  padding-top: 5.5rem;
  padding-bottom: 1rem;
}

.title {
  text-wrap: balance;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 3.3rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 0.9rem;
}

.title span {
  color: var(--faint);
}

.center {
  text-align: center;
}

.sub {
  color: var(--muted);
  font-size: 1.1rem;
  max-width: 34rem;
  margin: 0 0 2.5rem;
}

.center .sub {
  margin-left: auto;
  margin-right: auto;
}

.duo {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
  gap: 1rem;
  margin-top: 2.5rem;
}

.tile {
  position: relative;
  border-radius: 1.6rem;
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 1.8rem 1.8rem 0;
  overflow: hidden;
}

.tile h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.65rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 0.6rem;
}

.tile > p {
  color: var(--muted);
  margin: 0 0 1.5rem;
  max-width: 28rem;
}

.chip {
  display: inline-block;
  padding: 0 0.35em;
  border: 1px solid var(--line);
  border-radius: 0.45em;
  background: var(--paper);
  font-style: italic;
}

.stage {
  position: relative;
  height: 16rem;
  margin: 0 -1.8rem;
  background: var(--band);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* La session : le chrono qui tourne, les pages qui avancent */
.session {
  width: 15rem;
  text-align: center;
}

.live {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.live::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #e5484d;
  animation: pulse 1.6s ease-in-out infinite;
}

.clock {
  font-family: var(--serif);
  font-size: 4rem;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  counter-reset: min var(--min) sec var(--sec);
  animation:
    seconds 60s steps(60, jump-none) infinite,
    minutes 600s steps(10, jump-none) infinite;
}

.clock::after {
  content: counter(min) ":" counter(sec, decimal-leading-zero);
}

.session .book {
  font-family: var(--serif);
  font-style: italic;
  margin: 0.2rem 0 0.9rem;
}

.pages {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--muted);
}

.progress {
  height: 0.45rem;
  border-radius: 1rem;
  background: var(--line);
  overflow: hidden;
  margin: 0.35rem 0;
}

.progress span {
  display: block;
  height: 100%;
  width: 30%;
  background: var(--hl);
  border-radius: 1rem;
  animation: read 14s ease-in-out infinite alternate;
}

@keyframes seconds {
  from {
    --sec: 0;
  }
  to {
    --sec: 59;
  }
}

@keyframes minutes {
  from {
    --min: 42;
  }
  to {
    --min: 51;
  }
}

@keyframes pulse {
  50% {
    opacity: 0.3;
  }
}

@keyframes read {
  to {
    width: 72%;
  }
}

/* La photo : une page prise de travers, qui se redresse puis se lit */
.scan {
  position: relative;
  width: 11rem;
  height: 13.5rem;
  perspective: 700px;
}

.sheet-paper {
  position: absolute;
  inset: 0;
  padding: 1rem 0.9rem;
  border-radius: 0.3rem;
  background: #fbf8f1;
  box-shadow: 0 10px 24px rgba(26, 26, 34, 0.16);
  transform-origin: 50% 60%;
  animation: rectify 7s cubic-bezier(0.5, 0, 0.3, 1) infinite;
}

.sheet-paper i {
  display: block;
  height: 0.32rem;
  margin: 0 0 0.55rem;
  border-radius: 1rem;
  background: rgba(26, 26, 34, 0.2);
}

.sheet-paper i:nth-child(3n) {
  width: 82%;
}

.sheet-paper i:nth-child(5) {
  background: linear-gradient(#a8ebc4, #a8ebc4) no-repeat left / 0% 100%, rgba(26, 26, 34, 0.2);
  animation: line 7s infinite;
}

.corner {
  position: absolute;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--hl);
  border: 2px solid var(--ink);
  animation: corners 7s infinite;
}

.corner.a {
  left: -0.3rem;
  top: -0.3rem;
}

.corner.b {
  right: -0.3rem;
  top: -0.3rem;
}

.corner.c {
  left: -0.3rem;
  bottom: -0.3rem;
}

.corner.d {
  right: -0.3rem;
  bottom: -0.3rem;
}

@keyframes rectify {
  0%,
  22% {
    transform: rotateX(28deg) rotateZ(-9deg) skewX(6deg) scale(0.92);
  }
  42%,
  92% {
    transform: none;
  }
  100% {
    transform: rotateX(28deg) rotateZ(-9deg) skewX(6deg) scale(0.92);
  }
}

@keyframes corners {
  0%,
  8% {
    opacity: 0;
  }
  14%,
  40% {
    opacity: 1;
  }
  48%,
  100% {
    opacity: 0;
  }
}

@keyframes line {
  0%,
  50% {
    background-size: 0% 100%, auto;
  }
  64%,
  92% {
    background-size: 100% 100%, auto;
  }
  100% {
    background-size: 0% 100%, auto;
  }
}

/* --- Les mémoires, qui défilent ---------------------------------------------------------------- */

.marquee {
  overflow: hidden;
  padding: 1rem 0 2rem;
  mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}

.track {
  display: flex;
  gap: 1rem;
  width: max-content;
  animation: slide 80s linear infinite;
}

.marquee:hover .track {
  animation-play-state: paused;
}

.memory {
  flex: 0 0 auto;
  width: 17rem;
  border-radius: 1.2rem;
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 1.2rem 1.3rem 1.1rem;
}

.memory:nth-child(odd) {
  transform: rotate(-1deg);
}

.memory:nth-child(even) {
  transform: rotate(0.8deg) translateY(0.6rem);
}

.memory blockquote {
  margin: 0 0 0.9rem;
  font-family: var(--serif);
  font-size: 1.12rem;
  line-height: 1.38;
}

.memory .source {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.tag {
  display: inline-block;
  margin-top: 0.7rem;
  padding: 0.05rem 0.55rem;
  border-radius: 999px;
  background: var(--band);
  font-size: 0.75rem;
  color: var(--muted);
}

@keyframes slide {
  to {
    transform: translateX(-50%);
  }
}

/* --- La semaine de l'onglet Moi --------------------------------------------------------------- */

.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
  gap: 2.5rem;
  align-items: center;
}

.split p {
  color: var(--muted);
  max-width: 30rem;
}

.week {
  border-radius: 1.6rem;
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 1.3rem 1.2rem 1.4rem;
}

.week-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.week-head span {
  color: var(--muted);
}

.days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: center;
}

.days li {
  margin: 0;
}

.cover {
  position: relative;
  display: block;
  width: 100%;
  max-width: 2.6rem;
  aspect-ratio: 2 / 3;
  margin: 0 auto 0.45rem;
  border-radius: 0.2rem;
  box-shadow: 0 2px 5px rgba(26, 26, 34, 0.18), inset 0.18rem 0 rgba(255, 255, 255, 0.18);
}

.cover.none {
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--line);
}

.cover.c1 {
  background: #2f4a6b;
}

.cover.c2 {
  background: #c26b4a;
}

.cover.c3 {
  background: #e7d9b8;
}

.cover.c4 {
  background: #4f6b4a;
}

.cover.c5 {
  background: #7a3b47;
}

.cover b {
  position: absolute;
  right: -0.35rem;
  top: -0.35rem;
  padding: 0 0.25rem;
  border-radius: 0.5rem;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.55rem;
  font-weight: 700;
  line-height: 1.4;
}

.letter {
  display: block;
  font-size: 0.7rem;
  color: var(--muted);
}

.date {
  position: relative;
  display: inline-block;
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.3;
  padding: 0 0.2rem;
}

.date.past {
  color: var(--faint);
}

.date.kept::before {
  content: "";
  position: absolute;
  inset: 0.35em -0.05em 0.05em;
  background: var(--hl-soft);
  transform: rotate(-4deg);
  border-radius: 0.15em;
  z-index: -1;
}

.date.today {
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--ink);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}

.date.finished svg {
  position: absolute;
  left: -0.35rem;
  top: -0.25rem;
  width: calc(100% + 0.7rem);
  height: calc(100% + 0.5rem);
  overflow: visible;
}

.date.finished path {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.6;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.days {
  isolation: isolate;
}

/* --- La FAQ, l'appel final -------------------------------------------------------- */

/* les questions sur un fond à elles, pour les détacher de la semaine au-dessus */
.faq {
  margin-top: 5.5rem;
  padding: 4.5rem 0 4rem;
  background: var(--band);
}

details {
  border-bottom: 1px solid var(--line);
}

summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.05rem 0;
  font-size: 1.08rem;
  font-weight: 550;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: "+";
  font-weight: 300;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--muted);
  transition: transform 0.2s;
}

details[open] summary::after {
  transform: rotate(45deg);
}

details p {
  margin: 0 0 1.15rem;
  color: var(--muted);
}

.cta {
  position: relative;
  /* le fond des questions le sépare déjà : autant d'air au-dessus qu'en dessous */
  padding: 5rem 0;
  text-align: center;
  overflow: hidden;
}

.cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 50% 70% at 50% 100%, var(--glow), transparent 75%);
  z-index: -1;
}

.cta .title {
  max-width: 17ch;
  margin: 0 auto 2rem;
}

/* --- L'apparition des sections au défilement, là où le navigateur sait le faire en CSS -------- */

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 28%;
    }
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(2rem);
  }
}

/* --- Les pages de texte ------------------------------------------------------------------------ */

.doc {
  padding-top: 2.5rem;
  padding-bottom: 1rem;
}

.doc h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.3rem, 6vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 0.8rem;
}

.doc h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.65rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 2.75rem 0 0.75rem;
}

.doc h3 {
  font-size: 1.08rem;
  margin: 1.75rem 0 0.4rem;
}

.doc p,
.doc ul,
.doc ol {
  margin: 0 0 1rem;
}

.doc li {
  margin-bottom: 0.4rem;
}

.updated {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

.lead {
  font-size: 1.2rem;
}

.summary {
  background: var(--card);
  border-radius: 1.2rem;
  padding: 1.1rem 1.3rem;
  margin: 1.75rem 0 2.25rem;
  box-shadow: var(--shadow);
}

.summary ul {
  margin: 0;
  padding-left: 1.2rem;
}

.mail {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.mail-big {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 5vw, 2.3rem);
  font-weight: 400;
  letter-spacing: -0.01em;
}

/* Les tableaux défilent dans leur cadre sur un téléphone, jamais la page */
.table-wrap {
  overflow-x: auto;
  margin: 0 0 1.25rem;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 32rem;
  font-size: 0.95rem;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.55rem 0.9rem 0.55rem 0;
  border-bottom: 1px solid var(--line);
}

th {
  font-weight: 600;
}

code {
  font-size: 0.92em;
}

/* Ce qui attend une décision : visible tant qu'il en reste, à retirer avant la mise en ligne */
.pending {
  background: #ffe58a;
  color: #4a3a00;
  border-radius: 0.25rem;
  padding: 0 0.25rem;
}

/* --- Le pied ------------------------------------------------------------------------------------ */

.site-footer {
  margin-top: 4rem;
  border-top: 1px solid var(--line);
}

.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding-top: 2rem;
  padding-bottom: 3rem;
}

.site-footer p {
  margin: 0.6rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.95rem;
}

.site-footer li {
  margin: 0 0 0.4rem;
}

.site-footer ul a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer ul a:hover {
  color: var(--ink);
  background: none;
  text-decoration: underline;
  text-decoration-color: var(--hl);
}

/* Le sélecteur de langue, en bas de page : une liste qui s'ouvre vers le haut, sans script */
.footer-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1rem;
}

.lang {
  position: relative;
  border: none;
}

.lang summary {
  display: inline-flex;
  justify-content: flex-start;
  gap: 0.45rem;
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
}

.lang summary::after {
  content: "▾";
  font-size: 0.8rem;
  font-weight: 400;
}

.lang[open] summary::after {
  transform: rotate(180deg);
}

.globe {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}

.site-footer .lang ul {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.4rem);
  z-index: 5;
  min-width: 9rem;
  padding: 0.35rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  box-shadow: var(--shadow);
}

.site-footer .lang li {
  margin: 0;
}

.site-footer .lang a {
  display: block;
  padding: 0.4rem 0.7rem;
  border-radius: 0.5rem;
  color: var(--ink);
  text-decoration: none;
}

.site-footer .lang a:hover {
  background: var(--band);
  text-decoration: none;
}

.site-footer .lang a[aria-current]::after {
  content: " ✓";
  color: var(--muted);
}

@media (max-width: 40rem) {
  .footer-side {
    align-items: flex-start;
  }

  .site-footer .lang ul {
    right: auto;
    left: 0;
  }
}

/* --- Moins de mouvement : tout se fige dans son état final -------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .photo mark {
    background-size: 100% 100%;
  }

  .sheet {
    transform: none;
  }

  .keep .todo {
    opacity: 0;
  }

  .keep .done {
    opacity: 1;
  }
}
