/* Repères Électricité — design system
   Pétrole profond + ambre « électrique », une couleur par thème. */

@font-face { font-family: "Bricolage"; src: url("fonts/bricolage.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("fonts/figtree.woff2") format("woff2"); font-weight: 300 900; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("fonts/figtree-italic.woff2") format("woff2"); font-weight: 300 900; font-style: italic; font-display: swap; }

:root {
  --bg: #FBF8F3;
  --surface: #FFFFFF;
  --surface-2: #F3EEE5;
  --ink: #14232B;
  --ink-soft: #4A5A63;
  --line: #E6DFD3;
  --brand: #0E3B43;
  --brand-2: #155560;
  --on-brand: #EAF4F3;
  --volt: #FFC845;
  --volt-deep: #F5A524;
  --link: #0B6E79;
  --link-hover: #C2410C;
  --mark: #FFE7A3;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(20, 35, 43, .06), 0 8px 24px -12px rgba(20, 35, 43, .18);
  --shadow-hover: 0 2px 4px rgba(20, 35, 43, .08), 0 18px 40px -16px rgba(20, 35, 43, .28);
  --measure: 68ch;
  --head: "Bricolage", ui-sans-serif, system-ui, sans-serif;
  --body: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Couleur par thème : accent / fond teinté / texte sur teinte */
  --c: #0B6E79; --c-tint: #DDF3F5; --c-ink: #0A535B;
}
[data-pillar="installation"] { --c: #F5A524; --c-tint: #FFF2D6; --c-ink: #8A5A00; }
[data-pillar="chauffage"]    { --c: #EF6A4C; --c-tint: #FFE6DF; --c-ink: #A93A20; }
[data-pillar="securite"]     { --c: #4F7FEA; --c-tint: #E5ECFF; --c-ink: #2648A6; }
[data-pillar="exterieur"]    { --c: #2EA36D; --c-tint: #DFF5E9; --c-ink: #17734A; }
[data-pillar="local"]        { --c: #0E8C99; --c-tint: #DAF2F4; --c-ink: #0A5F68; }
[data-pillar="neutral"]      { --c: #FFC845; --c-tint: #F3EEE5; --c-ink: #0E3B43; }

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F1A1F; --surface: #15232A; --surface-2: #1B2B33;
    --ink: #E9EEF0; --ink-soft: #A9B6BC; --line: #26373F;
    --brand: #0A2A30; --brand-2: #0F3940;
    --link: #5FD0DB; --link-hover: #FFB37A; --mark: rgba(255, 200, 69, .28);
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -12px rgba(0,0,0,.6);
    --shadow-hover: 0 2px 4px rgba(0,0,0,.35), 0 18px 40px -16px rgba(0,0,0,.7);
  }
  [data-pillar] { --c-tint: color-mix(in srgb, var(--c) 16%, #15232A); --c-ink: color-mix(in srgb, var(--c) 70%, white); }
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 18px/1.72 var(--body); font-feature-settings: "ss01"; -webkit-font-smoothing: antialiased; }
.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 24px; }
a { color: var(--link); text-decoration-thickness: 1.5px; text-underline-offset: 3px; transition: color .15s; }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 3px solid var(--volt); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--head); line-height: 1.12; letter-spacing: -.02em; font-weight: 700; color: var(--ink); }
.ico { width: 22px; height: 22px; flex: none; }
.ico.sm { width: 17px; height: 17px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--volt); color: #14232B; padding: 8px 14px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }

/* ---------- En-tête ---------- */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.top.on-hero { background: var(--brand); border-bottom-color: transparent; }
.top.on-hero .brand, .top.on-hero .nav a { color: var(--on-brand); }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 700 1.2rem/1 var(--head); letter-spacing: -.02em; color: var(--ink); text-decoration: none; }
.logo { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--volt); color: #14232B; }
.logo .ico { width: 19px; height: 19px; fill: #14232B; stroke: none; }
.nav { display: flex; gap: 6px; }
.nav a { color: var(--ink-soft); text-decoration: none; font-weight: 600; font-size: .95rem; padding: 8px 14px; border-radius: 999px; transition: background .15s, color .15s; }
.nav a:hover { background: color-mix(in srgb, var(--volt) 30%, transparent); color: var(--ink); }
.top.on-hero .nav a:hover { color: #fff; background: rgba(255, 255, 255, .1); }

/* ---------- Hero accueil ---------- */
.hero { position: relative; overflow: hidden; color: var(--on-brand); background:
  radial-gradient(900px 420px at 85% 0%, rgba(255, 200, 69, .16), transparent 60%),
  radial-gradient(700px 400px at 0% 100%, rgba(46, 163, 109, .18), transparent 60%),
  var(--brand); }
.hero::before { content: ""; position: absolute; inset: 0; opacity: .5; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 40px 40px; mask-image: linear-gradient(to bottom, black, transparent 85%); -webkit-mask-image: linear-gradient(to bottom, black, transparent 85%); }
.hero-grid { position: relative; display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: 40px; padding-top: 72px; padding-bottom: 88px; }
.eyebrow { display: inline-block; margin: 0 0 18px; padding: 6px 14px; border-radius: 999px; font-size: .85rem; font-weight: 600; color: var(--volt); background: rgba(255, 200, 69, .12); border: 1px solid rgba(255, 200, 69, .3); }
.hero h1 { color: #fff; font-size: clamp(2.3rem, 5.6vw, 4rem); margin: 0 0 22px; font-weight: 800; letter-spacing: -.035em; }
.hero mark { color: #14232B; background: var(--volt); padding: 0 .18em; border-radius: .2em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.hero-lede { font-size: 1.2rem; line-height: 1.6; color: rgba(234, 244, 243, .85); max-width: 34em; margin: 0 0 32px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; }
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 50px; padding: 0 24px; border-radius: 999px; font-weight: 700; text-decoration: none; transition: transform .15s, box-shadow .15s, background .15s; }
.btn:hover { transform: translateY(-2px); }
.btn-volt { background: var(--volt); color: #14232B; box-shadow: 0 10px 30px -10px rgba(255, 200, 69, .7); }
.btn-volt:hover { color: #14232B; background: #FFD36B; }
.btn-ghost { color: #fff; border: 1.5px solid rgba(255, 255, 255, .3); }
.btn-ghost:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.hero-art { width: 100%; max-width: 420px; justify-self: center; filter: drop-shadow(0 30px 40px rgba(0, 0, 0, .35)); }
.hero-art .panel { fill: #F7F3EA; }
.hero-art .rail { fill: #D9D2C3; }
.hero-art .toggles rect { fill: #14232B; opacity: .85; }
.hero-art .wire { fill: none; stroke-width: 5; stroke-linecap: round; }
.hero-art .w1 { stroke: #FFC845; } .hero-art .w2 { stroke: #EF6A4C; } .hero-art .w3 { stroke: #4F7FEA; }
.hero-art .breakers rect { animation: pulse 4s ease-in-out infinite; }
.hero-art .breakers rect:nth-child(2n) { animation-delay: 1s; } .hero-art .breakers rect:nth-child(3n) { animation-delay: 2s; }
@keyframes pulse { 50% { opacity: .78; } }
@media (prefers-reduced-motion: reduce) { .hero-art .breakers rect { animation: none; } html { scroll-behavior: auto; } .btn:hover, .card a:hover, .step a:hover { transform: none; } }

/* ---------- Blocs accueil ---------- */
.block { padding-top: 80px; padding-bottom: 80px; }
.block-head { max-width: 720px; margin-bottom: 36px; }
.kicker { margin: 0 0 8px; font-size: .85rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--link); }
.block-head h2 { margin: 0; font-size: clamp(1.8rem, 3.6vw, 2.6rem); }
.band { background: var(--surface-2); }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: s; }
.step a { position: relative; display: flex; flex-direction: column; gap: 10px; height: 100%; padding: 28px; border-radius: var(--radius); background: var(--surface); color: var(--ink); text-decoration: none; box-shadow: var(--shadow); border-top: 5px solid var(--c); transition: transform .2s, box-shadow .2s; }
.step a:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); color: var(--ink); }
.step-n { font: 800 2.4rem/1 var(--head); color: var(--c); letter-spacing: -.04em; }

.card-title { font: 700 1.2rem/1.25 var(--head); letter-spacing: -.015em; }
.card-desc { color: var(--ink-soft); font-size: .98rem; line-height: 1.55; flex: 1; }
.card-more { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .92rem; color: var(--c-ink); }

.themes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.theme { padding: 28px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); position: relative; overflow: hidden; }
.theme::after { content: ""; position: absolute; right: -60px; top: -60px; width: 180px; height: 180px; border-radius: 50%; background: var(--c-tint); }
.theme > * { position: relative; z-index: 1; }
.theme h3 { margin: 16px 0 10px; font-size: 1.4rem; }
.theme h3 a { color: var(--ink); text-decoration: none; }
.theme h3 a:hover { color: var(--c-ink); }
.theme ul { list-style: none; margin: 0; padding: 0; }
.theme li { border-top: 1px solid var(--line); }
.theme li a { display: block; padding: 10px 0; color: var(--ink-soft); text-decoration: none; font-weight: 500; }
.theme li a:hover { color: var(--c-ink); }
.theme li a::before { content: "→"; display: inline-block; margin-right: 10px; color: var(--c); transition: transform .15s; }
.theme li a:hover::before { transform: translateX(3px); }
.badge { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 15px; background: var(--c-tint); color: var(--c-ink); }
.badge .ico { width: 26px; height: 26px; }

.prose-block .prose { margin: 0 auto; }

/* ---------- En-tête de page ---------- */
.page-head { position: relative; overflow: hidden; background: var(--c-tint); padding: 36px 0 44px; border-bottom: 1px solid var(--line); }
.page-head::after { content: ""; position: absolute; right: -120px; top: -140px; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--c) 30%, transparent), transparent 70%); pointer-events: none; }
.page-head .wrap { position: relative; z-index: 1; }
.page-head h1 { max-width: 22ch; margin: 14px 0 14px; font-size: clamp(2rem, 4.6vw, 3.2rem); font-weight: 800; letter-spacing: -.03em; }
.page-lede { max-width: 40em; margin: 0; font-size: 1.18rem; line-height: 1.6; color: var(--ink-soft); }
.meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 18px 0 0; font-size: .9rem; color: var(--ink-soft); }
.meta .dot { margin: 0 4px; opacity: .5; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .88rem; color: var(--ink-soft); }
.crumbs a { color: var(--ink-soft); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs .sep { opacity: .45; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 13px; border-radius: 999px; background: var(--surface); color: var(--c-ink); font-size: .85rem; font-weight: 700; text-decoration: none; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c) 45%, transparent); }
a.chip:hover { color: var(--c-ink); background: var(--c-tint); }
.page-head .chip { margin-top: 18px; }

/* ---------- Corps de page ---------- */
.page-body { padding-top: 48px; padding-bottom: 72px; }
.page-body.has-toc { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 56px; align-items: start; }
.page-body.has-toc .toc { order: 2; position: sticky; top: 92px; }
.prose { max-width: var(--measure); }
.prose.wide { max-width: none; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.15em; }
.prose h2 { font-size: clamp(1.5rem, 2.6vw, 1.95rem); margin: 2.2em 0 .6em; }
.prose h2::before { content: ""; display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--volt); margin-bottom: 18px; }
.prose h3 { font-size: 1.28rem; margin: 1.8em 0 .5em; }
.prose li { margin: .35em 0; padding-left: .2em; }
.prose li::marker { color: var(--volt-deep); font-weight: 700; }
.prose strong { font-weight: 700; color: var(--ink); }
.prose code { background: var(--surface-2); padding: 2px 6px; border-radius: 6px; font-size: .88em; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: .96rem; display: block; overflow-x: auto; }
.prose th { text-align: left; background: var(--surface-2); font-weight: 700; }
.prose th, .prose td { padding: 11px 14px; border-bottom: 1px solid var(--line); }
.prose blockquote { margin: 1.6em 0; padding: 4px 0 4px 22px; border-left: 4px solid var(--volt); font-size: 1.12rem; color: var(--ink-soft); }

.note, .tip, .warn { margin: 1.8em 0; padding: 18px 22px; border-radius: 14px; }
.note { background: var(--surface-2); border: 1px solid var(--line); }
.tip { background: #DFF5E9; color: #0F3B27; }
.warn { background: #FFF2D6; color: #4A3300; border-left: 5px solid var(--volt-deep); }
.note p:last-child, .tip p:last-child, .warn p:last-child { margin: 0; }
.brief { padding: 22px 26px; border-radius: 14px; background: var(--surface); border: 2px dashed var(--line); }

/* Sommaire */
.toc details { padding: 20px 22px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.toc summary { cursor: pointer; font: 700 1rem/1 var(--head); list-style: none; }
.toc summary::-webkit-details-marker { display: none; }
.toc ol { margin: 14px 0 0; padding: 0; list-style: none; counter-reset: t; }
.toc li { counter-increment: t; margin: 0; }
.toc a { display: flex; gap: 10px; padding: 7px 0; font-size: .93rem; line-height: 1.4; color: var(--ink-soft); text-decoration: none; }
.toc a::before { content: counter(t, decimal-leading-zero); font-weight: 700; color: var(--volt-deep); font-variant-numeric: tabular-nums; }
.toc a:hover { color: var(--ink); }

/* ---------- Cartes / index ---------- */
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.card a { display: flex; flex-direction: column; gap: 10px; height: 100%; padding: 24px; border-radius: var(--radius); background: var(--surface); color: var(--ink); text-decoration: none; box-shadow: var(--shadow); border: 1px solid transparent; transition: transform .2s, box-shadow .2s, border-color .2s; }
.card a:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: color-mix(in srgb, var(--c) 40%, transparent); color: var(--ink); }
.card .chip { align-self: flex-start; box-shadow: none; background: var(--c-tint); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.pillar { margin-top: 56px; }
.pillar-head { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.pillar-head h2 { margin: 0; font-size: 1.7rem; }
.pillar-head h2::before { display: none; }
.pillar-head .count { margin-left: auto; font-size: .88rem; font-weight: 700; color: var(--c-ink); background: var(--c-tint); padding: 5px 12px; border-radius: 999px; }
.related { padding-bottom: 80px; }
.related h2 { font-size: 1.6rem; margin: 0 0 22px; }

/* ---------- Pied de page ---------- */
.foot { background: var(--brand); color: rgba(234, 244, 243, .78); font-size: .95rem; }
.foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 40px; padding-top: 56px; padding-bottom: 40px; }
.foot .brand { color: #fff; }
.foot a { color: rgba(234, 244, 243, .78); text-decoration: none; }
.foot a:hover { color: var(--volt); }
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { margin: 8px 0; }
.foot-title { margin: 6px 0 14px; font: 700 .85rem/1 var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--volt); }
.safety { display: flex; gap: 10px; align-items: flex-start; max-width: 36em; padding: 14px 16px; border-radius: 12px; background: rgba(255, 255, 255, .06); font-size: .88rem; line-height: 1.55; }
.safety .ico { color: var(--volt); margin-top: 2px; }
.foot-bottom { padding-top: 20px; padding-bottom: 28px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: .85rem; color: rgba(234, 244, 243, .55); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; padding-top: 48px; padding-bottom: 64px; }
  .hero-art { max-width: 300px; order: -1; }
  .steps { grid-template-columns: 1fr; }
  .page-body.has-toc { grid-template-columns: 1fr; gap: 24px; }
  .page-body.has-toc .toc { order: 0; position: static; }
}
@media (max-width: 720px) {
  body { font-size: 17px; }
  .wrap { padding: 0 16px; }
  .top .wrap { min-height: 60px; }
  .brand { font-size: 1.05rem; }
  .nav a { padding: 8px 9px; font-size: .9rem; }
  .hero-art { display: none; }
  .themes { grid-template-columns: 1fr; }
  .block { padding-top: 56px; padding-bottom: 56px; }
  .foot-grid { grid-template-columns: 1fr; gap: 28px; }
  .btn { width: 100%; justify-content: center; }
}
@media (max-width: 400px) { .nav a:last-child { display: none; } }
