/* ==========================================================================
   OTSPI — Site vitrine www.otspi.org
   Polices système, aucune ressource externe, thèmes clair et sombre.
   ========================================================================== */

:root {
  --navy: #0f2042;
  --eu-blue: #003399;
  --gold: #ffcc00;

  --bg: #ffffff;
  --bg-alt: #f5f7fb;
  --surface: #ffffff;
  --text: #0f172a;
  --text-muted: #475569;
  --border: #dbe2ee;
  --accent: #003399;
  --accent-strong: #0f2042;
  --accent-soft: #e8eefb;
  --on-accent: #ffffff;
  --hero-bg: #0f2042;
  --hero-text: #ffffff;
  --hero-muted: #c7d2e8;

  --radius: 10px;
  --max: 1120px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1222;
    --bg-alt: #101a30;
    --surface: #14203a;
    --text: #e6ebf5;
    --text-muted: #a5b1c8;
    --border: #25324f;
    --accent: #7ea2ff;
    --accent-strong: #c9d6ff;
    --accent-soft: #1a2a4d;
    --on-accent: #0b1222;
    --hero-bg: #070d1a;
    --hero-text: #ffffff;
    --hero-muted: #a5b1c8;
    color-scheme: dark;
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--accent);
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--accent-strong);
}

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

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

@media (min-width: 720px) {
  .container {
    padding: 0 1.5rem;
  }
}

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 100;
  background: var(--surface);
  padding: 0.5rem 1rem;
}

/* --------------------------------------------------------------------------
   En-tête
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
}

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

.brand img {
  height: 2.4rem;
  width: auto;
}

.brand .logo-dark {
  display: none;
}

@media (prefers-color-scheme: dark) {
  .brand .logo-light {
    display: none;
  }

  .brand .logo-dark {
    display: block;
  }
}

.site-nav ul {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: block;
  padding: 0.5rem 0.7rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  border-radius: 6px;
}

.site-nav a:hover {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.site-nav .nav-cta {
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}

.site-nav .nav-cta:hover {
  background: var(--accent-strong);
  color: var(--on-accent);
}

.nav-toggle {
  display: none;
}

@media (max-width: 960px) {
  .js .nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 0.95rem;
    cursor: pointer;
  }

  .js .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
  }

  .js .site-nav.is-open {
    display: block;
  }

  .site-nav ul {
    flex-direction: column;
    align-items: stretch;
    padding: 0.5rem 1rem 1rem;
  }

  .site-nav a {
    padding: 0.75rem 0.5rem;
  }

  .site-nav .nav-cta {
    text-align: center;
    margin-top: 0.5rem;
  }
}

/* --------------------------------------------------------------------------
   Boutons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.3rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border: 2px solid transparent;
  line-height: 1.2;
}

.btn-primary {
  background: var(--gold);
  color: #0f2042;
}

.btn-primary:hover {
  background: #ffd83d;
  color: #0f2042;
}

.btn-outline {
  border-color: currentColor;
  color: var(--hero-text);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--hero-text);
}

.btn-accent {
  background: var(--accent);
  color: var(--on-accent);
}

.btn-accent:hover {
  background: var(--accent-strong);
  color: var(--on-accent);
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
  background:
    radial-gradient(circle at 85% 20%, rgba(0, 51, 153, 0.55), transparent 55%),
    var(--hero-bg);
  color: var(--hero-text);
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(3rem, 7vw, 5rem);
}

.kicker {
  display: inline-block;
  margin: 0 0 1rem;
  padding: 0.3rem 0.8rem;
  border: 1px solid rgba(255, 204, 0, 0.6);
  border-radius: 999px;
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0 0 1.25rem;
  max-width: 22ch;
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
}

.hero .lead {
  max-width: 62ch;
  margin: 0 0 2rem;
  color: var(--hero-muted);
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

@media (max-width: 480px) {
  .hero-actions .btn {
    width: 100%;
  }
}

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */
.section {
  padding: clamp(3rem, 7vw, 5rem) 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section-head {
  max-width: 70ch;
  margin-bottom: 2.5rem;
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.section h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.6rem, 3.5vw, 2.25rem);
  line-height: 1.2;
  color: var(--accent-strong);
}

@media (prefers-color-scheme: dark) {
  .section h2 {
    color: var(--text);
  }
}

.section-head p {
  margin: 0;
  color: var(--text-muted);
}

h3 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  line-height: 1.3;
}

/* --------------------------------------------------------------------------
   Chiffres clés
   -------------------------------------------------------------------------- */
.figures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.figure {
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--eu-blue);
  border-radius: var(--radius);
}

.figure-value {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--accent-strong);
  font-size: clamp(1.7rem, 4vw, 2.2rem);
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

@media (prefers-color-scheme: dark) {
  .figure {
    border-top-color: var(--accent);
  }

  .figure-value {
    color: var(--text);
  }
}

.figure p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.source {
  display: block;
  margin-top: 0.6rem;
  font-size: 0.8rem;
}

/* --------------------------------------------------------------------------
   Cartes
   -------------------------------------------------------------------------- */
.grid {
  display: grid;
  gap: 1.25rem;
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

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

@media (min-width: 760px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 360px) {
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

.card {
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.card p {
  margin: 0;
  color: var(--text-muted);
}

.card p + p,
.card ul {
  margin-top: 0.75rem;
}

.card ul {
  padding-left: 1.2rem;
  color: var(--text-muted);
}

.card li + li {
  margin-top: 0.3rem;
}

.card-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin-bottom: 0.9rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 800;
  font-size: 0.95rem;
}

.tag {
  display: inline-block;
  margin-bottom: 0.75rem;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.tag-pilot {
  background: var(--gold);
  color: #0f2042;
}

/* --------------------------------------------------------------------------
   Citation / encadré
   -------------------------------------------------------------------------- */
.callout {
  margin-top: 2rem;
  padding: 1.25rem 1.5rem;
  border-left: 4px solid var(--gold);
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.callout p {
  margin: 0;
}

/* --------------------------------------------------------------------------
   Tableau des garanties
   -------------------------------------------------------------------------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.97rem;
}

th,
td {
  padding: 0.9rem 1rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

tr:last-child td {
  border-bottom: 0;
}

th {
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

td:first-child {
  font-weight: 600;
  min-width: 11rem;
}

td:last-child {
  color: var(--text-muted);
}

@media (max-width: 600px) {
  table,
  tbody,
  tr,
  td {
    display: block;
  }

  thead {
    display: none;
  }

  tr {
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 0;
  }

  tr:last-child {
    border-bottom: 0;
  }

  td {
    border: 0;
    padding: 0.3rem 1rem;
  }
}

/* --------------------------------------------------------------------------
   Feuille de route
   -------------------------------------------------------------------------- */
.timeline {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: phase;
}

.timeline li {
  position: relative;
  padding: 0 0 2rem 3.5rem;
  counter-increment: phase;
}

.timeline li::before {
  content: counter(phase);
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 800;
}

.timeline li::after {
  content: "";
  position: absolute;
  left: 1.15rem;
  top: 2.6rem;
  bottom: 0.3rem;
  width: 2px;
  background: var(--border);
}

.timeline li:last-child {
  padding-bottom: 0;
}

.timeline li:last-child::after {
  display: none;
}

.timeline p {
  margin: 0;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Appel aux partenaires
   -------------------------------------------------------------------------- */
.partner-card h3 {
  color: var(--accent-strong);
}

@media (prefers-color-scheme: dark) {
  .partner-card h3 {
    color: var(--text);
  }
}

.partner-card dl {
  margin: 0.75rem 0 0;
}

.partner-card dt {
  margin-top: 0.6rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text);
}

.partner-card dd {
  margin: 0.2rem 0 0;
  color: var(--text-muted);
}

.cta-band {
  margin-top: 3rem;
  padding: clamp(1.75rem, 4vw, 2.5rem);
  border-radius: var(--radius);
  background: var(--hero-bg);
  color: var(--hero-text);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.cta-band h3 {
  font-size: 1.35rem;
  margin-bottom: 0.4rem;
}

.cta-band p {
  margin: 0;
  color: var(--hero-muted);
  max-width: 55ch;
}

.cta-band .hero-actions {
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Pied de page
   -------------------------------------------------------------------------- */
.site-footer {
  padding: 3rem 0 2rem;
  background: var(--hero-bg);
  color: var(--hero-muted);
  font-size: 0.93rem;
}

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

.site-footer h2 {
  margin: 0 0 0.75rem;
  color: var(--hero-text);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer li + li {
  margin-top: 0.4rem;
}

.site-footer a {
  color: var(--hero-text);
}

.site-footer .footer-logo {
  height: 2.6rem;
  width: auto;
  margin-bottom: 0.75rem;
}

.footer-bottom {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.85rem;
}

.footer-bottom p {
  margin: 0.25rem 0;
}

/* --------------------------------------------------------------------------
   Pages de contenu (mentions légales)
   -------------------------------------------------------------------------- */
.prose {
  max-width: 75ch;
}

.prose h2 {
  margin-top: 2.5rem;
  font-size: 1.4rem;
}

.prose h1 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  color: var(--accent-strong);
}

@media (prefers-color-scheme: dark) {
  .prose h1 {
    color: var(--text);
  }
}
