/* Dette Online — feuille de style du site de présentation.
   Mêmes tokens que l'application (src/theme/tokens.ts) : le site et l'app
   parlent la même langue visuelle. Rien d'externe n'est chargé. */

@font-face {
  font-family: 'Jakarta';
  src: url('../fonts/PlusJakartaSans-400Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Jakarta';
  src: url('../fonts/PlusJakartaSans-500Medium.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Jakarta';
  src: url('../fonts/PlusJakartaSans-600SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Jakarta';
  src: url('../fonts/PlusJakartaSans-700Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Jakarta';
  src: url('../fonts/PlusJakartaSans-800ExtraBold.woff2') format('woff2');
  font-weight: 800;
  font-display: swap;
}

:root {
  --bg: #f7f7f4;
  --surface: #ffffff;
  --surface-2: #f0f0ec;
  --text: #0e0f12;
  --muted: #62666d;
  --border: #e6e6e1;
  --owed: #0a7a55;
  --owed-soft: #e3f2ec;
  --owe: #c62f3a;
  --owe-soft: #fbeaeb;
  --urgent: #a34a07;
  --shadow: 0 18px 50px -24px rgba(14, 15, 18, 0.45);
  --radius: 20px;
  --measure: 62ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0c0f;
    --surface: #15171c;
    --surface-2: #1d2027;
    --text: #f4f4f2;
    --muted: #9a9ea6;
    --border: #262a31;
    --owed: #3dd68c;
    --owed-soft: #0f2a1e;
    --owe: #ff7a7a;
    --owe-soft: #2e1517;
    --urgent: #fbbf24;
    --shadow: 0 18px 50px -24px rgba(0, 0, 0, 0.8);
  }
}

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

html {
  scroll-behavior: smooth;
  color-scheme: light dark;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    'Jakarta',
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--owed);
  color: var(--bg);
}

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

* {
  scrollbar-color: var(--border) transparent;
  scrollbar-width: thin;
}

a {
  color: inherit;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-color: currentColor;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.wrap {
  width: min(100% - 40px, 1120px);
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 20px;
  top: 12px;
  z-index: 10;
  background: var(--text);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: 10px;
}

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

header.site {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

header.site.scrolled {
  border-bottom-color: var(--border);
}

header.site .wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.brand img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

nav.site {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 26px;
  font-size: 15px;
  font-weight: 500;
}

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

nav.site a:hover {
  color: var(--text);
}

/* Le bouton de la barre garde ses propres couleurs : la règle de nav
   ci-dessus est plus spécifique que .btn et le laissait gris sur noir. */
nav.site a.btn {
  color: var(--bg);
}

nav.site a.btn.ghost,
nav.site a.btn.ghost:hover {
  color: var(--text);
}

@media (max-width: 720px) {
  nav.site a:not(.btn) {
    display: none;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  transition:
    transform 0.14s ease,
    filter 0.14s ease;
}

.btn:hover {
  filter: brightness(1.25);
}

.btn:active {
  transform: translateY(1px);
}

.btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn.ghost:hover {
  border-color: var(--text);
  filter: none;
}

/* Hero ---------------------------------------------------------------- */

.hero {
  padding: clamp(48px, 9vw, 104px) 0 clamp(40px, 7vw, 88px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
  gap: clamp(32px, 6vw, 72px);
  align-items: center;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }
}

h1 {
  font-size: clamp(38px, 6.4vw, 68px);
  line-height: 1.02;
  letter-spacing: -0.045em;
  font-weight: 800;
  margin: 0 0 20px;
  text-wrap: balance;
}

.mark-owed {
  color: var(--owed);
}

.lede {
  font-size: clamp(17px, 2vw, 20px);
  color: var(--muted);
  max-width: var(--measure);
  margin: 0 0 28px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.hero-note {
  margin-top: 18px;
  font-size: 14px;
  color: var(--muted);
}

/* Démonstration interactive ------------------------------------------- */

.demo {
  justify-self: center;
  width: 100%;
  max-width: 340px;
}

.phone {
  position: relative;
  border-radius: 44px;
  padding: 10px;
  background: linear-gradient(180deg, #2a2d34, #15171c);
  box-shadow: var(--shadow);
}

.phone .screen {
  position: relative;
  overflow: hidden;
  border-radius: 34px;
  aspect-ratio: 1320 / 2868;
  background: var(--surface);
}

.phone video,
.phone img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 34px;
}

/* Commandes de la vidéo : posées sous le téléphone, jamais par-dessus le
   contenu. Affichées par le script, donc jamais offertes sans JavaScript. */
.demo-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}

.demo-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 16px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition:
    color 0.16s ease,
    border-color 0.16s ease;
}

.demo-btn:hover {
  color: var(--text);
  border-color: var(--text);
}

/* Un seul libellé visible à la fois, selon l'état de la vidéo. */
.demo-btn span {
  display: none;
}

.demo-btn[data-etat='lecture'] span[data-on='lecture'],
.demo-btn[data-etat='pause'] span[data-on='pause'],
.demo-btn[data-etat='muet'] span[data-on='muet'],
.demo-btn[data-etat='sonore'] span[data-on='sonore'] {
  display: inline;
}

/* Sections ------------------------------------------------------------ */

section {
  padding: clamp(48px, 8vw, 96px) 0;
}

h2 {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.08;
  letter-spacing: -0.035em;
  font-weight: 800;
  margin: 0 0 16px;
  text-wrap: balance;
}

h3 {
  font-size: 21px;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 0 0 8px;
}

p {
  max-width: var(--measure);
}

.muted {
  color: var(--muted);
}

.feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 360px);
  gap: clamp(28px, 6vw, 76px);
  align-items: center;
  padding: clamp(36px, 6vw, 64px) 0;
  border-top: 1px solid var(--border);
}

.feature:nth-child(even) .feature-shot {
  order: -1;
}

@media (max-width: 860px) {
  .feature {
    grid-template-columns: 1fr;
  }

  .feature:nth-child(even) .feature-shot {
    order: 0;
  }
}

.feature-shot img {
  border-radius: 26px;
  border: 1px solid var(--border);
  /* Une capture de téléphone est très haute : la brider garde la section
     lisible et le texte en regard du visuel. */
  max-height: min(70vh, 560px);
  width: auto;
  margin-inline: auto;
}

.points {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
  display: grid;
  gap: 12px;
  max-width: var(--measure);
}

.points li {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
  color: var(--muted);
}

.points svg {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  color: var(--owed);
  flex: none;
}

.facts {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
  display: grid;
  gap: 10px;
  max-width: var(--measure);
  color: var(--muted);
}

.facts strong {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.callout {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(24px, 4vw, 40px);
}

/* Pages de contenu ----------------------------------------------------- */

.page {
  padding: clamp(40px, 7vw, 80px) 0 clamp(56px, 8vw, 96px);
}

.page h1 {
  font-size: clamp(32px, 5vw, 48px);
  margin-bottom: 12px;
}

.page h2 {
  font-size: clamp(22px, 3vw, 28px);
  margin-top: 44px;
}

.page p,
.page li {
  max-width: var(--measure);
  color: var(--text);
}

.page ul {
  padding-left: 20px;
}

.page li {
  margin-bottom: 8px;
}

.page .updated {
  color: var(--muted);
  font-size: 15px;
}

.page table {
  border-collapse: collapse;
  width: 100%;
  max-width: 760px;
  margin-top: 16px;
  font-size: 15px;
}

.page th,
.page td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.page th {
  font-weight: 600;
  color: var(--muted);
}

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

footer.site {
  border-top: 1px solid var(--border);
  padding: 40px 0 56px;
  color: var(--muted);
  font-size: 15px;
}

footer.site .wrap {
  display: grid;
  gap: 14px;
}

footer.site nav {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

footer.site p {
  margin: 0;
  max-width: none;
}

footer.site .copyright {
  font-size: 14px;
}

/* Signature : à droite sur grand écran, dans le flux sur mobile. */
footer.site .credit {
  justify-self: end;
  font-size: 13.5px;
}

footer.site .credit a {
  color: var(--text);
  font-weight: 600;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
}

@media (max-width: 640px) {
  footer.site .credit {
    justify-self: start;
  }
}

footer.site a {
  text-decoration: none;
}

footer.site a:hover {
  color: var(--text);
}

/* Confiance ------------------------------------------------------------ */

:root:not([data-theme='dark']) .band-dark,
:root .band-dark {
  /* Bande sombre : les variables sont redéfinies ici, donc tout ce qu'elle
     contient (titres, texte secondaire, liens, filets) suit sans exception. */
  --bg: #0b0c0f;
  --surface: #15171c;
  --surface-2: #1d2027;
  --text: #f4f4f2;
  --muted: #9a9ea6;
  --border: #262a31;
  --owed: #3dd68c;
  --owe: #ff7a7a;
  background: var(--bg);
  color: var(--text);
}

/* Page déjà sombre : la bande se distingue en s'éclaircissant d'un cran,
   sinon elle disparaîtrait dans le fond. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .band-dark {
    --bg: #15171c;
    --surface: #1d2027;
    --border: #2e323b;
  }
}

.trust {
  border-top: 1px solid var(--border);
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: clamp(24px, 4vw, 48px);
  margin-top: clamp(32px, 5vw, 56px);
}

.trust-item h3 {
  margin-bottom: 10px;
}

.trust-item p {
  margin: 0;
}

/* Filet coloré de 2px sous le titre : une marque, pas une bordure de carte. */
.trust-item h3::after {
  content: '';
  display: block;
  width: 28px;
  height: 2px;
  margin-top: 12px;
  background: var(--owed);
}

.trust-more {
  margin-top: clamp(28px, 4vw, 44px);
  font-weight: 600;
}

/* Sur la bande sombre, le lien reste souligné : la couleur seule ne suffit
   jamais à signaler un lien. */
.band-dark a {
  color: var(--text);
  text-decoration-color: color-mix(in srgb, var(--owed) 70%, transparent);
}

.band-dark a:hover {
  text-decoration-color: var(--owed);
}

/* Stores ---------------------------------------------------------------- */

.stores {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 20px;
  margin: clamp(32px, 4vw, 48px) 0 28px;
  max-width: 980px;
}

.store {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: clamp(26px, 3vw, 34px) clamp(24px, 3vw, 32px);
  border-radius: var(--radius);
  background: var(--text);
  color: var(--bg);
  text-decoration: none;
  transition:
    transform 0.18s cubic-bezier(0.16, 1, 0.3, 1),
    filter 0.18s ease;
}

.store:hover {
  transform: translateY(-2px);
  filter: brightness(1.25);
}

.store:active {
  transform: translateY(0);
}

.store-mark {
  width: 44px;
  height: 44px;
  flex: none;
}

.store-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.store-name {
  font-size: clamp(24px, 2.4vw, 30px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.store-sub {
  font-size: 14.5px;
  opacity: 0.74;
}

.store-state {
  margin-left: auto;
  font-size: 13.5px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid currentColor;
  opacity: 0.75;
  flex: none;
}

.obtain-note {
  font-size: 15px;
}

/* Mise en mouvement ----------------------------------------------------- */

/* Règle d'or : aucun contenu n'est masqué en attendant JavaScript. Le hero
   s'anime au chargement ; le reste est piloté par le défilement, et seulement
   là où le navigateur sait le faire. Ailleurs, la page s'affiche simplement. */

@keyframes pose {
  from {
    opacity: 0;
    transform: translateY(22px);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: blur(0);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .hero .rise {
    animation: pose 0.8s cubic-bezier(0.16, 1, 0.3, 1) var(--d, 0ms) both;
  }
}

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    main section .rise {
      animation: pose 1s cubic-bezier(0.16, 1, 0.3, 1) both;
      animation-timeline: view();
      animation-range: entry 8% entry 42%;
    }

    /* Les captures dérivent pendant le défilement : l'effet suit le geste de
       l'utilisateur, il n'est pas joué par un minuteur. */
    @keyframes derive {
      from {
        transform: translateY(26px);
      }
      to {
        transform: translateY(-26px);
      }
    }

    .feature-shot img {
      animation: derive linear both;
      animation-timeline: view();
      animation-range: entry 15% exit 85%;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .rise {
    opacity: 1;
    animation: none;
  }

  .store,
  .store:hover {
    transform: none;
  }
}
