:root {
  --midnight: #111c2b;
  --deep-water: #080f1c;
  --blue-hour: #1e3045;
  --pearl: #e8e9df;
  --seed-gold: #dfb57e;
  color-scheme: dark;
  background: var(--midnight);
  color: var(--pearl);
  font-family: "STIX Two Math", "Cambria Math", Georgia, serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 16rem;
  min-height: 100svh;
  background:
    radial-gradient(ellipse at 52% 43%, var(--blue-hour) 0%, var(--midnight) 48%, var(--deep-water) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: url("/assets/grain.svg") repeat;
  opacity: 0.095;
}

main {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: max(1rem, env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(0.75rem, env(safe-area-inset-left));
  overflow: clip;
}

.equation {
  width: min(90vw, 72rem);
  margin: 0;
  transform: translateY(-1.5svh);
}

.equation__art {
  display: block;
  width: 100%;
  height: auto;
  /* A single, finite exposure; the composition then rests. */
  animation: develop 3.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@keyframes develop {
  from { opacity: 0; transform: translateY(0.5rem); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 40rem) {
  .equation { width: 104vw; }
}

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

@media (forced-colors: active) {
  body::before { display: none; }
  .equation__art { display: none; }
  .sr-only {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    clip-path: none;
    font-size: clamp(1.5rem, 7vw, 5rem);
  }
}
