/* Site public de My Habita : vitrine, installation, intégrations, versions, documentation. */
:root {
  --bg: #f6f7f4; --surface: #ffffff; --surface2: #eef0eb; --text: #1d2321; --muted: #5f6b66;
  --accent: #2f7d5b; --accent-2: #3f9b72; --accent-text: #fff; --border: #dde1db;
  --warning: #a8701c; --danger: #b8382b; --info: #2e6f9e;
  --radius: 16px; --shadow: 0 1px 2px rgb(0 0 0 / .04), 0 8px 28px rgb(0 0 0 / .06);
  --font: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Code', 'DejaVu Sans Mono', monospace;
  --soft: color-mix(in srgb, var(--accent) 12%, transparent);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1412; --surface: #171d1a; --surface2: #1f2723; --text: #e7ece9; --muted: #9aa8a1; --accent: #4fb386; --accent-2: #62c497; --accent-text: #0b1410; --border: #2a332f; --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 28px rgb(0 0 0 / .25); color-scheme: dark; }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
code, pre { font-family: var(--mono); font-size: .88em; }
:not(pre) > code { background: var(--surface2); padding: .12em .4em; border-radius: 6px; }
pre { background: var(--surface2); padding: 14px 16px; border-radius: 12px; overflow: auto; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.015em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin: .2em 0 .4em; }
h2 { font-size: 1.5rem; margin: 1.8em 0 .6em; }
h3 { font-size: 1.1rem; margin: 1.2em 0 .4em; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.wrap.narrow { max-width: 820px; }
main { padding: 32px 0 64px; min-height: 70vh; }
main.wide { padding-top: 0; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 46em; }
.lead.small { font-size: 1.02rem; }
.small { font-size: .9rem; } .muted { color: var(--muted); }

/* En-tête */
.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent); }
.top-in { display: flex; align-items: center; gap: 20px; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand img { border-radius: 9px; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { color: var(--muted); padding: 7px 12px; border-radius: 10px; font-weight: 550; }
.nav a:hover { background: var(--surface2); color: var(--text); text-decoration: none; }
.nav a.active { color: var(--accent); background: var(--soft); }
@media (max-width: 760px) { .nav { display: none; } .top .btn { margin-left: auto; } }

/* Boutons */
.btn { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 600; cursor: pointer; font: inherit; font-weight: 600; }
.btn:hover { text-decoration: none; background: var(--surface2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover { background: var(--accent-2); }
.btn.sm { height: 36px; padding: 0 14px; font-size: .92rem; }

/* Vitrine */
.hero { padding: 72px 0 56px; background: radial-gradient(1200px 400px at 85% -10%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%), radial-gradient(800px 300px at -10% 110%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%); }
.hero-in { display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin: .3em 0 .3em; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.hero-card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 22px 26px; box-shadow: var(--shadow); }
.hero-card ul { margin: 0; padding-left: 1.1em; } .hero-card li { margin: .35em 0; }
.hero-card h3:first-child, .hero-card p:first-child { margin-top: 0; }
.pill { display: inline-block; padding: 5px 12px; border-radius: 99px; background: var(--soft); color: var(--accent); font-weight: 600; font-size: .88rem; }
@media (max-width: 860px) { .hero-in { grid-template-columns: 1fr; gap: 28px; } .hero { padding-top: 40px; } }
.block { padding: 56px 0; }
.block.alt { background: var(--surface); border-block: 1px solid var(--border); }
.block h2 { margin-top: 0; font-size: 1.9rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 18px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.block.alt .card { background: var(--bg); }
.card h3 { margin: 0 0 .4em; font-size: 1.05rem; }
.card p { margin: .3em 0; color: var(--muted); font-size: .95rem; }
.card.link { color: inherit; transition: transform .12s, border-color .12s; }
.card.link:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-1px); }
.logos { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }
.logo-chip { padding: 8px 14px; border-radius: 12px; background: var(--bg); border: 1px solid var(--border); font-weight: 600; font-size: .95rem; }
.logo-chip em { font-style: normal; color: var(--warning); font-size: .78rem; margin-left: 4px; }

/* Commande à copier */
.cmd { display: flex; align-items: center; gap: 10px; background: #111816; color: #d8f3e6; border-radius: 14px; padding: 12px 12px 12px 18px; margin: 18px 0; overflow: hidden; }
.cmd code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; background: none; padding: 0; color: inherit; font-size: .95rem; }
.cmd .copy { flex-shrink: 0; border: 0; border-radius: 9px; padding: 8px 14px; background: #2f7d5b; color: #fff; font: inherit; font-weight: 600; font-size: .85rem; cursor: pointer; }
.cmd .copy.done { background: #3f9b72; }

/* Étiquettes */
.tag { display: inline-block; font-size: .76rem; font-weight: 650; padding: 2px 9px; border-radius: 99px; margin-right: 6px; background: var(--surface2); color: var(--muted); }
.tag.stable, .tag.ok { background: var(--soft); color: var(--accent); }
.tag.beta { background: color-mix(in srgb, var(--warning) 16%, transparent); color: var(--warning); }
.tag.experimental { background: color-mix(in srgb, var(--danger) 13%, transparent); color: var(--danger); }
.tag.cloud { background: color-mix(in srgb, var(--info) 14%, transparent); color: var(--info); }
.legend { color: var(--muted); font-size: .92rem; }
.integ .tags { margin-top: 10px; }

/* Texte long */
.prose table { border-collapse: collapse; width: 100%; margin: 1em 0; font-size: .95rem; display: block; overflow-x: auto; }
.prose th, .prose td { border-bottom: 1px solid var(--border); padding: 8px 10px; text-align: left; vertical-align: top; }
.prose th { color: var(--muted); font-weight: 650; }
.prose blockquote { margin: 1em 0; padding: 10px 16px; border-left: 4px solid var(--accent); background: var(--soft); border-radius: 0 10px 10px 0; }
.prose blockquote p { margin: .3em 0; }
.prose li { margin: .25em 0; }
.prose img { border-radius: 12px; border: 1px solid var(--border); }

/* Versions */
.timeline { margin-top: 28px; border-left: 2px solid var(--border); padding-left: 26px; }
.release { position: relative; margin-bottom: 40px; }
.release::before { content: ''; position: absolute; left: -34px; top: 10px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--bg); }
.release header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.release h2 { margin: 0; font-size: 1.5rem; }
.release time { color: var(--muted); font-size: .92rem; margin-left: auto; }
.rtitle { font-weight: 600; margin: .3em 0 .6em; }

/* Documentation */
.docs { display: grid; grid-template-columns: 250px minmax(0, 1fr) 200px; gap: 36px; padding-top: 28px; }
.docnav { position: sticky; top: 80px; align-self: start; max-height: calc(100vh - 100px); overflow-y: auto; font-size: .95rem; }
.docnav a { display: block; padding: 5px 10px; border-radius: 8px; color: var(--text); }
.docnav a:hover { background: var(--surface2); text-decoration: none; }
.docnav a.active { background: var(--soft); color: var(--accent); font-weight: 600; }
.docsec { margin-bottom: 16px; }
.docsec-t { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650; padding: 4px 10px; }
.docsearch { width: 100%; height: 40px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: 0 12px; font: inherit; margin-bottom: 14px; }
.docresults { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 6px; margin-bottom: 14px; }
.docresults a { display: block; } .docresults small { display: block; color: var(--muted); }
.doc { min-width: 0; }
.doc h1 { margin-top: 0; }
.crumb { color: var(--accent); font-weight: 600; font-size: .9rem; margin: 0; }
.toc { position: sticky; top: 80px; align-self: start; font-size: .88rem; }
.toc a { display: block; padding: 3px 10px; color: var(--muted); }
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 48px; padding-top: 18px; border-top: 1px solid var(--border); }
@media (max-width: 1100px) { .docs { grid-template-columns: 220px minmax(0, 1fr); } .toc { display: none; } }
@media (max-width: 760px) { .docs { grid-template-columns: 1fr; } .docnav { position: static; max-height: none; } }

.foot { border-top: 1px solid var(--border); padding: 26px 0; color: var(--muted); font-size: .9rem; }
.foot-in { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
