/* ==========================================================================
   Tip4Tech — tips2tech.fr
   Feuille de style commune à toutes les pages.
   Polices : Space Grotesk (titres) · Inter (texte) · JetBrains Mono (code)
   Palette : encre #14171C · papier #F4F5F1 · accent vert #2F6B4F
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Jetons de design
   -------------------------------------------------------------------------- */
:root {
  /* Couleurs de marque */
  --ink:          #14171C;
  --paper:        #F4F5F1;
  --accent:       #2F6B4F;

  /* Dérivées — thème clair */
  --bg:           #F4F5F1;
  --bg-alt:       #ECEEE8;
  --surface:      #FFFFFF;
  --surface-2:    #F9FAF7;
  --text:         #14171C;
  --text-muted:   #5B6169;
  --text-faint:   #878D95;
  --line:         #DCDFD7;
  --line-strong:  #C5C9BF;

  --accent-ink:   #234F3A;
  --accent-soft:  #E4EEE8;
  --accent-line:  #BBD5C7;

  --terminal-bg:  #14171C;
  --terminal-fg:  #E8EBE4;
  --terminal-dim: #8C939C;

  --warn:         #8A5A12;
  --warn-soft:    #FBF1DE;
  --warn-line:    #EAD7AE;
  --danger:       #9B2C2C;
  --danger-soft:  #FBEAEA;
  --danger-line:  #EEC9C9;
  --info:         #1F4E79;
  --info-soft:    #E7EFF7;
  --info-line:    #C2D6E8;

  /* Typographie */
  --font-title: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-body:  "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono:  "JetBrains Mono", "Cascadia Mono", Consolas, monospace;

  /* Rythme */
  --wrap:       1180px;
  --wrap-read:  760px;
  --radius:     10px;
  --radius-sm:  6px;
  --radius-lg:  16px;

  --shadow-sm:  0 1px 2px rgba(20, 23, 28, .06), 0 1px 1px rgba(20, 23, 28, .04);
  --shadow-md:  0 4px 16px rgba(20, 23, 28, .08), 0 1px 3px rgba(20, 23, 28, .05);
  --shadow-lg:  0 18px 48px rgba(20, 23, 28, .14);

  --speed: 160ms;
  --ease: cubic-bezier(.2, .7, .3, 1);
}

/* Thème sombre — automatique, surchargeable par [data-theme] */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:          #0F1216;
    --bg-alt:      #14171C;
    --surface:     #191D23;
    --surface-2:   #1E232A;
    --text:        #E9ECE5;
    --text-muted:  #A2A9B2;
    --text-faint:  #767D86;
    --line:        #2A3038;
    --line-strong: #3A424C;

    --accent:      #4E9E77;
    --accent-ink:  #7DBF9C;
    --accent-soft: #14251D;
    --accent-line: #29452F;

    --terminal-bg: #0A0D11;
    --terminal-fg: #DDE2D9;

    --warn:        #D9A441;
    --warn-soft:   #241D0E;
    --warn-line:   #463815;
    --danger:      #E07A7A;
    --danger-soft: #251313;
    --danger-line: #4A2525;
    --info:        #79AEDD;
    --info-soft:   #10202E;
    --info-line:   #1F3C55;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, .45);
    --shadow-lg: 0 18px 48px rgba(0, 0, 0, .55);
  }
}

:root[data-theme="dark"] {
  --bg:          #0F1216;
  --bg-alt:      #14171C;
  --surface:     #191D23;
  --surface-2:   #1E232A;
  --text:        #E9ECE5;
  --text-muted:  #A2A9B2;
  --text-faint:  #767D86;
  --line:        #2A3038;
  --line-strong: #3A424C;

  --accent:      #4E9E77;
  --accent-ink:  #7DBF9C;
  --accent-soft: #14251D;
  --accent-line: #29452F;

  --terminal-bg: #0A0D11;
  --terminal-fg: #DDE2D9;

  --warn:        #D9A441;
  --warn-soft:   #241D0E;
  --warn-line:   #463815;
  --danger:      #E07A7A;
  --danger-soft: #251313;
  --danger-line: #4A2525;
  --info:        #79AEDD;
  --info-soft:   #10202E;
  --info-line:   #1F3C55;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, .45);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, .55);
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.65;
  font-feature-settings: "cv05" 1, "ss01" 1;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-title);
  font-weight: 600;
  letter-spacing: -.015em;
  line-height: 1.2;
  margin: 0 0 .5em;
  color: var(--text);
}

h1 { font-size: clamp(2rem, 4.6vw, 2.9rem); letter-spacing: -.03em; }
h2 { font-size: clamp(1.45rem, 2.6vw, 1.8rem); }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1.1em; }

a {
  color: var(--accent-ink);
  text-decoration: none;
  text-underline-offset: 3px;
}
a:hover { text-decoration: underline; }

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

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2.5rem 0;
}

code, kbd, samp, pre { font-family: var(--font-mono); font-size: .875em; }

::selection { background: var(--accent); color: #fff; }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: .7rem 1.1rem;
  z-index: 200;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

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

/* --------------------------------------------------------------------------
   3. Mise en page
   -------------------------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 20px;
}

.section { padding: 4rem 0; }
.section--tight { padding: 2.5rem 0; }
.section--alt { background: var(--bg-alt); border-block: 1px solid var(--line); }

.grid { display: grid; gap: 1.25rem; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(265px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

.stack > * + * { margin-top: 1rem; }
.row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.row--between { justify-content: space-between; }

/* --------------------------------------------------------------------------
   4. Kicker « ligne de commande »
   -------------------------------------------------------------------------- */
.kicker {
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .02em;
  color: var(--text-muted);
  margin: 0 0 .9rem;
  display: flex;
  align-items: baseline;
  gap: .5rem;
}
.kicker::before {
  content: "$";
  color: var(--accent);
  font-weight: 700;
}
.kicker--light { color: var(--terminal-dim); }
.kicker--light::before { color: var(--accent-ink); }

/* --------------------------------------------------------------------------
   5. En-tête et navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 66px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: -.02em;
  color: var(--text);
  flex-shrink: 0;
}
.brand:hover { text-decoration: none; }
.brand__mark {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  background: var(--ink);
  color: #E8EBE4;
  border-radius: 7px;
  font-family: var(--font-mono);
  font-size: .82rem;
  font-weight: 700;
}
:root[data-theme="dark"] .brand__mark,
.brand__mark { box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.brand__tld { color: var(--accent); }

.nav {
  display: flex;
  gap: .25rem;
  margin-left: auto;
  align-items: center;
}

.nav__link {
  padding: .45rem .75rem;
  border-radius: var(--radius-sm);
  font-size: .93rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}
.nav__link:hover {
  background: var(--bg-alt);
  color: var(--text);
  text-decoration: none;
}
.nav__link[aria-current="page"] {
  color: var(--text);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent-line);
}

.nav-toggle {
  display: none;
  margin-left: auto;
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: .4rem .6rem;
  font-family: var(--font-mono);
  font-size: .85rem;
  cursor: pointer;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  width: 34px; height: 34px;
  display: grid; place-items: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: .95rem;
  flex-shrink: 0;
  transition: color var(--speed) var(--ease), border-color var(--speed) var(--ease);
}
.theme-toggle:hover { color: var(--text); border-color: var(--line-strong); }

/* --------------------------------------------------------------------------
   6. Boutons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .62rem 1.15rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: .93rem;
  font-weight: 550;
  line-height: 1.35;
  cursor: pointer;
  transition: background var(--speed) var(--ease),
              border-color var(--speed) var(--ease),
              color var(--speed) var(--ease),
              transform var(--speed) var(--ease);
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-ink); color: #fff; }
:root[data-theme="dark"] .btn--primary:hover { background: var(--accent-ink); color: var(--ink); }

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

.btn--quiet {
  background: transparent;
  color: var(--text-muted);
  padding: .4rem .6rem;
}
.btn--quiet:hover { background: var(--bg-alt); color: var(--text); }

.btn--sm { padding: .4rem .8rem; font-size: .85rem; }
.btn--block { width: 100%; }
.btn--mono { font-family: var(--font-mono); font-size: .85rem; }

/* --------------------------------------------------------------------------
   7. Hero — fenêtre de terminal
   -------------------------------------------------------------------------- */
.hero { padding: 4.5rem 0 3.5rem; }

.hero__grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 3rem;
  align-items: center;
}

.hero__lede {
  font-size: 1.12rem;
  color: var(--text-muted);
  max-width: 46ch;
}

.hero__actions { margin-top: 1.6rem; }

.hero__stats {
  display: flex;
  gap: 2rem;
  margin-top: 2.4rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.hero__stat b {
  display: block;
  font-family: var(--font-title);
  font-size: 1.6rem;
  line-height: 1.1;
}
.hero__stat span {
  font-family: var(--font-mono);
  font-size: .74rem;
  color: var(--text-faint);
  text-transform: lowercase;
}

.terminal {
  background: var(--terminal-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .07);
}

.terminal__bar {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .7rem .9rem;
  background: rgba(255, 255, 255, .035);
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.terminal__dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #3E444C;
}
.terminal__dot:nth-child(1) { background: #E05C5C; }
.terminal__dot:nth-child(2) { background: #D9A441; }
.terminal__dot:nth-child(3) { background: #4E9E77; }
.terminal__title {
  margin-left: .6rem;
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--terminal-dim);
}

.terminal__body {
  margin: 0;
  padding: 1.2rem 1.3rem 1.5rem;
  font-family: var(--font-mono);
  font-size: .83rem;
  line-height: 1.85;
  color: var(--terminal-fg);
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 268px;
}
.terminal__prompt { color: #4E9E77; }
.terminal__path   { color: #79AEDD; }
.terminal__cmd    { color: var(--terminal-fg); }
.terminal__out    { color: var(--terminal-dim); }
.terminal__ok     { color: #4E9E77; }
.terminal__warn   { color: #D9A441; }

.terminal__caret {
  display: inline-block;
  width: .55em; height: 1.05em;
  background: #4E9E77;
  vertical-align: text-bottom;
  animation: blink 1.05s steps(2, start) infinite;
}
@keyframes blink { to { visibility: hidden; } }

@media (prefers-reduced-motion: reduce) {
  .terminal__caret { animation: none; }
  html { scroll-behavior: auto; }
  .btn:hover, .card:hover { transform: none; }
}

/* --------------------------------------------------------------------------
   8. Titres de section
   -------------------------------------------------------------------------- */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.8rem;
  flex-wrap: wrap;
}
.section-head h2 { margin-bottom: .2rem; }
.section-head p { margin: 0; color: var(--text-muted); font-size: .96rem; }

/* --------------------------------------------------------------------------
   9. Cartes
   -------------------------------------------------------------------------- */
.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--speed) var(--ease),
              box-shadow var(--speed) var(--ease),
              transform var(--speed) var(--ease);
  height: 100%;
}
a.card:hover, .card--link:hover {
  border-color: var(--accent-line);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  text-decoration: none;
}

.card__meta {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--text-faint);
  margin-bottom: .7rem;
  flex-wrap: wrap;
}
.card__meta .dot::before { content: "·"; }

.card__title {
  font-family: var(--font-title);
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.32;
  margin: 0 0 .5rem;
  color: var(--text);
}
.card__excerpt {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: .92rem;
  line-height: 1.6;
}
.card__foot {
  margin-top: auto;
  padding-top: .85rem;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  font-family: var(--font-mono);
  font-size: .73rem;
  color: var(--text-faint);
}

/* Carte de catégorie */
.cat-card { position: relative; overflow: hidden; }
.cat-card__icon {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  margin-bottom: .9rem;
  font-size: 1.05rem;
}
.cat-card__count {
  font-family: var(--font-mono);
  font-size: .73rem;
  color: var(--text-faint);
}

/* --------------------------------------------------------------------------
   10. Tags et étiquettes
   -------------------------------------------------------------------------- */
.tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .01em;
  padding: .2rem .5rem;
  border-radius: 4px;
  background: var(--bg-alt);
  color: var(--text-muted);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.tag--accent {
  background: var(--accent-soft);
  color: var(--accent-ink);
  border-color: var(--accent-line);
}
.tag--warn   { background: var(--warn-soft);   color: var(--warn);   border-color: var(--warn-line); }
.tag--danger { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-line); }
.tag--info   { background: var(--info-soft);   color: var(--info);   border-color: var(--info-line); }

.tag-list { display: flex; flex-wrap: wrap; gap: .35rem; }

/* --------------------------------------------------------------------------
   11. Filtres
   -------------------------------------------------------------------------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-bottom: 1.6rem;
}
.filter {
  font-family: var(--font-mono);
  font-size: .78rem;
  padding: .4rem .8rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--speed) var(--ease);
}
.filter:hover { border-color: var(--accent); color: var(--text); }
.filter[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* --------------------------------------------------------------------------
   12. Champs de formulaire
   -------------------------------------------------------------------------- */
.field { margin-bottom: 1.05rem; }

.label {
  display: block;
  font-size: .85rem;
  font-weight: 550;
  margin-bottom: .35rem;
  color: var(--text);
}
.hint {
  display: block;
  font-size: .78rem;
  color: var(--text-faint);
  margin-top: .3rem;
}

.input, .select, .textarea {
  width: 100%;
  padding: .62rem .8rem;
  font-family: var(--font-body);
  font-size: .94rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  transition: border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }
.textarea { min-height: 130px; resize: vertical; font-family: var(--font-mono); font-size: .85rem; }
.input--mono { font-family: var(--font-mono); }

.search {
  position: relative;
  max-width: 420px;
}
.search .input { padding-left: 2.2rem; }
.search__icon {
  position: absolute;
  left: .75rem; top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  font-size: .9rem;
  pointer-events: none;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  font-size: .9rem;
  cursor: pointer;
  margin-bottom: .55rem;
}
.check input { margin-top: .28rem; accent-color: var(--accent); flex-shrink: 0; }

.range { width: 100%; accent-color: var(--accent); }

/* Messages de formulaire */
.alert {
  padding: .75rem .95rem;
  border-radius: var(--radius-sm);
  font-size: .89rem;
  border: 1px solid;
  margin-bottom: 1rem;
}
.alert--ok     { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent-line); }
.alert--error  { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-line); }
.alert--warn   { background: var(--warn-soft);   color: var(--warn);   border-color: var(--warn-line); }
.alert--info   { background: var(--info-soft);   color: var(--info);   border-color: var(--info-line); }
.alert[hidden] { display: none; }

/* --------------------------------------------------------------------------
   13. Onglets
   -------------------------------------------------------------------------- */
.tabs {
  display: flex;
  gap: .2rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.5rem;
}
.tab {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: .65rem 1rem;
  font-family: var(--font-body);
  font-size: .93rem;
  font-weight: 550;
  color: var(--text-muted);
  cursor: pointer;
  margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--accent-ink); border-bottom-color: var(--accent); }

/* --------------------------------------------------------------------------
   14. Article (tutoriel / actualité)
   -------------------------------------------------------------------------- */
.article-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 3rem;
  align-items: start;
  padding: 2.5rem 0 4rem;
}

.toc {
  position: sticky;
  top: 90px;
  font-size: .88rem;
}
.toc__title {
  font-family: var(--font-mono);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-faint);
  margin-bottom: .7rem;
}
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc li { margin: 0; }
.toc a {
  display: block;
  padding: .3rem 0 .3rem .85rem;
  margin-left: -1px;
  border-left: 2px solid transparent;
  color: var(--text-muted);
  line-height: 1.4;
}
.toc a:hover { color: var(--text); text-decoration: none; }
.toc a.is-active { color: var(--accent-ink); border-left-color: var(--accent); font-weight: 550; }

.article { max-width: var(--wrap-read); min-width: 0; }

.article__head { margin-bottom: 2.2rem; }
.article__head h1 { margin-bottom: .6rem; }
.article__lede {
  font-size: 1.08rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.article__meta {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  align-items: center;
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--text-faint);
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.prose { font-size: 1rem; line-height: 1.75; }
.prose h2 {
  margin-top: 2.6rem;
  padding-top: .3rem;
  font-size: 1.42rem;
}
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 1.9rem; font-size: 1.1rem; }
.prose ul, .prose ol { padding-left: 1.3rem; margin: 0 0 1.15em; }
.prose li { margin-bottom: .4em; }
.prose li > ul, .prose li > ol { margin-top: .4em; }
.prose strong { font-weight: 600; }

.prose :not(pre) > code {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: .1em .38em;
  color: var(--accent-ink);
  font-size: .855em;
  word-break: break-word;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.4em;
  font-size: .9rem;
}
.prose th, .prose td {
  text-align: left;
  padding: .55rem .7rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.prose th {
  font-family: var(--font-mono);
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-faint);
  border-bottom-color: var(--line-strong);
}
.prose tbody tr:last-child td { border-bottom: 0; }

.prose blockquote {
  margin: 0 0 1.3em;
  padding: .3rem 0 .3rem 1.1rem;
  border-left: 3px solid var(--accent-line);
  color: var(--text-muted);
  font-style: italic;
}

.table-scroll { overflow-x: auto; margin-bottom: 1.4em; }
.table-scroll table { margin-bottom: 0; }

/* Blocs de code */
.code {
  position: relative;
  margin: 0 0 1.5em;
  background: var(--terminal-bg);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .07);
}
.code__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .45rem .5rem .45rem .9rem;
  background: rgba(255, 255, 255, .04);
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.code__label {
  font-family: var(--font-mono);
  font-size: .71rem;
  letter-spacing: .04em;
  color: var(--terminal-dim);
}
.code__copy {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .14);
  color: var(--terminal-dim);
  border-radius: 4px;
  padding: .2rem .55rem;
  font-family: var(--font-mono);
  font-size: .7rem;
  cursor: pointer;
  transition: all var(--speed) var(--ease);
  flex-shrink: 0;
}
.code__copy:hover { color: var(--terminal-fg); border-color: rgba(255, 255, 255, .3); }
.code__copy.is-done { color: #4E9E77; border-color: #2F6B4F; }

.code pre {
  margin: 0;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  color: var(--terminal-fg);
  font-size: .82rem;
  line-height: 1.68;
  tab-size: 2;
}
.code pre code { background: none; border: 0; padding: 0; color: inherit; }
.code .c { color: #77808B; }           /* commentaire */
.code .p { color: #4E9E77; }           /* prompt      */
.code .s { color: #D9A441; }           /* chaîne      */
.code .k { color: #79AEDD; }           /* mot-clé     */

/* Encadrés */
.note {
  display: flex;
  gap: .85rem;
  padding: .95rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  margin: 0 0 1.5em;
  font-size: .93rem;
  line-height: 1.6;
}
.note > :last-child { margin-bottom: 0; }
.note__icon { font-size: 1rem; line-height: 1.5; flex-shrink: 0; }
.note__body > :last-child { margin-bottom: 0; }
.note__body strong { display: block; margin-bottom: .2rem; font-family: var(--font-title); }

.note--warn   { border-color: var(--warn-line);   background: var(--warn-soft); }
.note--danger { border-color: var(--danger-line); background: var(--danger-soft); }
.note--info   { border-color: var(--info-line);   background: var(--info-soft); }

/* Bas d'article */
.article__foot {
  margin-top: 3rem;
  padding-top: 1.8rem;
  border-top: 1px solid var(--line);
}

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 2rem;
}
.pager__item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .9rem 1.1rem;
  background: var(--surface);
}
.pager__item:hover { border-color: var(--accent-line); text-decoration: none; }
.pager__dir {
  font-family: var(--font-mono);
  font-size: .71rem;
  color: var(--text-faint);
  display: block;
  margin-bottom: .25rem;
}
.pager__title { font-weight: 550; color: var(--text); font-size: .92rem; line-height: 1.4; }
.pager__item--next { text-align: right; grid-column: 2; }

/* --------------------------------------------------------------------------
   15. Newsletter
   -------------------------------------------------------------------------- */
.newsletter {
  background: var(--ink);
  color: #E8EBE4;
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 2.5rem;
  align-items: center;
}
.newsletter h2 { color: #fff; }
.newsletter p { color: #A2A9B2; margin-bottom: 0; font-size: .95rem; }
.newsletter__form { display: flex; gap: .55rem; flex-wrap: wrap; }
.newsletter__form .input {
  flex: 1 1 200px;
  background: rgba(255, 255, 255, .06);
  border-color: rgba(255, 255, 255, .16);
  color: #E8EBE4;
}
.newsletter__form .input::placeholder { color: #767D86; }
.newsletter__form .input:focus {
  border-color: #4E9E77;
  box-shadow: 0 0 0 3px rgba(78, 158, 119, .22);
}
.newsletter__note {
  font-family: var(--font-mono);
  font-size: .72rem;
  color: #767D86;
  margin-top: .7rem;
}

/* --------------------------------------------------------------------------
   16. Outils
   -------------------------------------------------------------------------- */
.tool-card { display: flex; gap: 1rem; align-items: flex-start; }
.tool-card__logo {
  width: 44px; height: 44px;
  flex-shrink: 0;
  border-radius: 9px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 7px;
  object-fit: contain;
}
.tool-card__body { min-width: 0; flex: 1; }
.tool-card__links { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .9rem; }

.license {
  font-family: var(--font-mono);
  font-size: .68rem;
  color: var(--text-faint);
}

/* --------------------------------------------------------------------------
   17. Générateur de mot de passe
   -------------------------------------------------------------------------- */
.pw-output {
  display: flex;
  gap: .6rem;
  align-items: stretch;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
}
.pw-value {
  flex: 1 1 260px;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 1.12rem;
  letter-spacing: .01em;
  padding: .85rem 1rem;
  background: var(--terminal-bg);
  color: var(--terminal-fg);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: var(--radius-sm);
  word-break: break-all;
  display: flex;
  align-items: center;
  min-height: 56px;
}

.meter {
  height: 7px;
  border-radius: 999px;
  background: var(--bg-alt);
  overflow: hidden;
  border: 1px solid var(--line);
}
.meter__fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--accent);
  transition: width 260ms var(--ease), background 260ms var(--ease);
}
.meter__fill[data-level="1"] { background: #C0392B; }
.meter__fill[data-level="2"] { background: #D9A441; }
.meter__fill[data-level="3"] { background: #4E9E77; }
.meter__fill[data-level="4"] { background: #2F6B4F; }

.meter-legend {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: .73rem;
  color: var(--text-faint);
  margin-top: .45rem;
}

/* --------------------------------------------------------------------------
   18. Tableaux d'administration
   -------------------------------------------------------------------------- */
.admin-shell {
  display: grid;
  grid-template-columns: 208px minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
  padding: 2rem 0 4rem;
}
.admin-nav { position: sticky; top: 90px; display: flex; flex-direction: column; gap: .15rem; }
.admin-nav__item {
  text-align: left;
  background: none;
  border: 0;
  border-radius: var(--radius-sm);
  padding: .55rem .75rem;
  font-family: var(--font-body);
  font-size: .92rem;
  color: var(--text-muted);
  cursor: pointer;
}
.admin-nav__item:hover { background: var(--bg-alt); color: var(--text); }
.admin-nav__item[aria-current="true"] {
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 550;
}

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}
.stat b {
  display: block;
  font-family: var(--font-title);
  font-size: 1.75rem;
  line-height: 1.1;
}
.stat span {
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--text-faint);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.data-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-faint);
  padding: .65rem .8rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data-table td {
  padding: .65rem .8rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: var(--surface-2); }

/* --------------------------------------------------------------------------
   19. États
   -------------------------------------------------------------------------- */
.empty {
  text-align: center;
  padding: 3.5rem 1.5rem;
  color: var(--text-muted);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}
.empty__cmd {
  font-family: var(--font-mono);
  font-size: .85rem;
  color: var(--text-faint);
  margin-bottom: .6rem;
}

.loading {
  font-family: var(--font-mono);
  font-size: .85rem;
  color: var(--text-faint);
  padding: 2.5rem 0;
  text-align: center;
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-alt) 25%, var(--surface-2) 37%, var(--bg-alt) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* --------------------------------------------------------------------------
   20. Pied de page
   -------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-alt);
  padding: 3rem 0 2rem;
  margin-top: 4rem;
  font-size: .9rem;
}
.site-footer__grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 2.4rem;
}
.site-footer h4 {
  font-family: var(--font-mono);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-faint);
  margin-bottom: .8rem;
  font-weight: 500;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: .4rem; }
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--text); }
.site-footer__about { color: var(--text-muted); max-width: 34ch; font-size: .9rem; }

.site-footer__bottom {
  border-top: 1px solid var(--line);
  padding-top: 1.4rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: .74rem;
  color: var(--text-faint);
}

/* --------------------------------------------------------------------------
   21. Fil d'Ariane
   -------------------------------------------------------------------------- */
.crumbs {
  font-family: var(--font-mono);
  font-size: .76rem;
  color: var(--text-faint);
  padding: 1.2rem 0 0;
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
}
.crumbs a { color: var(--text-muted); }
.crumbs span[aria-hidden] { color: var(--line-strong); }

/* --------------------------------------------------------------------------
   22. Utilitaires
   -------------------------------------------------------------------------- */
.muted   { color: var(--text-muted); }
.faint   { color: var(--text-faint); }
.mono    { font-family: var(--font-mono); }
.small   { font-size: .86rem; }
.center  { text-align: center; }
.mt-0 { margin-top: 0; }  .mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.75rem; }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: 1rem; }
.nowrap { white-space: nowrap; }
[hidden] { display: none !important; }

/* --------------------------------------------------------------------------
   23. Adaptatif
   -------------------------------------------------------------------------- */
@media (max-width: 960px) {
  .hero__grid { grid-template-columns: 1fr; gap: 2.2rem; }
  .article-layout { grid-template-columns: 1fr; gap: 1.8rem; }
  .toc {
    position: static;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    background: var(--surface);
  }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-nav { position: static; flex-direction: row; overflow-x: auto; padding-bottom: .4rem; }
  .admin-nav__item { white-space: nowrap; }
  .newsletter { grid-template-columns: 1fr; gap: 1.6rem; padding: 2rem 1.6rem; }
  .site-footer__grid { grid-template-columns: 1fr 1fr; gap: 1.6rem; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  .wrap { padding-inline: 16px; }
  .section { padding: 2.8rem 0; }
  .hero { padding: 2.6rem 0 2rem; }

  .nav-toggle { display: inline-block; }
  .nav {
    display: none;
    position: absolute;
    top: 66px; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: .5rem 16px 1rem;
    box-shadow: var(--shadow-md);
  }
  .nav.is-open { display: flex; }
  .nav__link { padding: .7rem .6rem; }
  .nav .theme-toggle { margin-top: .5rem; width: 100%; height: 40px; }

  .terminal__body { font-size: .74rem; padding: 1rem; min-height: 0; }
  .hero__stats { gap: 1.4rem; }
  .pager { grid-template-columns: 1fr; }
  .pager__item--next { text-align: left; grid-column: 1; }
  .site-footer__grid { grid-template-columns: 1fr; }
  .newsletter { padding: 1.6rem 1.2rem; }
  .prose h2 { font-size: 1.28rem; }
}

/* --------------------------------------------------------------------------
   24. Impression
   -------------------------------------------------------------------------- */
@media print {
  .site-header, .site-footer, .toc, .pager, .newsletter,
  .code__copy, .filters, .theme-toggle, .nav-toggle { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .article-layout { grid-template-columns: 1fr; padding: 0; }
  .code { border: 1px solid #ccc; }
  .code pre { color: #000; background: #f6f6f6; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .8em; color: #555; }
}
