/* ============================================================
   Bananapix, la petite bande jaune.
   Palette solaire : jaune vif, bleu atelier, crème, noir doux.
   Style : contours épais et ombres portées nettes, esprit dessin animé.
   ============================================================ */

:root {
  --jaune: #FFD21E;
  --jaune-clair: #FFE05C;
  --jaune-fonce: #E5A800;
  --bleu: #2C5FB3;
  --bleu-fonce: #1E4180;
  --bleu-clair: #E8F0FC;
  --creme: #FFF9E8;
  --blanc: #FFFFFF;
  --noir: #1B1B1F;
  --gris: #6B6B76;
  --gris-clair: #E6E4DC;
  --rouge: #E2574C;
  --display: "Fredoka", "Baloo 2", "Nunito", system-ui, sans-serif;
  --corps: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --radius: 18px;
  --maxw: 1160px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--creme);
  color: var(--noir);
  font-family: var(--corps);
  line-height: 1.62;
  min-height: 100vh;
  overflow-x: hidden;
}
::selection { background: var(--jaune); color: var(--noir); }
a { color: var(--bleu); font-weight: 700; }
a:hover { color: var(--bleu-fonce); }
[hidden] { display: none !important; }

h1, h2, h3, .logo-text, .btn, .how-num {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* ============================ Boutons ============================ */
.btn {
  display: inline-block;
  padding: 14px 28px;
  border-radius: 999px;
  border: 3px solid var(--noir);
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  cursor: pointer;
  background: var(--blanc);
  color: var(--noir);
  box-shadow: 0 4px 0 var(--noir);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--noir); }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--noir); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: 0 4px 0 var(--noir); }
.btn-primary { background: var(--jaune); }
.btn-primary:hover { background: var(--jaune-clair); }
.btn-big { font-size: 1.2rem; padding: 17px 38px; width: 100%; }
.btn-small { font-size: 0.88rem; padding: 9px 18px; box-shadow: 0 3px 0 var(--noir); }

/* ============================ Header ============================ */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; max-width: var(--maxw); margin: 0 auto; padding: 18px 24px;
}
.logo { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.logo-mascotte { display: inline-flex; cursor: pointer; }
.logo-mascotte svg { display: block; }
.logo-text { font-size: 1.5rem; color: var(--noir); }
.logo-text em { color: var(--bleu); font-style: normal; }
.site-nav { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.site-nav a { color: var(--noir); text-decoration: none; font-size: 0.98rem; font-weight: 700; }
.site-nav a:hover { color: var(--bleu); }
.nav-studio {
  background: var(--bleu); color: var(--blanc) !important; padding: 8px 16px;
  border-radius: 999px; border: 2px solid var(--noir); box-shadow: 0 3px 0 var(--noir);
}

/* ============================ Hero ============================ */
.hero {
  position: relative; text-align: center; padding: 56px 24px 66px; overflow: hidden;
  background:
    radial-gradient(760px 360px at 50% -60px, var(--jaune) 0%, rgba(255, 210, 30, 0) 68%),
    var(--creme);
}
.hero-inner { position: relative; z-index: 2; max-width: 810px; margin: 0 auto; }
.hero-kicker {
  display: inline-block; background: var(--bleu); color: var(--blanc);
  padding: 6px 16px; border-radius: 999px; font-size: 0.82rem; font-weight: 800;
  margin-bottom: 20px; border: 2px solid var(--noir);
}
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.8rem); line-height: 1.08; }
.hero h1 .souligne { position: relative; display: inline-block; z-index: 1; }
.hero h1 .souligne::after {
  content: ""; position: absolute; left: -6px; right: -6px; bottom: 2px; height: 0.32em;
  background: var(--jaune); border-radius: 4px; z-index: -1;
}
.hero-sub { margin: 22px auto 30px; max-width: 630px; color: #46464F; font-size: 1.1rem; }
.hero-sub strong { color: var(--noir); }
.hero-ctas { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* la bande qui sautille sous le hero */
.bande-hero {
  display: flex; gap: 12px; justify-content: center; align-items: flex-end;
  margin-top: 42px; flex-wrap: wrap; min-height: 70px;
}
.bande-hero span { display: inline-flex; align-items: flex-end; }
.bande-hero .pixou { animation: sautille 2.4s ease-in-out infinite; }
.bande-hero span:nth-child(2) .pixou { animation-delay: 0.15s; }
.bande-hero span:nth-child(3) .pixou { animation-delay: 0.3s; }
.bande-hero span:nth-child(4) .pixou { animation-delay: 0.45s; }
.bande-hero span:nth-child(5) .pixou { animation-delay: 0.6s; }
.bande-hero span:nth-child(6) .pixou { animation-delay: 0.75s; }
.bande-hero span:nth-child(7) .pixou { animation-delay: 0.9s; }
@keyframes sautille {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}

.trust-chips {
  display: flex; gap: 10px 20px; justify-content: center; flex-wrap: wrap;
  list-style: none; margin-top: 30px; color: #46464F; font-size: 0.92rem; font-weight: 700;
}

/* ============================ Sections ============================ */
.section-title { text-align: center; font-size: clamp(1.7rem, 3.8vw, 2.4rem); margin-bottom: 8px; }
.section-sub { text-align: center; color: var(--gris); max-width: 580px; margin: 0 auto 34px; }

/* ============================ Outil ============================ */
.tool { max-width: var(--maxw); margin: 0 auto; padding: 46px 24px 80px; }

.dropzone {
  position: relative; border: 4px dashed var(--jaune-fonce); border-radius: var(--radius);
  background: var(--blanc); padding: 48px 24px; text-align: center; cursor: pointer;
  transition: border-color 0.18s, background 0.18s, transform 0.18s;
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--bleu); background: var(--bleu-clair); }
.dropzone.is-over { border-color: var(--bleu); background: var(--bleu-clair); transform: scale(1.01); }
.dropzone-ico { margin-bottom: 14px; display: flex; justify-content: center; align-items: flex-end; gap: 8px; }
.dropzone-title { font-family: var(--display); font-size: 1.6rem; }
.dropzone-hint { color: var(--gris); font-size: 0.94rem; margin-top: 6px; }
.dropzone-msg { margin-top: 14px; color: var(--rouge); font-weight: 800; }

.stage { margin-top: 26px; }
.stage-title { font-family: var(--display); font-size: 1.2rem; margin-bottom: 4px; }
.stage-help { color: var(--gris); font-size: 0.9rem; margin-bottom: 12px; }

.work-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.focal-panel, .options-panel {
  background: var(--blanc); border: 3px solid var(--noir);
  border-radius: var(--radius); padding: 22px; box-shadow: 0 5px 0 var(--noir);
}

/* ---- point focal ---- */
.focal-wrap {
  position: relative; display: block; line-height: 0; touch-action: none;
  cursor: crosshair; border-radius: 12px; overflow: hidden; border: 2px solid var(--noir);
}
.focal-wrap img { width: 100%; height: auto; display: block; }
.focal-dot {
  position: absolute; width: 40px; height: 40px; margin: -20px 0 0 -20px;
  border-radius: 50%; border: 3px solid var(--noir); background: rgba(255, 210, 30, 0.55);
  cursor: grab; padding: 0; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.85);
}
.focal-dot::before, .focal-dot::after { content: ""; position: absolute; background: var(--noir); }
.focal-dot::before { left: 50%; top: 7px; bottom: 7px; width: 2px; margin-left: -1px; }
.focal-dot::after { top: 50%; left: 7px; right: 7px; height: 2px; margin-top: -1px; }
.focal-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.img-info { margin-top: 10px; color: var(--gris); font-size: 0.86rem; font-weight: 600; }

/* ---- formats ---- */
.groupes { display: flex; flex-direction: column; gap: 14px; margin-bottom: 22px; }
.groupe { background: var(--creme); border: 2px solid var(--noir); border-radius: 14px; padding: 13px 15px; }
.groupe-head { margin-bottom: 8px; }
.groupe-titre { font-family: var(--display); font-size: 1.1rem; cursor: pointer; display: flex; align-items: center; gap: 9px; }
.groupe-pitch { color: var(--gris); font-size: 0.82rem; display: block; margin-top: 2px; }
.groupe-formats { display: grid; grid-template-columns: 1fr; gap: 2px; }
.fmt { display: flex; align-items: center; gap: 10px; padding: 6px 7px; border-radius: 8px; cursor: pointer; font-size: 0.93rem; font-weight: 600; }
.fmt:hover { background: var(--jaune-clair); }
.fmt-nom { flex: 1; }
.fmt-dim { color: var(--gris); font-size: 0.8rem; font-variant-numeric: tabular-nums; }
input[type="checkbox"] { accent-color: var(--bleu); width: 17px; height: 17px; flex-shrink: 0; }

.out-row { margin-bottom: 15px; }
.out-row label { display: flex; justify-content: space-between; font-weight: 800; font-size: 0.93rem; margin-bottom: 6px; }
.out-row output { color: var(--bleu); font-variant-numeric: tabular-nums; }
select, input[type="range"] { width: 100%; }
select {
  padding: 10px 13px; border-radius: 10px; border: 2px solid var(--noir);
  background: var(--blanc); color: var(--noir); font-size: 0.95rem; font-weight: 600;
  font-family: var(--corps);
}
input[type="range"] { accent-color: var(--jaune-fonce); cursor: pointer; }
input[type="range"]:disabled { opacity: 0.4; cursor: not-allowed; }
.note { background: var(--bleu-clair); border: 2px solid var(--bleu); border-radius: 10px; padding: 10px 13px; font-size: 0.88rem; margin-bottom: 15px; font-weight: 600; }
.go-hint { margin-top: 10px; text-align: center; color: var(--gris); font-size: 0.82rem; }

/* ---- les trois règles ---- */
.regles {
  margin-top: 24px; background: var(--jaune); border: 3px solid var(--noir);
  border-radius: var(--radius); padding: 24px 26px; box-shadow: 0 5px 0 var(--noir);
}
.regles h3 { font-family: var(--display); font-size: 1.3rem; margin-bottom: 4px; }
.regles .regles-sub { font-size: 0.9rem; color: #4A4326; margin-bottom: 14px; font-weight: 600; }
.regles ol { list-style: none; counter-reset: r; display: grid; gap: 11px; }
.regles li { counter-increment: r; display: flex; gap: 12px; align-items: flex-start; font-size: 0.96rem; color: #3A3520; }
.regles li::before {
  content: counter(r); flex-shrink: 0; width: 27px; height: 27px; border-radius: 50%;
  background: var(--blanc); border: 2px solid var(--noir); font-family: var(--display);
  font-weight: 700; font-size: 0.92rem; display: flex; align-items: center; justify-content: center;
}
.regles strong { color: var(--noir); }

/* ---- progression ---- */
.stage-run {
  text-align: center; background: var(--blanc); border: 3px solid var(--noir);
  border-radius: var(--radius); padding: 38px 26px; box-shadow: 0 5px 0 var(--noir);
}
.run-title { font-family: var(--display); font-size: 1.6rem; }
.run-sub { color: var(--gris); margin: 8px 0 18px; min-height: 1.4em; font-weight: 600; }
.run-bande { display: flex; gap: 8px; justify-content: center; align-items: flex-end; flex-wrap: wrap; min-height: 48px; margin-bottom: 20px; }
.run-bande .pixou { animation: pop 0.42s cubic-bezier(0.34, 1.6, 0.64, 1); }
@keyframes pop { from { transform: scale(0) rotate(-25deg); } to { transform: scale(1) rotate(0); } }
.progress { height: 16px; border-radius: 999px; background: var(--gris-clair); border: 2px solid var(--noir); overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--jaune); border-right: 2px solid var(--noir); transition: width 0.25s ease; }

/* ---- résultats ---- */
.results-head { text-align: center; margin-bottom: 24px; }
.results-title { font-family: var(--display); font-size: 1.8rem; }
.results-sub { color: var(--gris); margin-top: 6px; font-weight: 600; }
.results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 26px; }
.res-card {
  background: var(--blanc); border: 3px solid var(--noir); border-radius: 14px;
  padding: 12px; margin: 0; display: flex; flex-direction: column; gap: 9px;
  box-shadow: 0 4px 0 var(--noir); transition: transform 0.14s ease, box-shadow 0.14s ease;
}
.res-card:hover { transform: translateY(-3px); box-shadow: 0 7px 0 var(--noir); }
.res-vue {
  /* fond uni : un damier ferait croire à tort que l'image a de la transparence
     alors qu'il s'agit seulement du vide autour d'une vignette verticale */
  background: var(--gris-clair);
  border: 2px solid var(--noir); border-radius: 9px; overflow: hidden;
  display: flex; align-items: center; justify-content: center; min-height: 122px;
}
.res-vue img { max-width: 100%; max-height: 160px; display: block; }
.res-card figcaption { display: flex; align-items: flex-start; gap: 9px; }
.res-txt { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.res-nom { font-family: var(--display); font-size: 0.98rem; line-height: 1.2; }
.res-dim { color: var(--gris); font-size: 0.78rem; font-variant-numeric: tabular-nums; font-weight: 700; }
.res-warn { color: #B26A00; font-size: 0.77rem; font-weight: 800; }
.res-fail { color: var(--rouge); font-size: 0.87rem; padding: 24px 0; text-align: center; font-weight: 700; }
.res-dl {
  background: var(--jaune); border: 2px solid var(--noir); color: var(--noir);
  border-radius: 999px; padding: 8px; cursor: pointer; font-family: var(--display);
  font-size: 0.9rem; font-weight: 700; box-shadow: 0 3px 0 var(--noir);
}
.res-dl:hover { background: var(--jaune-clair); }
.res-dl:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--noir); }
.results-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.results-actions .btn-big { width: auto; }
.results-note { text-align: center; color: var(--gris); font-size: 0.86rem; margin-top: 12px; font-weight: 600; }

/* ============================ Comment, réassurance, FAQ ============================ */
.how { max-width: var(--maxw); margin: 0 auto; padding: 56px 24px; }
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 32px; }
.how-card { background: var(--blanc); border: 3px solid var(--noir); border-radius: var(--radius); padding: 26px 22px; box-shadow: 0 5px 0 var(--noir); }
.how-num {
  width: 46px; height: 46px; border-radius: 50%; background: var(--jaune);
  border: 3px solid var(--noir); display: flex; align-items: center; justify-content: center;
  font-size: 1.35rem; margin-bottom: 12px;
}
.how-card h3 { font-size: 1.2rem; margin-bottom: 8px; }
.how-card p { color: #46464F; font-size: 0.96rem; }

.reassure { max-width: var(--maxw); margin: 0 auto; padding: 20px 24px 60px; }
.reassure-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin-top: 32px; }
.reassure-card { background: var(--blanc); border: 3px solid var(--noir); border-radius: var(--radius); padding: 24px; box-shadow: 0 5px 0 var(--noir); }
.reassure-card:nth-child(1) { background: var(--jaune); }
.reassure-card h3 { font-size: 1.12rem; margin-bottom: 10px; }
.reassure-card p { color: #46464F; font-size: 0.96rem; }
.reassure-card:nth-child(1) p { color: #3A3520; }
.reassure-card strong { color: var(--noir); }

.faq { max-width: 820px; margin: 0 auto; padding: 20px 24px 70px; }
.faq details { background: var(--blanc); border: 3px solid var(--noir); border-radius: 14px; margin-top: 12px; overflow: hidden; box-shadow: 0 4px 0 var(--noir); }
.faq details:first-of-type { margin-top: 32px; }
.faq summary { cursor: pointer; padding: 16px 54px 16px 20px; font-weight: 800; list-style: none; position: relative; font-family: var(--display); font-size: 1.03rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; border-radius: 50%; background: var(--jaune);
  border: 2px solid var(--noir); display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem; transition: transform 0.2s;
}
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { padding: 0 20px 18px; color: #46464F; font-size: 0.96rem; }

/* ============================ Studio et footer ============================ */
.studio { padding: 10px 24px 70px; }
.studio-inner {
  max-width: 780px; margin: 0 auto; text-align: center; background: var(--bleu);
  border: 3px solid var(--noir); border-radius: var(--radius); padding: 44px 32px;
  box-shadow: 0 6px 0 var(--noir); color: var(--blanc);
}
.studio-inner h2 { font-size: clamp(1.5rem, 3.2vw, 2rem); margin-bottom: 14px; }
.studio-inner p { max-width: 560px; margin: 0 auto 24px; opacity: 0.95; }
.studio-inner strong { color: var(--jaune); }
.studio-inner a.btn { color: var(--noir); }

.site-footer { text-align: center; padding: 34px 24px 46px; border-top: 3px solid var(--noir); color: var(--gris); font-size: 0.88rem; font-weight: 600; }
.site-footer p { margin-bottom: 8px; }
.footer-serie { opacity: 0.85; }
.footer-tag { opacity: 0.7; }

/* ============================ Modale ============================ */
.email-modal {
  /* margin auto explicite : le reset `* { margin: 0 }` écrase le centrage natif du dialog */
  margin: auto; position: relative;
  background: var(--blanc); color: var(--noir);
  border: 4px solid var(--noir); border-radius: var(--radius);
  padding: 34px 30px; max-width: 470px; width: calc(100vw - 40px);
  box-shadow: 0 8px 0 var(--noir);
}
.email-modal::backdrop { background: rgba(27, 27, 31, 0.55); }
.email-modal h3 { font-family: var(--display); font-size: 1.55rem; margin-bottom: 10px; }
.email-modal > p { color: #46464F; font-size: 0.95rem; margin-bottom: 18px; }
.email-modal input[type="email"] {
  width: 100%; padding: 13px 16px; border-radius: 10px; border: 2px solid var(--noir);
  background: var(--blanc); color: var(--noir); font-size: 1rem; margin-bottom: 13px;
  font-family: var(--corps); font-weight: 600;
}
.email-modal input[type="email"]:focus { outline: none; border-color: var(--bleu); }
.optin { display: flex; gap: 10px; font-size: 0.88rem; color: #46464F; cursor: pointer; margin-bottom: 12px; align-items: flex-start; font-weight: 600; }
.optin input { margin-top: 3px; flex-shrink: 0; }
.email-error { color: var(--rouge); font-size: 0.88rem; font-weight: 800; min-height: 1.2em; margin-bottom: 8px; }
#email-submit { width: 100%; }
.email-legal { margin-top: 13px; font-size: 0.76rem; color: var(--gris); text-align: center; }
.modal-close {
  position: absolute; top: 10px; right: 12px; background: var(--jaune);
  border: 2px solid var(--noir); border-radius: 50%; width: 30px; height: 30px;
  font-size: 0.95rem; cursor: pointer; font-weight: 800; line-height: 1;
}
.modal-close:hover { background: var(--jaune-clair); }

/* ============================ La bande, vivante ============================ */
/* Les yeux clignent, chacun à son rythme (variable --bd posée par mascotte.js).
   transform-box: fill-box est indispensable pour que l'origine soit le centre de l'œil. */
.pixou .oeil {
  transform-origin: center;
  transform-box: fill-box;
  animation: cligne 6s infinite;
  animation-delay: var(--bd, 0s);
}
@keyframes cligne {
  0%, 94%, 100% { transform: scaleY(1); }
  96.5% { transform: scaleY(0.08); }
}

/* petit saut de joie, joué en cascade quand toute la bande est prête */
.pixou.fete { animation: joie 0.62s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes joie {
  0% { transform: translateY(0) rotate(0); }
  35% { transform: translateY(-14px) rotate(-8deg); }
  65% { transform: translateY(-6px) rotate(6deg); }
  100% { transform: translateY(0) rotate(0); }
}

/* la mascotte du logo réagit au survol */
.logo:hover .pixou { animation: joie 0.62s cubic-bezier(0.34, 1.56, 0.64, 1); }
.res-card:hover .pixou { animation: joie 0.62s cubic-bezier(0.34, 1.56, 0.64, 1); }

/* ============================ Bananes (easter egg) ============================ */
#bananes { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
.banane { position: absolute; top: -60px; font-size: 34px; animation: tombe linear forwards; }
@keyframes tombe {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(112vh) rotate(var(--spin, 400deg)); opacity: 0.85; }
}

/* ============================ Responsive ============================ */
@media (max-width: 900px) {
  .work-grid { grid-template-columns: 1fr; }
  .how-grid { grid-template-columns: 1fr; }
  .reassure-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .site-header { flex-direction: column; gap: 12px; }
  .hero { padding-top: 40px; }
  .results-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .res-card { transition: none; }
  .bande-hero .pixou, .run-bande .pixou, .banane, .pixou .oeil, .pixou.fete { animation: none !important; }
}
