/* bob-yt.com : une feuille blanche, des feutres, un enfant de 5 ans très appliqué.
   Les traits « à la main » viennent de trois astuces : coins irréguliers (border-radius à 8 valeurs), légères rotations,
   et le filtre SVG #crayon (turbulence) sur les dessins. Tout reste du vrai texte et de vrais liens. */
@font-face { font-family: 'Schoolbell'; src: url('/static/fonts/Schoolbell.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Patrick Hand'; src: url('/static/fonts/Patrick-Hand.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Caveat Brush'; src: url('/static/fonts/Caveat-Brush.woff2') format('woff2'); font-display: swap; }

:root {
  --paper: #ffffff;
  --ink: #2a2a2e;
  --ink-soft: #55555c;
  --pencil: #8a8a92;
  --red: #e8463a;
  --blue: #2b7bd8;
  --yellow: #ffd43b;
  --orange: #f2a516;
  --green: #2f9e44;
  --violet: #7c4dcc;
  --pink: #d6336c;
  --wobble: 255px 15px 225px 15px / 15px 225px 15px 255px;
  --wobble-2: 15px 255px 15px 225px / 225px 15px 255px 15px;
  --hand: 'Patrick Hand', 'Comic Sans MS', 'Chalkboard SE', cursive;
  --kid: 'Schoolbell', 'Comic Sans MS', 'Chalkboard SE', cursive;
  --brush: 'Caveat Brush', 'Schoolbell', cursive;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 21px/1.45 var(--hand);
  overflow-x: hidden;
}
a { color: var(--blue); text-decoration-thickness: 2px; text-underline-offset: 4px; }
a:hover { text-decoration-style: wavy; }
:focus-visible { outline: 3px dashed var(--blue); outline-offset: 4px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sheet { max-width: 1060px; margin: 0 auto; padding: 18px 20px 60px; position: relative; overflow-x: clip; }

/* En-tête */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 19px; }
.top .mini { font: 34px/1 var(--brush); color: var(--ink); text-decoration: none; transform: rotate(-4deg); display: inline-block; }
.top nav { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.top nav a { color: var(--ink); }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; cursor: pointer; }

/* Le grand dessin d'accueil */
.hero { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 8px 24px; align-items: center; padding: 26px 0 10px; }
.hero h1 { margin: 0; font: 400 clamp(84px, 17vw, 168px)/.9 var(--brush); letter-spacing: 2px; }
.hero h1 span { display: inline-block; }
.hero h1 span:nth-child(1) { color: var(--red); transform: rotate(-7deg) translateY(4px); }
.hero h1 span:nth-child(2) { color: var(--blue); transform: rotate(5deg) translateY(-6px); }
.hero h1 span:nth-child(3) { color: var(--green); transform: rotate(-3deg) translateY(6px); }
.hero h1 small { font: 400 .26em var(--kid); color: var(--ink-soft); margin-left: 10px; vertical-align: middle; }
.hero .lead { font: 30px/1.3 var(--kid); margin: 14px 0 6px; max-width: 34ch; transform: rotate(-1deg); }
.hero .lead s { text-decoration: none; position: relative; color: var(--ink-soft); }
.hero .lead s::after { content: ''; position: absolute; left: -4px; right: -4px; top: 52%; height: 4px; background: var(--red); border-radius: 4px; transform: rotate(-4deg); }
.hero .sub { margin: 0 0 18px; color: var(--ink-soft); max-width: 40ch; }
.hero .art { position: relative; width: 260px; height: 250px; }
.hero .grass { position: absolute; left: -10px; right: -20px; bottom: -14px; width: 290px; height: 30px; color: var(--green); filter: url(#crayon); }
.hero .flower { position: absolute; right: 18px; bottom: -6px; width: 44px; height: 70px; filter: url(#crayon); }
.sprinkle { position: absolute; width: 30px; height: 30px; pointer-events: none; filter: url(#crayon); }
.sprinkle.s1 { left: 46%; top: 38px; transform: rotate(-12deg); }
.sprinkle.s2 { right: 4px; top: 520px; width: 26px; transform: rotate(20deg); }
.sprinkle.s3 { left: -6px; top: 980px; width: 24px; transform: rotate(8deg); }
.hero .sun { position: absolute; right: -6px; top: -14px; width: 96px; height: 96px; animation: spin 40s linear infinite; }
.hero .bob { position: absolute; left: 34px; bottom: -6px; width: 130px; height: 174px; }
.hero .bob .wave { transform-origin: 60px 70px; }
.hero .cloud { position: absolute; left: -30px; top: 6px; width: 86px; }
.hero .bubble { position: absolute; left: -64px; top: 70px; font: 22px/1.1 var(--kid); background: #fff; border: 3px solid var(--ink); border-radius: var(--wobble); padding: 6px 12px; transform: rotate(-6deg); }
.cta-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.cta-row .arrow { width: 80px; height: 54px; color: var(--ink); transform: rotate(-12deg) translateY(-14px); }

/* Boutons et cadres faits au feutre */
.btn {
  --fill: var(--yellow);
  display: inline-block; position: relative; cursor: pointer;
  font: 28px/1.1 var(--kid); color: var(--ink); text-decoration: none;
  padding: 14px 26px 12px; border: 3px solid var(--ink); border-radius: var(--wobble);
  background: transparent; transform: rotate(-1.5deg); transition: transform .15s;
  isolation: isolate;
}
/* Coloriage qui dépasse un peu, en zigzag de feutre */
.btn::before {
  content: ''; position: absolute; inset: 4px -6px 2px 6px; z-index: -1; border-radius: var(--wobble-2);
  background:
    repeating-linear-gradient(-58deg, var(--fill) 0 7px, transparent 7px 10px);
  opacity: .95;
}
.btn:hover { transform: rotate(1deg) scale(1.03); text-decoration: none; }
.btn:active { transform: rotate(0) scale(.98); }
.btn.small { font-size: 22px; padding: 9px 18px 8px; }
.btn.blue { --fill: #a5d8ff; }
.btn.green { --fill: #b2f2bb; }
.btn.pink { --fill: #ffc9de; }
.btn[disabled] { opacity: .5; cursor: wait; }

.box { border: 3px solid var(--ink); border-radius: var(--wobble); padding: 20px 22px; background: #fff; }

/* Titres de section soulignés au feutre */
.scribble { font: 400 44px/1.1 var(--kid); margin: 54px 0 22px; display: inline-block; position: relative; transform: rotate(-1.5deg); }
.scribble::after {
  content: ''; position: absolute; left: -6px; right: -10px; bottom: -8px; height: 12px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'%3E%3Cpath d='M2 8 C40 2 80 11 120 5 S180 3 198 7' fill='none' stroke='%23ffd43b' stroke-width='6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
  z-index: -1;
}

/* Les outils, chacun dans son cadre de travers */
.tools { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 30px 28px; }
.tool { position: relative; }
.tool a.card {
  display: grid; grid-template-columns: 64px 1fr; gap: 6px 16px; align-items: start; height: 100%;
  color: var(--ink); text-decoration: none; padding: 18px 20px 16px;
  border: 3px solid var(--ink); border-radius: var(--wobble); background: #fff;
  transition: transform .18s;
}
.tool:nth-child(odd) a.card { transform: rotate(-1.2deg); }
.tool:nth-child(even) a.card { transform: rotate(1deg); border-radius: var(--wobble-2); }
.tool:nth-child(3n) a.card { transform: rotate(-.4deg); }
.tool a.card:hover { transform: rotate(0) translateY(-3px); box-shadow: 6px 7px 0 -1px var(--tint, #ddd); }
.tool .doodle { grid-row: span 2; width: 64px; height: 64px; filter: url(#crayon); }
.tool h3 { margin: 2px 0 0; font: 400 31px/1.05 var(--kid); }
.tool p { margin: 0; font-size: 20px; color: var(--ink-soft); line-height: 1.3; }
.tool .go { grid-column: 2; margin-top: 8px; font: 22px var(--kid); color: var(--tint); }
.tool .go::after { content: ' →'; }
.tool .have { position: absolute; right: -10px; top: -14px; font: 18px var(--kid); background: #fff; border: 2px solid var(--green); color: var(--green); padding: 1px 10px; border-radius: var(--wobble-2); transform: rotate(8deg); }
.mcp { margin: 34px 0 0; display: flex; gap: 12px; align-items: center; font: 24px/1.3 var(--kid); color: var(--ink-soft); transform: rotate(-.6deg); flex-wrap: wrap; }
.mcp .star { width: 34px; height: 34px; flex: none; }

/* Comment ça marche */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 22px; }
.steps li { display: flex; gap: 14px; align-items: flex-start; font-size: 22px; }
.steps .n { flex: none; width: 52px; height: 52px; display: grid; place-items: center; font: 32px var(--kid); border: 3px solid var(--ink); border-radius: 50% 46% 52% 44% / 48% 54% 46% 52%; }
.steps li:nth-child(1) .n { background: #ffe3e0; transform: rotate(-8deg); }
.steps li:nth-child(2) .n { background: #dbeafe; transform: rotate(6deg); }
.steps li:nth-child(3) .n { background: #d3f9d8; transform: rotate(-4deg); }

/* Inscription */
.signup { display: grid; grid-template-columns: 1.1fr 1fr; gap: 36px; align-items: start; }
.signup .pitch h2 { font: 400 42px/1.1 var(--kid); margin: 0 0 10px; transform: rotate(-1deg); }
.signup .pitch p { margin: 0 0 10px; color: var(--ink-soft); }
.signup .pitch ul { margin: 6px 0 0; padding-left: 0; list-style: none; }
.signup .pitch li::before { content: '✓ '; color: var(--green); font-weight: bold; }
form.paper { display: grid; gap: 14px; transform: rotate(.6deg); }
form.paper h3 { margin: 0; font: 400 32px/1.1 var(--kid); }
label.f { display: grid; gap: 4px; font-size: 20px; }
input.f {
  font: 22px var(--hand); color: var(--ink); padding: 10px 14px; width: 100%;
  border: 0; border-bottom: 3px solid var(--ink); border-radius: 2px 18px 4px 14px / 14px 3px 18px 4px; background: #fbfbf9;
}
input.f:focus { outline: none; background: #fff9db; border-bottom-color: var(--blue); }
.msg { min-height: 1.4em; font-size: 20px; }
.msg.err { color: var(--red); }
.msg.ok { color: var(--green); }
.alt { font-size: 19px; color: var(--ink-soft); display: flex; gap: 14px; flex-wrap: wrap; }

/* Mon compte */
.banner { margin: 18px 0; padding: 14px 18px; border: 3px dashed var(--orange); border-radius: var(--wobble-2); background: #fff9db; transform: rotate(-.5deg); }
.mine { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.mine li { display: grid; grid-template-columns: 48px 1fr auto; gap: 14px; align-items: center; padding: 10px 14px; border-bottom: 2px dashed #ccc; }
.mine .doodle { width: 48px; height: 48px; filter: url(#crayon); }
.mine b { font: 400 26px var(--kid); }
.mine .state { font-size: 18px; color: var(--ink-soft); display: block; }

footer.foot { margin-top: 70px; padding-top: 18px; border-top: 3px solid var(--ink); border-radius: 0 0 40% 60% / 0 0 6px 10px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 18px; color: var(--ink-soft); }
footer.foot .heart { width: 22px; height: 22px; vertical-align: -4px; }

/* Admin : même papier, mais lisible d'abord */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 18px; margin: 10px 0 8px; }
.kpi { border: 3px solid var(--ink); border-radius: var(--wobble); padding: 12px 16px; }
.kpi:nth-child(even) { border-radius: var(--wobble-2); }
.kpi .v { font: 44px/1 var(--kid); }
.kpi .l { font-size: 18px; color: var(--ink-soft); }
.kpi .d { font-size: 16px; color: var(--pencil); }
table.t { width: 100%; border-collapse: collapse; font-size: 18px; }
table.t th { text-align: left; font: 400 20px var(--kid); border-bottom: 3px solid var(--ink); padding: 6px 8px; white-space: nowrap; }
table.t td { border-bottom: 1px dashed #bbb; padding: 6px 8px; vertical-align: top; }
table.t td.n, table.t th.n { text-align: right; font-variant-numeric: tabular-nums; }
.scroll { overflow-x: auto; }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.yes { color: var(--green); font-weight: bold; }
.no { color: #c8c8cc; }
.muted { color: var(--pencil); font-size: 16px; }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 26px; }
.chart h4 { margin: 0 0 6px; font: 400 24px var(--kid); }
.chart svg { width: 100%; height: 150px; overflow: visible; }
.chart .bar { fill: var(--blue); }
.chart .bar.c { fill: var(--orange); }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .hit:hover + .bar, .chart .bar.on { opacity: .7; }
.chart .axis { stroke: var(--ink); stroke-width: 2; }
.chart text { font: 14px var(--hand); fill: var(--ink-soft); }
.tip { position: fixed; pointer-events: none; background: #fff; border: 2px solid var(--ink); border-radius: var(--wobble-2); padding: 4px 10px; font-size: 17px; display: none; z-index: 10; }
input.search { font: 20px var(--hand); padding: 6px 12px; border: 2px solid var(--ink); border-radius: var(--wobble-2); width: min(340px, 100%); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes wiggle { 0%, 100% { transform: rotate(-1.5deg); } 50% { transform: rotate(1.5deg); } }
.wiggle { animation: wiggle 1.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .hero .sun, .wiggle { animation: none; } .btn, .tool a.card { transition: none; } }

@media (max-width: 760px) {
  body { font-size: 19px; }
  .hero { grid-template-columns: 1fr; }
  .hero .art { width: 200px; height: 200px; margin: 0 auto -10px; order: -1; }
  .hero .bubble { left: -50px; }
  .hero .lead { font-size: 25px; }
  .signup { grid-template-columns: 1fr; }
  .scribble { font-size: 36px; margin-top: 44px; }
  .tools { grid-template-columns: 1fr; }
  .cta-row .arrow { display: none; }
  .btn { font-size: 25px; }
}
