/* ==========================================================================
   Rayonis — Design system CSS
   Base sur la charte de design system v1 (juillet 2026)
   ========================================================================== */

@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('../fonts/AtkinsonHyperlegibleNext-Variable.woff2') format('woff2-variations'),
       url('../fonts/AtkinsonHyperlegibleNext-Variable.woff2') format('woff2');
}

/* ---------------------------------------------------------------------- *
 * 1. Variables — couleurs (Radix Colors + valeurs Rayonis sur-mesure)
 * ---------------------------------------------------------------------- */
:root {
  /* Teal — accent officiel */
  --teal-1: #fafefd; --teal-2: #f3fbf9; --teal-3: #e0f8f3; --teal-4: #ccf3ea;
  --teal-5: #b8eae0; --teal-6: #a1ded2; --teal-7: #83cdc1; --teal-8: #53b9ab;
  --teal-9: #12a594; --teal-10: #0d9b8a; --teal-11: #008573; --teal-12: #0d3d38;

  /* Tomato (corail) — décoratif jeunes */
  --tomato-1: #fffcfc; --tomato-2: #fff8f7; --tomato-3: #feebe7; --tomato-4: #ffdcd3;
  --tomato-5: #ffcdc2; --tomato-6: #fdbdaf; --tomato-7: #f5a898; --tomato-8: #ec8e7b;
  --tomato-9: #e54d2e; --tomato-10: #dd4425; --tomato-11: #d13415; --tomato-12: #5c271f;

  /* Amber (ambre) — décoratif jeunes */
  --amber-1: #fefdfb; --amber-2: #fefbe9; --amber-3: #fff7c2; --amber-4: #ffee9c;
  --amber-5: #fbe577; --amber-6: #f3d673; --amber-7: #e9c162; --amber-8: #e2a336;
  --amber-9: #ffc53d; --amber-10: #ffba18; --amber-11: #ab6400; --amber-12: #4f3422;

  /* Red — réservé exclusivement aux erreurs */
  --red-1: #fffcfc; --red-2: #fff7f7; --red-3: #feebec; --red-4: #ffdbdc;
  --red-5: #ffcdce; --red-6: #fdbdbe; --red-7: #f4a9aa; --red-8: #eb8e90;
  --red-9: #e5484d; --red-10: #dc3e42; --red-11: #ce2c31; --red-12: #641723;

  /* Sage — gris neutre : structure, fonds, bordures (texte courant hors rampe, voir --text) */
  --sage-1: #fbfdfc; --sage-2: #f7f9f8; --sage-3: #eef1f0; --sage-4: #e6e9e8;
  --sage-5: #dfe2e0; --sage-6: #d7dad9; --sage-7: #cbcfcd; --sage-8: #b8bcba;
  --sage-9: #868e8b; --sage-10: #7c8481; --sage-11: #5f6563; --sage-12: #1a211e;

  /* Rayonis sur-mesure */
  --text: #444444;
  --white: #ffffff;

  /* Rayon (border-radius) — grandit avec le rôle */
  --radius-badge: 6px;
  --radius-control: 8px;
  --radius-card: 12px;

  /* Coin pixel à un seul palier de 8px (boutons) — même esprit que le coin
     pixel des cards (section 6 de la charte), mais un seul cran au lieu de 3 */
  --pixel-corner-8: polygon(
    0 8px, 8px 8px, 8px 0,
    calc(100% - 8px) 0, calc(100% - 8px) 8px, 100% 8px,
    100% calc(100% - 8px), calc(100% - 8px) calc(100% - 8px), calc(100% - 8px) 100%,
    8px 100%, 8px calc(100% - 8px), 0 calc(100% - 8px)
  );

  /* Typo */
  --font-sans: 'Atkinson Hyperlegible Next', system-ui, sans-serif;

  /* Mouvement — surchargé par prefers-reduced-motion plus bas */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --motion-fast: 150ms;
  --motion-medium: 220ms;
}

/* ---------------------------------------------------------------------- *
 * 2. Reset minimal + base
 * ---------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--white);
}

img { max-width: 100%; display: block; }
a { color: var(--teal-12); }
a:not([class]) { text-underline-offset: 0.15em; }

h1, h2, h3, h4 { font-weight: 700; line-height: 1.25; margin: 0 0 0.6em; color: var(--teal-12); }
h1 { font-weight: 800; font-size: clamp(1.9rem, 1.5rem + 2vw, 3rem); }
h2 { font-size: clamp(1.4rem, 1.2rem + 1vw, 2rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

.subtitle { font-weight: 500; }

/* Pas de texte en majuscules forcées ni tout en italique (section 2 de la charte) */
.eyebrow {
  font-weight: 700;
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
}

.container {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: 20px;
}

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

.skip-link {
  position: absolute;
  left: 20px;
  top: -60px;
  background: var(--teal-12);
  color: var(--white);
  padding: 10px 16px;
  border-radius: var(--radius-control);
  z-index: 100;
  transition: top var(--motion-fast) var(--ease);
}
.skip-link:focus { top: 20px; }

/* Focus clavier visible — jamais supprimé, sur aucun mode (section 4) */
:focus-visible {
  outline: 2px solid var(--teal-11);
  outline-offset: 2px;
  border-radius: 4px;
}

section { padding-block: 56px; }
section + section { border-top: 1px solid var(--sage-4); }

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

/* ---------------------------------------------------------------------- *
 * 3. En-tête / navigation
 * ---------------------------------------------------------------------- */
.site-header {
  border-bottom: 1px solid var(--sage-4);
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(6px);
  z-index: 50;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-block: 14px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  white-space: nowrap;
}
.wordmark:focus-visible { outline-offset: 4px; }
.wordmark__logo {
  height: 4em;
  width: auto;
  display: block;
}

.main-nav__list {
  list-style: none;
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
}

.main-nav__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 14px;
  border-radius: var(--radius-control);
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  font-size: 0.9375rem;
  transition: background var(--motion-fast) var(--ease), color var(--motion-fast) var(--ease);
}
.main-nav__link:hover { background: var(--sage-2); color: var(--teal-12); }
.main-nav__link[aria-current="page"] {
  color: var(--teal-12);
  background: var(--teal-2);
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1.5px solid var(--sage-9);
  border-radius: var(--radius-control);
  background: var(--white);
}

@media (max-width: 768px) {
  .nav-toggle { display: inline-flex; }
  .main-nav { position: relative; }
  .main-nav__list {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    flex-direction: column;
    background: var(--white);
    border: 1px solid var(--sage-4);
    border-radius: var(--radius-card);
    padding: 8px;
    box-shadow: 0 8px 24px rgba(26, 33, 30, 0.12);
    min-width: 200px;
  }
  .main-nav__list.is-open { display: flex; }
  .main-nav__link { width: 100%; }
}

/* ---------------------------------------------------------------------- *
 * 4. Pied de page
 * ---------------------------------------------------------------------- */
.site-footer {
  background: var(--sage-1);
  border-top: 1px solid var(--sage-4);
  padding-block: 40px;
}
.site-footer__inner {
  display: grid;
  gap: 32px;
  grid-template-columns: 1.2fr 1fr 1fr;
}
@media (max-width: 768px) {
  .site-footer__inner { grid-template-columns: 1fr; }
}
.site-footer h2 { font-size: 1rem; color: var(--text); margin-bottom: 0.75em; }
.site-footer p, .site-footer a { font-size: 0.9375rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.site-footer a { color: var(--text); text-decoration: underline; text-underline-offset: 0.15em; }
.site-footer a:hover { color: var(--teal-12); }
.site-footer__bottom {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--sage-4);
  font-size: 0.8125rem;
  color: var(--sage-11);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: space-between;
}
.site-footer__bottom a { color: var(--sage-11); }

/* ---------------------------------------------------------------------- *
 * 5. Bouton (section 6 de la charte)
 * ---------------------------------------------------------------------- */
.btn {
  --btn-bg: var(--teal-12);
  --btn-fg: var(--white);
  --btn-border: transparent;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  min-width: 44px;
  padding-inline: 20px;
  border-radius: 0;
  clip-path: var(--pixel-corner-8);
  border: 1.5px solid var(--btn-border);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--motion-fast) var(--ease), transform var(--motion-fast) var(--ease), color var(--motion-fast) var(--ease), border-color var(--motion-fast) var(--ease);
}
.btn:hover { background: var(--teal-11); }
.btn:active { transform: scale(0.98); }

/*
 * Variante contour : le coin pixel établit son propre contexte d'empilement
 * (comme pour .card--pixel), donc un `border` classique se ferait couper net
 * aux crans plutôt que de les suivre. Même parade que pour les cards : le
 * bouton porte la couleur de bordure en fond, et un ::before blanc, inset de
 * l'épaisseur de la bordure et en z-index négatif, vient recouvrir
 * l'intérieur — juste en dessous du texte.
 */
.btn--outline {
  --btn-fg: var(--teal-12);
  border: none;
  background: var(--teal-12);
}
.btn--outline::before {
  content: '';
  position: absolute;
  inset: 1.5px;
  background: var(--white);
  z-index: -1;
  clip-path: var(--pixel-corner-8);
  transition: background var(--motion-fast) var(--ease);
}
.btn--outline:hover::before { background: var(--teal-2); }

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--teal-12);
  --btn-border: transparent;
  padding-inline: 12px;
}
.btn--ghost:hover { background: var(--sage-2); }

.btn--block { width: 100%; }

/* ---------------------------------------------------------------------- *
 * 6. Badge (section 6)
 * ---------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding-inline: 10px;
  border-radius: var(--radius-badge);
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}
.badge--teal   { background: var(--teal-2);   color: var(--teal-12); }
.badge--tomato { background: var(--tomato-2); color: var(--tomato-12); }
.badge--amber  { background: var(--amber-2);  color: var(--amber-12); }
.badge--sage   { background: var(--sage-2);   color: var(--text); }

/* ---------------------------------------------------------------------- *
 * 7. Card (section 6) — variante "coin pixel" réservée aux cards
 * ---------------------------------------------------------------------- */
.card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  border-radius: var(--radius-card);
  border: 1px solid var(--sage-7);
  background: var(--white);
}
.card h3 { font-size: 1rem; font-weight: 700; margin: 0; }
.card p { font-size: 0.9375rem; }
.card .badge { align-self: flex-start; }
.card .btn { align-self: flex-start; margin-top: 6px; }

.card--square { border-radius: 0; }

/*
 * Coin pixel : clip-path établit son propre contexte d'empilement (comme un
 * transform/filter). Dans ce contexte, le fond de .card--pixel occupe
 * toujours la couche la plus basse — un ::before en z-index négatif se
 * peindrait donc AU-DESSUS de ce fond, pas en dessous. On inverse alors la
 * logique : .card--pixel porte la couleur de "bordure" (sage-7) en fond,
 * et un ::before blanc, légèrement plus petit (inset positif) et en
 * z-index négatif, vient recouvrir l'intérieur — juste en dessous du
 * contenu (badge/titre/texte), qui reste en flux normal au-dessus.
 */
.card--pixel {
  position: relative;
  border: none;
  border-radius: 0;
  background: var(--sage-7);
  clip-path: polygon(
    0 24px, 8px 24px, 8px 16px, 16px 16px, 16px 8px, 24px 8px, 24px 0,
    calc(100% - 24px) 0, calc(100% - 24px) 8px, calc(100% - 16px) 8px, calc(100% - 16px) 16px, calc(100% - 8px) 16px, calc(100% - 8px) 24px, 100% 24px,
    100% calc(100% - 24px), calc(100% - 8px) calc(100% - 24px), calc(100% - 8px) calc(100% - 16px), calc(100% - 16px) calc(100% - 16px), calc(100% - 16px) calc(100% - 8px), calc(100% - 24px) calc(100% - 8px), calc(100% - 24px) 100%,
    24px 100%, 24px calc(100% - 8px), 16px calc(100% - 8px), 16px calc(100% - 16px), 8px calc(100% - 16px), 8px calc(100% - 24px), 0 calc(100% - 24px)
  );
}
.card--pixel::before {
  content: '';
  position: absolute;
  inset: 1px;
  background: var(--white);
  z-index: -1;
  clip-path: polygon(
    0 24px, 8px 24px, 8px 16px, 16px 16px, 16px 8px, 24px 8px, 24px 0,
    calc(100% - 24px) 0, calc(100% - 24px) 8px, calc(100% - 16px) 8px, calc(100% - 16px) 16px, calc(100% - 8px) 16px, calc(100% - 8px) 24px, 100% 24px,
    100% calc(100% - 24px), calc(100% - 8px) calc(100% - 24px), calc(100% - 8px) calc(100% - 16px), calc(100% - 16px) calc(100% - 16px), calc(100% - 16px) calc(100% - 8px), calc(100% - 24px) calc(100% - 8px), calc(100% - 24px) 100%,
    24px 100%, 24px calc(100% - 8px), 16px calc(100% - 8px), 16px calc(100% - 16px), 8px calc(100% - 16px), 8px calc(100% - 24px), 0 calc(100% - 24px)
  );
}

a.card {
  text-decoration: none;
  color: inherit;
  transition: border-color var(--motion-fast) var(--ease);
}
a.card:hover { border-color: var(--sage-9); }
a.card.card--pixel:hover { background: var(--sage-9); }

.card-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

/* ---------------------------------------------------------------------- *
 * 8. Formulaires (section 6)
 * ---------------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px; }
.field label { font-size: 0.875rem; font-weight: 500; color: var(--text); }
.field .hint { font-size: 0.8125rem; color: var(--sage-11); }

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field select,
.field textarea {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  color: var(--text);
  height: 44px;
  padding-inline: 12px;
  border-radius: 0;
  border: 1px solid var(--sage-9);
  background: var(--white);
}
.field textarea { height: auto; min-height: 96px; padding-block: 12px; resize: none; }

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: none;
  border: 2px solid var(--teal-12);
  box-shadow: 0 0 0 2px var(--white), 0 0 0 4px var(--teal-11);
}

.field.has-error input,
.field.has-error select,
.field.has-error textarea {
  border: 2px solid var(--red-9);
}
.field .error-message {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  color: var(--red-12);
  font-size: 0.8125rem;
}
.field .error-message::before {
  content: '⚠';
  flex: none;
}

.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 44px;
  padding-block: 10px;
}
.checkbox-field input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  flex: none;
  accent-color: var(--teal-12);
  border: 1.5px solid var(--sage-9);
}
.checkbox-field label { font-size: 0.9375rem; }

.form-status {
  border-radius: var(--radius-control);
  padding: 14px 16px;
  margin-bottom: 20px;
  font-size: 0.9375rem;
}
.form-status--success { background: var(--teal-2); color: var(--teal-12); }
.form-status--error { background: var(--red-2); color: var(--red-12); }

/* Honeypot anti-spam — masqué visuellement et des lecteurs d'écran */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------------------------------------------------------------------- *
 * 9. Hero / sections spécifiques
 * ---------------------------------------------------------------------- */
.hero {
  padding-block: 64px;
}
.hero__inner {
  display: grid;
  gap: 40px;
  align-items: center;
}
.hero .eyebrow { color: var(--teal-11); display: block; margin-bottom: 10px; }
.hero p.lead { font-size: 1.125rem; }

.audience-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(2, 1fr);
  margin-top: 40px;
}
@media (max-width: 720px) {
  .audience-grid { grid-template-columns: 1fr; }
}
.audience-card {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.audience-card h2 { margin: 0; font-size: 1.375rem; }
.audience-card .btn { margin-top: 8px; align-self: flex-start; }

.contact-strip {
  background: var(--teal-2);
}
.contact-strip .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.offer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 0.875rem;
  color: var(--sage-11);
}
.offer-meta strong { color: var(--text); font-weight: 500; }

.offer-price {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--teal-12);
}

.list-check { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.list-check li { padding-left: 26px; position: relative; }
.list-check li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--teal-11);
  font-weight: 700;
}

.soon-card {
  border-style: dashed;
  color: var(--sage-11);
}

.two-col {
  display: grid;
  gap: 48px;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: start;
}
@media (max-width: 860px) {
  .two-col { grid-template-columns: 1fr; }
}

.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 16px;
}
.stat-row .stat { min-width: 140px; }
.stat strong { display: block; font-size: 1.5rem; color: var(--teal-12); }
.stat span { font-size: 0.875rem; color: var(--sage-11); }

/* ---------------------------------------------------------------------- *
 * 10. Mode entreprise — un seul accent, énergie quasi imperceptible
 * ---------------------------------------------------------------------- */
body[data-mode="entreprise"] .btn {
  --btn-fg: var(--teal-12);
  border: none;
  background: var(--teal-12);
}
body[data-mode="entreprise"] .btn::before {
  content: '';
  position: absolute;
  inset: 1.5px;
  background: var(--white);
  z-index: -1;
  clip-path: var(--pixel-corner-8);
  transition: background var(--motion-fast) var(--ease);
}
body[data-mode="entreprise"] .btn:hover::before { background: var(--teal-2); }
body[data-mode="entreprise"] .btn:active { transform: none; }
body[data-mode="entreprise"] a.card:hover { border-color: var(--sage-8); }
body[data-mode="entreprise"] .card--pixel { clip-path: none; border-radius: var(--radius-card); border: 1px solid var(--sage-7); background: var(--white); }
body[data-mode="entreprise"] .card--pixel::before { display: none; }
body[data-mode="entreprise"] a.card.card--pixel:hover { background: var(--white); border-color: var(--sage-8); }
