:root {
  --bg: #0a0a0b;
  --ink: #e9e7e2;
  --dim: #6d6a65;
  --accent: #c9b48c;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem;
}

/* The equation is the page. */
h1.eq {
  margin: 0;
  font-weight: 400;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  /* Sit slightly above true centre — it reads as centred to the eye. */
  transform: translateY(-3vh);
}

h1.eq .katex { font-size: clamp(2.6rem, 11vw, 6.5rem); }

/* KaTeX puts display math in a full-width block; the grid already centres it. */
h1.eq .katex-display { margin: 0; }

footer {
  padding: 0 1.25rem 2.5rem;
  text-align: center;
  color: var(--dim);
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: lowercase;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

@media print {
  body { background: #fff; color: #000; }
  footer { color: #444; }
}
