/* =====================================================================
   VALDOR — Documentation officielle
   Feuille de style unique. Thème sombre, pensé comme tel dès l'origine.
   ===================================================================== */

:root {
  --bg: #0a0c0f;
  --surface: #101318;
  --surface-2: #161a20;
  --surface-3: #1b2027;
  --border: #212730;
  --border-soft: #191d24;
  --text: #d3d9e1;
  --text-strong: #f2f5f8;
  --muted: #8a939f;
  --muted-2: #6b747f;
  --accent: #c6a664;
  --accent-soft: #e0c894;
  --accent-dim: rgba(198, 166, 100, 0.14);
  --accent-line: rgba(198, 166, 100, 0.38);

  --info: #6ea8d8;
  --tip: #7fbf95;
  --warn: #d9a441;
  --important: #d4736b;

  --header-h: 60px;
  --sidebar-w: 274px;
  --rail-w: 232px;
  --measure: 762px;
  --radius: 6px;

  --font: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", "Segoe UI Mono", Consolas,
    "Liberation Mono", monospace;

  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--text-strong);
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--accent);
  color: #14110a;
  padding: 10px 18px;
  font-weight: 600;
}
.skip:focus {
  left: 12px;
  top: 12px;
}

/* ============================== En-tête ============================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--header-h);
  background: rgba(10, 12, 15, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  max-width: 1600px;
  height: 100%;
  margin: 0 auto;
  padding: 0 22px;
  display: flex;
  align-items: center;
  gap: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
}

.brand__mark {
  width: 13px;
  height: 26px;
  background: linear-gradient(180deg, var(--accent-soft), var(--accent) 55%, #7d6633);
  clip-path: polygon(0 0, 100% 0, 100% 66%, 50% 100%, 0 66%);
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand__name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--text-strong);
}

.brand__tag {
  font-size: 10.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-top: 2px;
}

.hnav {
  display: flex;
  gap: 4px;
  margin-left: 14px;
}

.hnav__link {
  padding: 7px 11px;
  font-size: 14px;
  color: var(--muted);
  border-radius: var(--radius);
  transition: color 0.14s ease, background 0.14s ease;
}
.hnav__link:hover {
  color: var(--text-strong);
  background: var(--surface-2);
}
.hnav__link.is-active {
  color: var(--accent-soft);
}

.site-header__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-trigger {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 34px;
  padding: 0 10px 0 11px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
  transition: border-color 0.14s ease, color 0.14s ease;
}
.search-trigger:hover {
  border-color: #2d3540;
  color: var(--text);
}
.search-trigger svg {
  width: 15px;
  height: 15px;
}
.search-trigger kbd,
.hero__search kbd {
  font-family: var(--mono);
  font-size: 11px;
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--muted-2);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 15px;
  border-radius: var(--radius);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.btn--accent {
  background: var(--accent);
  color: #14110a;
}
.btn--accent:hover {
  background: var(--accent-soft);
}

.btn--ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn--ghost:hover {
  border-color: var(--accent-line);
  color: var(--text-strong);
}

.btn--lg {
  height: 44px;
  padding: 0 26px;
  font-size: 15px;
}

.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 34px;
  height: 34px;
  padding: 0 7px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}
.burger span {
  display: block;
  height: 1.5px;
  background: var(--text);
  border-radius: 2px;
}

/* ============================== Structure ============================ */

.shell {
  max-width: 1600px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--rail-w);
  align-items: start;
}

.sidebar {
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  overscroll-behavior: contain;
  border-right: 1px solid var(--border-soft);
  padding: 26px 16px 60px 22px;
  scrollbar-width: thin;
  scrollbar-color: #262c35 transparent;
}
.sidebar::-webkit-scrollbar {
  width: 8px;
}
.sidebar::-webkit-scrollbar-thumb {
  background: #232932;
  border-radius: 8px;
}

.sb__group + .sb__group {
  margin-top: 22px;
}

.sb__title {
  margin: 0 0 7px;
  padding-left: 10px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.sb__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sb__list a {
  display: block;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 14px;
  color: var(--muted);
  border-left: 2px solid transparent;
  transition: color 0.13s ease, background 0.13s ease, border-color 0.13s ease;
}
.sb__list a:hover {
  color: var(--text-strong);
  background: var(--surface);
}
.sb__list a.is-active {
  color: var(--accent-soft);
  background: var(--accent-dim);
  border-left-color: var(--accent);
  font-weight: 500;
}

.main {
  min-width: 0;
  padding: 34px 46px 90px;
}

.article {
  max-width: var(--measure);
  animation: fade-up 0.26s ease both;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.rail {
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 36px 24px 60px 8px;
}

/* ============================ Fil d'Ariane =========================== */

.crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--muted-2);
  margin-bottom: 16px;
}
.crumb a {
  color: var(--muted);
}
.crumb a:hover {
  color: var(--accent-soft);
}
.crumb__sep {
  color: #333a44;
}
.crumb__current {
  color: var(--text);
}

/* ============================== Article ============================== */

.article h1 {
  margin: 0 0 12px;
  font-size: 36px;
  line-height: 1.18;
  letter-spacing: -0.02em;
  font-weight: 700;
  color: var(--text-strong);
}

.lede {
  margin: 0 0 30px;
  font-size: 17.5px;
  line-height: 1.62;
  color: var(--muted);
}

.prose > *:first-child {
  margin-top: 0;
}

.prose h2 {
  position: relative;
  margin: 46px 0 14px;
  padding-top: 26px;
  border-top: 1px solid var(--border-soft);
  font-size: 25px;
  line-height: 1.3;
  letter-spacing: -0.012em;
  font-weight: 650;
  color: var(--text-strong);
}

.prose h3 {
  margin: 32px 0 10px;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.008em;
  color: var(--text-strong);
}

.prose h4 {
  margin: 26px 0 8px;
  font-size: 15.5px;
  font-weight: 650;
  color: var(--text-strong);
}

.anchor {
  margin-left: 8px;
  font-size: 0.62em;
  color: #2f3742;
  opacity: 0;
  transition: opacity 0.15s ease, color 0.15s ease;
}
.prose h2:hover .anchor,
.prose h3:hover .anchor,
.anchor:focus-visible {
  opacity: 1;
  color: var(--accent);
}

.prose p {
  margin: 0 0 16px;
  font-size: 16px;
}

.prose a:not(.anchor) {
  color: var(--accent-soft);
  border-bottom: 1px solid rgba(198, 166, 100, 0.3);
  transition: border-color 0.14s ease;
}
.prose a:not(.anchor):hover {
  border-bottom-color: var(--accent);
}

.prose ul,
.prose ol {
  margin: 0 0 18px;
  padding-left: 22px;
}
.prose li {
  margin-bottom: 7px;
}
.prose li::marker {
  color: var(--muted-2);
}
.prose ol > li::marker {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.prose strong {
  color: var(--text-strong);
  font-weight: 640;
}

.prose hr {
  margin: 34px 0;
  border: 0;
  border-top: 1px solid var(--border-soft);
}

.prose blockquote {
  margin: 0 0 18px;
  padding: 2px 0 2px 18px;
  border-left: 2px solid var(--border);
  color: var(--muted);
}
.prose blockquote p:last-child {
  margin-bottom: 0;
}

code {
  font-family: var(--mono);
  font-size: 0.875em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--accent-soft);
  word-break: break-word;
}

code.cmd {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding-right: 2px;
}

.cmd-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 1px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 3px;
  color: var(--muted-2);
  font-size: 12px;
  cursor: pointer;
  transition: color 0.13s ease, background 0.13s ease;
}
.cmd-copy:hover {
  color: var(--accent-soft);
  background: var(--surface-3);
}
.cmd-copy.is-done {
  color: var(--tip);
}

kbd {
  display: inline-block;
  min-width: 24px;
  padding: 2px 7px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
  color: var(--text-strong);
  background: linear-gradient(180deg, #1e232b, #14181d);
  border: 1px solid #2b323c;
  border-bottom-width: 2px;
  border-radius: 5px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
  white-space: nowrap;
}

/* ============================== Tableaux ============================= */

.table-wrap {
  margin: 0 0 20px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}

thead th {
  position: sticky;
  top: 0;
  text-align: left;
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover td {
  background: rgba(255, 255, 255, 0.012);
}

/* ============================== Encadrés ============================= */

.callout {
  --c: var(--info);
  margin: 0 0 20px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--c);
  border-radius: var(--radius);
}
.callout--tip {
  --c: var(--tip);
}
.callout--warn {
  --c: var(--warn);
}
.callout--important {
  --c: var(--important);
}

.callout__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.03em;
  color: var(--c);
}
.callout__icon {
  font-size: 13px;
}
.callout__body > *:last-child {
  margin-bottom: 0;
}
.callout__body p {
  font-size: 15px;
  margin-bottom: 10px;
}
.callout__body ul,
.callout__body ol {
  margin-bottom: 6px;
}

/* ============================== Pagination =========================== */

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 56px;
  padding-top: 26px;
  border-top: 1px solid var(--border-soft);
}

.pager__link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.14s ease, background 0.14s ease;
}
.pager__link:hover {
  border-color: var(--accent-line);
  background: var(--surface-2);
}
.pager__link--next {
  text-align: right;
}
.pager__dir {
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.pager__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-strong);
}

/* ============================== Sommaire ============================= */

.toc__title {
  margin: 0 0 10px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.toc__list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--border);
}

.toc__item a {
  display: block;
  padding: 4px 0 4px 13px;
  margin-left: -1px;
  border-left: 1px solid transparent;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted-2);
  transition: color 0.13s ease, border-color 0.13s ease;
}
.toc__item a:hover {
  color: var(--text);
}
.toc__item--h3 a {
  padding-left: 25px;
  font-size: 12.5px;
}
.toc__item a.is-current {
  color: var(--accent-soft);
  border-left-color: var(--accent);
}

/* ============================== Accueil ============================== */

.home {
  min-height: 60vh;
}

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border-soft);
  background:
    radial-gradient(900px 380px at 18% -10%, rgba(198, 166, 100, 0.09), transparent 62%),
    linear-gradient(180deg, #0c0f13, var(--bg));
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.016) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.016) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(700px 340px at 20% 0%, #000, transparent 75%);
  pointer-events: none;
}

.hero__inner {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 92px 26px 84px;
}

.hero--404 .hero__inner {
  padding: 120px 26px;
  text-align: center;
}
.hero--404 .hero__actions {
  justify-content: center;
}

.hero__eyebrow {
  margin: 0 0 16px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero__title {
  margin: 0 0 18px;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.08;
  letter-spacing: -0.028em;
  font-weight: 700;
  color: var(--text-strong);
  max-width: 16ch;
}
.hero--404 .hero__title {
  max-width: none;
}

.hero__text {
  margin: 0 0 30px;
  max-width: 62ch;
  font-size: 17px;
  line-height: 1.66;
  color: var(--muted);
}
.hero--404 .hero__text {
  margin-left: auto;
  margin-right: auto;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero__search {
  display: flex;
  align-items: center;
  gap: 11px;
  width: min(460px, 100%);
  margin-top: 30px;
  padding: 11px 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted-2);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.14s ease;
}
.hero__search:hover {
  border-color: var(--accent-line);
}
.hero__search svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.hero__search span {
  flex: 1;
  text-align: left;
}

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 58px 26px 0;
}
.wrap:last-of-type {
  padding-bottom: 84px;
}

.section-heading {
  margin: 0 0 22px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 14px;
}

.card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "icon title" "icon text";
  gap: 2px 14px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}
.card:hover {
  border-color: var(--accent-line);
  background: var(--surface-2);
  transform: translateY(-1px);
}

.card__icon {
  grid-area: icon;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 5px;
  background: var(--accent-dim);
  color: var(--accent);
}
.card__icon .icon {
  width: 19px;
  height: 19px;
}

.card__title {
  grid-area: title;
  font-size: 15.5px;
  font-weight: 640;
  color: var(--text-strong);
}

.card__text {
  grid-area: text;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
}

.card__go {
  position: absolute;
  top: 18px;
  right: 18px;
  color: #303842;
  transition: color 0.16s ease, transform 0.16s ease;
}
.card:hover .card__go {
  color: var(--accent);
  transform: translateX(2px);
}

.plan {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 26px 22px;
}
.plan__title {
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 13px;
  font-weight: 650;
  color: var(--text-strong);
}
.plan__col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.plan__col li {
  margin-bottom: 5px;
}
.plan__col a {
  font-size: 13.5px;
  color: var(--muted);
}
.plan__col a:hover {
  color: var(--accent-soft);
}

/* ============================== Recherche ============================ */

.search[hidden] {
  display: none;
}

.search {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  justify-content: center;
  padding: 12vh 18px 18px;
}

.search__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 8, 0.72);
  backdrop-filter: blur(3px);
}

.search__panel {
  position: relative;
  width: min(680px, 100%);
  max-height: 72vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  animation: fade-up 0.16s ease both;
}

.search__bar {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--border);
}
.search__bar svg {
  width: 17px;
  height: 17px;
  color: var(--muted-2);
  flex-shrink: 0;
}

#search-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--text-strong);
  font: inherit;
  font-size: 15.5px;
}
#search-input::placeholder {
  color: var(--muted-2);
}
#search-input::-webkit-search-cancel-button {
  display: none;
}

.search__esc {
  padding: 3px 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted-2);
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
}

.search__results {
  overflow-y: auto;
  padding: 6px;
}

.sr {
  display: block;
  padding: 9px 12px;
  border-radius: 5px;
  border: 1px solid transparent;
}
.sr:hover,
.sr.is-active {
  background: var(--surface-2);
  border-color: var(--border);
}
.sr__section {
  font-size: 10.5px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--accent);
}
.sr__title {
  display: block;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-strong);
  margin: 1px 0 2px;
}
.sr__text {
  display: block;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.sr__text mark,
.sr__title mark {
  background: rgba(198, 166, 100, 0.2);
  color: var(--accent-soft);
  border-radius: 2px;
  padding: 0 1px;
}

.sr__jump {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 12px 10px 12px;
  margin-top: -2px;
}

.sr__chip {
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface-2);
  font-size: 12px;
  color: var(--muted);
  transition: border-color 0.13s ease, color 0.13s ease;
}
.sr__chip:hover {
  border-color: var(--accent-line);
  color: var(--accent-soft);
}

.search__empty {
  padding: 26px 16px;
  text-align: center;
  font-size: 14px;
  color: var(--muted-2);
}

.search__hint {
  margin: 0;
  padding: 9px 15px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--muted-2);
}

/* ============================ Retour en haut ========================= */

.totop {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--muted);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s, color 0.14s ease;
}
.totop.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.totop:hover {
  color: var(--accent-soft);
  border-color: var(--accent-line);
}
.totop svg {
  width: 17px;
  height: 17px;
}

/* ================================= Toast ============================= */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 140;
  max-width: min(460px, calc(100vw - 32px));
  padding: 12px 18px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 10px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}
.toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

/* ============================== Pied de page ========================= */

.foot {
  border-top: 1px solid var(--border-soft);
  background: #080a0d;
}

.foot__inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 46px 26px 34px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 2fr;
  gap: 40px;
}

.foot__name {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--text-strong);
}
.foot__desc {
  margin: 0 0 10px;
  font-size: 13.5px;
  color: var(--muted);
}
.foot__note {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted-2);
}

.foot__cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 26px;
}
.foot__title {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.foot__cols ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.foot__cols li {
  margin-bottom: 6px;
}
.foot__cols a {
  font-size: 13.5px;
  color: var(--muted);
}
.foot__cols a:hover {
  color: var(--accent-soft);
}

.foot__bar {
  max-width: 1180px;
  margin: 0 auto;
  padding: 15px 26px 30px;
  border-top: 1px solid var(--border-soft);
  font-size: 12.5px;
  color: var(--muted-2);
}

/* ============================== Responsive =========================== */

@media (max-width: 1240px) {
  .shell {
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  }
  .rail {
    display: none;
  }
  .main {
    padding: 34px 34px 90px;
  }
}

@media (max-width: 1080px) {
  .hnav {
    display: none;
  }
  .search-trigger span {
    display: none;
  }
  .search-trigger kbd {
    display: none;
  }
  .search-trigger {
    width: 34px;
    justify-content: center;
    padding: 0;
  }
}

@media (max-width: 900px) {
  :root {
    --header-h: 56px;
  }

  .burger {
    display: flex;
  }

  .brand__tag {
    display: none;
  }

  .shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: fixed;
    top: var(--header-h);
    left: 0;
    z-index: 70;
    width: min(310px, 84vw);
    height: calc(100vh - var(--header-h));
    background: var(--surface);
    border-right: 1px solid var(--border);
    transform: translateX(-102%);
    transition: transform 0.22s ease;
  }
  .sidebar.is-open {
    transform: none;
  }

  .sb-scrim {
    position: fixed;
    inset: var(--header-h) 0 0;
    z-index: 65;
    background: rgba(4, 6, 8, 0.6);
  }
  .sb-scrim[hidden] {
    display: none;
  }

  .main {
    padding: 26px 20px 76px;
  }

  .article h1 {
    font-size: 29px;
  }
  .lede {
    font-size: 16.5px;
  }
  .prose h2 {
    font-size: 22px;
    margin-top: 38px;
  }

  .hero__inner {
    padding: 62px 20px 56px;
  }
  .wrap {
    padding: 44px 20px 0;
  }

  .pager {
    grid-template-columns: 1fr;
  }

  .foot__inner {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 36px 20px 26px;
  }
  .foot__bar {
    padding: 15px 20px 26px;
  }

  .search {
    padding: 6vh 12px 12px;
  }
  .search__panel {
    max-height: 84vh;
  }
}

@media (max-width: 560px) {
  .site-header__inner {
    padding: 0 14px;
    gap: 12px;
  }
  .btn--accent {
    padding: 0 11px;
    font-size: 12.5px;
  }
  .totop {
    right: 12px;
    bottom: 12px;
  }
  .cards {
    grid-template-columns: 1fr;
  }
}

@media print {
  .site-header,
  .sidebar,
  .rail,
  .pager,
  .totop,
  .search,
  .foot__cols {
    display: none !important;
  }
  body {
    background: #fff;
    color: #000;
  }
}
