:root {
  font-family: system-ui, sans-serif;
  color: #172033;
  background: #f4f7fb;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
}

main { width: min(92vw, 920px); padding: 48px 0; }
.intro { max-width: 700px; margin-bottom: 24px; }
.eyebrow { color: #5b45d6; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.12em; }
h1 { margin: 0; font-size: clamp(2rem, 5vw, 3.4rem); }
.equation, code { font-family: ui-monospace, monospace; font-weight: 700; }

.controls { display: flex; gap: 10px; align-items: center; width: min(100%, 720px); }
.controls label { font-family: ui-monospace, monospace; font-size: 1.25rem; font-weight: 800; }
.controls input {
  min-width: 0;
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #bfc9dc;
  border-radius: 8px;
  font: 1rem ui-monospace, monospace;
}
button { padding: 10px 14px; border: 0; border-radius: 8px; background: #5b45d6; color: white; font-weight: 750; cursor: pointer; }
button.secondary { background: #e5eaf3; color: #334155; }
.hint, .message { min-height: 1.4em; margin: 10px 0 16px; color: #56647b; }
.message.error { color: #b42318; font-weight: 650; }

canvas {
  display: block;
  width: min(100%, 720px);
  height: auto;
  background: white;
  border: 1px solid #d8e0ee;
  border-radius: 14px;
  box-shadow: 0 12px 32px #1720331a;
  cursor: crosshair;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

canvas.panning { cursor: grabbing; }

@media (max-width: 560px) {
  .controls { flex-wrap: wrap; }
  .controls input { min-width: 180px; }
}
