/* 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;
}

.switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: var(--surface-2);
  border-radius: 999px;
  margin-bottom: 22px;
}

.switch button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 10px 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

.switch button[aria-selected='true'] {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(14, 15, 18, 0.12);
}

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

.phone img {
  border-radius: 34px;
  display: block;
  width: 100%;
}

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

.phone .screen img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.012);
  transition:
    opacity 0.42s cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 0.42s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.phone .screen img.on {
  opacity: 1;
  transform: none;
}

/* 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: flex;
  flex-wrap: wrap;
  gap: 20px 32px;
  align-items: center;
}

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

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

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

/* Apparition au défilement --------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
}

.reveal.in {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

  .reveal,
  .reveal.in {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .phone .screen img {
    transition: opacity 0.001s linear;
    transform: none;
  }
}
