/* ==========================================================================
   SANBO — feuille de style
   Structure : 1) Design tokens  2) Reset  3) Primitives  4) Layout global
               5) Header/Nav  6) Sections  7) Composants  8) Footer
               9) Responsive
   ========================================================================== */

/* -------------------- 1. Design tokens (palette + échelles) -------------------- */
:root {
  color-scheme: light;

  /* Palette — 6 teintes issues du logo Sanbō (cercle bordeaux, pétales
     lavande / rouge / vert) + 2 neutres. Toujours utilisées via rgba()
     pour pouvoir doser la transparence plutôt que multiplier les teintes. */
  --c-bg: 32 22% 97%;          /* fond crème */
  --c-ink: 15 30% 12%;         /* texte principal, brun très foncé */
  --c-burgundy: 351 69% 25%;   /* couleur de marque principale (cercle/logotype) */
  --c-lavender: 253 58% 71%;   /* pétale violet — secondaire, sections douces */
  --c-terracotta: 5 65% 46%;   /* pétale rouge — accent chaud, CTA */
  --c-forest: 130 55% 27%;     /* pétale vert — accent, liens/validations */

  --color-bg: hsl(var(--c-bg));
  --color-bg-alt: hsl(32 30% 93%);
  --color-ink: hsl(var(--c-ink));
  --color-burgundy: hsl(var(--c-burgundy));
  --color-lavender: hsl(var(--c-lavender));
  --color-terracotta: hsl(var(--c-terracotta));
  --color-forest: hsl(var(--c-forest));

  /* Fonctions de transparence prêtes à l'emploi (fond, bordures, ombres) */
  --burgundy-08: hsl(var(--c-burgundy) / 0.08);
  --burgundy-15: hsl(var(--c-burgundy) / 0.15);
  --burgundy-30: hsl(var(--c-burgundy) / 0.3);
  --burgundy-85: hsl(var(--c-burgundy) / 0.85);
  --lavender-15: hsl(var(--c-lavender) / 0.15);
  --lavender-30: hsl(var(--c-lavender) / 0.3);
  --terracotta-12: hsl(var(--c-terracotta) / 0.12);
  --terracotta-90: hsl(var(--c-terracotta) / 0.9);
  --forest-12: hsl(var(--c-forest) / 0.12);
  --ink-06: hsl(var(--c-ink) / 0.06);
  --ink-45: hsl(var(--c-ink) / 0.45);

  /* Typographie */
  --font-heading: "Iowan Old Style", "Palatino Linotype", Georgia, "Noto Serif", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Échelle d'espacement */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6rem;

  /* Layout */
  --content-max: 1080px;
  --content-narrow: 760px;
  --radius: 14px;
  --header-h: 72px;
}

/* -------------------- 2. Reset -------------------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-ink);
  background: var(--color-bg);
  line-height: 1.6;
  font-size: 1rem;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: 1.2;
  margin: 0 0 var(--space-2);
  font-weight: 600;
}

p { margin: 0 0 var(--space-2); }

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

/* Toute section ciblée par une ancre garde son titre visible sous le header
   fixe : c'est le point-clé demandé pour un scroll bien ajusté. */
section[id] {
  scroll-margin-top: calc(var(--header-h) + var(--space-2));
}

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

/* -------------------- 3. Primitives -------------------- */
.container {
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--space-3);
}

.container--narrow {
  max-width: var(--content-narrow);
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-burgundy);
  background: var(--burgundy-08);
  padding: 0.3em 0.9em;
  border-radius: 999px;
  margin-bottom: var(--space-2);
}

.section-title {
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem);
  color: var(--color-burgundy);
}

.section-lead {
  max-width: 62ch;
  color: hsl(var(--c-ink) / 0.75);
  font-size: 1.05rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  padding: 0.85em 1.6em;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible { outline: 3px solid var(--lavender-30); outline-offset: 2px; }

.btn--primary {
  background: var(--color-burgundy);
  color: white;
  box-shadow: 0 8px 20px -8px var(--burgundy-30);
}
.btn--primary:hover { background: hsl(var(--c-burgundy) / 0.92); }

.btn--ghost {
  background: hsl(0 0% 100% / 0.5);
  border-color: var(--burgundy-30);
  color: var(--color-burgundy);
}
.btn--ghost:hover { background: var(--burgundy-08); }

.tag-todo {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  color: hsl(35 90% 30%);
  background: hsl(45 95% 55% / 0.25);
  border: 1px dashed hsl(35 90% 40% / 0.6);
  padding: 0.15em 0.6em;
  border-radius: 6px;
  margin-left: 0.4em;
}

/* -------------------- 4. Layout global -------------------- */
main { display: block; }

.section {
  padding-block: var(--space-6);
  border-bottom: 1px solid var(--ink-06);
}

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

.section--tint-lavender {
  background: linear-gradient(180deg, var(--lavender-15), transparent 65%);
}

/* Garantit assez d'espace sous la dernière section pour qu'elle puisse
   défiler entièrement sous le header sticky (sinon la fin de page bloque
   le scroll avant que le titre ciblé ne passe sous le header). */
.section:last-of-type {
  min-height: calc(100vh - var(--header-h) + 1px);
}

.section-head {
  margin-bottom: var(--space-4);
}

/* -------------------- 5. Header / Nav -------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: hsl(32 22% 97% / 0.85);
  backdrop-filter: blur(10px) saturate(1.1);
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
  border-bottom: 1px solid var(--burgundy-15);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6em;
  text-decoration: none;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--color-burgundy);
}

.brand img {
  height: 38px;
  width: auto;
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.nav__list {
  display: flex;
  gap: 0.2rem;
}

.nav__link {
  display: inline-block;
  padding: 0.55em 0.9em;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  color: hsl(var(--c-ink) / 0.8);
  transition: background 0.15s ease, color 0.15s ease;
}

.nav__link:hover,
.nav__link:focus-visible {
  background: var(--burgundy-08);
  color: var(--color-burgundy);
}

.nav__link.is-active {
  background: var(--burgundy-15);
  color: var(--color-burgundy);
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--burgundy-30);
  background: transparent;
  cursor: pointer;
}

.nav-toggle__bar,
.nav-toggle__bar::before,
.nav-toggle__bar::after {
  content: "";
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-burgundy);
  position: relative;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle__bar::before { position: absolute; top: -6px; }
.nav-toggle__bar::after { position: absolute; top: 6px; }

.nav-toggle[aria-expanded="true"] .nav-toggle__bar {
  background: transparent;
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar::before {
  transform: translateY(6px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar::after {
  transform: translateY(-6px) rotate(-45deg);
}

/* -------------------- 6. Hero -------------------- */
.hero {
  padding-block: var(--space-6) var(--space-5);
  background:
    radial-gradient(60% 55% at 85% 0%, var(--lavender-15), transparent 70%),
    radial-gradient(50% 45% at 10% 100%, var(--terracotta-12), transparent 70%);
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: var(--space-5);
  align-items: center;
}

.hero__logo {
  width: min(340px, 100%);
  margin-inline: auto;
}

.hero h1 {
  font-size: clamp(2.1rem, 1.6rem + 2.2vw, 3.4rem);
  color: var(--color-burgundy);
}

.hero__subtitle {
  font-family: var(--font-heading);
  font-style: italic;
  color: hsl(var(--c-ink) / 0.7);
  font-size: 1.15rem;
  margin-bottom: var(--space-3);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

/* -------------------- 7. Composants -------------------- */

/* Cartes "approches" */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: var(--space-3);
}

.card {
  background: white;
  border: 1px solid var(--ink-06);
  border-radius: var(--radius);
  padding: var(--space-3);
  box-shadow: 0 12px 30px -20px hsl(var(--c-ink) / 0.35);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 34px -18px hsl(var(--c-ink) / 0.3);
}

.card__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: var(--space-2);
}
.card:nth-of-type(4n+1) .card__icon { background: var(--burgundy-15); }
.card:nth-of-type(4n+2) .card__icon { background: var(--lavender-30); }
.card:nth-of-type(4n+3) .card__icon { background: var(--terracotta-12); }
.card:nth-of-type(4n+4) .card__icon { background: var(--forest-12); }

.card h3 {
  font-size: 1.1rem;
  color: var(--color-ink);
}

.card p {
  font-size: 0.95rem;
  color: hsl(var(--c-ink) / 0.75);
  margin-bottom: 0;
}

/* Liste d'objectifs */
.goal-list {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.goal-item {
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
  background: white;
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--ink-06);
}

.goal-item__mark {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--burgundy-15);
  color: var(--color-burgundy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-family: var(--font-heading);
}

.note {
  margin-top: var(--space-3);
  font-size: 0.9rem;
  color: hsl(var(--c-ink) / 0.65);
  border-left: 3px solid var(--lavender-30);
  padding-left: var(--space-2);
}

/* Origine du nom */
.origin {
  display: grid;
  grid-template-columns: minmax(0, 0.4fr) minmax(0, 0.6fr);
  gap: var(--space-4);
  align-items: center;
  background: white;
  border-radius: var(--radius);
  padding: var(--space-4);
  border: 1px solid var(--ink-06);
}

.origin__glyph {
  font-family: var(--font-heading);
  font-size: 4.5rem;
  text-align: center;
  color: var(--color-burgundy);
  line-height: 1;
}
.origin__glyph small {
  display: block;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  color: hsl(var(--c-ink) / 0.6);
  margin-top: var(--space-1);
}

/* Frise historique */
.timeline {
  display: grid;
  gap: 0;
  border-left: 2px solid var(--burgundy-30);
  margin-top: var(--space-4);
  padding-left: var(--space-4);
}

.timeline__item {
  position: relative;
  padding-bottom: var(--space-4);
}
.timeline__item:last-child { padding-bottom: 0; }

.timeline__item::before {
  content: "";
  position: absolute;
  left: calc(-1 * var(--space-4) - 6px);
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-burgundy);
  box-shadow: 0 0 0 4px var(--burgundy-08);
}

.timeline__date {
  display: inline-block;
  font-weight: 700;
  color: var(--color-burgundy);
  margin-bottom: 0.2em;
}

.timeline__item p { color: hsl(var(--c-ink) / 0.8); }

/* Infos pratiques */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-3);
}

.info-card {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--ink-06);
  padding: var(--space-3);
}

.info-card h3 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-burgundy);
  font-family: var(--font-body);
  font-weight: 700;
}

.info-card dl {
  margin: 0;
  display: grid;
  gap: 0.6em;
}
.info-card dt {
  font-size: 0.8rem;
  color: hsl(var(--c-ink) / 0.55);
}
.info-card dd {
  margin: 0;
  font-weight: 600;
}

/* Liens externes */
.link-list {
  display: grid;
  gap: var(--space-2);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.link-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  background: white;
  border: 1px solid var(--ink-06);
  border-radius: var(--radius);
  padding: var(--space-3);
  text-decoration: none;
  color: var(--color-ink);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.link-card:hover {
  border-color: var(--burgundy-30);
  transform: translateY(-2px);
}
.link-card__logo {
  flex: none;
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 8px;
  background: white;
}
.link-card__arrow {
  color: var(--color-burgundy);
  font-size: 1.2rem;
}

/* Contact */
.contact-box {
  background: linear-gradient(135deg, var(--burgundy-85), hsl(var(--c-burgundy) / 0.7));
  color: white;
  border-radius: var(--radius);
  padding: var(--space-4);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
  justify-content: space-between;
}
.contact-box a.btn--primary {
  background: white;
  color: var(--color-burgundy);
}
.contact-box .tag-todo {
  background: hsl(45 95% 65% / 0.9);
}

/* Lien discret style texte (déclenche la modale d'information) */
.link-inline {
  display: inline-block;
  margin-top: var(--space-2);
  padding: 0;
  border: none;
  background: none;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-burgundy);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.link-inline:hover { color: hsl(var(--c-burgundy) / 0.8); }
.link-inline--footer {
  color: hsl(32 60% 85%);
  font-weight: 500;
  margin-top: 0;
}

/* Modale d'information sur les pratiques corporelles */
dialog.modal {
  border: none;
  padding: 0;
  border-radius: var(--radius);
  max-width: 580px;
  width: calc(100% - var(--space-4));
  max-height: min(80vh, 700px);
  background: var(--color-bg);
  color: var(--color-ink);
  box-shadow: 0 30px 70px -20px hsl(var(--c-ink) / 0.5);
  overflow-y: auto;
}
dialog.modal::backdrop {
  background: hsl(var(--c-ink) / 0.55);
  backdrop-filter: blur(2px);
}
.modal__box {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4);
}
.modal__title {
  color: var(--color-burgundy);
  font-size: 1.35rem;
  margin-bottom: 0;
}
.modal__list {
  margin: 0;
  padding-left: 1.2em;
  list-style: disc;
  display: grid;
  gap: 0.5em;
  color: hsl(var(--c-ink) / 0.85);
}
.modal__note {
  font-size: 0.85rem;
  color: hsl(var(--c-ink) / 0.6);
  border-left: 3px solid var(--lavender-30);
  padding-left: var(--space-2);
  margin: 0;
}
.modal__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--space-1);
}

/* -------------------- 8. Footer -------------------- */
.site-footer {
  padding-block: var(--space-4);
  background: var(--color-ink);
  color: hsl(32 22% 92% / 0.85);
  font-size: 0.9rem;
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: space-between;
  align-items: center;
}

.site-footer a { color: hsl(32 60% 85%); text-decoration: underline; }

/* -------------------- 9. Responsive -------------------- */
@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; text-align: center; }
  .hero__actions { justify-content: center; }
  .hero__logo { order: -1; width: min(220px, 60%); }
  .origin { grid-template-columns: 1fr; text-align: center; }
}

@media (max-width: 760px) {
  :root { --header-h: 64px; }

  .nav-toggle { display: inline-flex; }

  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--color-bg);
    border-bottom: 1px solid var(--burgundy-15);
    box-shadow: 0 16px 30px -20px hsl(var(--c-ink) / 0.4);
    padding: var(--space-2) var(--space-3) var(--space-3);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.18s ease, opacity 0.18s ease;
  }

  .nav.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav__list {
    flex-direction: column;
    gap: 0.15rem;
  }

  .nav__link { display: block; padding: 0.8em 1em; }

  .brand span { font-size: 1.05rem; }

  .section { padding-block: var(--space-5); }

  .contact-box { flex-direction: column; align-items: flex-start; text-align: left; }
}

@media (max-width: 480px) {
  .container { padding-inline: var(--space-2); }
}
