/* ==========================================================================
   base · reset, typo, gabarit d'écran, barre haute, boutons
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--fs-base);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, figure, fieldset, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
fieldset { border: 0; padding: 0; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
a:hover { color: var(--action); }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--r-sm); }
[hidden] { display: none !important; }

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

/* ---------- typo ---------- */

.wordmark {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -.03em;
  line-height: 1;
}
.wordmark i, .thin {
  font-family: var(--font-thin);
  font-weight: 100;
  font-style: italic;
  letter-spacing: -.02em;
}
.title-hero { font-size: var(--fs-hero); line-height: .98; }
.title-xl   { font-size: 56px; }
.title-l    { font-size: 40px; }
.title-m    { font-size: var(--fs-h1); }

.h2 { font-family: var(--font-display); font-weight: 400; font-size: var(--fs-h2); line-height: 1.15; letter-spacing: var(--ls-tight); }
.h3 { font-family: var(--font-display); font-weight: 500; font-size: var(--fs-h3); line-height: 1.2; letter-spacing: -.01em; }
.eyebrow {
  font-size: var(--fs-xs); font-weight: 500; letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase; color: var(--ink-muted);
}
.muted { color: var(--ink-muted); }
.small { font-size: var(--fs-sm); }
.num { font-family: var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: -.04em; line-height: 1; }

/* ---------- gabarit ---------- */

/* plein écran : cadre rouge-orangé · intégré au BO : <body class="is-embedded"> */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  border: var(--frame);
}
.is-embedded .app { border: 0; min-height: 0; }
.is-embedded .topbar__brand, .is-embedded .topbar__logo { display: none; }

.main { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 var(--s-9); }
.split { flex: 1; display: flex; flex-wrap: wrap; min-height: 0; }
.split__main { flex: 999 1 640px; min-width: 0; }
.split__side { flex: 1 1 var(--rail-w); min-width: 0; }

.rule { border-top: 1px solid var(--line-strong); }
.rule-light { border-top: 1px solid var(--line); }

/* ---------- barre haute ---------- */

.topbar {
  display: flex; align-items: center; gap: 28px;
  min-height: var(--topbar-h);
  padding: 14px var(--gutter);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.topbar__brand { font-size: 28px; text-decoration: none; }
.topbar__brand:hover { color: inherit; }
.topbar__end { margin-left: auto; display: flex; gap: var(--s-4); align-items: center; }
.topbar__logo { width: 34px; height: 34px; flex: none; }

.steps { display: flex; gap: var(--s-1); flex-wrap: wrap; }
.steps a {
  display: inline-flex; gap: 6px; align-items: baseline;
  padding: 6px 12px; border-radius: var(--r-pill);
  font-size: var(--fs-sm); color: var(--ink-soft); text-decoration: none;
}
.steps a b { font-weight: 500; font-size: var(--fs-xs); letter-spacing: .06em; }
.steps a[aria-current="step"] { background: var(--ink); color: var(--paper); }
.steps a.is-done { color: var(--ink); }

.footer {
  display: flex; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap;
  padding: 14px var(--gutter);
  border-top: 1px solid var(--line);
  font-size: 12px; color: var(--ink-muted);
}

/* ---------- boutons ---------- */

.btn {
  appearance: none; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 48px; padding: 0 24px; border-radius: var(--r-pill);
  font-family: var(--font-display); font-weight: 500; font-size: var(--fs-md); line-height: 1;
  white-space: nowrap; text-decoration: none;
  background: var(--action); color: var(--paper);
  transition: background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.btn:hover { background: var(--action-dark); color: var(--paper); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .35; pointer-events: none; }
.btn--lg { height: 60px; padding: 0 32px; font-size: 19px; }
.btn--xl { height: 72px; padding: 0 36px; font-size: 22px; }
.btn--sm { height: 36px; padding: 0 16px; font-size: 14px; }
.btn--dark { background: var(--ink); }
.btn--dark:hover { background: var(--ink-2); }
.btn--outline { background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn--outline:hover { background: var(--grey); color: var(--ink); }
.btn--outline[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.btn--ghost {
  background: transparent; color: var(--ink); padding: 0 4px; font-weight: 400;
  text-decoration: underline; text-underline-offset: 4px;
}
.btn--ghost:hover { background: transparent; color: var(--action); }
.btn--block { width: 100%; }

.kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 5px;
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  background: var(--paper); color: var(--ink-muted);
  font: 500 11px/1 var(--font-text);
}
.shortcuts { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-muted); }
.shortcuts span { display: inline-flex; gap: 5px; align-items: center; }

/* bascule (grille / frise) */
.seg { display: inline-flex; padding: 3px; border-radius: var(--r-pill); box-shadow: inset 0 0 0 1.5px var(--ink); }
.seg button {
  appearance: none; border: 0; background: none; cursor: pointer;
  padding: 7px 16px; border-radius: var(--r-pill); font-size: 14px;
}
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* ---------- mouvement ---------- */

@keyframes rise   { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes stamp  { 0% { transform: scale(1.35) rotate(-6deg); opacity: 0; } 60% { transform: scale(.96) rotate(1deg); opacity: 1; } 100% { transform: none; } }
@keyframes snap   { 0% { transform: translate(-14px, -18px) rotate(-5deg); } 70% { transform: translate(1px, 2px) rotate(1deg); } 100% { transform: none; } }
@keyframes pulse  { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes spin   { to { transform: rotate(360deg); } }

.a-rise  { animation: rise var(--dur) var(--ease) both; }
.a-stamp { animation: stamp 320ms var(--ease-pop) both; }
.a-snap  { animation: snap 360ms var(--ease-pop) both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}

/* ---------- toast ---------- */

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  display: flex; gap: 14px; align-items: center;
  padding: 10px 12px 10px 20px; border-radius: var(--r-pill);
  background: var(--ink); color: var(--paper); font-size: 14px; white-space: nowrap;
  z-index: 50; animation: rise var(--dur) var(--ease) both;
}
.toast .btn { height: 30px; background: var(--paper); color: var(--ink); }
.toast .kbd { height: 18px; margin-left: 4px; }

/* ---------- tablette (bonus) ---------- */
@media (max-width: 1100px) {
  :root { --gutter: 20px; --fs-hero: 56px; }
  .topbar { gap: 14px; }
}
