/* Minuscule en Majuscule : design system */
:root {
  --ground: #F4F6F9;
  --surface: #FFFFFF;
  --surface-2: #EBEEF4;
  --ink: #1C2333;
  --ink-soft: #5A6376;
  --line: #D8DDE7;
  --accent: #2F4BD8;
  --accent-ink: #FFFFFF;
  --accent-soft: #E4E9FB;
  --ok: #146C3D;
  --margin-red: #D9534E;
  --paper-line: rgba(47, 75, 216, .08);
  --shadow: 0 1px 2px rgba(28,35,51,.06), 0 8px 24px rgba(28,35,51,.07);
  --serif: "Baskerville", "Libre Baskerville", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { color-scheme: light; }
html, body { margin: 0; }
body {
  background-color: var(--ground);
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 35px,
    var(--paper-line) 35px,
    var(--paper-line) 36px
  );
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
}
body::before {
  content: "";
  position: fixed;
  top: 0; bottom: 0;
  left: clamp(14px, 5vw, 64px);
  width: 2px;
  background: var(--margin-red);
  opacity: .35;
  pointer-events: none;
  z-index: 0;
}
@media (max-width: 1220px) {
  body::before { display: none; }
}
.wrap { max-width: 1060px; margin: 0 auto; padding: 0 20px; }
a { color: var(--accent); text-underline-offset: 2px; }
a:focus-visible, button:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* ---- Header ---- */
header.site {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  padding: 22px 0 10px;
}
.logo {
  font-family: var(--serif);
  font-size: 1.4rem; font-weight: 700; letter-spacing: -.01em;
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
.logo .aa { color: var(--accent); }
nav.main { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
nav.main a {
  color: var(--ink-soft); text-decoration: none;
  padding: 6px 10px; border-radius: 8px; font-size: .93rem;
}
nav.main a:hover { color: var(--ink); background: var(--surface-2); }
nav.main a[aria-current="page"] { color: var(--accent); font-weight: 600; }

/* ---- Hero + mascotte Apolline ---- */
.hero {
  padding: 22px 0 10px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 30px; flex-wrap: wrap;
}
.hero .intro-txt { flex: 1; min-width: 280px; }
.mascotte-box {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  flex: 0 0 auto;
}
.mascotte-box svg { display: block; }
.bulle {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 9px 14px;
  font-family: var(--serif); font-style: italic; font-size: .93rem;
  color: var(--ink); max-width: 250px; text-align: center;
  position: relative; box-shadow: var(--shadow);
}
.bulle::after {
  content: ""; position: absolute; left: 50%; bottom: -7px;
  width: 12px; height: 12px; transform: translateX(-50%) rotate(45deg);
  background: var(--surface);
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.mascotte-nom {
  font-size: .78rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-soft); font-weight: 700;
}
.mascotte-nom b { color: var(--margin-red); }
@media (max-width: 700px) { .mascotte-box { display: none; } }
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3.6vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -.015em;
  margin: 0 0 6px;
  text-wrap: balance;
}
.hero p { margin: 0; color: var(--ink-soft); max-width: 62ch; }

/* ---- Converter ---- */
.modes { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 14px; }
.mode {
  appearance: none; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink);
  border-radius: 999px; padding: 8px 16px;
  font-family: var(--sans); font-size: .93rem;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.mode:hover { border-color: var(--accent); }
.mode[aria-pressed="true"] {
  background: var(--accent); color: var(--accent-ink); border-color: var(--accent);
  font-weight: 600;
}
.panels { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .panels { grid-template-columns: 1fr; } }
.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.panel-head .label {
  font-size: .75rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-soft);
}
.panel textarea {
  border: 0; resize: vertical; min-height: 260px;
  padding: 16px; font: 1.02rem/1.6 var(--sans);
  background: transparent; color: var(--ink);
  width: 100%; flex: 1;
}
.panel textarea::placeholder { color: var(--ink-soft); }
.panel textarea:focus:not(:focus-visible) { outline: none; }
.panel textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.head-actions { display: flex; gap: 6px; }
.btn {
  appearance: none; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink);
  border-radius: 8px; padding: 5px 12px;
  font-family: var(--sans); font-size: .85rem; cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.stats {
  display: flex; flex-wrap: wrap; gap: 22px;
  margin: 14px 2px 0; color: var(--ink-soft); font-size: .9rem;
}
.stats b { color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 650; }

#toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(8px);
  background: var(--ok); color: #fff; font-weight: 600;
  padding: 10px 18px; border-radius: 10px; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- Content sections ---- */
.section { margin: 56px 0 0; }
.section h2 {
  font-family: var(--serif); font-size: 1.45rem; letter-spacing: -.01em;
  margin: 0 0 4px; text-wrap: balance;
}
.section > p.intro { color: var(--ink-soft); margin: 0 0 22px; max-width: 65ch; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 860px) { .cards { grid-template-columns: 1fr; } }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 18px 18px 16px;
}
.card .ex {
  font-family: var(--serif); font-size: 1.35rem; color: var(--accent);
  margin-bottom: 8px;
}
.card h3 { margin: 0 0 6px; font-size: 1rem; }
.card p { margin: 0; font-size: .92rem; color: var(--ink-soft); }

.prose { max-width: 70ch; }
.prose p { color: var(--ink-soft); }
.prose strong, .prose b { color: var(--ink); }

/* ---- FAQ ---- */
.faq details {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 0 18px; margin-bottom: 10px;
}
.faq summary {
  cursor: pointer; font-weight: 600; padding: 14px 0;
  list-style: none; position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 2px; color: var(--accent);
  font-size: 1.2rem; line-height: 1;
}
.faq details[open] summary::after { content: "\2212"; }
.faq details p { margin: 0 0 16px; color: var(--ink-soft); max-width: 65ch; }

/* ---- Article pages (legal, author, plan) ---- */
.breadcrumb {
  font-size: .85rem; color: var(--ink-soft); margin: 18px 0 0;
}
.breadcrumb a { color: var(--ink-soft); }
.breadcrumb a:hover { color: var(--accent); }
article.page { max-width: 72ch; padding: 10px 0 30px; }
article.page h1 {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3.2vw, 2.1rem);
  letter-spacing: -.015em; margin: 18px 0 4px; text-wrap: balance;
}
article.page .updated { color: var(--ink-soft); font-size: .88rem; margin: 0 0 24px; }
article.page h2 {
  font-family: var(--serif); font-size: 1.25rem; margin: 34px 0 8px;
  letter-spacing: -.01em;
}
article.page p, article.page li { color: var(--ink-soft); }
article.page li { margin-bottom: 6px; }
article.page strong { color: var(--ink); }
.infobox {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 18px 20px; margin: 20px 0;
}
.infobox dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; }
.infobox dt { font-weight: 600; color: var(--ink); }
.infobox dd { margin: 0; color: var(--ink-soft); overflow-wrap: anywhere; }
@media (max-width: 560px) { .infobox dl { grid-template-columns: 1fr; gap: 2px; } .infobox dd { margin-bottom: 10px; } }

/* ---- Author page ---- */
.author-hero {
  display: flex; gap: 26px; align-items: flex-start; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 26px; margin: 22px 0; box-shadow: var(--shadow);
}
.author-hero img {
  width: 140px; height: 140px; border-radius: 14px; object-fit: cover;
  border: 1px solid var(--line);
}
.author-hero .who { flex: 1; min-width: 240px; }
.author-hero h1 { margin: 0 0 2px; }
.author-hero .role { color: var(--accent); font-weight: 600; margin: 0 0 10px; }
.author-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.author-links a {
  text-decoration: none; font-size: .88rem;
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px;
  color: var(--ink); background: var(--ground);
}
.author-links a:hover { border-color: var(--accent); color: var(--accent); }

/* ---- Plan du site ---- */
.sitemap-list { list-style: none; padding: 0; }
.sitemap-list > li {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 18px; margin-bottom: 10px;
}
.sitemap-list a { font-weight: 600; text-decoration: none; }
.sitemap-list a:hover { text-decoration: underline; }
.sitemap-list .desc { color: var(--ink-soft); font-size: .92rem; margin: 2px 0 0; }

/* ---- Footer premium ---- */
footer.site {
  border-top: 1px solid var(--line);
  margin-top: 64px; background: var(--surface);
}
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr 1.2fr;
  gap: 28px; padding: 36px 0 28px;
}
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand .logo { font-size: 1.2rem; }
.footer-brand p { color: var(--ink-soft); font-size: .88rem; margin: 10px 0 0; max-width: 30ch; }
.footer-col h2 {
  font-size: .75rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-soft); margin: 4px 0 12px;
  font-family: var(--sans);
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: var(--ink-soft); text-decoration: none; font-size: .9rem; }
.footer-col a:hover { color: var(--accent); text-decoration: underline; }
.footer-col address { font-style: normal; color: var(--ink-soft); font-size: .9rem; line-height: 1.7; }
.footer-langs {
  border-top: 1px solid var(--line);
  padding: 16px 0 14px;
}
.footer-langs .langs-label {
  font-size: .75rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-soft); margin: 0 0 10px;
}
.footer-langs ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 6px 16px;
}
.footer-langs a {
  color: var(--ink-soft); text-decoration: none; font-size: .88rem; white-space: nowrap;
}
.footer-langs a:hover { color: var(--accent); }
.footer-langs a[aria-current="true"] { color: var(--ink); font-weight: 600; }

.footer-bottom {
  border-top: 1px solid var(--line);
  padding: 16px 0 26px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  color: var(--ink-soft); font-size: .85rem;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---- Boîte à outils ---- */
.tools-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 24px 0; }
@media (max-width: 760px) { .tools-grid { grid-template-columns: 1fr; } }
.tool-card {
  display: block; background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 20px 22px; text-decoration: none; color: inherit;
  box-shadow: var(--shadow);
  transition: border-color .12s ease, transform .12s ease;
}
.tool-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.tool-card .ico { font-family: var(--serif); font-size: 1.5rem; color: var(--accent); font-weight: 700; }
.tool-card h2 { font-family: var(--serif); font-size: 1.15rem; margin: 6px 0 6px; letter-spacing: -.01em; color: var(--ink); }
.tool-card p { margin: 0; font-size: .92rem; color: var(--ink-soft); }

.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 14px; align-items: center; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 14px; }
.opt {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line); background: var(--surface);
  border-radius: 999px; padding: 7px 14px; font-size: .9rem; cursor: pointer;
  color: var(--ink);
}
.opt:hover { border-color: var(--accent); }
.opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.opt input { accent-color: var(--accent); margin: 0; }
.opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.select {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 8px; padding: 6px 10px; font-family: var(--sans); font-size: .9rem;
}
.input-row { display: flex; gap: 8px; margin: 16px 0 14px; flex-wrap: wrap; }
.text-input {
  flex: 1; min-width: 220px;
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px;
  font: .95rem var(--sans); background: var(--surface); color: var(--ink);
}
.text-input::placeholder { color: var(--ink-soft); }
.note {
  background: var(--accent-soft); border-radius: 10px; padding: 10px 14px;
  font-size: .88rem; color: var(--ink); margin: 10px 0 0;
}

.stat-tiles {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px; margin: 18px 0;
}
.tile {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 16px;
}
.tile b {
  display: block; font-family: var(--serif); font-size: 1.55rem;
  font-variant-numeric: tabular-nums; color: var(--accent); line-height: 1.2;
}
.tile span { font-size: .82rem; color: var(--ink-soft); }

.freq-table { width: 100%; border-collapse: collapse; }
.freq-table th {
  text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--ink-soft); padding: 8px 10px; border-bottom: 1px solid var(--line);
}
.freq-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: .92rem; }
.freq-table td.num { font-variant-numeric: tabular-nums; color: var(--ink-soft); white-space: nowrap; }
.freq-table .bar { height: 6px; background: var(--accent); border-radius: 3px; min-width: 2px; }
.freq-table .col-bar { width: 30%; }
.freq-table .vide { color: var(--ink-soft); }
.table-scroll { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }

.diff-out {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 10px 0; overflow-x: auto; font: .9rem/1.55 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
.diff-out .diff-line { padding: 1px 16px; white-space: pre-wrap; overflow-wrap: anywhere; }
.diff-out .diff-add { background: rgba(24, 140, 78, .1); color: #14663B; }
.diff-out .diff-del { background: rgba(217, 83, 78, .1); color: #A03530; }
.diff-out .diff-ctx { color: var(--ink-soft); }
.diff-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .85rem; color: var(--ink-soft); margin: 10px 2px; }
.diff-legend .swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 5px; border: 1px solid var(--line); }
.diff-legend .sw-del { background: rgba(217, 83, 78, .1); border-color: rgba(217, 83, 78, .6); }
.diff-legend .sw-add { background: rgba(24, 140, 78, .1); border-color: rgba(24, 140, 78, .6); }
.diff-legend .sw-ctx { background: var(--surface-2); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
