/* Contalivia — page d'accueil publique.
   Idée directrice : le livre de comptes. Papier vert pâle réglé, encre bleue,
   rouge réservé au Haber. Une seule police (Recursive) : linéaire pour le texte,
   à chasse fixe pour les chiffres, comme dans un registre. */

@font-face {
  font-family: "Recursive";
  font-style: normal;
  font-weight: 300 1000;
  font-display: swap;
  src: url("../fonts/recursive-latin.woff2") format("woff2-variations");
}

:root {
  --paper: #eef3ec;      /* papier de registre */
  --paper-deep: #e1eadf;
  --rule: #c5d3c2;       /* lignes du registre */
  --ink: #1b2b4b;        /* encre bleue */
  --ink-soft: #4d5a73;
  --haber: #a8322b;      /* encre rouge du Haber, et seulement lui */
  --sheet: #ffffff;
  --action: #0f6e6a;
  --measure: 34rem;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Recursive", ui-sans-serif, system-ui, sans-serif;
  font-variation-settings: "MONO" 0;
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
}
a { color: var(--action); }
:focus-visible { outline: 3px solid var(--action); outline-offset: 3px; border-radius: 4px; }
.num { font-variation-settings: "MONO" 1; font-variant-numeric: tabular-nums; }

.wrap { width: min(72rem, 100% - 2.5rem); margin-inline: auto; }

/* --- En-tête ------------------------------------------------------------ */
.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.25rem 0; }
.wordmark { font-weight: 800; font-size: 1.35rem; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; }
.wordmark i { font-style: normal; font-variation-settings: "MONO" 1; font-weight: 500; color: var(--haber); }
.top-right { display: flex; align-items: center; gap: 1.25rem; }
.langs { display: flex; gap: .15rem; margin: 0; padding: 0; }
.langs button { font: inherit; font-size: .85rem; color: var(--ink-soft); background: none; border: 0; padding: .25rem .4rem; border-radius: 4px; cursor: pointer; }
.langs button[aria-current="true"] { color: var(--ink); font-weight: 700; background: var(--paper-deep); }
.button {
  display: inline-block; font: inherit; font-weight: 650; font-size: 1rem; text-decoration: none; cursor: pointer;
  padding: .7rem 1.2rem; border-radius: 6px; white-space: nowrap; border: 2px solid var(--ink); color: var(--ink); background: transparent;
}
.button.solid { background: var(--ink); color: var(--paper); }
.button:hover { background: var(--ink); color: var(--paper); }
.button.solid:hover { background: #0f1b33; }

/* --- Ouverture ------------------------------------------------------------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 3.5rem; align-items: center; padding: 3.5rem 0 5rem; }
.hero h1 { font-size: clamp(2.3rem, 4.6vw, 3.6rem); line-height: 1.05; letter-spacing: -0.03em; font-weight: 820; margin: 0 0 1.25rem; max-width: 15ch; }
.hero .lead { font-size: 1.2rem; color: var(--ink-soft); max-width: var(--measure); margin: 0 0 2rem; }
.hero .actions { display: flex; gap: .75rem; flex-wrap: wrap; }

/* La scène : un ticket posé sur une page de registre. */
/* Le ticket est posé en haut à droite ; il ne recouvre que la marge du registre. */
.scene { position: relative; padding-top: 13.5rem; }
.ledger {
  position: relative;
  background: var(--sheet);
  background-image: repeating-linear-gradient(to bottom, transparent 0 2.2rem, var(--rule) 2.2rem calc(2.2rem + 1px));
  background-position: 0 3.1rem;
  border: 1px solid var(--rule); border-left: 3px double var(--haber);
  padding: 1.6rem 1.25rem 1.2rem 1.5rem; border-radius: 3px;
}
.ledger table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.ledger caption { text-align: left; font-weight: 700; padding: .9rem 0 .4rem; font-size: .95rem; }
.ledger th { text-align: left; font-weight: 600; color: var(--ink-soft); font-size: .8rem; height: 2.2rem; vertical-align: bottom; padding: 0 .4rem .3rem 0; border-bottom: 1px solid var(--ink); }
.ledger td { height: 2.2rem; padding: 0 .4rem 0 0; vertical-align: middle; white-space: nowrap; }
.ledger .amt { text-align: right; }
.ledger .haber { color: var(--haber); }
.ledger tfoot td { border-top: 1px solid var(--ink); font-weight: 700; }

.ticket {
  position: absolute; right: 1.5rem; top: 0; width: 14rem; z-index: 2;
  background: var(--sheet); padding: 1rem 1rem 1.4rem; margin: 0;
  font-size: .78rem; line-height: 1.45; font-variation-settings: "MONO" 1;
  transform: rotate(3deg); box-shadow: 0 10px 24px -12px rgba(27, 43, 75, .45);
  /* bord déchiré */
  clip-path: polygon(0 0, 100% 0, 100% 100%, 92% 98.5%, 84% 100%, 76% 98.5%, 68% 100%, 60% 98.5%, 52% 100%, 44% 98.5%, 36% 100%, 28% 98.5%, 20% 100%, 12% 98.5%, 4% 100%, 0 98.5%);
}
.ticket .t-head { text-align: center; font-weight: 700; margin-bottom: .5rem; }
.ticket .t-row { display: flex; justify-content: space-between; gap: .5rem; }
.ticket .t-sep { border-top: 1px dashed var(--ink-soft); margin: .45rem 0; }
.ticket .t-total { font-weight: 800; font-size: .9rem; }
.ticket .t-foot { text-align: center; color: var(--ink-soft); margin-top: .5rem; white-space: nowrap; font-size: .72rem; }

/* Un seul moment animé : les montants du ticket passent dans le registre. */
@media (prefers-reduced-motion: no-preference) {
  .ticket .hl { animation: mark .5s ease-out both; }
  .ticket .hl.a { animation-delay: .6s; }
  .ticket .hl.b { animation-delay: 1.2s; }
  .ticket .hl.c { animation-delay: 1.8s; }
  .ledger tbody tr, .ledger tfoot tr { animation: write .45s ease-out both; }
  .ledger tbody tr:nth-child(1) { animation-delay: .9s; }
  .ledger tbody tr:nth-child(2) { animation-delay: 1.5s; }
  .ledger tbody tr:nth-child(3) { animation-delay: 2.1s; }
  .ledger tfoot tr { animation-delay: 2.6s; }
}
@keyframes mark { from { background: transparent; } 40% { background: #f6e7a6; } to { background: transparent; } }
@keyframes write { from { opacity: 0; clip-path: inset(0 100% 0 0); } to { opacity: 1; clip-path: inset(0 0 0 0); } }

/* --- Étapes ---------------------------------------------------------------- */
.band { background: var(--sheet); border-block: 1px solid var(--rule); padding: 4.5rem 0; }
.band h2, .split h2, .safety h2 { font-size: 1.75rem; letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 2rem; font-weight: 780; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem; counter-reset: step; }
.steps li { counter-increment: step; border-top: 2px solid var(--ink); padding-top: 1rem; }
.steps li::before { content: counter(step); font-variation-settings: "MONO" 1; font-weight: 700; font-size: 1.1rem; display: block; margin-bottom: .6rem; }
.steps h3 { margin: 0 0 .5rem; font-size: 1.2rem; display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
.steps p { margin: 0; color: var(--ink-soft); max-width: 30ch; }
.soon { font-size: .78rem; font-weight: 600; color: var(--ink-soft); border: 1px solid var(--rule); background: var(--paper); border-radius: 999px; padding: .05rem .55rem; }

/* --- Deux publics ---------------------------------------------------------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; padding: 5rem 0; }
.split h2 { margin-bottom: 1rem; }
.split ul { margin: 0 0 1.5rem; padding-left: 1.1rem; max-width: var(--measure); }
.split li { margin-bottom: .45rem; }
.split li::marker { color: var(--haber); }

/* --- Sécurité ---------------------------------------------------------------- */
.safety { padding: 0 0 5rem; }
.safety-inner { border-top: 1px solid var(--ink); padding-top: 2.5rem; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 3rem; }
.safety dl { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem 2.5rem; }
.safety dt { font-weight: 700; margin-bottom: .25rem; }
.safety dd { margin: 0; color: var(--ink-soft); }

/* --- Pied de page -------------------------------------------------------------- */
.foot { border-top: 1px solid var(--rule); padding: 1.5rem 0 2.5rem; font-size: .9rem; color: var(--ink-soft); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* --- Petits écrans -------------------------------------------------------------- */
@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; gap: 2.5rem; padding: 2rem 0 3.5rem; }
  .steps, .split, .safety-inner, .safety dl { grid-template-columns: 1fr; }
  .split { gap: 2.5rem; padding: 3.5rem 0; }
  .band { padding: 3.5rem 0; }
}
@media (max-width: 520px) {
  .top { align-items: flex-start; }
  .top-right { flex-direction: column-reverse; align-items: flex-end; gap: .5rem; }
  .langs button { padding: .2rem .3rem; }
  .ledger { padding-inline: .75rem; }
  .ledger table { font-size: .8rem; }
  .ledger .concept { display: none; }
  .ticket { right: .5rem; }
}

/* Pages légales */
.legal { max-width: 46rem; padding: 1.5rem 0 3rem; }
.legal h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); line-height: 1.15; margin: .5rem 0 1.5rem; }
.legal-body h2 { font-size: 1.25rem; margin: 2rem 0 .5rem; }
.legal-body h3 { font-size: 1.05rem; margin: 1.5rem 0 .4rem; }
.legal-body p, .legal-body li { max-width: var(--measure, 40rem); }
.legal-body ul { padding-left: 1.2rem; }
.legal-body li { margin: .25rem 0; }
.legal-note { background: var(--sheet); border-left: 4px solid var(--action); padding: .6rem .9rem; font-size: .95rem; }
.legal-date { color: var(--ink-soft); font-size: .9rem; margin-top: 2.5rem; }
.foot-legal a { color: inherit; }
