:root {
  color-scheme: dark;
  --bg: #0b1623;
  --panel: #101f30;
  --panel2: #14273a;
  --border: #2b4054;
  --text: #eef3fa;
  --muted: #a7b9ce;
  --accent: #65ded4;
  --radius: 16px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    16px/1.65 system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 5px;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
.wrap {
  max-width: 1180px;
  padding: 0 28px;
  margin: auto;
}
.header {
  min-height: 94px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  gap: 24px;
}
.brand {
  font-size: 27px;
  font-weight: 750;
  letter-spacing: -1.2px;
}
.brand span {
  color: var(--accent);
}
.nav {
  display: flex;
  gap: 30px;
  align-items: center;
}
.nav a {
  color: var(--muted);
  font-size: 14px;
  padding: 14px 0;
}
.nav a[aria-current] {
  color: var(--accent);
  box-shadow: 0 2px var(--accent);
}
.nav a:hover,
footer a:hover {
  color: var(--accent);
}
.menu {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 6px 12px;
}
.skip {
  position: absolute;
  left: 16px;
  top: -100px;
  background: var(--accent);
  color: var(--bg);
  padding: 8px;
  z-index: 5;
}
.skip:focus {
  top: 12px;
}
main {
  padding: 34px 0 0;
  min-height: 70vh;
}
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 22px;
}
.intro {
  padding: 46px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 2.1px;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 750;
  margin: 0 0 18px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: clamp(34px, 4.7vw, 58px);
  line-height: 1.1;
  letter-spacing: -2px;
  margin-bottom: 15px;
}
h2 {
  font-size: 26px;
  line-height: 1.25;
  letter-spacing: -0.6px;
}
h3 {
  font-size: 21px;
  line-height: 1.35;
  letter-spacing: -0.3px;
}
.subtitle {
  font-size: 24px;
  color: var(--muted);
  margin-bottom: 20px;
}
.muted,
.intro p:not(.eyebrow),
.card p:not(.eyebrow) {
  color: var(--muted);
}
.intro .lead {
  max-width: 490px;
  font-size: 17px;
}
.links {
  display: flex;
  gap: 25px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.text-link {
  color: var(--accent);
  font-weight: 600;
  font-size: 14px;
}
.text-link:hover {
  text-decoration: underline;
  text-underline-offset: 5px;
}
.portrait {
  margin: 0;
  align-self: start;
}
.portrait img {
  display: block;
  width: 100%;
  height: auto;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 37px 0 18px;
}
.section-head h2 {
  margin: 0;
}
.feature-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 20px;
}
.feature {
  padding: 32px;
  display: flex;
  flex-direction: column;
  min-height: 300px;
}
.feature h3 {
  font-size: 35px;
  letter-spacing: -1px;
}
.feature .bottom {
  margin-top: auto;
  padding-top: 22px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}
.stack {
  display: grid;
  gap: 18px;
}
.article-card {
  display: block;
  padding: 25px 28px;
  position: relative;
  transition:
    border-color 0.18s,
    background 0.18s;
}
.article-card:hover {
  border-color: #559b9e;
  background: var(--panel2);
}
.article-card .eyebrow {
  margin-bottom: 10px;
}
.article-card h3 {
  margin: 0 25px 8px 0;
}
.article-card p {
  font-size: 14px;
  margin-bottom: 0;
}
.tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.tag {
  font-size: 12px;
  color: var(--muted);
  padding: 4px 11px;
  border: 1px solid var(--border);
  border-radius: 7px;
}
.context-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin: 0 0 9px;
  padding: 3px 10px;
  background: color-mix(in srgb, var(--panel2) 62%, transparent);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0;
}
.context-filters {
  align-items: center;
}
.topics {
  padding: 23px 28px;
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.topics h2 {
  font-size: 17px;
  margin: 0;
}
.chip {
  background: none;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 15px;
  font-size: 13px;
}
.chip:hover,
.chip.active {
  border-color: var(--accent);
  color: var(--accent);
}
.chip.active {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  border-top: 1px solid var(--border);
  margin: 36px 0 0;
  padding: 25px 0 32px;
  color: var(--muted);
  font-size: 13px;
}
footer .brand {
  font-size: 21px;
  color: var(--text);
}
footer .footlinks {
  display: flex;
  gap: 24px;
}
.note {
  font-size: 12px;
  color: var(--muted);
  margin: 15px 0 0;
}
.page-heading {
  padding: 16px 0 24px;
  max-width: 780px;
}
.page-heading h1 {
  font-size: 42px;
}
.page-heading p {
  color: var(--muted);
}
.listing {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.listing .article-card {
  min-height: 180px;
}
.filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.filters input {
  flex: 1;
  min-width: 190px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 18px;
}
.field label {
  font-size: 14px;
  font-weight: 600;
}
input,
textarea,
select {
  background: var(--bg);
  background-image: none;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 13px;
  width: 100%;
  min-width: 0;
}
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='m4 6 4 4 4-4' stroke='%23a7b9ce' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
textarea {
  resize: vertical;
  min-height: 170px;
}
.btn {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 17px;
  background: var(--panel2);
  color: var(--text);
  display: inline-block;
  font-size: 14px;
}
.btn.primary {
  background: var(--accent);
  color: #092122;
  border-color: var(--accent);
  font-weight: 650;
}
.btn.danger {
  border-color: #9f4652;
  background: #452630;
  color: #ffe8eb;
}
.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.file-input:focus-visible {
  outline: none;
}
.file-picker {
  align-self: flex-start;
  display: inline-flex;
  width: auto;
  border: 0;
  border-radius: 8px;
  padding: 10px 17px;
  background: var(--accent);
  color: #092122;
  cursor: pointer;
  font-size: 14px;
  font-weight: 650;
}
.file-input:focus-visible + .file-picker {
  outline: 3px solid var(--accent);
  outline-offset: 5px;
}
.file-name {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.two-col {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 22px;
}
.padded {
  padding: 32px;
}
.prose {
  max-width: 740px;
  margin: 0 auto;
}
.contact-card {
  max-width: 720px;
}
.prose h1 {
  font-size: 40px;
}
.prose h2 {
  margin-top: 32px;
}
.prose p,
.prose li {
  color: var(--muted);
}
.prose a {
  color: var(--accent);
  text-decoration: underline;
}
.prose pre {
  overflow: auto;
  background: var(--bg);
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.prose code {
  font-family: ui-monospace, monospace;
  font-size: 14px;
}
.back {
  display: inline-block;
  color: var(--accent);
  font-size: 13px;
  margin-bottom: 25px;
}
.notice {
  padding: 14px 18px;
  background: #142d3b;
  border: 1px solid #315365;
  border-radius: 9px;
  font-size: 13px;
  color: #b8d7e7;
  margin-bottom: 22px;
}
.status {
  min-height: 26px;
  font-size: 14px;
  color: var(--accent);
}
.status.error {
  color: #e78282;
}
.auth-card {
  margin: 42px auto;
  max-width: 520px;
}
.article-card img,
.prose img,
.preview img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}
[hidden] {
  display: none !important;
}
.admin-layout {
  display: block;
  width: 100%;
}
.admin-layout > section {
  width: 100%;
  min-width: 0;
}
.admin-navigation {
  display: flex;
  gap: 26px;
  margin-bottom: 26px;
  align-items: center;
}
.admin-navigation a {
  color: var(--muted);
  font-size: 14px;
  padding: 4px 0;
}
.admin-navigation a[aria-current="page"] {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 7px;
}
.admin-navigation a:hover { color: var(--accent); }
.status:empty { display: none; }
.admin-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 25px;
}
.admin-bar h1 {
  font-size: 30px;
  letter-spacing: -0.7px;
  margin: 0;
}
.editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.editor-grid textarea {
  min-height: 380px;
  line-height: 1.7;
  font-family: ui-monospace, monospace;
  font-size: 13px;
}
.preview {
  padding: 22px;
  min-height: 380px;
  overflow-wrap: anywhere;
}
.preview h1 {
  font-size: 28px;
  letter-spacing: -0.5px;
}
.preview h2 {
  font-size: 21px;
}
.preview p {
  color: var(--muted);
}
.toolbar {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.toolbar button {
  font-size: 12px;
  padding: 5px 9px;
}
.editor-label {
  font-size: 14px;
  font-weight: 600;
}
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
}
.empty {
  padding: 28px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  color: var(--muted);
}
@media (max-width: 800px) {
  .wrap {
    padding: 0 20px;
  }
  .hero {
    grid-template-columns: minmax(0, 1fr) 230px;
  }
  .intro {
    padding: 28px;
  }
  h1 {
    font-size: 40px;
  }
  .subtitle {
    font-size: 20px;
  }
  .feature-grid {
    grid-template-columns: 1fr;
  }
  .feature {
    min-height: 240px;
  }
  .editor-grid {
    grid-template-columns: 1fr;
  }
  .two-col {
    grid-template-columns: 1fr;
  }
  .nav {
    gap: 18px;
  }
}
@media (max-width: 600px) {
  .header {
    min-height: 78px;
    flex-wrap: wrap;
    padding: 14px 0;
    gap: 10px;
  }
  .menu {
    display: block;
  }
  .nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 6px 0;
  }
  .nav.open {
    display: flex;
  }
  .nav a {
    padding: 9px 6px;
  }
  .hero {
    grid-template-columns: 1fr;
  }
  .intro {
    padding: 29px 25px;
  }
  .portrait {
    width: min(100%, 290px);
    justify-self: center;
  }
  .hero .portrait {
    order: 2;
  }
  h1 {
    font-size: 40px;
  }
  .subtitle {
    font-size: 21px;
  }
  .section-head {
    align-items: flex-start;
  }
  .section-head h2 {
    font-size: 23px;
  }
  .section-head .text-link {
    font-size: 12px;
  }
  .listing {
    grid-template-columns: 1fr;
  }
  .padded {
    padding: 24px;
  }
  .feature {
    padding: 26px;
  }
  .topics {
    padding: 23px;
  }
  .page-heading h1 {
    font-size: 36px;
  }
  .prose h1 {
    font-size: 32px;
  }
  .admin-bar .links {
    margin-top: 0;
  }
  .editor-grid textarea {
    min-height: 320px;
  }
  footer {
    flex-wrap: wrap;
  }
  .links {
    gap: 20px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
/* Pied de page public */
.site-footer {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 18px 36px;
  text-align: center;
  padding: 28px 0 34px;
}
.site-footer p {
  margin: 0;
}
.site-footer > a {
  color: var(--muted);
}

@media (max-width: 600px) {
  .site-footer {
    gap: 14px 22px;
  }
}

.site-footer .github-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.github-icon {
  flex: none;
}
.site-footer .language-link {
  color: var(--accent);
}

/* Palette claire : sauge, menthe et accents verts. */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eaf3e9;
  --panel: #dcefd5;
  --panel2: #d7ebd9;
  --border: #afc8b2;
  --text: #16372a;
  --muted: #486451;
  --accent: #176c3d;
}

/* Même fond et mêmes bordures pour tous les rectangles. */
:root[data-theme="light"] .intro,
:root[data-theme="light"] .feature,
:root[data-theme="light"] .article-card {
  background: var(--panel);
  border-color: var(--border);
}

/* Variation discrète au survol des articles. */
:root[data-theme="light"] .article-card:hover {
  background: var(--panel2);
  border-color: var(--accent);
}
:root[data-theme="light"] select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='m4 6 4 4 4-4' stroke='%23486451' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
:root[data-theme="light"] .chip.active {
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  border-color: var(--accent);
  color: var(--accent);
}
:root[data-theme="light"] .chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}
:root[data-theme="light"] .notice {
  background: #dceede;
  border-color: #9ebea7;
  color: #2e593e;
}
:root[data-theme="light"] .btn.primary {
  background: #237b45;
  border-color: #237b45;
  color: #ffffff;
}
:root[data-theme="light"] .btn.primary:hover {
  background: #185e33;
  border-color: #185e33;
}
:root[data-theme="light"] .btn:not(.primary):not(.danger) {
  background: #e0eecf;
}

/* Le pictogramme indique le thème vers lequel basculer. */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: transparent;
  color: #ffffff;
  border: 0;
  border-radius: 0;
  padding: 10px;
}
.theme-toggle:hover {
  background: transparent;
  opacity: 0.7;
}
:root[data-theme="light"] .theme-toggle {
  color: #000000;
}
.theme-icon {
  flex: none;
}
.icon-moon {
  display: none;
}
:root[data-theme="light"] .icon-sun {
  display: none;
}
:root[data-theme="light"] .icon-moon {
  display: block;
}

/* Garder le nom compact, même avec un HTML réparti sur plusieurs lignes. */
.brand {
  display: inline-flex;
  align-items: baseline;
}

.project-card { position: relative; padding-bottom: 22px; }
.project-card .project-action {
  display: block;
  margin-top: auto;
  padding-top: 24px;

  overflow-wrap: anywhere;
}
.project-card .bottom { margin-top: 0; }
:root[data-theme="light"] .btn.danger {
  background: #fbe9e7;
  border-color: #a52b38;
  color: #821d29;
}
:root[data-theme="light"] .btn.danger:hover,
:root[data-theme="light"] .btn.danger:active {
  background: #f5d1d0;
  border-color: #821d29;
  color: #68121d;
}
.article-card h3 { margin-right: 0; }
.article-card { overflow-wrap: anywhere; }
:root .article-card,
:root .article-card:hover,
:root[data-theme="light"] .article-card:hover {
  background: var(--panel);
  transition: border-color .15s ease;
}
:root .article-card:active { border-color: var(--accent); }
@media (hover: hover) and (pointer: fine) {
  :root .article-card:hover { border-color: var(--accent); }
}
html { background: var(--bg); }
:root[data-theme="light"] { color-scheme: light; }
.about-layout { max-width: 850px; margin-inline: auto; }
.project-articles { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border); }
.project-articles h4 { margin: 0 0 12px; }
.project-articles ul { padding-left: 20px; margin: 0; }
.project-articles li + li { margin-top: 10px; }
.project-articles a, .article-project a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.project-card { scroll-margin-top: 24px; }
.admin-navigation { flex-wrap: wrap; }

/* Navigation compacte, identique pour les deux listes. */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  margin: 28px 0 12px;
}
.pagination button {
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel2);
  color: var(--text);
  padding: 10px 18px;
  min-height: 44px;
  font-size: 14px;
  font-weight: 650;
}
.pagination button:hover:not(:disabled) { border-color: var(--accent); }
.pagination span { color: var(--muted); min-width: 48px; text-align: center; font-size: 14px; }
.project-card {
  display: flex;
  flex-direction: column;
  padding: 25px 28px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.project-card h3 { font-size: 21px; margin-bottom: 12px; }
.project-card .eyebrow { margin-bottom: 10px; }
.project-summary {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.65;
  max-height: 4.95em;
  margin-bottom: 0;
}
.project-description { white-space: pre-wrap; overflow-wrap: anywhere; }
.project-external { display: inline-block; margin-top: 24px; }
.read-next { max-width: 740px; margin: 40px auto 0; }
.read-next .article-card { min-width: 0; }
.read-next .article-card h3 { font-size: 18px; }
.read-next .article-card p {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Format de carte identique au blog : titre, catégorie, contexte et extrait. */
.project-card { min-height: 180px; padding: 25px 28px; }
.project-card .project-summary { margin-top: 0; }
.project-card .project-action { margin-top: auto; padding-top: 14px; }

/* Recherche alignée sur le titre des listes, compacte sur grand écran. */
.listing-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.listing-heading .page-heading { min-width: 0; flex: 1; }
.listing-search { width: min(260px, 32%); flex: none; margin-top: 16px; }
.listing-search input { width: 100%; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.project-card { display: block; min-height: 180px; padding: 25px 28px; }
.project-card h3 { margin: 0 0 8px; font-size: 21px; }
.project-card .project-summary { margin: 0; }
@media (max-width: 600px) {
  .listing-heading { flex-direction: column; gap: 0; }
  .listing-heading .page-heading { padding-bottom: 8px; }
  .listing-search { width: 100%; margin: 0 0 24px; }
}

/* Contexte du projet à côté du libellé, comme sur la fiche article. */
.project-detail > .eyebrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.project-detail > .eyebrow .context-badge { margin: 0; }
