:root {
  color-scheme: dark;
  --ink: #101c2a;
  --deep: #0a131d;
  --paper: #e7f0f0;
  --muted: #98afb5;
  --mint: #8fd3c7;
  --coral: #f07867;
  --rule: #2b4352;
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  background: var(--deep);
  color: var(--paper);
}

* { box-sizing: border-box; }
html { min-width: 20rem; background: var(--deep); }
body { margin: 0; min-height: 100vh; background: var(--ink); }
::selection { color: var(--deep); background: var(--mint); }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4.5rem;
  padding: 0 clamp(1.25rem, 4vw, 4.5rem);
  border-bottom: 1px solid var(--rule);
}

.brand { color: var(--paper); font-weight: 750; letter-spacing: -0.02em; text-decoration: none; }
.header-meta { display: flex; align-items: center; gap: 1.25rem; font-size: 0.875rem; }
.experiment { color: var(--mint); font-size: 0.875rem; }
.header-meta a { color: var(--paper); text-underline-offset: 0.35em; }
.header-meta a:hover { color: var(--mint); }

main {
  width: min(54rem, 100%);
  margin: 0 auto;
  padding: clamp(1.25rem, 4vw, 2.5rem);
}

.runner { overflow: hidden; border: 1px solid var(--rule); background: var(--deep); }
.canvas-frame { position: relative; width: 100%; aspect-ratio: 1; background: var(--deep); }
canvas { display: block; width: 100%; height: 100%; outline: 0; }
canvas:focus-visible { box-shadow: inset 0 0 0 3px var(--coral); }
.loading { position: absolute; inset: 0; display: grid; place-content: center; gap: 1rem; color: var(--muted); text-align: center; }
.loading[hidden] { display: none; }
.loading span { width: 1.6rem; height: 1.6rem; margin: auto; border: 2px solid var(--rule); border-top-color: var(--mint); border-radius: 50%; animation: spin 0.8s linear infinite; }

.proof-bar { display: flex; justify-content: space-between; gap: 1rem; padding: 1rem 1.2rem; border-top: 1px solid var(--rule); color: var(--muted); font: 0.875rem/1.5 "SFMono-Regular", Consolas, monospace; }
.proof-bar p { margin: 0; }
#status[data-love-ready="true"] { color: var(--mint); }
.error { color: var(--coral) !important; }

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 720px) {
  .site-header { min-height: 4rem; }
  .header-meta { gap: 0.75rem; }
  .proof-bar { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .loading span { animation: none; }
}
