:root {
  color-scheme: light;
  /* Palette principale Mathéria */
  --prune: #57405d;
  --lavande: #b8a7e8;
  --sauge: #a8c9b0;
  --peche: #f6b89e;
  --creme: #fff8ef;

  /* Palette complémentaire */
  --rose-poudre: #fadde1;
  --lilas: #d7c7f3;
  --menthe: #bfdcc9;
  --peche-clair: #fdd7c7;
  --gris-mauve: #e9e1eb;

  /* Utilitaires */
  --text: #32263a;
  --text-soft: #665b6b;
  --surface: #ffffff;
  --page: #fffdfb;
  --header: rgba(255, 253, 251, 0.92);
  --activity-tint: rgba(255, 248, 239, 0.55);
  --button-text: #ffffff;
  --button-hover: #fdd7c7;
  --border: rgba(87, 64, 93, 0.12);
  --shadow: 0 18px 40px rgba(87, 64, 93, 0.08);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 999px;
  --container: 1120px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --prune: #d7c7f3;
  --creme: #302738;
  --text: #f5effa;
  --text-soft: #c7bdce;
  --surface: #241e2c;
  --page: #18141f;
  --header: #201a28;
  --activity-tint: rgba(48, 39, 56, 0.55);
  --button-text: #241e2c;
  --button-hover: #453650;
  --border: rgba(215, 199, 243, 0.2);
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.2);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--page);
  color: var(--text);
  font-family: "Quicksand", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  transform: translateY(-160%);
  padding: 0.8rem 1rem;
  border-radius: 12px;
  background: var(--prune);
  color: var(--button-text);
  font-weight: 700;
}

.skip-link:focus {
  transform: translateY(0);
}

.container {
  width: min(calc(100% - 2rem), var(--container));
  margin-inline: auto;
}

.site-header {
  background: var(--header);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  width: auto;
  margin-left: max(1rem, calc((100% - var(--container)) / 2));
  margin-right: 1rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 80px;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand-logo {
  width: 170px;
}

.header-menu {
  display: flex;
  justify-content: center;
  gap: clamp(0.5rem, 3vw, 2.5rem);
}

.header-menu a,
.level-menu summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.35rem 0.5rem;
  margin: 0;
  color: var(--prune);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.header-menu a:hover {
  text-decoration: underline;
}

.level-menu {
  position: relative;
}

.level-menu summary {
  display: flex;
  gap: 0.5rem;
  list-style: none;
  cursor: pointer;
}

.level-menu summary::-webkit-details-marker {
  display: none;
}

.level-menu summary svg {
  width: 18px;
  height: 18px;
  margin-left: auto;
}

.level-menu[open] summary svg {
  transform: rotate(180deg);
}

.level-menu summary:hover {
  color: var(--text-soft);
}

.level-menu-links {
  position: absolute;
  z-index: 20;
  top: 100%;
  right: 0;
  min-width: 100%;
  margin: 0.5rem 0 0;
  padding: 0.5rem;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.level-menu-links a {
  display: flex;
  padding-inline: 0.75rem;
  border-radius: 8px;
}

.level-menu-links a:hover {
  background: var(--creme);
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--creme);
  color: var(--prune);
  cursor: pointer;
}

.menu-toggle:hover {
  background: var(--button-hover);
}

.menu-icon {
  width: 22px;
  height: 22px;
}

.menu-icon-close,
.menu-toggle[aria-expanded="true"] .menu-icon-burger {
  display: none;
}

.menu-toggle[aria-expanded="true"] .menu-icon-close {
  display: block;
}

.header-menu[hidden],
.menu-toggle[hidden] {
  display: none;
}

.theme-toggle {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--creme);
  color: var(--prune);
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.theme-toggle:hover {
  background: var(--button-hover);
}

.theme-toggle[hidden] {
  display: none;
}

.theme-icon {
  width: 19px;
  height: 19px;
}

.theme-switch {
  display: none;
}

.theme-toggle[aria-pressed="true"] {
  background: var(--button-hover);
}

.theme-tooltip {
  position: absolute;
  z-index: 10;
  top: calc(100% + 0.5rem);
  right: 0;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  background: var(--prune);
  color: var(--button-text);
  white-space: nowrap;
  visibility: hidden;
  pointer-events: none;
}

.theme-toggle:hover .theme-tooltip,
.theme-toggle:focus-visible .theme-tooltip {
  visibility: visible;
}

/* Afficher la version du logo correspondant au thème actif. */
.logo-dark,
:root[data-theme="dark"] .logo-light {
  display: none;
}

:root[data-theme="dark"] .logo-dark {
  display: block;
}

:root[data-theme="dark"] .brand-logo,
:root[data-theme="dark"] .footer-logo {
  border-radius: 10px;
}

:root[data-theme="dark"] .hero-mark-card {
  background: #57405d;
}

:root[data-theme="dark"] .hero-mark {
  border-radius: 24px;
}

@media (max-width: 899px) {
  .header-inner {
    grid-template-columns: 1fr auto;
    gap: 0.25rem 0.5rem;
    padding-top: 0.75rem;
    padding-bottom: 0.5rem;
  }

  .header-menu {
    grid-column: 1 / -1;
    grid-row: 2;
    flex-direction: column;
    gap: 0.25rem;
    padding-top: 0.5rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--border);
  }

  .menu-toggle {
    display: inline-flex;
    grid-column: 2;
    grid-row: 1;
  }

  .level-menu-links {
    position: static;
    min-width: 0;
    margin: 0.25rem 0 0.5rem 1rem;
    padding: 0 0 0 0.5rem;
    border: 0;
    border-left: 2px solid var(--border);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .theme-toggle {
    justify-content: flex-start;
    gap: 0.75rem;
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.75rem;
    border-radius: 12px;
    font-size: 0.95rem;
  }

  .theme-tooltip {
    position: static;
    padding: 0;
    background: transparent;
    color: inherit;
    visibility: visible;
  }

  .theme-switch {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    width: 36px;
    height: 22px;
    margin-left: auto;
    padding: 3px;
    border-radius: var(--radius-sm);
    background: var(--text-soft);
  }

  .theme-switch::before {
    content: "";
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--surface);
  }

  .theme-toggle[aria-pressed="true"] .theme-switch {
    background: var(--prune);
  }

  .theme-toggle[aria-pressed="true"] .theme-switch::before {
    transform: translateX(14px);
  }
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 4.25rem 0 3rem;
}

.hero-grid {
  display: grid;
  gap: 2.75rem;
  align-items: center;
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 680px;
}

.eyebrow {
  margin: 0 0 0.7rem;
  color: var(--prune);
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin-top: 0;
  color: var(--prune);
  font-family: "DM Sans", system-ui, sans-serif;
  line-height: 1.08;
}

h1 {
  max-width: 8ch;
  margin-bottom: 1.2rem;
  font-size: clamp(2.85rem, 11vw, 5.4rem);
  letter-spacing: -0.05em;
}

h2 {
  margin-bottom: 0.85rem;
  font-size: clamp(2rem, 7vw, 3rem);
  letter-spacing: -0.035em;
}

h3 {
  margin-bottom: 0.7rem;
  font-size: 1.45rem;
  letter-spacing: -0.025em;
}

.hero-text {
  max-width: 590px;
  margin: 0 0 1.75rem;
  color: var(--text-soft);
  font-size: clamp(1.08rem, 3.6vw, 1.3rem);
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.82rem 1.15rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  background: var(--prune);
  box-shadow: 0 12px 24px rgba(87, 64, 93, 0.18);
  color: var(--button-text);
}

.button-primary:hover {
  box-shadow: 0 16px 30px rgba(87, 64, 93, 0.22);
}

.button-secondary {
  margin-top: auto;
  align-self: flex-start;
  background: var(--creme);
  border-color: var(--border);
  color: var(--prune);
}

.button-secondary:hover {
  background: var(--button-hover);
}

.hero-visual {
  position: relative;
  min-height: 290px;
}

.hero-mark-card {
  position: absolute;
  inset: 1rem 1.25rem 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 34px;
  background: #fff;
  box-shadow: var(--shadow);
  transform: rotate(1.5deg);
}

.hero-mark {
  width: min(72%, 290px);
}

.shape {
  position: absolute;
  z-index: 2;
  display: block;
  border-radius: 999px;
  filter: saturate(0.92);
}

.shape-lavender {
  top: -4px;
  left: 0;
  width: 84px;
  height: 34px;
  background: var(--lavande);
  transform: rotate(-24deg);
}

.shape-peach {
  top: 36px;
  right: 2px;
  width: 52px;
  height: 52px;
  background: var(--peche);
}

.shape-sage {
  right: 12px;
  bottom: 3px;
  width: 96px;
  height: 38px;
  background: var(--sauge);
  transform: rotate(20deg);
}

.section {
  padding: 4.75rem 0;
}

.activities {
  background: linear-gradient(180deg, var(--activity-tint), transparent);
}

.section-heading {
  max-width: 700px;
  margin-bottom: 2rem;
}

.section-heading > p:last-child {
  margin: 0;
  color: var(--text-soft);
}

.activity-grid {
  display: grid;
  gap: 1.15rem;
}

.activity-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 12px 28px rgba(87, 64, 93, 0.06);
}

.activity-thumbnail {
  position: relative;
  display: flex;
  min-height: 180px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.activity-thumbnail::before,
.activity-thumbnail::after {
  position: absolute;
  content: "";
  border-radius: 999px;
  opacity: 0.75;
}

.activity-thumbnail::before {
  top: 18px;
  right: 22px;
  width: 74px;
  height: 30px;
  background: rgba(255, 255, 255, 0.72);
  transform: rotate(-18deg);
}

.activity-thumbnail::after {
  bottom: 22px;
  left: 24px;
  width: 46px;
  height: 46px;
  border: 9px solid rgba(255, 255, 255, 0.58);
  background: transparent;
}

.thumbnail-image::before,
.thumbnail-image::after {
  content: none;
}

.thumbnail-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 300ms ease;
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .thumbnail-image:hover img {
    transform: scale(1.2);
  }
}

.thumbnail-lavender {
  background: var(--lilas);
}

.thumbnail-sage {
  background: var(--menthe);
}

.thumbnail-peach {
  background: var(--peche-clair);
}

.thumbnail-symbol {
  position: relative;
  z-index: 1;
  color: #57405d;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 4.5rem;
  font-weight: 700;
  line-height: 1;
}

.thumbnail-dots {
  position: absolute;
  right: 24px;
  bottom: 20px;
  z-index: 1;
  color: rgba(87, 64, 93, 0.72);
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.activity-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 1.35rem;
}

.activity-content p {
  margin: 0 0 1.35rem;
  color: var(--text-soft);
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 29px;
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-sm);
  color: var(--prune);
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
}

.badge-level {
  background: var(--lavande);
  color: #57405d;
}

.badge-type {
  background: var(--creme);
  border: 1px solid var(--border);
}

.about {
  padding-top: 1.25rem;
}

.about-card {
  display: grid;
  gap: 1.5rem;
  padding: clamp(1.5rem, 5vw, 2.5rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--creme);
}

.about-card h2 {
  margin-bottom: 0;
}

.about-card > p {
  margin: 0;
  align-self: center;
  color: var(--text-soft);
  font-size: 1.05rem;
}

.site-footer {
  margin-top: 1rem;
  padding: 2.5rem 0;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.footer-inner {
  display: grid;
  gap: 1.4rem;
}

.footer-brand {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.footer-logo {
  width: 132px;
}

.footer-brand a,
.social-links a {
  color: var(--prune);
  font-weight: 600;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.1rem;
}

.copyright {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.9rem;
}

@media (min-width: 640px) {
  .container {
    width: min(calc(100% - 3rem), var(--container));
  }

  .brand-logo {
    width: 190px;
  }

  .header-inner {
    width: auto;
    margin-left: max(1.5rem, calc((100% - var(--container)) / 2));
    margin-right: 1.5rem;
  }

  .hero {
    padding-top: 5.4rem;
  }

  .hero-visual {
    min-height: 350px;
  }

  .activity-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .header-inner {
    min-height: 94px;
  }

  .hero {
    padding: 6.5rem 0 5.75rem;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1.08fr) minmax(330px, 0.92fr);
    gap: 4rem;
  }

  .hero-visual {
    min-height: 430px;
  }

  .activity-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .activity-thumbnail {
    min-height: 205px;
  }

  .about-card {
    grid-template-columns: 0.85fr 1.15fr;
    gap: 4rem;
  }

  .footer-inner {
    grid-template-columns: 1fr auto auto;
    align-items: center;
  }
}

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

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
