/* ---------- Polices : Lexend, la même que dans l'application ---------- */
@font-face { font-family: "Lexend"; font-weight: 400; font-display: swap; src: url("lexend-Regular.woff2") format("woff2"); }
@font-face { font-family: "Lexend"; font-weight: 500; font-display: swap; src: url("lexend-Medium.woff2") format("woff2"); }
@font-face { font-family: "Lexend"; font-weight: 600; font-display: swap; src: url("lexend-SemiBold.woff2") format("woff2"); }

/* Faune Display Black (CNAP) : la police du nom de l'app, réservée au mot OCnotes */
@font-face { font-family: "Faune"; font-weight: 900; font-display: swap; src: url("faune-display-black.woff2") format("woff2"); }

/* ---------- Jetons de couleur (clair par défaut, sombre selon le système) ---------- */
:root {
  --bg: #f3f6f4;
  --surface: #e6ece8;
  --ink: #15201c;
  --muted: #4a5a54;
  --line: #cdd8d2;
  --accent: #1d6b5a;        /* le vert de l'icône, seule couleur d'accent */
  --accent-ink: #ffffff;
  --radius: 14px;           /* un seul rayon pour tout, sauf les téléphones */
  --phone-radius: 26px;
  --shadow: 0 24px 50px -22px rgb(21 48 40 / .45);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1513;
    --surface: #18211d;
    --ink: #e8efeb;
    --muted: #9db0a8;
    --line: #28352f;
    --accent: #5fc9ae;
    --accent-ink: #08201a;
    --shadow: 0 24px 50px -22px rgb(0 0 0 / .8);
  }
}

* { box-sizing: border-box; }
/* les ancres s'arrêtent sous l'en-tête collant (64px) plutôt que dessous */
html { scroll-padding-top: 80px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Lexend", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  font-size-adjust: from-font;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(1160px, 100% - 2rem); margin-inline: auto; }

/* ---------- Lien d'évitement : hors écran tant qu'il n'a pas le focus ---------- */
.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 20; padding: .6rem 1rem; border-radius: var(--radius); background: var(--accent); color: var(--accent-ink); text-decoration: none; }
.skip-link:focus-visible { top: 1rem; }
/* la cible du lien d'évitement reçoit le focus sans anneau inutile */
h1:focus { outline: none; }

/* ---------- Bandeau « autre langue » (affiché par site.js) ----------
   Il flotte en bas de l'écran : comme il apparaît après le chargement,
   le placer en haut de page décalerait tout le contenu. */
.lang-hint { position: fixed; z-index: 30; left: 1rem; right: 1rem; bottom: 1rem; max-width: 40rem; margin-inline: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); font-size: .95rem; }
.lang-hint .wrap { width: auto; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.2rem; padding: .7rem 1rem; }
.lang-hint p { margin: 0; }
.lang-hint a { font-weight: 500; }
.lang-hint button { margin-left: auto; font: inherit; color: var(--muted); background: none; border: 1px solid var(--line); border-radius: 8px; padding: .3rem .8rem; cursor: pointer; }
.lang-hint button:hover { color: var(--ink); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .6rem;
  padding: .85rem 1.4rem;
  border-radius: var(--radius);
  font: 500 1rem/1 "Lexend", sans-serif;
  text-decoration: none; white-space: nowrap;
  border: 1.5px solid transparent;
  transition: transform .2s cubic-bezier(.16,1,.3,1), background-color .2s;
}

.btn-primary { background: var(--accent); color: var(--accent-ink); }
@media (prefers-reduced-motion: no-preference) {
  .btn:active { transform: scale(.97); }
  .btn-primary:hover { transform: translateY(-2px); }
}
.btn-ghost { border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--surface); }
.btn svg { width: 1.15em; height: 1.15em; flex: none; }

/* ---------- Navigation (une seule ligne, 64px) ---------- */
.nav { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav .wrap { height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; }
.wordmark { font-family: "Faune", "Lexend", sans-serif; font-weight: 900; letter-spacing: -.01em; }
.brand .wordmark { font-size: 1.5rem; line-height: 1; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.nav-links { display: flex; align-items: center; gap: 1.6rem; }
.nav-links a:not(.btn) { text-decoration: none; color: var(--muted); font-size: .95rem; }
.nav-links a:not(.btn):hover { color: var(--ink); }
.menu { list-style: none; }
.menu-btn { display: none; font: 500 .92rem/1 "Lexend", sans-serif; color: var(--ink); background: none; border: 1.5px solid var(--line); border-radius: var(--radius); padding: .55rem .9rem; cursor: pointer; anchor-name: --menu-btn; }
/* grand écran : la liste du popover s'affiche comme une simple rangée de liens */
@media (min-width: 861px) {
  .menu { display: flex; gap: 1.6rem; position: static; inset: auto; margin: 0; padding: 0; border: 0; background: none; color: inherit; overflow: visible; width: auto; height: auto; }
}
.nav .btn { padding: .6rem 1.1rem; font-size: .92rem; }

/* ---------- Hero : texte à gauche, trois écrans à droite ---------- */
.hero { padding-block: 4rem 5rem; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr 1fr; gap: 3rem; align-items: center; }
h1 { font-size: clamp(2.2rem, 4.6vw, 3.6rem); line-height: 1.06; letter-spacing: -.035em; font-weight: 600; margin: 0 0 1.4rem; max-width: 18ch; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 40ch; margin: 0 0 2rem; }
.cta { display: flex; flex-wrap: wrap; gap: .8rem; }

.phones { position: relative; height: min(640px, 70vw); }
.phone {
  position: absolute; width: 36%;
  border-radius: var(--phone-radius);
  border: 5px solid #0b100e;
  box-shadow: var(--shadow);
  background: #0b100e;
}
.phone.p1 { left: 0;   top: 12%; }
.phone.p2 { left: 32%; top: 0;   z-index: 2; }
.phone.p3 { left: 64%; top: 20%; }

/* ---------- Deux usages : deux colonnes séparées par un simple filet ---------- */
section { padding-block: 5rem; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); line-height: 1.15; letter-spacing: -.03em; font-weight: 600; margin: 0 0 1rem; max-width: 20ch; }
h3 { font-size: 1.2rem; letter-spacing: -.015em; font-weight: 600; margin: 0 0 .5rem; }
p { margin: 0 0 1rem; max-width: 62ch; }
.muted { color: var(--muted); }

.modes .wrap > p { color: var(--muted); }
.modes-grid { display: grid; grid-template-columns: 1fr 1fr; margin-top: 2.5rem; border-block: 1px solid var(--line); }
.modes-grid > div { padding: 2.2rem 2rem 2.2rem 0; }
.modes-grid > div + div { padding: 2.2rem 0 2.2rem 2rem; border-left: 1px solid var(--line); }
.modes-grid p { color: var(--muted); margin: 0; }

/* ---------- Fonctionnalités : une grande tuile + deux plus petites ---------- */
section.features { padding-top: 1rem; }
.features-grid { display: grid; grid-template-columns: 1.3fr 1fr; grid-template-rows: auto auto; gap: 1rem; margin-top: 2.5rem; }
.tile { border-radius: var(--radius); padding: 2rem; background: var(--surface); overflow: hidden; }
.tile p { color: var(--muted); margin: 0; }
.tile-big { grid-row: span 2; display: grid; grid-template-columns: 1fr 190px; gap: 1.5rem; align-items: end; padding-bottom: 0;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 22%, var(--surface)), var(--surface) 70%); }
.tile-big .text { padding-bottom: 2rem; align-self: center; }
.tile-big img { border-radius: var(--phone-radius) var(--phone-radius) 0 0; border: 5px solid #0b100e; border-bottom: 0; }
.tile ul { margin: 1rem 0 0; padding: 0; list-style: none; color: var(--muted); }
.tile li { padding: .35rem 0; }

/* ---------- Téléchargement ---------- */
.download { background: var(--surface); }
.download .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: start; }
.dl-meta { color: var(--muted); font-size: .95rem; margin: 1.2rem 0 0; }
.dl-meta code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .8rem; word-break: break-all; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; padding: 0 0 1.6rem 3rem; position: relative; }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: 0;
  width: 2rem; height: 2rem; border-radius: var(--radius);
  background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-weight: 600; font-size: .95rem;
}
.steps strong { display: block; font-weight: 600; }
.steps span { color: var(--muted); }
.note { border-left: 3px solid var(--accent); padding: .2rem 0 .2rem 1rem; color: var(--muted); font-size: .95rem; margin-top: .5rem; }

/* ---------- Pied de page ---------- */
footer { padding-block: 2.5rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .95rem; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; }
footer nav { display: flex; flex-wrap: wrap; gap: 1.5rem; }
footer a { text-decoration: none; }
footer a:hover { color: var(--ink); text-decoration: underline; }
footer .wrap > span a { text-decoration: underline; }

/* ---------- Mouvement : entrée douce, désactivée si l'utilisateur le demande ---------- */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .reveal { animation: reveal linear both; animation-timeline: view(); animation-range: entry 0% entry 60%; }
    @keyframes reveal { from { opacity: 0; translate: 0 22px; } }
  }
  /* les téléphones du hero arrivent l'un après l'autre : ils racontent l'ordre liste, édition, aperçu */
  .phone { animation: rise .9s cubic-bezier(.16,1,.3,1) backwards; }
  .p1 { animation-delay: .1s; } .p3 { animation-delay: .25s; }
  /* p2 est l'image principale (LCP) : elle glisse sans fondu pour être visible dès son chargement */
  .p2 { animation-name: slide; }
  @keyframes rise { from { opacity: 0; translate: 0 40px; } }
  @keyframes slide { from { translate: 0 40px; } }
}

/* ---------- Mobile : tout passe sur une colonne ---------- */
@media (max-width: 860px) {
  .hero { padding-block: 2.5rem 3rem; }
  .hero .wrap, .download .wrap, .features-grid, .modes-grid { grid-template-columns: 1fr; }
  .phones { height: 78vw; max-height: 480px; }
  .modes-grid > div, .modes-grid > div + div { padding: 1.6rem 0; border-left: 0; }
  .modes-grid > div + div { border-top: 1px solid var(--line); }
  .tile-big { grid-row: auto; grid-template-columns: 1fr 140px; }
  section { padding-block: 3.5rem; }
  .download .wrap { gap: 2.5rem; }
}
/* ---------- Menu mobile ----------
   Il repose sur l'attribut popover. Les navigateurs qui ne le gèrent pas (iOS < 17, Chrome < 114)
   afficheraient la liste en permanence par-dessus la page : chez eux, on masque menu et bouton,
   comme avant l'ajout du menu (les sections restent accessibles en faisant défiler). */
.menu .menu-dl { display: none; }
@supports selector(:popover-open) {
  @media (max-width: 860px) {
    .nav-links { gap: .6rem; }
    .menu-btn { display: inline-flex; }
    .menu { margin: 0; padding: .5rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); color: var(--ink); box-shadow: var(--shadow);
      /* sous l'en-tête par défaut, sous le bouton si le navigateur gère le positionnement par ancre */
      position: fixed; inset: auto; right: 1rem; top: 4.5rem; top: anchor(--menu-btn bottom); margin-top: .5rem; min-width: 12rem; }
    .menu a:not(.btn) { display: block; padding: .6rem .8rem; border-radius: 8px; color: var(--ink); font-size: 1rem; }
    .menu a:not(.btn):hover { background: var(--surface); }
  }
  /* très petit écran : le bouton Télécharger de l'en-tête passe dans le menu (celui du hero reste juste dessous) */
  @media (max-width: 520px) {
    .nav .btn-primary { display: none; }
    .menu .menu-dl { display: list-item; }
  }
}
@supports not selector(:popover-open) {
  @media (max-width: 860px) { .menu { display: none; } }
}
@media (max-width: 460px) {
  .tile-big { grid-template-columns: 1fr; }
  .tile-big img { width: 180px; justify-self: center; }
}

/* ---------- Sélecteur de langue ---------- */
.nav-links .lang { display: flex; align-items: center; gap: .15rem; font-size: .85rem; }
.nav-links .lang a:not(.btn) { display: inline-block; padding: .25rem .5rem; border-radius: 8px; color: var(--muted); font-weight: 500; }
.nav-links .lang a[aria-current="true"] { background: var(--surface); color: var(--ink); }
