/* =====================================================================
   base.css — Fondations
   Variables, reset, typographie transversale, liens, boutons.
   Charger AVANT layout.css, sections.css, responsive.css.
   ===================================================================== */

:root {
  /* Couleurs de base */
  --ink:        #0B0B0C;   /* sections sombres */
  --paper:      #F4F1EA;   /* sections claires (blanc cassé chaud) */
  --ink-fg:     #EDEBE6;
  --ink-muted:  #8B8B86;
  --ink-rule:   rgba(255, 255, 255, 0.16);
  --paper-fg:   #17161A;
  --paper-muted:#5A5954;
  --paper-rule: rgba(0, 0, 0, 0.16);

  /* Accent — utilisé avec parcimonie (numéros de section, un lien) */
  --accent-on-paper: #4B3BFF;
  --accent-on-ink:   #8E82FF;

  /* Typographie */
  --font-body:    "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-hero:    "Unbounded", "Segoe UI", system-ui, sans-serif;

  /* Rythme */
  --shell: 1200px;
  --gutter: clamp(20px, 5vw, 64px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* --------------------------------------------------------------------- */
/* Reset                                                                 */
/* --------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--ink);
  color: var(--ink-fg);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; }
button, input, textarea { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent-on-paper);
  color: #fff;
  padding: 10px 16px;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* --------------------------------------------------------------------- */
/* Typographie transversale                                              */
/* --------------------------------------------------------------------- */
.section__index,
.path__label,
.stack__label,
.form label,
.case__meta {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 500;
}

.section__index { color: var(--muted); margin-bottom: 22px; }
.section__index span { color: var(--accent); margin-right: 4px; }

.section__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.section__title em { font-style: italic; }

.section__note { color: var(--muted); margin-top: 20px; max-width: 40ch; }

.section__head {
  border-bottom: 1px solid var(--rule);
  padding-bottom: 28px;
  margin-bottom: 56px;
}

/* --------------------------------------------------------------------- */
/* Liens et boutons                                                      */
/* --------------------------------------------------------------------- */

/* Lien texte avec flèche + soulignement animé */
.link-arrow {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5ch;
  font-weight: 500;
  padding-bottom: 3px;
  background: linear-gradient(currentColor, currentColor) left bottom / 0% 1px no-repeat;
  transition: background-size 0.35s var(--ease);
}
.link-arrow::after { content: "\2192"; transition: transform 0.35s var(--ease); }
.link-arrow:hover { background-size: 100% 1px; }
.link-arrow:hover::after { transform: translateX(4px); }

/* Bouton plein, rectangulaire, sans ombre */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 15px 30px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  border: 1px solid var(--btn-bg);
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
}
.btn:hover { background: transparent; color: var(--fg); border-color: currentColor; }
.btn--wide { align-self: flex-start; padding: 16px 44px; margin-top: 6px; }

/* Boutons « faisceau » du hero — pastille dont la bordure tourne au survol.
   Les deux variantes partagent la même mécanique et la même géométrie, mais
   restent volontairement distinctes : --solid porte l'action principale,
   --ghost reste en retrait. */
.btn-beam {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px;                 /* épaisseur de la bordure */
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  background: none;
  cursor: pointer;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.btn-beam:hover { transform: translateY(-2px); }

/* Faisceau conique, révélé au survol */
.btn-beam::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200%;                  /* carré : couvre le bouton à toutes les rotations */
  aspect-ratio: 1;
  translate: -50% -50%;
  background: conic-gradient(from 90deg at 50% 50%,
              transparent 0%, transparent 75%, var(--beam) 100%);
  opacity: 0;
  animation: btn-beam-spin 3s linear infinite;
  transition: opacity 0.3s var(--ease);
}
.btn-beam:hover::before { opacity: 1; }

/* Bordure fixe, hors survol */
.btn-beam::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--beam-rest);
  transition: opacity 0.3s var(--ease);
}
.btn-beam:hover::after { opacity: 0; }

.btn-beam__face {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.8ch;
  width: 100%;
  padding: 13px 28px;
  border-radius: inherit;
  background: var(--face);
  color: var(--face-fg);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  box-shadow: var(--face-inset);
  transition: color 0.3s var(--ease);
}
.btn-beam__face::after { content: "\2192"; transition: transform 0.35s var(--ease); }
.btn-beam:hover .btn-beam__face { color: var(--face-fg-hover); }
.btn-beam:hover .btn-beam__face::after { transform: translateX(3px); }

/* Principal : surface claire, faisceau accent */
.btn-beam--solid {
  --beam: var(--accent-on-ink);
  --beam-rest: rgba(255, 255, 255, 0.38);
  --face: linear-gradient(to bottom, #FFFFFF, var(--paper));
  --face-fg: var(--ink);
  --face-fg-hover: var(--ink);
  --face-inset: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.btn-beam--solid:hover { box-shadow: 0 0 25px rgba(142, 130, 255, 0.22); }
.btn-beam--solid .btn-beam__face::after { content: none; }  /* pas de flèche */

/* Secondaire : surface sombre, faisceau blanc, texte en retrait.
   Ici le faisceau tourne en permanence : c'est lui qui attire l'oeil sur ce
   bouton, la bordure fixe ne sert donc plus. */
.btn-beam--ghost {
  --beam: #FFFFFF;
  --beam-rest: rgba(255, 255, 255, 0.18);
  --face: linear-gradient(to bottom, #1B1B1F, #0B0B0C);
  --face-fg: var(--ink-muted);
  --face-fg-hover: var(--ink-fg);
  --face-inset: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.btn-beam--ghost::before { opacity: 1; }
.btn-beam--ghost::after { opacity: 0; }
.btn-beam--ghost:hover { box-shadow: 0 0 25px rgba(255, 255, 255, 0.10); }

@keyframes btn-beam-spin { to { transform: rotate(360deg); } }

/* --------------------------------------------------------------------- */
/* Apparition au scroll (discrète) — activée par js/reveal.js            */
/* --------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }
.approach__steps .reveal:nth-child(2) { transition-delay: 0.05s; }
.approach__steps .reveal:nth-child(3) { transition-delay: 0.1s; }
