/* Vigia · guide de conception (/vigia/guide) : écran et impression (PDF A4). */
@font-face { font-family: "Vigia Grotesk"; src: url(/site/assets/fonts/vigia/space-grotesk-var.woff2) format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Vigia Inter"; src: url(/site/assets/fonts/vigia/inter-var.woff2) format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Vigia Mono"; src: url(/site/assets/fonts/vigia/ibm-plex-mono-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Vigia Mono"; src: url(/site/assets/fonts/vigia/ibm-plex-mono-600.woff2) format("woff2"); font-weight: 500 700; font-display: swap; }

:root {
  --night: #060c18; --night-2: #0b1628; --cyan: #22d3ee; --brand: #0891b2; --brand-d: #0e7490; --orange: #fb923c; --hot: #c2410c;
  --ink: #0f172a; --muted: #5b6b7d; --line: #dbe4ee; --bg: #f6f8fb; --soft: #eef3f8; --card: #fff;
  --head: "Vigia Grotesk", system-ui, sans-serif; --body: "Vigia Inter", system-ui, sans-serif; --mono: "Vigia Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.65 var(--body); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand-d); }
h1, h2, h3, h4 { font-family: var(--head); letter-spacing: -.02em; line-height: 1.15; margin: 0; }
code, kbd { font-family: var(--mono); font-size: .88em; }
code { background: var(--soft); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; white-space: nowrap; }
kbd { display: inline-block; min-width: 24px; text-align: center; padding: 1px 7px; border: 1px solid #c3cfdc; border-bottom-width: 2px; border-radius: 6px; background: #fff; }

/* ---- Barre du haut */
.top { position: sticky; top: 0; z-index: 10; background: rgba(6, 12, 24, .92); backdrop-filter: blur(10px); border-bottom: 1px solid rgba(34, 211, 238, .16); }
.top .in { max-width: 1240px; margin: 0 auto; padding: 0 24px; min-height: 62px; display: flex; align-items: center; gap: 18px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font: 700 18px/1 var(--head); }
.logo small { font-weight: 500; color: #8fb2d0; font-size: 14px; }
.top .sp { flex: 1; }
.top a.lnk { color: #b9d3ea; text-decoration: none; font-size: 14px; padding: 8px 10px; border-radius: 8px; }
.top a.lnk:hover { color: #fff; background: rgba(34, 211, 238, .1); }
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 15px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: 600 14px/1 var(--body); text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-d); }
.btn:focus-visible, .toc a:focus-visible, .top a:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* ---- En-tête de page */
.hero { background: radial-gradient(800px 400px at 15% -10%, rgba(34, 211, 238, .22), transparent 65%), radial-gradient(600px 360px at 95% 0%, rgba(251, 146, 60, .14), transparent 65%), var(--night); color: #d6ecff; }
.hero .in { max-width: 1240px; margin: 0 auto; padding: 56px 24px 48px; display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: center; }
.eyebrow { margin: 0 0 10px; font: 600 12.5px/1.2 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--cyan); }
.hero h1 { font-size: clamp(34px, 5vw, 52px); color: #fff; }
.hero p.lead { margin: 16px 0 0; color: #a9c4dc; font-size: 18px; max-width: 640px; }
.hero .cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.hero .btn:not(.primary) { background: transparent; color: #e6f4ff; border-color: rgba(214, 236, 255, .25); }
.hero .facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.hero .facts div { padding: 16px 18px; border: 1px solid rgba(34, 211, 238, .2); border-radius: 12px; background: rgba(11, 22, 40, .7); }
.hero .facts b { display: block; font: 700 30px/1.1 var(--head); color: #fff; }
.hero .facts span { font: 500 12px/1.2 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: #8fb2d0; }

/* ---- Mise en page : sommaire + contenu */
.layout { max-width: 1240px; margin: 0 auto; padding: 40px 24px 80px; display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 48px; }
.layout > * { min-width: 0; }
.toc { position: sticky; top: 86px; align-self: start; max-height: calc(100vh - 110px); overflow: auto; font-size: 14px; }
.toc p { margin: 0 0 8px; font: 600 11.5px/1.2 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: t; }
.toc li { counter-increment: t; }
.toc a { display: flex; gap: 10px; padding: 6px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.toc a::before { content: counter(t, decimal-leading-zero); font: 600 12px/1.6 var(--mono); color: var(--brand); }
.toc a:hover { background: var(--soft); }
.toc .pdf { margin-top: 18px; width: 100%; justify-content: center; }
.toc a.pdf::before { content: none; }

main section { padding-bottom: 28px; margin-bottom: 40px; border-bottom: 1px solid var(--line); }
main section:last-child { border-bottom: 0; }
main h2 { font-size: 32px; margin-bottom: 14px; display: flex; align-items: baseline; gap: 14px; }
main h2 .n { font: 600 15px/1 var(--mono); color: var(--hot); background: rgba(194, 65, 12, .08); padding: 6px 9px; border-radius: 8px; flex: none; }
main h3 { font-size: 21px; margin: 30px 0 10px; }
main h4 { font-size: 16px; margin: 0 0 6px; }
main p { margin: 0 0 14px; }
main ul, main ol { margin: 0 0 16px; padding-left: 22px; }
main li { margin-bottom: 6px; }
.lede { font-size: 18px; color: #334155; }
.muted { color: var(--muted); }

/* Captures */
figure { margin: 18px 0 26px; }
figure .shot { border-radius: 12px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 18px 40px -22px rgba(15, 23, 42, .35); background: #fff; position: relative; }
figure.dark .shot { background: var(--night); }
figcaption { margin-top: 10px; font-size: 13.5px; color: var(--muted); }
.side-by-side { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 28px; align-items: start; margin: 18px 0 26px; }
.side-by-side figure { margin: 0; }
.side-by-side > * { min-width: 0; }
.panel-shot { max-width: 300px; }
.pin { position: absolute; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%; display: grid; place-items: center; background: var(--hot); color: #fff; font: 700 13px/1 var(--mono); box-shadow: 0 0 0 4px rgba(194, 65, 12, .25); }
.legend { list-style: none; padding: 0; margin: 14px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 22px; }
.legend li { display: flex; gap: 10px; font-size: 14.5px; margin: 0; }
.legend b.k { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--hot); color: #fff; font: 700 12px/1 var(--mono); }

/* Étapes numérotées */
.steps { list-style: none; padding: 0; margin: 0 0 18px; counter-reset: s; display: grid; gap: 10px; }
.steps > li { counter-increment: s; position: relative; padding: 14px 16px 14px 56px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin: 0; }
.steps > li::before { content: counter(s); position: absolute; left: 14px; top: 14px; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--night); color: var(--cyan); font: 700 14px/1 var(--head); }

/* Encadrés */
.note, .warn, .tip { padding: 14px 18px; border-radius: 12px; margin: 16px 0 20px; font-size: 15px; border: 1px solid; }
.note { background: #ecfeff; border-color: #a5f3fc; }
.tip { background: #f0fdf4; border-color: #bbf7d0; }
.warn { background: #fff7ed; border-color: #fed7aa; }
.note b:first-child, .tip b:first-child, .warn b:first-child { font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; margin-right: 6px; }
.note b:first-child { color: var(--brand-d); } .tip b:first-child { color: #15803d; } .warn b:first-child { color: var(--hot); }

/* Tableaux */
.tbl { width: 100%; border-collapse: collapse; margin: 12px 0 22px; font-size: 14.5px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.tbl th { text-align: left; font: 600 11.5px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: var(--soft); padding: 10px 12px; }
.tbl td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: top; }
.tbl td:first-child { font-weight: 600; white-space: nowrap; }
.tbl td.ico { width: 36px; padding-right: 0; }
.tbl td.ico svg { width: 22px; height: 22px; fill: none; stroke: var(--brand); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tbl .size { font-family: var(--mono); font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.tbl tr.sec td { background: #f8fafc; font: 700 14px/1.3 var(--head); color: var(--ink); padding-top: 14px; }
.tbl tr.sec td em { font: 600 12px/1 var(--mono); font-style: normal; color: var(--hot); margin-left: 8px; }

/* Modèles */
.tpls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 14px 0 22px; }
.tpl { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; break-inside: avoid; }
.tpl img { aspect-ratio: 16 / 10; object-fit: cover; object-position: top; width: 100%; border-bottom: 1px solid var(--line); }
.tpl div { padding: 10px 12px 12px; }
.tpl b { display: block; font: 700 15px/1.2 var(--head); }
.tpl span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.tpl em { font: 600 10.5px/1 var(--mono); font-style: normal; letter-spacing: .1em; text-transform: uppercase; color: var(--hot); }

/* Schémas de mise en page */
.recipes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 14px 0 24px; }
.recipe { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; break-inside: avoid; }
.recipe h4 { margin-bottom: 2px; }
.recipe p { font-size: 13px; color: var(--muted); margin: 0 0 10px; }
.mini { display: grid; grid-template-columns: repeat(12, 1fr); grid-auto-rows: 15px; gap: 3px; padding: 8px; border-radius: 8px; background: var(--night-2); }
.mini.light { background: #e9eef5; }
.mini i { border-radius: 3px; background: rgba(34, 211, 238, .25); border: 1px solid rgba(34, 211, 238, .45); font: 600 8.5px/1 var(--mono); color: #d6ecff; display: grid; place-items: center; text-align: center; overflow: hidden; font-style: normal; }
.mini.light i { background: #fff; border-color: #cbd5e1; color: #475569; }
.mini i.k { background: rgba(251, 146, 60, .25); border-color: rgba(251, 146, 60, .6); }
.mini.light i.k { background: #fff1e6; border-color: #fdba74; color: #9a3412; }

.cards2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 14px 0 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; break-inside: avoid; }
.card p { margin: 0; font-size: 14.5px; color: #334155; }
.card h4 { margin-bottom: 6px; }

.foot { max-width: 1240px; margin: 0 auto; padding: 24px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px 20px; }

/* Couverture : seulement à l'impression */
.cover { display: none; }

@media (max-width: 980px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .toc { position: static; max-height: none; }
  .hero .in { grid-template-columns: 1fr; }
  .side-by-side { grid-template-columns: 1fr; }
  .tpls, .recipes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .top .lnk { display: none; }
  .layout { padding: 24px 16px 60px; }
  .hero .in { padding: 40px 16px 36px; }
  .tpls, .recipes, .cards2, .legend { grid-template-columns: 1fr; }
  .tbl { display: block; overflow-x: auto; }
  main h2 { font-size: 26px; }
  code { white-space: normal; overflow-wrap: anywhere; }
}

/* ---- Impression : mode d'emploi A4 */
@page { size: A4; margin: 16mm 15mm 18mm; }
@media print {
  html { scroll-behavior: auto; }
  body { background: #fff; font-size: 10.5pt; line-height: 1.55; }
  .top, .toc, .hero, .foot, .screen-only { display: none !important; }
  .layout { display: block; padding: 0; max-width: none; }
  .cover { display: flex; flex-direction: column; justify-content: space-between; height: 296mm; margin: 0; padding: 22mm 20mm 18mm; color: #d6ecff;
    background: radial-gradient(120mm 90mm at 10% 0%, rgba(34, 211, 238, .3), transparent 70%), radial-gradient(110mm 90mm at 100% 100%, rgba(251, 146, 60, .22), transparent 70%), #060c18;
    -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .cover .brand { display: flex; align-items: center; gap: 12px; font: 700 20pt/1 var(--head); color: #fff; }
  .cover .brand img { width: 40px; height: 40px; }
  .cover h1 { font-size: 42pt; color: #fff; line-height: 1.05; margin-top: 10mm; }
  .cover h1 em { font-style: normal; color: var(--cyan); }
  .cover p { color: #a9c4dc; font-size: 13pt; max-width: 140mm; margin: 6mm 0 0; }
  .cover .shot { margin: 8mm 0 0; border-radius: 10px; overflow: hidden; border: 1px solid rgba(34, 211, 238, .35); }
  .cover .meta { display: flex; justify-content: space-between; font: 500 9pt/1.4 var(--mono); color: #8fb2d0; letter-spacing: .06em; }
  .print-toc { display: block !important; break-after: page; }
  .print-toc h2 { font-size: 22pt; margin-bottom: 8mm; }
  .print-toc ol { list-style: none; padding: 0; margin: 0; counter-reset: t; }
  .print-toc li { counter-increment: t; display: flex; gap: 10px; padding: 3.2mm 0; border-bottom: 1px solid var(--line); font: 600 12pt/1.3 var(--head); }
  .print-toc li::before { content: counter(t, decimal-leading-zero); font: 600 10pt/1.5 var(--mono); color: var(--hot); width: 10mm; }
  .print-toc li span { font: 400 9.5pt/1.5 var(--body); color: var(--muted); margin-left: auto; }
  main section { break-before: page; border: 0; margin: 0; padding: 0; }
  main h2 { font-size: 22pt; margin-bottom: 4mm; }
  main h3 { font-size: 13.5pt; margin: 6mm 0 2mm; break-after: avoid; }
  figure, .steps > li, .tbl tr, .card, .note, .tip, .warn, .side-by-side { break-inside: avoid; }
  figure { margin: 4mm 0 6mm; }
  figure .shot { box-shadow: none; }
  .side-by-side { grid-template-columns: 62mm minmax(0, 1fr); gap: 7mm; }
  .tpls { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3mm; }
  .tpl div { padding: 2mm 2.5mm; } .tpl b { font-size: 9.5pt; } .tpl span { font-size: 7.5pt; }
  .recipes { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4mm; }
  .tbl { font-size: 8.8pt; line-height: 1.4; } .tbl th { font-size: 7.5pt; padding: 1.6mm 2.5mm; } .tbl td { padding: 1.25mm 2.5mm; } .tbl tr.sec td { padding-top: 2mm; }
  .tbl, .tpl, .card, .note, .tip, .warn, .steps > li, figure .shot, .mini, .pin, .legend b.k, main h2 .n, code, kbd, .steps > li::before, .tbl th, .tbl tr.sec td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: inherit; text-decoration: none; }
}
.print-toc { display: none; }
/* PDF en deux passes : la couverture seule (pleine page, sans marge), puis le reste sans couverture */
@media print {
  html.cover-only main > :not(.cover) { display: none !important; }
  html.no-cover .cover { display: none !important; }
}
