:root {
  color-scheme: dark;
}

* {
  box-sizing: border-box;
  margin: 0;
}

html,
body {
  overflow-x: hidden;
  background: #050505;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.view {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: pan-y;
}

/* The live page laid over the top sheet, in the same 3D space as the scene. */
.paper-layer {
  position: fixed !important;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.sheet-page {
  position: relative;
  width: 1240px;
  height: 1754px;
  /* Slightly translucent ink, so the light and shadow on the sheet show through it. */
  color: rgba(22, 20, 16, 0.88);
  font-family: Charter, "Iowan Old Style", Georgia, serif;
  line-height: 1;
  cursor: default;
  -webkit-user-select: text;
  user-select: text;
}

.sheet-ink,
.sheet-ink > *,
.sheet-test > * {
  position: absolute;
  margin: 0;
}

.sheet-ink {
  inset: 0;
}

/* The text cursor only over text itself; every piece of text is its own shrink-wrapped element. */
.sheet-page :is(p, h2, span) {
  cursor: text;
}

.sheet-ink ::selection {
  background: rgba(70, 120, 220, 0.3);
}

.sheet-head,
.sheet-foot {
  right: 70px;
  display: flex;
  justify-content: space-between;
  color: rgba(40, 38, 33, 0.7);
  font: 26px/1.2 "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.sheet-title {
  font-weight: 400;
  line-height: 1.1;
  white-space: nowrap;
}

.sheet-rule {
  width: 980px;
  height: 4px;
  background: currentColor;
}

.sheet-line {
  width: 980px;
  height: 2px;
  background: rgba(60, 50, 30, 0.16);
}

.sheet-label,
.sheet-kicker {
  color: rgba(40, 38, 33, 0.72);
  font-size: 58px;
  line-height: 1.2;
}

.sheet-kicker {
  font-size: 56px;
}

.sheet-body {
  font-size: 40px;
  line-height: 1.2;
  white-space: nowrap;
}

.sheet-link {
  color: inherit;
  line-height: 1.2;
  white-space: nowrap;
  /* The underline is a stripe placed by the script, so it matches the printed image. */
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  cursor: pointer;
}

.sheet-link:hover {
  color: rgba(0, 0, 0, 0.95);
}

.sheet-test {
  position: absolute;
  inset: 0;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.sheet-test-title {
  font-size: 62px;
  font-weight: 700;
  line-height: 1.2;
}

.sheet-test-sub {
  color: #57554f;
  font-size: 30px;
  line-height: 1.2;
}

.sheet-test-label {
  color: #57554f;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.2;
}

/* On the live page only the text is drawn; rules and colour stay in the lit 3D sheet beneath. */
.sheet-page.live :is(.sheet-rule, .sheet-line) {
  background: none !important;
  border-color: transparent !important;
}

/* The browser draws small text crisper, so darker, than the same text in the 3D sheet; lighten it to match. */
.sheet-page.live :is(.sheet-head, .sheet-foot) {
  color: rgba(40, 38, 33, 0.52);
}

.sheet-page.live :is(.sheet-label, .sheet-kicker) {
  color: rgba(40, 38, 33, 0.6);
}

/* Pages are laid out here, out of sight, to be measured and painted. */
.page-measure {
  position: fixed;
  top: 0;
  left: 0;
  visibility: hidden;
  pointer-events: none;
}

.baseline-probe {
  display: inline-block;
  width: 0;
  height: 0;
  vertical-align: baseline;
}

/* Scrolling through this space moves the camera down onto the pages. */
.scroll-space {
  height: 260vh;
}

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

/* Shown only if WebGL is unavailable. */
.fallback {
  display: none;
}

.no-webgl .fallback {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  color: #f4efe6;
  font-size: 20px;
}

.no-webgl .fallback a {
  color: inherit;
}
