:root {
  --bg: #ffffff;
  --text: #1f2328;
  --muted: #57606a;
  --accent: #3b82d4;
  --ghost: #eef4fc;
  --shadow: rgba(31, 35, 40, .12);
  --weed: #b8a07a;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --text: #e6edf3;
    --muted: #8b949e;
    --accent: #58a6ff;
    --ghost: #e6edf3;
    --shadow: rgba(0, 0, 0, .45);
    --weed: #7d6c52;
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", system-ui, sans-serif;
  line-height: 1.6;
  text-align: center;
}
main { position: relative; z-index: 1; max-width: 32rem; }

/* Fantôme */
.ghost { width: clamp(7rem, 30vw, 10rem); height: auto; overflow: visible; }
.ghost-body { animation: float 3.6s ease-in-out infinite; }
.ghost-shadow {
  fill: var(--shadow);
  transform-box: fill-box;
  transform-origin: center;
  animation: shadow 3.6s ease-in-out infinite;
}
.ghost-shape { fill: var(--ghost); stroke: var(--accent); stroke-width: 3; stroke-linejoin: round; }
.eyes { animation: look 7s ease-in-out infinite; }
/* Les yeux suivent le pointeur (piloté par ghost.js) */
.ghost.tracking .eyes {
  animation: none;
  transform: translate(var(--ex, 0px), var(--ey, 0px));
  transition: transform .08s linear;
}
.eye {
  fill: #1f2328;
  transform-box: fill-box;
  transform-origin: center;
  animation: blink 5s infinite;
}
.cheek { fill: var(--accent); opacity: .25; }
.mouth { fill: none; stroke: #1f2328; stroke-width: 2.5; stroke-linecap: round; }

h1 { margin: 1.25rem 0 .5rem; font-size: 1.6rem; line-height: 1.2; }
p { margin: .5rem 0; color: var(--muted); }
.small { margin-top: 2rem; font-size: .8rem; }
a { color: var(--accent); }

/* Boule d'herbe sèche */
.weed-track {
  position: fixed;
  left: 0;
  bottom: 1.5rem;
  width: 100%;
  height: 3.5rem;
  pointer-events: none;
}
.weed-run { position: absolute; bottom: 0; left: 0; animation: run 16s linear infinite; animation-delay: 3s; transform: translateX(-6rem); }
.weed { width: 3.5rem; height: 3.5rem; animation: roll 16s linear infinite; animation-delay: 3s; }
.weed path, .weed circle { fill: none; stroke: var(--weed); stroke-width: 2; stroke-linecap: round; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
@keyframes shadow {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(.75); opacity: .6; }
}
@keyframes look {
  0%, 12%   { transform: translate(0, 0); }
  20%, 38%  { transform: translate(-6px, -1px); }
  46%, 60%  { transform: translate(6px, -1px); }
  70%, 100% { transform: translate(0, 0); }
}
@keyframes blink {
  0%, 92%, 100% { transform: scaleY(1); }
  96% { transform: scaleY(.1); }
}
@keyframes run {
  from { transform: translateX(-6rem); }
  to   { transform: translateX(calc(100vw + 6rem)); }
}
@keyframes roll {
  from { transform: rotate(0); }
  to   { transform: rotate(1440deg); }
}
@media (prefers-reduced-motion: reduce) {
  .ghost-body, .ghost-shadow, .eyes, .eye, .weed-run, .weed { animation: none; }
  .weed-track { display: none; }
}
