/* ==========================================================================
   Boris Beaude — feuille de style du site /boris/
   Polices auto-hébergées (fonts/) : Nunito et Lato, SIL Open Font License 1.1.
   Après modification, changer le paramètre ?v= dans index.html : nginx met
   les CSS en cache 30 jours.
   ========================================================================== */

/* --- Polices ------------------------------------------------------------- */

@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url("../fonts/nunito-latin-wght-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Nunito";
  font-style: italic;
  font-weight: 200 1000;
  font-display: swap;
  src: url("../fonts/nunito-latin-wght-italic.woff2") format("woff2");
}

@font-face {
  font-family: "Lato";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("../fonts/lato-latin-300-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Lato";
  font-style: italic;
  font-weight: 300;
  font-display: swap;
  src: url("../fonts/lato-latin-300-italic.woff2") format("woff2");
}

/* --- Variables ----------------------------------------------------------- */

:root {
  --color-accent: #018ac8;            /* bleu d'origine : filets, accents */
  --color-button: #0077b0;            /* bleu des boutons (texte blanc lisible) */
  --color-button-hover: #005795;
  --color-link-on-dark: #33a6dc;
  --color-link-on-light: #00699a;
  --color-text-on-dark: #bcbcbc;
  --color-meta-on-dark: #dddddd;
  --color-title-on-dark: #ffffff;
  --color-text-on-light: #222222;
  --color-rule-on-dark: rgba(255, 255, 255, 0.2);
  --overlay-dark: rgba(0, 0, 0, 0.8);
  --font-text: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-title: "Lato", "Nunito", system-ui, sans-serif;
  --container-width: 1140px;
  --header-height: 72px;
}

/* --- Base ---------------------------------------------------------------- */

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

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: #000000;
  color: var(--color-text-on-light);
  font-family: var(--font-text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--color-link-on-light);
  font-weight: 600;
}

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

.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 16px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 8px 16px;
  background: #ffffff;
  color: #000000;
}

.skip-link:focus {
  left: 16px;
}

/* --- En-tête et navigation ----------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: var(--header-height);
}

.site-header-portrait {
  flex: none;
  display: block;
  line-height: 0;
}

.site-header-portrait img {
  width: 56px;
  height: 56px;
}

.site-nav {
  margin-left: auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.site-nav-list {
  display: flex;
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
  white-space: nowrap;
}

.site-nav-list a {
  display: block;
  padding: 10px 0;
  color: #444444;
  font-size: 15px;
  text-decoration: none;
}

.site-nav-list a:hover {
  color: var(--color-link-on-light);
}

/* --- Bandeau d'accueil --------------------------------------------------- */

.hero {
  background: #000000 url("../img/hero-background.webp") center / cover no-repeat;
  color: var(--color-title-on-dark);
  padding: 72px 0 80px;
}

.hero .container {
  display: flex;
  flex-wrap: wrap-reverse;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
}

.hero-name {
  margin: 0 0 12px;
  font-family: var(--font-text);
  font-size: clamp(36px, 6vw, 56px);
  font-weight: 400;
  line-height: 1.1;
}

.hero-subtitle {
  margin: 0 0 16px;
  font-family: var(--font-title);
  font-size: clamp(22px, 3vw, 32px);
  font-style: italic;
  font-weight: 300;
}

.hero-role {
  margin: 0;
  color: var(--color-meta-on-dark);
  font-size: 18px;
  font-weight: 600;
}

.hero-logo img {
  display: block;
  width: 283px;
}

/* --- Sections ------------------------------------------------------------ */

.section-heading {
  background: #ffffff;
  padding: 28px 0;
}

.section-heading h2 {
  margin: 0;
  color: #000000;
  font-family: var(--font-text);
  font-size: clamp(32px, 5vw, 44px);
  font-weight: 400;
  line-height: 1.2;
}

.section-content {
  padding: 64px 0;
  background-color: #000000;
  background-image: linear-gradient(var(--overlay-dark), var(--overlay-dark)), url("../img/section-background.webp");
  background-position: center;
  background-size: cover;
  color: var(--color-text-on-dark);
}

.section-content-nebula {
  background-image: linear-gradient(var(--overlay-dark), var(--overlay-dark)), url("../img/section-background-nebula.webp");
}

.section-content-bandeau {
  background-image: linear-gradient(var(--overlay-dark), var(--overlay-dark)), url("../img/hero-background.webp");
}

@media (hover: hover) and (min-width: 1024px) {
  .section-content {
    background-attachment: fixed;
  }
}

/* :where() annule la spécificité : les classes (.card-actions, .section-intro…) priment. */
:where(.section-content) p {
  margin: 0 0 1em;
}

.section-content a {
  color: var(--color-link-on-dark);
}

.section-intro {
  max-width: 760px;
  margin: 0 0 40px;
  color: var(--color-meta-on-dark);
  font-size: 16px;
}

.subsection-title {
  margin: 64px 0 28px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--color-accent);
  color: var(--color-title-on-dark);
  font-family: var(--font-text);
  font-size: 26px;
  font-weight: 400;
}

.subsection-title:first-child,
.section-intro + .subsection-title {
  margin-top: 0;
}

/* --- Présentation -------------------------------------------------------- */

.presentation-text {
  max-width: 760px;
}

.presentation-text p {
  color: var(--color-meta-on-dark);
  font-size: 17px;
  line-height: 1.65;
}

/* --- Cartes -------------------------------------------------------------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 56px 32px;
}

.card {
  display: flex;
  flex-direction: column;
  padding-top: 20px;
  border-top: 1px solid var(--color-rule-on-dark);
}

.card-title {
  margin: 0 0 12px;
  color: var(--color-title-on-dark);
  font-family: var(--font-title);
  font-size: 24px;
  font-weight: 300;
  line-height: 1.25;
}

.card-meta {
  color: var(--color-meta-on-dark);
  font-size: 14px;
  font-weight: 600;
}

.section-content .card-meta {
  margin-bottom: 0.6em;
}

.card-figure {
  margin: 4px 0 16px;
}

.card-image {
  display: block;
  width: 100%;
}

.card-cover {
  display: block;
  width: auto;
  height: 300px;
  margin: 8px auto 20px;
}

.image-credit {
  margin-top: 6px;
  color: #8f8f8f;
  font-size: 12px;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 12px;
}

.funding-logo {
  display: block;
  width: 200px;
  margin: 8px 0 4px;
}

.key-references {
  margin: 0;
  padding-left: 1.1em;
}

.key-references li {
  margin-bottom: 4px;
}

.key-references-label {
  margin-top: 8px;
  color: var(--color-meta-on-dark);
  font-weight: 600;
}

/* --- Boutons et étiquettes ----------------------------------------------- */

.button {
  display: inline-block;
  padding: 6px 14px;
  background: var(--color-button);
  color: #ffffff;
  font-family: var(--font-text);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

.section-content a.button,
.site-footer a.button {
  color: #ffffff;
}

.button:hover {
  background: var(--color-button-hover);
}

.tag {
  display: inline-block;
  padding: 3px 8px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: var(--color-meta-on-dark);
  font-size: 12px;
  font-weight: 600;
}

/* --- « détails ↓ » : texte replié (élément natif <details>) -------------- */

.more-details {
  margin: 0 0 1em;
}

.more-details-toggle {
  display: inline-block;
  color: var(--color-link-on-dark);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.more-details-toggle::-webkit-details-marker {
  display: none;
}

.more-details-arrow {
  display: inline-block;
  transition: transform 0.15s ease-out;
}

.more-details[open] .more-details-arrow {
  transform: rotate(180deg);
}

.more-details[open] .more-details-toggle {
  margin-bottom: 0.8em;
}

/* --- Blog ---------------------------------------------------------------- */

.blog-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 32px;
  align-items: center;
}

.blog-layout img {
  display: block;
  width: 100%;
}

.blog-title {
  margin: 0 0 12px;
  color: var(--color-accent);
  font-family: var(--font-text);
  font-size: 40px;
  font-weight: 400;
}

/* --- Pied de page -------------------------------------------------------- */

.footer-social {
  background: var(--color-accent);
  padding: 20px 0;
}

.footer-social-list {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-social-list a {
  display: block;
  color: #ffffff;
  line-height: 0;
}

.footer-social-list a:hover {
  color: #000000;
}

.footer-social-list svg {
  width: 36px;
  height: 36px;
  fill: currentColor;
}

.footer-info {
  background: #ffffff;
  padding: 48px 0;
}

.footer-info .container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 32px;
}

.footer-title {
  margin: 0 0 14px;
  color: #000000;
  font-family: var(--font-title);
  font-size: 24px;
  font-weight: 300;
}

.footer-info p,
.footer-info address {
  margin: 0 0 8px;
  font-style: normal;
}

.footer-credit {
  margin: 0;
  background: #000000;
  color: var(--color-link-on-dark);
  padding: 16px 0;
  font-size: 14px;
  text-align: center;
}

/* --- Petits écrans ------------------------------------------------------- */

@media (max-width: 640px) {
  :root {
    --header-height: 64px;
  }

  .site-header .container {
    gap: 14px;
  }

  .site-header-portrait img {
    width: 44px;
    height: 44px;
  }

  .hero {
    padding: 48px 0 56px;
  }

  .hero-logo img {
    width: 200px;
  }

  .section-content {
    padding: 48px 0;
  }

  .footer-social-list {
    gap: 32px;
  }
}
