/* =========================================================
   Rocket Tutorials — feuille de style unique
   Direction : « arène de nuit ». Chaque figure a sa couleur
   signature (Stall = boost bleu, Purple = violet, Gold = or),
   reprise partout où la figure apparaît.
   ========================================================= */

/* ---------- Jetons : thème clair ---------- */
:root {
  --bg: #eef3fb;
  --bg-alt: #e2e9f6;
  --surface: #ffffff;
  --ink: #0c1733;
  --ink-soft: #3c4a6b;
  --line: #c9d4e8;
  --focus: #ff7a1a;

  --stall: #0077b6;
  --purple: #7b2cbf;
  --gold: #a86a00;
  --flame: #c2410c;
  --on-accent: #ffffff;

  --header-bg: rgba(238, 243, 251, 0.86);
  --hero-veil: linear-gradient(90deg, rgba(12, 23, 51, 0.88) 0%, rgba(12, 23, 51, 0.55) 55%, rgba(12, 23, 51, 0.15) 100%);

  --font: "Saira", system-ui, -apple-system, "Segoe UI", sans-serif;
  --wrap: 72rem;
  --gutter: clamp(1rem, 4vw, 2rem);
  --radius-s: 6px;
  --radius-m: 12px;
  --header-h: 4rem;

  color-scheme: light;
}

/* ---------- Jetons : thème sombre ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1733;
    --bg-alt: #101e40;
    --surface: #142450;
    --ink: #e9eeff;
    --ink-soft: #a9b5d6;
    --line: #24376a;
    --stall: #2ec5ff;
    --purple: #c27bff;
    --gold: #ffc23d;
    --flame: #ff7a1a;
    --on-accent: #0c1733;
    --header-bg: rgba(12, 23, 51, 0.86);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c1733;
  --bg-alt: #101e40;
  --surface: #142450;
  --ink: #e9eeff;
  --ink-soft: #a9b5d6;
  --line: #24376a;
  --stall: #2ec5ff;
  --purple: #c27bff;
  --gold: #ffc23d;
  --flame: #ff7a1a;
  --on-accent: #0c1733;
  --header-bg: rgba(12, 23, 51, 0.86);
  color-scheme: dark;
}

/* Couleur de la figure courante */
[data-tech="stall"]  { --tech: var(--stall); }
[data-tech="purple"] { --tech: var(--purple); }
[data-tech="gold"]   { --tech: var(--gold); }

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-variation-settings: "wdth" 100;
  transition: background-color .25s ease, color .25s ease;
}

img, video { display: block; max-width: 100%; }

h1, h2, h3 {
  margin: 0 0 .5em;
  line-height: 1.1;
  font-weight: 800;
  font-stretch: 70%;
  font-variation-settings: "wdth" 70;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
h2 { font-size: clamp(1.8rem, 1.3rem + 2vw, 2.6rem); }
h3 { font-size: 1.45rem; }

p { margin: 0 0 1em; max-width: 68ch; text-wrap: pretty; }

a { color: inherit; text-underline-offset: .2em; }
a:hover { color: var(--flame); }

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

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

.skip {
  position: absolute;
  left: 1rem; top: -4rem;
  z-index: 100;
  padding: .6rem 1rem;
  background: var(--flame);
  color: #fff;
  font-weight: 700;
  border-radius: var(--radius-s);
}
.skip:focus { top: 1rem; }

/* ---------- En-tête ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}

.bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: var(--header-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-right: auto;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.25rem;
  font-variation-settings: "wdth" 70;
  letter-spacing: .01em;
}
.brand img { width: auto; height: 2.6rem; }
.brand:hover { color: inherit; }

.nav { display: flex; align-items: center; gap: .5rem; }
.nav ul {
  display: flex;
  gap: .25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav a {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .45rem .75rem;
  border-radius: var(--radius-s);
  text-decoration: none;
  font-weight: 600;
  color: var(--ink-soft);
}
.nav a:hover { color: var(--ink); background: var(--bg-alt); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--bg-alt); }

/* Pastille de couleur des figures dans le menu */
.nav a[data-tech]::before {
  content: "";
  width: .55rem; height: .55rem;
  border-radius: 50%;
  background: var(--tech);
  flex: none;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 2.6rem; height: 2.6rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.icon-btn:hover { background: var(--bg-alt); }
.icon-btn svg { width: 1.3rem; height: 1.3rem; }

/* Icône soleil/lune selon le thème actif */
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: block; }
}

.nav-toggle { display: none; }
.theme-toggle .label { display: none; font-weight: 600; }

@media (max-width: 860px) {
  .nav-toggle { display: inline-grid; }
  .nav {
    position: absolute;
    top: var(--header-h);
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: .75rem;
    padding: 1rem var(--gutter) 1.25rem;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 30px -18px rgba(12, 23, 51, .45);
    display: none;
  }
  .nav.is-open { display: flex; }
  .nav ul { flex-direction: column; }
  .nav a { padding: .8rem .75rem; font-size: 1.1rem; }
  .theme-toggle { width: 100%; gap: .5rem; display: flex; justify-content: center; }
  .theme-toggle .label { display: inline; }
}

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .8rem 1.4rem;
  border: 2px solid transparent;
  border-radius: var(--radius-s);
  background: var(--flame);
  color: #fff;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s ease, background-color .15s ease;
}
.btn:hover { color: #fff; transform: translateY(-1px); background: #e2620a; }
.btn:active { transform: translateY(0); }
.btn-ghost { background: transparent; border-color: currentColor; color: inherit; }
.btn-ghost:hover { background: rgba(255, 255, 255, .12); color: inherit; }

/* =========================================================
   Accueil
   ========================================================= */
.hero {
  position: relative;
  isolation: isolate;
  min-height: min(82vh, 46rem);
  display: grid;
  align-items: end;
  color: #f3f6ff;
  background: #0c1733 url(../imgs/presentation.jpg) center / cover no-repeat;
  overflow: hidden;
}
.hero video {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: -2;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--hero-veil);
}
.hero .wrap { padding-block: 5rem 4rem; }

.hero h1 {
  font-size: clamp(3rem, 1.6rem + 7vw, 7rem);
  font-weight: 900;
  font-variation-settings: "wdth" 60;
  line-height: .92;
  max-width: 11ch;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  font-style: italic;
}
.hero p { font-size: 1.2rem; max-width: 46ch; color: #d5ddf3; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }

/* La bande des trois figures, sous le héros */
.tech-strip {
  display: flex;
  height: 6px;
}
.tech-strip span { flex: 1; }
.tech-strip span:nth-child(1) { background: #2ec5ff; }
.tech-strip span:nth-child(2) { background: #c27bff; }
.tech-strip span:nth-child(3) { background: #ffc23d; }

.section { padding-block: clamp(3.5rem, 8vw, 6rem); }
.section-head { margin-bottom: 2.5rem; }
.section-head p { color: var(--ink-soft); font-size: 1.15rem; }

/* Cartes des tutoriels */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tech-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 5px solid var(--tech);
  border-radius: var(--radius-m);
  overflow: hidden;
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease;
}
.tech-card:hover {
  color: inherit;
  transform: translateY(-4px);
  box-shadow: 0 18px 36px -20px var(--tech);
}
.tech-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.tech-card .body { display: flex; flex-direction: column; flex: 1; padding: 1.25rem 1.4rem 1.4rem; }
.tech-card h3 {
  font-size: 2.4rem;
  font-weight: 900;
  font-style: italic;
  font-variation-settings: "wdth" 60;
  text-transform: uppercase;
  color: var(--tech);
  margin-bottom: .35rem;
}
.tech-card p { color: var(--ink-soft); margin-bottom: 1.25rem; }
.tech-card .meta {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  color: var(--ink);
}
.tech-card .go {
  display: inline-grid;
  place-items: center;
  width: 2.2rem; height: 2.2rem;
  border-radius: 50%;
  background: var(--tech);
  color: var(--on-accent);
  transition: transform .2s ease;
}
.tech-card:hover .go { transform: translateX(3px); }
.tech-card .go svg { width: 1.1rem; height: 1.1rem; }

@media (max-width: 900px) {
  .tech-grid { grid-template-columns: 1fr; max-width: 34rem; }
}

/* Témoignages */
.voices { background: var(--bg-alt); }
.quote-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}
.quote {
  margin: 0;
  padding: 1.5rem 1.6rem;
  background: var(--surface);
  border-radius: var(--radius-m);
  border: 1px solid var(--line);
}
.quote blockquote { margin: 0 0 1.25rem; }
.quote blockquote p { margin: 0; font-size: 1.05rem; }
.quote figcaption { display: flex; align-items: center; gap: .75rem; font-weight: 700; }
.quote img { width: 2.75rem; height: 2.75rem; border-radius: 50%; object-fit: cover; }
@media (max-width: 760px) {
  .quote-grid { grid-template-columns: 1fr; }
}

/* =========================================================
   Pages tutoriel
   ========================================================= */
.tuto-hero {
  position: relative;
  padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(2rem, 5vw, 3.5rem);
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(60rem 22rem at 85% 0%, color-mix(in srgb, var(--tech) 22%, transparent), transparent 70%),
    var(--bg);
}
.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
  color: var(--ink-soft);
  font-weight: 600;
}
.crumbs li + li::before { content: "/"; margin-right: .4rem; opacity: .6; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

.tech-title {
  font-size: clamp(3.5rem, 2rem + 9vw, 8.5rem);
  font-weight: 900;
  font-style: italic;
  font-variation-settings: "wdth" 55;
  text-transform: uppercase;
  line-height: .88;
  color: var(--tech);
  margin-bottom: 1.25rem;
}
.lede { font-size: 1.2rem; color: var(--ink-soft); max-width: 60ch; }

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}
.facts li {
  padding: .3rem .8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-weight: 600;
  font-size: .95rem;
}

.tuto-layout {
  display: grid;
  grid-template-columns: 16rem minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  padding-block: 3rem 5rem;
  align-items: start;
}

/* Sommaire */
.toc {
  position: sticky;
  top: calc(var(--header-h) + 1.5rem);
  max-height: calc(100vh - var(--header-h) - 3rem);
  overflow: auto;
}
.toc summary {
  font-weight: 800;
  font-size: 1.15rem;
  font-variation-settings: "wdth" 70;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: .25rem;
}
.toc summary::-webkit-details-marker { display: none; }
.toc summary svg { width: 1.2rem; height: 1.2rem; transition: transform .2s ease; }
.toc[open] summary svg { transform: rotate(180deg); }

.toc ol { list-style: none; margin: .75rem 0 0; padding: 0; }
.toc ol ol { margin: .2rem 0 .4rem; }
.toc a {
  display: block;
  padding: .35rem .75rem;
  border-left: 2px solid var(--line);
  color: var(--ink-soft);
  text-decoration: none;
  font-size: .95rem;
  line-height: 1.35;
}
.toc ol ol a { padding-left: 1.5rem; font-size: .9rem; }
.toc a:hover { color: var(--ink); border-left-color: var(--ink-soft); }
.toc a.is-active {
  color: var(--ink);
  font-weight: 700;
  border-left: 3px solid var(--tech);
  background: color-mix(in srgb, var(--tech) 10%, transparent);
}

@media (min-width: 961px) {
  .toc summary { pointer-events: none; }
  .toc summary svg { display: none; }
}

@media (max-width: 960px) {
  .tuto-layout { grid-template-columns: 1fr; padding-top: 1.5rem; }
  .toc {
    position: static;
    max-height: none;
    padding: .75rem 1rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-m);
  }
}

/* Contenu */
.tuto-body > section + section { margin-top: 3.5rem; }
.tuto-body h2 { position: relative; padding-left: 1rem; }
.tuto-body h2::before {
  content: "";
  position: absolute;
  left: 0; top: .1em; bottom: .1em;
  width: 5px;
  border-radius: 3px;
  background: var(--tech);
}

/* Étapes : un rail vertical numéroté */
.steps {
  counter-reset: step;
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
}
.step {
  counter-increment: step;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 1.5rem 2rem;
  align-items: center;
  padding: 0 0 2.75rem 4.25rem;
}
.step::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 0;
  display: grid;
  place-items: center;
  width: 2.75rem; height: 2.75rem;
  border-radius: 50%;
  background: var(--tech);
  color: var(--on-accent);
  font-weight: 900;
  font-size: 1.3rem;
  font-variation-settings: "wdth" 70;
}
.step::after {
  content: "";
  position: absolute;
  left: calc(1.375rem - 1px);
  top: 3.25rem; bottom: .5rem;
  width: 2px;
  background: linear-gradient(var(--tech), transparent);
  opacity: .5;
}
.step:last-child::after { display: none; }
.step:nth-child(even) .media { order: 2; }
.step-text h3 { margin-bottom: .5rem; }
.step-text p { color: var(--ink-soft); margin: 0; }

@media (max-width: 1100px) {
  .step { grid-template-columns: 1fr; align-items: start; }
  .step:nth-child(even) .media { order: 0; }
  .step-text { order: -1; padding-top: .35rem; }
}
@media (max-width: 520px) {
  .step { padding-left: 3.25rem; }
  .step::before { width: 2.25rem; height: 2.25rem; font-size: 1.1rem; }
  .step::after { left: calc(1.125rem - 1px); top: 2.75rem; }
}

/* Médias (vidéos et captures) */
.media {
  position: relative;
  margin: 0;
  aspect-ratio: 16 / 9;
  background: #0a1430;
  border-radius: var(--radius-m);
  overflow: hidden;
  border: 1px solid var(--line);
}
.media video, .media img {
  width: 100%; height: 100%;
  object-fit: contain;
}
.media-wide { border: 2px solid var(--tech); }

.media-toggle {
  position: absolute;
  right: .6rem; bottom: .6rem;
  display: grid;
  place-items: center;
  width: 2.4rem; height: 2.4rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(10, 20, 48, .7);
  color: #fff;
  cursor: pointer;
  opacity: .85;
}
.media-toggle:hover { opacity: 1; }
.media-toggle svg { width: 1.1rem; height: 1.1rem; }
.media-toggle .play { display: none; }
.media.is-paused .media-toggle .play { display: block; }
.media.is-paused .media-toggle .pause { display: none; }

/* Navigation entre tutoriels */
.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}
.pager a {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface);
  text-decoration: none;
}
.pager a:hover { border-color: var(--tech); color: inherit; }
.pager .dir { color: var(--ink-soft); font-size: .9rem; font-weight: 600; }
.pager .name {
  font-size: 1.5rem;
  font-weight: 900;
  font-style: italic;
  font-variation-settings: "wdth" 60;
  text-transform: uppercase;
  color: var(--tech);
}
.pager .next { grid-column: 2; text-align: right; }
@media (max-width: 520px) {
  .pager { grid-template-columns: 1fr; }
  .pager .next { grid-column: auto; }
}

/* =========================================================
   À propos / contact
   ========================================================= */
.page-hero {
  padding-block: clamp(2.5rem, 6vw, 4.5rem) 2rem;
  border-bottom: 1px solid var(--line);
}
.page-hero h1 {
  font-size: clamp(3rem, 2rem + 6vw, 6rem);
  font-weight: 900;
  font-style: italic;
  font-variation-settings: "wdth" 55;
  text-transform: uppercase;
  line-height: .9;
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}
.about-grid section + section { margin-top: 2.5rem; }
.about-grid h2 { font-size: 1.9rem; }
.about-grid p { color: var(--ink-soft); }
.about-grid a { color: var(--ink); font-weight: 600; }

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

.contact-card {
  padding: clamp(1.25rem, 4vw, 2rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 5px solid var(--flame);
  border-radius: var(--radius-m);
}
.contact-card h2 { font-size: 1.9rem; }
.contact-card > p { color: var(--ink-soft); }

.field { display: grid; gap: .35rem; margin-bottom: 1rem; }
.field label { font-weight: 700; }
.field input, .field textarea {
  width: 100%;
  padding: .75rem .9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
}
.field textarea { min-height: 9rem; resize: vertical; }
.field input:focus-visible, .field textarea:focus-visible { outline-offset: 0; }
.field .hint { font-size: .9rem; color: var(--ink-soft); }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: #d6293e; }

.form-status { margin: 1rem 0 0; font-weight: 600; min-height: 1.6em; }
.form-status.is-error { color: #d6293e; }
.form-status.is-ok { color: var(--ink); }

/* =========================================================
   Pied de page
   ========================================================= */
.site-footer {
  background: #0c1733;
  color: #c9d3ee;
  padding-block: 3rem 2rem;
}
:root[data-theme="dark"] .site-footer { background: #08112a; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .site-footer { background: #08112a; }
}
.site-footer a { color: #f3f6ff; text-decoration: none; }
.site-footer a:hover { color: #ffc23d; text-decoration: underline; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
}
.footer-brand { display: flex; gap: .9rem; align-items: center; }
.footer-brand img { height: 3.5rem; width: auto; }
.footer-brand strong {
  display: block;
  color: #fff;
  font-size: 1.3rem;
  font-variation-settings: "wdth" 70;
}
.footer-brand p { margin: 0; font-size: .95rem; }
.site-footer h2 {
  font-size: 1.05rem;
  color: #fff;
  margin-bottom: .75rem;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.copyright {
  margin: 2.5rem 0 0;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, .12);
  font-size: .9rem;
  max-width: none;
}
@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

/* ---------- Mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .hero video { display: none; }
}
