/* cabana.dev — aucune police externe, aucun framework : le site doit prouver la vitesse. */
:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --ink: #15171a;
  --muted: #5b6168;
  --line: #e2e0d9;
  --accent: #0f7b5f;
  --accent-ink: #ffffff;
  --accent-soft: #e3f2ec;
  --code: #eceae4;
  --radius: 10px;
  --max: 1120px;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1113;
    --surface: #171a1d;
    --ink: #eceeef;
    --muted: #9aa1a8;
    --line: #2a2f34;
    --accent: #3ccf9e;
    --accent-ink: #06231a;
    --accent-soft: #12302a;
    --code: #1f2327;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.6 var(--sans);
}
img, svg { max-width: 100%; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.2rem, 5.5vw, 3.8rem); font-weight: 750; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 650; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.mono { font-family: var(--mono); font-size: .85em; letter-spacing: .02em; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; background: var(--surface); padding: 8px 12px; z-index: 10; }

/* En-tête */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 5; }
.site-header .wrap { display: flex; align-items: center; gap: 24px; height: 64px; }
.logo { font-family: var(--mono); font-weight: 700; font-size: 1.05rem; color: var(--ink); text-decoration: none; }
.logo span { color: var(--accent); }
.nav { display: flex; gap: 20px; margin-left: auto; align-items: center; }
.nav a { color: var(--ink); text-decoration: none; font-size: .95rem; }
.nav a:hover { color: var(--accent); }
.nav .lang { font-family: var(--mono); font-size: .8rem; border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; }
.site-header .wrap { position: relative; }
.nav-links { display: flex; gap: 20px; }
.menu-btn { display: none; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 8px; background: transparent; cursor: pointer; padding: 0; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.menu-btn span { display: block; width: 18px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .2s, opacity .2s; }
.open .menu-btn span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.open .menu-btn span:nth-child(2) { opacity: 0; }
.open .menu-btn span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
@media (max-width: 720px) {
  .nav { gap: 10px; }
  .menu-btn { display: inline-flex; }
  .nav-links { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; gap: 0; background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: 0 12px 24px rgba(0,0,0,.08); padding: 8px 20px 16px; }
  .open .nav-links { display: flex; }
  .nav-links a { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 1.05rem; }
  .nav-links a:last-child { border-bottom: 0; }
}

/* Boutons */
.btn {
  display: inline-block; background: var(--accent); color: var(--accent-ink);
  padding: 12px 20px; border-radius: 8px; font-weight: 650; text-decoration: none;
  border: 0; cursor: pointer; font: inherit; font-weight: 650;
}
.btn:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.nav .btn { padding: 8px 14px; font-size: .9rem; color: var(--accent-ink); }

/* Sections */
section { padding: 56px 0; }
@media (max-width: 600px) { section { padding: 40px 0; } }
section + section { border-top: 1px solid var(--line); }
.eyebrow { font-family: var(--mono); font-size: .8rem; color: var(--accent); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 14px; display: block; }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 640px; }

/* Héros */
.hero { padding: 64px 0 56px; }
.hero h1 { max-width: 15ch; }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-top: 44px; }
.metrics div { background: var(--surface); padding: 20px; }
.metrics b { display: block; font-family: var(--mono); font-size: 1.5rem; }
.metrics span { color: var(--muted); font-size: .9rem; }
@media (max-width: 720px) { .metrics { grid-template-columns: repeat(2, 1fr); } }

/* Grilles */
.grid { display: grid; gap: 20px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .g3, .g4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.card p:last-child { margin-bottom: 0; }
.card .tag { font-family: var(--mono); font-size: .75rem; background: var(--code); padding: 2px 8px; border-radius: 4px; color: var(--muted); }
.split { display: grid; grid-template-columns: 1fr 1.4fr; gap: 56px; align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; gap: 32px; } }

/* Liste sécurité */
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.checks li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px 18px 52px; position: relative; }
.checks li::before { content: ""; position: absolute; left: 20px; top: 22px; width: 16px; height: 16px; border-radius: 50%; background: var(--accent-soft); box-shadow: inset 0 0 0 5px var(--accent); }
.checks b { display: block; margin-bottom: 4px; }
.checks p { margin: 0; color: var(--muted); font-size: .95rem; }

/* Projets */
.project { display: flex; flex-direction: column; }
.project p { flex: 1; color: var(--muted); }
.project a.more { font-weight: 600; text-decoration: none; }

/* Appel à l'action */
.cta { background: var(--ink); color: var(--bg); border-radius: 16px; padding: 36px 40px; display: flex; gap: 32px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.cta h2 { margin: 0; max-width: 20ch; }
.cta p { margin: 8px 0 0; opacity: .75; }
@media (max-width: 600px) { .cta { padding: 32px 24px; } }

/* Formulaire */
form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { form .row { grid-template-columns: 1fr; } }
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px; margin-bottom: 16px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
textarea { min-height: 160px; resize: vertical; }
.hp { position: absolute; left: -9999px; }
.form-status { margin-top: 16px; padding: 12px 14px; border-radius: 8px; display: none; }
.form-status.ok { display: block; background: var(--accent-soft); }
.form-status.err { display: block; background: #fbe6e4; color: #7a1d14; }
@media (prefers-color-scheme: dark) { .form-status.err { background: #3a1915; color: #ffb4a8; } }

/* Texte long (politique) */
.prose { max-width: 720px; }
.prose h2 { font-size: 1.4rem; margin-top: 2em; }

/* Pied de page */
.site-footer { border-top: 1px solid var(--line); padding: 40px 0 28px; font-size: .92rem; }
.site-footer .cols { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 32px; }
@media (max-width: 800px) { .site-footer .cols { grid-template-columns: 1fr 1fr; } }
.site-footer h4 { font-family: var(--mono); font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 0 0 12px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer a { color: var(--ink); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.site-footer .legal { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

/* Blogue */
.post { padding: 40px 0 56px; }
.post h1 { font-size: clamp(2rem, 4.5vw, 3rem); margin-top: 20px; }
.post-hero { width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); background: var(--code); margin: 28px 0 8px; }
.post-body { font-size: 1.05rem; }
.post-body h2 { font-size: 1.5rem; margin-top: 1.8em; }
.post-body img { width: 100%; height: auto; border-radius: 8px; }
.post-body figure { margin: 1.5em 0; }
.post-body ul, .post-body ol { padding-left: 1.3em; }
.post-body li { margin-bottom: .4em; }
.post-body code { font-family: var(--mono); font-size: .88em; background: var(--code); padding: 1px 6px; border-radius: 4px; }
.post-body table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: .95rem; display: block; overflow-x: auto; }
.post-body th, .post-body td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; vertical-align: top; }
.post-body th { background: var(--code); }
.post-card { display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--ink); }
.post-card:hover { border-color: var(--accent); }
.post-card img { width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; border-radius: 6px; background: var(--code); margin-bottom: 8px; }
.post-card h3 { margin: 0; }
.post-card p { flex: 1; margin: 0; font-size: .95rem; }
.post-card .more { color: var(--accent); font-weight: 600; }

/* Pages projets */
.project-hero { padding: 40px 0 8px; }
.project-hero + section { border-top: 0; padding-top: 24px; }
.project-hero .lead { margin-bottom: 0; }
.prose > h2:first-child { margin-top: 0; }
.project-hero .tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.project-hero .tag { font-family: var(--mono); font-size: .75rem; background: var(--code); padding: 3px 10px; border-radius: 4px; color: var(--muted); }
.project-hero h1 { font-size: clamp(1.8rem, 3.2vw, 2.6rem); max-width: 22ch; }
.shot { width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--line); }
.demo { display: grid; grid-template-columns: 1fr auto 1.3fr; gap: 20px; align-items: center; margin: 28px 0; }
.demo .arrow { font-size: 1.6rem; color: var(--accent); }
.demo .card h4 { font-family: var(--mono); font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 12px; }
.demo ul { list-style: none; margin: 0; padding: 0; }
.demo .raw li { padding: 4px 0; border-bottom: 1px dashed var(--line); }
.demo .aisle { margin-bottom: 12px; }
.demo .aisle b { display: block; margin-bottom: 4px; }
.demo .aisle span { display: inline-block; margin-right: 14px; color: var(--muted); }
@media (max-width: 700px) { .demo { grid-template-columns: 1fr; } .demo .arrow { transform: rotate(90deg); justify-self: center; } }
.step { font-family: var(--mono); font-size: .75rem; color: var(--accent); letter-spacing: .08em; }

.side-illu { width: 100%; max-width: 420px; height: auto; margin-top: 28px; border-radius: var(--radius); border: 1px solid var(--line); background: #fff; }
@media (max-width: 900px) { .side-illu { max-width: 320px; } }
.post-body h3 { font-size: 1.15rem; margin-top: 1.6em; }
.post-body .note { background: var(--accent-soft); border-left: 3px solid var(--accent); padding: 12px 16px; border-radius: 6px; font-size: .95rem; }
