/* ============================================================
   CANOPY — AFFICHE ITERATION A · FLUIDE  (flagship)
   ------------------------------------------------------------
   Loads after theme-affiche.css.

   COLOR LOGIC — the six café colors live in fixed contrast duos,
   exactly like the palette cards in the reference photo:
     espresso  #542916 ⇄ bleu porcelaine #88b8ce
     terre     #a13a1e ⇄ miel doré       #f1c166
     eau       #b79858 ⇄ nuage de lait   #fefaf0
   Every colored surface takes its partner as ink. Categories
   carry their duo (--cat / --cat-ink), set by app.js.

   MOTION LOGIC — everything moves like something on earth:
     sun     · the honey arch rises at the horizon, glows slowly
     wind    · shapes sway like branches, each on its own period
     water   · focusing the search sends a ripple; the sheet
               slides like a tide
     leaves  · results fall-and-settle; a small leaf drops from
               the canopy every so often
     roots   · category tiles grow up from the ground on scroll
   ============================================================ */

/* ---------- contrast pass (readability over mood) ---------- */
:root {
  --espresso-60: rgba(84, 41, 22, .74);  /* was .6 — descriptions must read */
  --espresso-30: rgba(84, 41, 22, .42);
}
.entry-hint { color: var(--espresso-60); }
.hero .sub { color: var(--espresso-60); }

/* ---------- retire the static pseudo-element shapes ---------- */
.canopy-top::before, .canopy-top::after, .hero::after { content: none; }

/* ---------- the earth composition ---------- */
.canopy-top { overflow: hidden; }
.shapes { position: absolute; inset: 0; pointer-events: none; }
.sh {
  position: absolute;
  translate: calc(var(--mx, 0) * var(--depth, 10px))
             calc(var(--my, 0) * var(--depth, 6px) + var(--sy, 0) * var(--drop, 20px));
  transition: translate 1.2s var(--ease), scale .7s var(--ease), opacity .7s var(--ease);
}
.sh::before { content: ""; display: block; }

/* the sun — honey arch at the horizon, rising as the day breathes */
.sh-sun { bottom: -6px; left: -40px; --depth: 8px; --drop: 30px; }
.sh-sun::before {
  width: 210px; height: 105px; border-radius: 210px 210px 0 0;
  background: var(--miel);
  animation: sunrise 18s ease-in-out infinite;
}
@keyframes sunrise {
  0%, 100% { transform: translateY(26px); filter: brightness(.97); }
  50%      { transform: translateY(0);    filter: brightness(1.05); }
}

/* the moon — porcelain circle drifting like a slow cloud */
.sh-moon { top: -110px; right: -90px; --depth: 16px; --drop: 46px; }
.sh-moon::before {
  width: 300px; height: 300px; border-radius: 50%;
  background: var(--bleu);
  animation: cloud 26s ease-in-out infinite alternate;
}
@keyframes cloud {
  from { transform: translateX(0) translateY(0); }
  to   { transform: translateX(-22px) translateY(8px); }
}

/* the mountain — terre triangle, still; only the wind touches it */
.sh-mont { top: 86px; right: 15%; --depth: 24px; --drop: 60px; }
.sh-mont::before {
  width: 0; height: 0;
  border-left: 30px solid transparent; border-right: 30px solid transparent;
  border-bottom: 52px solid var(--terre);
  transform-origin: 50% 100%;
  animation: windSway 13s ease-in-out infinite alternate;
}
@keyframes windSway {
  from { transform: rotate(-1.6deg); }
  to   { transform: rotate(1.6deg); }
}

/* the leaf — a small eau ring that lets go and falls, then regrows */
.sh-leaf { top: 42%; left: 7%; --depth: 32px; --drop: 80px; }
.sh-leaf::before {
  width: 42px; height: 42px; border-radius: 50%;
  border: 6px solid var(--eau);
  animation: leafFall 17s var(--ease) infinite;
}
@keyframes leafFall {
  0%, 55%  { transform: translateY(0) rotate(0deg); opacity: 1; }
  70%      { transform: translateY(90px) translateX(24px) rotate(38deg); opacity: 0; }
  71%      { transform: translateY(-30px) rotate(-10deg); opacity: 0; }
  85%, 100%{ transform: translateY(0) rotate(0deg); opacity: 1; }
}
@media (max-width: 560px) { .sh-mont, .sh-leaf { display: none; } }

body.is-typing .sh { scale: 1.05; }

/* ---------- search choreography: the poster folds away ---------- */
.top-bar { transition: margin-bottom .55s var(--ease); }
.hero h1 { transition: font-size .5s var(--ease), opacity .4s var(--ease); }
.hero .sub { transition: opacity .35s var(--ease); }
.canopy-top { transition: padding-bottom .55s var(--ease); }

body.has-query .top-bar { margin-bottom: 1.1rem; }
body.has-query .hero h1 { font-size: clamp(1.25rem, 1.6vw + .7rem, 1.7rem); opacity: .6; }
body.has-query .hero .sub { opacity: 0; }
body.has-query .canopy-top { padding-bottom: 2.2rem; }
body.has-query .sh { scale: .82; opacity: .55; }

/* ---------- water: the underline ripples on focus ---------- */
.search-wrap { position: relative; border-bottom-color: rgba(84, 41, 22, .5); }
.search-wrap::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -3px; height: 3px;
  background: var(--terre);
  transform: scaleX(0); transform-origin: left;
  transition: transform .55s var(--ease);
}
.search-wrap:focus-within::after { transform: scaleX(1); }
/* the ripple ring, spreading from the leaf like a drop on a pond */
.search-leaf { position: relative; }
.search-wrap:focus-within .search-leaf { animation: dip .5s var(--ease); }
@keyframes dip { 35% { transform: translateY(3px) rotate(-8deg); } }
.search-wrap::before {
  content: "";
  position: absolute; left: 12px; top: 50%;
  width: 20px; height: 20px; margin-top: -10px;
  border-radius: 50%;
  border: 2px solid var(--bleu);
  opacity: 0; transform: scale(.5);
  pointer-events: none;
}
.search-wrap:focus-within::before { animation: ripple 1.1s var(--ease); }
@keyframes ripple {
  0%   { opacity: .9; transform: scale(.5); }
  100% { opacity: 0;  transform: scale(3.2); }
}

/* ---------- leaves: results fall and settle ---------- */
.res-card { animation: leafSettle .6s var(--ease) backwards; }
.result-list .res-card:nth-child(2) { animation-delay: 100ms; }
.result-list .res-card:nth-child(3) { animation-delay: 200ms; }
@keyframes leafSettle {
  0%   { opacity: 0; transform: translateY(-14px) rotate(.7deg); }
  60%  { opacity: 1; transform: translateY(4px) rotate(-.25deg); }
  100% { transform: none; }
}

/* results carry their category's duo on hover — the color logic, felt */
.res-card { border-left-width: 2px; }
.res-card:hover {
  transform: translateX(4px);
  background: color-mix(in srgb, var(--cat, var(--miel)) 14%, var(--milk));
}
.res-card .cat-strip { width: 8px; transition: width .35s var(--ease); }
.res-card:hover .cat-strip { width: 12px; }
.res-sub { color: var(--espresso-60); }

/* section rule draws itself */
#home-zone.wake .section-label::after,
#results-zone .section-label::after { transform-origin: left; animation: drawRule .9s var(--ease) both; }
@keyframes drawRule { from { transform: scaleX(0); } }

/* ---------- roots: category tiles grow up from the ground ---------- */
body.alive #home-zone .cat-sticker {
  opacity: 0; transform: translateY(22px) scale(.985);
  transition: opacity .65s var(--ease), transform .65s var(--ease),
              background .3s var(--ease), color .3s var(--ease);
  transform-origin: 50% 100%;
}
body.alive #home-zone .cat-sticker.in-view { opacity: 1; transform: none; }
body.alive #home-zone .cat-sticker:nth-child(3n+2) { transition-delay: 60ms; }
body.alive #home-zone .cat-sticker:nth-child(3n)   { transition-delay: 120ms; }
body.alive #home-zone .cat-sticker.in-view:hover   { transition-delay: 0ms; }

/* hover floods the tile with its duo — bloom */
.cat-sticker:hover, body.alive #home-zone .cat-sticker.in-view:hover {
  background: var(--cat, var(--miel));
  color: var(--cat-ink, var(--espresso));
  transform: translateY(-3px);
}
.cat-sticker:hover .cat-count { color: var(--cat-ink); opacity: .6; }
.cat-sticker:hover .cat-icon { background: var(--cat-ink) !important; color: var(--cat) !important; transform: rotate(180deg); }
.cat-icon { transition: transform .7s var(--ease), background .3s var(--ease), color .3s var(--ease); }

#home-zone.wake .guided-btn { animation: leafSettle .55s var(--ease) backwards; }

/* ---------- badges: the duo system, readable first ---------- */
.badge { border-width: 1.5px; }
.badge.b-free   { background: var(--miel);  border-color: var(--terre);   color: #7c2c15; }
.badge.b-open   { background: var(--bleu);  border-color: var(--espresso); color: var(--espresso); }
.badge.b-open .dot { background: var(--espresso); }
.badge.b-urgent { background: var(--terre); border-color: var(--terre);   color: var(--miel); }
.badge.b-paid   { background: var(--milk);  border-color: var(--eau);     color: #6e5731; border-style: solid; }
.badge.b-closed { background: transparent;  border-color: var(--espresso-30); color: var(--espresso-60); }

/* ---------- your path, shown back (the personal part) ---------- */
.path-row { margin: 0 0 1.2rem; animation: leafSettle .5s var(--ease) backwards; }
.path-you {
  font-size: var(--fs-tiny); font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--espresso-60);
}
.path-chip {
  font-size: var(--fs-tiny); font-weight: 700;
  padding: .3rem .65rem;
  background: var(--espresso); color: var(--bleu);
  letter-spacing: .03em;
}
.path-chip + .path-chip { position: relative; margin-left: .9rem; }
.path-chip + .path-chip::before {
  content: "→"; position: absolute; left: -1.05rem;
  color: var(--espresso-60); font-weight: 400;
}
.path-edit {
  font-size: var(--fs-tiny); font-weight: 700;
  text-decoration: underline; text-underline-offset: 3px;
  color: var(--terre);
}
.assist-note {
  margin: 0 0 1.1rem;
  font-size: var(--fs-small); font-style: italic;
  color: var(--espresso-60);
  border-left: 4px solid var(--bleu); padding-left: .8rem;
}

/* ---------- Enter hint: appears while you type, breathes gently ---------- */
.enter-hint {
  display: none;
  font-size: var(--fs-tiny); font-weight: 700;
  border: 1.5px solid var(--espresso-30);
  padding: .15rem .5rem;
  color: var(--espresso-60);
  animation: hintBreath 2.6s ease-in-out infinite;
}
body.has-query .enter-hint { display: inline-block; }
@keyframes hintBreath { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }

/* ---------- the breath between Enter and the answer ---------- */
.searching { display: flex; justify-content: center; padding: 3rem 0; }
.breath-dot {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--terre);
  animation: searchBreath 1.4s ease-in-out infinite;
}
@keyframes searchBreath {
  0%, 100% { transform: scale(.7); opacity: .5; box-shadow: 0 0 0 0 rgba(161, 58, 30, .25); }
  50%      { transform: scale(1);  opacity: 1;  box-shadow: 0 0 0 14px rgba(161, 58, 30, 0); }
}

/* ---------- the guide (assist cards) ---------- */
.assist-card {
  border: var(--line);
  background: var(--milk);
  padding: 1.4rem 1.4rem 1.5rem;
  margin-bottom: 1.4rem;
  position: relative;
  animation: leafSettle .55s var(--ease) backwards;
}
.assist-card::before { /* the guide's mark: a small honey sun */
  content: "";
  position: absolute; top: -11px; left: 22px;
  width: 40px; height: 20px; border-radius: 40px 40px 0 0;
  background: var(--miel); border: 2px solid var(--espresso); border-bottom: none;
}
.assist-q {
  margin: 0 0 1.1rem;
  font-family: 'Josefin Sans', sans-serif;
  font-size: var(--fs-h3); font-weight: 600;
}
/* ---------- visible AI helper strip + info icon ---------- */
.helper-strip {
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1.5px dashed var(--espresso-30);
}
.helper-strip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  margin-bottom: .55rem;
}
.helper-strip-label {
  margin: 0;
  font-size: var(--fs-tiny);
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--espresso-60);
}
.helper-info-btn {
  flex: none;
  width: 1.85rem;
  height: 1.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: var(--line);
  border-radius: 50%;
  background: var(--milk);
  color: var(--espresso);
  font-family: 'Josefin Sans', sans-serif;
  font-size: .82rem;
  font-weight: 700;
  font-style: italic;
  line-height: 1;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.helper-info-btn:hover {
  background: var(--bleu);
  color: var(--espresso);
  transform: scale(1.05);
}
.helper-info-btn:focus-visible {
  outline: 3px solid var(--terre);
  outline-offset: 2px;
}
.helper-cta {
  width: 100%;
  display: flex;
  align-items: center;
  gap: .75rem;
  text-align: left;
  border: var(--line);
  background: color-mix(in srgb, var(--bleu) 14%, var(--milk));
  padding: .95rem 1.05rem;
  transition: transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.helper-cta:hover {
  transform: translateX(4px);
  background: color-mix(in srgb, var(--bleu) 24%, var(--milk));
}
.helper-cta-icon {
  flex: none;
  width: 1.6rem;
  height: 1.6rem;
  color: var(--terre);
}
.helper-cta-icon svg { width: 100%; height: 100%; display: block; }
.helper-cta-copy { flex: 1; min-width: 0; }
.helper-cta-badge {
  display: inline-block;
  margin-bottom: .28rem;
  padding: .12rem .45rem;
  border: 1.5px solid var(--bleu);
  background: color-mix(in srgb, var(--bleu) 18%, var(--milk));
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--espresso);
}
.helper-cta-title {
  display: block;
  font-weight: 700;
  font-size: 1.02rem;
  line-height: 1.25;
  color: var(--espresso);
}
.helper-cta-sub {
  display: block;
  margin-top: .28rem;
  font-size: var(--fs-tiny);
  letter-spacing: .04em;
  color: var(--espresso-60);
}
.helper-cta-go {
  flex: none;
  color: var(--terre);
  font-weight: 700;
  font-size: 1.1rem;
}
.tree-foot .helper-strip { margin-top: .35rem; padding-top: .75rem; }

.helper-info-box .helper-info-list {
  margin: 0 0 1.2rem;
  padding: 0 0 0 1.1rem;
  color: var(--espresso-60);
  font-size: var(--fs-small);
  line-height: 1.55;
}
.helper-info-box .helper-info-list li + li { margin-top: .45rem; }
.helper-info-veil { background: rgba(84, 41, 22, .5); }

/* the warm first line, before the question */
.assist-ack {
  margin: 0 0 .5rem;
  font-size: 1.05rem; font-style: italic;
  color: var(--espresso-60);
  animation: leafSettle .5s var(--ease) backwards;
}
.assist-ack-quiet {
  font-size: var(--fs-small);
  margin-top: -.2rem;
  margin-bottom: 1rem;
}
.assist-privacy-soft {
  margin: 0 0 1rem;
  font-size: var(--fs-small);
  color: var(--espresso-60);
}
.convo-crumbs { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 .9rem; }
.convo-foot {
  display: flex; flex-wrap: wrap; gap: .9rem 1.2rem; margin-top: 1.2rem;
  padding-top: .9rem; border-top: 1.5px dashed var(--espresso-30);
  align-items: center;
}
.convo-link {
  font-size: var(--fs-tiny); font-weight: 700;
  color: var(--espresso-60);
  text-decoration: underline; text-underline-offset: 3px;
}
.convo-link:hover { color: var(--terre); }
.assist-choice {
  border: var(--line);
  background: var(--milk);
  padding: .95rem 1.15rem;
  transition: transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
  animation: leafSettle .5s var(--ease) backwards;
}
.assist-choice:nth-child(2) { animation-delay: 70ms; }
.assist-choice:nth-child(3) { animation-delay: 140ms; }
.assist-choice:nth-child(4) { animation-delay: 210ms; }
.assist-choice:nth-child(5) { animation-delay: 280ms; }
.assist-choice:hover { transform: translateX(4px); background: #fbf2dd; }
.assist-choice .t-label { font-weight: 600; }
.assist-choice .t-sub { font-size: var(--fs-tiny); text-transform: uppercase; letter-spacing: .1em; color: var(--espresso-60); width: 100%; }
.assist-choice .t-go { color: var(--terre); }
.assist-none { border-style: dashed; }

.assist-privacy {
  font-size: var(--fs-small); line-height: 1.6;
  color: var(--espresso-60);
  margin: 0 0 1rem;
}
.assist-consent .assist-choices { margin-top: .2rem; }
.assist-echo {
  margin: 0 0 1.2rem; padding: .8rem 1rem;
  border-left: 4px solid var(--eau);
  background: #fbf2dd;
  font-style: italic;
}
.assist-thinking { padding: 2.2rem 1.4rem; }
.think-dot {
  display: inline-block; width: 11px; height: 11px; border-radius: 50%;
  background: var(--espresso); margin: 0 4px;
  animation: think 1.3s ease-in-out infinite;
}
.think-dot:nth-child(2) { animation-delay: .18s; background: var(--terre); }
.think-dot:nth-child(3) { animation-delay: .36s; background: var(--eau); }
@keyframes think { 0%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-7px); opacity: 1; } }

.ai-status {
  display: block;
  margin: .5rem 0 0;
  font-size: .78rem;
  font-weight: 600;
  color: var(--terre);
  animation: aiPulse 1.6s ease-in-out infinite;
}
body.ai-active .search-wrap { outline: 2px solid var(--terre); outline-offset: 3px; border-radius: 2px; }
body.ai-active .ai-status { display: block; }
.assist-echo-live { margin: .6rem 0 0; font-style: italic; opacity: .85; }
.assist-privacy-compact { font-size: .72rem; margin-top: .6rem; opacity: .75; }
.think-row { display: flex; gap: .35rem; justify-content: center; margin-top: .8rem; }
.assist-ai-foot { margin-top: .6rem; border-style: dashed; }
.ai-sent-note { margin-top: 1rem; font-size: .75rem; opacity: .8; }
@keyframes aiPulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }

/* ---------- desktop: the sheet is a side panel (a tide, not a curtain) ---------- */
@media (min-width: 900px) {
  .sheet {
    left: auto; right: 0; top: 0; bottom: 0;
    width: 560px; max-height: none;
    border: none; border-left: 3px solid var(--espresso);
    border-radius: 0;
    transform: translateX(105%);
    transition: transform .5s var(--ease);
  }
  .sheet.on { transform: translateX(0); }
  .sheet-handle { display: none; }
  .sheet-scroll { padding-top: 1.6rem; }
  .sheet-veil { background: rgba(84, 41, 22, .18); }
}

/* ---------- small signs of life ---------- */
.sos { animation: sosBreath 5s ease-in-out infinite; }
@keyframes sosBreath {
  0%, 100% { box-shadow: 0 0 0 0 rgba(161, 58, 30, .35); }
  50%      { box-shadow: 0 0 0 9px rgba(161, 58, 30, 0); }
}
.badge.b-open .dot { animation-duration: 3.4s; }
