* { margin: 0; }

body {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  height: 100vh;
  height: 100dvh;
  background: #0e1018;
  color: #f3f4f8;
  font: 16px/1.4 "Inter", Arial, sans-serif;
}

[hidden] { display: none !important; }

.viewport {
  position: relative;
  overflow: hidden;
}

.canvas {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1920px;
  height: 1080px;
  transform: translate(-50%, -50%) scale(var(--scale, 0));
}

.canvas > section {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
  isolation: isolate;
}

:where(.canvas) section * { position: relative; }

:where(.canvas) h1 { font-size: 96px; font-weight: 600; }
:where(.canvas) h2 { font-size: 64px; font-weight: 600; }
:where(.canvas) h3 { font-size: 44px; font-weight: 600; }

.canvas :is(p, li, h1, h2, h3, td, th) {
  overflow-wrap: break-word;
  text-wrap: pretty;
}

nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px 12px max(8px, env(safe-area-inset-bottom));
}

nav output { min-width: 56px; text-align: center; font-variant-numeric: tabular-nums; }

nav button {
  width: 44px;
  height: 44px;
  border: 1px solid #565b6e;
  border-radius: 8px;
  background: #1b1e2b;
  color: inherit;
  font: 23px/1 "Inter", Arial, sans-serif;
  cursor: pointer;
}

nav button:hover:not(:disabled) { background: #272b3a; }
nav button:focus-visible { outline: 2px solid #8fb0ff; outline-offset: 2px; }
nav button:disabled { opacity: 0.45; cursor: default; }

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