/* Ali DHIBI : feuille de style unique. Propriétés logiques partout : le RTL (arabe) s'adapte seul. */

:root {
  --ink: #0a0a0c;
  --ink-2: #111114;
  --ink-3: #1a1a1e;
  --paper: #eceae4;
  --paper-2: #e3e0d8;
  --on-dark: #e8e8ea; /* argent clair du logo */
  --muted-dark: #a3a3a9;
  --on-light: #121214;
  --muted-light: #55555c;
  --line-dark: rgba(236, 235, 230, 0.14);
  --line-light: rgba(18, 18, 20, 0.16);
  --accent: #e0463d;       /* sur fond sombre */
  --accent-deep: #b3261e;  /* sur fond clair */
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --wrap: 1180px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --header-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 8px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; background: var(--ink); color: var(--on-dark);
  font: 400 1.0625rem/1.65 var(--sans); text-rendering: optimizeLegibility;
}
html[lang="ar"] body, html[lang="ar"] :is(h1, h2, h3, .fact-value, .brand-mark) {
  font-family: "Segoe UI", "Noto Sans Arabic", "Noto Naskh Arabic", Tahoma, "Arial", sans-serif;
}
html[lang="ar"] body { line-height: 1.85; }
img, svg { max-width: 100%; }
a { color: inherit; }
p { margin: 0; }
ul, ol, dl, dd { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.light :focus-visible { outline-color: var(--accent-deep); }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; inset-inline-start: 1rem; top: -4rem; z-index: 100; background: var(--paper); color: var(--on-light); padding: .6rem 1rem; border-radius: 4px; transition: top .15s; }
.skip:focus { top: .75rem; }
.icon { flex: none; }
[dir="rtl"] .icon-dir { transform: scaleX(-1); }

/* ─── Bandes de fond ─── */
.dark { background: var(--ink); color: var(--on-dark); }
.dark-2 { background: var(--ink-2); color: var(--on-dark); }
.light { background: var(--paper); color: var(--on-light); }
.section { padding-block: clamp(4rem, 9vw, 7.5rem); }

/* ─── En-tête ─── */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: rgba(10, 10, 12, 0.88); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-dark);
}
.bar { display: flex; align-items: center; gap: 1.5rem; height: 100%; }
.brand { display: inline-flex; align-items: center; gap: .7rem; text-decoration: none; font-weight: 600; letter-spacing: .01em; margin-inline-end: auto; }
.brand-mark { display: block; width: 56px; height: 34px; }
.nav ul { display: flex; gap: clamp(1rem, 2.4vw, 2rem); }
.nav a { position: relative; display: inline-block; padding: .5rem 0; text-decoration: none; font-size: .95rem; color: var(--muted-dark); transition: color .2s; }
.nav a:hover, .nav a[aria-current="true"] { color: var(--on-dark); }
.nav a[aria-current="true"]::after { content: ""; position: absolute; inset-inline: 0; bottom: .1rem; height: 1px; background: var(--accent); }
.tools { display: flex; align-items: center; gap: .75rem; }
.lang { display: inline-flex; border: 1px solid var(--line-dark); border-radius: 999px; padding: 2px; }
.lang-link { min-width: 2.6rem; padding: .3rem .6rem; text-align: center; text-decoration: none; font-size: .78rem; font-weight: 600; letter-spacing: .06em; border-radius: 999px; color: var(--muted-dark); transition: color .2s, background .2s; }
.lang-link:hover { color: var(--on-dark); }
.lang-link[aria-current="true"] { background: var(--on-dark); color: var(--ink); }
.menu-btn { display: none; width: 44px; height: 44px; padding: 0; background: none; border: 1px solid var(--line-dark); border-radius: 50%; color: inherit; cursor: pointer; place-items: center; }
.menu-bars, .menu-bars::before { display: block; width: 18px; height: 1.5px; background: currentColor; position: relative; transition: transform .2s; }
.menu-bars::before { content: ""; position: absolute; top: 6px; }
.menu-bars { top: -3px; }
.menu-btn[aria-expanded="true"] .menu-bars { transform: translateY(3px) rotate(45deg); }
.menu-btn[aria-expanded="true"] .menu-bars::before { transform: translateY(-6px) rotate(-90deg); top: 6px; }

@media (max-width: 900px) {
  .menu-btn { display: grid; }
  .js .nav {
    position: absolute; inset-inline: 0; top: var(--header-h); background: var(--ink);
    border-bottom: 1px solid var(--line-dark); padding: .5rem var(--gutter) 1.25rem;
    display: none;
  }
  .js .nav.is-open { display: block; }
  .nav ul { flex-direction: column; gap: 0; }
  .nav a { display: block; padding: .9rem 0; font-size: 1.1rem; border-bottom: 1px solid var(--line-dark); color: var(--on-dark); }
  .nav a[aria-current="true"]::after { display: none; }
  .nav a[aria-current="true"] { color: var(--accent); }
  .no-js .nav { order: 3; width: 100%; }
  .no-js .bar { flex-wrap: wrap; height: auto; padding-block: .5rem; }
  .no-js .site-header { position: static; height: auto; }
}
@media (max-width: 520px) { .brand-name { display: none; } }

/* ─── Typographie commune ─── */
h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 500; letter-spacing: -.012em; line-height: 1.12; text-wrap: balance; }
h2 { font-size: clamp(1.9rem, 4.2vw, 3.1rem); }
h3 { font-size: 1.3rem; }
.eyebrow { font: 600 .78rem/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin-bottom: 1.1rem; display: flex; align-items: center; gap: .8rem; }
.eyebrow::before { content: ""; width: 2rem; height: 1px; background: currentColor; }
.light .eyebrow { color: var(--accent-deep); }
html[lang="ar"] .eyebrow { letter-spacing: 0; text-transform: none; font-size: .95rem; }
.section-head { max-width: 52rem; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-intro { margin-top: 1.25rem; font-size: 1.125rem; color: var(--muted-dark); max-width: 42rem; }
.light .section-intro { color: var(--muted-light); }

/* ─── Boutons ─── */
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .85rem 1rem; }
.btn { display: inline-flex; align-items: center; gap: .6rem; padding: .95rem 1.5rem; border: 1px solid transparent; border-radius: 2px; font: 600 .98rem/1.2 var(--sans); text-decoration: none; transition: background .2s, color .2s, border-color .2s; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #ee5a51; }
.btn-ghost { border-color: var(--line-dark); color: var(--on-dark); }
.btn-ghost:hover { border-color: var(--on-dark); }
.btn:not(.btn-ghost) .icon-dir { transition: transform .2s; }
@media (prefers-reduced-motion: no-preference) {
  .btn-primary:hover .icon-dir { transform: translateX(3px); }
  [dir="rtl"] .btn-primary:hover .icon-dir { transform: scaleX(-1) translateX(3px); }
}

/* ─── Hero ─── */
.hero { position: relative; overflow: hidden; padding-block: clamp(3.5rem, 8vw, 6rem) clamp(3rem, 6vw, 5rem); min-height: min(calc(100svh - var(--header-h)), 820px); display: grid; align-items: center; background: radial-gradient(60% 70% at 85% 40%, rgba(224, 70, 61, .10), transparent 70%), var(--ink); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.kicker { font: 500 .9rem/1.4 var(--sans); letter-spacing: .08em; color: var(--muted-dark); margin-bottom: 1.6rem; }
html[lang="ar"] .kicker { letter-spacing: 0; font-size: 1rem; }
.hero h1 { font-size: clamp(2.2rem, 5.2vw, 4rem); line-height: 1.04; letter-spacing: -.025em; }
html[lang="ar"] .hero h1 { line-height: 1.3; letter-spacing: 0; font-weight: 600; }
.hero h1 em { font-style: normal; color: var(--accent); display: inline; }
.lede { margin-top: 1.75rem; max-width: 38rem; font-size: clamp(1.08rem, 1.7vw, 1.28rem); color: #cfcfd2; }
.vision { margin-top: 1rem; max-width: 38rem; color: var(--muted-dark); border-inline-start: 2px solid var(--accent); padding-inline-start: 1rem; }
.hero .actions { margin-top: 2.25rem; }
.link-cv { display: inline-flex; align-items: center; gap: .5rem; font-size: .95rem; color: var(--muted-dark); text-decoration: none; padding: .5rem .25rem; border-bottom: 1px solid var(--line-dark); transition: color .2s, border-color .2s; }
.link-cv:hover { color: var(--on-dark); border-color: var(--accent); }
.domain-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 2.5rem; }
.domain-chips li { font-size: .82rem; padding: .35rem .8rem; border: 1px solid var(--line-dark); border-radius: 999px; color: var(--muted-dark); }
.hero-art { color: var(--on-dark); justify-self: center; width: min(100%, 440px); }
.emblem { position: relative; aspect-ratio: 681 / 527; }
.rings { position: absolute; width: 150%; height: auto; inset-inline-start: -25%; top: 50%; transform: translateY(-50%); overflow: visible; pointer-events: none; }
.emblem img { position: absolute; inset-inline: 0; width: 100%; height: auto; }
.em-mark, .em-red { top: 0; }
.em-name { top: 86.3%; }
.em-red { opacity: 0; }
/* Entrée unique, courte et sans mouvement permanent ; sans effet si mouvement réduit */
@media (prefers-reduced-motion: no-preference) {
  .em-mark { animation: emIn .9s cubic-bezier(.2, .7, .2, 1) both; }
  .em-name { animation: emIn .8s cubic-bezier(.2, .7, .2, 1) .55s both; }
  .em-red { animation: emGlow 1.4s ease-in-out .9s both; }
  @keyframes emIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
  @keyframes emGlow {
    0%, 100% { opacity: 0; filter: drop-shadow(0 0 0 rgba(255, 70, 60, 0)); }
    45% { opacity: .85; filter: drop-shadow(0 0 9px rgba(255, 70, 60, .5)); }
  }
}
@media (max-width: 820px) {
  .hero { min-height: 0; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { order: -1; width: min(62%, 230px); margin-inline: 0; justify-self: start; }
}

/* ─── Repères ─── */
.facts { padding-block: clamp(2.5rem, 5vw, 4rem); border-block: 1px solid var(--line-dark); }
.fact-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem 0; }
.fact { padding-inline: clamp(1rem, 2vw, 1.75rem); border-inline-start: 1px solid var(--line-dark); }
.fact:first-child { border-inline-start: 0; padding-inline-start: 0; }
.fact-value { font: 500 clamp(2rem, 4vw, 3.1rem)/1 var(--serif); letter-spacing: -.02em; color: var(--on-dark); }
.fact-label { margin-top: .6rem; font-weight: 600; font-size: .98rem; line-height: 1.35; }
.fact-context { margin-top: .5rem; font-size: .9rem; line-height: 1.55; color: var(--muted-dark); }
.path { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 2rem; margin-top: clamp(2rem, 4vw, 3rem); padding-top: 1.75rem; border-top: 1px solid var(--line-dark); }
.path-label { font: 600 .75rem/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--muted-dark); }
html[lang="ar"] .path-label { letter-spacing: 0; font-size: .9rem; text-transform: none; }
.path-steps { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 0; counter-reset: s; }
.path-steps li { display: flex; align-items: center; font-size: .95rem; }
.path-steps li:not(:last-child)::after { content: ""; width: clamp(1rem, 3vw, 2.5rem); height: 1px; background: var(--line-dark); margin-inline: .6rem; }
.path-steps li.is-last span { color: var(--accent); font-weight: 600; }
@media (max-width: 900px) {
  .fact-grid { grid-template-columns: 1fr 1fr; }
  .fact:nth-child(odd) { border-inline-start: 0; padding-inline-start: 0; }
}
@media (max-width: 520px) {
  .fact-grid { grid-template-columns: 1fr; }
  .fact { border-inline-start: 0; padding-inline: 0; padding-bottom: 1.5rem; border-bottom: 1px solid var(--line-dark); }
  .fact:last-child { border-bottom: 0; padding-bottom: 0; }
  .path-steps { flex-direction: column; align-items: flex-start; gap: 0; }
  .path-steps li { padding-block: .35rem; }
  .path-steps li:not(:last-child)::after { display: none; }
  .path-steps li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--line-dark); margin-inline-end: .75rem; }
  .path-steps li.is-last::before { background: var(--accent); }
}

/* ─── Profil ─── */
.profile-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.prose { display: grid; gap: 1.2rem; font-size: 1.125rem; max-width: 40rem; }
.prose p:first-child::first-line { font-weight: 600; }
.profile-side { display: grid; gap: 2rem; padding-top: .5rem; }
.seeking { background: var(--on-light); color: var(--on-dark); padding: clamp(1.5rem, 3vw, 2.25rem); border-top: 3px solid var(--accent); }
.seeking h3 { font-size: 1.2rem; margin-bottom: .75rem; }
.seeking p { color: #cfcfd2; font-size: 1rem; }
.details > div { padding-block: 1rem; border-top: 1px solid var(--line-light); }
.details > div:last-child { border-bottom: 1px solid var(--line-light); }
.details dt { font: 600 .75rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted-light); margin-bottom: .5rem; }
html[lang="ar"] .details dt { letter-spacing: 0; font-size: .9rem; text-transform: none; }
@media (max-width: 860px) { .profile-grid { grid-template-columns: 1fr; } }

/* ─── Cartes (expertise, réalisations) ─── */
.domain-grid, .work-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line-dark); border: 1px solid var(--line-dark); }
.card { background: var(--ink); padding: clamp(1.5rem, 3.4vw, 2.75rem); display: flex; flex-direction: column; }
.dark-2 .card { background: var(--ink-2); }
.num { font: 500 .9rem/1 var(--serif); color: var(--accent); letter-spacing: .08em; margin-bottom: 1.25rem; }
.card h3 { font-size: clamp(1.35rem, 2.2vw, 1.7rem); }
.domain-lead { margin-top: .9rem; color: var(--muted-dark); font-size: 1rem; }
.ticks { margin-top: 1.5rem; display: grid; gap: .55rem; font-size: .98rem; }
.ticks li { position: relative; padding-inline-start: 1.25rem; }
.ticks li::before { content: ""; position: absolute; inset-inline-start: 0; top: .7em; width: .55rem; height: 1px; background: var(--accent); }
.domain-note { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px dashed var(--line-dark); font-size: .88rem; color: var(--muted-dark); }
@media (max-width: 860px) { .domain-grid, .work-grid { grid-template-columns: 1fr; } }

/* ─── Expérience ─── */
.legend { font-size: .9rem; color: var(--muted-light); margin: -1.5rem 0 2rem; max-width: 42rem; }
.timeline { border-top: 1px solid var(--line-light); }
.role { display: grid; grid-template-columns: minmax(150px, 220px) minmax(0, 1fr); gap: 1rem clamp(1.5rem, 4vw, 3.5rem); padding-block: clamp(1.75rem, 3.5vw, 2.75rem); border-bottom: 1px solid var(--line-light); }
.role-meta { padding-top: .35rem; }
.role-period { font: 600 .9rem/1.4 var(--sans); color: var(--accent-deep); }
.role-org { margin-top: .35rem; font-weight: 600; }
.role-body h3 { font-size: clamp(1.4rem, 2.6vw, 2rem); }
.role-current .role-body h3 { font-size: clamp(1.6rem, 3.2vw, 2.4rem); }
.role-summary { margin-top: .6rem; color: var(--muted-light); max-width: 44rem; }
.role-list { margin-top: 1.5rem; display: grid; gap: .8rem; }
.role-list li { display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: .25rem 1rem; align-items: baseline; font-size: 1rem; }
.kind { justify-self: start; font: 600 .7rem/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; padding: .32rem .5rem; border: 1px solid currentColor; white-space: nowrap; }
html[lang="ar"] .kind { letter-spacing: 0; text-transform: none; font-size: .8rem; }
.kind-lead { background: var(--accent-deep); border-color: var(--accent-deep); color: #fff; }
.kind-design { color: var(--on-light); }
.kind-contrib { color: var(--muted-light); border-style: dashed; }
.kind-industrialize { color: var(--on-light); background: var(--paper-2); border-color: var(--paper-2); }
@media (max-width: 760px) {
  .role { grid-template-columns: 1fr; }
  .role-meta { display: flex; flex-wrap: wrap; gap: .25rem 1rem; padding-top: 0; }
  .role-org { margin-top: 0; }
  .role-list li { grid-template-columns: 1fr; gap: .4rem; }
}

/* ─── Réalisations ─── */
.work dl { margin-top: 1.5rem; display: grid; gap: 1.1rem; }
.work dt { font: 600 .72rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: .4rem; }
html[lang="ar"] .work dt { letter-spacing: 0; font-size: .9rem; text-transform: none; }
.work dd { color: #cfcfd2; font-size: .98rem; line-height: 1.6; }
.work .dl-role { padding-top: 1.1rem; border-top: 1px solid var(--line-dark); }
.work .dl-role dd { color: var(--on-dark); font-weight: 500; }
.tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: auto; padding-top: 1.75rem; }
.tags li { font-size: .78rem; padding: .25rem .6rem; border: 1px solid var(--line-dark); color: var(--muted-dark); border-radius: 999px; }

/* ─── Formation ─── */
.edu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 6vw, 5rem); }
.edu-grid h3 { font: 600 .78rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted-light); padding-bottom: 1rem; border-bottom: 1px solid var(--on-light); }
html[lang="ar"] .edu-grid h3 { letter-spacing: 0; font-size: .95rem; text-transform: none; }
.edu-list li { padding-block: 1.1rem; border-bottom: 1px solid var(--line-light); }
.edu-name { font-weight: 600; font-size: 1.05rem; line-height: 1.4; }
.edu-place { color: var(--muted-light); font-size: .95rem; margin-top: .2rem; }
.edu-note { margin-top: 1rem; font-size: .88rem; color: var(--muted-light); font-style: italic; }
@media (max-width: 760px) { .edu-grid { grid-template-columns: 1fr; } }

/* ─── Articles ─── */
.articles-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.articles-grid .section-head { margin-bottom: 2rem; }
.topic-list { display: grid; gap: 0; border-top: 1px solid var(--line-dark); }
.topic-list li { padding-block: .85rem; border-bottom: 1px solid var(--line-dark); font-size: 1rem; }
.articles-feed { padding-top: 1.5rem; }
.empty { border: 1px dashed var(--line-dark); padding: clamp(1.5rem, 3vw, 2.5rem); display: grid; gap: 1.25rem; justify-items: start; color: var(--muted-dark); }
.more { display: inline-flex; align-items: center; gap: .5rem; color: var(--on-dark); font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--accent); padding-bottom: .15rem; }
.more:hover { color: var(--accent); }
.article-list { display: grid; gap: 1.5rem; }
.article { padding-bottom: 1.5rem; border-bottom: 1px solid var(--line-dark); display: grid; gap: .6rem; }
.article-meta { font-size: .85rem; color: var(--muted-dark); }
.article h3 a { text-decoration: none; }
.article h3 a:hover { color: var(--accent); }
@media (max-width: 860px) { .articles-grid { grid-template-columns: 1fr; } .articles-feed { padding-top: 0; } }

/* ─── Contact ─── */
.contact { position: relative; background: radial-gradient(55% 80% at 100% 100%, rgba(224, 70, 61, .12), transparent 70%), var(--ink); border-top: 1px solid var(--line-dark); }
[dir="rtl"] .contact { background: radial-gradient(55% 80% at 0% 100%, rgba(224, 70, 61, .12), transparent 70%), var(--ink); }
.contact-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.contact h2 { font-size: clamp(2.1rem, 5vw, 3.8rem); }
.contact .actions { margin-top: 2rem; }
.topics-label { margin-top: 2.5rem; font: 600 .75rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted-dark); }
html[lang="ar"] .topics-label { letter-spacing: 0; font-size: .9rem; text-transform: none; }
.topic-links { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .9rem; }
.topic-links a { display: inline-block; padding: .5rem 1rem; border: 1px solid var(--line-dark); border-radius: 999px; text-decoration: none; font-size: .92rem; transition: border-color .2s, color .2s; }
.topic-links a:hover { border-color: var(--accent); color: var(--accent); }
.contact-details > div { padding-block: 1.25rem; border-top: 1px solid var(--line-dark); }
.contact-details > div:last-child { border-bottom: 1px solid var(--line-dark); }
.contact-details dt { font: 600 .75rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted-dark); margin-bottom: .55rem; }
html[lang="ar"] .contact-details dt { letter-spacing: 0; font-size: .9rem; text-transform: none; }
.contact-details dd { font-size: 1.1rem; overflow-wrap: anywhere; }
.contact-details a { text-decoration: none; border-bottom: 1px solid var(--line-dark); transition: border-color .2s; }
.contact-details a:hover { border-color: var(--accent); }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }

/* ─── Pied de page ─── */
.site-footer { background: var(--ink); border-top: 1px solid var(--line-dark); padding-block: 1.75rem; font-size: .88rem; color: var(--muted-dark); }
.foot { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; }
.foot p { margin-inline-end: auto; }
.foot-mark { width: 40px; height: 24px; opacity: .85; }
.foot a { text-decoration: none; border-bottom: 1px solid var(--line-dark); }
.foot a:hover { color: var(--on-dark); }

/* ─── Apparition au défilement (uniquement avec JS et sans préférence de mouvement réduit) ─── */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
  .js .reveal.is-visible { opacity: 1; transform: none; }
}

@media print {
  .site-header, .hero-art, .menu-btn { display: none; }
  body, .dark, .dark-2, .light { background: #fff; color: #000; }
}

/* Type de contribution : conseillé */
.kind-advise { color: var(--accent-deep); border-color: var(--accent-deep); background: transparent; }

/* Page d'article */
.article-page { padding-top: clamp(2.5rem, 6vw, 4.5rem); }
.article-wrap { max-width: 46rem; }
.back a { display: inline-flex; align-items: center; gap: .5rem; font-size: .92rem; color: var(--muted-light); text-decoration: none; border-bottom: 1px solid var(--line-light); padding-bottom: .1rem; }
.back a:hover { color: var(--on-light); }
.back .icon { transform: scaleX(-1); }
[dir="rtl"] .back .icon { transform: none; }
.draft-banner { margin-top: 1.5rem; padding: .75rem 1rem; border: 1px dashed var(--accent-deep); color: var(--accent-deep); font-size: .92rem; }
.article-head { margin-block: 2rem 2rem; }
.article-head h1 { font-size: clamp(1.9rem, 4.4vw, 3rem); line-height: 1.12; }
.article-lede { margin-top: 1.25rem; font-size: 1.2rem; color: var(--muted-light); }
.article-info { margin-top: 1.25rem; font-size: .88rem; color: var(--muted-light); }
.toc { margin-block: 2rem; padding: 1.25rem 1.5rem; border: 1px solid var(--line-light); background: var(--paper-2); }
.toc-title { font: 600 .75rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted-light); margin-bottom: .75rem; }
.toc ol { list-style: none; padding-inline-start: 0; display: grid; gap: .35rem; font-size: .95rem; }
.toc a { text-decoration: none; border-bottom: 1px solid var(--line-light); }
.toc a:hover { border-color: var(--accent-deep); }
.article-body { font-size: 1.08rem; line-height: 1.75; }
.article-body > * + * { margin-top: 1.1rem; }
.article-body h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-top: 3rem; }
.article-body h3 { font-size: 1.25rem; margin-top: 2rem; }
.article-body a { color: var(--accent-deep); text-underline-offset: 3px; }
.article-body ul { list-style: disc; padding-inline-start: 1.4rem; display: grid; gap: .45rem; }
.article-body ol { list-style: decimal; padding-inline-start: 1.5rem; display: grid; gap: .45rem; }
.article-body li::marker { color: var(--accent-deep); }
.article-body code { font: .88em/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--paper-2); padding: .1em .35em; border-radius: 3px; direction: ltr; unicode-bidi: embed; overflow-wrap: anywhere; }
.article-body pre { background: var(--ink); color: var(--on-dark); padding: 1.1rem 1.25rem; overflow-x: auto; border-top: 2px solid var(--accent); direction: ltr; text-align: left; font-size: .88rem; line-height: 1.55; }
.article-body pre code { background: none; padding: 0; font-size: inherit; overflow-wrap: normal; }
.article-body blockquote { border-inline-start: 3px solid var(--accent-deep); padding-inline-start: 1rem; color: var(--muted-light); }
.article-body hr { border: 0; border-top: 1px solid var(--line-light); margin-block: 2rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line-light); }
.article-body table { border-collapse: collapse; width: 100%; font-size: .92rem; line-height: 1.5; min-width: 38rem; }
.article-body th { text-align: start; background: var(--paper-2); font-weight: 600; }
.article-body th, .article-body td { padding: .65rem .8rem; border-bottom: 1px solid var(--line-light); vertical-align: top; }
.article-body .checklist { list-style: none; padding-inline-start: 0; }
.article-body .checklist .task { display: flex; gap: .75rem; align-items: flex-start; }
.article-body .box { flex: none; width: 1rem; height: 1rem; margin-top: .4rem; border: 1.5px solid var(--on-light); }
@media print { .toc, .back { display: none; } }

/* Schémas des articles (SVG inline, couleurs de la charte) */
.article-figure { margin-block: 2rem; }
.article-figure svg { display: block; width: 100%; height: auto; max-width: 46rem; margin-inline: auto; overflow: visible; }
.article-figure figcaption { margin-top: .75rem; text-align: center; font-size: .88rem; line-height: 1.5; color: var(--muted-light); }
.fig-line { stroke: var(--muted-light); stroke-opacity: .35; stroke-width: 1; }
.fig-wire { stroke: var(--accent-deep); stroke-linecap: round; fill: none; }
.fig-node { fill: #f7f6f2; stroke: var(--accent-deep); stroke-width: 2; }
.fig-box { fill: #f7f6f2; stroke: var(--muted-light); stroke-opacity: .5; }
.fig-fill { fill: var(--accent-deep); }
.fig-soft { fill: var(--accent-deep); fill-opacity: .4; }
.fig-arrow { fill: var(--accent-deep); }
.fig-text { fill: #2a2a2e; font-family: inherit; font-size: 15px; }
.fig-strong { fill: var(--on-light); font-weight: 700; }
.fig-label { fill: var(--muted-light); font-family: inherit; font-size: 13px; }
.fig-on-fill { fill: #fff; font-weight: 700; }
.fig-dash { stroke: var(--accent-deep); stroke-width: 1.5; stroke-dasharray: 5 5; fill: none; }

/* Encadrés et listes d'articles */
.article-body blockquote.note { border: 0; border-inline-start: 4px solid var(--accent-deep); background: var(--paper-2); padding: 1rem 1.25rem; color: var(--on-light); }
.article-body blockquote.note p + p, .article-body blockquote.note p + ul { margin-top: .6rem; }
.article-body blockquote.note p:first-child strong:only-child { display: block; }
.article-body blockquote.note ul { list-style: disc; padding-inline-start: 1.25rem; display: grid; gap: .3rem; }
.tag { display: inline-block; font: 600 .7rem/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; padding: .28rem .55rem; border: 1px solid currentColor; margin-inline-end: .5rem; }
html[lang="ar"] .tag { letter-spacing: 0; text-transform: none; font-size: .8rem; }
.all-articles { margin-top: 2rem; }
.article-list-light { margin-top: 2.5rem; }
.article-list-light .article { border-bottom-color: var(--line-light); }
.article-list-light .article-meta { color: var(--muted-light); }
.article-list-light .tag { color: var(--accent-deep); }
.article-list-light .more { color: var(--on-light); border-bottom-color: var(--accent-deep); }
.article-list-light h3 a:hover { color: var(--accent-deep); }
.articles-feed .tag { color: var(--accent); }
.article-info time, .article-info span { white-space: nowrap; }

/* Petits écrans : le schéma garde une taille lisible et défile horizontalement si nécessaire */
.article-figure { overflow-x: auto; }
.article-figure svg { min-width: 560px; }
@media (min-width: 640px) { .article-figure svg { min-width: 0; } }
