/* les petits curieux — styles */
:root {
  --cream: #FBF4EA;
  --sand: #F3E7D7;
  --ink: #1B1B1B;
  --ink-2: #4A4540;
  --coral: #F2775A;
  --coral-soft: #F7A38D;
  --blue: #3D74E0;
  --blue-soft: #C9DCF5;
  --yellow: #FFC93C;
  --yellow-soft: #FDDF8A;
  --green: #5FAE5B;
  --green-soft: #8CC67E;
  --radius: 28px;
  --nav-h: 76px;
  --font: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.45;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
}
a { color: inherit; }
button { font: inherit; color: inherit; }
img, svg { display: block; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 8px; }

.dot { color: var(--coral); }

/* ---------- Header ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: 1180px; margin: 0 auto; padding: 22px 22px 6px;
}
.logo {
  font-weight: 800; font-size: 25px; line-height: .9; letter-spacing: -.03em;
  text-decoration: none;
}
.icon-btn {
  display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 50%;
  border: 0; background: transparent; cursor: pointer; text-decoration: none;
}
.icon-btn svg { width: 26px; height: 26px; }
.topbar__nav { display: none; }

/* ---------- Navigation ---------- */
.nav { display: flex; justify-content: space-around; align-items: center; }
.nav__item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: 13.5px; font-weight: 600; color: var(--ink-2); text-decoration: none; min-width: 72px;
}
.nav__icon { display: grid; place-items: center; width: 58px; height: 34px; border-radius: 999px; transition: background .2s; }
.nav__icon svg { width: 24px; height: 24px; }
.nav__item.is-active { color: var(--ink); font-weight: 800; }
.nav__item.is-active .nav__icon { background: var(--coral-soft); }
.nav__item:hover .nav__icon { background: var(--sand); }
.nav__item.is-active:hover .nav__icon { background: var(--coral-soft); }

.bottom-nav {
  position: fixed; inset: auto 0 0 0; z-index: 20;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding: 8px 8px env(safe-area-inset-bottom);
  background: rgba(251, 244, 234, .96);
  backdrop-filter: blur(10px);
  border-top: 1px solid #EADCC8;
}

/* ---------- Page ---------- */
.page { max-width: 1180px; margin: 0 auto; padding: 8px 22px 40px; }

.hero-title {
  position: relative; display: inline-block;
  font-size: clamp(44px, 12vw, 84px); line-height: .95; font-weight: 800; letter-spacing: -.045em;
  margin: 26px 0 22px;
}
.burst {
  position: absolute; top: -6px; right: -54px; width: 46px; height: 46px;
  background:
    linear-gradient(var(--coral), var(--coral)) 30% 0 / 6px 22px no-repeat,
    linear-gradient(var(--coral), var(--coral)) 100% 40% / 22px 6px no-repeat;
  transform: rotate(20deg);
}
.burst::after {
  content: ''; position: absolute; left: 6px; bottom: 2px; width: 6px; height: 20px; border-radius: 3px;
  background: var(--coral); transform: rotate(48deg);
}
.lead { font-size: 18px; color: var(--ink-2); max-width: 36ch; margin: 0 0 8px; }

/* ---------- Recherche & chips ---------- */
.search {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border-radius: 999px; padding: 0 18px; height: 52px; margin-bottom: 14px;
  box-shadow: 0 1px 0 #EADCC8;
}
.search__icon svg { width: 20px; height: 20px; color: var(--ink-2); }
.search input { flex: 1; border: 0; outline: 0; background: transparent; font: inherit; font-size: 16px; height: 100%; }

.chips {
  display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none;
  margin: 0 -22px; padding: 2px 22px 6px;
}
.chips::-webkit-scrollbar { display: none; }
.chips--wrap { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 8px;
  height: 48px; padding: 0 20px; border-radius: 999px; border: 2px solid transparent;
  background: var(--sand); font-size: 16px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.chip:hover { background: #EBDCC7; }
.chip[aria-pressed="true"] { background: var(--coral-soft); border-color: var(--coral); }
.chip svg { width: 20px; height: 20px; }
.chip--dark { background: var(--ink); color: #fff; }
.chip--dark:hover { background: #333; }
.chip__badge {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 999px; background: var(--coral); color: #fff; font-size: 13px; font-weight: 800;
}

.filters {
  background: #fff; border-radius: 24px; padding: 18px 20px 14px; margin: 10px 0 4px;
  box-shadow: 0 6px 24px rgba(60, 40, 20, .08);
}
.filters fieldset { border: 0; padding: 0; margin: 0 0 14px; }
.filters legend { font-weight: 800; font-size: 15px; margin-bottom: 8px; }
.filters .chip { height: 40px; font-size: 15px; padding: 0 16px; }
.link-btn { background: none; border: 0; padding: 4px 0; font-weight: 700; text-decoration: underline; cursor: pointer; }

.count { font-size: 17px; font-weight: 600; color: var(--ink-2); margin: 14px 0 16px; }

/* ---------- Cartes ---------- */
.grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px;
}
.card {
  position: relative; display: flex; flex-direction: column; justify-content: space-between;
  aspect-ratio: 1 / 1; border-radius: var(--radius); overflow: hidden; text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-3px) rotate(-.4deg); box-shadow: 0 10px 24px rgba(60, 40, 20, .12); }
.card--coral { background: var(--coral); }
.card--blue { background: var(--blue-soft); }
.card--yellow { background: var(--yellow-soft); }
.card--green { background: var(--green-soft); }
.card__art { flex: 1; display: grid; place-items: center; padding: 10px 10px 0; min-height: 0; }
.card__art .illus { width: 88%; height: 100%; max-height: 100%; object-fit: contain; }
.card__body { padding: 0 16px 16px; }
.card__title { margin: 0; font-size: clamp(17px, 4.6vw, 22px); line-height: 1.05; font-weight: 800; letter-spacing: -.02em; }
.card__meta { margin: 4px 0 0; font-size: 13px; font-weight: 600; opacity: .72; }

.grid--feature { grid-template-columns: 1fr; }
.grid--feature .card { aspect-ratio: auto; flex-direction: row; align-items: center; min-height: 190px; }
.grid--feature .card__art { flex: 0 0 48%; padding: 16px; }
.grid--feature .card__body { padding: 20px 20px 20px 0; }
.grid--feature .card__title { font-size: 28px; }
.grid--feature .card__meta { font-size: 15px; }
#daily:not(.is-ready) > li:not(:first-child) { display: none; }
#fav-grid:not(.is-ready) { display: none; }

.grid--row {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  margin: 0 -22px; padding: 4px 22px 10px;
}
.grid--row::-webkit-scrollbar { display: none; }
.grid--row > li { flex: 0 0 44%; scroll-snap-align: start; }

/* ---------- Accueil ---------- */
.section { margin-top: 30px; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; }
.section__title { font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 14px; }
.link { font-weight: 700; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile {
  display: grid; grid-template-columns: 56px 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center;
  padding: 14px; border-radius: 22px; text-decoration: none; transition: transform .15s;
}
.tile:hover { transform: translateY(-2px); }
.tile--coral { background: var(--coral); }
.tile--blue { background: var(--blue-soft); }
.tile--yellow { background: var(--yellow-soft); }
.tile--green { background: var(--green-soft); }
.tile__art { grid-row: 1 / 3; width: 56px; height: 44px; }
.tile__label { font-weight: 800; font-size: 16px; line-height: 1.1; }
.tile__count { font-size: 13px; font-weight: 600; opacity: .75; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 52px; padding: 0 24px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--ink); color: #fff; font-weight: 700; font-size: 16px; text-decoration: none;
}
.btn svg { width: 22px; height: 22px; }
.btn:hover { background: #333; }
.btn--wide { width: 100%; margin-top: 28px; }
.empty { text-align: center; padding: 40px 0; color: var(--ink-2); }

/* ---------- Détail ---------- */
.is-detail .topbar { display: none; }
.detail-top { position: absolute; inset: 0 0 auto 0; z-index: 5; }
.detail-bar {
  display: flex; justify-content: space-between; max-width: 820px; margin: 0 auto; padding: 18px 14px;
}
.fav-btn svg { width: 28px; height: 28px; transition: transform .15s; }
.fav-btn[aria-pressed="true"] svg { fill: var(--ink); transform: scale(1.08); }
.fav-btn:active svg { transform: scale(.9); }

.detail { max-width: 820px; margin: 0 auto; position: relative; }
.detail__hero { position: relative; height: 330px; overflow: hidden; }
.detail__blob {
  position: absolute; inset: -40px -10% 0 -10%;
  border-radius: 0 0 46% 54% / 0 0 34% 22%;
}
.detail--coral .detail__blob { background: var(--coral); }
.detail--blue .detail__blob { background: var(--blue-soft); }
.detail--yellow .detail__blob { background: var(--yellow-soft); }
.detail--green .detail__blob { background: var(--green-soft); }
.detail__art { position: relative; height: 100%; display: grid; place-items: center; padding: 70px 30px 40px; }
.illus--hero { width: min(420px, 90%); height: 100%; object-fit: contain; }

.detail__content { padding: 0 22px 40px; margin-top: -26px; position: relative; }
.detail__title { font-size: clamp(42px, 11vw, 64px); line-height: .95; font-weight: 800; letter-spacing: -.045em; margin: 0 0 18px; }
.pills { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-flex; align-items: center; gap: 7px; height: 42px; padding: 0 16px;
  background: var(--sand); border-radius: 999px; font-weight: 600; font-size: 15px;
}
.pill svg { width: 20px; height: 20px; }
.skills { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 6px; }
.skills span { font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 999px; border: 1.5px solid #DCCBB3; color: var(--ink-2); }

.block { margin-top: 26px; }
.block h2, .safety h2 { font-size: 25px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 12px; }
.block p { margin: 0; font-size: 17px; }

.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.check { display: flex; align-items: flex-start; gap: 14px; cursor: pointer; font-size: 17px; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check__box {
  flex: none; width: 26px; height: 26px; border: 2px solid #CDBBA2; border-radius: 7px; background: #fff;
  display: grid; place-items: center; transition: background .15s, border-color .15s;
}
.check input:checked + .check__box { background: var(--green); border-color: var(--green); }
.check input:checked + .check__box::after {
  content: ''; width: 12px; height: 7px; border: solid #fff; border-width: 0 0 3px 3px; transform: rotate(-45deg) translate(1px, -1px);
}
.check input:checked ~ span:last-child { text-decoration: line-through; color: #8a8178; }
.check input:focus-visible + .check__box { outline: 3px solid var(--blue); outline-offset: 2px; }

.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; gap: 12px; }
.steps li { counter-increment: step; display: flex; gap: 14px; align-items: flex-start; font-size: 17px; }
.steps li::before {
  content: counter(step); flex: none; display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 50%; background: var(--coral); color: #fff; font-weight: 800; font-size: 15px;
}
.bullets { margin: 0; padding-left: 20px; font-size: 17px; display: grid; gap: 6px; }

.safety {
  display: flex; gap: 14px; margin-top: 28px; padding: 20px; border-radius: 24px; background: var(--blue-soft);
}
.safety__icon svg { width: 34px; height: 34px; }
.safety h2 { font-size: 21px; margin-bottom: 4px; }
.safety p { margin: 0; font-size: 16px; }

/* ---------- Desktop ---------- */
@media (min-width: 700px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
  .grid--feature { grid-template-columns: 1fr; }
  .grid--feature .card { min-height: 280px; }
  .grid--feature .card__title { font-size: 40px; }
  .grid--row > li { flex-basis: 30%; }
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .detail__hero { height: 400px; }
  .detail__blob { border-radius: 0 0 48px 48px; inset: 0; }
  .detail__content { margin-top: 28px; }
}

@media (min-width: 980px) {
  body { padding-bottom: 0; }
  .bottom-nav { display: none; }
  .topbar { padding-top: 26px; }
  .topbar__nav { display: block; }
  .topbar__nav .nav { gap: 6px; }
  .topbar__nav .nav__item { flex-direction: row; gap: 8px; min-width: 0; font-size: 16px; padding: 10px 18px; border-radius: 999px; }
  .topbar__nav .nav__icon { width: auto; height: auto; background: none !important; }
  .topbar__nav .nav__icon svg { width: 20px; height: 20px; }
  .topbar__nav .nav__item:hover { background: var(--sand); }
  .topbar__nav .nav__item.is-active { background: var(--coral-soft); }
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid--feature { grid-template-columns: 1fr; }
  .grid--row > li { flex-basis: 23%; }
  .is-home .intro { display: grid; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- Contraste des illustrations par défaut selon le fond ---------- */
:is(.card--coral, .tile--coral, .detail--coral) svg.illus [fill="#F2775A"] { fill: #FFE1D6; }
:is(.card--yellow, .tile--yellow, .detail--yellow) svg.illus [fill="#FFC93C"] { fill: #fff; }
:is(.card--green, .tile--green, .detail--green) svg.illus [fill="#5FAE5B"] { fill: #fff; }
:is(.card--blue, .card--yellow, .card--green, .tile--blue, .tile--yellow, .tile--green, .detail--blue, .detail--yellow, .detail--green) svg.illus g[stroke="#fff"] { stroke: var(--coral); }
