/* Glance — site vitrine. Palette et polices de l'appli (lib/theme/palette.dart).
   Une page, une grille de 12 colonnes ; chaque idée alterne texte et scène. */

:root {
  --bg: #F7F5F1;
  --bg-alt: #EFEBE3;
  --surface: #FFFFFF;
  --fg: #211E19;
  --fg2: #6B655A;
  --fg3: #8C857A;
  --line: rgba(30, 25, 15, .12);
  --accent: #3B7A5A;
  --accent-ink: #2F6349;
  --on-accent: #FFFFFF;
  --forecast: #C98A2E;
  --forecast-ink: #8E5F14;
  --band: #211E19;
  --band-fg: #F3F0E9;
  --band-fg2: #A69F91;
  --band-accent: #7EC49B;

  --titre: "Fredoka", system-ui, sans-serif;
  --texte: "Geist", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;

  --marge: clamp(20px, 4vw, 56px);
  --gouttiere: clamp(16px, 2vw, 32px);
  --respiration: clamp(80px, 11vw, 168px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16140F;
    --bg-alt: #1C1912;
    --surface: #201D16;
    --fg: #F3F0E9;
    --fg2: #A69F91;
    --fg3: #7F786B;
    --line: rgba(250, 245, 235, .14);
    --accent: #5AA57E;
    --accent-ink: #7EC49B;
    --on-accent: #0E1A12;
    --forecast: #E0A458;
    --forecast-ink: #E0A458;
    --band: #201D16;
    --band-fg: #F3F0E9;
    --band-fg2: #A69F91;
    --band-accent: #7EC49B;
  }
}

/* Les trois polices n'ont pas les idéogrammes : chaque famille reçoit une seconde déclaration limitée au CJK
   et à la ponctuation pleine chasse, qui suit la police du système (même règle que les visuels des stores). */
@font-face { font-family: "Fredoka"; font-weight: 300 700; unicode-range: U+2E80-9FFF, U+F900-FAFF, U+FE30-FE4F, U+FF00-FFEF, U+3000-303F;
  src: local("PingFangSC-Semibold"), local("PingFang SC Semibold"), local("PingFang SC"), local("Hiragino Sans GB"), local("Noto Sans SC"); }
@font-face { font-family: "Geist"; font-weight: 100 900; unicode-range: U+2E80-9FFF, U+F900-FAFF, U+FE30-FE4F, U+FF00-FFEF, U+3000-303F;
  src: local("PingFangSC-Regular"), local("PingFang SC"), local("Hiragino Sans GB"), local("Noto Sans SC"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 100 800; unicode-range: U+2E80-9FFF, U+F900-FAFF, U+FE30-FE4F, U+FF00-FFEF, U+3000-303F;
  src: local("PingFangSC-Regular"), local("PingFang SC"), local("Hiragino Sans GB"), local("Noto Sans SC"); }

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; color-scheme: light dark; }
body {
  background: var(--bg); color: var(--fg); font-family: var(--texte); font-size: 18px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--accent-ink); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--fg); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { max-width: 1360px; margin: 0 auto; padding-inline: var(--marge); }

/* ——— Barre du haut ——— */
.haut { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent);
  border-bottom: 1px solid var(--line); }
.haut .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 68px; }
.marque { display: flex; align-items: center; gap: 12px; color: var(--fg); text-decoration: none;
  font-family: var(--titre); font-weight: 600; font-size: 23px; letter-spacing: -.01em; }
.marque img { width: 38px; height: 38px; border-radius: 22%; }
.haut nav { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 32px); font-size: 15px; font-weight: 500; }
.haut nav a { color: var(--fg2); text-decoration: none; }
.haut nav a:hover { color: var(--fg); }
.haut nav { position: relative; }

/* ——— Sélecteur de langue : six langues, chacune par son propre nom ——— */
.langues { position: relative; }
.langues summary { display: flex; align-items: center; gap: 8px; padding: 7px 14px; border: 1.5px solid var(--line); border-radius: 999px;
  color: var(--fg); cursor: pointer; list-style: none; white-space: nowrap; }
.langues summary::-webkit-details-marker { display: none; }
.langues summary:hover, .langues[open] summary { border-color: var(--fg); }
.langues summary svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; flex: none; }
.langues ul { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; min-width: 180px; list-style: none; padding: 6px;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 16px; }
.langues li a { display: block; padding: 9px 14px; border-radius: 10px; color: var(--fg); text-decoration: none; white-space: nowrap; }
.langues li a:hover { background: var(--bg-alt); }
.langues li a[aria-current] { color: var(--accent-ink); font-weight: 600; }

/* La bulle qui propose la langue du navigateur. */
.lang-tip { position: absolute; top: calc(100% + 16px); right: 0; z-index: 40; width: 264px; padding: 16px 18px; background: var(--surface);
  border: 1.5px solid var(--line); border-radius: 16px; font-size: 14px; line-height: 1.45; }
.lang-tip::before { content: ""; position: absolute; top: -8px; right: 34px; width: 14px; height: 14px; background: var(--surface);
  border-left: 1.5px solid var(--line); border-top: 1.5px solid var(--line); transform: rotate(45deg); }
.lang-tip p { margin: 0 0 12px; padding-right: 22px; color: var(--fg); }
.lang-tip .go { display: block; padding: 10px 0; border-radius: 10px; background: var(--accent); color: var(--on-accent); text-align: center;
  font-family: var(--titre); font-weight: 500; text-decoration: none; }
.lang-tip .go:hover { background: var(--accent-ink); color: var(--on-accent); }
.lang-tip .x { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border: 0; border-radius: 8px; background: var(--bg-alt);
  color: var(--fg3); font-size: 12px; cursor: pointer; }
.lang-tip .x:hover { color: var(--fg); }

/* ——— Titres et texte ——— */
.surtitre { font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: .04em; color: var(--accent-ink); }
h1, h2, h3 { font-family: var(--titre); font-weight: 600; color: var(--fg); text-wrap: balance; }
h1 { font-size: clamp(44px, 7.4vw, 104px); line-height: .98; letter-spacing: -.025em; }
h2 { font-size: clamp(34px, 4.4vw, 62px); line-height: 1.02; letter-spacing: -.02em; }
h3 { font-size: 26px; line-height: 1.15; letter-spacing: -.01em; }
.texte p { color: var(--fg2); max-width: 46ch; text-wrap: pretty; }
.texte p + p { margin-top: 14px; }
.lien { display: inline-block; margin-top: 22px; font-weight: 600; }

/* ——— Boutons et badges ——— */
.badges { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.badge { display: inline-flex; align-items: center; gap: 12px; padding: 11px 20px 11px 16px; border-radius: 16px;
  border: 1.5px solid var(--line); color: var(--fg); text-decoration: none; line-height: 1.15; background: transparent;
  transition: border-color .2s, background-color .2s; }
.badge:hover { border-color: var(--fg); color: var(--fg); }
.badge svg { width: 24px; height: 24px; flex: none; fill: currentColor; }
.badge small { display: block; font-family: var(--mono); font-size: 11px; color: var(--fg3); letter-spacing: .02em; }
.badge b { display: block; font-family: var(--titre); font-weight: 600; font-size: 18px; }
.badge.premier { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.badge.premier small { color: color-mix(in srgb, var(--on-accent) 75%, transparent); }
.badge.premier:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: var(--on-accent); }

/* ——— Hero ——— */
.hero { position: relative; overflow: clip; padding: clamp(48px, 7vw, 104px) 0 0; }
.hero .wrap { position: relative; display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gouttiere); align-items: end; }
.hero .texte { grid-column: 1 / 8; padding-bottom: clamp(56px, 8vw, 120px); position: relative; z-index: 1; }
.hero h1 { margin-top: 22px; }
.hero .accroche { margin-top: 28px; font-size: clamp(19px, 1.7vw, 22px); color: var(--fg2); max-width: 36ch; }
.hero .telephone { grid-column: 8 / 13; position: relative; z-index: 1;
  -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.hero .courbe { position: absolute; right: -5vw; top: 2%; width: min(62vw, 880px); height: auto; z-index: 0; pointer-events: none; }
.hero .courbe path { fill: none; stroke: var(--accent); stroke-width: 1.1; stroke-linecap: round; stroke-linejoin: round; opacity: .2; }
.hero .courbe circle { fill: var(--accent); opacity: .2; }

/* ——— Une idée : texte d'un côté, scène de l'autre ——— */
.idee { padding: var(--respiration) 0; }
.idee + .idee { border-top: 1px solid var(--line); }
.idee .wrap { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gouttiere); align-items: start; }
.idee .texte { grid-column: 1 / 6; position: sticky; top: 120px; padding-top: 8px; }
.idee .texte h2 { margin-top: 18px; margin-bottom: 26px; }
.idee .scene { grid-column: 7 / 13; }
.idee.inverse .texte { grid-column: 8 / 13; }
.idee.inverse .scene { grid-column: 1 / 7; grid-row: 1; }
.idee.etroit .scene { grid-column: 7 / 12; }
.idee.inverse.etroit .scene { grid-column: 2 / 7; }
.scene img { width: 100%; border-radius: 30px; box-shadow: 0 0 0 1px var(--line); }

/* La prévision est la seule idée en orange, comme dans l'appli. */
.idee.prevision .surtitre { color: var(--forecast-ink); }
.idee.prevision .lien { color: var(--forecast-ink); }
.idee.prevision .texte h2 { padding-bottom: 22px; background: radial-gradient(circle, var(--forecast) 2.2px, transparent 2.6px) 0 100% / 14px 6px repeat-x; background-size: 14px 6px; width: fit-content; max-width: 100%; }

/* ——— Outils pris en charge ——— */
.bande { padding: var(--respiration) 0; background: var(--bg-alt); }
.bande .wrap { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gouttiere); }
.bande .texte { grid-column: 1 / 5; }
.bande h2 { margin: 18px 0 0; }
.outils { grid-column: 6 / 13; list-style: none; border-top: 1.5px solid var(--fg); }
.outils li { display: grid; grid-template-columns: 1fr auto; gap: 4px 24px; align-items: baseline; padding: 26px 0; border-bottom: 1px solid var(--line); }
.outils h3 { font-size: clamp(28px, 3vw, 40px); }
.outils p { grid-column: 1; color: var(--fg2); max-width: 52ch; }
.outils .etat { grid-column: 2; grid-row: 1; font-family: var(--mono); font-size: 13px; color: var(--accent-ink); }
.outils .bientot .etat { color: var(--fg3); }

/* ——— Vie privée ——— */
.prive { padding: var(--respiration) 0; background: var(--band); color: var(--band-fg); }
.prive .wrap { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gouttiere); row-gap: 56px; }
.prive .surtitre { color: var(--band-accent); }
.prive h2 { grid-column: 1 / 9; color: var(--band-fg); margin-top: 18px; }
.prive .titre-bloc { grid-column: 1 / 13; }
.prive ul { grid-column: 1 / 13; list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gouttiere); }
.prive li { border-top: 1.5px solid var(--band-accent); padding-top: 22px; }
.prive li h3 { color: var(--band-fg); font-size: 28px; }
.prive li p { margin-top: 10px; color: var(--band-fg2); max-width: 34ch; }
.prive .note { grid-column: 1 / 13; color: var(--band-fg2); font-size: 16px; }
.prive .note a { color: var(--band-accent); }

/* ——— Téléchargement ——— */
.telecharger { padding: var(--respiration) 0 calc(var(--respiration) * .7); }
.telecharger .wrap { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gouttiere); row-gap: 40px; }
.telecharger .texte { grid-column: 1 / 7; }
.telecharger h2 { margin-top: 18px; margin-bottom: 22px; }
.telecharger .badges { grid-column: 7 / 13; align-self: end; margin-top: 0; display: grid; grid-template-columns: 1fr 1fr; }
.brew { grid-column: 1 / 13; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 16px; color: var(--fg2); }
.brew a { font-weight: 600; }
.brew code { font-family: var(--mono); font-size: 15px; background: var(--band); color: var(--band-fg); padding: 13px 18px; border-radius: 12px; }
.brew code i { font-style: normal; color: var(--band-accent); }

.faq { padding: 0 0 var(--respiration); }
.faq .wrap { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gouttiere); }
.faq h2 { grid-column: 1 / 5; font-size: clamp(30px, 3.4vw, 46px); }
.faq .liste { grid-column: 6 / 13; border-top: 1.5px solid var(--fg); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 20px 36px 20px 0; font-family: var(--titre); font-weight: 500; font-size: 21px; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 16px; font-size: 28px; color: var(--accent-ink); }
.faq details[open] summary::after { content: "–"; }
.faq details p { padding: 0 0 22px; color: var(--fg2); max-width: 60ch; }

/* ——— Retours : le bouton rond et son formulaire ——— */
.fab { position: fixed; right: 22px; bottom: 22px; z-index: 25; width: 54px; height: 54px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; background: var(--accent); color: var(--on-accent); transition: transform .15s; }
.fab:hover { transform: translateY(-2px); }
.fbk-ov { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; padding: 18px; background: rgba(22, 20, 15, .55); }
.fbk-ov[hidden], .fbk [hidden] { display: none; }
.fbk { width: 100%; max-width: 420px; padding: 28px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 22px; }
.fbk h3 { font-size: 24px; }
.fbk .sub { margin: 8px 0 18px; font-size: 15px; color: var(--fg2); line-height: 1.5; }
.fbk textarea, .fbk input { width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--bg);
  color: var(--fg); font: inherit; font-size: 15px; }
.fbk textarea { min-height: 120px; margin-bottom: 10px; resize: vertical; }
.fbk input { margin-bottom: 16px; }
.fbk textarea:focus, .fbk input:focus { outline: none; border-color: var(--accent); }
.fbk .err { margin: 0 0 12px; font-size: 14px; color: #B15A42; }
.fbk .row { display: flex; gap: 10px; }
.fbk .btn { flex: 1; padding: 12px 16px; border: 1.5px solid var(--line); border-radius: 14px; background: transparent; color: var(--fg);
  font-family: var(--titre); font-weight: 500; font-size: 16px; cursor: pointer; }
.fbk .btn.primaire { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.fbk .btn:disabled { opacity: .6; }
.fbk [data-f="done"] .btn { width: 100%; }

/* ——— Pied de page ——— */
.pied { padding: 56px 0 44px; background: var(--band); color: var(--band-fg2); font-size: 15px; }
.pied .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 32px; }
.pied .marque { color: var(--band-fg); }
.pied p { margin-top: 14px; max-width: 34ch; }
.pied ul { list-style: none; display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: flex-start; }
.pied a { color: var(--band-fg); text-decoration: none; }
.pied a:hover { color: var(--band-accent); }
.pied .pied-langues { flex-basis: 100%; }
.pied .droits { flex-basis: 100%; max-width: none; margin-top: 0; padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, .1); font-family: var(--mono); font-size: 12px; }

/* Avant le premier rendu de GSAP : le hero attend son entrée (anim.js retire la classe). */
.js .hero [data-entree] { opacity: 0; }

@media (max-width: 900px) {
  .hero .texte, .hero .telephone, .idee .texte, .idee .scene, .idee.inverse .texte, .idee.inverse .scene,
  .idee.etroit .scene, .idee.inverse.etroit .scene, .bande .texte, .outils, .prive h2, .telecharger .texte,
  .telecharger .badges, .faq h2, .faq .liste { grid-column: 1 / 13; grid-row: auto; }
  .hero .telephone { width: min(100%, 420px); margin: 0 auto; }
  .hero .courbe { display: none; }
  .hero .texte { padding-bottom: 48px; }
  .idee .texte { position: static; margin-bottom: 40px; }
  .bande .texte { margin-bottom: 36px; }
  .prive ul { grid-template-columns: 1fr; }
  .faq h2 { margin-bottom: 28px; }
  .haut nav > a { display: none; }
  .lang-tip { position: fixed; top: var(--tip-top, 64px); left: 12px; right: 12px; width: auto; }
  .lang-tip::before { right: auto; left: var(--tip-arrow, 84%); margin-left: -7px; }
  .scene img { border-radius: 22px; }
}
@media (max-width: 480px) {
  .badge { flex: 1 1 calc(50% - 6px); padding-right: 12px; }
  body { font-size: 17px; }
}

/* Chinois : pas de césure, pas de resserrement des lettres (conçu pour le latin). */
html[lang="zh-Hans"] h1, html[lang="zh-Hans"] h2, html[lang="zh-Hans"] h3 { letter-spacing: 0; line-height: 1.18; }
html[lang="zh-Hans"] .surtitre { letter-spacing: 0; }
html[lang="zh-Hans"] .texte p, html[lang="zh-Hans"] .accroche { line-height: 1.8; max-width: 34em; }
html[lang="zh-Hans"] body { line-break: strict; }
/* Allemand : mots longs, la césure automatique évite les débordements. */
html[lang="de"] .texte p, html[lang="de"] .prive li p, html[lang="de"] .faq details p, html[lang="de"] .outils p { hyphens: auto; }
html[lang="de"] h1, html[lang="de"] h2 { hyphens: auto; overflow-wrap: break-word; }
.badge b, .badge small { white-space: nowrap; }
